changeset 17641:fbf94ea858f1

don't call altivec_yuv2packedX() with a dstFormat that it doesn't support; instead fall back on yuv2packedXinC
author pacman
date Sat, 18 Feb 2006 00:41:28 +0000
parents 6b69c5b4b92a
children 64e5c4e34f07
files postproc/swscale_template.c
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/swscale_template.c	Fri Feb 17 20:05:25 2006 +0000
+++ b/postproc/swscale_template.c	Sat Feb 18 00:41:28 2006 +0000
@@ -967,14 +967,19 @@
 #endif
 	default:
 #ifdef HAVE_ALTIVEC
-		altivec_yuv2packedX (c, lumFilter, lumSrc, lumFilterSize,
-			    chrFilter, chrSrc, chrFilterSize,
-			    dest, dstW, dstY);
-#else
-		yuv2packedXinC(c, lumFilter, lumSrc, lumFilterSize,
-			    chrFilter, chrSrc, chrFilterSize,
-			    dest, dstW, dstY);
+		/* The following list of supported dstFormat values should
+		   match what's found in the body of altivec_yuv2packedX() */
+		if(c->dstFormat==IMGFMT_ABGR  || c->dstFormat==IMGFMT_BGRA  ||
+		   c->dstFormat==IMGFMT_BGR24 || c->dstFormat==IMGFMT_RGB24 ||
+		   c->dstFormat==IMGFMT_RGBA  || c->dstFormat==IMGFMT_ARGB)
+			altivec_yuv2packedX (c, lumFilter, lumSrc, lumFilterSize,
+				    chrFilter, chrSrc, chrFilterSize,
+				    dest, dstW, dstY);
+		else
 #endif
+			yuv2packedXinC(c, lumFilter, lumSrc, lumFilterSize,
+				    chrFilter, chrSrc, chrFilterSize,
+				    dest, dstW, dstY);
 		break;
 	}
 }