aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ppc
diff options
context:
space:
mode:
authorRong Yan <rongyan236@gmail.com>2014-12-08 08:00:59 +0000
committerMichael Niedermayer <michaelni@gmx.at>2014-12-08 15:30:03 +0100
commit6ec5a199ea7718d24d574b47176b224f6bdca6af (patch)
treea8ac4aef1bbd350950dc7af8585bf48444bb1d32 /libavcodec/ppc
parentf7b536665706b5cb941b15abafd28f67ae2b0604 (diff)
downloadffmpeg-6ec5a199ea7718d24d574b47176b224f6bdca6af.tar.gz
avcodec/ppc/vp3dsp_altivec: POWER LE support to vp3_idct_add_altivec()
add GET_VDST16() macro Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 9bd8f2cc32c2616c2bc010dd50f542ce6a85162b) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r--libavcodec/ppc/vp3dsp_altivec.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libavcodec/ppc/vp3dsp_altivec.c b/libavcodec/ppc/vp3dsp_altivec.c
index 9d81b3f265..4a367b655e 100644
--- a/libavcodec/ppc/vp3dsp_altivec.c
+++ b/libavcodec/ppc/vp3dsp_altivec.c
@@ -32,8 +32,13 @@
static const vec_s16 constants =
{0, 64277, 60547, 54491, 46341, 36410, 25080, 12785};
+#if HAVE_BIGENDIAN
static const vec_u8 interleave_high =
{0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29};
+#else
+static const vec_u8 interleave_high =
+ {2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31};
+#endif
#define IDCT_START \
vec_s16 A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;\
@@ -156,9 +161,18 @@ static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64])
TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7);
IDCT_1D(ADD8, SHIFT4)
-#define ADD(a)\
+#if HAVE_BIGENDIAN
+#define GET_VDST16\
vdst = vec_ld(0, dst);\
- vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);\
+ vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);
+#else
+#define GET_VDST16\
+ vdst = vec_vsx_ld(0,dst);\
+ vdst_16 = (vec_s16)vec_mergeh(vdst, zero_u8v);
+#endif
+
+#define ADD(a)\
+ GET_VDST16;\
vdst_16 = vec_adds(a, vdst_16);\
t = vec_packsu(vdst_16, vdst_16);\
vec_ste((vec_u32)t, 0, (unsigned int *)dst);\