SwsContext Struct Reference

#include <swscale_internal.h>

Collaboration diagram for SwsContext:
Collaboration graph

Public Member Functions

 DECLARE_ALIGNED (16, int32_t, input_rgb2yuv_table)[16+40 *4]
 
 DECLARE_ALIGNED (8, uint64_t, redDither)
 
 DECLARE_ALIGNED (8, uint64_t, greenDither)
 
 DECLARE_ALIGNED (8, uint64_t, blueDither)
 
 DECLARE_ALIGNED (8, uint64_t, yCoeff)
 
 DECLARE_ALIGNED (8, uint64_t, vrCoeff)
 
 DECLARE_ALIGNED (8, uint64_t, ubCoeff)
 
 DECLARE_ALIGNED (8, uint64_t, vgCoeff)
 
 DECLARE_ALIGNED (8, uint64_t, ugCoeff)
 
 DECLARE_ALIGNED (8, uint64_t, yOffset)
 
 DECLARE_ALIGNED (8, uint64_t, uOffset)
 
 DECLARE_ALIGNED (8, uint64_t, vOffset)
 
 DECLARE_ALIGNED (8, uint64_t, esp)
 
 DECLARE_ALIGNED (8, uint64_t, vRounder)
 
 DECLARE_ALIGNED (8, uint64_t, u_temp)
 
 DECLARE_ALIGNED (8, uint64_t, v_temp)
 
 DECLARE_ALIGNED (8, uint64_t, y_temp)
 
 DECLARE_ALIGNED (8, ptrdiff_t, uv_off)
 offset (in pixels) between u and v planes More...
 
 DECLARE_ALIGNED (8, ptrdiff_t, uv_offx2)
 offset (in bytes) between u and v planes More...
 
 DECLARE_ALIGNED (8, uint16_t, dither16)[8]
 
 DECLARE_ALIGNED (8, uint32_t, dither32)[8]
 

Data Fields

const AVClassav_class
 info on struct for av_log More...
 
SwsFunc swScale
 Note that src, dst, srcStride, dstStride will be copied in the sws_scale() wrapper so they can be freely modified here. More...
 
int srcW
 Width of source luma/alpha planes. More...
 
int srcH
 Height of source luma/alpha planes. More...
 
int dstH
 Height of destination luma/alpha planes. More...
 
int chrSrcW
 Width of source chroma planes. More...
 
int chrSrcH
 Height of source chroma planes. More...
 
int chrDstW
 Width of destination chroma planes. More...
 
int chrDstH
 Height of destination chroma planes. More...
 
int lumXInc
 
int chrXInc
 
int lumYInc
 
int chrYInc
 
enum AVPixelFormat dstFormat
 Destination pixel format. More...
 
enum AVPixelFormat srcFormat
 Source pixel format. More...
 
int dstFormatBpp
 Number of bits per pixel of the destination pixel format. More...
 
int srcFormatBpp
 Number of bits per pixel of the source pixel format. More...
 
int dstBpc
 
int srcBpc
 
int chrSrcHSubSample
 Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source image. More...
 
int chrSrcVSubSample
 Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image. More...
 
int chrDstHSubSample
 Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination image. More...
 
int chrDstVSubSample
 Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in destination image. More...
 
int vChrDrop
 Binary logarithm of extra vertical subsampling factor in source image chroma planes specified by user. More...
 
int sliceDir
 Direction that slices are fed to the scaler (1 = top-to-bottom, -1 = bottom-to-top). More...
 
double param [2]
 Input parameters for scaling algorithms that need them. More...
 
uint32_t pal_yuv [256]
 
uint32_t pal_rgb [256]
 
uint8_tformatConvBuffer
 
int lumMmxextFilterCodeSize
 Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes. More...
 
int chrMmxextFilterCodeSize
 Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes. More...
 
uint8_tlumMmxextFilterCode
 Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes. More...
 
uint8_tchrMmxextFilterCode
 Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes. More...
 
int canMMXEXTBeUsed
 
int dstY
 Last destination vertical line output from last slice. More...
 
int flags
 Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc... More...
 
voidyuvTable
 
uint8_ttable_rV [256+2 *YUVRGB_TABLE_HEADROOM]
 
uint8_ttable_gU [256+2 *YUVRGB_TABLE_HEADROOM]
 
int table_gV [256+2 *YUVRGB_TABLE_HEADROOM]
 
uint8_ttable_bU [256+2 *YUVRGB_TABLE_HEADROOM]
 
int * dither_error [4]
 
int contrast
 
int brightness
 
int saturation
 
int srcColorspaceTable [4]
 
int dstColorspaceTable [4]
 
int srcRange
 0 = MPG YUV range, 1 = JPG YUV range (source image). More...
 
int dstRange
 0 = MPG YUV range, 1 = JPG YUV range (destination image). More...
 
int src0Alpha
 
int dst0Alpha
 
int yuv2rgb_y_offset
 
int yuv2rgb_y_coeff
 
int yuv2rgb_v2r_coeff
 
int yuv2rgb_v2g_coeff
 
int yuv2rgb_u2g_coeff
 
int yuv2rgb_u2b_coeff
 
int32_t lumMmxFilter [4 *MAX_FILTER_SIZE]
 
int32_t chrMmxFilter [4 *MAX_FILTER_SIZE]
 
int dstW
 Width of destination luma/alpha planes. More...
 
int32_t alpMmxFilter [4 *MAX_FILTER_SIZE]
 
const uint8_tchrDither8
 
const uint8_tlumDither8
 
int use_mmx_vfilter
 
yuv2planar1_fn yuv2plane1
 
yuv2planarX_fn yuv2planeX
 
yuv2interleavedX_fn yuv2nv12cX
 
yuv2packed1_fn yuv2packed1
 
yuv2packed2_fn yuv2packed2
 
yuv2packedX_fn yuv2packedX
 
yuv2anyX_fn yuv2anyX
 
void(* lumToYV12 )(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal)
 Unscaled conversion of luma plane to YV12 for horizontal scaler. More...
 
void(* alpToYV12 )(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal)
 Unscaled conversion of alpha plane to YV12 for horizontal scaler. More...
 
void(* chrToYV12 )(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal)
 Unscaled conversion of chroma planes to YV12 for horizontal scaler. More...
 
void(* lumConvertRange )(int16_t *dst, int width)
 Color range conversion function for luma plane if needed. More...
 
void(* chrConvertRange )(int16_t *dst1, int16_t *dst2, int width)
 Color range conversion function for chroma planes if needed. More...
 
int needs_hcscale
 Set if there are chroma planes to be converted. More...
 
Scaled horizontal lines ring buffer.

The horizontal scaler keeps just enough scaled lines in a ring buffer so they may be passed to the vertical scaler.

The pointers to the allocated buffers for each line are duplicated in sequence in the ring buffer to simplify indexing and avoid wrapping around between lines inside the vertical scaler code. The wrapping is done before the vertical scaler is called.

int16_t ** lumPixBuf
 Ring buffer for scaled horizontal luma plane lines to be fed to the vertical scaler. More...
 
int16_t ** chrUPixBuf
 Ring buffer for scaled horizontal chroma plane lines to be fed to the vertical scaler. More...
 
int16_t ** chrVPixBuf
 Ring buffer for scaled horizontal chroma plane lines to be fed to the vertical scaler. More...
 
int16_t ** alpPixBuf
 Ring buffer for scaled horizontal alpha plane lines to be fed to the vertical scaler. More...
 
int vLumBufSize
 Number of vertical luma/alpha lines allocated in the ring buffer. More...
 
int vChrBufSize
 Number of vertical chroma lines allocated in the ring buffer. More...
 
int lastInLumBuf
 Last scaled horizontal luma/alpha line from source in the ring buffer. More...
 
int lastInChrBuf
 Last scaled horizontal chroma line from source in the ring buffer. More...
 
int lumBufIndex
 Index in ring buffer of the last scaled horizontal luma/alpha line from source. More...
 
int chrBufIndex
 Index in ring buffer of the last scaled horizontal chroma line from source. More...
 
Horizontal and vertical filters.

To better understand the following fields, here is a pseudo-code of their usage in filtering a horizontal line:

for (i = 0; i < width; i++) {
dst[i] = 0;
for (j = 0; j < filterSize; j++)
dst[i] += src[ filterPos[i] + j ] * filter[ filterSize * i + j ];
dst[i] >>= FRAC_BITS; // The actual implementation is fixed-point.
}
int16_t * hLumFilter
 Array of horizontal filter coefficients for luma/alpha planes. More...
 
int16_t * hChrFilter
 Array of horizontal filter coefficients for chroma planes. More...
 
int16_t * vLumFilter
 Array of vertical filter coefficients for luma/alpha planes. More...
 
int16_t * vChrFilter
 Array of vertical filter coefficients for chroma planes. More...
 
int32_thLumFilterPos
 Array of horizontal filter starting positions for each dst[i] for luma/alpha planes. More...
 
int32_thChrFilterPos
 Array of horizontal filter starting positions for each dst[i] for chroma planes. More...
 
int32_tvLumFilterPos
 Array of vertical filter starting positions for each dst[i] for luma/alpha planes. More...
 
int32_tvChrFilterPos
 Array of vertical filter starting positions for each dst[i] for chroma planes. More...
 
int hLumFilterSize
 Horizontal filter size for luma/alpha pixels. More...
 
int hChrFilterSize
 Horizontal filter size for chroma pixels. More...
 
int vLumFilterSize
 Vertical filter size for luma/alpha pixels. More...
 
int vChrFilterSize
 Vertical filter size for chroma pixels. More...
 
void(* readLumPlanar )(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv)
 Functions to read planar input, such as planar RGB, and convert internally to Y/UV. More...
 
void(* readChrPlanar )(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv)
 
void(* hyscale_fast )(struct SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc)
 Scale one horizontal line of input data using a bilinear filter to produce one line of output data. More...
 
void(* hcscale_fast )(struct SwsContext *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc)
 
void(* hyScale )(struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
 Scale one horizontal line of input data using a filter over the input lines, to produce one (differently sized) line of output data. More...
 
void(* hcScale )(struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
 

Detailed Description

Definition at line 259 of file swscale_internal.h.

Member Function Documentation

SwsContext::DECLARE_ALIGNED ( 16  ,
int32_t  ,
input_rgb2yuv_table   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
redDither   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
greenDither   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
blueDither   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
yCoeff   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
vrCoeff   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
ubCoeff   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
vgCoeff   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
ugCoeff   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
yOffset   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
uOffset   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
vOffset   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
esp   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
vRounder   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
u_temp   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
v_temp   
)
SwsContext::DECLARE_ALIGNED ( ,
uint64_t  ,
y_temp   
)
SwsContext::DECLARE_ALIGNED ( ,
ptrdiff_t  ,
uv_off   
)

offset (in pixels) between u and v planes

SwsContext::DECLARE_ALIGNED ( ,
ptrdiff_t  ,
uv_offx2   
)

offset (in bytes) between u and v planes

SwsContext::DECLARE_ALIGNED ( ,
uint16_t  ,
dither16   
)
SwsContext::DECLARE_ALIGNED ( ,
uint32_t  ,
dither32   
)

Field Documentation

int32_t SwsContext::alpMmxFilter[4 *MAX_FILTER_SIZE]

Definition at line 435 of file swscale_internal.h.

Referenced by swScale().

int16_t** SwsContext::alpPixBuf

Ring buffer for scaled horizontal alpha plane lines to be fed to the vertical scaler.

Definition at line 308 of file swscale_internal.h.

Referenced by ff_sws_init_input_funcs(), ff_sws_init_output_funcs(), ff_sws_init_swScale_altivec(), ff_sws_init_swScale_mmx(), sws_freeContext(), sws_init_context(), and swScale().

void(* SwsContext::alpToYV12) (uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal)

Unscaled conversion of alpha plane to YV12 for horizontal scaler.

Definition at line 489 of file swscale_internal.h.

Referenced by ff_sws_init_input_funcs(), ff_sws_init_swScale_mmx(), and hyscale().

const AVClass* SwsContext::av_class

info on struct for av_log

Definition at line 263 of file swscale_internal.h.

Referenced by sws_alloc_context().

int SwsContext::brightness

Definition at line 376 of file swscale_internal.h.

Referenced by sws_getColorspaceDetails(), and sws_setColorspaceDetails().

int SwsContext::canMMXEXTBeUsed

Definition at line 352 of file swscale_internal.h.

Referenced by sws_init_context().

int SwsContext::chrBufIndex

Index in ring buffer of the last scaled horizontal chroma line from source.

Definition at line 314 of file swscale_internal.h.

Referenced by swScale().

void(* SwsContext::chrConvertRange) (int16_t *dst1, int16_t *dst2, int width)

Color range conversion function for chroma planes if needed.

Definition at line 576 of file swscale_internal.h.

Referenced by hcscale(), and sws_init_swScale_c().

const uint8_t* SwsContext::chrDither8

Definition at line 444 of file swscale_internal.h.

Referenced by swScale(), and yuv2nv12cX_c().

int SwsContext::chrDstH

Height of destination chroma planes.

Definition at line 276 of file swscale_internal.h.

Referenced by sws_init_context().

int SwsContext::chrDstHSubSample

Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination image.

Definition at line 286 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), planarCopyWrapper(), and sws_init_context().

int SwsContext::chrDstVSubSample

Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in destination image.

Definition at line 287 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), planarCopyWrapper(), sws_init_context(), sws_scale(), and swScale().

int SwsContext::chrDstW

Width of destination chroma planes.

Definition at line 275 of file swscale_internal.h.

Referenced by sws_init_context(), and swScale().

uint8_t* SwsContext::chrMmxextFilterCode

Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.

Definition at line 350 of file swscale_internal.h.

Referenced by sws_freeContext(), and sws_init_context().

int SwsContext::chrMmxextFilterCodeSize

Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.

Definition at line 348 of file swscale_internal.h.

Referenced by sws_freeContext(), and sws_init_context().

int32_t SwsContext::chrMmxFilter[4 *MAX_FILTER_SIZE]

Definition at line 428 of file swscale_internal.h.

Referenced by swScale().

int SwsContext::chrSrcH

Height of source chroma planes.

Definition at line 274 of file swscale_internal.h.

Referenced by sws_init_context(), and swScale().

int SwsContext::chrSrcHSubSample

Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source image.

Definition at line 284 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), ff_sws_init_input_funcs(), and sws_init_context().

int SwsContext::chrSrcVSubSample

Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image.

Definition at line 285 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), sws_init_context(), sws_scale(), and swScale().

int SwsContext::chrSrcW

Width of source chroma planes.

Definition at line 273 of file swscale_internal.h.

Referenced by sws_init_context(), swScale(), and yvu9ToYv12Wrapper().

void(* SwsContext::chrToYV12) (uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal)

Unscaled conversion of chroma planes to YV12 for horizontal scaler.

Definition at line 492 of file swscale_internal.h.

Referenced by ff_sws_init_input_funcs(), ff_sws_init_swScale_mmx(), and hcscale().

int16_t** SwsContext::chrUPixBuf

Ring buffer for scaled horizontal chroma plane lines to be fed to the vertical scaler.

Definition at line 306 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int16_t** SwsContext::chrVPixBuf

Ring buffer for scaled horizontal chroma plane lines to be fed to the vertical scaler.

Definition at line 307 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int SwsContext::chrXInc

Definition at line 277 of file swscale_internal.h.

Referenced by sws_init_context(), and swScale().

int SwsContext::chrYInc

Definition at line 278 of file swscale_internal.h.

Referenced by sws_init_context().

int SwsContext::contrast

Definition at line 376 of file swscale_internal.h.

Referenced by sws_getColorspaceDetails(), and sws_setColorspaceDetails().

int SwsContext::dst0Alpha

Definition at line 382 of file swscale_internal.h.

Referenced by sws_getCachedContext(), sws_getContext(), and sws_scale().

int SwsContext::dstBpc
int SwsContext::dstColorspaceTable[4]

Definition at line 378 of file swscale_internal.h.

Referenced by sws_getColorspaceDetails(), and sws_setColorspaceDetails().

int SwsContext::dstFormatBpp

Number of bits per pixel of the destination pixel format.

Definition at line 281 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), ff_yuv2rgb_c_init_tables(), findRgbConvFn(), rgbToRgbWrapper(), sws_init_context(), and sws_setColorspaceDetails().

int SwsContext::dstH

Height of destination luma/alpha planes.

Definition at line 272 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), selfTest(), sws_getCachedContext(), sws_getContext(), sws_init_context(), sws_scale(), and swScale().

int SwsContext::dstRange

0 = MPG YUV range, 1 = JPG YUV range (destination image).

Definition at line 380 of file swscale_internal.h.

Referenced by sws_getCachedContext(), sws_getColorspaceDetails(), sws_getContext(), sws_init_context(), sws_init_swScale_c(), and sws_setColorspaceDetails().

int SwsContext::dstY

Last destination vertical line output from last slice.

Definition at line 354 of file swscale_internal.h.

Referenced by swScale().

uint8_t* SwsContext::formatConvBuffer
int16_t* SwsContext::hChrFilter

Array of horizontal filter coefficients for chroma planes.

Definition at line 334 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int32_t* SwsContext::hChrFilterPos

Array of horizontal filter starting positions for each dst[i] for chroma planes.

Definition at line 338 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int SwsContext::hChrFilterSize

Horizontal filter size for chroma pixels.

Definition at line 342 of file swscale_internal.h.

Referenced by ff_sws_init_swScale_mmx(), sws_init_context(), and swScale().

void(* SwsContext::hcScale) (struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
void(* SwsContext::hcscale_fast) (struct SwsContext *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc)

Definition at line 528 of file swscale_internal.h.

Referenced by hcscale(), sws_init_swScale(), sws_init_swScale_c(), and yuv2yuyv422_1().

int16_t* SwsContext::hLumFilter

Array of horizontal filter coefficients for luma/alpha planes.

Definition at line 333 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int32_t* SwsContext::hLumFilterPos

Array of horizontal filter starting positions for each dst[i] for luma/alpha planes.

Definition at line 337 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int SwsContext::hLumFilterSize

Horizontal filter size for luma/alpha pixels.

Definition at line 341 of file swscale_internal.h.

Referenced by ff_sws_init_swScale_mmx(), sws_init_context(), and swScale().

void(* SwsContext::hyScale) (struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)

Scale one horizontal line of input data using a filter over the input lines, to produce one (differently sized) line of output data.

Parameters
dstpointer to destination buffer for horizontally scaled data. If the number of bits per component of one destination pixel (SwsContext->dstBpc) is <= 10, data will be 15bpc in 16bits (int16_t) width. Else (i.e. SwsContext->dstBpc == 16), data will be 19bpc in 32bits (int32_t) width.
dstWwidth of destination image
srcpointer to source data to be scaled. If the number of bits per component of a source pixel (SwsContext->srcBpc) is 8, this is 8bpc in 8bits (uint8_t) width. Else (i.e. SwsContext->dstBpc > 8), this is native depth in 16bits (uint16_t) width. In other words, for 9-bit YUV input, this is 9bpc, for 10-bit YUV input, this is 10bpc, and for 16-bit RGB or YUV, this is 16bpc.
filterfilter coefficients to be used per output pixel for scaling. This contains 14bpp filtering coefficients. Guaranteed to contain dstW * filterSize entries.
filterPosposition of the first input pixel to be used for each output pixel during scaling. Guaranteed to contain dstW entries.
filterSizethe number of input coefficients to be used (and thus the number of input pixels to be used) for creating a single output pixel. Is aligned to 4 (and input coefficients thus padded with zeroes) to simplify creating SIMD code.

Definition at line 565 of file swscale_internal.h.

Referenced by ff_sws_init_swScale_altivec(), ff_sws_init_swScale_mmx(), hyscale(), and sws_init_swScale_c().

void(* SwsContext::hyscale_fast) (struct SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc)

Scale one horizontal line of input data using a bilinear filter to produce one line of output data.

Compared to SwsContext->hScale(), please take note of the following caveats when using these:

  • Scaling is done using only 7bit instead of 14bit coefficients.
  • You can use no more than 5 input pixels to produce 4 output pixels. Therefore, this filter should not be used for downscaling by more than ~20% in width (because that equals more than 5/4th downscaling and thus more than 5 pixels input per 4 pixels output).
  • In general, bilinear filters create artifacts during downscaling (even when <20%), because one output pixel will span more than one input pixel, and thus some pixels will need edges of both neighbor pixels to interpolate the output pixel. Since you can use at most two input pixels per output pixel in bilinear scaling, this is impossible and thus downscaling by any size will create artifacts. To enable this type of scaling, set SWS_FLAG_FAST_BILINEAR in SwsContext->flags.

Definition at line 525 of file swscale_internal.h.

Referenced by hyscale(), sws_init_swScale(), sws_init_swScale_c(), and yuv2yuyv422_1().

int SwsContext::lastInChrBuf

Last scaled horizontal chroma line from source in the ring buffer.

Definition at line 312 of file swscale_internal.h.

Referenced by swScale().

int SwsContext::lastInLumBuf

Last scaled horizontal luma/alpha line from source in the ring buffer.

Definition at line 311 of file swscale_internal.h.

Referenced by swScale().

int SwsContext::lumBufIndex

Index in ring buffer of the last scaled horizontal luma/alpha line from source.

Definition at line 313 of file swscale_internal.h.

Referenced by swScale().

void(* SwsContext::lumConvertRange) (int16_t *dst, int width)

Color range conversion function for luma plane if needed.

Definition at line 574 of file swscale_internal.h.

Referenced by hyscale(), and sws_init_swScale_c().

const uint8_t * SwsContext::lumDither8

Definition at line 444 of file swscale_internal.h.

Referenced by swScale().

uint8_t* SwsContext::lumMmxextFilterCode

Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.

Definition at line 349 of file swscale_internal.h.

Referenced by sws_freeContext(), and sws_init_context().

int SwsContext::lumMmxextFilterCodeSize

Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.

Definition at line 347 of file swscale_internal.h.

Referenced by sws_freeContext(), and sws_init_context().

int32_t SwsContext::lumMmxFilter[4 *MAX_FILTER_SIZE]

Definition at line 427 of file swscale_internal.h.

Referenced by swScale().

int16_t** SwsContext::lumPixBuf

Ring buffer for scaled horizontal luma plane lines to be fed to the vertical scaler.

Definition at line 305 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

void(* SwsContext::lumToYV12) (uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal)

Unscaled conversion of luma plane to YV12 for horizontal scaler.

Definition at line 486 of file swscale_internal.h.

Referenced by ff_sws_init_input_funcs(), ff_sws_init_swScale_mmx(), and hyscale().

int SwsContext::lumXInc

Definition at line 277 of file swscale_internal.h.

Referenced by sws_init_context(), and swScale().

int SwsContext::lumYInc

Definition at line 278 of file swscale_internal.h.

Referenced by sws_init_context().

int SwsContext::needs_hcscale

Set if there are chroma planes to be converted.

Definition at line 578 of file swscale_internal.h.

Referenced by sws_init_swScale_c(), and swScale().

uint32_t SwsContext::pal_rgb[256]

Definition at line 293 of file swscale_internal.h.

Referenced by palToRgbWrapper(), and sws_scale().

uint32_t SwsContext::pal_yuv[256]

Definition at line 292 of file swscale_internal.h.

Referenced by sws_scale(), and swScale().

double SwsContext::param[2]

Input parameters for scaling algorithms that need them.

Definition at line 290 of file swscale_internal.h.

Referenced by sws_getCachedContext(), sws_getContext(), and sws_init_context().

void(* SwsContext::readChrPlanar) (uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv)

Definition at line 502 of file swscale_internal.h.

Referenced by ff_sws_init_input_funcs(), and hcscale().

void(* SwsContext::readLumPlanar) (uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv)

Functions to read planar input, such as planar RGB, and convert internally to Y/UV.

Definition at line 501 of file swscale_internal.h.

Referenced by ff_sws_init_input_funcs(), and hyscale().

int SwsContext::saturation

Definition at line 376 of file swscale_internal.h.

Referenced by sws_getColorspaceDetails(), and sws_setColorspaceDetails().

int SwsContext::sliceDir

Direction that slices are fed to the scaler (1 = top-to-bottom, -1 = bottom-to-top).

Definition at line 289 of file swscale_internal.h.

Referenced by sws_scale().

int SwsContext::src0Alpha

Definition at line 381 of file swscale_internal.h.

Referenced by sws_getCachedContext(), sws_getContext(), and sws_scale().

int SwsContext::srcBpc
int SwsContext::srcColorspaceTable[4]

Definition at line 377 of file swscale_internal.h.

Referenced by sws_getColorspaceDetails(), and sws_setColorspaceDetails().

int SwsContext::srcFormatBpp

Number of bits per pixel of the source pixel format.

Definition at line 282 of file swscale_internal.h.

Referenced by ff_get_unscaled_swscale(), findRgbConvFn(), rgbToRgbWrapper(), sws_init_context(), and sws_setColorspaceDetails().

int SwsContext::srcH

Height of source luma/alpha planes.

Definition at line 271 of file swscale_internal.h.

Referenced by doTest(), ff_yuv2rgb_init_altivec(), selfTest(), sws_getCachedContext(), sws_getContext(), sws_init_context(), sws_scale(), and swScale().

int SwsContext::srcRange

0 = MPG YUV range, 1 = JPG YUV range (source image).

Definition at line 379 of file swscale_internal.h.

Referenced by planarCopyWrapper(), sws_getCachedContext(), sws_getColorspaceDetails(), sws_getContext(), sws_init_context(), sws_init_swScale_c(), and sws_setColorspaceDetails().

SwsFunc SwsContext::swScale

Note that src, dst, srcStride, dstStride will be copied in the sws_scale() wrapper so they can be freely modified here.

Definition at line 269 of file swscale_internal.h.

Referenced by ff_bfin_get_unscaled_swscale(), ff_get_unscaled_swscale(), ff_swscale_get_unscaled_altivec(), sws_init_context(), and sws_scale().

int SwsContext::table_gV[256+2 *YUVRGB_TABLE_HEADROOM]
int SwsContext::use_mmx_vfilter

Definition at line 474 of file swscale_internal.h.

Referenced by ff_sws_init_swScale_mmx(), and swScale().

int SwsContext::vChrBufSize

Number of vertical chroma lines allocated in the ring buffer.

Definition at line 310 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int SwsContext::vChrDrop

Binary logarithm of extra vertical subsampling factor in source image chroma planes specified by user.

Definition at line 288 of file swscale_internal.h.

Referenced by sws_init_context(), and swScale().

int16_t* SwsContext::vChrFilter

Array of vertical filter coefficients for chroma planes.

Definition at line 336 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int32_t* SwsContext::vChrFilterPos

Array of vertical filter starting positions for each dst[i] for chroma planes.

Definition at line 340 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int SwsContext::vChrFilterSize

Vertical filter size for chroma pixels.

Definition at line 344 of file swscale_internal.h.

Referenced by sws_init_context(), and swScale().

int SwsContext::vLumBufSize

Number of vertical luma/alpha lines allocated in the ring buffer.

Definition at line 309 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int16_t* SwsContext::vLumFilter

Array of vertical filter coefficients for luma/alpha planes.

Definition at line 335 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), swScale(), and yuv2planeX_16_altivec().

int32_t* SwsContext::vLumFilterPos

Array of vertical filter starting positions for each dst[i] for luma/alpha planes.

Definition at line 339 of file swscale_internal.h.

Referenced by sws_freeContext(), sws_init_context(), and swScale().

int SwsContext::vLumFilterSize

Vertical filter size for luma/alpha pixels.

Definition at line 343 of file swscale_internal.h.

Referenced by sws_init_context(), and swScale().

yuv2anyX_fn SwsContext::yuv2anyX

Definition at line 483 of file swscale_internal.h.

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

yuv2interleavedX_fn SwsContext::yuv2nv12cX

Definition at line 479 of file swscale_internal.h.

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

yuv2packed1_fn SwsContext::yuv2packed1

Definition at line 480 of file swscale_internal.h.

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

yuv2packed2_fn SwsContext::yuv2packed2

Definition at line 481 of file swscale_internal.h.

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

yuv2packedX_fn SwsContext::yuv2packedX
yuv2planar1_fn SwsContext::yuv2plane1

Definition at line 477 of file swscale_internal.h.

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

int SwsContext::yuv2rgb_u2b_coeff
int SwsContext::yuv2rgb_u2g_coeff
int SwsContext::yuv2rgb_v2g_coeff
int SwsContext::yuv2rgb_v2r_coeff
int SwsContext::yuv2rgb_y_offset
void* SwsContext::yuvTable

Definition at line 356 of file swscale_internal.h.

Referenced by ff_yuv2rgb_c_init_tables(), and sws_freeContext().


The documentation for this struct was generated from the following file: