From 9d052adbebf0c85e32e3e011fd33ac633635b234 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 17 Sep 2013 21:29:42 +0200 Subject: [PATCH] swscale/utils: Simplify scaler name printing code Signed-off-by: Michael Niedermayer --- libswscale/utils.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 0d4fc3fc28..b53724c665 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -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 ||