Go to the documentation of this file.
32 #define randomize_buffers(buf, size) \
35 for (j = 0; j < size; j+=4) \
36 AV_WN32(buf + j, rnd()); \
70 int dstW, byte_size, luma_filter_size, chr_filter_size;
71 #define LARGEST_FILTER 16
72 #define FILTER_SIZES 4
73 static const int filter_sizes[] = {1, 4, 8, 16};
74 #define LARGEST_INPUT_SIZE 512
75 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
80 const int16_t **lumSrcx,
int lumFilterSize,
81 const int16_t *chrFilter,
const int16_t **chrUSrcx,
82 const int16_t **chrVSrcx,
int chrFilterSize,
83 const int16_t **alpSrcx, uint8_t **dest,
116 dst0[0] = (uint8_t*)dst0_g;
117 dst0[1] = (uint8_t*)dst0_b;
118 dst0[2] = (uint8_t*)dst0_r;
119 dst0[3] = (uint8_t*)dst0_a;
121 dst1[0] = (uint8_t*)dst1_g;
122 dst1[1] = (uint8_t*)dst1_b;
123 dst1[2] = (uint8_t*)dst1_r;
124 dst1[3] = (uint8_t*)dst1_a;
147 luma_filter_size = filter_sizes[fsi];
148 chr_filter_size = filter_sizes[fsi];
150 if (
desc->comp[0].depth > 16) {
152 }
else if (
desc->comp[0].depth > 8) {
159 if (
check_func(
c->yuv2anyX,
"yuv2%s_full_X_%d_%d",
desc->name, luma_filter_size, dstW)) {
160 for (
i = 0;
i < 4;
i ++) {
165 call_ref(
c, luma_filter, luma, luma_filter_size,
166 chr_filter, chru, chrv, chr_filter_size,
167 alpha, dst0, dstW, 0);
168 call_new(
c, luma_filter, luma, luma_filter_size,
169 chr_filter, chru, chrv, chr_filter_size,
170 alpha, dst1, dstW, 0);
172 if (memcmp(dst0[0], dst1[0], dstW * byte_size) ||
173 memcmp(dst0[1], dst1[1], dstW * byte_size) ||
174 memcmp(dst0[2], dst1[2], dstW * byte_size) ||
175 memcmp(dst0[3], dst1[3], dstW * byte_size) )
178 bench_new(
c, luma_filter, luma, luma_filter_size,
179 chr_filter, chru, chrv, chr_filter_size,
180 alpha, dst1, dstW, 0);
188 #undef LARGEST_INPUT_SIZE
197 #define LARGEST_INPUT_SIZE 512
198 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
199 const uint8_t *
src[4];
219 src[0] = (uint8_t*)src_g;
220 src[1] = (uint8_t*)src_b;
221 src[2] = (uint8_t*)src_r;
222 src[3] = (uint8_t*)src_a;
238 if(
check_func(
c->readLumPlanar,
"planar_%s_to_y_%d",
desc->name, dstW)) {
245 if (memcmp(dst0_y, dst1_y, dstW * byte_size))
256 #undef LARGEST_INPUT_SIZE
265 #define LARGEST_INPUT_SIZE 512
266 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
267 const uint8_t *
src[4];
290 src[0] = (uint8_t*)src_g;
291 src[1] = (uint8_t*)src_b;
292 src[2] = (uint8_t*)src_r;
293 src[3] = (uint8_t*)src_a;
309 if(
check_func(
c->readChrPlanar,
"planar_%s_to_uv_%d",
desc->name, dstW)) {
318 if (memcmp(dst0_u, dst1_u, dstW * byte_size) ||
319 memcmp(dst0_v, dst1_v, dstW * byte_size))
329 #undef LARGEST_INPUT_SIZE
338 #define LARGEST_INPUT_SIZE 512
339 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
340 const uint8_t *
src[4];
360 src[0] = (uint8_t*)src_g;
361 src[1] = (uint8_t*)src_b;
362 src[2] = (uint8_t*)src_r;
363 src[3] = (uint8_t*)src_a;
382 if(
check_func(
c->readAlpPlanar,
"planar_%s_to_a_%d",
desc->name, dstW)) {
389 if (memcmp(dst0_a, dst1_a, dstW * byte_size))
401 report(
"output_yuv2gbrp");
404 report(
"input_planar_rgb_y");
407 report(
"input_planar_rgb_uv");
410 report(
"input_planar_rgb_a");
@ AV_PIX_FMT_GBRP16BE
planar GBR 4:4:4 48bpp, big-endian
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
void sws_freeContext(SwsContext *swsContext)
Free the swscaler context swsContext.
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
#define check_func(func,...)
static const char rgb2yuv[]
unsigned flags
Bitmask of SWS_*.
@ AV_PIX_FMT_GBRP14BE
planar GBR 4:4:4 42bpp, big-endian
@ AV_PIX_FMT_GBRAP12LE
planar GBR 4:4:4:4 48bpp, little-endian
static const int planar_fmts[]
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
#define AV_PIX_FMT_YUVA444P16
av_warn_unused_result int sws_init_context(SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
static void check_output_yuv2gbrp(void)
void checkasm_check_sw_gbrp(void)
#define FF_ARRAY_ELEMS(a)
#define randomize_buffers(buf, size)
@ AV_PIX_FMT_GBRAP16BE
planar GBRA 4:4:4:4 64bpp, big-endian
@ AV_PIX_FMT_GBRP16LE
planar GBR 4:4:4 48bpp, little-endian
static const int input_sizes[]
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
static void check_input_planar_rgb_to_y(void)
#define LOCAL_ALIGNED_8(t, v,...)
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
@ AV_PIX_FMT_GBRAP12BE
planar GBR 4:4:4:4 48bpp, big-endian
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
static void check_input_planar_rgb_to_uv(void)
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
@ AV_PIX_FMT_GBRP9BE
planar GBR 4:4:4 27bpp, big-endian
@ AV_PIX_FMT_GBRP9LE
planar GBR 4:4:4 27bpp, little-endian
#define LARGEST_INPUT_SIZE
@ AV_PIX_FMT_GBRAP10LE
planar GBR 4:4:4:4 40bpp, little-endian
int dst_format
Destination pixel format.
static SwsContext * sws[3]
#define i(width, name, range_min, range_max)
void ff_sws_init_scale(SwsInternal *c)
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
@ AV_PIX_FMT_GBRAP16LE
planar GBRA 4:4:4:4 64bpp, little-endian
@ SWS_FULL_CHR_H_INT
Perform full chroma upsampling when upscaling to RGB.
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
static void check_input_planar_rgb_to_a(void)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
int src_format
Source pixel format.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define declare_func(ret,...)
static const int16_t alpha[]
@ AV_PIX_FMT_GBRP14LE
planar GBR 4:4:4 42bpp, little-endian
static SwsInternal * sws_internal(const SwsContext *sws)
@ AV_PIX_FMT_GBRAP10BE
planar GBR 4:4:4:4 40bpp, big-endian
Main external API structure.