#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 "rgb2rgb.h"#include "libavutil/x86_cpu.h"#include "libavutil/bswap.h"#include "swscale_template.c"Go to the source code of this file.
Defines | |
| #define | _SVID_SOURCE |
| #define | DITHER1XBPP |
| #define | FAST_BGR2YV12 |
| #define | RET 0xC3 |
| #define | PI 3.14159265358979323846 |
| #define | isSupportedIn(x) |
| #define | isSupportedOut(x) |
| #define | isPacked(x) |
| #define | usePal(x) |
| #define | RGB2YUV_SHIFT 15 |
| #define | BY ( (int)(0.114*219/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | BV (-(int)(0.081*224/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | BU ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | GY ( (int)(0.587*219/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | GV (-(int)(0.419*224/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | GU (-(int)(0.331*224/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | RY ( (int)(0.299*219/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | RV ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | RU (-(int)(0.169*224/255*(1<<RGB2YUV_SHIFT)+0.5)) |
| #define | YSCALE_YUV_2_PACKEDX_NOCLIP_C(type) |
| #define | YSCALE_YUV_2_PACKEDX_C(type) |
| #define | YSCALE_YUV_2_PACKEDX_FULL_C |
| #define | YSCALE_YUV_2_RGBX_FULL_C(rnd) |
| #define | YSCALE_YUV_2_GRAY16_C |
| #define | YSCALE_YUV_2_RGBX_C(type) |
| #define | YSCALE_YUV_2_PACKED2_C |
| #define | YSCALE_YUV_2_GRAY16_2_C |
| #define | YSCALE_YUV_2_RGB2_C(type) |
| #define | YSCALE_YUV_2_PACKED1_C |
| #define | YSCALE_YUV_2_GRAY16_1_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_MONO2_C |
| #define | YSCALE_YUV_2_MONOX_C |
| #define | YSCALE_YUV_2_ANYRGB_C(func, func2, func_g16, func_monoblack) |
| #define | COMPILE_C |
| #define | HAVE_MMX 0 |
| #define | HAVE_MMX2 0 |
| #define | HAVE_AMD3DNOW 0 |
| #define | HAVE_ALTIVEC 0 |
| #define | RENAME(a) a ## _C |
| #define | MAX_FUNNY_CODE_SIZE 10000 |
Functions | |
| unsigned | swscale_version (void) |
| Returns the LIBSWSCALE_VERSION_INT constant. | |
| static SwsVector * | sws_getConvVec (SwsVector *a, SwsVector *b) |
| const 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) |
| static void | yuv2rgbXinC_full (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) |
| 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 | YUV422PToYuy2Wrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
| static int | YUV422PToUyvyWrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
| static int | pal2rgbWrapper (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], 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 | packedCopy (SwsContext *c, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
| static int | planarCopy (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 (enum PixelFormat *format) |
| SwsContext * | sws_getContext (int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param) |
| Allocates and returns a SwsContext. | |
| 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[]) |
| SwsFilter * | sws_getDefaultFilter (float lumaGBlur, float chromaGBlur, float lumaSharpen, float chromaSharpen, float chromaHShift, float chromaVShift, int verbose) |
| SwsVector * | sws_getGaussianVec (double variance, double quality) |
| Returns a normalized Gaussian curve used to filter stuff quality=3 is high quality, lower is lower quality. | |
| SwsVector * | sws_getConstVec (double c, int length) |
Allocates and returns a vector with length coefficients, all with the same value c. | |
| SwsVector * | sws_getIdentityVec (void) |
| Allocates and returns a vector with just one coefficient, with value 1.0. | |
| double | sws_dcVec (SwsVector *a) |
| void | sws_scaleVec (SwsVector *a, double scalar) |
Scales all the coefficients of a by the scalar value. | |
| void | sws_normalizeVec (SwsVector *a, double height) |
Scales all the coefficients of a so that their sum equals height. | |
| static SwsVector * | sws_sumVec (SwsVector *a, SwsVector *b) |
| static SwsVector * | sws_diffVec (SwsVector *a, SwsVector *b) |
| static SwsVector * | sws_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) |
| SwsVector * | sws_cloneVec (SwsVector *a) |
Allocates and returns a clone of the vector a, that is a vector with the same coefficients as a. | |
| void | sws_printVec2 (SwsVector *a, AVClass *log_ctx, int log_level) |
Prints with av_log() a textual representation of the vector a if log_level <= av_log_level. | |
| void | sws_printVec (SwsVector *a) |
| void | sws_freeVec (SwsVector *a) |
| void | sws_freeFilter (SwsFilter *filter) |
| void | sws_freeContext (SwsContext *c) |
| struct SwsContext * | sws_getCachedContext (struct SwsContext *context, int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param) |
Checks if context can be reused, otherwise reallocates a new one. | |
Variables | |
| const int32_t | ff_yuv2rgb_coeffs [8][4] |
| static const double | rgb2yuv_table [8][9] |
| static unsigned char | clip_table [768] |
| static const uint8_t | dither_2x2_4 [2][8] |
| static 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] |
| break | |
| default | __pad0__ |
| #define isPacked | ( | x | ) |
( \
(x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \
|| isRGB(x) \
|| isBGR(x) \
)
Definition at line 151 of file swscale.c.
Referenced by sws_getContext().
| #define isSupportedIn | ( | x | ) |
Definition at line 102 of file swscale.c.
Referenced by sws_getContext().
| #define isSupportedOut | ( | x | ) |
( \
(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 \
|| (x)==PIX_FMT_YUV440P \
)
Definition at line 134 of file swscale.c.
Referenced by sws_getContext().
| #define MAX_FUNNY_CODE_SIZE 10000 |
Referenced by sws_freeContext(), and sws_getContext().
| #define PI 3.14159265358979323846 |
Definition at line 99 of file swscale.c.
Referenced by initFilter(), and sws_getGaussianVec().
| #define usePal | ( | x | ) |
( \
(x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_BGR4_BYTE \
|| (x)==PIX_FMT_RGB4_BYTE \
|| (x)==PIX_FMT_BGR8 \
|| (x)==PIX_FMT_RGB8 \
)
Definition at line 158 of file swscale.c.
Referenced by pal2rgbWrapper(), sws_getContext(), and sws_scale().
| #define YSCALE_YUV_2_ANYRGB_C | ( | func, | |||
| func2, | |||||
| func_g16, | |||||
| func_monoblack | ) |
Definition at line 768 of file swscale.c.
Referenced by yuv2packedXinC().
| #define YSCALE_YUV_2_GRAY16_1_C |
| #define YSCALE_YUV_2_GRAY16_2_C |
| #define YSCALE_YUV_2_GRAY16_C |
for (i=0; i<(dstW>>1); i++){\ int j;\ int Y1 = 1<<18;\ int Y2 = 1<<18;\ int U = 1<<18;\ int V = 1<<18;\ \ const int i2= 2*i;\ \ for (j=0; j<lumFilterSize; j++)\ {\ Y1 += lumSrc[j][i2] * lumFilter[j];\ Y2 += lumSrc[j][i2+1] * lumFilter[j];\ }\ Y1>>=11;\ Y2>>=11;\ if ((Y1|Y2|U|V)&65536)\ {\ if (Y1>65535) Y1=65535; \ else if (Y1<0)Y1=0; \ if (Y2>65535) Y2=65535; \ else if (Y2<0)Y2=0; \ }
Definition at line 630 of file swscale.c.
Referenced by yuv2packedXinC().
| #define YSCALE_YUV_2_MONO2_C |
const uint8_t * const d128=dither_8x8_220[y&7];\ uint8_t *g= c->table_gU[128] + c->table_gV[128];\ for (i=0; i<dstW-7; i+=8){\ int acc;\ acc = g[((buf0[i ]*yalpha1+buf1[i ]*yalpha)>>19) + d128[0]];\ acc+= acc + g[((buf0[i+1]*yalpha1+buf1[i+1]*yalpha)>>19) + d128[1]];\ acc+= acc + g[((buf0[i+2]*yalpha1+buf1[i+2]*yalpha)>>19) + d128[2]];\ acc+= acc + g[((buf0[i+3]*yalpha1+buf1[i+3]*yalpha)>>19) + d128[3]];\ acc+= acc + g[((buf0[i+4]*yalpha1+buf1[i+4]*yalpha)>>19) + d128[4]];\ acc+= acc + g[((buf0[i+5]*yalpha1+buf1[i+5]*yalpha)>>19) + d128[5]];\ acc+= acc + g[((buf0[i+6]*yalpha1+buf1[i+6]*yalpha)>>19) + d128[6]];\ acc+= acc + g[((buf0[i+7]*yalpha1+buf1[i+7]*yalpha)>>19) + d128[7]];\ ((uint8_t*)dest)[0]= c->dstFormat == PIX_FMT_MONOBLACK ? acc : ~acc;\ dest++;\ }\
| #define YSCALE_YUV_2_MONOX_C |
const uint8_t * const d128=dither_8x8_220[y&7];\ uint8_t *g= c->table_gU[128] + c->table_gV[128];\ int acc=0;\ for (i=0; i<dstW-1; i+=2){\ int j;\ int Y1=1<<18;\ int Y2=1<<18;\ \ for (j=0; j<lumFilterSize; j++)\ {\ Y1 += lumSrc[j][i] * lumFilter[j];\ Y2 += lumSrc[j][i+1] * lumFilter[j];\ }\ Y1>>=19;\ Y2>>=19;\ if ((Y1|Y2)&256)\ {\ if (Y1>255) Y1=255;\ else if (Y1<0)Y1=0;\ if (Y2>255) Y2=255;\ else if (Y2<0)Y2=0;\ }\ acc+= acc + g[Y1+d128[(i+0)&7]];\ acc+= acc + g[Y2+d128[(i+1)&7]];\ if ((i&7)==6){\ ((uint8_t*)dest)[0]= c->dstFormat == PIX_FMT_MONOBLACK ? acc : ~acc;\ dest++;\ }\ }
Definition at line 736 of file swscale.c.
Referenced by yuv2packedXinC().
| #define YSCALE_YUV_2_PACKED1_C |
| #define YSCALE_YUV_2_PACKED1B_C |
| #define YSCALE_YUV_2_PACKED2_C |
| #define YSCALE_YUV_2_PACKEDX_C | ( | type | ) |
YSCALE_YUV_2_PACKEDX_NOCLIP_C(type)\ if ((Y1|Y2|U|V)&256)\ {\ if (Y1>255) Y1=255; \ else if (Y1<0)Y1=0; \ if (Y2>255) Y2=255; \ else if (Y2<0)Y2=0; \ if (U>255) U=255; \ else if (U<0) U=0; \ if (V>255) V=255; \ else if (V<0) V=0; \ }
Definition at line 579 of file swscale.c.
Referenced by yuv2packedXinC().
| #define YSCALE_YUV_2_PACKEDX_FULL_C |
for (i=0; i<dstW; i++){\ int j;\ int Y = 0;\ int U = -128<<19;\ int V = -128<<19;\ int R,G,B;\ \ for (j=0; j<lumFilterSize; j++){\ Y += lumSrc[j][i ] * lumFilter[j];\ }\ for (j=0; j<chrFilterSize; j++){\ U += chrSrc[j][i ] * chrFilter[j];\ V += chrSrc[j][i+VOFW] * chrFilter[j];\ }\ Y >>=10;\ U >>=10;\ V >>=10;\
| #define YSCALE_YUV_2_PACKEDX_NOCLIP_C | ( | type | ) |
for (i=0; i<(dstW>>1); i++){\ int j;\ int Y1 = 1<<18;\ int Y2 = 1<<18;\ int U = 1<<18;\ int V = 1<<18;\ type av_unused *r, *b, *g;\ const int i2= 2*i;\ \ for (j=0; j<lumFilterSize; j++)\ {\ Y1 += lumSrc[j][i2] * lumFilter[j];\ Y2 += lumSrc[j][i2+1] * lumFilter[j];\ }\ for (j=0; j<chrFilterSize; j++)\ {\ U += chrSrc[j][i] * chrFilter[j];\ V += chrSrc[j][i+VOFW] * chrFilter[j];\ }\ Y1>>=19;\ Y2>>=19;\ U >>=19;\ V >>=19;\
| #define YSCALE_YUV_2_RGB1_C | ( | type | ) |
| #define YSCALE_YUV_2_RGB1B_C | ( | type | ) |
| #define YSCALE_YUV_2_RGB2_C | ( | type | ) |
| #define YSCALE_YUV_2_RGBX_C | ( | type | ) |
YSCALE_YUV_2_PACKEDX_C(type) /* FIXME fix tables so that clipping is not needed and then use _NOCLIP*/\ 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 655 of file swscale.c.
Referenced by yuv2packedXinC().
| #define YSCALE_YUV_2_RGBX_FULL_C | ( | rnd | ) |
YSCALE_YUV_2_PACKEDX_FULL_C\ Y-= c->yuv2rgb_y_offset;\ Y*= c->yuv2rgb_y_coeff;\ Y+= rnd;\ R= Y + V*c->yuv2rgb_v2r_coeff;\ G= Y + V*c->yuv2rgb_v2g_coeff + U*c->yuv2rgb_u2g_coeff;\ B= Y + U*c->yuv2rgb_u2b_coeff;\ if ((R|G|B)&(0xC0000000)){\ if (R>=(256<<22)) R=(256<<22)-1; \ else if (R<0)R=0; \ if (G>=(256<<22)) G=(256<<22)-1; \ else if (G<0)G=0; \ if (B>=(256<<22)) B=(256<<22)-1; \ else if (B<0)B=0; \ }\
Definition at line 612 of file swscale.c.
Referenced by yuv2rgbXinC_full().
| static int bgr24toyv12Wrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1854 of file swscale.c.
Referenced by sws_getContext().
| static double getSplineCoeff | ( | double | a, | |
| double | b, | |||
| double | c, | |||
| double | d, | |||
| double | dist | |||
| ) | [static] |
Definition at line 1060 of file swscale.c.
Referenced by initFilter().
| static void getSubSampleFactors | ( | int * | h, | |
| int * | v, | |||
| int | format | |||
| ) | [static] |
Definition at line 2026 of file swscale.c.
Referenced by sws_getContext().
| static SwsFunc getSwsFunc | ( | int | flags | ) | [static] |
| static void globalInit | ( | void | ) | [static] |
Definition at line 1628 of file swscale.c.
Referenced by sws_getContext().
| static int gray16swap | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 2007 of file swscale.c.
Referenced by sws_getContext().
| static int gray16togray | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1960 of file swscale.c.
Referenced by sws_getContext().
| static int graytogray16 | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1985 of file swscale.c.
Referenced by sws_getContext().
| static int handle_jpeg | ( | enum PixelFormat * | format | ) | [static] |
Definition at line 2162 of file swscale.c.
Referenced by sws_getContext().
| 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 1071 of file swscale.c.
Referenced by sws_getContext().
| static int packedCopy | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1897 of file swscale.c.
Referenced by sws_getContext().
| static int pal2rgbWrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1738 of file swscale.c.
Referenced by sws_getContext().
| static int planarCopy | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1924 of file swscale.c.
Referenced by sws_getContext().
| static int PlanarToNV12Wrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dstParam[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1675 of file swscale.c.
Referenced by sws_getContext().
| static int PlanarToUyvyWrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dstParam[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1711 of file swscale.c.
Referenced by sws_getContext().
| static int PlanarToYuy2Wrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dstParam[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1702 of file swscale.c.
Referenced by sws_getContext().
| static int rgb2rgbWrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1774 of file swscale.c.
Referenced by sws_getContext().
| static uint16_t roundToInt16 | ( | int64_t | f | ) | [static] |
Definition at line 2070 of file swscale.c.
Referenced by sws_setColorspaceDetails().
Definition at line 3032 of file swscale.c.
Referenced by sws_getDefaultFilter().
| double sws_dcVec | ( | SwsVector * | a | ) |
Definition at line 2927 of file swscale.c.
Referenced by sws_normalizeVec().
Definition at line 2987 of file swscale.c.
Referenced by sws_subVec().
| const char* sws_format_name | ( | enum PixelFormat | format | ) |
Definition at line 374 of file swscale.c.
Referenced by altivec_yuv2packedX(), doTest(), ff_bfin_yuv2rgb_get_func_ptr(), pal2rgbWrapper(), rgb2rgbWrapper(), selfTest(), and sws_getContext().
| void sws_freeContext | ( | SwsContext * | c | ) |
| void sws_freeVec | ( | SwsVector * | a | ) |
Definition at line 3098 of file swscale.c.
Referenced by sws_freeFilter(), and sws_getDefaultFilter().
| struct SwsContext* sws_getCachedContext | ( | struct SwsContext * | context, | |
| int | srcW, | |||
| int | srcH, | |||
| enum PixelFormat | srcFormat, | |||
| int | dstW, | |||
| int | dstH, | |||
| enum PixelFormat | dstFormat, | |||
| int | flags, | |||
| SwsFilter * | srcFilter, | |||
| SwsFilter * | dstFilter, | |||
| double * | param | |||
| ) | [read] |
Checks if context can be reused, otherwise reallocates a new one.
If context is NULL, just calls sws_getContext() to get a new context. Otherwise, checks if the parameters are the ones already saved in context. If that is the case, returns the current context. Otherwise, frees context and gets a new context with the new parameters.
Be warned that srcFilter and dstFilter are not checked, they are assumed to remain the same.
| int sws_getColorspaceDetails | ( | SwsContext * | c, | |
| int ** | inv_table, | |||
| int * | srcRange, | |||
| int ** | table, | |||
| int * | dstRange, | |||
| int * | brightness, | |||
| int * | contrast, | |||
| int * | saturation | |||
| ) |
| SwsVector* sws_getConstVec | ( | double | c, | |
| int | length | |||
| ) |
Allocates and returns a vector with length coefficients, all with the same value c.
Definition at line 2908 of file swscale.c.
Referenced by sws_getIdentityVec().
| SwsContext* sws_getContext | ( | int | srcW, | |
| int | srcH, | |||
| enum PixelFormat | srcFormat, | |||
| int | dstW, | |||
| int | dstH, | |||
| enum PixelFormat | dstFormat, | |||
| int | flags, | |||
| SwsFilter * | srcFilter, | |||
| SwsFilter * | dstFilter, | |||
| double * | param | |||
| ) | [read] |
Allocates and returns a SwsContext.
You need it to perform scaling/conversion operations using sws_scale().
| srcW | the width of the source image | |
| srcH | the height of the source image | |
| srcFormat | the source image format | |
| dstW | the width of the destination image | |
| dstH | the height of the destination image | |
| dstFormat | the destination image format | |
| flags | specify which algorithm and options to use for rescaling |
Definition at line 2948 of file swscale.c.
Referenced by sws_convVec().
| SwsFilter* sws_getDefaultFilter | ( | float | lumaGBlur, | |
| float | chromaGBlur, | |||
| float | lumaSharpen, | |||
| float | chromaSharpen, | |||
| float | chromaHShift, | |||
| float | chromaVShift, | |||
| int | verbose | |||
| ) |
| SwsVector* sws_getGaussianVec | ( | double | variance, | |
| double | quality | |||
| ) |
Returns a normalized Gaussian curve used to filter stuff quality=3 is high quality, lower is lower quality.
Definition at line 2887 of file swscale.c.
Referenced by sws_getDefaultFilter().
| SwsVector* sws_getIdentityVec | ( | void | ) |
Allocates and returns a vector with just one coefficient, with value 1.0.
Definition at line 2923 of file swscale.c.
Referenced by sws_getDefaultFilter().
Definition at line 3005 of file swscale.c.
Referenced by sws_shiftVec().
| void sws_normalizeVec | ( | SwsVector * | a, | |
| double | height | |||
| ) |
Scales all the coefficients of a so that their sum equals height.
"
Definition at line 2944 of file swscale.c.
Referenced by sws_getDefaultFilter(), and sws_getGaussianVec().
| void sws_printVec | ( | SwsVector * | a | ) |
Prints with av_log() a textual representation of the vector a if log_level <= av_log_level.
Definition at line 3069 of file swscale.c.
Referenced by sws_getDefaultFilter(), and sws_printVec().
| 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.
Scales the image slice in srcSlice and puts the resulting scaled slice in the image in dst.
Assumes planar YUV to be in YUV order instead of YVU.
| int sws_scale_ordered | ( | struct SwsContext * | context, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) |
| void sws_scaleVec | ( | SwsVector * | a, | |
| double | scalar | |||
| ) |
Scales all the coefficients of a by the scalar value.
Definition at line 2937 of file swscale.c.
Referenced by sws_getDefaultFilter(), and sws_normalizeVec().
| int sws_setColorspaceDetails | ( | SwsContext * | c, | |
| const int | inv_table[4], | |||
| int | srcRange, | |||
| const int | table[4], | |||
| int | dstRange, | |||
| int | brightness, | |||
| int | contrast, | |||
| int | saturation | |||
| ) |
| inv_table | the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] | |
| fullRange | if 1 then the luma range is 0..255 if 0 it is 16..235 |
Definition at line 2082 of file swscale.c.
Referenced by sws_getContext().
| void sws_shiftVec | ( | SwsVector * | a, | |
| int | shift | |||
| ) |
Definition at line 3024 of file swscale.c.
Referenced by sws_getDefaultFilter().
Definition at line 2970 of file swscale.c.
Referenced by sws_addVec().
| unsigned swscale_version | ( | void | ) |
| 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 503 of file swscale.c.
Referenced by yuv2nv12X_SSE2().
| 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 906 of file swscale.c.
Referenced by yuv2packedX_SSE2().
| static void yuv2rgbXinC_full | ( | 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] |
| 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 470 of file swscale.c.
Referenced by yuv2yuvX_SSE2().
| static int YUV422PToUyvyWrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dstParam[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1729 of file swscale.c.
Referenced by sws_getContext().
| static int YUV422PToYuy2Wrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dstParam[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1720 of file swscale.c.
Referenced by sws_getContext().
| static int yvu9toyv12Wrapper | ( | SwsContext * | c, | |
| uint8_t * | src[], | |||
| int | srcStride[], | |||
| int | srcSliceY, | |||
| int | srcSliceH, | |||
| uint8_t * | dst[], | |||
| int | dstStride[] | |||
| ) | [static] |
Definition at line 1867 of file swscale.c.
Referenced by sws_getContext().
unsigned char clip_table[768] [static] |
Definition at line 263 of file swscale.c.
Referenced by globalInit(), and sws_getContext().
const uint8_t dither_2x2_4[2][8] [static] |
const uint8_t dither_2x2_8[2][8] [static] |
| const uint8_t dither_8x8_220[8][8] |
{
{117, 62, 158, 103, 113, 58, 155, 100, },
{ 34, 199, 21, 186, 31, 196, 17, 182, },
{144, 89, 131, 76, 141, 86, 127, 72, },
{ 0, 165, 41, 206, 10, 175, 52, 217, },
{110, 55, 151, 96, 120, 65, 162, 107, },
{ 28, 193, 14, 179, 38, 203, 24, 189, },
{138, 83, 124, 69, 148, 93, 134, 79, },
{ 7, 172, 48, 213, 3, 168, 45, 210, },
}
| const uint8_t dither_8x8_32[8][8] |
{
{ 17, 9, 23, 15, 16, 8, 22, 14, },
{ 5, 29, 3, 27, 4, 28, 2, 26, },
{ 21, 13, 19, 11, 20, 12, 18, 10, },
{ 0, 24, 6, 30, 1, 25, 7, 31, },
{ 16, 8, 22, 14, 17, 9, 23, 15, },
{ 4, 28, 2, 26, 5, 29, 3, 27, },
{ 20, 12, 18, 10, 21, 13, 19, 11, },
{ 1, 25, 7, 31, 0, 24, 6, 30, },
}
| const uint8_t dither_8x8_73[8][8] |
{
{ 0, 55, 14, 68, 3, 58, 17, 72, },
{ 37, 18, 50, 32, 40, 22, 54, 35, },
{ 9, 64, 5, 59, 13, 67, 8, 63, },
{ 46, 27, 41, 23, 49, 31, 44, 26, },
{ 2, 57, 16, 71, 1, 56, 15, 70, },
{ 39, 21, 52, 34, 38, 19, 51, 33, },
{ 11, 66, 7, 62, 10, 65, 6, 60, },
{ 48, 30, 43, 25, 47, 29, 42, 24, },
}
| const int32_t ff_yuv2rgb_coeffs[8][4] |
Definition at line 68 of file yuv2rgb.c.
Referenced by sws_getContext().
const double rgb2yuv_table[8][9] [static] |
{
{0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5},
{0.7152, 0.0722, 0.2126, -0.386, 0.5, -0.115, -0.454, -0.046, 0.5},
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5},
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5},
{0.59 , 0.11 , 0.30 , -0.331, 0.5, -0.169, -0.421, -0.079, 0.5},
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5},
{0.587 , 0.114 , 0.299 , -0.331, 0.5, -0.169, -0.419, -0.081, 0.5},
{0.701 , 0.087 , 0.212 , -0.384, 0.5 -0.116, -0.445, -0.055, 0.5},
}
1.6.3