]> git.sesse.net Git - ffmpeg/commitdiff
swresample/swresample: do not use s32p internally by default when resampling
authorMuhammad Faiz <mfcc64@gmail.com>
Thu, 16 Mar 2017 05:35:11 +0000 (12:35 +0700)
committerMuhammad Faiz <mfcc64@gmail.com>
Sat, 18 Mar 2017 06:57:03 +0000 (13:57 +0700)
use fltp when doing s32 -> s32 resampling
because s32p has no simd optimization

benchmark:
old 17.913s
new  7.584s (use fma3)

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
libswresample/swresample.c

index f2e66005eb07667ff7d53921ff8e8159964c5f3e..74c96dce605e467a99def17607908cb651488e11 100644 (file)
@@ -223,6 +223,8 @@ av_cold int swr_init(struct SwrContext *s){
         }else if(   av_get_planar_sample_fmt(s-> in_sample_fmt) == AV_SAMPLE_FMT_S32P
                  && av_get_planar_sample_fmt(s->out_sample_fmt) == AV_SAMPLE_FMT_S32P
                  && !s->rematrix
+                 && s->out_sample_rate == s->in_sample_rate
+                 && !(s->flags & SWR_FLAG_RESAMPLE)
                  && s->engine != SWR_ENGINE_SOXR){
             s->int_sample_fmt= AV_SAMPLE_FMT_S32P;
         }else if(av_get_bytes_per_sample(s->in_sample_fmt) <= 4){