| 281 | } |
| 282 | |
| 283 | static 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 | |
| 317 | static av_cold int decode_init(AVCodecContext *avctx) |
| 318 | { |
no test coverage detected