MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / decode_init

Function decode_init

libavcodec/nellymoserdec.c:118–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118static av_cold int decode_init(AVCodecContext * avctx)
119{
120 int ret;
121 float scale = 1.0f;
122 NellyMoserDecodeContext *s = avctx->priv_data;
123
124 s->avctx = avctx;
125 s->imdct_out = s->imdct_buf[0];
126 s->imdct_prev = s->imdct_buf[1];
127 av_lfg_init(&s->random_state, 0);
128 if ((ret = av_tx_init(&s->imdct_ctx, &s->imdct_fn, AV_TX_FLOAT_MDCT,
129 1, 128, &scale, 0)) < 0)
130 return ret;
131
132 s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
133 if (!s->fdsp)
134 return AVERROR(ENOMEM);
135
136 s->scale_bias = 1.0/(32768*8);
137 avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
138
139 av_channel_layout_uninit(&avctx->ch_layout);
140 avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
141
142 /* Generate overlap window */
143 ff_init_ff_sine_windows(7);
144
145 return 0;
146}
147
148static int decode_tag(AVCodecContext *avctx, AVFrame *frame,
149 int *got_frame_ptr, AVPacket *avpkt)

Callers

nothing calls this directly

Calls 5

av_lfg_initFunction · 0.85
av_tx_initFunction · 0.85
avpriv_float_dsp_allocFunction · 0.85
av_channel_layout_uninitFunction · 0.85
ff_init_ff_sine_windowsFunction · 0.85

Tested by

no test coverage detected