[MPlayer-dev-eng] [PATCH] altivec fixes, part 2: missing vec_splat

Alan Curry pacman at TheWorld.com
Mon Feb 6 07:28:02 CET 2006


The vec_clip() macro didn't work correctly because it didn't vec_splat() its
constants.

diff -u postproc/yuv2rgb_altivec.c postproc/yuv2rgb_altivec.c
--- postproc/yuv2rgb_altivec.c	6 Feb 2006 01:49:30 -0000
+++ postproc/yuv2rgb_altivec.c	6 Feb 2006 02:15:27 -0000
@@ -211,7 +211,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