From d59a4b83080080f5be4a002be79d01d9e1c31176 Mon Sep 17 00:00:00 2001 From: bcoudurier Date: Fri, 5 Sep 2008 01:44:33 +0000 Subject: [PATCH] simplify function selection code git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@27528 b3059339-0415-0410-9bf9-f77b7e298cf2 --- swscale.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/swscale.c b/swscale.c index 8fdd5eb..54e391c 100644 --- a/swscale.c +++ b/swscale.c @@ -2262,24 +2262,22 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH /* LQ converters if -sws 0 or -sws 4*/ if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)){ /* yv12_to_yuy2 */ - if (srcFormat == PIX_FMT_YUV420P && - (dstFormat == PIX_FMT_YUYV422 || dstFormat == PIX_FMT_UYVY422)) + if (srcFormat == PIX_FMT_YUV420P) { if (dstFormat == PIX_FMT_YUYV422) c->swScale= PlanarToYuy2Wrapper; - else + else if (dstFormat == PIX_FMT_UYVY422) c->swScale= PlanarToUyvyWrapper; } } #ifdef COMPILE_ALTIVEC if ((c->flags & SWS_CPU_CAPS_ALTIVEC) && - ((srcFormat == PIX_FMT_YUV420P && - (dstFormat == PIX_FMT_YUYV422 || dstFormat == PIX_FMT_UYVY422)))) { + srcFormat == PIX_FMT_YUV420P) { // unscaled YV12 -> packed YUV, we want speed if (dstFormat == PIX_FMT_YUYV422) c->swScale= yv12toyuy2_unscaled_altivec; - else + else if (dstFormat == PIX_FMT_UYVY422) c->swScale= yv12touyvy_unscaled_altivec; } #endif -- 2.11.4.GIT