28#define randomize_buffers(buf, size) \
30 for (int j = 0; j < size; j += 4) \
31 AV_WN32((char*)buf + j, rnd()); \
34#define randomize_buffer_clipped(buf, min, max) \
36 for (size_t j = 0; j < FF_ARRAY_ELEMS(buf); ++j) \
37 buf[j] = rnd() % (max - min + 1) + min; \
43 const uint16_t dct_offset[64]);
53 unsigned random =
rnd();
54 block_ref[
i] = random & (1 << 16) ? random : 0;
58 memcpy(block_new, block_ref,
sizeof(block_new));
59 memcpy(dct_error_sum_new, dct_error_sum_ref,
sizeof(dct_error_sum_ref));
61 call_ref(block_ref, dct_error_sum_ref, dct_offset);
62 call_new(block_new, dct_error_sum_new, dct_offset);
63 if (memcmp(block_ref, block_new,
sizeof(block_ref)) ||
64 memcmp(dct_error_sum_new, dct_error_sum_ref,
sizeof(dct_error_sum_new)))
67 bench_new(block_new, dct_error_sum_new, dct_offset);
83 memcpy(rem2, rem1,
sizeof(rem2));
86 if (memcmp(rem1, rem2,
sizeof(rem1)))
100 for (
int n = 0; n < 2; n++) {
101 const char *negstride_str = n ?
"_negstride" :
"";
102 if (
check_func(
c->pix_sum,
"pix_sum%s", negstride_str)) {
104 const uint8_t *
pix =
src + (n ? (15 * 16) : 0);
105 ptrdiff_t line_size = 16 * (n ? -1 : 1);
123 for (
int n = 0; n < 2; n++) {
124 const char *negstride_str = n ?
"_negstride" :
"";
125 if (
check_func(
c->pix_norm1,
"pix_norm1%s", negstride_str)) {
127 const uint8_t *
pix =
src + (n ? (15 * 16) : 0);
128 ptrdiff_t line_size = 16 * (n ? -1 : 1);
139#define MAX_LINE_SIZE 1920
141#define LINESIZE (EDGE_WIDTH + MAX_LINE_SIZE + EDGE_WIDTH)
142#define BUFSIZE ((EDGE_WIDTH + NUM_LINES + EDGE_WIDTH) * LINESIZE)
151 int w,
int h,
int sides);
155 int negstride = input_size < 0;
156 const char *negstride_str = negstride ?
"_negstride" :
"";
165 dst0 += (
height - 1) * linesize;
166 dst1 += (
height - 1) * linesize;
177 if (memcmp(buf0, buf1,
BUFSIZE))
194 .bits_per_raw_sample = 8,
#define i(width, name, range_min, range_max)
common internal and external API header
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static int shift(int a, int b)
av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
static av_const int sign_extend(int val, unsigned bits)
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
#define LOCAL_ALIGNED_16(t, v,...)
static int16_t basis[64][64]
#define FF_ARRAY_ELEMS(a)
main external API structure.
static const int input_sizes[]
static void check_add_8x8basis(MpegvideoEncDSPContext *c)
static void check_pix_norm1(MpegvideoEncDSPContext *c)
static void check_draw_edges(MpegvideoEncDSPContext *c)
#define randomize_buffer_clipped(buf, min, max)
static void check_pix_sum(MpegvideoEncDSPContext *c)
#define randomize_buffers(buf, size)
void checkasm_check_mpegvideoencdsp(void)
static void check_denoise_dct(MpegvideoEncDSPContext *c)