summaryrefslogtreecommitdiff
path: root/libavcodec/ppc/idct_altivec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-01-16 21:54:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-01-16 21:54:55 +0000
commitdb40a39aba6a22729279ac8915b52b182473f209 (patch)
treebd67103c33705c172f5cac6838edc4899a1bfc80 /libavcodec/ppc/idct_altivec.c
parentf44a2df04fb553ef076594daca3ed4ccab315123 (diff)
downloadffmpeg-db40a39aba6a22729279ac8915b52b182473f209.tar.gz
AltiVec perf (take 2), plus a couple AltiVec functions by (Romain Dolbeau <dolbeau at irisa dot fr>)
Originally committed as revision 1464 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc/idct_altivec.c')
-rw-r--r--libavcodec/ppc/idct_altivec.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavcodec/ppc/idct_altivec.c b/libavcodec/ppc/idct_altivec.c
index 8036d403fa..533ab3e4c8 100644
--- a/libavcodec/ppc/idct_altivec.c
+++ b/libavcodec/ppc/idct_altivec.c
@@ -38,6 +38,7 @@
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include "../dsputil.h"
+#include "dsputil_altivec.h"
#define vector_s16_t vector signed short
#define vector_u16_t vector unsigned short
@@ -160,8 +161,17 @@ static const vector_s16_t constants[5] = {
void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)
{
+ALTIVEC_TBL_DECLARE(altivec_idct_put_num, 1);
+#ifdef ALTIVEC_USE_REFERENCE_C_CODE
+ALTIVEC_TBL_START_COUNT(altivec_idct_put_num, 1);
+ void simple_idct_put(UINT8 *dest, int line_size, INT16 *block);
+ simple_idct_put(dest, stride, (INT16*)block);
+ALTIVEC_TBL_STOP_COUNT(altivec_idct_put_num, 1);
+#else /* ALTIVEC_USE_REFERENCE_C_CODE */
vector_u8_t tmp;
+ALTIVEC_TBL_START_COUNT(altivec_idct_put_num, 1);
+
IDCT
#define COPY(dest,src) \
@@ -177,16 +187,28 @@ void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)
COPY (dest, vx5) dest += stride;
COPY (dest, vx6) dest += stride;
COPY (dest, vx7)
+
+ALTIVEC_TBL_STOP_COUNT(altivec_idct_put_num, 1);
+#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
void idct_add_altivec(uint8_t* dest, int stride, vector_s16_t* block)
{
+ALTIVEC_TBL_DECLARE(altivec_idct_add_num, 1);
+#ifdef ALTIVEC_USE_REFERENCE_C_CODE
+ALTIVEC_TBL_START_COUNT(altivec_idct_add_num, 1);
+ void simple_idct_add(UINT8 *dest, int line_size, INT16 *block);
+ simple_idct_add(dest, stride, (INT16*)block);
+ALTIVEC_TBL_STOP_COUNT(altivec_idct_add_num, 1);
+#else /* ALTIVEC_USE_REFERENCE_C_CODE */
vector_u8_t tmp;
vector_s16_t tmp2, tmp3;
vector_u8_t perm0;
vector_u8_t perm1;
vector_u8_t p0, p1, p;
+ALTIVEC_TBL_START_COUNT(altivec_idct_add_num, 1);
+
IDCT
p0 = vec_lvsl (0, dest);
@@ -212,5 +234,8 @@ void idct_add_altivec(uint8_t* dest, int stride, vector_s16_t* block)
ADD (dest, vx5, perm1) dest += stride;
ADD (dest, vx6, perm0) dest += stride;
ADD (dest, vx7, perm1)
+
+ALTIVEC_TBL_STOP_COUNT(altivec_idct_add_num, 1);
+#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}