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

Robert Swain robert.swain
Thu Sep 11 03:22:51 CEST 2008


2008/9/11 Michael Niedermayer <michaelni at gmx.at>:
> 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);

Applied.

Regards,
Rob




More information about the ffmpeg-devel mailing list