diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-03-03 14:54:00 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-03-03 14:54:00 +0000 |
commit | b0368839ac6de47dee3e971c709676d9635865e9 (patch) | |
tree | d2f5240d3726509118642a98d11adfdd21d73d07 /libavcodec/ppc | |
parent | a5dbb247af9f02cff4899f16d3a87f49fe16727a (diff) | |
download | ffmpeg-b0368839ac6de47dee3e971c709676d9635865e9.tar.gz |
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')
-rw-r--r-- | libavcodec/ppc/dsputil_ppc.c | 17 | ||||
-rw-r--r-- | libavcodec/ppc/mpegvideo_altivec.c | 8 |
2 files changed, 20 insertions, 5 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 { diff --git a/libavcodec/ppc/mpegvideo_altivec.c b/libavcodec/ppc/mpegvideo_altivec.c index dd898e158a..2123880489 100644 --- a/libavcodec/ppc/mpegvideo_altivec.c +++ b/libavcodec/ppc/mpegvideo_altivec.c @@ -468,7 +468,7 @@ int dct_quantize_altivec(MpegEncContext* s, // and handle it using the vector unit if we can. This is the permute used // by the altivec idct, so it is common when using the altivec dct. - if ((lastNonZero > 0) && (s->idct_permutation_type == FF_TRANSPOSE_IDCT_PERM)) + if ((lastNonZero > 0) && (s->dsp.idct_permutation_type == FF_TRANSPOSE_IDCT_PERM)) { TRANSPOSE8(data0, data1, data2, data3, data4, data5, data6, data7); } @@ -501,10 +501,10 @@ int dct_quantize_altivec(MpegEncContext* s, // We handled the tranpose permutation above and we don't // need to permute the "no" permutation case. if ((lastNonZero > 0) && - (s->idct_permutation_type != FF_TRANSPOSE_IDCT_PERM) && - (s->idct_permutation_type != FF_NO_IDCT_PERM)) + (s->dsp.idct_permutation_type != FF_TRANSPOSE_IDCT_PERM) && + (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM)) { - ff_block_permute(data, s->idct_permutation, + ff_block_permute(data, s->idsp.dct_permutation, s->intra_scantable.scantable, lastNonZero); } |