[FFmpeg-devel] [PATCH] NellyMoser audio decoder v2

Michael Niedermayer michaelni
Wed Oct 10 13:13:06 CEST 2007


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;

also is the FFABS needed here? or is does diff / -diff work?


> +
> +        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/


> +            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


> +            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


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071010/6c90f4a4/attachment.pgp>



More information about the ffmpeg-devel mailing list