69 if (sliceY & chrSkipMask)
109 uint16_t *lum_filter = inst[0].
filter[0];
110 uint16_t *chr_filter = inst[1].
filter[0];
127 if (c->
yuv2packed1 && lum_fsize == 1 && chr_fsize == 1) {
129 (
const int16_t*)(desc->
alpha ? *src3 :
NULL), *dst, dstW, 0, sliceY);
130 }
else if (c->
yuv2packed1 && lum_fsize == 1 && chr_fsize == 2 &&
131 chr_filter[2 * chrSliceY + 1] + chr_filter[2 * chrSliceY] == 4096 &&
132 chr_filter[2 * chrSliceY + 1] <= 4096
U) {
133 int chrAlpha = chr_filter[2 * chrSliceY + 1];
135 (
const int16_t*)(desc->
alpha ? *src3 :
NULL), *dst, dstW, chrAlpha, sliceY);
136 }
else if (c->
yuv2packed2 && lum_fsize == 2 && chr_fsize == 2 &&
137 lum_filter[2 * sliceY + 1] + lum_filter[2 * sliceY] == 4096 &&
138 lum_filter[2 * sliceY + 1] <= 4096
U &&
139 chr_filter[2 * chrSliceY + 1] + chr_filter[2 * chrSliceY] == 4096 &&
140 chr_filter[2 * chrSliceY + 1] <= 4096
U 142 int lumAlpha = lum_filter[2 * sliceY + 1];
143 int chrAlpha = chr_filter[2 * chrSliceY + 1];
147 c->
chrMmxFilter[3] = chr_filter[2 * chrSliceY] * 0x10001;
148 ((
yuv2packed2_fn)inst->
pfn)(
c, (
const int16_t**)src0, (
const int16_t**)
src1, (
const int16_t**)src2, (
const int16_t**)src3,
149 *dst, dstW, lumAlpha, chrAlpha, sliceY);
151 if ((c->
yuv2packed1 && lum_fsize == 1 && chr_fsize == 2) ||
152 (c->
yuv2packed2 && lum_fsize == 2 && chr_fsize == 2)) {
158 inst->
yuv2packedX(c, lum_filter + sliceY * lum_fsize,
159 (
const int16_t**)src0, lum_fsize, chr_filter + chrSliceY * chr_fsize,
160 (
const int16_t**)src1, (
const int16_t**)src2, chr_fsize, (
const int16_t**)src3, *dst, dstW, sliceY);
173 uint16_t *lum_filter = inst[0].
filter[0];
174 uint16_t *chr_filter = inst[1].
filter[0];
199 (
const int16_t**)src0, lum_fsize, chr_filter + sliceY * chr_fsize,
200 (
const int16_t**)
src1, (
const int16_t**)src2, chr_fsize, (
const int16_t**)src3, dst, dstW, sliceY);
270 chrCtx->
isMMX = use_mmx;
273 if (yuv2nv12cX) chrCtx->
pfn = yuv2nv12cX;
275 else chrCtx->
pfn = yuv2planeX;
284 lumCtx->
isMMX = use_mmx;
287 else lumCtx->
pfn = yuv2planeX;
301 lumCtx->
isMMX = use_mmx;
302 chrCtx->
isMMX = use_mmx;
306 lumCtx->
pfn = yuv2packed1;
308 lumCtx->
pfn = yuv2packed2;
311 lumCtx->
pfn = yuv2anyX;
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
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.
int v_chr_sub_sample
vertical chroma subsampling factor
SwsSlice * dst
Output slice.
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 (...
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.
yuv2packed1_fn yuv2packed1
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
SwsPlane plane[MAX_SLICE_PLANES]
color planes
int32_t alpMmxFilter[4 *MAX_FILTER_SIZE]
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
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)
#define AV_LOG_INFO
Standard information.
int width
Slice line width.
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...
int(* process)(SwsContext *c, struct SwsFilterDescriptor *desc, int sliceY, int sliceH)
Function for processing input slice sliceH lines starting from line sliceY.
yuv2planarX_fn yuv2planeX
int warned_unuseable_bilinear
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...
Struct which defines a slice of an image to be scaled or an output for a scaled slice.
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...
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
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...
int32_t chrMmxFilter[4 *MAX_FILTER_SIZE]
yuv2packedX_fn yuv2packedX
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 ...
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...
int16_t * vLumFilter
Array of vertical filter coefficients for luma/alpha planes.
SwsSlice * src
Source slice.
int sliceY
index of first line
static int chr_planar_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
#define AV_CEIL_RSHIFT(a, b)