diff options
author | Robert Swain <robert.swain@gmail.com> | 2008-06-22 15:12:27 +0000 |
---|---|---|
committer | Robert Swain <robert.swain@gmail.com> | 2008-06-22 15:12:27 +0000 |
commit | 9146e4d61c9de8fb86a7a9837705a0ad48fc547d (patch) | |
tree | 9a388e3225b3b770b2c2f3a26767fca52cf19079 /libavcodec/mdct.c | |
parent | d47f16074ff4678d0ea968318354fc8ca6e0ba90 (diff) | |
download | ffmpeg-9146e4d61c9de8fb86a7a9837705a0ad48fc547d.tar.gz |
Add generic ff_sine_window_init function and implement in codecs appropriately
Originally committed as revision 13888 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mdct.c')
-rw-r--r-- | libavcodec/mdct.c | 7 |
1 files changed, 7 insertions, 0 deletions
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. */ |