x86/swscale.c File Reference
#include <inttypes.h>
#include "config.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
#include "libavutil/cpu.h"
#include "libavutil/pixdesc.h"
Include dependency graph for x86/swscale.c:

Go to the source code of this file.

Macros

#define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt)
 
#define SCALE_FUNCS(filter_n, opt)
 
#define SCALE_FUNCS_MMX(opt)
 
#define SCALE_FUNCS_SSE(opt)
 
#define VSCALEX_FUNC(size, opt)
 
#define VSCALEX_FUNCS(opt)
 
#define VSCALE_FUNC(size, opt)
 
#define VSCALE_FUNCS(opt1, opt2)
 
#define INPUT_Y_FUNC(fmt, opt)
 
#define INPUT_UV_FUNC(fmt, opt)
 
#define INPUT_FUNC(fmt, opt)
 
#define INPUT_FUNCS(opt)
 
#define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2)
 
#define ASSIGN_MMX_SCALE_FUNC(hscalefn, filtersize, opt1, opt2)
 
#define ASSIGN_VSCALEX_FUNC(vscalefn, opt, do_16_case, condition_8bit)
 
#define ASSIGN_VSCALE_FUNC(vscalefn, opt1, opt2, opt2chk)
 
#define case_rgb(x, X, opt)
 
#define ASSIGN_SSE_SCALE_FUNC(hscalefn, filtersize, opt1, opt2)
 

Functions

 SCALE_FUNCS_SSE (sse2)
 
 SCALE_FUNCS_SSE (ssse3)
 
 SCALE_FUNCS_SSE (sse4)
 
 VSCALEX_FUNCS (sse2)
 
 VSCALEX_FUNCS (sse4)
 
 VSCALEX_FUNC (16, sse4)
 
 VSCALEX_FUNCS (avx)
 
 VSCALE_FUNCS (sse2, sse2)
 
 VSCALE_FUNC (16, sse4)
 
 VSCALE_FUNCS (avx, avx)
 
 INPUT_FUNCS (sse2)
 
 INPUT_FUNCS (ssse3)
 
 INPUT_FUNCS (avx)
 
av_cold void ff_sws_init_swScale_mmx (SwsContext *c)
 

Macro Definition Documentation

#define ASSIGN_MMX_SCALE_FUNC (   hscalefn,
  filtersize,
  opt1,
  opt2 
)
Value:
switch (filtersize) { \
case 4: ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \
case 8: ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \
default: ASSIGN_SCALE_FUNC2(hscalefn, X, opt1, opt2); break; \
}
#define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2)
Sampled sinusoid X
default
Definition: start.py:60

Referenced by ff_sws_init_swScale_mmx().

#define ASSIGN_SCALE_FUNC2 (   hscalefn,
  filtersize,
  opt1,
  opt2 
)
Value:
do { \
if (c->srcBpc == 8) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale8to15_ ## filtersize ## _ ## opt2 : \
ff_hscale8to19_ ## filtersize ## _ ## opt1; \
} else if (c->srcBpc == 9) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale9to15_ ## filtersize ## _ ## opt2 : \
ff_hscale9to19_ ## filtersize ## _ ## opt1; \
} else if (c->srcBpc == 10) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale10to15_ ## filtersize ## _ ## opt2 : \
ff_hscale10to19_ ## filtersize ## _ ## opt1; \
} else if (c->srcBpc == 12) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \
ff_hscale12to19_ ## filtersize ## _ ## opt1; \
} else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_desc_get(c->srcFormat)->comp[0].depth_minus1<15)) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \
ff_hscale14to19_ ## filtersize ## _ ## opt1; \
} else { /* c->srcBpc == 16 */ \
av_assert0(c->srcBpc == 16);\
hscalefn = c->dstBpc <= 14 ? ff_hscale16to15_ ## filtersize ## _ ## opt2 : \
ff_hscale16to19_ ## filtersize ## _ ## opt1; \
} \
} while (0)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:1778
#define _(x)
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:86
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:79
#define isAnyRGB(x)
uint16_t depth_minus1
number of bits in the component minus 1
Definition: pixdesc.h:43
static double c[64]
#define ASSIGN_SSE_SCALE_FUNC (   hscalefn,
  filtersize,
  opt1,
  opt2 
)
Value:
switch (filtersize) { \
case 4: ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \
case 8: ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \
default: if (filtersize & 4) ASSIGN_SCALE_FUNC2(hscalefn, X4, opt1, opt2); \
else ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
break; \
}
#define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2)
else[Y, I2]
default
Definition: start.py:60
X4
Definition: Lab2 1d.m:2

Referenced by ff_sws_init_swScale_mmx().

#define ASSIGN_VSCALE_FUNC (   vscalefn,
  opt1,
  opt2,
  opt2chk 
)
Value:
switch(c->dstBpc){ \
case 16: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2plane1_16_ ## opt1; break; \
case 10: if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_10_ ## opt2; break; \
case 9: if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_9_ ## opt2; break; \
case 8: vscalefn = ff_yuv2plane1_8_ ## opt1; break; \
default: av_assert0(c->dstBpc>8); \
}
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
default
Definition: start.py:60
static double c[64]

Referenced by ff_sws_init_swScale_mmx().

#define ASSIGN_VSCALEX_FUNC (   vscalefn,
  opt,
  do_16_case,
  condition_8bit 
)
Value:
switch(c->dstBpc){ \
case 16: do_16_case; break; \
case 10: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_10_ ## opt; break; \
case 9: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_9_ ## opt; break; \
default: if (condition_8bit) /*vscalefn = ff_yuv2planeX_8_ ## opt;*/ break; \
}
static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
default
Definition: start.py:60
static double c[64]

Referenced by ff_sws_init_swScale_mmx().

#define case_rgb (   x,
  X,
  opt 
)
Value:
case AV_PIX_FMT_ ## X: \
c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \
if (!c->chrSrcHSubSample) \
c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \
break
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
Discrete Time axis x
Sampled sinusoid X
static double c[64]

Referenced by ff_sws_init_swScale_mmx().

#define INPUT_FUNC (   fmt,
  opt 
)
Value:
const char * fmt
Definition: avisynth_c.h:669
#define INPUT_Y_FUNC(fmt, opt)
Definition: x86/swscale.c:348
#define INPUT_UV_FUNC(fmt, opt)
Definition: x86/swscale.c:352

Definition at line 358 of file x86/swscale.c.

#define INPUT_FUNCS (   opt)
Value:
INPUT_FUNC(uyvy, opt); \
INPUT_FUNC(yuyv, opt); \
INPUT_UV_FUNC(nv12, opt); \
INPUT_UV_FUNC(nv21, opt); \
INPUT_FUNC(rgba, opt); \
INPUT_FUNC(bgra, opt); \
INPUT_FUNC(argb, opt); \
INPUT_FUNC(abgr, opt); \
INPUT_FUNC(rgb24, opt); \
INPUT_FUNC(bgr24, opt)
#define INPUT_FUNC(fmt, opt)
Definition: x86/swscale.c:358
#define INPUT_UV_FUNC(fmt, opt)
Definition: x86/swscale.c:352

Definition at line 361 of file x86/swscale.c.

#define INPUT_UV_FUNC (   fmt,
  opt 
)
Value:
void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \
const uint8_t *unused0, \
const uint8_t *src1, \
const uint8_t *src2, \
int w, uint32_t *unused)
const char * fmt
Definition: avisynth_c.h:669
output residual component w
uint8_t

Definition at line 352 of file x86/swscale.c.

#define INPUT_Y_FUNC (   fmt,
  opt 
)
Value:
void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \
const uint8_t *unused1, const uint8_t *unused2, \
int w, uint32_t *unused)
const char * fmt
Definition: avisynth_c.h:669
output residual component w
uint8_t
AVS_Value src
Definition: avisynth_c.h:523
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 348 of file x86/swscale.c.

#define SCALE_FUNC (   filter_n,
  from_bpc,
  to_bpc,
  opt 
)
Value:
void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
SwsContext *c, int16_t *data, \
int dstW, const uint8_t *src, \
const int16_t *filter, \
const int32_t *filterPos, int filterSize)
#define _(x)
uint8_t
the mask is usually to keep the same permissions Filters should remove permissions on reference they give to output whenever necessary It can be automatically done by setting the rej_perms field on the output pad Here are a few guidelines corresponding to common 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
Spectrum Plot time data
int32_t
AVS_Value src
Definition: avisynth_c.h:523
FFmpeg Automated Testing Environment ************************************Table of Contents *****************FFmpeg Automated Testing Environment Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass target exec to configure or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script tests fate sh from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at doc fate_config sh template Create a configuration that suits your based on the configuration template The slot configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern< arch >< os >< compiler >< compiler version > The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the fate_recv variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ssh command with one or more v options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory FATE makefile targets and variables *************************************Makefile can be set to
Definition: fate.txt:142
static double c[64]

Definition at line 276 of file x86/swscale.c.

#define SCALE_FUNCS (   filter_n,
  opt 
)
Value:
SCALE_FUNC(filter_n, 8, 15, opt); \
SCALE_FUNC(filter_n, 9, 15, opt); \
SCALE_FUNC(filter_n, 10, 15, opt); \
SCALE_FUNC(filter_n, 12, 15, opt); \
SCALE_FUNC(filter_n, 14, 15, opt); \
SCALE_FUNC(filter_n, 16, 15, opt); \
SCALE_FUNC(filter_n, 8, 19, opt); \
SCALE_FUNC(filter_n, 9, 19, opt); \
SCALE_FUNC(filter_n, 10, 19, opt); \
SCALE_FUNC(filter_n, 12, 19, opt); \
SCALE_FUNC(filter_n, 14, 19, opt); \
SCALE_FUNC(filter_n, 16, 19, opt)
#define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt)
Definition: x86/swscale.c:276

Definition at line 283 of file x86/swscale.c.

#define SCALE_FUNCS_MMX (   opt)
Value:
SCALE_FUNCS(4, opt); \
SCALE_FUNCS(8, opt); \
Sampled sinusoid X
#define SCALE_FUNCS(filter_n, opt)
Definition: x86/swscale.c:283

Definition at line 297 of file x86/swscale.c.

#define SCALE_FUNCS_SSE (   opt)
Value:
SCALE_FUNCS(4, opt); \
SCALE_FUNCS(8, opt); \
SCALE_FUNCS(X8, opt)
#define SCALE_FUNCS(filter_n, opt)
Definition: x86/swscale.c:283
X4
Definition: Lab2 1d.m:2

Definition at line 302 of file x86/swscale.c.

#define VSCALE_FUNC (   size,
  opt 
)
Value:
void ff_yuv2plane1_ ## size ## _ ## opt(const int16_t *src, uint8_t *dst, int dstW, \
const uint8_t *dither, int offset)
#define _(x)
uint8_t
static const uint8_t offset[127][2]
Definition: vf_spp.c:70
int size
AVS_Value src
Definition: avisynth_c.h:523
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 332 of file x86/swscale.c.

#define VSCALE_FUNCS (   opt1,
  opt2 
)
Value:
VSCALE_FUNC(8, opt1); \
VSCALE_FUNC(9, opt2); \
VSCALE_FUNC(10, opt2); \
VSCALE_FUNC(16, opt1)
#define VSCALE_FUNC(size, opt)
Definition: x86/swscale.c:332

Definition at line 335 of file x86/swscale.c.

#define VSCALEX_FUNC (   size,
  opt 
)
Value:
void ff_yuv2planeX_ ## size ## _ ## opt(const int16_t *filter, int filterSize, \
const int16_t **src, uint8_t *dest, int dstW, \
const uint8_t *dither, int offset)
#define _(x)
uint8_t
the mask is usually to keep the same permissions Filters should remove permissions on reference they give to output whenever necessary It can be automatically done by setting the rej_perms field on the output pad Here are a few guidelines corresponding to common 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
static const uint8_t offset[127][2]
Definition: vf_spp.c:70
int size
dest
Definition: start.py:60
AVS_Value src
Definition: avisynth_c.h:523

Definition at line 315 of file x86/swscale.c.

#define VSCALEX_FUNCS (   opt)
Value:
VSCALEX_FUNC(8, opt); \
VSCALEX_FUNC(9, opt); \
VSCALEX_FUNC(10, opt)
#define VSCALEX_FUNC(size, opt)
Definition: x86/swscale.c:315

Definition at line 319 of file x86/swscale.c.

Function Documentation

av_cold void ff_sws_init_swScale_mmx ( SwsContext c)

Definition at line 380 of file x86/swscale.c.

Referenced by ff_getSwsFunc(), and usePal().

INPUT_FUNCS ( sse2  )
INPUT_FUNCS ( ssse3  )
INPUT_FUNCS ( avx  )
SCALE_FUNCS_SSE ( sse2  )
SCALE_FUNCS_SSE ( ssse3  )
SCALE_FUNCS_SSE ( sse4  )
VSCALE_FUNC ( 16  ,
sse4   
)
VSCALE_FUNCS ( sse2  ,
sse2   
)
VSCALE_FUNCS ( avx  ,
avx   
)
VSCALEX_FUNC ( 16  ,
sse4   
)
VSCALEX_FUNCS ( sse2  )
VSCALEX_FUNCS ( sse4  )
VSCALEX_FUNCS ( avx  )