comparison ppc/dsputil_ppc.c @ 1092:f59c3f66363b libavcodec

MpegEncContext.(i)dct_* -> DspContext.(i)dct_* bitexact cleanup
author michaelni
date Mon, 03 Mar 2003 14:54:00 +0000
parents b4172ff70d27
children 80c46c310a91
comparison
equal deleted inserted replaced
1091:03df246fb06b 1092:f59c3f66363b
22 #include "dsputil_ppc.h" 22 #include "dsputil_ppc.h"
23 23
24 #ifdef HAVE_ALTIVEC 24 #ifdef HAVE_ALTIVEC
25 #include "dsputil_altivec.h" 25 #include "dsputil_altivec.h"
26 #endif 26 #endif
27
28 extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
29 extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
27 30
28 int mm_flags = 0; 31 int mm_flags = 0;
29 32
30 int mm_support(void) 33 int mm_support(void)
31 { 34 {
167 av_free(fakedata); 170 av_free(fakedata);
168 171
169 return count; 172 return count;
170 } 173 }
171 174
172 void dsputil_init_ppc(DSPContext* c, unsigned mask) 175 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
173 { 176 {
174 // Common optimisations whether Altivec or not 177 // Common optimisations whether Altivec or not
175 178
176 switch (check_dcbz_effect()) { 179 switch (check_dcbz_effect()) {
177 case 32: 180 case 32:
213 c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec; 216 c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec;
214 c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec; 217 c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec;
215 c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec; 218 c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
216 219
217 c->gmc1 = gmc1_altivec; 220 c->gmc1 = gmc1_altivec;
221
222 if ((avctx->idct_algo == FF_IDCT_AUTO) ||
223 (avctx->idct_algo == FF_IDCT_ALTIVEC))
224 {
225 c->idct_put = idct_put_altivec;
226 c->idct_add = idct_add_altivec;
227 #ifndef ALTIVEC_USE_REFERENCE_C_CODE
228 c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
229 #else /* ALTIVEC_USE_REFERENCE_C_CODE */
230 c->idct_permutation_type = FF_NO_IDCT_PERM;
231 #endif /* ALTIVEC_USE_REFERENCE_C_CODE */
232 }
218 233
219 #ifdef POWERPC_TBL_PERFORMANCE_REPORT 234 #ifdef POWERPC_TBL_PERFORMANCE_REPORT
220 { 235 {
221 int i; 236 int i;
222 for (i = 0 ; i < powerpc_perf_total ; i++) 237 for (i = 0 ; i < powerpc_perf_total ; i++)