AV_WN16A(buf + j * 2, rnd() & 0x3FF); \
} while (0)
-static void compare_add_res(int size, ptrdiff_t stride)
+static void compare_add_res(int size, ptrdiff_t stride, int overflow_test)
{
LOCAL_ALIGNED_32(int16_t, res0, [32 * 32]);
LOCAL_ALIGNED_32(int16_t, res1, [32 * 32]);
randomize_buffers(res0, size);
randomize_buffers2(dst0, size);
+ if (overflow_test)
+ res0[0] = 0x8000;
memcpy(res1, res0, sizeof(*res0) * size);
memcpy(dst1, dst0, sizeof(int16_t) * size);
ptrdiff_t stride = block_size << (bit_depth > 8);
if (check_func(h.add_residual[i - 2], "hevc_add_res_%dx%d_%d", block_size, block_size, bit_depth)) {
- compare_add_res(size, stride);
+ compare_add_res(size, stride, 0);
+ // overflow test for res = -32768
+ compare_add_res(size, stride, 1);
}
}
}