Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: JFIF - huffman compression



I think the answer is that if those codes existed in your table
there *would* be room for them. But they don't!

The jpeg huffman table describes an (almost) fully filled in
Huffman tree (seems the all 1's value is not used). So there won't
be gaps for you to insert extra codes.

Try drawing the actual tree for a couple of your examples
and it should all come clear.

(From a non-expert who just happens to be working on the
same thing)


"Adam Wnęk" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> I try to write my own JFIF decoder.
>
> I have a troubles with huffman coding. I read that the huffman codes are
gen
> erated in that way:
>
> For length 1 we have nr_codes[1]=0, we skip this length
>          For length 2 we have 2 codes  00
>                                        01
>          For length 3 we have 3 codes  100
>                                        101
>                                        110
>          For length  4 we have 1 code  1110
>          For length  5 we have 1 code  11110
>          For length  6 we have 1 code  111110
>          For length  7 we have 0 codes  -- skip
>  (if we had 1 code for length 7,
>           we would have                1111110)
>          For length  8 we have 1 code  11111100 (You see that the code is
st
> ill
>                                                  shifted to left though we
s
> kipped
>                                                  the code value for 7)
>          .....
>          For length 16, .... (the same thing)
>
> But, if I have 3 (for example) codes with length 5, How it be describe ?
111
> 10, 11111, ???
>
> Please help me.
>
> Thanks.
>
> Ps. Sorry for lame question
>
>





<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.