[FFmpeg-cvslog] avcodec/ppc/idctdsp.c: POWER LE support in idct_add_altivec()
Rong Yan
git at videolan.org
Thu Feb 12 18:11:54 CET 2015
ffmpeg | branch: release/2.5 | Rong Yan <rongyan236 at gmail.com> | Tue Feb 3 03:04:33 2015 +0000| [b0b6d8de7ec88f1099efaf93d5b5bb43b9dfea22] | committer: Michael Niedermayer
avcodec/ppc/idctdsp.c: POWER LE support in idct_add_altivec()
also add GET_TMP2() macro
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit fc35df893175cedd65c14a4f7ebab6f33aeae4a6)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0b6d8de7ec88f1099efaf93d5b5bb43b9dfea22
---
libavcodec/ppc/idctdsp.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/libavcodec/ppc/idctdsp.c b/libavcodec/ppc/idctdsp.c
index 5ef514b..ea56a70 100644
--- a/libavcodec/ppc/idctdsp.c
+++ b/libavcodec/ppc/idctdsp.c
@@ -209,16 +209,26 @@ static void idct_add_altivec(uint8_t *dest, int stride, int16_t *blk)
IDCT;
+#if HAVE_BIGENDIAN
p0 = vec_lvsl(0, dest);
p1 = vec_lvsl(stride, dest);
p = vec_splat_u8(-1);
perm0 = vec_mergeh(p, p0);
perm1 = vec_mergeh(p, p1);
+#endif
-#define ADD(dest, src, perm) \
- /* *(uint64_t *) &tmp = *(uint64_t *) dest; */ \
+#if HAVE_BIGENDIAN
+#define GET_TMP2(dest, prm) \
tmp = vec_ld(0, dest); \
- tmp2 = (vec_s16) vec_perm(tmp, (vec_u8) zero, perm); \
+ tmp2 = (vec_s16) vec_perm(tmp, (vec_u8) zero, prm);
+#else
+#define GET_TMP2(dest, prm) \
+ tmp = vec_vsx_ld(0, dest); \
+ tmp2 = (vec_s16) vec_mergeh(tmp, (vec_u8) zero)
+#endif
+
+#define ADD(dest, src, perm) \
+ GET_TMP2(dest, perm); \
tmp3 = vec_adds(tmp2, src); \
tmp = vec_packsu(tmp3, tmp3); \
vec_ste((vec_u32) tmp, 0, (unsigned int *) dest); \
More information about the ffmpeg-cvslog
mailing list