avcodec/qdm2: move static init to normal init to avoid initializing tables that might never be used

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-06 15:38:20 +01:00
parent 133fbfc781
commit 976fc5911c

View File

@ -1750,12 +1750,19 @@ static void qdm2_synthesis_filter(QDM2Context *q, int index)
*
* @param q context
*/
static av_cold void qdm2_init_static_data(AVCodec *codec) {
static av_cold void qdm2_init_static_data(void) {
static int done;
if(done)
return;
qdm2_init_vlc();
ff_mpa_synth_init_float(ff_mpa_synth_window_float);
softclip_table_init();
rnd_table_init();
init_noise_samples();
done = 1;
}
/**
@ -1768,6 +1775,8 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
int extradata_size;
int tmp_val, tmp, size;
qdm2_init_static_data();
/* extradata parsing
Structure:
@ -2044,7 +2053,6 @@ AVCodec ff_qdm2_decoder = {
.id = AV_CODEC_ID_QDM2,
.priv_data_size = sizeof(QDM2Context),
.init = qdm2_decode_init,
.init_static_data = qdm2_init_static_data,
.close = qdm2_decode_close,
.decode = qdm2_decode_frame,
.capabilities = CODEC_CAP_DR1,