Go to the documentation of this file.
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
140 #define EDGE_WIDTH 16
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))
#define declare_func_emms(cpu_flags, ret,...)
static int16_t basis[64][64]
#define check_func(func,...)
void checkasm_check_mpegvideoencdsp(void)
static void check_pix_norm1(MpegvideoEncDSPContext *c)
static void check_pix_sum(MpegvideoEncDSPContext *c)
#define FF_ARRAY_ELEMS(a)
static const int input_sizes[]
#define LOCAL_ALIGNED_16(t, v,...)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
#define DECLARE_ALIGNED(n, t, v)
static int shift(int a, int b)
#define i(width, name, range_min, range_max)
#define randomize_buffer_clipped(buf, min, max)
#define randomize_buffers(buf, size)
#define AV_CPU_FLAG_MMX
standard MMX
main external API structure.
static av_const int sign_extend(int val, unsigned bits)
#define declare_func(ret,...)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
static void check_draw_edges(MpegvideoEncDSPContext *c)
The exact code depends on how similar the blocks are and how related they are to the block
static void check_add_8x8basis(MpegvideoEncDSPContext *c)
static void check_denoise_dct(MpegvideoEncDSPContext *c)