]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ppc/util_altivec.h
options: set minimum for "threads" to zero
[ffmpeg] / libavcodec / ppc / util_altivec.h
index 9bf7e390acd8efa38508e8d18f5e5f0c3f0153dc..19ea9626db80fbd41c50014b0b6dd48a996d94fb 100644 (file)
@@ -1,23 +1,23 @@
 /*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
- * @file libavcodec/ppc/util_altivec.h
+ * @file
  * Contains misc utility macros and inline functions
  */
 
@@ -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
@@ -92,7 +94,7 @@ do { \
 } while (0)
 
 
-/** \brief loads unaligned vector \a *src with offset \a offset
+/** @brief loads unaligned vector @a *src with offset @a offset
     and returns it */
 static inline vector unsigned char unaligned_load(int offset, uint8_t *src)
 {
@@ -102,4 +104,15 @@ static inline vector unsigned char unaligned_load(int offset, uint8_t *src)
     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 */