26 #define randomize_buffer(buf, size) do { \
28 for (i = 0; i < size / 4; i++) \
29 ((uint32_t *)buf)[i] = rnd(); \
47 const int ii_w =
w + e*2;
48 const int ii_h =
h + e*2;
49 const int ii_lz_32 =
FFALIGN(ii_w + 1, 4);
50 uint32_t *ii_orig_ref =
av_calloc(ii_h + 1, ii_lz_32 *
sizeof(*ii_orig_ref));
51 uint32_t *ii_ref = ii_orig_ref + ii_lz_32 + 1;
52 uint32_t *ii_orig_new =
av_calloc(ii_h + 1, ii_lz_32 *
sizeof(*ii_orig_new));
53 uint32_t *ii_new = ii_orig_new + ii_lz_32 + 1;
58 const uint8_t *s1, ptrdiff_t linesize1,
59 const uint8_t *s2, ptrdiff_t linesize2,
64 for (offy = -
r; offy <=
r; offy++) {
65 for (offx = -
r; offx <=
r; offx++) {
69 const int s2x = e + offx;
70 const int s2y = e + offy;
71 const int startx_safe =
FFMAX(s1x, s2x);
72 const int starty_safe =
FFMAX(s1y, s2y);
73 const int u_endx_safe =
FFMIN(s1x +
w, s2x +
w);
74 const int endy_safe =
FFMIN(s1y +
h, s2y +
h);
75 const int safe_pw = (u_endx_safe - startx_safe) & ~0
xf;
76 const int safe_ph = endy_safe - starty_safe;
84 memset(ii_ref, 0, (ii_lz_32 * ii_h - 1) *
sizeof(*ii_ref));
85 memset(ii_new, 0, (ii_lz_32 * ii_h - 1) *
sizeof(*ii_new));
87 call_ref(ii_ref + starty_safe*ii_lz_32 + startx_safe, ii_lz_32,
88 src + (starty_safe - s1y) * src_lz + (startx_safe - s1x), src_lz,
89 src + (starty_safe - s2y) * src_lz + (startx_safe - s2x), src_lz,
91 call_new(ii_new + starty_safe*ii_lz_32 + startx_safe, ii_lz_32,
92 src + (starty_safe - s1y) * src_lz + (startx_safe - s1x), src_lz,
93 src + (starty_safe - s2y) * src_lz + (startx_safe - s2x), src_lz,
96 if (memcmp(ii_ref, ii_new, (ii_lz_32 * ii_h - 1) *
sizeof(*ii_ref)))
99 memset(ii_new, 0, (ii_lz_32 * ii_h - 1) *
sizeof(*ii_new));
100 bench_new(ii_new + starty_safe*ii_lz_32 + startx_safe, ii_lz_32,
101 src + (starty_safe - s1y) * src_lz + (startx_safe - s1x), src_lz,
102 src + (starty_safe - s2y) * src_lz + (startx_safe - s2x), src_lz,