[FFmpeg-devel] [PATCH] NellyMoser audio decoder v2
Benjamin Larsson
banan
Sat Oct 13 15:18:04 CEST 2007
Michael Niedermayer wrote:
> Hi
>
> On Sun, Oct 07, 2007 at 08:16:05PM +0200, Benjamin Larsson wrote:
>> Latest version of the patch. Is it ok to commit now ?
>
> more comments
>
> [...]
>> + shift = 0;
>> + diff = bitsum - NELLY_DETAIL_BITS;
>> +
>> + while (FFABS(diff) <= 16383) {
>> + shift++;
>> + diff *= 2;
>> + }
>
> for(shift=0; FFABS(diff) <= 16383; shift++)
> diff *= 2;
Fixed.
>
> also is the FFABS needed here? or is does diff / -diff work?
It's needed.
>
>
>> +
>> + diff = (diff * NELLY_BASE_OFF) >> 15;
>> + shift = shift_saved-(NELLY_BASE_SHIFT+shift-15);
>> +
>> + diff = signed_shift(diff, shift);
>> +
>> + for (j = 1; j < 20; j++) {
>> + tmp = off;
>
> s/tmp/last_off/
Fixed.
>
>
>> + off += diff;
>> + last_bitsum = bitsum;
>> +
>> + bitsum = sum_bits(sbuf, shift_saved, off);
>> +
>> + if ((bitsum-NELLY_DETAIL_BITS) * (last_bitsum-NELLY_DETAIL_BITS) <= 0)
>> + break;
>> + }
>> +
>> + if (bitsum != NELLY_DETAIL_BITS) {
>
> this if() is superflous
Fixed.
>
>
>> + if (bitsum > NELLY_DETAIL_BITS) {
>> + big_off = off;
>> + off = tmp;
>> + big_bitsum=bitsum;
>> + small_bitsum=last_bitsum;
>> + } else {
>> + big_off = tmp;
>> + big_bitsum=last_bitsum;
>> + small_bitsum=bitsum;
>> + }
>> +
>
>> + while (bitsum != NELLY_DETAIL_BITS && j <= 19) {
>> + diff = (big_off+off)>>1;
>
> s/off/small_off/
> s/diff/off/
> that is change the names of the variables here not the actual code
>
>
Fixed I think.
MvH
Benjamin Larsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nellymoserdec.c
Type: text/x-csrc
Size: 15006 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071013/2ddb563f/attachment.c>
More information about the ffmpeg-devel
mailing list