[FFmpeg-cvslog] swresample/swresample: do not use s32p internally by default when resampling

Muhammad Faiz git at videolan.org
Sat Mar 18 09:09:19 EET 2017


ffmpeg | branch: master | Muhammad Faiz <mfcc64 at gmail.com> | Thu Mar 16 12:35:11 2017 +0700| [c52638cca255737eb060dcdedf5be4414e622e82] | committer: Muhammad Faiz

swresample/swresample: do not use s32p internally by default when resampling

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 at googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c52638cca255737eb060dcdedf5be4414e622e82
---

 libswresample/swresample.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index f2e6600..74c96dc 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -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){



More information about the ffmpeg-cvslog mailing list