[MPlayer-dev-eng] another RGB ordering fix for altivec
Alan Curry
pacman at TheWorld.com
Sat Mar 4 21:36:25 CET 2006
This time it's the unscaled 32-bit yuv2rgb conversions getting attention.
When these are put next to each other, it becomes clear that they can't both
be right:
DEFCSP420_CVT (yuv2_bgra32, out_argb)
DEFCSP420_CVT (yuv2_argb32, out_argb)
This fixes it. It also abolishes the "bgra32"-style function names. There's
already "ABGR" and "RGB32", which thanks to DOCS/tech/colorspaces.txt you can
at least find out what they are (although I think I'll never know *why*). How
many different names for the same thing do we need?
While I was in there, I also added the 2 missing 32-bit formats to the
switch().
Did this break anything? Is anyone in love with the /[argb]{4}32/ names?
Index: postproc/yuv2rgb_altivec.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/yuv2rgb_altivec.c,v
retrieving revision 1.12
diff -u -r1.12 yuv2rgb_altivec.c
--- postproc/yuv2rgb_altivec.c 18 Feb 2006 01:08:17 -0000 1.12
+++ postproc/yuv2rgb_altivec.c 4 Mar 2006 20:04:29 -0000
@@ -417,9 +417,9 @@
#define out_rgb24(a,b,c,ptr) vec_mstrgb24(a,b,c,ptr)
#define out_bgr24(a,b,c,ptr) vec_mstbgr24(a,b,c,ptr)
-DEFCSP420_CVT (yuv2_abgr32, out_abgr)
+DEFCSP420_CVT (yuv2_abgr, out_abgr)
#if 1
-DEFCSP420_CVT (yuv2_bgra32, out_argb)
+DEFCSP420_CVT (yuv2_bgra, out_bgra)
#else
static int altivec_yuv2_bgra32 (SwsContext *c,
unsigned char **in, int *instrides,
@@ -571,8 +571,8 @@
#endif
-DEFCSP420_CVT (yuv2_rgba32, out_rgba)
-DEFCSP420_CVT (yuv2_argb32, out_argb)
+DEFCSP420_CVT (yuv2_rgba, out_rgba)
+DEFCSP420_CVT (yuv2_argb, out_argb)
DEFCSP420_CVT (yuv2_rgb24, out_rgb24)
DEFCSP420_CVT (yuv2_bgr24, out_bgr24)
@@ -698,14 +698,18 @@
case IMGFMT_BGR24:
MSG_WARN("ALTIVEC: Color Space BGR24\n");
return altivec_yuv2_bgr24;
- case IMGFMT_RGB32:
- MSG_WARN("ALTIVEC: Color Space ARGB32\n");
- return altivec_yuv2_argb32;
- case IMGFMT_BGR32:
- MSG_WARN("ALTIVEC: Color Space BGRA32\n");
- // return profile_altivec_bgra32;
-
- return altivec_yuv2_bgra32;
+ case IMGFMT_ARGB:
+ MSG_WARN("ALTIVEC: Color Space ARGB\n");
+ return altivec_yuv2_argb;
+ case IMGFMT_ABGR:
+ MSG_WARN("ALTIVEC: Color Space ABGR\n");
+ return altivec_yuv2_abgr;
+ case IMGFMT_RGBA:
+ MSG_WARN("ALTIVEC: Color Space RGBA\n");
+ return altivec_yuv2_rgba;
+ case IMGFMT_BGRA:
+ MSG_WARN("ALTIVEC: Color Space BGRA\n");
+ return altivec_yuv2_bgra;
default: return NULL;
}
break;
More information about the MPlayer-dev-eng
mailing list