swscale/utils: Simplify scaler name printing code
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Sep 2013 19:29:42 +0000 (21:29 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Sep 2013 19:29:42 +0000 (21:29 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/utils.c

index 0d4fc3f..b53724c 100644 (file)
@@ -1546,32 +1546,34 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
     av_assert0(c->chrDstH <= dstH);
 
     if (flags & SWS_PRINT_INFO) {
+        const char *scaler;
         if (flags & SWS_FAST_BILINEAR)
-            av_log(c, AV_LOG_INFO, "FAST_BILINEAR scaler, ");
+            scaler = "FAST_BILINEAR scaler";
         else if (flags & SWS_BILINEAR)
-            av_log(c, AV_LOG_INFO, "BILINEAR scaler, ");
+            scaler = "BILINEAR scaler";
         else if (flags & SWS_BICUBIC)
-            av_log(c, AV_LOG_INFO, "BICUBIC scaler, ");
+            scaler = "BICUBIC scaler";
         else if (flags & SWS_X)
-            av_log(c, AV_LOG_INFO, "Experimental scaler, ");
+            scaler = "Experimental scaler";
         else if (flags & SWS_POINT)
-            av_log(c, AV_LOG_INFO, "Nearest Neighbor / POINT scaler, ");
+            scaler = "Nearest Neighbor / POINT scaler";
         else if (flags & SWS_AREA)
-            av_log(c, AV_LOG_INFO, "Area Averaging scaler, ");
+            scaler = "Area Averaging scaler";
         else if (flags & SWS_BICUBLIN)
-            av_log(c, AV_LOG_INFO, "luma BICUBIC / chroma BILINEAR scaler, ");
+            scaler = "luma BICUBIC / chroma BILINEAR scaler";
         else if (flags & SWS_GAUSS)
-            av_log(c, AV_LOG_INFO, "Gaussian scaler, ");
+            scaler = "Gaussian scaler";
         else if (flags & SWS_SINC)
-            av_log(c, AV_LOG_INFO, "Sinc scaler, ");
+            scaler = "Sinc scaler";
         else if (flags & SWS_LANCZOS)
-            av_log(c, AV_LOG_INFO, "Lanczos scaler, ");
+            scaler = "Lanczos scaler";
         else if (flags & SWS_SPLINE)
-            av_log(c, AV_LOG_INFO, "Bicubic spline scaler, ");
+            scaler = "Bicubic spline scaler";
         else
-            av_log(c, AV_LOG_INFO, "ehh flags invalid?! ");
+            scaler = "ehh flags invalid?!";
 
-        av_log(c, AV_LOG_INFO, "from %s to %s%s ",
+        av_log(c, AV_LOG_INFO, "%s, from %s to %s%s ",
+               scaler,
                av_get_pix_fmt_name(srcFormat),
 #ifdef DITHER1XBPP
                dstFormat == AV_PIX_FMT_BGR555   || dstFormat == AV_PIX_FMT_BGR565   ||