37 ff_put_pixels8_mmxext(block, pixels, line_size, h);
38 ff_put_pixels8_mmxext(block + 8, pixels + 8, line_size, h);
47 int dstStride,
int src1Stride,
int h);
49 int dstStride,
int src1Stride,
int h);
51 int dstStride,
int src1Stride,
int h);
53 int dstStride,
int src1Stride,
int h);
55 int dstStride,
int src1Stride,
int h);
57 int dstStride,
int src1Stride,
int h);
59 int line_size,
int h);
61 int line_size,
int h);
62 #define ff_put_pixels8_l2_sse2 ff_put_pixels8_l2_mmxext
63 #define ff_avg_pixels8_l2_sse2 ff_avg_pixels8_l2_mmxext
64 #define ff_put_pixels16_l2_sse2 ff_put_pixels16_l2_mmxext
65 #define ff_avg_pixels16_l2_sse2 ff_avg_pixels16_l2_mmxext
67 #define DEF_QPEL(OPNAME)\
68 void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
69 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
70 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_ssse3(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
71 void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_l2_mmxext(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);\
72 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_l2_mmxext(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);\
73 void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_l2_ssse3(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride);\
74 void ff_ ## OPNAME ## _h264_qpel4_v_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
75 void ff_ ## OPNAME ## _h264_qpel8or16_v_lowpass_op_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h);\
76 void ff_ ## OPNAME ## _h264_qpel8or16_v_lowpass_sse2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h);\
77 void ff_ ## OPNAME ## _h264_qpel4_hv_lowpass_v_mmxext(uint8_t *src, int16_t *tmp, int srcStride);\
78 void ff_ ## OPNAME ## _h264_qpel4_hv_lowpass_h_mmxext(int16_t *tmp, uint8_t *dst, int dstStride);\
79 void ff_ ## OPNAME ## _h264_qpel8or16_hv1_lowpass_op_mmxext(uint8_t *src, int16_t *tmp, int srcStride, int size);\
80 void ff_ ## OPNAME ## _h264_qpel8or16_hv1_lowpass_op_sse2(uint8_t *src, int16_t *tmp, int srcStride, int size);\
81 void ff_ ## OPNAME ## _h264_qpel8or16_hv2_lowpass_op_mmxext(uint8_t *dst, int16_t *tmp, int dstStride, int unused, int h);\
82 void ff_ ## OPNAME ## _h264_qpel8or16_hv2_lowpass_ssse3(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size);\
83 void ff_ ## OPNAME ## _pixels4_l2_shift5_mmxext(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h);\
84 void ff_ ## OPNAME ## _pixels8_l2_shift5_mmxext(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h);
89 #define QPEL_H264(OPNAME, OP, MMX)\
90 static av_always_inline void ff_ ## OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
92 src -= 2*srcStride+2;\
94 ff_ ## OPNAME ## h264_qpel4_hv_lowpass_v_mmxext(src, tmp, srcStride);\
99 ff_ ## OPNAME ## h264_qpel4_hv_lowpass_h_mmxext(tmp, dst, dstStride);\
102 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
104 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_op_mmxext(dst, src, dstStride, srcStride, h);\
107 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_op_mmxext(dst, src, dstStride, srcStride, h);\
109 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv1_lowpass_ ## MMX(int16_t *tmp, uint8_t *src, int tmpStride, int srcStride, int size){\
110 int w = (size+8)>>2;\
111 src -= 2*srcStride+2;\
113 ff_ ## OPNAME ## h264_qpel8or16_hv1_lowpass_op_mmxext(src, tmp, srcStride, size);\
118 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size){\
121 ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_op_mmxext(dst, tmp, dstStride, 0, size);\
127 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
128 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\
130 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
131 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\
132 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
135 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
136 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
137 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
140 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
141 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
144 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
145 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
146 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
149 src2 += 8*src2Stride;\
150 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
151 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
154 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
155 ff_put_h264_qpel8or16_hv1_lowpass_ ## MMX(tmp, src, tmpStride, srcStride, size);\
156 ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
158 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
159 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 8);\
162 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
163 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 16);\
166 static av_always_inline void ff_ ## OPNAME ## pixels16_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
168 ff_ ## OPNAME ## pixels8_l2_shift5_ ## MMX(dst , src16 , src8 , dstStride, src8Stride, h);\
169 ff_ ## OPNAME ## pixels8_l2_shift5_ ## MMX(dst+8, src16+8, src8+8, dstStride, src8Stride, h);\
174 #define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
176 void ff_avg_h264_qpel16_h_lowpass_l2_ssse3(
uint8_t *
dst,
uint8_t *src,
uint8_t *src2,
int dstStride,
int src2Stride);
177 void ff_put_h264_qpel16_h_lowpass_l2_ssse3(
uint8_t *
dst,
uint8_t *src,
uint8_t *src2,
int dstStride,
int src2Stride);
180 #define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
181 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
182 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
183 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
186 src2 += 8*src2Stride;\
187 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
188 ff_ ## OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
190 #endif // ARCH_X86_64
192 #define QPEL_H264_H_XMM(OPNAME, OP, MMX)\
193 QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
194 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
195 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
196 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
199 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
200 ff_ ## OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
203 #define QPEL_H264_V_XMM(OPNAME, OP, MMX)\
204 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
205 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\
207 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
208 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\
209 ff_ ## OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
212 static av_always_inline void ff_put_h264_qpel8or16_hv1_lowpass_sse2(int16_t *tmp,
uint8_t *src,
int tmpStride,
int srcStride,
int size){
214 src -= 2*srcStride+2;
216 ff_put_h264_qpel8or16_hv1_lowpass_op_sse2(src, tmp, srcStride, size);
222 #define QPEL_H264_HV_XMM(OPNAME, OP, MMX)\
223 static av_always_inline void ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
224 ff_put_h264_qpel8or16_hv1_lowpass_sse2(tmp, src, tmpStride, srcStride, size);\
225 ff_ ## OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
227 static av_always_inline void ff_ ## OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
228 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 8);\
230 static av_always_inline void ff_ ## OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
231 ff_ ## OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 16);\
234 #define ff_put_h264_qpel8_h_lowpass_l2_sse2 ff_put_h264_qpel8_h_lowpass_l2_mmxext
235 #define ff_avg_h264_qpel8_h_lowpass_l2_sse2 ff_avg_h264_qpel8_h_lowpass_l2_mmxext
236 #define ff_put_h264_qpel16_h_lowpass_l2_sse2 ff_put_h264_qpel16_h_lowpass_l2_mmxext
237 #define ff_avg_h264_qpel16_h_lowpass_l2_sse2 ff_avg_h264_qpel16_h_lowpass_l2_mmxext
239 #define ff_put_h264_qpel8_v_lowpass_ssse3 ff_put_h264_qpel8_v_lowpass_sse2
240 #define ff_avg_h264_qpel8_v_lowpass_ssse3 ff_avg_h264_qpel8_v_lowpass_sse2
241 #define ff_put_h264_qpel16_v_lowpass_ssse3 ff_put_h264_qpel16_v_lowpass_sse2
242 #define ff_avg_h264_qpel16_v_lowpass_ssse3 ff_avg_h264_qpel16_v_lowpass_sse2
244 #define ff_put_h264_qpel8or16_hv2_lowpass_sse2 ff_put_h264_qpel8or16_hv2_lowpass_mmxext
245 #define ff_avg_h264_qpel8or16_hv2_lowpass_sse2 ff_avg_h264_qpel8or16_hv2_lowpass_mmxext
247 #define H264_MC(OPNAME, SIZE, MMX, ALIGN) \
248 H264_MC_C(OPNAME, SIZE, MMX, ALIGN)\
249 H264_MC_V(OPNAME, SIZE, MMX, ALIGN)\
250 H264_MC_H(OPNAME, SIZE, MMX, ALIGN)\
251 H264_MC_HV(OPNAME, SIZE, MMX, ALIGN)\
259 #define put_h264_qpel8_mc00_sse2 put_h264_qpel8_mc00_mmxext
260 #define avg_h264_qpel8_mc00_sse2 avg_h264_qpel8_mc00_mmxext
262 #define H264_MC_C(OPNAME, SIZE, MMX, ALIGN) \
263 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
264 ff_ ## OPNAME ## pixels ## SIZE ## _ ## MMX(dst, src, stride, SIZE);\
267 #define H264_MC_H(OPNAME, SIZE, MMX, ALIGN) \
268 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
269 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src, stride, stride);\
272 static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
273 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
276 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int 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, uint8_t *src, int stride){\
282 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
283 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
284 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\
287 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
288 ff_ ## OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
291 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
292 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
293 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
294 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\
297 #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \
298 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
299 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
300 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
301 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
304 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
305 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
306 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
307 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
310 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
311 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
312 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
313 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\
316 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
317 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
318 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, 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 ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
323 DECLARE_ALIGNED(ALIGN, uint16_t, temp)[SIZE*(SIZE<8?12:24)];\
324 ff_ ## OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, temp, src, stride, SIZE, stride);\
327 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
328 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
329 uint8_t * const halfHV= temp;\
330 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
331 assert(((int)temp & 7) == 0);\
332 ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
333 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\
336 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
337 DECLARE_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 assert(((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+stride, halfHV, stride, SIZE);\
345 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
346 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
347 uint8_t * const halfHV= temp;\
348 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
349 assert(((int)temp & 7) == 0);\
350 ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
351 ff_ ## OPNAME ## pixels ## SIZE ## _l2_shift5_mmxext(dst, halfV+2, halfHV, stride, SIZE, SIZE);\
354 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
355 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
356 uint8_t * const halfHV= temp;\
357 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
358 assert(((int)temp & 7) == 0);\
359 ff_put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
360 ff_ ## OPNAME ## pixels ## SIZE ## _l2_shift5_mmxext(dst, halfV+3, halfHV, stride, SIZE, SIZE);\
363 #define H264_MC_4816(MMX)\
364 H264_MC(put_, 4, MMX, 8)\
365 H264_MC(put_, 8, MMX, 8)\
366 H264_MC(put_, 16,MMX, 8)\
367 H264_MC(avg_, 4, MMX, 8)\
368 H264_MC(avg_, 8, MMX, 8)\
369 H264_MC(avg_, 16,MMX, 8)\
371 #define H264_MC_816(QPEL, XMM)\
372 QPEL(put_, 8, XMM, 16)\
373 QPEL(put_, 16,XMM, 16)\
374 QPEL(avg_, 8, XMM, 16)\
375 QPEL(avg_, 16,XMM, 16)\
378 #define PAVGB "pavgb"
379 QPEL_H264(put_, PUT_OP, mmxext)
380 QPEL_H264(avg_, AVG_MMXEXT_OP, mmxext)
381 QPEL_H264_V_XMM(put_, PUT_OP, sse2)
382 QPEL_H264_V_XMM(avg_,AVG_MMXEXT_OP, sse2)
383 QPEL_H264_HV_XMM(put_, PUT_OP, sse2)
384 QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, sse2)
385 QPEL_H264_H_XMM(put_, PUT_OP, ssse3)
386 QPEL_H264_H_XMM(avg_,AVG_MMXEXT_OP, ssse3)
387 QPEL_H264_HV_XMM(put_, PUT_OP, ssse3)
388 QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, ssse3)
392 H264_MC_816(H264_MC_V, sse2)
393 H264_MC_816(H264_MC_HV, sse2)
394 H264_MC_816(H264_MC_H, ssse3)
395 H264_MC_816(H264_MC_HV, ssse3)
399 #define LUMA_MC_OP(OP, NUM, DEPTH, TYPE, OPT) \
400 void ff_ ## OP ## _h264_qpel ## NUM ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT \
401 (uint8_t *dst, uint8_t *src, int stride);
403 #define LUMA_MC_ALL(DEPTH, TYPE, OPT) \
404 LUMA_MC_OP(put, 4, DEPTH, TYPE, OPT) \
405 LUMA_MC_OP(avg, 4, DEPTH, TYPE, OPT) \
406 LUMA_MC_OP(put, 8, DEPTH, TYPE, OPT) \
407 LUMA_MC_OP(avg, 8, DEPTH, TYPE, OPT) \
408 LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
409 LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
411 #define LUMA_MC_816(DEPTH, TYPE, OPT) \
412 LUMA_MC_OP(put, 8, DEPTH, TYPE, OPT) \
413 LUMA_MC_OP(avg, 8, DEPTH, TYPE, OPT) \
414 LUMA_MC_OP(put, 16, DEPTH, TYPE, OPT) \
415 LUMA_MC_OP(avg, 16, DEPTH, TYPE, OPT)
417 LUMA_MC_ALL(10, mc00, mmxext)
418 LUMA_MC_ALL(10, mc10, mmxext)
419 LUMA_MC_ALL(10, mc20, mmxext)
420 LUMA_MC_ALL(10, mc30, mmxext)
421 LUMA_MC_ALL(10, mc01, mmxext)
422 LUMA_MC_ALL(10, mc11, mmxext)
423 LUMA_MC_ALL(10, mc21, mmxext)
424 LUMA_MC_ALL(10, mc31, mmxext)
425 LUMA_MC_ALL(10, mc02, mmxext)
426 LUMA_MC_ALL(10, mc12, mmxext)
427 LUMA_MC_ALL(10, mc22, mmxext)
428 LUMA_MC_ALL(10, mc32, mmxext)
429 LUMA_MC_ALL(10, mc03, mmxext)
430 LUMA_MC_ALL(10, mc13, mmxext)
431 LUMA_MC_ALL(10, mc23, mmxext)
432 LUMA_MC_ALL(10, mc33, mmxext)
434 LUMA_MC_816(10, mc00, sse2)
435 LUMA_MC_816(10, mc10, sse2)
436 LUMA_MC_816(10, mc10, sse2_cache64)
437 LUMA_MC_816(10, mc10, ssse3_cache64)
438 LUMA_MC_816(10, mc20, sse2)
439 LUMA_MC_816(10, mc20, sse2_cache64)
440 LUMA_MC_816(10, mc20, ssse3_cache64)
441 LUMA_MC_816(10, mc30, sse2)
442 LUMA_MC_816(10, mc30, sse2_cache64)
443 LUMA_MC_816(10, mc30, ssse3_cache64)
444 LUMA_MC_816(10, mc01, sse2)
445 LUMA_MC_816(10, mc11, sse2)
446 LUMA_MC_816(10, mc21, sse2)
447 LUMA_MC_816(10, mc31, sse2)
448 LUMA_MC_816(10, mc02, sse2)
449 LUMA_MC_816(10, mc12, sse2)
450 LUMA_MC_816(10, mc22, sse2)
451 LUMA_MC_816(10, mc32, sse2)
452 LUMA_MC_816(10, mc03, sse2)
453 LUMA_MC_816(10, mc13, sse2)
454 LUMA_MC_816(10, mc23, sse2)
455 LUMA_MC_816(10, mc33, sse2)
457 #define QPEL16_OPMC(OP, MC, MMX)\
458 void ff_ ## OP ## _h264_qpel16_ ## MC ## _10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
459 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst , src , stride);\
460 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
463 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst , src , stride);\
464 ff_ ## OP ## _h264_qpel8_ ## MC ## _10_ ## MMX(dst+16, src+16, stride);\
467 #define QPEL16_OP(MC, MMX)\
468 QPEL16_OPMC(put, MC, MMX)\
469 QPEL16_OPMC(avg, MC, MMX)
472 QPEL16_OP(mc00, MMX)\
473 QPEL16_OP(mc01, MMX)\
474 QPEL16_OP(mc02, MMX)\
475 QPEL16_OP(mc03, MMX)\
476 QPEL16_OP(mc10, MMX)\
477 QPEL16_OP(mc11, MMX)\
478 QPEL16_OP(mc12, MMX)\
479 QPEL16_OP(mc13, MMX)\
480 QPEL16_OP(mc20, MMX)\
481 QPEL16_OP(mc21, MMX)\
482 QPEL16_OP(mc22, MMX)\
483 QPEL16_OP(mc23, MMX)\
484 QPEL16_OP(mc30, MMX)\
485 QPEL16_OP(mc31, MMX)\
486 QPEL16_OP(mc32, MMX)\
489 #if ARCH_X86_32 && HAVE_YASM && CONFIG_H264QPEL // ARCH_X86_64 implies SSE2+
495 #define SET_QPEL_FUNCS(PFX, IDX, SIZE, CPU, PREFIX) \
497 c->PFX ## _pixels_tab[IDX][ 0] = PREFIX ## PFX ## SIZE ## _mc00_ ## CPU; \
498 c->PFX ## _pixels_tab[IDX][ 1] = PREFIX ## PFX ## SIZE ## _mc10_ ## CPU; \
499 c->PFX ## _pixels_tab[IDX][ 2] = PREFIX ## PFX ## SIZE ## _mc20_ ## CPU; \
500 c->PFX ## _pixels_tab[IDX][ 3] = PREFIX ## PFX ## SIZE ## _mc30_ ## CPU; \
501 c->PFX ## _pixels_tab[IDX][ 4] = PREFIX ## PFX ## SIZE ## _mc01_ ## CPU; \
502 c->PFX ## _pixels_tab[IDX][ 5] = PREFIX ## PFX ## SIZE ## _mc11_ ## CPU; \
503 c->PFX ## _pixels_tab[IDX][ 6] = PREFIX ## PFX ## SIZE ## _mc21_ ## CPU; \
504 c->PFX ## _pixels_tab[IDX][ 7] = PREFIX ## PFX ## SIZE ## _mc31_ ## CPU; \
505 c->PFX ## _pixels_tab[IDX][ 8] = PREFIX ## PFX ## SIZE ## _mc02_ ## CPU; \
506 c->PFX ## _pixels_tab[IDX][ 9] = PREFIX ## PFX ## SIZE ## _mc12_ ## CPU; \
507 c->PFX ## _pixels_tab[IDX][10] = PREFIX ## PFX ## SIZE ## _mc22_ ## CPU; \
508 c->PFX ## _pixels_tab[IDX][11] = PREFIX ## PFX ## SIZE ## _mc32_ ## CPU; \
509 c->PFX ## _pixels_tab[IDX][12] = PREFIX ## PFX ## SIZE ## _mc03_ ## CPU; \
510 c->PFX ## _pixels_tab[IDX][13] = PREFIX ## PFX ## SIZE ## _mc13_ ## CPU; \
511 c->PFX ## _pixels_tab[IDX][14] = PREFIX ## PFX ## SIZE ## _mc23_ ## CPU; \
512 c->PFX ## _pixels_tab[IDX][15] = PREFIX ## PFX ## SIZE ## _mc33_ ## CPU; \
515 #define H264_QPEL_FUNCS(x, y, CPU) \
517 c->put_h264_qpel_pixels_tab[0][x + y * 4] = put_h264_qpel16_mc ## x ## y ## _ ## CPU; \
518 c->put_h264_qpel_pixels_tab[1][x + y * 4] = put_h264_qpel8_mc ## x ## y ## _ ## CPU; \
519 c->avg_h264_qpel_pixels_tab[0][x + y * 4] = avg_h264_qpel16_mc ## x ## y ## _ ## CPU; \
520 c->avg_h264_qpel_pixels_tab[1][x + y * 4] = avg_h264_qpel8_mc ## x ## y ## _ ## CPU; \
523 #define H264_QPEL_FUNCS_10(x, y, CPU) \
525 c->put_h264_qpel_pixels_tab[0][x + y * 4] = ff_put_h264_qpel16_mc ## x ## y ## _10_ ## CPU; \
526 c->put_h264_qpel_pixels_tab[1][x + y * 4] = ff_put_h264_qpel8_mc ## x ## y ## _10_ ## CPU; \
527 c->avg_h264_qpel_pixels_tab[0][x + y * 4] = ff_avg_h264_qpel16_mc ## x ## y ## _10_ ## CPU; \
528 c->avg_h264_qpel_pixels_tab[1][x + y * 4] = ff_avg_h264_qpel8_mc ## x ## y ## _10_ ## CPU; \
534 int high_bit_depth = bit_depth > 8;
538 if (!high_bit_depth) {
545 }
else if (bit_depth == 10) {
563 if (!high_bit_depth) {
578 if (bit_depth == 10) {
590 if (!high_bit_depth) {
605 if (bit_depth == 10) {
617 if (bit_depth == 10) {