58 if (sliceY & chrSkipMask)
98 uint16_t *lum_filter = inst[0].
filter[0];
99 uint16_t *chr_filter = inst[1].
filter[0];
101 int firstLum =
FFMAX(1-lum_fsize, inst[0].filter_pos[chrSliceY]);
102 int firstChr =
FFMAX(1-chr_fsize, inst[1].filter_pos[chrSliceY]);
116 if (c->
yuv2packed1 && lum_fsize == 1 && chr_fsize <= 2) {
117 int chrAlpha = chr_fsize == 1 ? 0 : chr_filter[2 * sliceY + 1];
118 ((
yuv2packed1_fn)inst->
pfn)(
c, (
const int16_t*)*src0, (
const int16_t**)
src1, (
const int16_t**)src2, (
const int16_t*)(desc->
alpha ? *src3 :
NULL), *dst, dstW, chrAlpha, sliceY);
119 }
else if (c->
yuv2packed2 && lum_fsize == 2 && chr_fsize == 2) {
120 int lumAlpha = lum_filter[2 * sliceY + 1];
121 int chrAlpha = chr_filter[2 * sliceY + 1];
125 c->
chrMmxFilter[3] = chr_filter[2 * chrSliceY] * 0x10001;
126 ((
yuv2packed2_fn)inst->
pfn)(
c, (
const int16_t**)src0, (
const int16_t**)
src1, (
const int16_t**)src2, (
const int16_t**)src3,
127 *dst, dstW, lumAlpha, chrAlpha, sliceY);
130 (
const int16_t**)src0, lum_fsize, chr_filter + sliceY * chr_fsize,
131 (
const int16_t**)
src1, (
const int16_t**)src2, chr_fsize, (
const int16_t**)src3, *dst, dstW, sliceY);
144 uint16_t *lum_filter = inst[0].
filter[0];
145 uint16_t *chr_filter = inst[1].
filter[0];
147 int firstLum =
FFMAX(1-lum_fsize, inst[0].filter_pos[chrSliceY]);
148 int firstChr =
FFMAX(1-chr_fsize, inst[1].filter_pos[chrSliceY]);
170 (
const int16_t**)src0, lum_fsize, chr_filter + sliceY * chr_fsize,
171 (
const int16_t**)
src1, (
const int16_t**)src2, chr_fsize, (
const int16_t**)src3, dst, dstW, sliceY);
241 chrCtx->
isMMX = use_mmx;
244 if (yuv2nv12cX) chrCtx->
pfn = yuv2nv12cX;
246 else chrCtx->
pfn = yuv2planeX;
255 lumCtx->
isMMX = use_mmx;
258 else lumCtx->
pfn = yuv2planeX;
272 lumCtx->
isMMX = use_mmx;
273 chrCtx->
isMMX = use_mmx;
277 lumCtx->
pfn = yuv2packed1;
279 lumCtx->
pfn = yuv2packed2;
281 lumCtx->
pfn = yuv2packedX;
283 lumCtx->
pfn = yuv2anyX;
int16_t ** alpPixBuf
Ring buffer for scaled horizontal alpha plane lines to be fed to the vertical scaler.
void ff_init_vscale_pfn(SwsContext *c, yuv2planar1_fn yuv2plane1, yuv2planarX_fn yuv2planeX, yuv2interleavedX_fn yuv2nv12cX, yuv2packed1_fn yuv2packed1, yuv2packed2_fn yuv2packed2, yuv2packedX_fn yuv2packedX, yuv2anyX_fn yuv2anyX, int use_mmx)
setup vertical scaler functions
int h_chr_sub_sample
horizontal chroma subsampling factor
Struct which holds all necessary data for processing a slice.
int ff_init_vscale(SwsContext *c, SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst)
initializes vertical scaling descriptors
const uint8_t * lumDither8
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 ...
static int any_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
uint8_t ** line
line buffer
int alpha
Flag for processing alpha channel.
int vChrFilterSize
Vertical filter size for chroma pixels.
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...
int v_chr_sub_sample
vertical chroma subsampling factor
SwsSlice * dst
Output slice.
int(* process)(SwsContext *c, struct SwsFilterDescriptor *desc, int sliceY, int sliceH)
Function for processing input slice sliceH lines starting from line sliceY.
enum AVPixelFormat dstFormat
Destination pixel format.
yuv2packedX_fn yuv2packedX
int32_t * vChrFilterPos
Array of vertical filter starting positions for each dst[i] for chroma planes.
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 v...
yuv2packed1_fn yuv2packed1
SwsPlane plane[MAX_SLICE_PLANES]
color planes
int32_t alpMmxFilter[4 *MAX_FILTER_SIZE]
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 (...
ptrdiff_t uv_offx2
offset (in bytes) between u and v planes
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
yuv2planar1_fn yuv2plane1
yuv2interleavedX_fn yuv2nv12cX
#define FF_CEIL_RSHIFT(a, b)
struct SwsFilterDescriptor * desc
int32_t * vLumFilterPos
Array of vertical filter starting positions for each dst[i] for luma/alpha planes.
static int lum_planar_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
int32_t lumMmxFilter[4 *MAX_FILTER_SIZE]
static int packed_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
int width
Slice line width.
yuv2planarX_fn yuv2planeX
Struct which defines a slice of an image to be scaled or a output for a scaled slice.
int vLumFilterSize
Vertical filter size for luma/alpha pixels.
static av_always_inline int isPlanarYUV(enum AVPixelFormat pix_fmt)
int16_t * vChrFilter
Array of vertical filter coefficients for chroma planes.
void * instance
Filter instance data.
const uint8_t * chrDither8
yuv2packed2_fn yuv2packed2
static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
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...
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 scalin...
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 ver...
int32_t chrMmxFilter[4 *MAX_FILTER_SIZE]
static void * av_mallocz_array(size_t nmemb, size_t size)
int16_t * vLumFilter
Array of vertical filter coefficients for luma/alpha planes.
SwsSlice * src
Source slice.
int sliceY
index of first line
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int chr_planar_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)