[FFmpeg-cvslog] r17598 - trunk/libavcodec/aac.c
Benjamin Larsson
banan
Thu Feb 26 08:20:30 CET 2009
alexc wrote:
> Author: alexc
> Date: Thu Feb 26 02:50:00 2009
> New Revision: 17598
>
> Log:
> Use const to better allow the compiler to optimize AAC independent coupling.
>
> Modified:
> trunk/libavcodec/aac.c
>
> Modified: trunk/libavcodec/aac.c
> ==============================================================================
> --- trunk/libavcodec/aac.c Thu Feb 26 02:38:51 2009 (r17597)
> +++ trunk/libavcodec/aac.c Thu Feb 26 02:50:00 2009 (r17598)
> @@ -1456,8 +1456,13 @@ static void apply_dependent_coupling(AAC
> */
> static void apply_independent_coupling(AACContext * ac, SingleChannelElement * target, ChannelElement * cce, int index) {
> int i;
> + const float gain = cce->coup.gain[index][0];
> + const float bias = ac->add_bias;
> + const float* src = cce->ch[0].ret;
> + float* dest = target->ret;
> +
> for (i = 0; i < 1024; i++)
> - target->ret[i] += cce->coup.gain[index][0] * (cce->ch[0].ret[i] - ac->add_bias);
> + dest[i] += gain * (src[i] - bias);
> }
>
Just for the record I think that not dereferencing in the loop is more
to blame for the speedup then the const-ifying.
MvH
Benjamin Larsson
More information about the ffmpeg-cvslog
mailing list