Go to the documentation of this file.
31 #define randomize_buffers(buf, size) \
34 for (j = 0; j < size; j+=4) \
35 AV_WN32(buf + j, rnd()); \
41 const int16_t **
src, uint8_t *dest,
int dstW,
45 d = ((filterSize - 1) * 8 +
dither[0]) >> 4;
46 for (
i = 0;
i < dstW;
i++) {
53 for (j = 0; j < filterSize; j++){
64 int fsi, osi, isi,
i, j;
66 #define LARGEST_FILTER 16
67 #define FILTER_SIZES 4
68 static const int filter_sizes[
FILTER_SIZES] = {1, 4, 8, 16};
69 #define LARGEST_INPUT_SIZE 512
71 static const int input_sizes[
INPUT_SIZES] = {8, 24, 128, 144, 256, 512};
74 int filterSize,
const int16_t **
src, uint8_t *dest,
87 uint8_t d_val =
rnd();
97 dstW = input_sizes[isi];
98 for(osi = 0; osi < 64; osi += 16){
101 vFilterData =
av_malloc((filter_sizes[fsi] + 2) *
sizeof(
union VFilterData));
102 memset(vFilterData, 0, (filter_sizes[fsi] + 2) *
sizeof(
union VFilterData));
103 for(
i = 0;
i < filter_sizes[fsi]; ++
i){
105 vFilterData[
i].src =
src[
i];
106 for(j = 0; j < 4; ++j)
107 vFilterData[
i].
coeff[j + 4] = filter_coeff[
i];
109 if (
check_func(
ctx->yuv2planeX,
"yuv2yuvX_%d_%d_%d", filter_sizes[fsi], osi, dstW)){
119 if(
ctx->use_mmx_vfilter){
120 call_new((
const int16_t*)vFilterData, filter_sizes[fsi],
src, dst1, dstW - osi,
dither, osi);
124 bench_new((
const int16_t*)vFilterData, filter_sizes[fsi],
src, dst1, dstW - osi,
dither, osi);
137 #define SRC_PIXELS 512
141 #define MAX_FILTER_WIDTH 40
142 #define FILTER_SIZES 6
143 static const int filter_sizes[
FILTER_SIZES] = { 4, 8, 12, 16, 32, 40 };
145 #define HSCALE_PAIRS 2
151 #define LARGEST_INPUT_SIZE 512
152 #define INPUT_SIZES 6
153 static const int input_sizes[
INPUT_SIZES] = {8, 24, 128, 144, 256, 512};
155 int i, j, fsi, hpi,
width, dstWi;
172 const uint8_t *
src,
const int16_t *
filter,
173 const int32_t *filterPos,
int filterSize);
186 width = filter_sizes[fsi];
188 ctx->srcBpc = hscale_pairs[hpi][0];
189 ctx->dstBpc = hscale_pairs[hpi][1];
209 for (j = 0; j <
width; j++) {
222 ctx->dstW =
ctx->chrDstW = input_sizes[dstWi];
229 memset(dst0, 0,
SRC_PIXELS *
sizeof(dst0[0]));
230 memset(dst1, 0,
SRC_PIXELS *
sizeof(dst1[0]));
234 if (memcmp(dst0, dst1,
ctx->dstW *
sizeof(dst0[0])))
#define declare_func_emms(cpu_flags, ret,...)
int dstW
Width of destination luma/alpha planes.
static void check_yuv2yuvX(void)
#define check_func(func,...)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static atomic_int cpu_flags
static double val(void *priv, double ch)
static void check_hscale(void)
#define AV_CPU_FLAG_SLOW_GATHER
CPU has slow gathers.
#define LOCAL_ALIGNED_16(t, v,...)
#define LOCAL_ALIGNED_32(t, v,...)
struct SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext.
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
void ff_sws_init_scale(SwsContext *c)
int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, int filterSize, int16_t *filter, int dstW)
#define AV_CPU_FLAG_AVX2
AVX2 functions: requires OS support even if YMM registers aren't used.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
#define i(width, name, range_min, range_max)
#define LARGEST_INPUT_SIZE
#define randomize_buffers(buf, size)
av_warn_unused_result int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
#define AV_CPU_FLAG_MMX
standard MMX
void sws_freeContext(struct SwsContext *swsContext)
Free the swscaler context swsContext.
static void ref_function(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
static const double coeff[2][5]
void checkasm_check_sw_scale(void)
static const uint8_t dither[8][8]