[FFmpeg-devel] [PATCH] Fix CCE decoding and cleanup

Robert Swain robert.swain
Tue Sep 23 13:47:07 CEST 2008


2008/9/18 Alex Converse <alex.converse at gmail.com>:
> On Thu, Sep 18, 2008 at 5:45 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>>
>> On Thu, Sep 18, 2008 at 05:19:39PM -0400, Alex Converse wrote:
>> > Hi,
>> >
>> > The first patch fixes CCE decoding. The second patch cleans up some CCE
>> > related documentation and variable names.
>>
>> [...]
>>
>> > @@ -1001,12 +1001,13 @@
>> >                          int t = get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
>> >                          if (t) {
>> >                              int s = 1;
>> > +                            int g;
>> > +                            g = gain += t;
>> >                              if (sign) {
>> > -                                s  -= 2 * (t & 0x1);
>> > -                                t >>= 1;
>> > +                                s  -= 2 * (g & 0x1);
>> > +                                g >>= 1;
>> >                              }
>> > -                            gain += t;
>> > -                            gain_cache = pow(scale, gain) * s;
>> > +                            gain_cache = pow(scale, -g) * s;
>> >                          }
>> >                      }
>>
>>    int t = get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
>>    if (t) {
>>        int s = 1;
>>        t = (gain += t);
>>        if (sign) {
>>            s  -= 2 * (t & 1);
>>            t >>= 1;
>>        }
>>        gain_cache = pow(scale, -t) * s;
>>    }
>> }
>
> Fixed.

I'm not sure if they're needed but you omitted the parentheses around
'gain += t' in your fixed patch. The cosmetics look fine but I'll sit
on them until we receive a response or we give up waiting and just
match the reference implementation. :)

For people following this thread, we're waiting for some clarification
from the mp4-tech mailing list regarding the difference in sign
between the reference implementation and the specification.

http://lists.mpegif.org/pipermail/mp4-tech/2008-September/008371.html

Regards,
Rob




More information about the ffmpeg-devel mailing list