Go to the documentation of this file.
32 #define randomize_buffers(buf, size) \
34 for (int j = 0; j < size; j += 4) \
35 AV_WN32(buf + j, rnd()); \
67 for (
size_t i = 0;
i < n;
i++) {
76 const uint16_t *ref16 = (
const uint16_t *)
ref;
77 const uint16_t *test16 = (
const uint16_t *)
test;
78 for (
size_t i = 0;
i < n;
i++) {
79 if (
abs(( ref16[
i] & 0x1f) - ( test16[
i] & 0x1f)) > accuracy)
81 if (
abs(((ref16[
i] >> 5) & 0x1f) - ((test16[
i] >> 5) & 0x1f)) > accuracy)
83 if (
abs(((ref16[
i] >> 10) & 0x1f) - ((test16[
i] >> 10) & 0x1f)) > accuracy)
91 const uint16_t *ref16 = (
const uint16_t *)
ref;
92 const uint16_t *test16 = (
const uint16_t *)
test;
93 for (
size_t i = 0;
i < n;
i++) {
94 if (
abs(( ref16[
i] & 0x1f) - ( test16[
i] & 0x1f)) > accuracy)
96 if (
abs(((ref16[
i] >> 5) & 0x3f) - ((test16[
i] >> 5) & 0x3f)) > accuracy)
98 if (
abs(((ref16[
i] >> 11) & 0x1f) - ((test16[
i] >> 11) & 0x1f)) > accuracy)
107 #define MAX_LINE_SIZE 1920
108 #define SRC_STRIDE_PAD 32
113 const int srcStride[],
int srcSliceY,
int srcSliceH,
114 uint8_t *
const dst[],
const int dstStride[]);
120 const uint8_t *
src[4] = { src_y, src_u, src_v, src_a };
125 uint8_t *dst0[4] = { dst0_0, dst0_1, dst0_2 };
130 uint8_t *dst1[4] = { dst1_0, dst1_1, dst1_2 };
169 width, srcSliceH, dst_pix_fmt,
187 srcSliceH, dst0, dstStride);
189 srcSliceH, dst1, dstStride);
197 for (
int row = 0; row < srcSliceH; row++)
199 dst1_0 + row * dstStride[0],
200 width * sample_size, 3))
204 for (
int row = 0; row < srcSliceH; row++)
206 dst1_0 + row * dstStride[0],
211 for (
int row = 0; row < srcSliceH; row++)
213 dst1_0 + row * dstStride[0],
217 for (
int p = 0;
p < 3;
p++)
218 for (
int row = 0; row < srcSliceH; row++)
220 dst1[
p] + row * dstStride[
p],
228 srcSliceH, dst0, dstStride);
236 #undef SRC_STRIDE_PAD
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
void sws_freeContext(SwsContext *swsContext)
Free the swscaler context swsContext.
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
#define randomize_buffers(buf, size)
static int cmp_565_by_n(const uint8_t *ref, const uint8_t *test, size_t n, int accuracy)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
static int cmp_555_by_n(const uint8_t *ref, const uint8_t *test, size_t n, int accuracy)
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
static const int input_sizes[]
static void check_yuv2rgb(int src_pix_fmt)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define LOCAL_ALIGNED_8(t, v,...)
int av_log_get_level(void)
Get the current log level.
static int cmp_off_by_n(const uint8_t *ref, const uint8_t *test, size_t n, int accuracy)
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
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
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define i(width, name, range_min, range_max)
void checkasm_check_sw_yuv2rgb(void)
#define AV_PIX_FMT_BGR555
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
Compute the size of an image line with format pix_fmt and width width for the plane plane.
void av_log_set_level(int level)
Set the log level.
#define AV_PIX_FMT_RGB555
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
#define AV_PIX_FMT_BGR565
#define AV_PIX_FMT_RGB565
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
SwsContext * sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Allocate and return an SwsContext.
static int ref[MAX_W *MAX_W]
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
static const int dst_fmts[]
static SwsInternal * sws_internal(const SwsContext *sws)
Main external API structure.