40 uint8_t fill[4][8 + 6 + 3] = {{ 0 }};
41 uint8_t *
data[4] = { fill[0], fill[1], fill[2], fill[3] };
42 int linesize[4] = { 0, 0, 0, 0 };
73 tmp[0] =
tmp[1] = (1ULL <<
c->depth) - 1;
82 const uint8_t *
block1, ptrdiff_t stride1,
83 const uint8_t *block2, ptrdiff_t stride2,
91 case 0:
block1++; block2++;
break;
92 case 1: block2++;
break;
96 out = f_out(
block1, stride1, block2, stride2);
97 ref = f_ref(
block1, stride1, block2, stride2);
98 printf(
"[%s] [%c%c] SAD [%s] %dx%d=%d ref=%d\n",
99 out ==
ref ?
"OK" :
"FAIL",
106 const uint8_t *
b1,
const uint8_t *
b2)
110 for (
a = 0;
a < 3;
a++) {
127 if (!buf1 || !buf2) {
128 fprintf(stderr,
"malloc failure\n");
135#define RANDOM_INIT(buf, size) do { \
137 for (k = 0; k < size; k++) { \
138 state = state * 1664525 + 1013904223; \
139 buf[k] = state>>24; \
146 ret =
run_test(
"random", buf1, buf2);
151 memset(buf1, 0xff,
W1*
H1);
152 memset(buf2, 0x00,
W2*
H2);
158 memset(buf1, 0x90,
W1*
H1);
159 memset(buf2, 0x90,
W2*
H2);
165 for (
i = 1;
i <= 5;
i++) {
172 size1 = size2 = 1 << (
i << 1);
175 case 0: size1++; size2++;
break;
176 case 1: size2++;
break;
182 if (!buf1 || !buf2) {
183 fprintf(stderr,
"malloc failure\n");
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static const uint8_t *BS_FUNC align(BSCTX *bc)
Skip bits to a byte boundary.
#define i(width, name, range_min, range_max)
__device__ int printf(const char *,...)
static int16_t block1[64]
static struct @346255127015250356166251341105367306144006377143 state
#define AV_LOG_INFO
Standard information.
common internal API header
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 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 void check_pixfmt_descriptors(void)
#define RANDOM_INIT(buf, size)
static int run_test(const char *test, const uint8_t *b1, const uint8_t *b2)
Memory handling functions.
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w)
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
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])
@ AV_PIX_FMT_NB
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
#define FF_ARRAY_ELEMS(a)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint64_t flags
Combination of AV_PIX_FMT_FLAG_... flags.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
uint8_t nb_components
The number of components each pixel has, (1-4)
static int ref[MAX_W *MAX_W]
static double b1(void *priv, double x, double y)
static double b2(void *priv, double x, double y)