Go to the documentation of this file.
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; \
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");
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)
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])
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
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)
@ AV_PIX_FMT_NB
number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of...
static double b1(void *priv, double x, double y)
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
#define FF_ARRAY_ELEMS(a)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void check_pixfmt_descriptors(void)
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 AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
printf("static const uint8_t my_array[100] = {\n")
static const uint8_t *BS_FUNC() align(BSCTX *bc)
Skip bits to a byte boundary.
static double b2(void *priv, double x, double y)
static int16_t block1[64]
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
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
#define AV_PIX_FMT_FLAG_BAYER
The pixel format is following a Bayer pattern.
#define AV_LOG_INFO
Standard information.
#define i(width, name, range_min, range_max)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
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)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
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)
static int run_test(const char *test, const uint8_t *b1, const uint8_t *b2)