diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2015-10-28 15:38:20 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-10-01 00:45:55 +0200 |
commit | 43717469f9daa402f6acb48997255827a56034e9 (patch) | |
tree | 16960ef3b92b1da9c4b34a88128050009a898cba /libavcodec/ac3dsp.c | |
parent | 8ea35af7620e4f73f9e8c072e1c0fac9a04ec161 (diff) | |
download | ffmpeg-43717469f9daa402f6acb48997255827a56034e9.tar.gz |
ac3dsp: Reverse matrix in/out order in downmix()
Also use (float **) instead of (float (*)[2]). This matches the matrix
layout in libavresample so we can reuse assembly code between the two.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/ac3dsp.c')
-rw-r--r-- | libavcodec/ac3dsp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c index 38c35b187a..d1bf37e943 100644 --- a/libavcodec/ac3dsp.c +++ b/libavcodec/ac3dsp.c @@ -171,7 +171,7 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs) } } -static void ac3_downmix_c(float **samples, float (*matrix)[2], +static void ac3_downmix_c(float **samples, float **matrix, int out_ch, int in_ch, int len) { int i, j; @@ -180,8 +180,8 @@ static void ac3_downmix_c(float **samples, float (*matrix)[2], for (i = 0; i < len; i++) { v0 = v1 = 0.0f; for (j = 0; j < in_ch; j++) { - v0 += samples[j][i] * matrix[j][0]; - v1 += samples[j][i] * matrix[j][1]; + v0 += samples[j][i] * matrix[0][j]; + v1 += samples[j][i] * matrix[1][j]; } samples[0][i] = v0; samples[1][i] = v1; @@ -190,7 +190,7 @@ static void ac3_downmix_c(float **samples, float (*matrix)[2], for (i = 0; i < len; i++) { v0 = 0.0f; for (j = 0; j < in_ch; j++) - v0 += samples[j][i] * matrix[j][0]; + v0 += samples[j][i] * matrix[0][j]; samples[0][i] = v0; } } |