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

Function decode_ctx_init

libavcodec/mpegaudiodec_template.c:283–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283static av_cold int decode_ctx_init(AVCodecContext *avctx, MPADecodeContext *s)
284{
285 static AVOnce init_static_once = AV_ONCE_INIT;
286
287 s->avctx = avctx;
288
289#if USE_FLOATS
290 {
291 AVFloatDSPContext *fdsp;
292 fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
293 if (!fdsp)
294 return AVERROR(ENOMEM);
295 s->butterflies_float = fdsp->butterflies_float;
296 av_free(fdsp);
297 }
298#endif
299
300 ff_mpadsp_init(&s->mpadsp);
301
302 if (avctx->request_sample_fmt == OUT_FMT &&
303 avctx->codec_id != AV_CODEC_ID_MP3ON4)
304 avctx->sample_fmt = OUT_FMT;
305 else
306 avctx->sample_fmt = OUT_FMT_P;
307 s->err_recognition = avctx->err_recognition;
308
309 if (avctx->codec_id == AV_CODEC_ID_MP3ADU)
310 s->adu_mode = 1;
311
312 ff_thread_once(&init_static_once, decode_init_static);
313
314 return 0;
315}
316
317static av_cold int decode_init(AVCodecContext *avctx)
318{

Callers 2

decode_initFunction · 0.85
decode_init_mp3on4Function · 0.85

Calls 4

avpriv_float_dsp_allocFunction · 0.85
ff_mpadsp_initFunction · 0.85
ff_thread_onceFunction · 0.85
av_freeFunction · 0.50

Tested by

no test coverage detected