comparison ppc/idct_altivec.c @ 1277:f3152eb76f1a libavcodec

altivec gcc-3 fixes by (Magnus Damm <damm at opensource dot se>)
author michaelni
date Wed, 21 May 2003 17:50:57 +0000
parents b32afefe7d33
children e8ff4783f188
comparison
equal deleted inserted replaced
1276:d5719a953ee0 1277:f3152eb76f1a
36 36
37 37
38 #include <stdlib.h> /* malloc(), free() */ 38 #include <stdlib.h> /* malloc(), free() */
39 #include <string.h> 39 #include <string.h>
40 #include "../dsputil.h" 40 #include "../dsputil.h"
41
42 #include "gcc_fixes.h"
43
41 #include "dsputil_altivec.h" 44 #include "dsputil_altivec.h"
42 45
43 #define vector_s16_t vector signed short 46 #define vector_s16_t vector signed short
44 #define vector_u16_t vector unsigned short 47 #define vector_u16_t vector unsigned short
45 #define vector_s8_t vector signed char 48 #define vector_s8_t vector signed char
150 vx5 = vec_sra (vy5, shift); \ 153 vx5 = vec_sra (vy5, shift); \
151 vx6 = vec_sra (vy6, shift); \ 154 vx6 = vec_sra (vy6, shift); \
152 vx7 = vec_sra (vy7, shift); 155 vx7 = vec_sra (vy7, shift);
153 156
154 157
155 #ifdef CONFIG_DARWIN
156 static const vector_s16_t constants[5] = { 158 static const vector_s16_t constants[5] = {
157 (vector_s16_t)(23170, 13573, 6518, 21895, -23170, -21895, 32, 31), 159 (vector_s16_t) AVV(23170, 13573, 6518, 21895, -23170, -21895, 32, 31),
158 (vector_s16_t)(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725), 160 (vector_s16_t) AVV(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725),
159 (vector_s16_t)(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521), 161 (vector_s16_t) AVV(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521),
160 (vector_s16_t)(21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692), 162 (vector_s16_t) AVV(21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692),
161 (vector_s16_t)(19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722) 163 (vector_s16_t) AVV(19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722)
162 }; 164 };
163 #else
164 // broken gcc
165 static const vector_s16_t constants[5] = {
166 (vector_s16_t){23170, 13573, 6518, 21895, -23170, -21895, 32, 31},
167 (vector_s16_t){16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725},
168 (vector_s16_t){22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521},
169 (vector_s16_t){21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692},
170 (vector_s16_t){19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722}
171 };
172 #endif
173 165
174 void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block) 166 void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block)
175 { 167 {
176 POWERPC_TBL_DECLARE(altivec_idct_put_num, 1); 168 POWERPC_TBL_DECLARE(altivec_idct_put_num, 1);
177 #ifdef ALTIVEC_USE_REFERENCE_C_CODE 169 #ifdef ALTIVEC_USE_REFERENCE_C_CODE