- dsputil_init(&s->dsp, avctx);
-
- if (avctx->request_sample_fmt == AV_SAMPLE_FMT_FLT) {
- s->scale_bias = 1.0/(32768*8);
- avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
- } else {
- s->scale_bias = 1.0/(1*8);
- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
- ff_fmt_convert_init(&s->fmt_conv, avctx);
- s->float_buf = av_mallocz(NELLY_SAMPLES * sizeof(*s->float_buf));
- if (!s->float_buf) {
- av_log(avctx, AV_LOG_ERROR, "error allocating float buffer\n");
- return AVERROR(ENOMEM);
- }
- }
+ avpriv_float_dsp_init(&s->fdsp, avctx->flags & AV_CODEC_FLAG_BITEXACT);
+
+ s->scale_bias = 1.0/(32768*8);
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLT;