[FFmpeg-devel] [PATCH] avfilter/allfilters: Prefer s32 format over float

Aleksey Vasenev margtu-fivt at ya.ru
Wed Mar 8 15:09:47 EET 2017


Because float actually int24 in the range [-1, 1]

Signed-off-by: Aleksey Vasenev <margtu-fivt at ya.ru>
---
 libavfilter/avfiltergraph.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 534c6701a8..61c10eeecd 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -648,11 +648,11 @@ static int get_fmt_score(enum AVSampleFormat dst_fmt, enum AVSampleFormat src_fm
 
     if (av_get_packed_sample_fmt(dst_fmt) == AV_SAMPLE_FMT_S32 &&
         av_get_packed_sample_fmt(src_fmt) == AV_SAMPLE_FMT_FLT)
-        score += 20;
+        score += 2;
 
     if (av_get_packed_sample_fmt(dst_fmt) == AV_SAMPLE_FMT_FLT &&
         av_get_packed_sample_fmt(src_fmt) == AV_SAMPLE_FMT_S32)
-        score += 2;
+        score += 20;
 
     return score;
 }
-- 
2.12.0.windows.1



More information about the ffmpeg-devel mailing list