From 68b107b2ca90ce6d8f295dca5a14894279982537 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 14 Sep 2024 21:04:20 +0200 Subject: [PATCH] avfilter/aspace_template: small refactor --- libavfilter/aspace_template.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libavfilter/aspace_template.c b/libavfilter/aspace_template.c index 102c9f6dc0..fc0dc255d1 100644 --- a/libavfilter/aspace_template.c +++ b/libavfilter/aspace_template.c @@ -21,12 +21,15 @@ #undef ftype #undef SAMPLE_FORMAT +#undef VECTOR_MUL #if DEPTH == 32 #define SAMPLE_FORMAT float #define ftype float +#define VECTOR_MUL s->fdsp->vector_fmul #else #define SAMPLE_FORMAT double #define ftype double +#define VECTOR_MUL s->fdsp->vector_dmul #endif #define fn3(a,b) a##_##b @@ -41,16 +44,9 @@ static void fn(process)(AVFilterContext *ctx, AudioSpaceContext *s = ctx->priv; for (int i = 0; i < nb_channels; i++) { -#if DEPTH == 32 - s->fdsp->vector_fmul((ftype *)out->extended_data[i], - (const ftype *)in->extended_data[0], - (const ftype *)w->extended_data[i], - nb_samples); -#else - s->fdsp->vector_dmul((ftype *)out->extended_data[i], - (const ftype *)in->extended_data[0], - (const ftype *)w->extended_data[i], - nb_samples); -#endif + VECTOR_MUL((ftype *)out->extended_data[i], + (const ftype *)in->extended_data[0], + (const ftype *)w->extended_data[i], + nb_samples); } }