[x264-devel] Re: x264 Decoder

Loren Merritt lorenm at u.washington.edu
Tue Jul 12 17:40:21 CEST 2005


On Tue, 12 Jul 2005, Stephen Henry wrote:

> The decoder software contains "x264_vlc_table_loop_new" functions that
> are used to derive VLC look up tables. I don't understand what these
> are used for and when they are called in the program they crash. It
> appears to me that similar functionality is already contained within
> common/vlc.h.
>
> Given the fact that the decoder doesn't have prior knowledge of the
> length of codeword to read from the bitstream, whereas the encoder
> does know the length to write, is it really necessary to have two
> seperate implementations for the encoder and the decoder? If this is
> so, would I be right in thinking that the decoder's code simply reads
> one bit at a time and then compares it against all possible codewords
> with a matching bit; continuing until a valid codeword has been found?
> Or, is there a more efficient mechanism for doing this?

The efficient way is: read some fixed amount (e.g. 8 bits). Lookup which 
codeword it starts with. If the codeword is shorter than you read, put the 
rest of the bits back, else read some more. (Note that "put back" doesn't 
cost any computation, you just change the amount to increment the 
bitstream pointer.)

--Loren Merritt

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list