]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/atrac3plusdsp.c
Merge commit '5c8a5765dc5f4e29afb85b95be393c30f45412a8'
[ffmpeg] / libavcodec / atrac3plusdsp.c
index d089588274c10aa54a3cb94db8e3da08d1f10c01..96aa402c2b2c7669da2d9e2ad71f757108b43beb 100644 (file)
@@ -415,11 +415,12 @@ static const int subband_to_qu[17] = {
     0, 8, 12, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
 };
 
-void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, int ch_index,
-                                   float *sp, int rng_index, int sb)
+void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, AVFloatDSPContext *fdsp,
+                                   int ch_index, float *sp, int rng_index, int sb)
 {
     AtracGainInfo *g1, *g2;
-    float pwcsp[ATRAC3P_SUBBAND_SAMPLES], *dst, grp_lev, qu_lev;
+    LOCAL_ALIGNED_32(float, pwcsp, [ATRAC3P_SUBBAND_SAMPLES]);
+    float *dst, grp_lev, qu_lev;
     int i, gain_lev, gcv = 0, qu, nsp;
     int swap_ch = (ctx->unit_type == CH_UNIT_STEREO && ctx->swap_channels[sb]) ? 1 : 0;
 
@@ -456,8 +457,7 @@ void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, int ch_index,
         dst = &sp[ff_atrac3p_qu_to_spec_pos[qu]];
         nsp = ff_atrac3p_qu_to_spec_pos[qu + 1] - ff_atrac3p_qu_to_spec_pos[qu];
 
-        for (i = 0; i < nsp; i++)
-            dst[i] += pwcsp[i] * qu_lev;
+        fdsp->vector_fmac_scalar(dst, pwcsp, qu_lev, nsp);
     }
 }