Mercurial > libavcodec.hg
comparison ppc/idct_altivec.c @ 1839:b370288f004d libavcodec
Metrowerks CodeWarrior patches by (John Dalgliesh <johnd at defyne dot org>)
author | michael |
---|---|
date | Sat, 28 Feb 2004 15:03:53 +0000 |
parents | e8ff4783f188 |
children | ef2149182f1c |
comparison
equal
deleted
inserted
replaced
1838:8cdbb74c2f4b | 1839:b370288f004d |
---|---|
42 #include "gcc_fixes.h" | 42 #include "gcc_fixes.h" |
43 | 43 |
44 #include "dsputil_altivec.h" | 44 #include "dsputil_altivec.h" |
45 | 45 |
46 #define vector_s16_t vector signed short | 46 #define vector_s16_t vector signed short |
47 #define const_vector_s16_t const_vector signed short | |
47 #define vector_u16_t vector unsigned short | 48 #define vector_u16_t vector unsigned short |
48 #define vector_s8_t vector signed char | 49 #define vector_s8_t vector signed char |
49 #define vector_u8_t vector unsigned char | 50 #define vector_u8_t vector unsigned char |
50 #define vector_s32_t vector signed int | 51 #define vector_s32_t vector signed int |
51 #define vector_u32_t vector unsigned int | 52 #define vector_u32_t vector unsigned int |
153 vx5 = vec_sra (vy5, shift); \ | 154 vx5 = vec_sra (vy5, shift); \ |
154 vx6 = vec_sra (vy6, shift); \ | 155 vx6 = vec_sra (vy6, shift); \ |
155 vx7 = vec_sra (vy7, shift); | 156 vx7 = vec_sra (vy7, shift); |
156 | 157 |
157 | 158 |
158 static const vector_s16_t constants[5] = { | 159 static const_vector_s16_t constants[5] = { |
159 (vector_s16_t) AVV(23170, 13573, 6518, 21895, -23170, -21895, 32, 31), | 160 (vector_s16_t) AVV(23170, 13573, 6518, 21895, -23170, -21895, 32, 31), |
160 (vector_s16_t) AVV(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725), | 161 (vector_s16_t) AVV(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725), |
161 (vector_s16_t) AVV(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521), | 162 (vector_s16_t) AVV(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521), |
162 (vector_s16_t) AVV(21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692), | 163 (vector_s16_t) AVV(21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692), |
163 (vector_s16_t) AVV(19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722) | 164 (vector_s16_t) AVV(19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722) |
172 simple_idct_put(dest, stride, (int16_t*)block); | 173 simple_idct_put(dest, stride, (int16_t*)block); |
173 POWERPC_PERF_STOP_COUNT(altivec_idct_put_num, 1); | 174 POWERPC_PERF_STOP_COUNT(altivec_idct_put_num, 1); |
174 #else /* ALTIVEC_USE_REFERENCE_C_CODE */ | 175 #else /* ALTIVEC_USE_REFERENCE_C_CODE */ |
175 vector_u8_t tmp; | 176 vector_u8_t tmp; |
176 | 177 |
178 #ifdef POWERPC_PERFORMANCE_REPORT | |
177 POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1); | 179 POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1); |
178 | 180 #endif |
179 IDCT | 181 IDCT |
180 | 182 |
181 #define COPY(dest,src) \ | 183 #define COPY(dest,src) \ |
182 tmp = vec_packsu (src, src); \ | 184 tmp = vec_packsu (src, src); \ |
183 vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); \ | 185 vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); \ |
209 vector_s16_t tmp2, tmp3; | 211 vector_s16_t tmp2, tmp3; |
210 vector_u8_t perm0; | 212 vector_u8_t perm0; |
211 vector_u8_t perm1; | 213 vector_u8_t perm1; |
212 vector_u8_t p0, p1, p; | 214 vector_u8_t p0, p1, p; |
213 | 215 |
216 #ifdef POWERPC_PERFORMANCE_REPORT | |
214 POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1); | 217 POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1); |
218 #endif | |
215 | 219 |
216 IDCT | 220 IDCT |
217 | 221 |
218 p0 = vec_lvsl (0, dest); | 222 p0 = vec_lvsl (0, dest); |
219 p1 = vec_lvsl (stride, dest); | 223 p1 = vec_lvsl (stride, dest); |