44 LOG2_MAX_BLOCKSIZE = 4,
46 LOG2_MIN_BLOCKSIZE = 1,
49 declare_func(
void,
const uint8_t *obmc,
const int obmc_stride,
50 uint8_t **
block,
int b_w,
int b_h,
int src_x,
51 int src_stride,
IDWTELEM *
const *lines,
52 int add, uint8_t *dst8);
59 for (
int i = 0;
i < 2; ++
i) {
60 for (
int j = LOG2_MIN_BLOCKSIZE; j <= LOG2_MAX_BLOCKSIZE; ++j) {
66 const uint8_t *obmc =
ff_obmc_tab[LOG2_MAX_BLOCKSIZE - j];
67 int obmc_stride = 2 << j;
74 int nb_complete_blocks = (
width - b_w / 2) / b_w;
75 mb_x = 1 +
rnd() % nb_complete_blocks;
79 mb_x = (
width + b_w/2) % b_w &&
rnd() & 1 ? (
width + b_w/2) / b_w : 0;
82 int src_x = b_w*mb_x - b_w/2;
89 if (src_x + b_w >
width) {
93 uint8_t *dst8p_ref = dst8_ref + src_x;
94 uint8_t *dst8p_new = dst8_new + src_x;
95 unsigned rand =
rnd();
96 uint8_t *blocks[4] = {
block[rand % 4],
block[rand / 4 % 4],
99 dst8p_ref += (b_h - 1) * src_stride;
100 dst8p_new += (b_h - 1) * src_stride;
101 blocks[0] += (b_h - 1) * src_stride;
102 blocks[1] += (b_h - 1) * src_stride;
103 blocks[2] += (b_h - 1) * src_stride;
104 blocks[3] += (b_h - 1) * src_stride;
105 src_stride = -src_stride;
109 for (
int k = 0; k < b_h; ++k)
122 memcpy(dst8_new, dst8_ref,
sizeof(dst8_new));
124 call_ref(obmc, obmc_stride, blocks, b_w, b_h, src_x, src_stride, lines, 1, dst8p_ref);
125 call_new(obmc, obmc_stride, blocks, b_w, b_h, src_x, src_stride, lines, 1, dst8p_new);
127 if (memcmp(dst8_ref, dst8_new,
sizeof(dst8_new)))
130 bench_new(obmc, obmc_stride, blocks, b_w, b_h, src_x, src_stride, lines, 1, dst8p_new);
133 report(
"inner_add_yblock");
void(* inner_add_yblock)(const uint8_t *obmc, const int obmc_stride, uint8_t **block, int b_w, int b_h, int src_x, int src_stride, IDWTELEM *const *lines, int add, uint8_t *dst8)