[FFmpeg-devel] [PATCH] MLP Encoder

Ramiro Polla ramiro.polla
Thu Aug 21 21:44:27 CEST 2008


On Thu, Aug 21, 2008 at 10:47 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Thu, Aug 21, 2008 at 01:13:32AM -0300, Ramiro Polla wrote:
>> >> /** Applies the filter to the current samples, and saves the residual back
>> >>  *  into the samples buffer. If the filter is too bad and overflows the
>> >>  *  maximum amount of bits allowed (24), the samples buffer is left as is and
>> >>  *  the function returns -1.
>> >>  */
>> >
>> > i do not belive overflow is possible
>> > without checking the code too carefull i suspect you got the wrap around wrong
>> > somewhere
>> > remember (a+b) & MASK = c & MASKis the same as a & MASK = (c-b) & MASK
>>
>> I got a sample from Justin that overflows at this point. I don't see
>> how masking could help, since the mask only clears LSBs. And I don't
>> see how it could wrap around (it shouldn't).
>
> hmm, if so mlp is poorly designed, anyway where does the limit of 24 bits come
> from? In the decoder i see a huff_lsbs that is read as get_bits(5) so it
> should be able to reach 31 ...

If the raw samples can be encoded with 24-bit, is it not a good idea
to drop any filter that takes more then this? (remember the codebooks
aren't really good and just save a few bytes).




More information about the ffmpeg-devel mailing list