76 if (sliceY & chrSkipMask)
116 uint16_t *lum_filter = inst[0].
filter[0];
117 uint16_t *chr_filter = inst[1].
filter[0];
134 if (c->
yuv2packed1 && lum_fsize == 1 && chr_fsize == 1) {
135 inst->
pfn.
yuv2packed1(c, (
const int16_t*)*src0, (
const int16_t**)src1, (
const int16_t**)src2,
136 (
const int16_t*)(desc->
alpha ? *src3 :
NULL), *dst, dstW, 0, sliceY);
137 }
else if (c->
yuv2packed1 && lum_fsize == 1 && chr_fsize == 2 &&
138 chr_filter[2 * chrSliceY + 1] + chr_filter[2 * chrSliceY] == 4096 &&
139 chr_filter[2 * chrSliceY + 1] <= 4096
U) {
140 int chrAlpha = chr_filter[2 * chrSliceY + 1];
141 inst->
pfn.
yuv2packed1(c, (
const int16_t*)*src0, (
const int16_t**)src1, (
const int16_t**)src2,
142 (
const int16_t*)(desc->
alpha ? *src3 :
NULL), *dst, dstW, chrAlpha, sliceY);
143 }
else if (c->
yuv2packed2 && lum_fsize == 2 && chr_fsize == 2 &&
144 lum_filter[2 * sliceY + 1] + lum_filter[2 * sliceY] == 4096 &&
145 lum_filter[2 * sliceY + 1] <= 4096
U &&
146 chr_filter[2 * chrSliceY + 1] + chr_filter[2 * chrSliceY] == 4096 &&
147 chr_filter[2 * chrSliceY + 1] <= 4096
U 149 int lumAlpha = lum_filter[2 * sliceY + 1];
150 int chrAlpha = chr_filter[2 * chrSliceY + 1];
154 c->
chrMmxFilter[3] = chr_filter[2 * chrSliceY] * 0x10001;
155 inst->
pfn.
yuv2packed2(c, (
const int16_t**)src0, (
const int16_t**)src1, (
const int16_t**)src2, (
const int16_t**)src3,
156 *dst, dstW, lumAlpha, chrAlpha, sliceY);
158 if ((c->
yuv2packed1 && lum_fsize == 1 && chr_fsize == 2) ||
159 (c->
yuv2packed2 && lum_fsize == 2 && chr_fsize == 2)) {
165 inst->
yuv2packedX(c, lum_filter + sliceY * lum_fsize,
166 (
const int16_t**)src0, lum_fsize, chr_filter + chrSliceY * chr_fsize,
167 (
const int16_t**)src1, (
const int16_t**)src2, chr_fsize, (
const int16_t**)src3, *dst, dstW, sliceY);
180 uint16_t *lum_filter = inst[0].
filter[0];
181 uint16_t *chr_filter = inst[1].
filter[0];
205 inst->
pfn.
yuv2anyX(c, lum_filter + sliceY * lum_fsize,
206 (
const int16_t**)src0, lum_fsize, chr_filter + sliceY * chr_fsize,
207 (
const int16_t**)src1, (
const int16_t**)src2, chr_fsize, (
const int16_t**)src3, dst, dstW, sliceY);
277 chrCtx->
isMMX = use_mmx;
291 lumCtx->
isMMX = use_mmx;
308 lumCtx->
isMMX = use_mmx;
309 chrCtx->
isMMX = use_mmx;
union VScalerContext::@320 pfn
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.
yuv2planarX_fn yuv2planarX
int ff_init_vscale(SwsContext *c, SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst)
initializes vertical scaling descriptors
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const uint8_t * lumDither8
yuv2planar1_fn yuv2planar1
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.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int v_chr_sub_sample
vertical chroma subsampling factor
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But first
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
SwsPlane plane[MAX_SLICE_PLANES]
color planes
int32_t alpMmxFilter[4 *MAX_FILTER_SIZE]
yuv2packed1_fn yuv2packed1
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
yuv2interleavedX_fn yuv2interleavedX
yuv2packed2_fn yuv2packed2
static void FUNC() yuv2planeX(const int16_t *filter, int filterSize, const int16_t **src, uint8_t *dest, int dstW, const uint8_t *dither, int offset)
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(* 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
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
void(* yuv2interleavedX_fn)(enum AVPixelFormat dstFormat, const uint8_t *chrDither, 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 ...
yuv2packed2_fn yuv2packed2
static int chr_planar_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
void * av_mallocz_array(size_t nmemb, size_t size)
#define AV_CEIL_RSHIFT(a, b)