[FFmpeg-devel] [PATCH] [Issue 632] AAC pulse data is applied incorrectly

Alex Converse alex.converse
Thu Sep 11 02:50:33 CEST 2008


On Wed, Sep 10, 2008 at 8:36 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Sep 10, 2008 at 08:16:22PM -0400, Alex Converse wrote:
>> Hi all,
>>
>> This patch is pretty straight forward if you look at the relevant
>> section if 14496-3. Basically the pulse data should be applied to
>> match the sign of the underlying spectral coefficient (counting zero
>> as negative). While requantizing the spectral coefficient we must be
>> sure to not divide by zero.
>>
>> Note: This does not fix all the problems with the stream in Issue 632;
>> there is still some bitstream decoding issue and possibly a TNS issue.
>>
>> Regards,
>> Alex Converse
>
>> Index: libavcodec/aac.c
>> ===================================================================
>> --- libavcodec/aac.c  (revision 15290)
>> +++ libavcodec/aac.c  (working copy)
>> @@ -753,7 +753,14 @@
>>      if (pulse_present) {
>>          for(i = 0; i < pulse->num_pulse; i++){
>>              float co  = coef_base[ pulse->pos[i] ];
>> -            float ico = co / sqrtf(sqrtf(fabsf(co))) + pulse->amp[i];
>> +            float ico;
>> +            if (co == 0) {
>> +                ico = -pulse->amp[i];
>> +            } else if (co > 0) {
>> +                ico = co / sqrtf(sqrtf(fabsf(co))) + pulse->amp[i];
>> +            } else {
>> +                ico = co / sqrtf(sqrtf(fabsf(co))) - pulse->amp[i];
>> +            }
>
> ico= -pulse->amp[i];
> if(co)
>    ico= co / sqrtf(sqrtf(fabsf(co))) + (co>0 ? -ico : ico);
>

Yeah, that makes more sense.

--Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aac-pulse-data-v2.diff
Type: text/x-diff
Size: 607 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080910/7297f66c/attachment.diff>



More information about the ffmpeg-devel mailing list