changeset 12010:8499462c732f libavcodec

Altivec: Add helper function to load from a constant misalignment
author conrad
date Tue, 29 Jun 2010 06:42:12 +0000
parents 8c82dfce2f24
children f96187e79438
files ppc/util_altivec.h
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ppc/util_altivec.h	Tue Jun 29 06:42:08 2010 +0000
+++ b/ppc/util_altivec.h	Tue Jun 29 06:42:12 2010 +0000
@@ -32,6 +32,8 @@
 #include <altivec.h>
 #endif
 
+#include "types_altivec.h"
+
 // used to build registers permutation vectors (vcprm)
 // the 's' are for words in the _s_econd vector
 #define WORD_0 0x00,0x01,0x02,0x03
@@ -102,4 +104,15 @@
     return vec_perm(first, second, mask);
 }
 
+/**
+ * loads vector known misalignment
+ * @param perm_vec the align permute vector to combine the two loads from lvsl
+ */
+static inline vec_u8 load_with_perm_vec(int offset, uint8_t *src, vec_u8 perm_vec)
+{
+    vec_u8 a = vec_ld(offset, src);
+    vec_u8 b = vec_ld(offset+15, src);
+    return vec_perm(a, b, perm_vec);
+}
+
 #endif /* AVCODEC_PPC_UTIL_ALTIVEC_H */