comparison ppc/dsputil_h264_altivec.c @ 3544:8bb61d9a2c40 libavcodec

avoid alignment hacks, luckly gcc does the right thing on arches different from x86
author lu_zero
date Thu, 03 Aug 2006 13:21:13 +0000
parents bec1eb6d3746
children
comparison
equal deleted inserted replaced
3543:6aabb2bec46c 3544:8bb61d9a2c40
69 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, int stride){\ 69 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, int stride){\
70 OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\ 70 OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
71 }\ 71 }\
72 \ 72 \
73 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \ 73 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \
74 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\ 74 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
75 uint8_t * const half= (uint8_t*)temp;\
76 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ 75 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
77 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\ 76 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
78 }\ 77 }\
79 \ 78 \
80 static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 79 static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
81 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(dst, src, stride, stride);\ 80 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(dst, src, stride, stride);\
82 }\ 81 }\
83 \ 82 \
84 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 83 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
85 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\ 84 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
86 uint8_t * const half= (uint8_t*)temp;\
87 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ 85 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
88 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\ 86 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\
89 }\ 87 }\
90 \ 88 \
91 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 89 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
92 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\ 90 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
93 uint8_t * const half= (uint8_t*)temp;\
94 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ 91 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
95 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\ 92 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
96 }\ 93 }\
97 \ 94 \
98 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 95 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
99 OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(dst, src, stride, stride);\ 96 OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(dst, src, stride, stride);\
100 }\ 97 }\
101 \ 98 \
102 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 99 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
103 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\ 100 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
104 uint8_t * const half= (uint8_t*)temp;\
105 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ 101 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
106 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\ 102 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\
107 }\ 103 }\
108 \ 104 \
109 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 105 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
110 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\ 106 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
111 uint8_t * const halfH= (uint8_t*)temp;\ 107 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
112 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
113 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\ 108 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
114 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\ 109 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
115 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\ 110 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
116 }\ 111 }\
117 \ 112 \
118 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 113 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
119 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\ 114 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
120 uint8_t * const halfH= (uint8_t*)temp;\ 115 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
121 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
122 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\ 116 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
123 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\ 117 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
124 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\ 118 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
125 }\ 119 }\
126 \ 120 \
127 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 121 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
128 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\ 122 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
129 uint8_t * const halfH= (uint8_t*)temp;\ 123 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
130 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
131 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\ 124 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
132 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\ 125 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
133 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\ 126 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
134 }\ 127 }\
135 \ 128 \
136 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 129 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
137 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\ 130 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
138 uint8_t * const halfH= (uint8_t*)temp;\ 131 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
139 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
140 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\ 132 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
141 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\ 133 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
142 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\ 134 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
143 }\ 135 }\
144 \ 136 \
145 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 137 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
146 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4]);\ 138 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
147 int16_t * const tmp= (int16_t*)temp;\
148 OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\ 139 OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\
149 }\ 140 }\
150 \ 141 \
151 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 142 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
152 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\ 143 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
153 uint8_t * const halfH= (uint8_t*)temp;\ 144 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
154 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\ 145 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
155 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
156 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\ 146 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
157 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\ 147 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
158 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\ 148 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
159 }\ 149 }\
160 \ 150 \
161 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 151 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
162 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\ 152 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
163 uint8_t * const halfH= (uint8_t*)temp;\ 153 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
164 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\ 154 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
165 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
166 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\ 155 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
167 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\ 156 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
168 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\ 157 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
169 }\ 158 }\
170 \ 159 \
171 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 160 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
172 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\ 161 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
173 uint8_t * const halfV= (uint8_t*)temp;\ 162 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
174 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\ 163 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
175 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
176 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\ 164 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
177 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\ 165 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
178 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\ 166 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
179 }\ 167 }\
180 \ 168 \
181 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\ 169 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
182 DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\ 170 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
183 uint8_t * const halfV= (uint8_t*)temp;\ 171 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
184 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\ 172 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
185 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
186 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\ 173 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
187 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\ 174 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
188 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\ 175 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
189 }\ 176 }\
190 177