[FFmpeg-devel] [PATCH] Mimic decoder

Ramiro Polla ramiro
Mon Mar 17 19:07:49 CET 2008


Hello,

Michael Niedermayer wrote:
> On Sun, Mar 16, 2008 at 04:26:55PM -0300, Ramiro Polla wrote:
>> Hello Michael,
>>
>> Michael Niedermayer wrote:
>>> On Sat, Mar 15, 2008 at 11:48:00PM -0300, Ramiro Polla wrote:
>>> [...]
>>>>     int8_t vlcdec_lookup[8][128];
>>> int8_t vlcdec_lookup[9][64]
>>>
>>> is large enough
>> The maximum num_bits is 7, so the largest value is 127.
>>
>> vlcdec_lookup[7] has 128 symbols. That way, it'd have to read 
>> vlcdec_lookup[8][64] as vlcdec_lookup[7][128], which I don't think is a 
>> good idea.
> 
> There is no [8][64] or [7][128]
> There is a [7][127] though
> My suggestion safes almost 50% memory and it also should be faster due to
> better use of the cache.

Done.

According to the nice folks at ##c at freenode.net, the memory for the 
array must be contiguous and unpadded, something I wasn't aware of. Just 
out of curiosity, can some C99 expert point me out where that's written 
on the spec?

Ramiro Polla




More information about the ffmpeg-devel mailing list