summaryrefslogtreecommitdiff
path: root/libswresample/resample.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-07-02 22:16:48 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-07-04 01:37:41 +0200
commit857cd1f33bcf86005529af2a77f861f884327be5 (patch)
tree519ce6e41cfa927c419131481d509c85b6f20eec /libswresample/resample.c
parent5c65aed7fdfba6d5488bae4b50b9df8829587818 (diff)
swr: initialize only the necessary resample dsp functions
Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/resample.c')
-rw-r--r--libswresample/resample.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 6124b8a035..2a8aa7e2d0 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -271,8 +271,6 @@ static int swri_resample(ResampleContext *c,
uint8_t *dst, const uint8_t *src, int *consumed,
int src_size, int dst_size, int update_ctx)
{
- int fn_idx = c->format - AV_SAMPLE_FMT_S16P;
-
if (c->filter_length == 1 && c->phase_shift == 0) {
int index= c->index;
int frac= c->frac;
@@ -281,7 +279,7 @@ static int swri_resample(ResampleContext *c,
int new_size = (src_size * (int64_t)c->src_incr - frac + c->dst_incr - 1) / c->dst_incr;
dst_size= FFMIN(dst_size, new_size);
- c->dsp.resample_one[fn_idx](dst, src, dst_size, index2, incr);
+ c->dsp.resample_one(dst, src, dst_size, index2, incr);
index += dst_size * c->dst_incr_div;
index += (frac + dst_size * (int64_t)c->dst_incr_mod) / c->src_incr;
@@ -298,11 +296,7 @@ static int swri_resample(ResampleContext *c,
dst_size = FFMIN(dst_size, delta_n);
if (dst_size > 0) {
- if (!c->linear) {
- *consumed = c->dsp.resample_common[fn_idx](c, dst, src, dst_size, update_ctx);
- } else {
- *consumed = c->dsp.resample_linear[fn_idx](c, dst, src, dst_size, update_ctx);
- }
+ *consumed = c->dsp.resample(c, dst, src, dst_size, update_ctx);
} else {
*consumed = 0;
}