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

Function decode_init

libavcodec/hcadec.c:363–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363static av_cold int decode_init(AVCodecContext *avctx)
364{
365 HCAContext *c = avctx->priv_data;
366 float scale = 1.f / 8.f;
367 int ret;
368
369 avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
370
371 if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > FF_ARRAY_ELEMS(c->ch))
372 return AVERROR(EINVAL);
373
374 c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
375 if (!c->fdsp)
376 return AVERROR(ENOMEM);
377
378 ret = av_tx_init(&c->tx_ctx, &c->tx_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0);
379 if (ret < 0)
380 return ret;
381
382 if (avctx->extradata_size != 0 && avctx->extradata_size < 36)
383 return AVERROR_INVALIDDATA;
384
385 if (!avctx->extradata_size)
386 return 0;
387
388 return init_hca(avctx, avctx->extradata, avctx->extradata_size);
389}
390
391static void run_imdct(HCAContext *c, ChannelContext *ch, int index, float *out)
392{

Callers

nothing calls this directly

Calls 3

avpriv_float_dsp_allocFunction · 0.85
av_tx_initFunction · 0.85
init_hcaFunction · 0.85

Tested by

no test coverage detected