[FFmpeg-devel] [PATCH] intreadwrite: Altivec implementations of AV_COPY128 and AV_ZERO128.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Mar 8 17:16:43 CET 2015


Slightly (ca. 4%?) faster and smaller ff_h264_decode_mb_cavlc
in my tests on a G4 7450.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavutil/ppc/intreadwrite.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavutil/ppc/intreadwrite.h b/libavutil/ppc/intreadwrite.h
index 7671676..65b346e 100644
--- a/libavutil/ppc/intreadwrite.h
+++ b/libavutil/ppc/intreadwrite.h
@@ -24,6 +24,16 @@
 #include <stdint.h>
 #include "config.h"
 
+#if HAVE_ALTIVEC
+#include "util_altivec.h"
+#if HAVE_BIGENDIAN
+#define AV_COPY128(d, s) vec_st(vec_ld(0, (const unsigned char *)(s)), 0, (unsigned char *)(d))
+#else
+#define AV_COPY128(d, s) vec_vsx_st(vec_vsx_ld(0, (const unsigned char *)(s)), 0, (unsigned char *)(d))
+#endif
+#define AV_ZERO128(d) VEC_ST(vec_splat_u8(0), 0, (unsigned char *)(d))
+#endif
+
 #if HAVE_XFORM_ASM
 
 #if HAVE_BIGENDIAN
-- 
2.1.4



More information about the ffmpeg-devel mailing list