swscale_internal.h File Reference
#include "config.h"
#include "libavutil/avassert.h"
#include "libavutil/avutil.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/pixfmt.h"
#include "libavutil/pixdesc.h"
Include dependency graph for swscale_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SwsContext
 

Macros

#define STR(s)   AV_TOSTRING(s)
 
#define YUVRGB_TABLE_HEADROOM   128
 
#define MAX_FILTER_SIZE   256
 
#define DITHER1XBPP
 
#define ALT32_CORR   1
 
#define APCK_PTR2   4
 
#define APCK_COEF   8
 
#define APCK_SIZE   16
 
#define RY_IDX   0
 
#define GY_IDX   1
 
#define BY_IDX   2
 
#define RU_IDX   3
 
#define GU_IDX   4
 
#define BU_IDX   5
 
#define RV_IDX   6
 
#define GV_IDX   7
 
#define BV_IDX   8
 
#define RGB2YUV_SHIFT   15
 
#define RED_DITHER   "0*8"
 
#define GREEN_DITHER   "1*8"
 
#define BLUE_DITHER   "2*8"
 
#define Y_COEFF   "3*8"
 
#define VR_COEFF   "4*8"
 
#define UB_COEFF   "5*8"
 
#define VG_COEFF   "6*8"
 
#define UG_COEFF   "7*8"
 
#define Y_OFFSET   "8*8"
 
#define U_OFFSET   "9*8"
 
#define V_OFFSET   "10*8"
 
#define LUM_MMX_FILTER_OFFSET   "11*8"
 
#define CHR_MMX_FILTER_OFFSET   "11*8+4*4*256"
 
#define DSTW_OFFSET   "11*8+4*4*256*2"
 
#define ESP_OFFSET   "11*8+4*4*256*2+8"
 
#define VROUNDER_OFFSET   "11*8+4*4*256*2+16"
 
#define U_TEMP   "11*8+4*4*256*2+24"
 
#define V_TEMP   "11*8+4*4*256*2+32"
 
#define Y_TEMP   "11*8+4*4*256*2+40"
 
#define ALP_MMX_FILTER_OFFSET   "11*8+4*4*256*2+48"
 
#define UV_OFF_PX   "11*8+4*4*256*3+48"
 
#define UV_OFF_BYTE   "11*8+4*4*256*3+56"
 
#define DITHER16   "11*8+4*4*256*3+64"
 
#define DITHER32   "11*8+4*4*256*3+80"
 
#define isNBPS(x)   is9_OR_10BPS(x)
 
#define isGray(x)
 
#define isRGBinInt(x)
 
#define isBGRinInt(x)
 
#define isRGBinBytes(x)
 
#define isBGRinBytes(x)
 
#define isAnyRGB(x)
 
#define isPacked(x)
 
#define FILL(wfunc)
 

Typedefs

typedef int(* SwsFunc) (struct SwsContext *context, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 
typedef void(* yuv2planar1_fn) (const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
 Write one line of horizontally scaled data to planar output without any additional vertical scaling (or point-scaling). More...
 
typedef void(* yuv2planarX_fn) (const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
 Write one line of horizontally scaled data to planar output with multi-point vertical scaling between input pixels. More...
 
typedef void(* yuv2interleavedX_fn) (struct SwsContext *c, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest, int dstW)
 Write one line of horizontally scaled chroma to interleaved output with multi-point vertical scaling between input pixels. More...
 
typedef void(* yuv2packed1_fn) (struct SwsContext *c, const int16_t *lumSrc, const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc, uint8_t *dest, int dstW, int uvalpha, int y)
 Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output without any additional vertical scaling (or point-scaling). More...
 
typedef void(* yuv2packed2_fn) (struct SwsContext *c, const int16_t *lumSrc[2], const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)
 Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing bilinear scaling between two input lines. More...
 
typedef void(* yuv2packedX_fn) (struct SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
 Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing multi-point vertical scaling between input pixels. More...
 
typedef void(* yuv2anyX_fn) (struct SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t **dest, int dstW, int y)
 Write one line of horizontally scaled Y/U/V/A to YUV/RGB output by doing multi-point vertical scaling between input pixels. More...
 
typedef struct SwsContext SwsContext
 

Functions

SwsFunc ff_yuv2rgb_get_func_ptr (SwsContext *c)
 
int ff_yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation)
 
void ff_yuv2rgb_init_tables_altivec (SwsContext *c, const int inv_table[4], int brightness, int contrast, int saturation)
 
void updateMMXDitherTables (SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex, int lastInLumBuf, int lastInChrBuf)
 
SwsFunc ff_yuv2rgb_init_mmx (SwsContext *c)
 
SwsFunc ff_yuv2rgb_init_vis (SwsContext *c)
 
SwsFunc ff_yuv2rgb_init_altivec (SwsContext *c)
 
SwsFunc ff_yuv2rgb_get_func_ptr_bfin (SwsContext *c)
 
void ff_bfin_get_unscaled_swscale (SwsContext *c)
 
static av_always_inline int is16BPS (enum AVPixelFormat pix_fmt)
 
static av_always_inline int is9_OR_10BPS (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isBE (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isYUV (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isPlanarYUV (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isRGB (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isALPHA (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isPlanar (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isPackedRGB (enum AVPixelFormat pix_fmt)
 
static av_always_inline int isPlanarRGB (enum AVPixelFormat pix_fmt)
 
static av_always_inline int usePal (enum AVPixelFormat pix_fmt)
 
void ff_get_unscaled_swscale (SwsContext *c)
 Set c->swScale to an unscaled converter if one exists for the specific source and destination formats, bit depths, flags, etc. More...
 
void ff_swscale_get_unscaled_altivec (SwsContext *c)
 
SwsFunc ff_getSwsFunc (SwsContext *c)
 Return function pointer to fastest main scaler path function depending on architecture and available optimizations. More...
 
void ff_sws_init_input_funcs (SwsContext *c)
 
void ff_sws_init_output_funcs (SwsContext *c, yuv2planar1_fn *yuv2plane1, yuv2planarX_fn *yuv2planeX, yuv2interleavedX_fn *yuv2nv12cX, yuv2packed1_fn *yuv2packed1, yuv2packed2_fn *yuv2packed2, yuv2packedX_fn *yuv2packedX, yuv2anyX_fn *yuv2anyX)
 
void ff_sws_init_swScale_altivec (SwsContext *c)
 
void ff_sws_init_swScale_mmx (SwsContext *c)
 
static void fillPlane16 (uint8_t *plane, int stride, int width, int height, int y, int alpha, int bits, const int big_endian)
 

Variables

const uint64_t ff_dither4 [2]
 
const uint64_t ff_dither8 [2]
 
const uint8_t dithers [8][8][8]
 
const uint16_t dither_scale [15][16]
 
const AVClass sws_context_class
 

Macro Definition Documentation

#define ALP_MMX_FILTER_OFFSET   "11*8+4*4*256*2+48"

Definition at line 409 of file swscale_internal.h.

Referenced by yuv2rgb32_X(), and yuv2rgb32_X_ar().

#define ALT32_CORR   1

Definition at line 49 of file swscale_internal.h.

Referenced by findRgbConvFn(), and rgbToRgbWrapper().

#define APCK_COEF   8

Definition at line 58 of file swscale_internal.h.

#define APCK_PTR2   4

Definition at line 57 of file swscale_internal.h.

#define APCK_SIZE   16

Definition at line 59 of file swscale_internal.h.

Referenced by initFilter().

#define BLUE_DITHER   "2*8"
#define CHR_MMX_FILTER_OFFSET   "11*8+4*4*256"

Definition at line 402 of file swscale_internal.h.

#define DITHER16   "11*8+4*4*256*3+64"

Definition at line 412 of file swscale_internal.h.

#define DITHER1XBPP

Definition at line 44 of file swscale_internal.h.

Referenced by sws_init_context().

#define DITHER32   "11*8+4*4*256*3+80"

Definition at line 413 of file swscale_internal.h.

#define DSTW_OFFSET   "11*8+4*4*256*2"

Definition at line 403 of file swscale_internal.h.

#define ESP_OFFSET   "11*8+4*4*256*2+8"
#define FILL (   wfunc)
Value:
for (j = 0; j < width; j++) {\
wfunc(ptr+2*j, v);\
}
float v
static int width
Definition: tests/utils.c:158

Referenced by fillPlane16().

#define GREEN_DITHER   "1*8"
#define isAnyRGB (   x)
Value:
( \
isRGB(x) || \
)
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:234
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:233
#define isRGBinInt(x)
Discrete Time axis x
planar GBR 4:4:4 27bpp, big-endian
Definition: pixfmt.h:169
#define isBGRinInt(x)
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:171
planar GBR 4:4:4 42bpp, little-endian
Definition: pixfmt.h:236
static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
planar GBR 4:4:4 42bpp, big-endian
Definition: pixfmt.h:235
#define AV_PIX_FMT_GBR24P
Definition: pixfmt.h:251
planar GBR 4:4:4 27bpp, little-endian
Definition: pixfmt.h:170
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:172

Definition at line 724 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), hScale16To15_c(), hScale16To19_c(), sws_init_context(), and sws_init_swScale_c().

#define isBGRinBytes (   x)
Value:
( \
|| (x) == AV_PIX_FMT_BGRA \
|| (x) == AV_PIX_FMT_ABGR \
|| (x) == AV_PIX_FMT_BGR24 \
)
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:212
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:211
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:98
Discrete Time axis x
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:99
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:143
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:71
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:142

Definition at line 714 of file swscale_internal.h.

#define isBGRinInt (   x)
Value:
( \
(x) == AV_PIX_FMT_BGR32 || \
(x) == AV_PIX_FMT_BGR24 || \
(x) == AV_PIX_FMT_BGR8 || \
(x) == AV_PIX_FMT_BGR4 || \
)
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:212
packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:88
packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:211
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
Definition: pixfmt.h:120
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:89
Discrete Time axis x
#define AV_PIX_FMT_BGR32_1
Definition: pixfmt.h:262
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:143
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:71
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:142
packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
Definition: pixfmt.h:119
#define AV_PIX_FMT_BGR32
Definition: pixfmt.h:261
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:87
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 ...
Definition: pixfmt.h:122
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 ...
Definition: pixfmt.h:140
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:78
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:77
packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 ...
Definition: pixfmt.h:121
packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 ...
Definition: pixfmt.h:139

Definition at line 683 of file swscale_internal.h.

Referenced by findRgbConvFn().

#define isGray (   x)
Value:
((x) == AV_PIX_FMT_GRAY8 || \
(x) == AV_PIX_FMT_Y400A || \
Discrete Time axis x
Y , 16bpp, big-endian.
Definition: pixfmt.h:101
#define AV_PIX_FMT_Y400A
Definition: pixfmt.h:250
Y , 8bpp.
Definition: pixfmt.h:76
Y , 16bpp, little-endian.
Definition: pixfmt.h:102

Definition at line 655 of file swscale_internal.h.

#define isNBPS (   x)    is9_OR_10BPS(x)
#define isPacked (   x)
Value:
( \
|| isRGBinInt(x) \
|| isBGRinInt(x) \
)
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:85
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:79
#define isRGBinInt(x)
Discrete Time axis x
#define isBGRinInt(x)
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:69
#define AV_PIX_FMT_Y400A
Definition: pixfmt.h:250

Definition at line 748 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), and swScale().

#define isRGBinBytes (   x)
Value:
( \
|| (x) == AV_PIX_FMT_RGBA \
|| (x) == AV_PIX_FMT_ARGB \
|| (x) == AV_PIX_FMT_RGB24 \
)
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:70
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:112
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:209
Discrete Time axis x
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:96
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:97
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:111
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:210

Definition at line 705 of file swscale_internal.h.

#define isRGBinInt (   x)
Value:
( \
(x) == AV_PIX_FMT_RGB32 || \
(x) == AV_PIX_FMT_RGB24 || \
(x) == AV_PIX_FMT_RGB8 || \
(x) == AV_PIX_FMT_RGB4 || \
)
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:70
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
Definition: pixfmt.h:117
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 ...
Definition: pixfmt.h:138
packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in ...
Definition: pixfmt.h:91
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:115
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:112
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:209
packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 ...
Definition: pixfmt.h:137
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
Definition: pixfmt.h:114
Discrete Time axis x
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:92
#define AV_PIX_FMT_RGB32
Definition: pixfmt.h:259
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 ...
Definition: pixfmt.h:116
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:78
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:77
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:111
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:90
#define AV_PIX_FMT_RGB32_1
Definition: pixfmt.h:260
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:210

Definition at line 662 of file swscale_internal.h.

Referenced by findRgbConvFn().

#define LUM_MMX_FILTER_OFFSET   "11*8"

Definition at line 401 of file swscale_internal.h.

#define MAX_FILTER_SIZE   256

Definition at line 42 of file swscale_internal.h.

Referenced by initFilter().

#define RED_DITHER   "0*8"
#define RGB2YUV_SHIFT   15

Definition at line 371 of file swscale_internal.h.

#define STR (   s)    AV_TOSTRING(s)

Definition at line 38 of file swscale_internal.h.

Referenced by av_register_all().

#define U_OFFSET   "9*8"

Definition at line 399 of file swscale_internal.h.

#define U_TEMP   "11*8+4*4*256*2+24"

Definition at line 406 of file swscale_internal.h.

Referenced by yuv2rgb32_2(), and yuv2rgb32_X_ar().

#define UB_COEFF   "5*8"

Definition at line 395 of file swscale_internal.h.

#define UG_COEFF   "7*8"

Definition at line 397 of file swscale_internal.h.

#define UV_OFF_BYTE   "11*8+4*4*256*3+56"

Definition at line 411 of file swscale_internal.h.

#define UV_OFF_PX   "11*8+4*4*256*3+48"

Definition at line 410 of file swscale_internal.h.

#define V_OFFSET   "10*8"

Definition at line 400 of file swscale_internal.h.

#define V_TEMP   "11*8+4*4*256*2+32"

Definition at line 407 of file swscale_internal.h.

Referenced by yuv2rgb32_2(), and yuv2rgb32_X_ar().

#define VG_COEFF   "6*8"

Definition at line 396 of file swscale_internal.h.

#define VR_COEFF   "4*8"

Definition at line 394 of file swscale_internal.h.

#define VROUNDER_OFFSET   "11*8+4*4*256*2+16"

Definition at line 405 of file swscale_internal.h.

#define Y_COEFF   "3*8"

Definition at line 393 of file swscale_internal.h.

#define Y_OFFSET   "8*8"

Definition at line 398 of file swscale_internal.h.

#define Y_TEMP   "11*8+4*4*256*2+40"

Definition at line 408 of file swscale_internal.h.

Referenced by yuv2rgb32_X_ar().

#define YUVRGB_TABLE_HEADROOM   128

Typedef Documentation

typedef struct SwsContext SwsContext
typedef int(* SwsFunc) (struct SwsContext *context, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])

Definition at line 64 of file swscale_internal.h.

typedef void(* yuv2anyX_fn) (struct SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t **dest, int dstW, int y)

Write one line of horizontally scaled Y/U/V/A to YUV/RGB output by doing multi-point vertical scaling between input pixels.

Parameters
cSWS scaling context
lumFiltervertical luma/alpha scaling coefficients, 12bit [0,4096]
lumSrcscaled luma (Y) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
lumFilterSizenumber of vertical luma/alpha input lines to scale
chrFiltervertical chroma scaling coefficients, 12bit [0,4096]
chrUSrcscaled chroma (U) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrVSrcscaled chroma (V) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrFilterSizenumber of vertical chroma input lines to scale
alpSrcscaled alpha (A) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
destpointer to the output planes. For 16bit output, this is uint16_t
dstWwidth of lumSrc and alpSrc in pixels, number of pixels to write into dest[]
yvertical line number for this output. This does not need to be used to calculate the offset in the destination, but can be used to generate comfort noise using dithering or some output formats.

Definition at line 250 of file swscale_internal.h.

typedef void(* yuv2interleavedX_fn) (struct SwsContext *c, const int16_t *chrFilter, int chrFilterSize, const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest, int dstW)

Write one line of horizontally scaled chroma to interleaved output with multi-point vertical scaling between input pixels.

Parameters
cSWS scaling context
chrFiltervertical chroma scaling coefficients, 12bit [0,4096]
chrUSrcscaled chroma (U) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrVSrcscaled chroma (V) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrFilterSizenumber of vertical chroma input lines to scale
destpointer to the output plane. For >8bit output, this is in uint16_t
dstWwidth of chroma planes

Definition at line 115 of file swscale_internal.h.

typedef void(* yuv2packed1_fn) (struct SwsContext *c, const int16_t *lumSrc, const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc, uint8_t *dest, int dstW, int uvalpha, int y)

Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output without any additional vertical scaling (or point-scaling).

Note that this function may do chroma scaling, see the "uvalpha" argument.

Parameters
cSWS scaling context
lumSrcscaled luma (Y) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrUSrcscaled chroma (U) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrVSrcscaled chroma (V) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
alpSrcscaled alpha (A) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
destpointer to the output plane. For 16bit output, this is uint16_t
dstWwidth of lumSrc and alpSrc in pixels, number of pixels to write into dest[]
uvalphachroma scaling coefficient for the second line of chroma pixels, either 2048 or 0. If 0, one chroma input is used for 2 output pixels (or if the SWS_FLAG_FULL_CHR_INT flag is set, it generates 1 output pixel). If 2048, two chroma input pixels should be averaged for 2 output pixels (this only happens if SWS_FLAG_FULL_CHR_INT is not set)
yvertical line number for this output. This does not need to be used to calculate the offset in the destination, but can be used to generate comfort noise using dithering for some output formats.

Definition at line 151 of file swscale_internal.h.

typedef void(* yuv2packed2_fn) (struct SwsContext *c, const int16_t *lumSrc[2], const int16_t *chrUSrc[2], const int16_t *chrVSrc[2], const int16_t *alpSrc[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y)

Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing bilinear scaling between two input lines.

Parameters
cSWS scaling context
lumSrcscaled luma (Y) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrUSrcscaled chroma (U) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrVSrcscaled chroma (V) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
alpSrcscaled alpha (A) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
destpointer to the output plane. For 16bit output, this is uint16_t
dstWwidth of lumSrc and alpSrc in pixels, number of pixels to write into dest[]
yalphaluma/alpha scaling coefficients for the second input line. The first line's coefficients can be calculated by using 4096 - yalpha
uvalphachroma scaling coefficient for the second input line. The first line's coefficients can be calculated by using 4096 - uvalpha
yvertical line number for this output. This does not need to be used to calculate the offset in the destination, but can be used to generate comfort noise using dithering for some output formats.

Definition at line 184 of file swscale_internal.h.

typedef void(* yuv2packedX_fn) (struct SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y)

Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB output by doing multi-point vertical scaling between input pixels.

Parameters
cSWS scaling context
lumFiltervertical luma/alpha scaling coefficients, 12bit [0,4096]
lumSrcscaled luma (Y) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
lumFilterSizenumber of vertical luma/alpha input lines to scale
chrFiltervertical chroma scaling coefficients, 12bit [0,4096]
chrUSrcscaled chroma (U) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrVSrcscaled chroma (V) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
chrFilterSizenumber of vertical chroma input lines to scale
alpSrcscaled alpha (A) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
destpointer to the output plane. For 16bit output, this is uint16_t
dstWwidth of lumSrc and alpSrc in pixels, number of pixels to write into dest[]
yvertical line number for this output. This does not need to be used to calculate the offset in the destination, but can be used to generate comfort noise using dithering or some output formats.

Definition at line 216 of file swscale_internal.h.

typedef void(* yuv2planar1_fn) (const int16_t *src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)

Write one line of horizontally scaled data to planar output without any additional vertical scaling (or point-scaling).

Parameters
srcscaled source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
destpointer to the output plane. For >8bit output, this is in uint16_t
dstWwidth of destination in pixels
ditherordered dither array of type int16_t and size 8
offsetDither offset

Definition at line 80 of file swscale_internal.h.

typedef void(* yuv2planarX_fn) (const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)

Write one line of horizontally scaled data to planar output with multi-point vertical scaling between input pixels.

Parameters
filtervertical luma/alpha scaling coefficients, 12bit [0,4096]
srcscaled luma (Y) or alpha (A) source data, 15bit for 8-10bit output, 19-bit for 16bit output (in int32_t)
filterSizenumber of vertical input lines to scale
destpointer to output plane. For >8bit output, this is in uint16_t
dstWwidth of destination pixels
offsetDither offset

Definition at line 96 of file swscale_internal.h.

Function Documentation

void ff_bfin_get_unscaled_swscale ( SwsContext c)

Definition at line 74 of file swscale_bfin.c.

Referenced by ff_get_unscaled_swscale().

void ff_get_unscaled_swscale ( SwsContext c)

Set c->swScale to an unscaled converter if one exists for the specific source and destination formats, bit depths, flags, etc.

Definition at line 997 of file swscale_unscaled.c.

Referenced by sws_init_context(), and usePal().

SwsFunc ff_getSwsFunc ( SwsContext c)

Return function pointer to fastest main scaler path function depending on architecture and available optimizations.

Definition at line 755 of file swscale.c.

Referenced by sws_init_context(), and usePal().

void ff_sws_init_input_funcs ( SwsContext c)

Definition at line 889 of file input.c.

Referenced by sws_init_swScale_c(), and usePal().

void ff_sws_init_output_funcs ( SwsContext c,
yuv2planar1_fn yuv2plane1,
yuv2planarX_fn yuv2planeX,
yuv2interleavedX_fn yuv2nv12cX,
yuv2packed1_fn yuv2packed1,
yuv2packed2_fn yuv2packed2,
yuv2packedX_fn yuv2packedX,
yuv2anyX_fn yuv2anyX 
)

Definition at line 1565 of file output.c.

Referenced by sws_init_swScale_c(), swScale(), and usePal().

void ff_sws_init_swScale_altivec ( SwsContext c)

Definition at line 288 of file swscale_altivec.c.

Referenced by ff_getSwsFunc(), and usePal().

void ff_sws_init_swScale_mmx ( SwsContext c)

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

Referenced by ff_getSwsFunc(), and usePal().

void ff_swscale_get_unscaled_altivec ( SwsContext c)

Definition at line 182 of file yuv2yuv_altivec.c.

Referenced by ff_get_unscaled_swscale(), and usePal().

int ff_yuv2rgb_c_init_tables ( SwsContext c,
const int  inv_table[4],
int  fullRange,
int  brightness,
int  contrast,
int  saturation 
)

Definition at line 706 of file yuv2rgb.c.

Referenced by sws_setColorspaceDetails().

SwsFunc ff_yuv2rgb_get_func_ptr ( SwsContext c)

Definition at line 607 of file yuv2rgb.c.

Referenced by ff_get_unscaled_swscale().

SwsFunc ff_yuv2rgb_get_func_ptr_bfin ( SwsContext c)

Definition at line 171 of file yuv2rgb_bfin.c.

Referenced by ff_yuv2rgb_get_func_ptr().

SwsFunc ff_yuv2rgb_init_altivec ( SwsContext c)

Definition at line 535 of file yuv2rgb_altivec.c.

Referenced by ff_yuv2rgb_get_func_ptr().

SwsFunc ff_yuv2rgb_init_mmx ( SwsContext c)

Definition at line 72 of file x86/yuv2rgb.c.

Referenced by ff_yuv2rgb_get_func_ptr().

void ff_yuv2rgb_init_tables_altivec ( SwsContext c,
const int  inv_table[4],
int  brightness,
int  contrast,
int  saturation 
)

Definition at line 595 of file yuv2rgb_altivec.c.

Referenced by sws_setColorspaceDetails().

SwsFunc ff_yuv2rgb_init_vis ( SwsContext c)

Definition at line 188 of file yuv2rgb_vis.c.

Referenced by ff_yuv2rgb_get_func_ptr().

static void fillPlane16 ( uint8_t plane,
int  stride,
int  width,
int  height,
int  y,
int  alpha,
int  bits,
const int  big_endian 
)
inlinestatic

Definition at line 829 of file swscale_internal.h.

Referenced by planarCopyWrapper(), and swScale().

static av_always_inline int is9_OR_10BPS ( enum AVPixelFormat  pix_fmt)
static
static av_always_inline int isALPHA ( enum AVPixelFormat  pix_fmt)
static

Definition at line 740 of file swscale_internal.h.

static av_always_inline int isPackedRGB ( enum AVPixelFormat  pix_fmt)
static

Definition at line 773 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale().

static av_always_inline int isPlanar ( enum AVPixelFormat  pix_fmt)
static
static av_always_inline int isPlanarRGB ( enum AVPixelFormat  pix_fmt)
static

Definition at line 780 of file swscale_internal.h.

Referenced by sws_init_context().

static av_always_inline int isPlanarYUV ( enum AVPixelFormat  pix_fmt)
static

Definition at line 636 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), and swScale().

static av_always_inline int isRGB ( enum AVPixelFormat  pix_fmt)
static

Definition at line 643 of file swscale_internal.h.

static av_always_inline int isYUV ( enum AVPixelFormat  pix_fmt)
static
void updateMMXDitherTables ( SwsContext c,
int  dstY,
int  lumBufIndex,
int  chrBufIndex,
int  lastInLumBuf,
int  lastInChrBuf 
)

Referenced by swScale().

static av_always_inline int usePal ( enum AVPixelFormat  pix_fmt)
static

Variable Documentation

const uint16_t dither_scale[15][16]

Definition at line 112 of file swscale_unscaled.c.

Referenced by usePal().

const uint8_t dithers[8][8][8]

Referenced by usePal().

const uint64_t ff_dither4[2]

Referenced by usePal(), and yuv420_rgb16().

const uint64_t ff_dither8[2]

Referenced by usePal(), yuv420_rgb15(), and yuv420_rgb16().

const AVClass sws_context_class

Definition at line 70 of file libswscale/options.c.

Referenced by sws_alloc_context(), sws_get_class(), and usePal().