From 9146e4d61c9de8fb86a7a9837705a0ad48fc547d Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Sun, 22 Jun 2008 15:12:27 +0000 Subject: Add generic ff_sine_window_init function and implement in codecs appropriately Originally committed as revision 13888 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mdct.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavcodec/mdct.c') diff --git a/libavcodec/mdct.c b/libavcodec/mdct.c index c51f809714..07eef2b3d4 100644 --- a/libavcodec/mdct.c +++ b/libavcodec/mdct.c @@ -48,6 +48,13 @@ void ff_kbd_window_init(float *window, float alpha, int n) window[i] = sqrt(local_window[i] / sum); } +// Generate a sine window. +void ff_sine_window_init(float *window, int n) { + int i; + for(i = 0; i < n; i++) + window[i] = sin((i + 0.5) / (2 * n) * M_PI); +} + /** * init MDCT or IMDCT computation. */ -- cgit v1.2.3