summaryrefslogtreecommitdiff
path: root/libswresample/resample_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-19 03:06:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-19 03:09:24 +0200
commit0c142e4cda3dbc3b460a5f8c1095cee6594ed5c6 (patch)
tree537e232270d0fd97d63eb116c140031fbd61d39a /libswresample/resample_template.c
parent80e857c967ff063def0ffc2499d1c78b8d6d130b (diff)
swr: introduce filter_alloc in preparation of SIMD resample optimisations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/resample_template.c')
-rw-r--r--libswresample/resample_template.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libswresample/resample_template.c b/libswresample/resample_template.c
index 4060c66a43..13d7189842 100644
--- a/libswresample/resample_template.c
+++ b/libswresample/resample_template.c
@@ -50,7 +50,7 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
frac = (frac + dst_index * (int64_t)dst_incr_frac) % c->src_incr;
}else if(compensation_distance == 0 && !c->linear && index >= 0){
for(dst_index=0; dst_index < dst_size; dst_index++){
- FELEM *filter= ((FELEM*)c->filter_bank) + c->filter_length*(index & c->phase_mask);
+ FELEM *filter= ((FELEM*)c->filter_bank) + c->filter_alloc*(index & c->phase_mask);
int sample_index= index >> c->phase_shift;
if(sample_index + c->filter_length > src_size){
@@ -72,7 +72,7 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
}
}else{
for(dst_index=0; dst_index < dst_size; dst_index++){
- FELEM *filter= ((FELEM*)c->filter_bank) + c->filter_length*(index & c->phase_mask);
+ FELEM *filter= ((FELEM*)c->filter_bank) + c->filter_alloc*(index & c->phase_mask);
int sample_index= index >> c->phase_shift;
FELEM2 val=0;
@@ -85,7 +85,7 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
FELEM2 v2=0;
for(i=0; i<c->filter_length; i++){
val += src[sample_index + i] * (FELEM2)filter[i];
- v2 += src[sample_index + i] * (FELEM2)filter[i + c->filter_length];
+ v2 += src[sample_index + i] * (FELEM2)filter[i + c->filter_alloc];
}
val+=(v2-val)*(FELEML)frac / c->src_incr;
}else{