[MPlayer-dev-eng] altivec patch 1/5: missing vec_splat in vec_clip macro

Alan Curry pacman at world.std.com
Tue Feb 7 11:49:04 CET 2006


vec_clip() is the only thing that uses AVV() with a single non-zero argument
and doesn't use vec_splat(). There's a good reason the others all surround it
in vec_splat(...,0). AVV(235) is {235,0,0,0,...} at least on some compilers.

-------------- next part --------------
Index: postproc/yuv2rgb_altivec.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/yuv2rgb_altivec.c,v
retrieving revision 1.5
diff -u -r1.5 yuv2rgb_altivec.c
--- postproc/yuv2rgb_altivec.c	14 Nov 2005 00:30:37 -0000	1.5
+++ postproc/yuv2rgb_altivec.c	6 Feb 2006 21:44:19 -0000
@@ -208,7 +208,8 @@
                                     0x10,0x0C,0x10,0x0D,0x10,0x0E,0x10,0x0F))
 
 #define vec_clip(x) \
-  vec_max (vec_min (x, (typeof(x))AVV(235)), (typeof(x))AVV(16))
+  vec_max (vec_min (x, vec_splat((typeof(x))AVV(235),0)), \
+           vec_splat((typeof(x))AVV(16),0))
 
 #define vec_packclp_a(x,y) \
   (vector unsigned char)vec_pack (vec_clip (x), vec_clip (y))


More information about the MPlayer-dev-eng mailing list