[FFmpeg-devel] [PATCH v2 3/4] libswscale/utils: simplify the default scaler logic

Linjie Fu fulinjie at zju.edu.cn
Mon Aug 2 19:49:03 EEST 2021


From: Linjie Fu <linjie.justin.fu at gmail.com>

Signed-off-by: Linjie Fu <linjie.justin.fu at gmail.com>
---
 libswscale/utils.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 176fc6fd63..dea3b76eb3 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1250,12 +1250,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
 
     /* provide a default scaler if not set by caller */
     if (!i) {
-        if (dstW < srcW && dstH < srcH)
-            flags |= SWS_BICUBIC;
-        else if (dstW > srcW && dstH > srcH)
-            flags |= SWS_BICUBIC;
-        else
-            flags |= SWS_BICUBIC;
+        flags |= SWS_BICUBIC;
         c->flags = flags;
     } else if (i & (i - 1)) {
         av_log(c, AV_LOG_ERROR,
-- 
2.31.1



More information about the ffmpeg-devel mailing list