29 #define IDCT_ADD_FUNC(NUM, DEPTH, OPT) \
30 void ff_h264_idct ## NUM ## _add_ ## DEPTH ## _ ## OPT(uint8_t *dst, \
49 #define IDCT_ADD_REP_FUNC(NUM, REP, DEPTH, OPT) \
50 void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
51 (uint8_t *dst, const int *block_offset, \
52 int16_t *block, int stride, const uint8_t nnzc[5 * 8]);
65 #define IDCT_ADD_REP_FUNC2(NUM, REP, DEPTH, OPT) \
66 void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \
67 (uint8_t **dst, const int *block_offset, \
68 int16_t *block, int stride, const uint8_t nnzc[15 * 8]);
87 int bidir,
int edges,
int step,
88 int mask_mv0,
int mask_mv1,
int field);
90 #define LF_FUNC(DIR, TYPE, DEPTH, OPT) \
91 void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix, \
96 #define LF_IFUNC(DIR, TYPE, DEPTH, OPT) \
97 void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## OPT(uint8_t *pix, \
102 #define LF_FUNCS(type, depth) \
103 LF_FUNC(h, luma, depth, sse2) \
104 LF_IFUNC(h, luma_intra, depth, sse2) \
105 LF_FUNC(v, luma, depth, sse2) \
106 LF_IFUNC(v, luma_intra, depth, sse2) \
107 LF_FUNC(h, chroma, depth, sse2) \
108 LF_IFUNC(h, chroma_intra, depth, sse2) \
109 LF_FUNC(h, chroma422, depth, sse2) \
110 LF_IFUNC(h, chroma422_intra, depth, sse2) \
111 LF_FUNC(v, chroma, depth, sse2) \
112 LF_IFUNC(v, chroma_intra, depth, sse2) \
113 LF_FUNC(h, luma, depth, avx) \
114 LF_IFUNC(h, luma_intra, depth, avx) \
115 LF_FUNC(v, luma, depth, avx) \
116 LF_IFUNC(v, luma_intra, depth, avx) \
117 LF_FUNC(h, chroma, depth, avx) \
118 LF_IFUNC(h, chroma_intra, depth, avx) \
119 LF_FUNC(h, chroma422, depth, avx) \
120 LF_IFUNC(h, chroma422_intra, depth, avx) \
121 LF_FUNC(v, chroma, depth, avx) \
122 LF_IFUNC(v, chroma_intra, depth, avx)
138 #define H264_WEIGHT(W, OPT) \
139 void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, ptrdiff_t stride, \
140 int height, int log2_denom, \
141 int weight, int offset);
143 #define H264_BIWEIGHT(W, OPT) \
144 void ff_h264_biweight_ ## W ## _ ## OPT(uint8_t *dst, uint8_t *src, \
145 ptrdiff_t stride, int height, \
146 int log2_denom, int weightd, \
147 int weights, int offset);
149 #define H264_BIWEIGHT_MMX(W) \
150 H264_WEIGHT(W, mmxext) \
151 H264_BIWEIGHT(W, mmxext)
153 #define H264_BIWEIGHT_SSE(W) \
154 H264_WEIGHT(W, sse2) \
155 H264_BIWEIGHT(W, sse2) \
156 H264_BIWEIGHT(W, ssse3)
162 #define H264_WEIGHT_10(W, DEPTH, OPT) \
163 void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
170 #define H264_BIWEIGHT_10(W, DEPTH, OPT) \
171 void ff_h264_biweight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
180 #define H264_BIWEIGHT_10_SSE(W, DEPTH) \
181 H264_WEIGHT_10(W, DEPTH, sse2) \
182 H264_WEIGHT_10(W, DEPTH, sse4) \
183 H264_BIWEIGHT_10(W, DEPTH, sse2) \
184 H264_BIWEIGHT_10(W, DEPTH, sse4)
191 const
int chroma_format_idc)
201 if (chroma_format_idc <= 1) {
203 c->h264_idct_add8 = ff_h264_idct_add8_422_8_mmx;
207 c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmxext;
209 c->weight_h264_pixels_tab[2] = ff_h264_weight_4_mmxext;
211 c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_mmxext;
214 c->h264_idct8_add = ff_h264_idct8_add_8_sse2;
216 c->h264_idct_add16 = ff_h264_idct_add16_8_sse2;
217 c->h264_idct8_add4 = ff_h264_idct8_add4_8_sse2;
218 if (chroma_format_idc <= 1)
219 c->h264_idct_add8 = ff_h264_idct_add8_8_sse2;
220 c->h264_idct_add16intra = ff_h264_idct_add16intra_8_sse2;
223 c->weight_h264_pixels_tab[0] = ff_h264_weight_16_sse2;
224 c->weight_h264_pixels_tab[1] = ff_h264_weight_8_sse2;
226 c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_sse2;
227 c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_sse2;
229 c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_sse2;
230 c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_sse2;
231 c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_sse2;
232 c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_sse2;
235 c->h264_h_loop_filter_luma_mbaff = ff_deblock_h_luma_mbaff_8_sse2;
238 c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_sse2;
239 c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_sse2;
240 if (chroma_format_idc <= 1) {
241 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_sse2;
242 c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_sse2;
244 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_8_sse2;
245 c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma422_intra_8_sse2;
248 c->h264_idct_add = ff_h264_idct_add_8_sse2;
249 c->h264_idct_dc_add = ff_h264_idct_dc_add_8_sse2;
252 c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_ssse3;
253 c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_ssse3;
256 c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_avx;
257 c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_avx;
258 c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_avx;
259 c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx;
261 c->h264_h_loop_filter_luma_mbaff = ff_deblock_h_luma_mbaff_8_avx;
264 c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_avx;
265 c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_avx;
266 if (chroma_format_idc <= 1) {
267 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_avx;
268 c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_avx;
270 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_8_avx;
271 c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma422_intra_8_avx;
274 c->h264_idct_add = ff_h264_idct_add_8_avx;
275 c->h264_idct_dc_add = ff_h264_idct_dc_add_8_avx;
279 #if ARCH_X86_32 && !HAVE_ALIGNED_STACK
280 c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_mmxext;
281 c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_mmxext;
282 c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_mmxext;
283 c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_mmxext;
285 c->h264_idct_dc_add = ff_h264_idct_dc_add_10_mmxext;
288 c->h264_idct_add = ff_h264_idct_add_10_sse2;
289 c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_sse2;
291 c->h264_idct_add16 = ff_h264_idct_add16_10_sse2;
292 if (chroma_format_idc <= 1) {
293 c->h264_idct_add8 = ff_h264_idct_add8_10_sse2;
295 c->h264_idct_add8 = ff_h264_idct_add8_422_10_sse2;
297 c->h264_idct_add16intra = ff_h264_idct_add16intra_10_sse2;
298 #if HAVE_ALIGNED_STACK
299 c->h264_idct8_add = ff_h264_idct8_add_10_sse2;
300 c->h264_idct8_add4 = ff_h264_idct8_add4_10_sse2;
303 c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse2;
304 c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse2;
305 c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse2;
307 c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse2;
308 c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse2;
309 c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse2;
311 c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_10_sse2;
312 c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_sse2;
313 if (chroma_format_idc <= 1) {
314 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_sse2;
316 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_sse2;
318 #if HAVE_ALIGNED_STACK
319 c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_sse2;
320 c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_sse2;
321 c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_sse2;
322 c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_sse2;
326 c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse4;
327 c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse4;
328 c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse4;
330 c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse4;
331 c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4;
332 c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4;
335 c->h264_idct_dc_add =
336 c->h264_idct_add = ff_h264_idct_add_10_avx;
337 c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_avx;
339 c->h264_idct_add16 = ff_h264_idct_add16_10_avx;
340 if (chroma_format_idc <= 1) {
341 c->h264_idct_add8 = ff_h264_idct_add8_10_avx;
343 c->h264_idct_add8 = ff_h264_idct_add8_422_10_avx;
345 c->h264_idct_add16intra = ff_h264_idct_add16intra_10_avx;
346 #if HAVE_ALIGNED_STACK
347 c->h264_idct8_add = ff_h264_idct8_add_10_avx;
348 c->h264_idct8_add4 = ff_h264_idct8_add4_10_avx;
351 c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_10_avx;
352 c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_avx;
353 if (chroma_format_idc <= 1) {
354 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_avx;
356 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_avx;
358 #if HAVE_ALIGNED_STACK
359 c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_avx;
360 c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_avx;
361 c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_avx;
362 c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_avx;