[FFmpeg-devel] [PATCH] WMA: Use ff_sine_window_init and share sine window tables

Robert Swain robert.swain
Fri Aug 15 00:13:38 CEST 2008


2008/8/14 Michael Niedermayer <michaelni at gmx.at>:
> On Thu, Aug 14, 2008 at 10:26:25PM +0100, Robert Swain wrote:
>> 2008/8/14 Robert Swain <robert.swain at gmail.com>:
>> > 2008/8/14 Michael Niedermayer <michaelni at gmx.at>:
>> >> On Thu, Aug 14, 2008 at 02:16:48PM +0100, Robert Swain wrote:
>> >>> Hello,
>> >>>
>> >>> Attached are two patches:
>> >>>
>> >>> 0001-Use-ff_sine_window_init-from-mdct.c.patch
>> >>> Change wma.c to use the ff_sine_window_init() from mdct.c
>> >>>
>> >>> 0002-Add-shared-sine-tables-to-mdct.c-and-use-them-in-wma.patch
>> >>> Add declarations for the sine tables used in wma.c (half window sizes:
>> >>> 128, 256, 512, 1024 and 2048) to mdct.c. Make them accessible via
>> >>> ff_sine_windows[] in dsputil.h. Make wma.c use these shared tables.
>> >>>
>> >>> When this is done, I'll use the appropriate shared tables in the AAC decoder.
>> >> [...]
>> >>> @@ -48,6 +48,15 @@ void ff_kbd_window_init(float *window, float alpha, int n)
>> >>>         window[i] = sqrt(local_window[i] / sum);
>> >>>  }
>> >>>
>> >>> +static float ff_sine_128 [ 128];
>> >>> +static float ff_sine_256 [ 256];
>> >>> +static float ff_sine_512 [ 512];
>> >>> +static float ff_sine_1024[1024];
>> >>> +static float ff_sine_2048[2048];
>> >>
>> >> it may be faster if some of these where non static and accessed
>> >> directly by codecs needing just one
>> >
>> > I was going to do it that way but I figured either way would work.
>> > I'll make them non-static as it shouldn't hurt.
>> >
>> > Applying...
>>
>> Applied. But I've just had a thought. These will commonly be used in
>> dsputil functions such as fmul_add_add or fmul_window or whatever so
>> should they be DECLARE_ALIGNED(16, ...)?
>
> yes (and no, no patch please just commit it!)

See attached. ;)

Rob




More information about the ffmpeg-devel mailing list