[theora-dev] Bitstream encoded huffman tables always the same

Gabriel TEIXEIRA gabriel_teixeira at sdesigns.eu
Fri Dec 10 07:51:56 PST 2010


Hello all,

I've been working a little inside the Theora decoder when I found that 
it seems that many videos had the very same huffman tables encoded into 
their bitstreams (at least the ones that I could take my time to 
dissecate). I found that the tables are listed as TH_VP31_HUFF_CODES in 
the file huffenc.c. I tried to investigate a little bit more to see who 
was setting the bitstream to those tables, but I ended in the fact that 
this is dependent whether the function th_encode_ctl is called with 
TH_ENCCTL_SET_HUFFMAN_CODES or TH_ENCCTL_SET_VP3_COMPATIBLE, but I could 
figure myself who is calling it using what parameter. Is that true that 
libtheora will always set the huffman codes to the same ones? Isn't this 
approach a little bit inefficient since the distribution of the 
probabilities of the symbols is not always the ones in the 80 tables 
(although the tables may be very good, there's always some room for 
increased precision), and besides we spend around 1-2kb to stock them, 
instead of having them preencoded in the decoder (of course, this would 
break the compatibility)?

Thanks in advance
Gabriel TEIXEIRA


More information about the theora-dev mailing list