[FFmpeg-devel] [PATCH] AAC: unroll parts of decode_spectrum_and_dequant()

Vitor Sessak vitor1001
Tue Dec 9 18:02:34 CET 2008


Alex Converse wrote:
> On Tue, Dec 9, 2008 at 6:39 AM, Robert Swain <robert.swain at gmail.com> wrote:
> 
>> 2008/12/9 Alex Converse <alex.converse at gmail.com>:
>>> On Mon, Dec 8, 2008 at 10:58 PM, Jason Garrett-Glaser <
>> darkshikari at gmail.com
>>>> if (vq_ptr[2]) coef[coef_tmp_idx + 2] = 1 - 2*(int)get_bits1(gb);
>>>> if (vq_ptr[3]) coef[coef_tmp_idx + 3] = 1 - 2*(int)get_bits1(gb);
>>>>
>>>> Isn't that a rather unnecessary int -> float conversion?  I'd think
>>>> you could do much better than that considering there are only two
>>>> possible input values...
>>> In principle I agree. In practice is that a non germane change that needs
>> to
>>> be in a segregated patch? I had an improvement for ESC_BT that I tossed
>> in a
>>> separate patch.
>> If it's unrelated, stick it in a separate patch. If you're unsure, it
>> won't hurt to put it in a separate patch as it looks like a different
>> style of potential micro-optimisation.
>>
> 
> Attached
> 
> --Alex
> 

> 
> 
> diff --git a/libavcodec/aac.c b/libavcodec/aac.c
> index d0c3e6d..7c2fc28 100644
> --- a/libavcodec/aac.c
> +++ b/libavcodec/aac.c
> @@ -728,6 +728,8 @@ static void decode_mid_side_stereo(ChannelElement * cpe, GetBitContext * gb,
>      }
>  }
>  
> +static float sign_lookup[] = { 1.0f, -1.0f };

static const float ?

-Vitor




More information about the ffmpeg-devel mailing list