| 361 | } |
| 362 | |
| 363 | static 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 | |
| 391 | static void run_imdct(HCAContext *c, ChannelContext *ch, int index, float *out) |
| 392 | { |
nothing calls this directly
no test coverage detected