summaryrefslogtreecommitdiff
path: root/libavcodec/ppc/dsputil_ppc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-03-03 14:54:00 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-03-03 14:54:00 +0000
commitb0368839ac6de47dee3e971c709676d9635865e9 (patch)
treed2f5240d3726509118642a98d11adfdd21d73d07 /libavcodec/ppc/dsputil_ppc.c
parenta5dbb247af9f02cff4899f16d3a87f49fe16727a (diff)
MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
bitexact cleanup Originally committed as revision 1617 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc/dsputil_ppc.c')
-rw-r--r--libavcodec/ppc/dsputil_ppc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c
index c502f5819d..374309e378 100644
--- a/libavcodec/ppc/dsputil_ppc.c
+++ b/libavcodec/ppc/dsputil_ppc.c
@@ -25,6 +25,9 @@
#include "dsputil_altivec.h"
#endif
+extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
+extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
+
int mm_flags = 0;
int mm_support(void)
@@ -169,7 +172,7 @@ long check_dcbz_effect(void)
return count;
}
-void dsputil_init_ppc(DSPContext* c, unsigned mask)
+void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
{
// Common optimisations whether Altivec or not
@@ -215,6 +218,18 @@ void dsputil_init_ppc(DSPContext* c, unsigned mask)
c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
c->gmc1 = gmc1_altivec;
+
+ if ((avctx->idct_algo == FF_IDCT_AUTO) ||
+ (avctx->idct_algo == FF_IDCT_ALTIVEC))
+ {
+ c->idct_put = idct_put_altivec;
+ c->idct_add = idct_add_altivec;
+#ifndef ALTIVEC_USE_REFERENCE_C_CODE
+ c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
+#else /* ALTIVEC_USE_REFERENCE_C_CODE */
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
+ }
#ifdef POWERPC_TBL_PERFORMANCE_REPORT
{