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 };
61 if (j >=
d->nb_components) {
62 av_assert0(!
c->plane && !
c->step && !
c->offset && !
c->shift && !
c->depth);
74 tmp[0] =
tmp[1] = (1ULL <<
c->depth) - 1;
83 const uint8_t *
block1, ptrdiff_t stride1,
84 const uint8_t *block2, ptrdiff_t stride2,
92 case 0:
block1++; block2++;
break;
93 case 1: block2++;
break;
97 out = f_out(
block1, stride1, block2, stride2);
98 ref = f_ref(
block1, stride1, block2, stride2);
99 printf(
"[%s] [%c%c] SAD [%s] %dx%d=%d ref=%d\n",
100 out ==
ref ?
"OK" :
"FAIL",
107 const uint8_t *
b1,
const uint8_t *
b2)
111 for (
a = 0;
a < 3;
a++) {
113 const uint8_t *block2 =
b2;
116 case 0:
block1++; block2++;
break;
117 case 1: block2++;
break;
136 if (!buf1 || !buf2) {
137 fprintf(stderr,
"malloc failure\n");
144 #define RANDOM_INIT(buf, size) do { \
146 for (k = 0; k < size; k++) { \
147 state = state * 1664525 + 1013904223; \
148 buf[k] = state>>24; \
160 memset(buf1, 0xff,
W1*
H1);
161 memset(buf2, 0x00,
W2*
H2);
167 memset(buf1, 0x90,
W1*
H1);
168 memset(buf2, 0x90,
W2*
H2);
174 for (
i = 1;
i <= 5;
i++) {
181 size1 = size2 = 1 << (
i << 1);
184 case 0: size1++; size2++;
break;
185 case 1: size2++;
break;
191 if (!buf1 || !buf2) {
192 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)