Go to the documentation of this file.
27 const uint8_t *
block1, ptrdiff_t stride1,
28 const uint8_t *block2, ptrdiff_t stride2,
36 case 0:
block1++; block2++;
break;
37 case 1: block2++;
break;
41 out = f_out(
block1, stride1, block2, stride2);
42 ref = f_ref(
block1, stride1, block2, stride2);
43 printf(
"[%s] [%c%c] SAD [%s] %dx%d=%d ref=%d\n",
44 out ==
ref ?
"OK" :
"FAIL",
45 align ?
'A' :
'U', align == 2 ?
'A' :
'U',
51 const uint8_t *
b1,
const uint8_t *
b2)
55 for (
a = 0;
a < 3;
a++) {
57 const uint8_t *block2 =
b2;
60 case 0:
block1++; block2++;
break;
61 case 1: block2++;
break;
81 fprintf(stderr,
"malloc failure\n");
88 #define RANDOM_INIT(buf, size) do { \
90 for (k = 0; k < size; k++) { \
91 state = state * 1664525 + 1013904223; \
104 memset(buf1, 0xff,
W1*
H1);
105 memset(buf2, 0x00,
W2*
H2);
111 memset(buf1, 0x90,
W1*
H1);
112 memset(buf2, 0x90,
W2*
H2);
118 for (
i = 1;
i <= 5;
i++) {
119 for (align = 0; align < 3; align++) {
125 size1 = size2 = 1 << (
i << 1);
128 case 0: size1++; size2++;
break;
129 case 1: size2++;
break;
135 if (!buf1 || !buf2) {
136 fprintf(stderr,
"malloc failure\n");
int(* av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1, const uint8_t *src2, ptrdiff_t stride2)
Sum of abs(src1[x] - src2[x])
static int run_single_test(const char *test, const uint8_t *block1, ptrdiff_t stride1, const uint8_t *block2, ptrdiff_t stride2, int align, int n)
static double b1(void *priv, double x, double y)
#define FF_ARRAY_ELEMS(a)
printf("static const uint8_t my_array[100] = {\n")
static double b2(void *priv, double x, double y)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
void ff_check_pixfmt_descriptors(void)
#define i(width, name, range_min, range_max)
av_pixelutils_sad_fn av_pixelutils_get_sad_fn(int w_bits, int h_bits, int aligned, void *log_ctx)
Get a potentially optimized pointer to a Sum-of-absolute-differences function (see the av_pixelutils_...
static int ref[MAX_W *MAX_W]
#define RANDOM_INIT(buf, size)
static int16_t block1[64]
static int run_test(const char *test, const uint8_t *b1, const uint8_t *b2)