33 static const uint32_t
pixel_mask[] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff, 0x3fff3fff, 0xffffffff };
34 static const int sizes[] = { 2, 4, 8, 16, 32, 64, 128 };
36 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
37 #define PIXEL_STRIDE (MAX_CTU_SIZE * 2)
38 #define EXTRA_BEFORE 3
40 #define SRC_EXTRA (EXTRA_BEFORE + EXTRA_AFTER) * 2
41 #define SRC_BUF_SIZE (PIXEL_STRIDE + SRC_EXTRA) * (PIXEL_STRIDE + SRC_EXTRA)
42 #define DST_BUF_SIZE (MAX_CTU_SIZE * MAX_CTU_SIZE * 2)
43 #define SRC_OFFSET ((PIXEL_STRIDE + EXTRA_BEFORE * 2) * EXTRA_BEFORE)
45 #define randomize_buffers(buf0, buf1, size, mask) \
48 for (k = 0; k < size; k += 4) { \
49 uint32_t r = rnd() & mask; \
50 AV_WN32A(buf0 + k, r); \
51 AV_WN32A(buf1 + k, r); \
55 #define randomize_pixels(buf0, buf1, size) \
57 uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
58 randomize_buffers(buf0, buf1, size, mask); \
61 #define randomize_avg_src(buf0, buf1, size) \
63 uint32_t mask = 0x3fff3fff; \
64 randomize_buffers(buf0, buf1, size, mask); \
75 declare_func(
void, int16_t *dst,
const uint8_t *
src,
const ptrdiff_t src_stride,
76 const int height,
const int8_t *hf,
const int8_t *vf,
const int width);
81 for (
int i = 0;
i < 2;
i++) {
82 for (
int j = 0; j < 2; j++) {
86 const int mx =
rnd() % 16;
87 const int my =
rnd() % 16;
91 switch ((j << 1) |
i) {
92 case 0:
type =
"put_luma_pixels";
break;
93 case 1:
type =
"put_luma_h";
break;
94 case 2:
type =
"put_luma_v";
break;
95 case 3:
type =
"put_luma_hv";
break;
124 uint8_t *
src, ptrdiff_t srcstride,
int height,
const int8_t *hf,
const int8_t *vf,
int width);
129 for (
int i = 0;
i < 2;
i++) {
130 for (
int j = 0; j < 2; j++) {
140 switch ((j << 1) |
i) {
141 case 0:
type =
"put_uni_pixels";
break;
142 case 1:
type =
"put_uni_h";
break;
143 case 2:
type =
"put_uni_v";
break;
144 case 3:
type =
"put_uni_hv";
break;
173 declare_func(
void, int16_t *dst,
const uint8_t *
src,
const ptrdiff_t src_stride,
174 const int height,
const int8_t *hf,
const int8_t *vf,
const int width);
179 for (
int i = 0;
i < 2;
i++) {
180 for (
int j = 0; j < 2; j++) {
189 switch ((j << 1) |
i) {
190 case 0:
type =
"put_chroma_pixels";
break;
191 case 1:
type =
"put_chroma_h";
break;
192 case 2:
type =
"put_chroma_v";
break;
193 case 3:
type =
"put_chroma_hv";
break;
222 uint8_t *
src, ptrdiff_t srcstride,
int height,
const int8_t *hf,
const int8_t *vf,
int width);
227 for (
int i = 0;
i < 2;
i++) {
228 for (
int j = 0; j < 2; j++) {
238 switch ((j << 1) |
i) {
239 case 0:
type =
"put_uni_pixels";
break;
240 case 1:
type =
"put_uni_h";
break;
241 case 2:
type =
"put_uni_v";
break;
242 case 3:
type =
"put_uni_hv";
break;
263 #define AVG_SRC_BUF_SIZE (MAX_CTU_SIZE * MAX_CTU_SIZE)
264 #define AVG_DST_BUF_SIZE (MAX_PB_SIZE * MAX_PB_SIZE * 2)
299 int denom,
int w0,
int w1,
int o0,
int o1);
301 const int denom =
rnd() % 8;
302 const int w0 =
rnd() % 256 - 128;
303 const int w1 =
rnd() % 256 - 128;
304 const int o0 =
rnd() % 256 - 128;
305 const int o1 =
rnd() % 256 - 128;
310 call_ref(dst0,
MAX_CTU_SIZE *
SIZEOF_PIXEL, src00, src01,
w,
h, denom, w0, w1, o0, o1);
311 call_new(dst1,
MAX_CTU_SIZE *
SIZEOF_PIXEL, src10, src11,
w,
h, denom, w0, w1, o0, o1);
315 bench_new(dst0,
MAX_CTU_SIZE *
SIZEOF_PIXEL, src00, src01,
w,
h, denom, w0, w1, o0, o1);