[x264-devel] [PATCH] Implementation of predict_16x16_p() in AltiVec

Noboru Asai noboru.asai at gmail.com
Sat Dec 8 09:47:56 CET 2007


Hi,

2007/12/8, Guillaume Poirier <gpoirier at mplayerhq.hu>:
>
> Hello,
>
> The attached patch adds the AliVec implementation predict_16x16_p().
>
> Comments, benchmarks and feedbacks are welcome.


please apply the following patch.

--- a/common/ppc/predict.c
+++ b/common/ppc/predict.c
@@ -20,6 +20,10 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.

*****************************************************************************/

+#ifdef SYS_LINUX
+#include <altivec.h>
+#endif
+
 #include "common/common.h"
 #include "common/clip1.h"
 #include "predict.h"
@@ -49,13 +53,13 @@ static void predict_16x16_p_altivec( uint8_t *src )
     b_u.s[0]   = b;
     c_u.s[0]   = c;

-    vec_s16_t val5_v = vec_splat_s16(5);
+    vec_u16_t val5_v = vec_splat_u16(5);
     vec_s16_t i00_v, b_v, c_v;
     i00_v = vec_splat(i00_u.v, 0);
     b_v = vec_splat(b_u.v, 0);
     c_v = vec_splat(c_u.v, 0);
     vec_s16_t induc_v  = (vec_s16_t) CV(0,  1,  2,  3,  4,  5,  6,  7);
-    vec_s16_t b8_v = vec_sl(b_v, vec_splat_s16(3));
+    vec_s16_t b8_v = vec_sl(b_v, vec_splat_u16(3));
     vec_s32_t mule_b_v = vec_mule(induc_v, b_v);
     vec_s32_t mulo_b_v = vec_mulo(induc_v, b_v);
     vec_s16_t mul_b_induc0_v = vec_pack(vec_mergeh(mule_b_v, mulo_b_v),
vec_mergel(mule_b_v, mulo_b_v));


Noboru Asai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/x264-devel/attachments/20071208/74517f8d/attachment.htm 


More information about the x264-devel mailing list