aboutsummaryrefslogtreecommitdiffstats
path: root/libavresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-11 19:34:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-11 19:34:31 +0200
commitfb7d64df7e3b4894460c23ef3005030a5f86b5d1 (patch)
tree46258fc7d79e69ce29ef471ea76d2f8a59681730 /libavresample
parent671f9086571adc5de48ae1ef3be01cf194864a49 (diff)
parent3c84f6b5d20cd345fac706f8cfb70c55e541ffb5 (diff)
downloadffmpeg-fb7d64df7e3b4894460c23ef3005030a5f86b5d1.tar.gz
Merge commit '3c84f6b5d20cd345fac706f8cfb70c55e541ffb5'
* commit '3c84f6b5d20cd345fac706f8cfb70c55e541ffb5': resample: reindent Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavresample')
-rw-r--r--libavresample/resample_template.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/libavresample/resample_template.c b/libavresample/resample_template.c
index 6b2a6af433..0b4cf251dd 100644
--- a/libavresample/resample_template.c
+++ b/libavresample/resample_template.c
@@ -67,30 +67,29 @@ static void SET_TYPE(resample_one)(ResampleContext *c,
{
FELEM *dst = dst0;
const FELEM *src = src0;
+ int i;
+ int sample_index = index >> c->phase_shift;
+ FELEM2 val = 0;
+ FELEM *filter = ((FELEM *)c->filter_bank) +
+ c->filter_length * (index & c->phase_mask);
- int i;
- int sample_index = index >> c->phase_shift;
- FELEM2 val = 0;
- FELEM *filter = ((FELEM *)c->filter_bank) +
- c->filter_length * (index & c->phase_mask);
-
- if (sample_index < 0) {
- for (i = 0; i < c->filter_length; i++)
- val += src[FFABS(sample_index + i) % src_size] *
- (FELEM2)filter[i];
- } else if (c->linear) {
- FELEM2 v2 = 0;
- for (i = 0; i < c->filter_length; i++) {
- val += src[abs(sample_index + i)] * (FELEM2)filter[i];
- v2 += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];
- }
- val += (v2 - val) * (FELEML)frac / c->src_incr;
- } else {
- for (i = 0; i < c->filter_length; i++)
- val += src[sample_index + i] * (FELEM2)filter[i];
+ if (sample_index < 0) {
+ for (i = 0; i < c->filter_length; i++)
+ val += src[FFABS(sample_index + i) % src_size] *
+ (FELEM2)filter[i];
+ } else if (c->linear) {
+ FELEM2 v2 = 0;
+ for (i = 0; i < c->filter_length; i++) {
+ val += src[abs(sample_index + i)] * (FELEM2)filter[i];
+ v2 += src[abs(sample_index + i)] * (FELEM2)filter[i + c->filter_length];
}
+ val += (v2 - val) * (FELEML)frac / c->src_incr;
+ } else {
+ for (i = 0; i < c->filter_length; i++)
+ val += src[sample_index + i] * (FELEM2)filter[i];
+ }
- OUT(dst[dst_index], val);
+ OUT(dst[dst_index], val);
}
static void SET_TYPE(set_filter)(void *filter0, double *tab, int phase,