29 static const uint32_t
pixel_mask[] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff, 0x07ff07ff, 0x0fff0fff };
30 static const uint32_t
pixel_mask16[] = { 0x00ff00ff, 0x01ff01ff, 0x03ff03ff, 0x07ff07ff, 0x0fff0fff };
31 static const int sizes[] = { -1, 4, 6, 8, 12, 16, 24, 32, 48, 64 };
32 static const int weights[] = { 0, 128, 255, -1 };
33 static const int denoms[] = {0, 7, 12, -1 };
34 static const int offsets[] = {0, 255, -1 };
36 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
37 #define BUF_SIZE (2 * MAX_PB_SIZE * (2 * 4 + MAX_PB_SIZE))
39 #define checkasm_check_pixel(buf1, stride1, buf2, stride2, ...) \
41 checkasm_check(uint16_t, (const uint16_t*)buf1, stride1, \
42 (const uint16_t*)buf2, stride2, \
44 checkasm_check(uint8_t, (const uint8_t*) buf1, stride1, \
45 (const uint8_t*) buf2, stride2, \
48 #define randomize_buffers() \
50 uint32_t mask = pixel_mask[bit_depth - 8]; \
52 for (k = 0; k < BUF_SIZE + SRC_EXTRA; k += 4) { \
53 uint32_t r = rnd() & mask; \
54 AV_WN32A(buf0 + k, r); \
55 AV_WN32A(buf1 + k, r); \
59 AV_WN32A(dst0 + k, r); \
60 AV_WN32A(dst1 + k, r); \
64 #define randomize_buffers_ref() \
65 randomize_buffers(); \
67 uint32_t mask = pixel_mask16[bit_depth - 8]; \
69 for (k = 0; k < BUF_SIZE; k += 2) { \
70 uint32_t r = rnd() & mask; \
71 AV_WN32A(ref0 + k, r); \
72 AV_WN32A(ref1 + k, r); \
76 #define src0 (buf0 + 2 * 4 * MAX_PB_SIZE)
77 #define src1 (buf1 + 2 * 4 * MAX_PB_SIZE)
97 for (
i = 0;
i < 2;
i++) {
98 for (j = 0; j < 2; j++) {
101 switch ((j << 1) |
i) {
102 case 0:
type =
"pel_pixels";
break;
103 case 1:
type =
"qpel_h";
break;
104 case 2:
type =
"qpel_v";
break;
105 case 3:
type =
"qpel_hv";
break;
110 int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
135 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
141 for (
i = 0;
i < 2;
i++) {
142 for (j = 0; j < 2; j++) {
145 switch ((j << 1) |
i) {
146 case 0:
type =
"pel_uni_pixels";
break;
147 case 1:
type =
"qpel_uni_h";
break;
148 case 2:
type =
"qpel_uni_v";
break;
149 case 3:
type =
"qpel_uni_hv";
break;
184 const int *denom, *wx, *ox;
185 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
186 int height,
int denom,
int wx,
int ox, intptr_t mx, intptr_t my,
int width);
191 for (
i = 0;
i < 2;
i++) {
192 for (j = 0; j < 2; j++) {
195 switch ((j << 1) |
i) {
196 case 0:
type =
"pel_uni_w_pixels";
break;
197 case 1:
type =
"qpel_uni_w_h";
break;
198 case 2:
type =
"qpel_uni_w_v";
break;
199 case 3:
type =
"qpel_uni_w_hv";
break;
204 for (denom =
denoms; *denom >= 0; denom++) {
205 for (wx =
weights; *wx >= 0; wx++) {
206 for (ox =
offsets; *ox >= 0; ox++) {
242 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
249 for (
i = 0;
i < 2;
i++) {
250 for (j = 0; j < 2; j++) {
253 switch ((j << 1) |
i) {
254 case 0:
type =
"pel_bi_pixels";
break;
255 case 1:
type =
"qpel_bi_h";
break;
256 case 2:
type =
"qpel_bi_v";
break;
257 case 3:
type =
"qpel_bi_hv";
break;
294 const int *denom, *wx, *ox;
295 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
297 int height,
int denom,
int wx0,
int wx1,
298 int ox0,
int ox1, intptr_t mx, intptr_t my,
int width);
303 for (
i = 0;
i < 2;
i++) {
304 for (j = 0; j < 2; j++) {
307 switch ((j << 1) |
i) {
308 case 0:
type =
"pel_bi_w_pixels";
break;
309 case 1:
type =
"qpel_bi_w_h";
break;
310 case 2:
type =
"qpel_bi_w_v";
break;
311 case 3:
type =
"qpel_bi_w_hv";
break;
316 for (denom =
denoms; *denom >= 0; denom++) {
317 for (wx =
weights; *wx >= 0; wx++) {
318 for (ox =
offsets; *ox >= 0; ox++) {
361 for (
i = 0;
i < 2;
i++) {
362 for (j = 0; j < 2; j++) {
365 switch ((j << 1) |
i) {
366 case 0:
type =
"pel_pixels";
break;
367 case 1:
type =
"epel_h";
break;
368 case 2:
type =
"epel_v";
break;
369 case 3:
type =
"epel_hv";
break;
374 int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
399 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
405 for (
i = 0;
i < 2;
i++) {
406 for (j = 0; j < 2; j++) {
409 switch ((j << 1) |
i) {
410 case 0:
type =
"pel_uni_pixels";
break;
411 case 1:
type =
"epel_uni_h";
break;
412 case 2:
type =
"epel_uni_v";
break;
413 case 3:
type =
"epel_uni_hv";
break;
448 const int *denom, *wx, *ox;
449 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
450 int height,
int denom,
int wx,
int ox, intptr_t mx, intptr_t my,
int width);
455 for (
i = 0;
i < 2;
i++) {
456 for (j = 0; j < 2; j++) {
459 switch ((j << 1) |
i) {
460 case 0:
type =
"pel_uni_w_pixels";
break;
461 case 1:
type =
"epel_uni_w_h";
break;
462 case 2:
type =
"epel_uni_w_v";
break;
463 case 3:
type =
"epel_uni_w_hv";
break;
468 for (denom =
denoms; *denom >= 0; denom++) {
469 for (wx =
weights; *wx >= 0; wx++) {
470 for (ox =
offsets; *ox >= 0; ox++) {
506 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
513 for (
i = 0;
i < 2;
i++) {
514 for (j = 0; j < 2; j++) {
517 switch ((j << 1) |
i) {
518 case 0:
type =
"pel_bi_pixels";
break;
519 case 1:
type =
"epel_bi_h";
break;
520 case 2:
type =
"epel_bi_v";
break;
521 case 3:
type =
"epel_bi_hv";
break;
558 const int *denom, *wx, *ox;
559 declare_func(
void, uint8_t *dst, ptrdiff_t dststride, uint8_t *
src, ptrdiff_t srcstride,
561 int height,
int denom,
int wx0,
int wx1,
562 int ox0,
int ox1, intptr_t mx, intptr_t my,
int width);
567 for (
i = 0;
i < 2;
i++) {
568 for (j = 0; j < 2; j++) {
571 switch ((j << 1) |
i) {
572 case 0:
type =
"pel_bi_w_pixels";
break;
573 case 1:
type =
"epel_bi_w_h";
break;
574 case 2:
type =
"epel_bi_w_v";
break;
575 case 3:
type =
"epel_bi_w_hv";
break;
580 for (denom =
denoms; *denom >= 0; denom++) {
581 for (wx =
weights; *wx >= 0; wx++) {
582 for (ox =
offsets; *ox >= 0; ox++) {