aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mdct.c
diff options
context:
space:
mode:
authorRobert Swain <robert.swain@gmail.com>2008-06-22 15:12:27 +0000
committerRobert Swain <robert.swain@gmail.com>2008-06-22 15:12:27 +0000
commit9146e4d61c9de8fb86a7a9837705a0ad48fc547d (patch)
tree9a388e3225b3b770b2c2f3a26767fca52cf19079 /libavcodec/mdct.c
parentd47f16074ff4678d0ea968318354fc8ca6e0ba90 (diff)
downloadffmpeg-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.c7
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.
*/