[x264-devel] commit: add AltiVec 16 <-> 32 bits conversions macros (Guillaume Poirier )

git version control git at videolan.org
Fri Jan 23 22:53:57 CET 2009


x264 | branch: master | Guillaume Poirier <gpoirier at mplayerhq.hu> | Fri Jan 23 01:11:20 2009 -0800| [1959672cf6f18da888940261916dbf81248e0598] | committer: Guillaume Poirier 

add AltiVec 16 <-> 32 bits conversions macros

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=1959672cf6f18da888940261916dbf81248e0598
---

 common/ppc/ppccommon.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/common/ppc/ppccommon.h b/common/ppc/ppccommon.h
index 7c87885..510ab26 100644
--- a/common/ppc/ppccommon.h
+++ b/common/ppc/ppccommon.h
@@ -87,6 +87,22 @@ typedef union {
 #define vec_u16_to_u8(v) vec_pack( v, zero_u16v )
 #define vec_s16_to_u8(v) vec_packsu( v, zero_s16v )
 
+
+/***********************************************************************
+ * 16 <-> 32 bits conversions
+ **********************************************************************/
+#define vec_u16_to_u32_h(v) (vec_u32_t) vec_mergeh( zero_u16v, (vec_u16_t) v )
+#define vec_u16_to_u32_l(v) (vec_u32_t) vec_mergel( zero_u16v, (vec_u16_t) v )
+#define vec_u16_to_s32_h(v) (vec_s32_t) vec_mergeh( zero_u16v, (vec_u16_t) v )
+#define vec_u16_to_s32_l(v) (vec_s32_t) vec_mergel( zero_u16v, (vec_u16_t) v )
+
+#define vec_u16_to_u32(v) vec_u16_to_u32_h(v)
+#define vec_u16_to_s32(v) vec_u16_to_s32_h(v)
+
+#define vec_u32_to_u16(v) vec_pack( v, zero_u32v )
+#define vec_s32_to_u16(v) vec_packsu( v, zero_s32v )
+
+
 /***********************************************************************
  * PREP_LOAD: declares two vectors required to perform unaligned loads
  * VEC_LOAD:  loads n bytes from u8 * p into vector v of type t where o is from original src offset



More information about the x264-devel mailing list