simplify function selection code

Originally committed as revision 27528 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
pull/126/head
Baptiste Coudurier 17 years ago
parent a6100f39a1
commit 3b38f1c60b
  1. 10
      libswscale/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*/ /* LQ converters if -sws 0 or -sws 4*/
if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)){ if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)){
/* yv12_to_yuy2 */ /* yv12_to_yuy2 */
if (srcFormat == PIX_FMT_YUV420P && if (srcFormat == PIX_FMT_YUV420P)
(dstFormat == PIX_FMT_YUYV422 || dstFormat == PIX_FMT_UYVY422))
{ {
if (dstFormat == PIX_FMT_YUYV422) if (dstFormat == PIX_FMT_YUYV422)
c->swScale= PlanarToYuy2Wrapper; c->swScale= PlanarToYuy2Wrapper;
else else if (dstFormat == PIX_FMT_UYVY422)
c->swScale= PlanarToUyvyWrapper; c->swScale= PlanarToUyvyWrapper;
} }
} }
#ifdef COMPILE_ALTIVEC #ifdef COMPILE_ALTIVEC
if ((c->flags & SWS_CPU_CAPS_ALTIVEC) && if ((c->flags & SWS_CPU_CAPS_ALTIVEC) &&
((srcFormat == PIX_FMT_YUV420P && srcFormat == PIX_FMT_YUV420P) {
(dstFormat == PIX_FMT_YUYV422 || dstFormat == PIX_FMT_UYVY422)))) {
// unscaled YV12 -> packed YUV, we want speed // unscaled YV12 -> packed YUV, we want speed
if (dstFormat == PIX_FMT_YUYV422) if (dstFormat == PIX_FMT_YUYV422)
c->swScale= yv12toyuy2_unscaled_altivec; c->swScale= yv12toyuy2_unscaled_altivec;
else else if (dstFormat == PIX_FMT_UYVY422)
c->swScale= yv12touyvy_unscaled_altivec; c->swScale= yv12touyvy_unscaled_altivec;
} }
#endif #endif

Loading…
Cancel
Save