I’m suffering with this problem for a few days now. How can you build a tree with the data as specified on the following site:
http://www.impulseadventure.com/photo/jpeg-huffman-coding.html, under the topic:
The actual DHT in the JPEG file
I’ll reexplain it shortly here so,
You have :
- a table with lengths (bytesvector)
- a table with data (bytesvector as well)
Now I want to build a binary tree with these two arguments. Filled everytime from left to right with the data for the corresponding length. The deeper you go into the tree the longer your lengths. Lengths vary from 1 – 16. Take a look at the site and it should become clear.
Now I want to make such a tree in Scheme/Racket so I can walk to the tree and build a table for each encoded value.
The tree I have in my mind would look like:
'((x01 x02)((x03 (x11 x04))(((x00 ...)(...)))))
1 Answer