summaryrefslogtreecommitdiff
path: root/libavcodec/ppc/dsputil_altivec.h
diff options
context:
space:
mode:
authorGuillaume Poirier <gpoirier@mplayerhq.hu>2006-10-10 08:01:19 +0000
committerGuillaume Poirier <gpoirier@mplayerhq.hu>2006-10-10 08:01:19 +0000
commitab5a1435ecad12b7c372f067322bc1b2d01dba2d (patch)
tree68022fb453ed5f09bb0c95d85ce8a2f85b8817ef /libavcodec/ppc/dsputil_altivec.h
parenta22b7322ccd286223064026af301e37f6e02bb38 (diff)
Move TRANSPOSE8 macro to dsputil_altivec.h.
(was duplicated in libavcodec/ppc/vc1dsp_altivec.c nd libavcodec/ppc/mpegvideo_altivec.c, and will be used in upcoming routines for h264_altivec.c) Originally committed as revision 6621 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc/dsputil_altivec.h')
-rw-r--r--libavcodec/ppc/dsputil_altivec.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h
index f9572d5202..560d778bbd 100644
--- a/libavcodec/ppc/dsputil_altivec.h
+++ b/libavcodec/ppc/dsputil_altivec.h
@@ -67,6 +67,40 @@ void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size,
#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
#endif
+// Transpose 8x8 matrix of 16-bit elements (in-place)
+#define TRANSPOSE8(a,b,c,d,e,f,g,h) \
+do { \
+ vector signed short A1, B1, C1, D1, E1, F1, G1, H1; \
+ vector signed short A2, B2, C2, D2, E2, F2, G2, H2; \
+ \
+ A1 = vec_mergeh (a, e); \
+ B1 = vec_mergel (a, e); \
+ C1 = vec_mergeh (b, f); \
+ D1 = vec_mergel (b, f); \
+ E1 = vec_mergeh (c, g); \
+ F1 = vec_mergel (c, g); \
+ G1 = vec_mergeh (d, h); \
+ H1 = vec_mergel (d, h); \
+ \
+ A2 = vec_mergeh (A1, E1); \
+ B2 = vec_mergel (A1, E1); \
+ C2 = vec_mergeh (B1, F1); \
+ D2 = vec_mergel (B1, F1); \
+ E2 = vec_mergeh (C1, G1); \
+ F2 = vec_mergel (C1, G1); \
+ G2 = vec_mergeh (D1, H1); \
+ H2 = vec_mergel (D1, H1); \
+ \
+ a = vec_mergeh (A2, E2); \
+ b = vec_mergel (A2, E2); \
+ c = vec_mergeh (B2, F2); \
+ d = vec_mergel (B2, F2); \
+ e = vec_mergeh (C2, G2); \
+ f = vec_mergel (C2, G2); \
+ g = vec_mergeh (D2, H2); \
+ h = vec_mergel (D2, H2); \
+} while (0)
+
#endif /* HAVE_ALTIVEC */
#endif /* _DSPUTIL_ALTIVEC_ */