summaryrefslogtreecommitdiff
path: root/libavresample/resample_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-11 19:24:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-11 19:34:03 +0200
commit671f9086571adc5de48ae1ef3be01cf194864a49 (patch)
treea1ce738a8c76ff8b4d6207ca4f55055ca431a6d4 /libavresample/resample_template.c
parentc04961fa0ff63a87f07ba411f4f0a413a23ceea8 (diff)
parentf20892eb67a7b4b5a3c080388a35a3380516a805 (diff)
Merge commit 'f20892eb67a7b4b5a3c080388a35a3380516a805'
* commit 'f20892eb67a7b4b5a3c080388a35a3380516a805': resample: split the nearest neighbour path into a separate function pointer Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavresample/resample_template.c')
-rw-r--r--libavresample/resample_template.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libavresample/resample_template.c b/libavresample/resample_template.c
index 458944ebb2..6b2a6af433 100644
--- a/libavresample/resample_template.c
+++ b/libavresample/resample_template.c
@@ -54,16 +54,20 @@
#define DBL_TO_FELEM(d, v) d = av_clip_int16(lrint(v * (1 << 15)))
#endif
-static void SET_TYPE(resample_one)(ResampleContext *c, int no_filter,
+static void SET_TYPE(resample_nearest)(void *dst0, int dst_index, const void *src0, int index)
+{
+ FELEM *dst = dst0;
+ const FELEM *src = src0;
+ dst[dst_index] = src[index];
+}
+
+static void SET_TYPE(resample_one)(ResampleContext *c,
void *dst0, int dst_index, const void *src0,
int src_size, int index, int frac)
{
FELEM *dst = dst0;
const FELEM *src = src0;
- if (no_filter) {
- dst[dst_index] = src[index];
- } else {
int i;
int sample_index = index >> c->phase_shift;
FELEM2 val = 0;
@@ -87,7 +91,6 @@ static void SET_TYPE(resample_one)(ResampleContext *c, int no_filter,
}
OUT(dst[dst_index], val);
- }
}
static void SET_TYPE(set_filter)(void *filter0, double *tab, int phase,