Mercurial > libavcodec.hg
diff ppc/idct_altivec.c @ 1009:3b7cc8e4b83f libavcodec
AltiVec perf (take 2), plus a couple AltiVec functions by (Romain Dolbeau <dolbeau at irisa dot fr>)
author | michaelni |
---|---|
date | Thu, 16 Jan 2003 21:54:55 +0000 |
parents | ace3ccd18dd2 |
children | 35cf2f4a0f8c |
line wrap: on
line diff
--- a/ppc/idct_altivec.c Wed Jan 15 19:21:21 2003 +0000 +++ b/ppc/idct_altivec.c Thu Jan 16 21:54:55 2003 +0000 @@ -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 @@ 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 @@ 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 @@ 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 */ }