summaryrefslogtreecommitdiff
path: root/libswresample/rematrix_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-01 20:20:21 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-01 20:20:21 +0200
commitaab5a4521c4034c218cbd72325b5d1946a3ec3c2 (patch)
treed250c1d9fc0454047df5ce59f3e55007b4b0a337 /libswresample/rematrix_template.c
parent00fea26faf8df22b7c686ceb36a7eecdc3d44b10 (diff)
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.c17
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]);
}