31 #define LFC_FUNC(DIR, DEPTH, OPT) \
32 void ff_hevc_ ## DIR ## _loop_filter_chroma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, int *tc, uint8_t *no_p, uint8_t *no_q);
34 #define LFL_FUNC(DIR, DEPTH, OPT) \
35 void ff_hevc_ ## DIR ## _loop_filter_luma_ ## DEPTH ## _ ## OPT(uint8_t *pix, ptrdiff_t stride, int beta, int *tc, uint8_t *no_p, uint8_t *no_q);
37 #define LFC_FUNCS(type, depth, opt) \
38 LFC_FUNC(h, depth, opt) \
39 LFC_FUNC(v, depth, opt)
41 #define LFL_FUNCS(type, depth, opt) \
42 LFL_FUNC(h, depth, opt) \
43 LFL_FUNC(v, depth, opt)
61 #define IDCT_FUNCS(W, opt) \
62 void ff_hevc_idct##W##_dc_8_##opt(int16_t *coeffs); \
63 void ff_hevc_idct##W##_dc_10_##opt(int16_t *coeffs); \
64 void ff_hevc_idct##W##_dc_12_##opt(int16_t *coeffs)
74 #define mc_rep_func(name, bitd, step, W, opt) \
75 void ff_hevc_put_hevc_##name##W##_##bitd##_##opt(int16_t *_dst, \
76 uint8_t *_src, ptrdiff_t _srcstride, int height, \
77 intptr_t mx, intptr_t my, int width) \
82 for (i = 0; i < W; i += step) { \
83 src = _src + (i * ((bitd + 7) / 8)); \
85 ff_hevc_put_hevc_##name##step##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width); \
88 #define mc_rep_uni_func(name, bitd, step, W, opt) \
89 void ff_hevc_put_hevc_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, \
90 uint8_t *_src, ptrdiff_t _srcstride, int height, \
91 intptr_t mx, intptr_t my, int width) \
96 for (i = 0; i < W; i += step) { \
97 src = _src + (i * ((bitd + 7) / 8)); \
98 dst = _dst + (i * ((bitd + 7) / 8)); \
99 ff_hevc_put_hevc_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \
100 height, mx, my, width); \
103 #define mc_rep_bi_func(name, bitd, step, W, opt) \
104 void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, uint8_t *_src, \
105 ptrdiff_t _srcstride, int16_t* _src2, \
106 int height, intptr_t mx, intptr_t my, int width) \
112 for (i = 0; i < W ; i += step) { \
113 src = _src + (i * ((bitd + 7) / 8)); \
114 dst = _dst + (i * ((bitd + 7) / 8)); \
116 ff_hevc_put_hevc_bi_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, \
117 height, mx, my, width); \
121 #define mc_rep_funcs(name, bitd, step, W, opt) \
122 mc_rep_func(name, bitd, step, W, opt) \
123 mc_rep_uni_func(name, bitd, step, W, opt) \
124 mc_rep_bi_func(name, bitd, step, W, opt)
126 #define mc_rep_func2(name, bitd, step1, step2, W, opt) \
127 void ff_hevc_put_hevc_##name##W##_##bitd##_##opt(int16_t *dst, \
128 uint8_t *src, ptrdiff_t _srcstride, int height, \
129 intptr_t mx, intptr_t my, int width) \
131 ff_hevc_put_hevc_##name##step1##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width); \
132 ff_hevc_put_hevc_##name##step2##_##bitd##_##opt(dst + step1, src + (step1 * ((bitd + 7) / 8)), \
133 _srcstride, height, mx, my, width); \
135 #define mc_rep_uni_func2(name, bitd, step1, step2, W, opt) \
136 void ff_hevc_put_hevc_uni_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, \
137 uint8_t *src, ptrdiff_t _srcstride, int height, \
138 intptr_t mx, intptr_t my, int width) \
140 ff_hevc_put_hevc_uni_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, height, mx, my, width);\
141 ff_hevc_put_hevc_uni_##name##step2##_##bitd##_##opt(dst + (step1 * ((bitd + 7) / 8)), dststride, \
142 src + (step1 * ((bitd + 7) / 8)), _srcstride, \
143 height, mx, my, width); \
145 #define mc_rep_bi_func2(name, bitd, step1, step2, W, opt) \
146 void ff_hevc_put_hevc_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
147 ptrdiff_t _srcstride, int16_t* src2, \
148 int height, intptr_t mx, intptr_t my, int width) \
150 ff_hevc_put_hevc_bi_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, src2, height, mx, my, width);\
151 ff_hevc_put_hevc_bi_##name##step2##_##bitd##_##opt(dst + (step1 * ((bitd + 7) / 8)), dststride, \
152 src + (step1 * ((bitd + 7) / 8)), _srcstride, \
153 src2 + step1, height, mx, my, width); \
156 #define mc_rep_funcs2(name, bitd, step1, step2, W, opt) \
157 mc_rep_func2(name, bitd, step1, step2, W, opt) \
158 mc_rep_uni_func2(name, bitd, step1, step2, W, opt) \
159 mc_rep_bi_func2(name, bitd, step1, step2, W, opt)
161 #if ARCH_X86_64 && HAVE_SSE4_EXTERNAL
163 #define mc_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \
164 void ff_hevc_put_hevc_##name##width1##_10_##opt1(int16_t *dst, uint8_t *src, ptrdiff_t _srcstride, \
165 int height, intptr_t mx, intptr_t my, int width) \
168 ff_hevc_put_hevc_##name##width2##_10_##opt1(dst, src, _srcstride, height, mx, my, width); \
169 ff_hevc_put_hevc_##name##width3##_10_##opt2(dst+ width2, src+ width4, _srcstride, height, mx, my, width); \
172 #define mc_bi_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \
173 void ff_hevc_put_hevc_bi_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
174 ptrdiff_t _srcstride, int16_t *src2, \
175 int height, intptr_t mx, intptr_t my, int width) \
177 ff_hevc_put_hevc_bi_##name##width2##_10_##opt1(dst, dststride, src, _srcstride, src2, \
178 height, mx, my, width); \
179 ff_hevc_put_hevc_bi_##name##width3##_10_##opt2(dst+width4, dststride, src+width4, _srcstride, src2+width2,\
180 height, mx, my, width); \
183 #define mc_uni_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \
184 void ff_hevc_put_hevc_uni_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride, \
185 uint8_t *src, ptrdiff_t _srcstride, int height, \
186 intptr_t mx, intptr_t my, int width) \
188 ff_hevc_put_hevc_uni_##name##width2##_10_##opt1(dst, dststride, src, _srcstride, \
189 height, mx, my, width); \
190 ff_hevc_put_hevc_uni_##name##width3##_10_##opt2(dst+width4, dststride, src+width4, _srcstride, \
191 height, mx, my, width); \
194 #define mc_rep_mixs_10(name, width1, width2, width3, opt1, opt2, width4) \
195 mc_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \
196 mc_bi_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4) \
197 mc_uni_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4)
199 #define mc_rep_mix_8(name, width1, width2, width3, opt1, opt2) \
200 void ff_hevc_put_hevc_##name##width1##_8_##opt1(int16_t *dst, uint8_t *src, ptrdiff_t _srcstride, \
201 int height, intptr_t mx, intptr_t my, int width) \
204 ff_hevc_put_hevc_##name##width2##_8_##opt1(dst, src, _srcstride, height, mx, my, width); \
205 ff_hevc_put_hevc_##name##width3##_8_##opt2(dst+ width2, src+ width2, _srcstride, height, mx, my, width); \
208 #define mc_bi_rep_mix_8(name, width1, width2, width3, opt1, opt2) \
209 void ff_hevc_put_hevc_bi_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
210 ptrdiff_t _srcstride, int16_t* src2, \
211 int height, intptr_t mx, intptr_t my, int width) \
213 ff_hevc_put_hevc_bi_##name##width2##_8_##opt1(dst, dststride, src, _srcstride, \
214 src2, height, mx, my, width); \
215 ff_hevc_put_hevc_bi_##name##width3##_8_##opt2(dst+width2, dststride, src+width2, _srcstride, \
216 src2+width2, height, mx, my, width); \
219 #define mc_uni_rep_mix_8(name, width1, width2, width3, opt1, opt2) \
220 void ff_hevc_put_hevc_uni_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride, \
221 uint8_t *src, ptrdiff_t _srcstride, int height, \
222 intptr_t mx, intptr_t my, int width) \
224 ff_hevc_put_hevc_uni_##name##width2##_8_##opt1(dst, dststride, src, _srcstride, \
225 height, mx, my, width); \
226 ff_hevc_put_hevc_uni_##name##width3##_8_##opt2(dst+width2, dststride, src+width2, _srcstride, \
227 height, mx, my, width); \
230 #define mc_rep_mixs_8(name, width1, width2, width3, opt1, opt2) \
231 mc_rep_mix_8(name, width1, width2, width3, opt1, opt2) \
232 mc_bi_rep_mix_8(name, width1, width2, width3, opt1, opt2) \
233 mc_uni_rep_mix_8(name, width1, width2, width3, opt1, opt2)
235 #if HAVE_AVX2_EXTERNAL
237 mc_rep_mixs_8(pel_pixels, 48, 32, 16, avx2, sse4)
238 mc_rep_mixs_8(epel_hv, 48, 32, 16, avx2, sse4)
239 mc_rep_mixs_8(epel_h , 48, 32, 16, avx2, sse4)
240 mc_rep_mixs_8(epel_v , 48, 32, 16, avx2, sse4)
242 mc_rep_mix_10(pel_pixels, 24, 16, 8, avx2, sse4, 32)
243 mc_bi_rep_mix_10(pel_pixels,24, 16, 8, avx2, sse4, 32)
244 mc_rep_mixs_10(epel_hv, 24, 16, 8, avx2, sse4, 32)
245 mc_rep_mixs_10(epel_h , 24, 16, 8, avx2, sse4, 32)
246 mc_rep_mixs_10(epel_v , 24, 16, 8, avx2, sse4, 32)
249 mc_rep_mixs_10(qpel_h , 24, 16, 8, avx2, sse4, 32)
250 mc_rep_mixs_10(qpel_v , 24, 16, 8, avx2, sse4, 32)
251 mc_rep_mixs_10(qpel_hv, 24, 16, 8, avx2, sse4, 32)
287 mc_rep_mixs_8(qpel_h , 48, 32, 16, avx2, sse4)
290 mc_rep_mixs_8(qpel_v, 48, 32, 16, avx2, sse4)
424 #define mc_rep_uni_w(bitd, step, W, opt) \
425 void ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, \
426 int height, int denom, int _wx, int _ox) \
431 for (i = 0; i < W; i += step) { \
433 dst= _dst + (i * ((bitd + 7) / 8)); \
434 ff_hevc_put_hevc_uni_w##step##_##bitd##_##opt(dst, dststride, src, \
435 height, denom, _wx, _ox); \
439 mc_rep_uni_w(8, 6, 12, sse4)
440 mc_rep_uni_w(8, 8, 16, sse4)
441 mc_rep_uni_w(8, 8, 24, sse4)
442 mc_rep_uni_w(8, 8, 32, sse4)
443 mc_rep_uni_w(8, 8, 48, sse4)
444 mc_rep_uni_w(8, 8, 64, sse4)
446 mc_rep_uni_w(10, 6, 12, sse4)
447 mc_rep_uni_w(10, 8, 16, sse4)
448 mc_rep_uni_w(10, 8, 24, sse4)
449 mc_rep_uni_w(10, 8, 32, sse4)
450 mc_rep_uni_w(10, 8, 48, sse4)
451 mc_rep_uni_w(10, 8, 64, sse4)
453 mc_rep_uni_w(12, 6, 12, sse4)
454 mc_rep_uni_w(12, 8, 16, sse4)
455 mc_rep_uni_w(12, 8, 24, sse4)
456 mc_rep_uni_w(12, 8, 32, sse4)
457 mc_rep_uni_w(12, 8, 48, sse4)
458 mc_rep_uni_w(12, 8, 64, sse4)
460 #define mc_rep_bi_w(bitd, step, W, opt) \
461 void ff_hevc_put_hevc_bi_w##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, int16_t *_src, \
462 int16_t *_src2, int height, \
463 int denom, int _wx0, int _wx1, int _ox0, int _ox1) \
469 for (i = 0; i < W; i += step) { \
472 dst = _dst + (i * ((bitd + 7) / 8)); \
473 ff_hevc_put_hevc_bi_w##step##_##bitd##_##opt(dst, dststride, src, src2, \
474 height, denom, _wx0, _wx1, _ox0, _ox1); \
478 mc_rep_bi_w(8, 6, 12, sse4)
479 mc_rep_bi_w(8, 8, 16, sse4)
480 mc_rep_bi_w(8, 8, 24, sse4)
481 mc_rep_bi_w(8, 8, 32, sse4)
482 mc_rep_bi_w(8, 8, 48, sse4)
483 mc_rep_bi_w(8, 8, 64, sse4)
485 mc_rep_bi_w(10, 6, 12, sse4)
486 mc_rep_bi_w(10, 8, 16, sse4)
487 mc_rep_bi_w(10, 8, 24, sse4)
488 mc_rep_bi_w(10, 8, 32, sse4)
489 mc_rep_bi_w(10, 8, 48, sse4)
490 mc_rep_bi_w(10, 8, 64, sse4)
492 mc_rep_bi_w(12, 6, 12, sse4)
493 mc_rep_bi_w(12, 8, 16, sse4)
494 mc_rep_bi_w(12, 8, 24, sse4)
495 mc_rep_bi_w(12, 8, 32, sse4)
496 mc_rep_bi_w(12, 8, 48, sse4)
497 mc_rep_bi_w(12, 8, 64, sse4)
499 #define mc_uni_w_func(name, bitd, W, opt) \
500 void ff_hevc_put_hevc_uni_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride, \
501 uint8_t *_src, ptrdiff_t _srcstride, \
502 int height, int denom, \
504 intptr_t mx, intptr_t my, int width) \
506 LOCAL_ALIGNED_16(int16_t, temp, [71 * MAX_PB_SIZE]); \
507 ff_hevc_put_hevc_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width); \
508 ff_hevc_put_hevc_uni_w##W##_##bitd##_##opt(_dst, _dststride, temp, height, denom, _wx, _ox);\
511 #define mc_uni_w_funcs(name, bitd, opt) \
512 mc_uni_w_func(name, bitd, 4, opt) \
513 mc_uni_w_func(name, bitd, 8, opt) \
514 mc_uni_w_func(name, bitd, 12, opt) \
515 mc_uni_w_func(name, bitd, 16, opt) \
516 mc_uni_w_func(name, bitd, 24, opt) \
517 mc_uni_w_func(name, bitd, 32, opt) \
518 mc_uni_w_func(name, bitd, 48, opt) \
519 mc_uni_w_func(name, bitd, 64, opt)
521 mc_uni_w_funcs(pel_pixels, 8, sse4)
522 mc_uni_w_func(pel_pixels, 8, 6, sse4)
523 mc_uni_w_funcs(epel_h, 8, sse4)
524 mc_uni_w_func(epel_h, 8, 6, sse4)
525 mc_uni_w_funcs(epel_v, 8, sse4)
526 mc_uni_w_func(epel_v, 8, 6, sse4)
527 mc_uni_w_funcs(epel_hv, 8, sse4)
528 mc_uni_w_func(epel_hv, 8, 6, sse4)
529 mc_uni_w_funcs(qpel_h, 8, sse4)
530 mc_uni_w_funcs(qpel_v, 8, sse4)
531 mc_uni_w_funcs(qpel_hv, 8, sse4)
533 mc_uni_w_funcs(pel_pixels, 10, sse4)
534 mc_uni_w_func(pel_pixels, 10, 6, sse4)
535 mc_uni_w_funcs(epel_h, 10, sse4)
536 mc_uni_w_func(epel_h, 10, 6, sse4)
537 mc_uni_w_funcs(epel_v, 10, sse4)
538 mc_uni_w_func(epel_v, 10, 6, sse4)
539 mc_uni_w_funcs(epel_hv, 10, sse4)
540 mc_uni_w_func(epel_hv, 10, 6, sse4)
541 mc_uni_w_funcs(qpel_h, 10, sse4)
542 mc_uni_w_funcs(qpel_v, 10, sse4)
543 mc_uni_w_funcs(qpel_hv, 10, sse4)
545 mc_uni_w_funcs(pel_pixels, 12, sse4)
546 mc_uni_w_func(pel_pixels, 12, 6, sse4)
547 mc_uni_w_funcs(epel_h, 12, sse4)
548 mc_uni_w_func(epel_h, 12, 6, sse4)
549 mc_uni_w_funcs(epel_v, 12, sse4)
550 mc_uni_w_func(epel_v, 12, 6, sse4)
551 mc_uni_w_funcs(epel_hv, 12, sse4)
552 mc_uni_w_func(epel_hv, 12, 6, sse4)
553 mc_uni_w_funcs(qpel_h, 12, sse4)
554 mc_uni_w_funcs(qpel_v, 12, sse4)
555 mc_uni_w_funcs(qpel_hv, 12, sse4)
557 #define mc_bi_w_func(name, bitd, W, opt) \
558 void ff_hevc_put_hevc_bi_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride, \
559 uint8_t *_src, ptrdiff_t _srcstride, \
561 int height, int denom, \
562 int _wx0, int _wx1, int _ox0, int _ox1, \
563 intptr_t mx, intptr_t my, int width) \
565 LOCAL_ALIGNED_16(int16_t, temp, [71 * MAX_PB_SIZE]); \
566 ff_hevc_put_hevc_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width); \
567 ff_hevc_put_hevc_bi_w##W##_##bitd##_##opt(_dst, _dststride, temp, _src2, \
568 height, denom, _wx0, _wx1, _ox0, _ox1); \
571 #define mc_bi_w_funcs(name, bitd, opt) \
572 mc_bi_w_func(name, bitd, 4, opt) \
573 mc_bi_w_func(name, bitd, 8, opt) \
574 mc_bi_w_func(name, bitd, 12, opt) \
575 mc_bi_w_func(name, bitd, 16, opt) \
576 mc_bi_w_func(name, bitd, 24, opt) \
577 mc_bi_w_func(name, bitd, 32, opt) \
578 mc_bi_w_func(name, bitd, 48, opt) \
579 mc_bi_w_func(name, bitd, 64, opt)
581 mc_bi_w_funcs(pel_pixels, 8, sse4)
582 mc_bi_w_func(pel_pixels, 8, 6, sse4)
583 mc_bi_w_funcs(epel_h, 8, sse4)
584 mc_bi_w_func(epel_h, 8, 6, sse4)
585 mc_bi_w_funcs(epel_v, 8, sse4)
586 mc_bi_w_func(epel_v, 8, 6, sse4)
587 mc_bi_w_funcs(epel_hv, 8, sse4)
588 mc_bi_w_func(epel_hv, 8, 6, sse4)
589 mc_bi_w_funcs(qpel_h, 8, sse4)
590 mc_bi_w_funcs(qpel_v, 8, sse4)
591 mc_bi_w_funcs(qpel_hv, 8, sse4)
593 mc_bi_w_funcs(pel_pixels, 10, sse4)
594 mc_bi_w_func(pel_pixels, 10, 6, sse4)
595 mc_bi_w_funcs(epel_h, 10, sse4)
596 mc_bi_w_func(epel_h, 10, 6, sse4)
597 mc_bi_w_funcs(epel_v, 10, sse4)
598 mc_bi_w_func(epel_v, 10, 6, sse4)
599 mc_bi_w_funcs(epel_hv, 10, sse4)
600 mc_bi_w_func(epel_hv, 10, 6, sse4)
601 mc_bi_w_funcs(qpel_h, 10, sse4)
602 mc_bi_w_funcs(qpel_v, 10, sse4)
603 mc_bi_w_funcs(qpel_hv, 10, sse4)
605 mc_bi_w_funcs(pel_pixels, 12, sse4)
606 mc_bi_w_func(pel_pixels, 12, 6, sse4)
607 mc_bi_w_funcs(epel_h, 12, sse4)
608 mc_bi_w_func(epel_h, 12, 6, sse4)
609 mc_bi_w_funcs(epel_v, 12, sse4)
610 mc_bi_w_func(epel_v, 12, 6, sse4)
611 mc_bi_w_funcs(epel_hv, 12, sse4)
612 mc_bi_w_func(epel_hv, 12, 6, sse4)
613 mc_bi_w_funcs(qpel_h, 12, sse4)
614 mc_bi_w_funcs(qpel_v, 12, sse4)
615 mc_bi_w_funcs(qpel_hv, 12, sse4)
616 #endif //ARCH_X86_64 && HAVE_SSE4_EXTERNAL
618 #define SAO_BAND_FILTER_FUNCS(bitd, opt) \
619 void ff_hevc_sao_band_filter_8_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
620 int16_t *sao_offset_val, int sao_left_class, int width, int height); \
621 void ff_hevc_sao_band_filter_16_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
622 int16_t *sao_offset_val, int sao_left_class, int width, int height); \
623 void ff_hevc_sao_band_filter_32_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
624 int16_t *sao_offset_val, int sao_left_class, int width, int height); \
625 void ff_hevc_sao_band_filter_48_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
626 int16_t *sao_offset_val, int sao_left_class, int width, int height); \
627 void ff_hevc_sao_band_filter_64_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, \
628 int16_t *sao_offset_val, int sao_left_class, int width, int height);
632 SAO_BAND_FILTER_FUNCS(12, sse2)
633 SAO_BAND_FILTER_FUNCS(8, avx)
634 SAO_BAND_FILTER_FUNCS(10, avx)
635 SAO_BAND_FILTER_FUNCS(12, avx)
636 SAO_BAND_FILTER_FUNCS(8, avx2)
637 SAO_BAND_FILTER_FUNCS(10, avx2)
638 SAO_BAND_FILTER_FUNCS(12, avx2)
640 #define SAO_BAND_INIT(bitd, opt) do { \
641 c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_##bitd##_##opt; \
642 c->sao_band_filter[1] = ff_hevc_sao_band_filter_16_##bitd##_##opt; \
643 c->sao_band_filter[2] = ff_hevc_sao_band_filter_32_##bitd##_##opt; \
644 c->sao_band_filter[3] = ff_hevc_sao_band_filter_48_##bitd##_##opt; \
645 c->sao_band_filter[4] = ff_hevc_sao_band_filter_64_##bitd##_##opt; \
648 #define SAO_EDGE_FILTER_FUNCS(bitd, opt) \
649 void ff_hevc_sao_edge_filter_8_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \
650 int eo, int width, int height); \
651 void ff_hevc_sao_edge_filter_16_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \
652 int eo, int width, int height); \
653 void ff_hevc_sao_edge_filter_32_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \
654 int eo, int width, int height); \
655 void ff_hevc_sao_edge_filter_48_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \
656 int eo, int width, int height); \
657 void ff_hevc_sao_edge_filter_64_##bitd##_##opt(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, \
658 int eo, int width, int height); \
662 SAO_EDGE_FILTER_FUNCS(10, sse2)
663 SAO_EDGE_FILTER_FUNCS(10, avx2)
664 SAO_EDGE_FILTER_FUNCS(12, sse2)
665 SAO_EDGE_FILTER_FUNCS(12, avx2)
667 #define SAO_EDGE_INIT(bitd, opt) do { \
668 c->sao_edge_filter[0] = ff_hevc_sao_edge_filter_8_##bitd##_##opt; \
669 c->sao_edge_filter[1] = ff_hevc_sao_edge_filter_16_##bitd##_##opt; \
670 c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_##bitd##_##opt; \
671 c->sao_edge_filter[3] = ff_hevc_sao_edge_filter_48_##bitd##_##opt; \
672 c->sao_edge_filter[4] = ff_hevc_sao_edge_filter_64_##bitd##_##opt; \
675 #define EPEL_LINKS(pointer, my, mx, fname, bitd, opt ) \
676 PEL_LINK(pointer, 1, my , mx , fname##4 , bitd, opt ); \
677 PEL_LINK(pointer, 2, my , mx , fname##6 , bitd, opt ); \
678 PEL_LINK(pointer, 3, my , mx , fname##8 , bitd, opt ); \
679 PEL_LINK(pointer, 4, my , mx , fname##12, bitd, opt ); \
680 PEL_LINK(pointer, 5, my , mx , fname##16, bitd, opt ); \
681 PEL_LINK(pointer, 6, my , mx , fname##24, bitd, opt ); \
682 PEL_LINK(pointer, 7, my , mx , fname##32, bitd, opt ); \
683 PEL_LINK(pointer, 8, my , mx , fname##48, bitd, opt ); \
684 PEL_LINK(pointer, 9, my , mx , fname##64, bitd, opt )
685 #define QPEL_LINKS(pointer, my, mx, fname, bitd, opt) \
686 PEL_LINK(pointer, 1, my , mx , fname##4 , bitd, opt ); \
687 PEL_LINK(pointer, 3, my , mx , fname##8 , bitd, opt ); \
688 PEL_LINK(pointer, 4, my , mx , fname##12, bitd, opt ); \
689 PEL_LINK(pointer, 5, my , mx , fname##16, bitd, opt ); \
690 PEL_LINK(pointer, 6, my , mx , fname##24, bitd, opt ); \
691 PEL_LINK(pointer, 7, my , mx , fname##32, bitd, opt ); \
692 PEL_LINK(pointer, 8, my , mx , fname##48, bitd, opt ); \
693 PEL_LINK(pointer, 9, my , mx , fname##64, bitd, opt )
699 if (bit_depth == 8) {
701 c->
idct_dc[0] = ff_hevc_idct4x4_dc_8_mmxext;
702 c->
idct_dc[1] = ff_hevc_idct8x8_dc_8_mmxext;
715 c->
idct_dc[1] = ff_hevc_idct8x8_dc_8_sse2;
716 c->
idct_dc[2] = ff_hevc_idct16x16_dc_8_sse2;
717 c->
idct_dc[3] = ff_hevc_idct32x32_dc_8_sse2;
760 c->
idct_dc[2] = ff_hevc_idct16x16_dc_8_avx2;
761 c->
idct_dc[3] = ff_hevc_idct32x32_dc_8_avx2;
787 c->
put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
788 c->
put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
789 c->
put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
799 c->
put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
800 c->
put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
801 c->
put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
811 c->
put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
812 c->
put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
813 c->
put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
823 c->
put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
824 c->
put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
825 c->
put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
827 c->
put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
828 c->
put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
829 c->
put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
855 }
else if (bit_depth == 10) {
858 c->
idct_dc[0] = ff_hevc_idct4x4_dc_10_mmxext;
859 c->
idct_dc[1] = ff_hevc_idct8x8_dc_10_mmxext;
871 c->
idct_dc[1] = ff_hevc_idct8x8_dc_10_sse2;
872 c->
idct_dc[2] = ff_hevc_idct16x16_dc_10_sse2;
873 c->
idct_dc[3] = ff_hevc_idct32x32_dc_10_sse2;
907 c->
idct_dc[2] = ff_hevc_idct16x16_dc_10_avx2;
908 c->
idct_dc[3] = ff_hevc_idct32x32_dc_10_avx2;
945 c->
put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
946 c->
put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
947 c->
put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
948 c->
put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
949 c->
put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
963 c->
put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
964 c->
put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
965 c->
put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
966 c->
put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
967 c->
put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
981 c->
put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
982 c->
put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
983 c->
put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
984 c->
put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
985 c->
put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
999 c->
put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
1000 c->
put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
1001 c->
put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
1002 c->
put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
1003 c->
put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
1017 c->
put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
1018 c->
put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
1019 c->
put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
1020 c->
put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
1021 c->
put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
1035 c->
put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
1036 c->
put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
1037 c->
put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
1038 c->
put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
1039 c->
put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
1060 }
else if (bit_depth == 12) {
1062 c->
idct_dc[0] = ff_hevc_idct4x4_dc_12_mmxext;
1063 c->
idct_dc[1] = ff_hevc_idct8x8_dc_12_mmxext;
1075 c->
idct_dc[1] = ff_hevc_idct8x8_dc_12_sse2;
1076 c->
idct_dc[2] = ff_hevc_idct16x16_dc_12_sse2;
1077 c->
idct_dc[3] = ff_hevc_idct32x32_dc_12_sse2;
1107 c->
idct_dc[2] = ff_hevc_idct16x16_dc_12_avx2;
1108 c->
idct_dc[3] = ff_hevc_idct32x32_dc_12_avx2;
void ff_hevc_transform_add32_10_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
void ff_hevc_transform_add8_8_avx(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
void ff_hevc_put_hevc_pel_pixels16_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_bi_pel_pixels48_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_transform_add4_10_mmxext(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
#define SAO_EDGE_INIT(bitd, opt)
void ff_hevc_transform_add16_8_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
void(* put_hevc_epel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
#define LFL_FUNCS(type, depth, opt)
void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
#define SAO_EDGE_FILTER_FUNCS(bitd, opt)
void ff_hevc_put_hevc_uni_pel_pixels128_8_avx2(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_pel_pixels64_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
#define EXTERNAL_SSE4(flags)
void(* put_hevc_epel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_bi_pel_pixels32_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
#define mc_rep_func(name, bitd, step, W, opt)
void ff_hevc_transform_add32_8_avx2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
void ff_hevc_transform_add16_10_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
#define mc_rep_funcs2(name, bitd, step1, step2, W, opt)
void(* hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride, int beta, int32_t *tc, uint8_t *no_p, uint8_t *no_q)
bitstream reader API header.
void ff_hevc_put_hevc_pel_pixels32_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_uni_pel_pixels48_8_avx2(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_pel_pixels64_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
#define EXTERNAL_SSE2(flags)
void(* put_hevc_qpel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_pel_pixels48_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_transform_add16_10_avx2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
#define EXTERNAL_AVX2_FAST(flags)
void(* hevc_v_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride, int beta, int32_t *tc, uint8_t *no_p, uint8_t *no_q)
#define mc_rep_funcs(name, bitd, step, W, opt)
void(* transform_add[4])(uint8_t *_dst, int16_t *coeffs, ptrdiff_t _stride)
void(* sao_edge_filter[5])(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val, int sao_eo_class, int width, int height)
#define EPEL_LINKS(pointer, my, mx, fname, bitd, opt)
#define IDCT_FUNCS(W, opt)
void ff_hevc_put_hevc_bi_pel_pixels32_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
void(* hevc_v_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride, int32_t *tc, uint8_t *no_p, uint8_t *no_q)
void ff_hevc_put_hevc_uni_pel_pixels32_8_avx2(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_bi_pel_pixels24_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_transform_add8_8_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
void ff_hevc_transform_add16_8_avx(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
void ff_hevc_transform_add8_10_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
#define SAO_BAND_FILTER_FUNCS(bitd, opt)
void(* idct_dc[4])(int16_t *coeffs)
void(* hevc_h_loop_filter_chroma)(uint8_t *pix, ptrdiff_t stride, int32_t *tc, uint8_t *no_p, uint8_t *no_q)
#define LFC_FUNCS(type, depth, opt)
void(* put_hevc_qpel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
#define mc_rep_uni_func(name, bitd, step, W, opt)
void(* sao_band_filter[5])(uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, int16_t *sao_offset_val, int sao_left_class, int width, int height)
void ff_hevc_transform_add32_8_avx(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
#define EXTERNAL_SSSE3(flags)
void ff_hevc_put_hevc_uni_pel_pixels96_8_avx2(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_pel_pixels24_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_bi_pel_pixels16_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
void(* put_hevc_qpel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, int height, intptr_t mx, intptr_t my, int width)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
void ff_hevc_transform_add32_8_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
#define EXTERNAL_AVX2(flags)
#define EXTERNAL_MMXEXT(flags)
void ff_hevc_put_hevc_pel_pixels32_10_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_bi_pel_pixels64_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
#define SAO_BAND_INIT(bitd, opt)
#define mc_rep_bi_func(name, bitd, step, W, opt)
void ff_hevc_put_hevc_pel_pixels48_8_avx2(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_bi_pel_pixels64_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_transform_add4_8_mmxext(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
void(* put_hevc_epel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_transform_add32_10_avx2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
#define QPEL_LINKS(pointer, my, mx, fname, bitd, opt)
#define EXTERNAL_AVX(flags)
void ff_hevc_put_hevc_bi_pel_pixels48_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_hevc_uni_pel_pixels64_8_avx2(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)