33 int dstStride,
int src1Stride,
int h);
35 int dstStride,
int src1Stride,
int h);
37 int dstStride,
int src1Stride,
int h);
39 int dstStride,
int src1Stride,
int h);
41 int dstStride,
int src1Stride,
int h);
43 int dstStride,
int src1Stride,
int h);
44 #define ff_put_pixels8_l2_sse2 ff_put_pixels8_l2_mmxext
45 #define ff_avg_pixels8_l2_sse2 ff_avg_pixels8_l2_mmxext
46 #define ff_put_pixels16_l2_sse2 ff_put_pixels16_l2_mmxext
47 #define ff_avg_pixels16_l2_sse2 ff_avg_pixels16_l2_mmxext
48 #define ff_put_pixels16_mmxext ff_put_pixels16_mmx
49 #define ff_put_pixels8_mmxext ff_put_pixels8_mmx
50 #define ff_put_pixels4_mmxext ff_put_pixels4_mmx
52 #define DEF_QPEL(OPNAME)\
53 void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_mmxext(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride);\
54 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_mmxext(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride);\
55 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_ssse3(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride);\
56 void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_l2_mmxext(uint8_t *dst, const uint8_t *src, const uint8_t *src2, int dstStride, int src2Stride);\
57 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_l2_mmxext(uint8_t *dst, const uint8_t *src, const uint8_t *src2, int dstStride, int src2Stride);\
58 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_l2_ssse3(uint8_t *dst, const uint8_t *src, const uint8_t *src2, int dstStride, int src2Stride);\
59 void ff_ ## OPNAME ## _h264_qpel4_v_lowpass_mmxext(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride);\
60 void ff_ ## OPNAME ## _h264_qpel8or16_v_lowpass_op_mmxext(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h);\
61 void ff_ ## OPNAME ## _h264_qpel8or16_v_lowpass_sse2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h);\
62 void ff_ ## OPNAME ## _h264_qpel4_hv_lowpass_v_mmxext(const uint8_t *src, int16_t *tmp, int srcStride);\
63 void ff_ ## OPNAME ## _h264_qpel4_hv_lowpass_h_mmxext(int16_t *tmp, uint8_t *dst, int dstStride);\
64 void ff_ ## OPNAME ## _h264_qpel8or16_hv1_lowpass_op_mmxext(const uint8_t *src, int16_t *tmp, int srcStride, int size);\
65 void ff_ ## OPNAME ## _h264_qpel8or16_hv1_lowpass_op_sse2(const uint8_t *src, int16_t *tmp, int srcStride, int size);\
66 void ff_ ## OPNAME ## _h264_qpel8or16_hv2_lowpass_op_mmxext(uint8_t *dst, int16_t *tmp, int dstStride, int unused, int h);\
67 void ff_ ## OPNAME ## _h264_qpel8or16_hv2_lowpass_ssse3(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size);\
68 void ff_ ## OPNAME ## _pixels4_l2_shift5_mmxext(uint8_t *dst, const int16_t *src16, const uint8_t *src8, int dstStride, int src8Stride, int h);\
69 void ff_ ## OPNAME ## _pixels8_l2_shift5_mmxext(uint8_t *dst, const int16_t *src16, const uint8_t *src8, int dstStride, int src8Stride, int h);
76 int w = (
size + 8) >> 2;
77 src -= 2 * srcStride + 2;
79 ff_put_h264_qpel8or16_hv1_lowpass_op_mmxext(
src,
tmp, srcStride,
size);
85 #define QPEL_H264(OPNAME, OP, MMX)\
86 static av_always_inline void ff_ ## OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, const uint8_t *src, int dstStride, int tmpStride, int srcStride){\
88 src -= 2*srcStride+2;\
90 ff_ ## OPNAME ## h264_qpel4_hv_lowpass_v_mmxext(src, tmp, srcStride);\
95 ff_ ## OPNAME ## h264_qpel4_hv_lowpass_h_mmxext(tmp, dst, dstStride);\
98 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h){\
100 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_op_mmxext(dst, src, dstStride, srcStride, h);\
103 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_op_mmxext(dst, src, dstStride, srcStride, h);\
105 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size){\
108 ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_op_mmxext(dst, tmp, dstStride, 0, size);\
114 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
115 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\
117 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
118 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\
119 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
122 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
123 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
124 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
127 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
128 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
131 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, const uint8_t *src, const uint8_t *src2, int dstStride, int src2Stride){\
132 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
133 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
136 src2 += 8*src2Stride;\
137 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
138 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
141 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, const uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
142 ff_put_h264_qpel8or16_hv1_lowpass_ ## MMX(tmp, src, tmpStride, srcStride, size);\
143 ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
145 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, const uint8_t *src, int dstStride, int tmpStride, int srcStride){\
146 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 8);\
149 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, const uint8_t *src, int dstStride, int tmpStride, int srcStride){\
150 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 16);\
153 static av_always_inline void ff_ ## OPNAME ## pixels16_l2_shift5_ ## MMX(uint8_t *dst, const int16_t *src16, const uint8_t *src8, int dstStride, int src8Stride, int h)\
155 ff_ ## OPNAME ## pixels8_l2_shift5_ ## MMX(dst , src16 , src8 , dstStride, src8Stride, h);\
156 ff_ ## OPNAME ## pixels8_l2_shift5_ ## MMX(dst+8, src16+8, src8+8, dstStride, src8Stride, h);\
161 #define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
163 void ff_avg_h264_qpel16_h_lowpass_l2_ssse3(
uint8_t *dst,
const uint8_t *
src,
const uint8_t *src2,
int dstStride,
int src2Stride);
164 void ff_put_h264_qpel16_h_lowpass_l2_ssse3(
uint8_t *dst,
const uint8_t *
src,
const uint8_t *src2,
int dstStride,
int src2Stride);
167 #define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
168 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, const uint8_t *src, const uint8_t *src2, int dstStride, int src2Stride){\
169 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
170 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
173 src2 += 8*src2Stride;\
174 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
175 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
177 #endif // ARCH_X86_64
179 #define QPEL_H264_H_XMM(OPNAME, OP, MMX)\
180 QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
181 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
182 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
183 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
186 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
187 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
190 #define QPEL_H264_V_XMM(OPNAME, OP, MMX)\
191 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
192 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\
194 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
195 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\
196 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
206 src -= 2*srcStride+2;
208 ff_put_h264_qpel8or16_hv1_lowpass_op_sse2(
src,
tmp, srcStride,
size);
214 #define QPEL_H264_HV_XMM(OPNAME, OP, MMX)\
215 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, const uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
216 put_h264_qpel8or16_hv1_lowpass_sse2(tmp, src, tmpStride, srcStride, size);\
217 ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
219 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, const uint8_t *src, int dstStride, int tmpStride, int srcStride){\
220 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 8);\
222 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, const uint8_t *src, int dstStride, int tmpStride, int srcStride){\
223 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 16);\
226 #define ff_put_h264_qpel8_h_lowpass_l2_sse2 ff_put_h264_qpel8_h_lowpass_l2_mmxext
227 #define ff_avg_h264_qpel8_h_lowpass_l2_sse2 ff_avg_h264_qpel8_h_lowpass_l2_mmxext
228 #define ff_put_h264_qpel16_h_lowpass_l2_sse2 ff_put_h264_qpel16_h_lowpass_l2_mmxext
229 #define ff_avg_h264_qpel16_h_lowpass_l2_sse2 ff_avg_h264_qpel16_h_lowpass_l2_mmxext
231 #define ff_put_h264_qpel8_v_lowpass_ssse3 ff_put_h264_qpel8_v_lowpass_sse2
232 #define ff_avg_h264_qpel8_v_lowpass_ssse3 ff_avg_h264_qpel8_v_lowpass_sse2
233 #define ff_put_h264_qpel16_v_lowpass_ssse3 ff_put_h264_qpel16_v_lowpass_sse2
234 #define ff_avg_h264_qpel16_v_lowpass_ssse3 ff_avg_h264_qpel16_v_lowpass_sse2
236 #define ff_put_h264_qpel8or16_hv2_lowpass_sse2 ff_put_h264_qpel8or16_hv2_lowpass_mmxext
237 #define ff_avg_h264_qpel8or16_hv2_lowpass_sse2 ff_avg_h264_qpel8or16_hv2_lowpass_mmxext
239 #define H264_MC(OPNAME, SIZE, MMX, ALIGN) \
240 H264_MC_C(OPNAME, SIZE, MMX, ALIGN)\
241 H264_MC_V(OPNAME, SIZE, MMX, ALIGN)\
242 H264_MC_H(OPNAME, SIZE, MMX, ALIGN)\
243 H264_MC_HV(OPNAME, SIZE, MMX, ALIGN)\
255 #define put_h264_qpel8_mc00_sse2 put_h264_qpel8_mc00_mmxext
256 #define avg_h264_qpel8_mc00_sse2 avg_h264_qpel8_mc00_mmxext
258 #define H264_MC_C(OPNAME, SIZE, MMX, ALIGN) \
259 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
261 ff_ ## OPNAME ## pixels ## SIZE ## _ ## MMX(dst, src, stride, SIZE);\
264 #define H264_MC_H(OPNAME, SIZE, MMX, ALIGN) \
265 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
267 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src, stride, stride);\
270 static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
272 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
275 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
277 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src+1, stride, stride);\
280 #define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \
281 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
283 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
284 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
285 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\
288 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
290 ff_ ## OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
293 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
295 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
296 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
297 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\
300 #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \
301 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
303 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
304 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
305 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
308 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
310 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
311 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
312 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
315 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
317 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
318 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
319 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\
322 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
324 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
325 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
326 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\
329 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
331 LOCAL_ALIGNED(ALIGN, uint16_t, temp, [SIZE*(SIZE<8?12:24)]);\
332 ff_ ## OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, temp, src, stride, SIZE, stride);\
335 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
337 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\
338 uint8_t * const halfHV= temp;\
339 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
340 av_assert2(((int)temp & 7) == 0);\
341 ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
342 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\
345 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
347 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\
348 uint8_t * const halfHV= temp;\
349 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
350 av_assert2(((int)temp & 7) == 0);\
351 ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
352 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfHV, stride, SIZE);\
355 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
357 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\
358 uint8_t * const halfHV= temp;\
359 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
360 av_assert2(((int)temp & 7) == 0);\
361 ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
362 ff_ ## OPNAME ## pixels ## SIZE ## _l2_shift5_mmxext(dst, halfV+2, halfHV, stride, SIZE, SIZE);\
365 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
367 LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE]);\
368 uint8_t * const halfHV= temp;\
369 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
370 av_assert2(((int)temp & 7) == 0);\
371 ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
372 ff_ ## OPNAME ## pixels ## SIZE ## _l2_shift5_mmxext(dst, halfV+3, halfHV, stride, SIZE, SIZE);\
375 #define H264_MC_4816(MMX)\
376 H264_MC(put_, 4, MMX, 8)\
377 H264_MC(put_, 8, MMX, 8)\
378 H264_MC(put_, 16,MMX, 8)\
379 H264_MC(avg_, 4, MMX, 8)\
380 H264_MC(avg_, 8, MMX, 8)\
381 H264_MC(avg_, 16,MMX, 8)\
383 #define H264_MC_816(QPEL, XMM)\
384 QPEL(put_, 8, XMM, 16)\
385 QPEL(put_, 16,XMM, 16)\
386 QPEL(avg_, 8, XMM, 16)\
387 QPEL(avg_, 16,XMM, 16)\
389 QPEL_H264(put_, PUT_OP, mmxext)
390 QPEL_H264(avg_, AVG_MMXEXT_OP, mmxext)
391 QPEL_H264_V_XMM(put_, PUT_OP, sse2)
392 QPEL_H264_V_XMM(avg_,AVG_MMXEXT_OP, sse2)
393 QPEL_H264_HV_XMM(put_, PUT_OP, sse2)
394 QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, sse2)
395 QPEL_H264_H_XMM(put_, PUT_OP, ssse3)
396 QPEL_H264_H_XMM(avg_,AVG_MMXEXT_OP, ssse3)
397 QPEL_H264_HV_XMM(put_, PUT_OP, ssse3)
398 QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, ssse3)
401 H264_MC_816(H264_MC_V, sse2)
402 H264_MC_816(H264_MC_HV, sse2)
403 H264_MC_816(H264_MC_H, ssse3)
404 H264_MC_816(H264_MC_HV, ssse3)
408 #define LUMA_MC_OP(OP, NUM, DEPTH, TYPE, OPT) \
409 void ff_ ## OP ## _h264_qpel ## NUM ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT \
410 (uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
412 #define LUMA_MC_ALL(DEPTH, TYPE, OPT) \
413 LUMA_MC_OP(put, 4, DEPTH, TYPE, OPT) \
414 LUMA_MC_OP(avg, 4, DEPTH, TYPE, OPT) \
415 LUMA_MC_OP(put, 8, DEPTH, TYPE, OPT) \
416 LUMA_MC_OP(avg, 8, DEPTH, TYPE, OPT) \
417 LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
418 LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
420 #define LUMA_MC_816(DEPTH, TYPE, OPT) \
421 LUMA_MC_OP(put, 8, DEPTH, TYPE, OPT) \
422 LUMA_MC_OP(avg, 8, DEPTH, TYPE, OPT) \
423 LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
424 LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
426 LUMA_MC_ALL(10, mc00, mmxext)
427 LUMA_MC_ALL(10, mc10, mmxext)
428 LUMA_MC_ALL(10, mc20, mmxext)
429 LUMA_MC_ALL(10, mc30, mmxext)
430 LUMA_MC_ALL(10, mc01, mmxext)
431 LUMA_MC_ALL(10, mc11, mmxext)
432 LUMA_MC_ALL(10, mc21, mmxext)
433 LUMA_MC_ALL(10, mc31, mmxext)
434 LUMA_MC_ALL(10, mc02, mmxext)
435 LUMA_MC_ALL(10, mc12, mmxext)
436 LUMA_MC_ALL(10, mc22, mmxext)
437 LUMA_MC_ALL(10, mc32, mmxext)
438 LUMA_MC_ALL(10, mc03, mmxext)
439 LUMA_MC_ALL(10, mc13, mmxext)
440 LUMA_MC_ALL(10, mc23, mmxext)
441 LUMA_MC_ALL(10, mc33, mmxext)
443 LUMA_MC_816(10, mc00, sse2)
444 LUMA_MC_816(10, mc10, sse2)
445 LUMA_MC_816(10, mc10, sse2_cache64)
446 LUMA_MC_816(10, mc10, ssse3_cache64)
447 LUMA_MC_816(10, mc20, sse2)
448 LUMA_MC_816(10, mc20, sse2_cache64)
449 LUMA_MC_816(10, mc20, ssse3_cache64)
450 LUMA_MC_816(10, mc30, sse2)
451 LUMA_MC_816(10, mc30, sse2_cache64)
452 LUMA_MC_816(10, mc30, ssse3_cache64)
453 LUMA_MC_816(10, mc01, sse2)
454 LUMA_MC_816(10, mc11, sse2)
455 LUMA_MC_816(10, mc21, sse2)
456 LUMA_MC_816(10, mc31, sse2)
457 LUMA_MC_816(10, mc02, sse2)
458 LUMA_MC_816(10, mc12, sse2)
459 LUMA_MC_816(10, mc22, sse2)
460 LUMA_MC_816(10, mc32, sse2)
461 LUMA_MC_816(10, mc03, sse2)
462 LUMA_MC_816(10, mc13, sse2)
463 LUMA_MC_816(10, mc23, sse2)
464 LUMA_MC_816(10, mc33, sse2)
466 #define QPEL16_OPMC(OP, MC, MMX)\
467 void ff_ ## OP ## _h264_qpel16_ ## MC ## _10_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride){\
468 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst , src , stride);\
469 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
472 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst , src , stride);\
473 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
476 #define QPEL16_OP(MC, MMX)\
477 QPEL16_OPMC(put, MC, MMX)\
478 QPEL16_OPMC(avg, MC, MMX)
481 QPEL16_OP(mc00, MMX)\
482 QPEL16_OP(mc01, MMX)\
483 QPEL16_OP(mc02, MMX)\
484 QPEL16_OP(mc03, MMX)\
485 QPEL16_OP(mc10, MMX)\
486 QPEL16_OP(mc11, MMX)\
487 QPEL16_OP(mc12, MMX)\
488 QPEL16_OP(mc13, MMX)\
489 QPEL16_OP(mc20, MMX)\
490 QPEL16_OP(mc21, MMX)\
491 QPEL16_OP(mc22, MMX)\
492 QPEL16_OP(mc23, MMX)\
493 QPEL16_OP(mc30, MMX)\
494 QPEL16_OP(mc31, MMX)\
495 QPEL16_OP(mc32, MMX)\
498 #if ARCH_X86_32 // ARCH_X86_64 implies SSE2+
504 #define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX) \
506 c->PFX ## _pixels_tab[IDX][ 0] = PREFIX ## PFX ## SIZE ## _mc00_ ## CPU; \
507 c->PFX ## _pixels_tab[IDX][ 1] = PREFIX ## PFX ## SIZE ## _mc10_ ## CPU; \
508 c->PFX ## _pixels_tab[IDX][ 2] = PREFIX ## PFX ## SIZE ## _mc20_ ## CPU; \
509 c->PFX ## _pixels_tab[IDX][ 3] = PREFIX ## PFX ## SIZE ## _mc30_ ## CPU; \
510 c->PFX ## _pixels_tab[IDX][ 4] = PREFIX ## PFX ## SIZE ## _mc01_ ## CPU; \
511 c->PFX ## _pixels_tab[IDX][ 5] = PREFIX ## PFX ## SIZE ## _mc11_ ## CPU; \
512 c->PFX ## _pixels_tab[IDX][ 6] = PREFIX ## PFX ## SIZE ## _mc21_ ## CPU; \
513 c->PFX ## _pixels_tab[IDX][ 7] = PREFIX ## PFX ## SIZE ## _mc31_ ## CPU; \
514 c->PFX ## _pixels_tab[IDX][ 8] = PREFIX ## PFX ## SIZE ## _mc02_ ## CPU; \
515 c->PFX ## _pixels_tab[IDX][ 9] = PREFIX ## PFX ## SIZE ## _mc12_ ## CPU; \
516 c->PFX ## _pixels_tab[IDX][10] = PREFIX ## PFX ## SIZE ## _mc22_ ## CPU; \
517 c->PFX ## _pixels_tab[IDX][11] = PREFIX ## PFX ## SIZE ## _mc32_ ## CPU; \
518 c->PFX ## _pixels_tab[IDX][12] = PREFIX ## PFX ## SIZE ## _mc03_ ## CPU; \
519 c->PFX ## _pixels_tab[IDX][13] = PREFIX ## PFX ## SIZE ## _mc13_ ## CPU; \
520 c->PFX ## _pixels_tab[IDX][14] = PREFIX ## PFX ## SIZE ## _mc23_ ## CPU; \
521 c->PFX ## _pixels_tab[IDX][15] = PREFIX ## PFX ## SIZE ## _mc33_ ## CPU; \
524 #define H264_QPEL_FUNCS(x, y, CPU) \
526 c->put_h264_qpel_pixels_tab[0][x + y * 4] = put_h264_qpel16_mc ## x ## y ## _ ## CPU; \
527 c->put_h264_qpel_pixels_tab[1][x + y * 4] = put_h264_qpel8_mc ## x ## y ## _ ## CPU; \
528 c->avg_h264_qpel_pixels_tab[0][x + y * 4] = avg_h264_qpel16_mc ## x ## y ## _ ## CPU; \
529 c->avg_h264_qpel_pixels_tab[1][x + y * 4] = avg_h264_qpel8_mc ## x ## y ## _ ## CPU; \
532 #define H264_QPEL_FUNCS_10(x, y, CPU) \
534 c->put_h264_qpel_pixels_tab[0][x + y * 4] = ff_put_h264_qpel16_mc ## x ## y ## _10_ ## CPU; \
535 c->put_h264_qpel_pixels_tab[1][x + y * 4] = ff_put_h264_qpel8_mc ## x ## y ## _10_ ## CPU; \
536 c->avg_h264_qpel_pixels_tab[0][x + y * 4] = ff_avg_h264_qpel16_mc ## x ## y ## _10_ ## CPU; \
537 c->avg_h264_qpel_pixels_tab[1][x + y * 4] = ff_avg_h264_qpel8_mc ## x ## y ## _10_ ## CPU; \
547 if (!high_bit_depth) {
567 if (!high_bit_depth) {
594 if (!high_bit_depth) {
600 if (!high_bit_depth) {