libswscale/swscale.c File Reference

#include <inttypes.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <unistd.h>
#include "config.h"
#include <assert.h>
#include "swscale.h"
#include "swscale_internal.h"
#include "x86_cpu.h"
#include "bswap.h"
#include "rgb2rgb.h"
#include "libavcodec/opt.h"
#include "swscale_template.c"

Go to the source code of this file.

Defines

#define DITHER1XBPP
#define FAST_BGR2YV12
#define RET   0xC3
#define ASSERT(x)   ;
#define PI   3.14159265358979323846
#define isSupportedIn(x)
#define isSupportedOut(x)
#define isPacked(x)
#define RGB2YUV_SHIFT   16
#define BY   ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5))
#define BV   ((int)(-0.071*(1<<RGB2YUV_SHIFT)+0.5))
#define BU   ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
#define GY   ((int)( 0.504*(1<<RGB2YUV_SHIFT)+0.5))
#define GV   ((int)(-0.368*(1<<RGB2YUV_SHIFT)+0.5))
#define GU   ((int)(-0.291*(1<<RGB2YUV_SHIFT)+0.5))
#define RY   ((int)( 0.257*(1<<RGB2YUV_SHIFT)+0.5))
#define RV   ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
#define RU   ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5))
#define OFFSET(x)   offsetof(SwsContext, x)
#define DEFAULT   0
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
#define YSCALE_YUV_2_PACKEDX_C(type)
#define YSCALE_YUV_2_RGBX_C(type)
#define YSCALE_YUV_2_PACKED2_C
#define YSCALE_YUV_2_RGB2_C(type)
#define YSCALE_YUV_2_PACKED1_C
#define YSCALE_YUV_2_RGB1_C(type)
#define YSCALE_YUV_2_PACKED1B_C
#define YSCALE_YUV_2_RGB1B_C(type)
#define YSCALE_YUV_2_ANYRGB_C(func, func2)
#define COMPILE_C
#define RENAME(a)   a ## _C
#define MAX_FUNNY_CODE_SIZE   10000

Functions

static SwsVectorsws_getConvVec (SwsVector *a, SwsVector *b)
static const char * sws_context_to_name (void *ptr)
char * sws_format_name (enum PixelFormat format)
static void yuv2yuvXinC (int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW)
static void yuv2nv12XinC (int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)
static void yuv2packedXinC (SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int dstW, int y)
 for (i=0;i< dstW-1;i+=2)
static double getSplineCoeff (double a, double b, double c, double d, double dist)
static int initFilter (int16_t **outFilter, int16_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, SwsVector *srcFilter, SwsVector *dstFilter, double param[2])
static void globalInit (void)
static SwsFunc getSwsFunc (int flags)
static int PlanarToNV12Wrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[])
static int PlanarToYuy2Wrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[])
static int PlanarToUyvyWrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[])
static int rgb2rgbWrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int bgr24toyv12Wrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yvu9toyv12Wrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int simpleCopy (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int gray16togray (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int graytogray16 (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int gray16swap (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static void getSubSampleFactors (int *h, int *v, int format)
static uint16_t roundToInt16 (int64_t f)
int sws_setColorspaceDetails (SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation)
int sws_getColorspaceDetails (SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation)
static int handle_jpeg (int *format)
SwsContextsws_getContext (int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
int sws_scale (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 swscale wrapper, so we don't need to export the SwsContext.
int sws_scale_ordered (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 swscale wrapper, so we don't need to export the SwsContext
SwsFiltersws_getDefaultFilter (float lumaGBlur, float chromaGBlur, float lumaSharpen, float chromaSharpen, float chromaHShift, float chromaVShift, int verbose)
SwsVectorsws_getGaussianVec (double variance, double quality)
 returns a normalized gaussian curve used to filter stuff quality=3 is high quality, lowwer is lowwer quality
SwsVectorsws_getConstVec (double c, int length)
SwsVectorsws_getIdentityVec (void)
double sws_dcVec (SwsVector *a)
void sws_scaleVec (SwsVector *a, double scalar)
void sws_normalizeVec (SwsVector *a, double height)
static SwsVectorsws_sumVec (SwsVector *a, SwsVector *b)
static SwsVectorsws_diffVec (SwsVector *a, SwsVector *b)
static SwsVectorsws_getShiftedVec (SwsVector *a, int shift)
void sws_shiftVec (SwsVector *a, int shift)
void sws_addVec (SwsVector *a, SwsVector *b)
void sws_subVec (SwsVector *a, SwsVector *b)
void sws_convVec (SwsVector *a, SwsVector *b)
SwsVectorsws_cloneVec (SwsVector *a)
void sws_printVec (SwsVector *a)
void sws_freeVec (SwsVector *a)
void sws_freeFilter (SwsFilter *filter)
void sws_freeContext (SwsContext *c)
struct SwsContextsws_getCachedContext (struct SwsContext *context, int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
 Checks if context is valid or reallocs a new one instead.

Variables

const int32_t Inverse_Table_6_9 [8][4]
static unsigned char clip_table [768]
const uint8_t dither_2x2_4 [2][8]
const uint8_t dither_2x2_8 [2][8]
const uint8_t dither_8x8_32 [8][8]
const uint8_t dither_8x8_73 [8][8]
const uint8_t dither_8x8_220 [8][8]
static const AVOption options []
static AVClass sws_context_class = { "SWScaler", sws_context_to_name, options }
 break
case PIX_FMT_BGR24
uint8_tdest [1] = g[Y1]
case PIX_FMT_RGB565
const int dg1 = dither_2x2_4[y&1 ][0]
const int db1 = dither_2x2_8[(y&1)^1][0]
const int dr2 = dither_2x2_8[y&1 ][1]
const int dg2 = dither_2x2_4[y&1 ][1]
const int db2 = dither_2x2_8[(y&1)^1][1]
case PIX_FMT_RGB555
case PIX_FMT_RGB8
const uint8_t *const d32 = dither_8x8_32[y&7]
case PIX_FMT_RGB4
const uint8_t *const d128 = dither_8x8_220[y&7]
case PIX_FMT_RGB4_BYTE
case PIX_FMT_MONOBLACK
uint8_tg = c->table_gU[128] + c->table_gV[128]
int acc = 0
case PIX_FMT_YUYV422
case PIX_FMT_UYVY422


Define Documentation

#define ASSERT (  )     ;

Definition at line 94 of file swscale.c.

Referenced by swScale_TMPL().

#define BU   ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 157 of file swscale.c.

#define BV   ((int)(-0.071*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 156 of file swscale.c.

#define BY   ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 155 of file swscale.c.

#define COMPILE_C

Definition at line 836 of file swscale.c.

#define DEFAULT   0

Definition at line 246 of file swscale.c.

#define DITHER1XBPP

Definition at line 85 of file swscale.c.

Referenced by yuv420_rgb16_TMPL().

#define FAST_BGR2YV12

Definition at line 87 of file swscale.c.

#define GU   ((int)(-0.291*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 160 of file swscale.c.

#define GV   ((int)(-0.368*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 159 of file swscale.c.

#define GY   ((int)( 0.504*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 158 of file swscale.c.

#define isPacked (  ) 

Value:

(       \
           (x)==PIX_FMT_PAL8        \
        || (x)==PIX_FMT_YUYV422     \
        || (x)==PIX_FMT_UYVY422     \
        || isRGB(x)                 \
        || isBGR(x)                 \
    )

Definition at line 146 of file swscale.c.

Referenced by swScale_TMPL().

#define isSupportedIn (  ) 

Value:

(       \
           (x)==PIX_FMT_YUV420P     \
        || (x)==PIX_FMT_YUVA420P    \
        || (x)==PIX_FMT_YUYV422     \
        || (x)==PIX_FMT_UYVY422     \
        || (x)==PIX_FMT_RGB32       \
        || (x)==PIX_FMT_BGR24       \
        || (x)==PIX_FMT_BGR565      \
        || (x)==PIX_FMT_BGR555      \
        || (x)==PIX_FMT_BGR32       \
        || (x)==PIX_FMT_RGB24       \
        || (x)==PIX_FMT_RGB565      \
        || (x)==PIX_FMT_RGB555      \
        || (x)==PIX_FMT_GRAY8       \
        || (x)==PIX_FMT_YUV410P     \
        || (x)==PIX_FMT_GRAY16BE    \
        || (x)==PIX_FMT_GRAY16LE    \
        || (x)==PIX_FMT_YUV444P     \
        || (x)==PIX_FMT_YUV422P     \
        || (x)==PIX_FMT_YUV411P     \
        || (x)==PIX_FMT_PAL8        \
        || (x)==PIX_FMT_BGR8        \
        || (x)==PIX_FMT_RGB8        \
        || (x)==PIX_FMT_BGR4_BYTE   \
        || (x)==PIX_FMT_RGB4_BYTE   \
        || (x)==PIX_FMT_YUV440P     \
    )

Definition at line 103 of file swscale.c.

#define isSupportedOut (  ) 

Value:

(       \
           (x)==PIX_FMT_YUV420P     \
        || (x)==PIX_FMT_YUYV422     \
        || (x)==PIX_FMT_UYVY422     \
        || (x)==PIX_FMT_YUV444P     \
        || (x)==PIX_FMT_YUV422P     \
        || (x)==PIX_FMT_YUV411P     \
        || isRGB(x)                 \
        || isBGR(x)                 \
        || (x)==PIX_FMT_NV12        \
        || (x)==PIX_FMT_NV21        \
        || (x)==PIX_FMT_GRAY16BE    \
        || (x)==PIX_FMT_GRAY16LE    \
        || (x)==PIX_FMT_GRAY8       \
        || (x)==PIX_FMT_YUV410P     \
    )

Definition at line 130 of file swscale.c.

#define MAX_FUNNY_CODE_SIZE   10000

#define OFFSET (  )     offsetof(SwsContext, x)

Definition at line 245 of file swscale.c.

#define PI   3.14159265358979323846

Definition at line 100 of file swscale.c.

#define RENAME (  )     a ## _C

Definition at line 869 of file swscale.c.

#define RET   0xC3

Definition at line 89 of file swscale.c.

#define RGB2YUV_SHIFT   16

Definition at line 154 of file swscale.c.

#define RU   ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 163 of file swscale.c.

#define RV   ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 162 of file swscale.c.

#define RY   ((int)( 0.257*(1<<RGB2YUV_SHIFT)+0.5))

Definition at line 161 of file swscale.c.

#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

Definition at line 247 of file swscale.c.

#define YSCALE_YUV_2_ANYRGB_C ( func,
func2   ) 

Definition at line 546 of file swscale.c.

Referenced by yuv2packed1_TMPL(), and yuv2packed2_TMPL().

#define YSCALE_YUV_2_PACKED1_C

Value:

for (i=0; i<(dstW>>1); i++){\
        const int i2= 2*i;\
        int Y1= buf0[i2  ]>>7;\
        int Y2= buf0[i2+1]>>7;\
        int U= (uvbuf1[i     ])>>7;\
        int V= (uvbuf1[i+2048])>>7;\

Definition at line 516 of file swscale.c.

Referenced by yuv2packed1_TMPL().

#define YSCALE_YUV_2_PACKED1B_C

Value:

for (i=0; i<(dstW>>1); i++){\
        const int i2= 2*i;\
        int Y1= buf0[i2  ]>>7;\
        int Y2= buf0[i2+1]>>7;\
        int U= (uvbuf0[i     ] + uvbuf1[i     ])>>8;\
        int V= (uvbuf0[i+2048] + uvbuf1[i+2048])>>8;\

Definition at line 531 of file swscale.c.

Referenced by yuv2packed1_TMPL().

#define YSCALE_YUV_2_PACKED2_C

Value:

for (i=0; i<(dstW>>1); i++){ \
        const int i2= 2*i;       \
        int Y1= (buf0[i2  ]*yalpha1+buf1[i2  ]*yalpha)>>19;           \
        int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>19;           \
        int U= (uvbuf0[i     ]*uvalpha1+uvbuf1[i     ]*uvalpha)>>19;  \
        int V= (uvbuf0[i+2048]*uvalpha1+uvbuf1[i+2048]*uvalpha)>>19;  \

Definition at line 501 of file swscale.c.

Referenced by yuv2packed2_TMPL().

#define YSCALE_YUV_2_PACKEDX_C ( type   ) 

Definition at line 459 of file swscale.c.

#define YSCALE_YUV_2_RGB1_C ( type   ) 

Value:

YSCALE_YUV_2_PACKED1_C\
    type *r, *b, *g;\
    r = (type *)c->table_rV[V];\
    g = (type *)(c->table_gU[U] + c->table_gV[V]);\
    b = (type *)c->table_bU[U];\

Definition at line 524 of file swscale.c.

Referenced by yuv2packed1_TMPL().

#define YSCALE_YUV_2_RGB1B_C ( type   ) 

Value:

YSCALE_YUV_2_PACKED1B_C\
    type *r, *b, *g;\
    r = (type *)c->table_rV[V];\
    g = (type *)(c->table_gU[U] + c->table_gV[V]);\
    b = (type *)c->table_bU[U];\

Definition at line 539 of file swscale.c.

Referenced by yuv2packed1_TMPL().

#define YSCALE_YUV_2_RGB2_C ( type   ) 

Value:

YSCALE_YUV_2_PACKED2_C\
    type *r, *b, *g;\
    r = (type *)c->table_rV[V];\
    g = (type *)(c->table_gU[U] + c->table_gV[V]);\
    b = (type *)c->table_bU[U];\

Definition at line 509 of file swscale.c.

Referenced by yuv2packed2_TMPL().

#define YSCALE_YUV_2_RGBX_C ( type   ) 

Value:

YSCALE_YUV_2_PACKEDX_C(type)  \
    r = (type *)c->table_rV[V];   \
    g = (type *)(c->table_gU[U] + c->table_gV[V]); \
    b = (type *)c->table_bU[U];   \

Definition at line 495 of file swscale.c.


Function Documentation

static int bgr24toyv12Wrapper ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
) [static]

Definition at line 1660 of file swscale.c.

for (  ) 

static double getSplineCoeff ( double  a,
double  b,
double  c,
double  d,
double  dist 
) [static]

Definition at line 928 of file swscale.c.

Referenced by initFilter().

static void getSubSampleFactors ( int *  h,
int *  v,
int  format 
) [static]

Definition at line 1832 of file swscale.c.

static SwsFunc getSwsFunc ( int  flags  )  [static]

RUNTIME_CPUDETECT

Definition at line 1499 of file swscale.c.

static void globalInit ( void   )  [static]

Definition at line 1490 of file swscale.c.

static int gray16swap ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
) [static]

Definition at line 1813 of file swscale.c.

static int gray16togray ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
) [static]

Definition at line 1766 of file swscale.c.

static int graytogray16 ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
) [static]

Definition at line 1791 of file swscale.c.

static int handle_jpeg ( int *  format  )  [static]

Definition at line 1961 of file swscale.c.

static int initFilter ( int16_t **  outFilter,
int16_t **  filterPos,
int *  outFilterSize,
int  xInc,
int  srcW,
int  dstW,
int  filterAlign,
int  one,
int  flags,
SwsVector srcFilter,
SwsVector dstFilter,
double  param[2] 
) [inline, static]

Definition at line 939 of file swscale.c.

static int PlanarToNV12Wrapper ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dstParam[],
int  dstStride[] 
) [static]

Definition at line 1537 of file swscale.c.

static int PlanarToUyvyWrapper ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dstParam[],
int  dstStride[] 
) [static]

Definition at line 1573 of file swscale.c.

static int PlanarToYuy2Wrapper ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dstParam[],
int  dstStride[] 
) [static]

Definition at line 1564 of file swscale.c.

static int rgb2rgbWrapper ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
) [static]

Definition at line 1583 of file swscale.c.

static uint16_t roundToInt16 ( int64_t  f  )  [static]

Definition at line 1876 of file swscale.c.

static int simpleCopy ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
) [static]

Definition at line 1703 of file swscale.c.

void sws_addVec ( SwsVector a,
SwsVector b 
)

Definition at line 2749 of file swscale.c.

SwsVector* sws_cloneVec ( SwsVector a  ) 

Definition at line 2773 of file swscale.c.

static const char* sws_context_to_name ( void *  ptr  )  [static]

Definition at line 241 of file swscale.c.

void sws_convVec ( SwsVector a,
SwsVector b 
)

Definition at line 2765 of file swscale.c.

double sws_dcVec ( SwsVector a  ) 

Definition at line 2644 of file swscale.c.

Referenced by sws_diffVec().

static SwsVector* sws_diffVec ( SwsVector a,
SwsVector b 
) [static]

Definition at line 2704 of file swscale.c.

char* sws_format_name ( enum PixelFormat  format  ) 

Definition at line 279 of file swscale.c.

Referenced by altivec_yuv2packedX(), doTest(), ff_bfin_yuv2rgb_get_func_ptr(), and selfTest().

void sws_freeContext ( SwsContext c  ) 

Definition at line 2828 of file swscale.c.

Referenced by av_encode(), doTest(), and Release().

void sws_freeFilter ( SwsFilter filter  ) 

Definition at line 2817 of file swscale.c.

void sws_freeVec ( SwsVector a  ) 

Definition at line 2809 of file swscale.c.

struct SwsContext* sws_getCachedContext ( struct SwsContext context,
int  srcW,
int  srcH,
int  srcFormat,
int  dstW,
int  dstH,
int  dstFormat,
int  flags,
SwsFilter srcFilter,
SwsFilter dstFilter,
double *  param 
) [read]

Checks if context is valid or reallocs a new one instead.

If context is NULL, just calls sws_getContext() to get a new one. Otherwise, checks if the parameters are the same already saved in context. If that is the case, returns the current context. Otherwise, frees context and gets a new one.

Be warned that srcFilter, dstFilter are not checked, they are asumed to remain valid.

Definition at line 2914 of file swscale.c.

Referenced by get_watermark_picture(), Process(), Process0(), Process1(), and queue_picture().

int sws_getColorspaceDetails ( SwsContext c,
int **  inv_table,
int *  srcRange,
int **  table,
int *  dstRange,
int *  brightness,
int *  contrast,
int *  saturation 
)

Returns:
-1 if not supported

Definition at line 1947 of file swscale.c.

SwsVector* sws_getConstVec ( double  c,
int  length 
)

Definition at line 2625 of file swscale.c.

SwsContext* sws_getContext ( int  srcW,
int  srcH,
int  srcFormat,
int  dstW,
int  dstH,
int  dstFormat,
int  flags,
SwsFilter srcFilter,
SwsFilter dstFilter,
double *  param 
) [read]

Definition at line 1981 of file swscale.c.

Referenced by av_encode(), doTest(), main(), and write_video_frame().

static SwsVector * sws_getConvVec ( SwsVector a,
SwsVector b 
) [static]

Definition at line 2665 of file swscale.c.

SwsFilter* sws_getDefaultFilter ( float  lumaGBlur,
float  chromaGBlur,
float  lumaSharpen,
float  chromaSharpen,
float  chromaHShift,
float  chromaVShift,
int  verbose 
)

Definition at line 2542 of file swscale.c.

SwsVector* sws_getGaussianVec ( double  variance,
double  quality 
)

returns a normalized gaussian curve used to filter stuff quality=3 is high quality, lowwer is lowwer quality

Definition at line 2604 of file swscale.c.

SwsVector* sws_getIdentityVec ( void   ) 

Definition at line 2640 of file swscale.c.

static SwsVector* sws_getShiftedVec ( SwsVector a,
int  shift 
) [static]

Definition at line 2722 of file swscale.c.

void sws_normalizeVec ( SwsVector a,
double  height 
)

Definition at line 2661 of file swscale.c.

void sws_printVec ( SwsVector a  ) 

Definition at line 2786 of file swscale.c.

int sws_scale ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)

swscale wrapper, so we don't need to export the SwsContext.

assumes planar YUV to be in YUV order instead of YVU

Definition at line 2484 of file swscale.c.

Referenced by do_video_out(), doTest(), get_watermark_picture(), main(), Process(), Process0(), Process1(), queue_picture(), and write_video_frame().

int sws_scale_ordered ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)

swscale wrapper, so we don't need to export the SwsContext

Definition at line 2537 of file swscale.c.

void sws_scaleVec ( SwsVector a,
double  scalar 
)

Definition at line 2654 of file swscale.c.

Referenced by sws_diffVec().

int sws_setColorspaceDetails ( SwsContext c,
const int  inv_table[4],
int  srcRange,
const int  table[4],
int  dstRange,
int  brightness,
int  contrast,
int  saturation 
)

Parameters:
inv_table the yuv2rgb coeffs, normally Inverse_Table_6_9[x]
fullRange if 1 then the luma range is 0..255 if 0 it is 16..235
Returns:
-1 if not supported

Definition at line 1888 of file swscale.c.

void sws_shiftVec ( SwsVector a,
int  shift 
)

Definition at line 2741 of file swscale.c.

void sws_subVec ( SwsVector a,
SwsVector b 
)

Definition at line 2757 of file swscale.c.

static SwsVector* sws_sumVec ( SwsVector a,
SwsVector b 
) [static]

Definition at line 2687 of file swscale.c.

static void yuv2nv12XinC ( int16_t *  lumFilter,
int16_t **  lumSrc,
int  lumFilterSize,
int16_t *  chrFilter,
int16_t **  chrSrc,
int  chrFilterSize,
uint8_t dest,
uint8_t uDest,
int  dstW,
int  chrDstW,
int  dstFormat 
) [inline, static]

Definition at line 408 of file swscale.c.

Referenced by swScale_TMPL(), and yuv2nv12X_TMPL().

static void yuv2packedXinC ( SwsContext c,
int16_t *  lumFilter,
int16_t **  lumSrc,
int  lumFilterSize,
int16_t *  chrFilter,
int16_t **  chrSrc,
int  chrFilterSize,
uint8_t dest,
int  dstW,
int  y 
) [inline, static]

Definition at line 681 of file swscale.c.

Referenced by swScale_TMPL(), and yuv2packedX_TMPL().

static void yuv2yuvXinC ( int16_t *  lumFilter,
int16_t **  lumSrc,
int  lumFilterSize,
int16_t *  chrFilter,
int16_t **  chrSrc,
int  chrFilterSize,
uint8_t dest,
uint8_t uDest,
uint8_t vDest,
int  dstW,
int  chrDstW 
) [inline, static]

Definition at line 375 of file swscale.c.

Referenced by swScale_TMPL(), and yuv2yuvX_TMPL().

static int yvu9toyv12Wrapper ( SwsContext c,
uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
) [static]

Definition at line 1673 of file swscale.c.


Variable Documentation

int acc = 0

Definition at line 784 of file swscale.c.

Referenced by escape_FF(), fill_coding_method_array(), get_intra_count(), get_sae(), and sse().

Definition at line 705 of file swscale.c.

unsigned char clip_table[768] [static]

Definition at line 231 of file swscale.c.

Referenced by yuv2packed2_TMPL().

const uint8_t * d128 = dither_8x8_220[y&7]

Definition at line 762 of file swscale.c.

const uint8_t* const d32 = dither_8x8_32[y&7]

Definition at line 751 of file swscale.c.

const int db1 = dither_2x2_8[(y&1)^1][0]

Definition at line 722 of file swscale.c.

const int db2 = dither_2x2_8[(y&1)^1][1]

Definition at line 725 of file swscale.c.

uint8_t * dest = g[Y1]

const int dg1 = dither_2x2_4[y&1 ][0]

Definition at line 721 of file swscale.c.

const int dg2 = dither_2x2_4[y&1 ][1]

Definition at line 724 of file swscale.c.

const uint8_t dither_2x2_4[2][8]

Definition at line 52 of file yuv2rgb.c.

const uint8_t dither_2x2_8[2][8]

Definition at line 57 of file yuv2rgb.c.

const uint8_t dither_8x8_220[8][8]

Definition at line 111 of file yuv2rgb.c.

const uint8_t dither_8x8_32[8][8]

Definition at line 62 of file yuv2rgb.c.

const uint8_t dither_8x8_73[8][8]

Definition at line 86 of file yuv2rgb.c.

const int dr2 = dither_2x2_8[y&1 ][1]

Definition at line 723 of file swscale.c.

uint8_t* g = c->table_gU[128] + c->table_gV[128]

const int32_t Inverse_Table_6_9[8][4]

Definition at line 201 of file yuv2rgb.c.

const AVOption options[] [static]

Initial value:

 {
    { "sws_flags", "scaler/cpu flags", OFFSET(flags), FF_OPT_TYPE_FLAGS, DEFAULT, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "fast_bilinear", "fast bilinear", 0, FF_OPT_TYPE_CONST, SWS_FAST_BILINEAR, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "bilinear", "bilinear", 0, FF_OPT_TYPE_CONST, SWS_BILINEAR, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "bicubic", "bicubic", 0, FF_OPT_TYPE_CONST, SWS_BICUBIC, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "experimental", "experimental", 0, FF_OPT_TYPE_CONST, SWS_X, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "neighbor", "nearest neighbor", 0, FF_OPT_TYPE_CONST, SWS_POINT, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "area", "averaging area", 0, FF_OPT_TYPE_CONST, SWS_AREA, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "bicublin", "luma bicubic, chroma bilinear", 0, FF_OPT_TYPE_CONST, SWS_BICUBLIN, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "gauss", "gaussian", 0, FF_OPT_TYPE_CONST, SWS_GAUSS, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "sinc", "sinc", 0, FF_OPT_TYPE_CONST, SWS_SINC, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "lanczos", "lanczos", 0, FF_OPT_TYPE_CONST, SWS_LANCZOS, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "spline", "natural bicubic spline", 0, FF_OPT_TYPE_CONST, SWS_SPLINE, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "print_info", "print info", 0, FF_OPT_TYPE_CONST, SWS_PRINT_INFO, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "accurate_rnd", "accurate rounding", 0, FF_OPT_TYPE_CONST, SWS_ACCURATE_RND, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "mmx", "MMX SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_MMX, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "mmx2", "MMX2 SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_MMX2, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "3dnow", "3DNOW SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_3DNOW, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "altivec", "AltiVec SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_ALTIVEC, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "bfin", "Blackfin SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_BFIN, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "full_chroma_int", "full chroma interpolation", 0 , FF_OPT_TYPE_CONST, SWS_FULL_CHR_H_INT, INT_MIN, INT_MAX, VE, "sws_flags" },
    { "full_chroma_inp", "full chroma input", 0 , FF_OPT_TYPE_CONST, SWS_FULL_CHR_H_INP, INT_MIN, INT_MAX, VE, "sws_flags" },
    { NULL }
}

Definition at line 249 of file swscale.c.

Definition at line 708 of file swscale.c.

Definition at line 782 of file swscale.c.

Definition at line 761 of file swscale.c.

Definition at line 772 of file swscale.c.

Definition at line 735 of file swscale.c.

Definition at line 720 of file swscale.c.

Definition at line 750 of file swscale.c.

Definition at line 823 of file swscale.c.

Definition at line 815 of file swscale.c.

AVClass sws_context_class = { "SWScaler", sws_context_to_name, options } [static]

Definition at line 277 of file swscale.c.


Generated on Fri Apr 23 15:12:04 2010 for ffmpeg by  doxygen 1.5.6