[FFmpeg-devel] [PATCH 2/2] avcodec/atrac3: use float_dsp in reverse_matrixing()
James Almer
jamrial at gmail.com
Tue Jul 25 07:04:55 EEST 2017
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavcodec/atrac3.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
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]);
--
2.13.3
More information about the ffmpeg-devel
mailing list