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

Michael Niedermayer michaelni
Thu Sep 11 02:36:17 CEST 2008


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);

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- 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/20080911/97187d50/attachment.pgp>



More information about the ffmpeg-devel mailing list