diff mbox

[FFmpeg-devel,2/2] avcodec/atrac3: use float_dsp in reverse_matrixing()

Message ID 20170725040455.428-1-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer July 25, 2017, 4:04 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/atrac3.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 6cdcdf1964..bb2f5ee828 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -467,8 +467,8 @@  static int add_tonal_components(float *spectrum, int num_components,
 #define INTERPOLATE(old, new, nsample) \
     ((old) + (nsample) * 0.125 * ((new) - (old)))
 
-static void reverse_matrixing(float *su1, float *su2, int *prev_code,
-                              int *curr_code)
+static void reverse_matrixing(ATRAC3Context *q, float *su1, float *su2,
+                              int *prev_code, int *curr_code)
 {
     int i, nsample, band;
     float mc1_l, mc1_r, mc2_l, mc2_r;
@@ -516,12 +516,7 @@  static void reverse_matrixing(float *su1, float *su2, int *prev_code,
             break;
         case 2:
         case 3:
-            for (; nsample < band + 256; nsample++) {
-                float c1 = su1[nsample];
-                float c2 = su2[nsample];
-                su1[nsample] = c1 + c2;
-                su2[nsample] = c1 - c2;
-            }
+            q->fdsp->butterflies_float(&su1[nsample], &su2[nsample], band + 256 - nsample);
             break;
         default:
             av_assert1(0);
@@ -717,7 +712,7 @@  static int decode_frame(AVCodecContext *avctx, const uint8_t *databuf,
                 return ret;
 
             /* Reconstruct the channel coefficients. */
-            reverse_matrixing(out_samples[ch], out_samples[ch+1],
+            reverse_matrixing(q, out_samples[ch], out_samples[ch+1],
                               q->matrix_coeff_index_prev[js_pair],
                               q->matrix_coeff_index_now[js_pair]);