diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-01 20:20:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-01 20:20:21 +0200 |
commit | aab5a4521c4034c218cbd72325b5d1946a3ec3c2 (patch) | |
tree | d250c1d9fc0454047df5ce59f3e55007b4b0a337 /libswresample/rematrix_template.c | |
parent | 00fea26faf8df22b7c686ceb36a7eecdc3d44b10 (diff) | |
download | ffmpeg-aab5a4521c4034c218cbd72325b5d1946a3ec3c2.tar.gz |
swr: add and use function pointers for rematrix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/rematrix_template.c')
-rw-r--r-- | libswresample/rematrix_template.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libswresample/rematrix_template.c b/libswresample/rematrix_template.c index 862430e184..0b5123c1cb 100644 --- a/libswresample/rematrix_template.c +++ b/libswresample/rematrix_template.c @@ -19,20 +19,19 @@ */ -static void RENAME(sum2)(SAMPLE *out, const SAMPLE *in1, const SAMPLE *in2, COEFF coeff1, COEFF coeff2, int len){ +static void RENAME(sum2)(SAMPLE *out, const SAMPLE *in1, const SAMPLE *in2, COEFF *coeffp, int index1, int index2, int len){ int i; + COEFF coeff1 = coeffp[index1]; + COEFF coeff2 = coeffp[index2]; for(i=0; i<len; i++) out[i] = R(coeff1*in1[i] + coeff2*in2[i]); } -static void RENAME(copy)(SAMPLE *out, const SAMPLE *in, COEFF coeff, int len){ - if(coeff == ONE){ - memcpy(out, in, sizeof(SAMPLE)*len); - }else{ - int i; - for(i=0; i<len; i++) - out[i] = R(coeff*in[i]); - } +static void RENAME(copy)(SAMPLE *out, const SAMPLE *in, COEFF *coeffp, int index, int len){ + int i; + COEFF coeff = coeffp[index]; + for(i=0; i<len; i++) + out[i] = R(coeff*in[i]); } |