diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2014-06-16 02:49:18 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-16 03:33:32 +0400 |
commit | edf930472bbd892216751413476afcd6e6f0e7e8 (patch) | |
tree | 1a8b5b2e8560dc585c954dce064be390f04c2eb4 /libswresample/resample_template.c | |
parent | 20c7baf832f4c1165a1a0d4fe93f19a36ab3c764 (diff) |
swr: reindent.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/resample_template.c')
-rw-r--r-- | libswresample/resample_template.c | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/libswresample/resample_template.c b/libswresample/resample_template.c index a13235154c..f0e1dc0ec7 100644 --- a/libswresample/resample_template.c +++ b/libswresample/resample_template.c @@ -123,42 +123,42 @@ int RENAME(swri_resample_common)(ResampleContext *c, DELEM *dst, const DELEM *src, int n, int update_ctx) { - int dst_index; - int index= c->index; - int frac= c->frac; - int dst_incr_frac= c->dst_incr % c->src_incr; - int dst_incr= c->dst_incr / c->src_incr; - int sample_index = index >> c->phase_shift; + int dst_index; + int index= c->index; + int frac= c->frac; + int dst_incr_frac= c->dst_incr % c->src_incr; + int dst_incr= c->dst_incr / c->src_incr; + int sample_index = index >> c->phase_shift; - index &= c->phase_mask; - for (dst_index = 0; dst_index < n; dst_index++) { - FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index; + index &= c->phase_mask; + for (dst_index = 0; dst_index < n; dst_index++) { + FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index; #ifdef COMMON_CORE - COMMON_CORE + COMMON_CORE #else - FELEM2 val=0; - int i; - for (i = 0; i < c->filter_length; i++) { - val += src[sample_index + i] * (FELEM2)filter[i]; - } - OUT(dst[dst_index], val); + FELEM2 val=0; + int i; + for (i = 0; i < c->filter_length; i++) { + val += src[sample_index + i] * (FELEM2)filter[i]; + } + OUT(dst[dst_index], val); #endif - frac += dst_incr_frac; - index += dst_incr; - if (frac >= c->src_incr) { - frac -= c->src_incr; - index++; - } - sample_index += index >> c->phase_shift; - index &= c->phase_mask; - } - - if(update_ctx){ - c->frac= frac; - c->index= index; - } + frac += dst_incr_frac; + index += dst_incr; + if (frac >= c->src_incr) { + frac -= c->src_incr; + index++; + } + sample_index += index >> c->phase_shift; + index &= c->phase_mask; + } + + if(update_ctx){ + c->frac= frac; + c->index= index; + } return sample_index; } @@ -167,44 +167,44 @@ int RENAME(swri_resample_linear)(ResampleContext *c, DELEM *dst, const DELEM *src, int n, int update_ctx) { - int dst_index; - int index= c->index; - int frac= c->frac; - int dst_incr_frac= c->dst_incr % c->src_incr; - int dst_incr= c->dst_incr / c->src_incr; - int sample_index = index >> c->phase_shift; - - index &= c->phase_mask; - for (dst_index = 0; dst_index < n; dst_index++) { - FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index; - FELEM2 val=0, v2 = 0; + int dst_index; + int index= c->index; + int frac= c->frac; + int dst_incr_frac= c->dst_incr % c->src_incr; + int dst_incr= c->dst_incr / c->src_incr; + int sample_index = index >> c->phase_shift; + + index &= c->phase_mask; + for (dst_index = 0; dst_index < n; dst_index++) { + FELEM *filter = ((FELEM *) c->filter_bank) + c->filter_alloc * index; + FELEM2 val=0, v2 = 0; #ifdef LINEAR_CORE - LINEAR_CORE + LINEAR_CORE #else - int i; - 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_alloc]; - } + int i; + 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_alloc]; + } #endif - val += (v2 - val) * (FELEML) frac / c->src_incr; - OUT(dst[dst_index], val); - - frac += dst_incr_frac; - index += dst_incr; - if (frac >= c->src_incr) { - frac -= c->src_incr; - index++; - } - sample_index += index >> c->phase_shift; - index &= c->phase_mask; - } - - if(update_ctx){ - c->frac= frac; - c->index= index; - } + val += (v2 - val) * (FELEML) frac / c->src_incr; + OUT(dst[dst_index], val); + + frac += dst_incr_frac; + index += dst_incr; + if (frac >= c->src_incr) { + frac -= c->src_incr; + index++; + } + sample_index += index >> c->phase_shift; + index &= c->phase_mask; + } + + if(update_ctx){ + c->frac= frac; + c->index= index; + } return sample_index; } |