summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodsp_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mpegaudiodsp_template.c')
-rw-r--r--libavcodec/mpegaudiodsp_template.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodsp_template.c b/libavcodec/mpegaudiodsp_template.c
index f8d0870df6..c67c456e8a 100644
--- a/libavcodec/mpegaudiodsp_template.c
+++ b/libavcodec/mpegaudiodsp_template.c
@@ -22,6 +22,7 @@
#include "libavutil/attributes.h"
#include "libavutil/mem.h"
+#include "libavutil/thread.h"
#include "dct32.h"
#include "mathops.h"
#include "mpegaudiodsp.h"
@@ -192,7 +193,7 @@ void RENAME(ff_mpa_synth_filter)(MPADSPContext *s, MPA_INT *synth_buf_ptr,
*synth_buf_offset = offset;
}
-av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window)
+static av_cold void mpa_synth_init(MPA_INT *window)
{
int i, j;
@@ -221,6 +222,17 @@ av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window)
window[512+128+16*i+j] = window[64*i+48-j];
}
+static av_cold void mpa_synth_window_init(void)
+{
+ mpa_synth_init(RENAME(ff_mpa_synth_window));
+}
+
+av_cold void RENAME(ff_mpa_synth_init)(void)
+{
+ static AVOnce init_static_once = AV_ONCE_INIT;
+ ff_thread_once(&init_static_once, mpa_synth_window_init);
+}
+
/* cos(pi*i/18) */
#define C1 FIXHR(0.98480775301220805936/2)
#define C2 FIXHR(0.93969262078590838405/2)