static av_cold int init(AVFilterContext *ctx)
{
VolumeContext *vol = ctx->priv;
+
+ vol->fdsp = avpriv_float_dsp_alloc(0);
+ if (!vol->fdsp)
+ return AVERROR(ENOMEM);
+
return set_expr(&vol->volume_pexpr, vol->volume_expr, ctx);
}
VolumeContext *vol = ctx->priv;
av_expr_free(vol->volume_pexpr);
av_opt_free(vol);
+ av_freep(&vol->fdsp);
}
static int query_formats(AVFilterContext *ctx)
vol->scale_samples = scale_samples_s32;
break;
case AV_SAMPLE_FMT_FLT:
- avpriv_float_dsp_init(&vol->fdsp, 0);
vol->samples_align = 4;
break;
case AV_SAMPLE_FMT_DBL:
- avpriv_float_dsp_init(&vol->fdsp, 0);
vol->samples_align = 8;
break;
}
}
} else if (av_get_packed_sample_fmt(vol->sample_fmt) == AV_SAMPLE_FMT_FLT) {
for (p = 0; p < vol->planes; p++) {
- vol->fdsp.vector_fmul_scalar((float *)out_buf->extended_data[p],
+ vol->fdsp->vector_fmul_scalar((float *)out_buf->extended_data[p],
(const float *)buf->extended_data[p],
vol->volume, plane_samples);
}
} else {
for (p = 0; p < vol->planes; p++) {
- vol->fdsp.vector_dmul_scalar((double *)out_buf->extended_data[p],
+ vol->fdsp->vector_dmul_scalar((double *)out_buf->extended_data[p],
(const double *)buf->extended_data[p],
vol->volume, plane_samples);
}