Go to the documentation of this file.
31 const uint8_t *
block1, ptrdiff_t stride1,
32 const uint8_t *block2, ptrdiff_t stride2,
40 case 0:
block1++; block2++;
break;
41 case 1: block2++;
break;
45 out = f_out(
block1, stride1, block2, stride2);
46 ref = f_ref(
block1, stride1, block2, stride2);
47 printf(
"[%s] [%c%c] SAD [%s] %dx%d=%d ref=%d\n",
48 out ==
ref ?
"OK" :
"FAIL",
49 align ?
'A' :
'U', align == 2 ?
'A' :
'U',
55 const uint8_t *
b1,
const uint8_t *
b2)
59 for (
a = 0;
a < 3;
a++) {
61 const uint8_t *block2 =
b2;
64 case 0:
block1++; block2++;
break;
65 case 1: block2++;
break;
85 fprintf(stderr,
"malloc failure\n");
92 #define RANDOM_INIT(buf, size) do { \
94 for (k = 0; k < size; k++) { \
95 state = state * 1664525 + 1013904223; \
108 memset(buf1, 0xff,
W1*
H1);
109 memset(buf2, 0x00,
W2*
H2);
115 memset(buf1, 0x90,
W1*
H1);
116 memset(buf2, 0x90,
W2*
H2);
122 for (
i = 1;
i <= 5;
i++) {
123 for (align = 0; align < 3; align++) {
129 size1 = size2 = 1 << (
i << 1);
132 case 0: size1++; size2++;
break;
133 case 1: size2++;
break;
139 if (!buf1 || !buf2) {
140 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)