33 static const uint32_t
pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff };
35 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
36 #define SRC_PIXEL_STRIDE (MAX_CTU_SIZE + 2 * ALF_PADDING_SIZE)
37 #define DST_PIXEL_STRIDE (SRC_PIXEL_STRIDE + 4)
38 #define SRC_BUF_SIZE (SRC_PIXEL_STRIDE * (MAX_CTU_SIZE + 3 * 2) * 2) //+3 * 2 for top and bottom row, *2 for high bit depth
39 #define DST_BUF_SIZE (DST_PIXEL_STRIDE * (MAX_CTU_SIZE + 3 * 2) * 2)
40 #define LUMA_PARAMS_SIZE (MAX_CTU_SIZE * MAX_CTU_SIZE / ALF_BLOCK_SIZE / ALF_BLOCK_SIZE * ALF_NUM_COEFF_LUMA)
42 #define randomize_buffers(buf0, buf1, size) \
44 uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \
46 for (k = 0; k < size; k += 4) { \
47 uint32_t r = rnd() & mask; \
48 AV_WN32A(buf0 + k, r); \
49 AV_WN32A(buf1 + k, r); \
53 #define randomize_buffers2(buf, size, filter) \
57 for (k = 0; k < size; k++) { \
62 for (k = 0; k < size; k++) { \
63 int r = rnd() % FF_ARRAY_ELEMS(clip_set); \
64 buf[k] = clip_set[r]; \
86 const int16_t clip_set[] = {
94 declare_func(
void, uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *
src, ptrdiff_t src_stride,
104 if (!(
w % 8) && !(
h % 8)) {
111 for (
int i = 0;
i < (
h + 1);
i++) {
112 if (memcmp(dst0 +
i * dst_stride, dst1 +
i * dst_stride, (
w + 1) *
SIZEOF_PIXEL))
116 if (
w ==
h && (
w & (
w - 1)) == 0)
121 if ((
w <= 64 || !(
w % 8)) && (
h <= 64 || !(
h % 8))) {
128 for (
int i = 0;
i < (
h + 1);
i++) {
129 if (memcmp(dst0 +
i * dst_stride, dst1 +
i * dst_stride, (
w + 1) *
SIZEOF_PIXEL))
132 if (
w ==
h && (
w & (
w - 1)) == 0)
154 const uint8_t *
src, ptrdiff_t src_stride,
int width,
int height,
int vb_pos,
int *gradient_tmp);
164 memset(class_idx0, 0, id_size);
165 memset(class_idx1, 0, id_size);
166 memset(transpose_idx0, 0, id_size);
167 memset(transpose_idx1, 0, id_size);
172 if (memcmp(class_idx0, class_idx1, id_size))
174 if (memcmp(transpose_idx0, transpose_idx1, id_size))
177 if (
w ==
h && (
w & (
w - 1)) == 0)