36 int dstW =
desc->dst->width;
40 int dp = sliceY -
desc->dst->plane[0].sliceY;
52 int dp = sliceY -
desc->dst->plane[3].sliceY;
68 const int chrSkipMask = (1 <<
desc->dst->v_chr_sub_sample) - 1;
69 if (sliceY & chrSkipMask)
74 int chrSliceY = sliceY >>
desc->dst->v_chr_sub_sample;
77 int sp1 =
first -
desc->src->plane[1].sliceY;
78 int sp2 =
first -
desc->src->plane[2].sliceY;
79 int dp1 = chrSliceY -
desc->dst->plane[1].sliceY;
80 int dp2 = chrSliceY -
desc->dst->plane[2].sliceY;
104 int dstW =
desc->dst->width;
105 int chrSliceY = sliceY >>
desc->dst->v_chr_sub_sample;
109 uint16_t *lum_filter = inst[0].
filter[0];
110 uint16_t *chr_filter = inst[1].
filter[0];
112 int firstLum =
FFMAX(1-lum_fsize, inst[0].filter_pos[ sliceY]);
113 int firstChr =
FFMAX(1-chr_fsize, inst[1].filter_pos[chrSliceY]);
115 int sp0 = firstLum -
desc->src->plane[0].sliceY;
116 int sp1 = firstChr -
desc->src->plane[1].sliceY;
117 int sp2 = firstChr -
desc->src->plane[2].sliceY;
118 int sp3 = firstLum -
desc->src->plane[3].sliceY;
119 int dp = sliceY -
desc->dst->plane[0].sliceY;
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];
145 c->lumMmxFilter[3] = lum_filter[2 * sliceY] * 0x10001;
147 c->chrMmxFilter[3] = chr_filter[2 * chrSliceY] * 0x10001;
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)) {
153 if (!
c->warned_unuseable_bilinear)
155 c->warned_unuseable_bilinear = 1;
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);
168 int dstW =
desc->dst->width;
169 int chrSliceY = sliceY >>
desc->dst->v_chr_sub_sample;
173 uint16_t *lum_filter = inst[0].
filter[0];
174 uint16_t *chr_filter = inst[1].
filter[0];
176 int firstLum =
FFMAX(1-lum_fsize, inst[0].filter_pos[ sliceY]);
177 int firstChr =
FFMAX(1-chr_fsize, inst[1].filter_pos[chrSliceY]);
179 int sp0 = firstLum -
desc->src->plane[0].sliceY;
180 int sp1 = firstChr -
desc->src->plane[1].sliceY;
181 int sp2 = firstChr -
desc->src->plane[2].sliceY;
182 int sp3 = firstLum -
desc->src->plane[3].sliceY;
183 int dp0 = sliceY -
desc->dst->plane[0].sliceY;
184 int dp1 = chrSliceY -
desc->dst->plane[1].sliceY;
185 int dp2 = chrSliceY -
desc->dst->plane[2].sliceY;
186 int dp3 = sliceY -
desc->dst->plane[3].sliceY;
193 desc->dst->plane[1].line[dp1],
194 desc->dst->plane[2].line[dp2],
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);
218 desc[0].instance = lumCtx;
221 desc[0].alpha =
c->needAlpha;
228 desc[1].instance = chrCtx;
239 desc[0].instance = lumCtx;
242 desc[0].alpha =
c->needAlpha;
246 c->yuv2packed1,
c->yuv2packed2,
c->yuv2packedX,
c->yuv2anyX,
c->use_mmx_vfilter);
261 int idx =
c->numDesc - (
c->is_internal_gamma ? 2 : 1);
265 chrCtx =
c->desc[idx].instance;
267 chrCtx->
filter[0] = use_mmx ? (int16_t*)
c->chrMmxFilter :
c->vChrFilter;
270 chrCtx->
isMMX = use_mmx;
273 if (yuv2nv12cX) chrCtx->
pfn = yuv2nv12cX;
274 else if (
c->vChrFilterSize == 1) chrCtx->
pfn = yuv2plane1;
278 lumCtx =
c->desc[idx].instance;
280 lumCtx->
filter[0] = use_mmx ? (int16_t*)
c->lumMmxFilter :
c->vLumFilter;
281 lumCtx->
filter[1] = use_mmx ? (int16_t*)
c->alpMmxFilter :
c->vLumFilter;
284 lumCtx->
isMMX = use_mmx;
286 if (
c->vLumFilterSize == 1) lumCtx->
pfn = yuv2plane1;
290 lumCtx =
c->desc[idx].instance;
293 lumCtx->
filter[0] =
c->vLumFilter;
297 chrCtx->
filter[0] =
c->vChrFilter;
301 lumCtx->
isMMX = use_mmx;
302 chrCtx->
isMMX = use_mmx;
305 if (
c->yuv2packed1 &&
c->vLumFilterSize == 1 &&
c->vChrFilterSize <= 2)
306 lumCtx->
pfn = yuv2packed1;
307 else if (
c->yuv2packed2 &&
c->vLumFilterSize == 2 &&
c->vChrFilterSize == 2)
308 lumCtx->
pfn = yuv2packed2;
311 lumCtx->
pfn = yuv2anyX;