swscale/swscale: Pass slice location into unscaled code also for dst scaling

Fixes: alphablend=checkerboard

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-09-30 18:21:47 +02:00
parent 06d6726588
commit f801207568
1 changed files with 10 additions and 2 deletions

View File

@ -1020,7 +1020,7 @@ static int scale_internal(SwsContext *c,
int offset = srcSliceY_internal;
int slice_h = srcSliceH;
// for dst slice scaling, offset the src pointers to match the dst slice
// for dst slice scaling, offset the pointers to match the unscaled API
if (scale_dst) {
av_assert0(offset == 0);
for (i = 0; i < 4 && src2[i]; i++) {
@ -1028,12 +1028,20 @@ static int scale_internal(SwsContext *c,
break;
src2[i] += (dstSliceY >> ((i == 1 || i == 2) ? c->chrSrcVSubSample : 0)) * srcStride2[i];
}
offset = 0;
for (i = 0; i < 4 && dst2[i]; i++) {
if (!dst2[i] || (i > 0 && usePal(c->dstFormat)))
break;
dst2[i] -= (dstSliceY >> ((i == 1 || i == 2) ? c->chrDstVSubSample : 0)) * dstStride2[i];
}
offset = dstSliceY;
slice_h = dstSliceH;
}
ret = c->convert_unscaled(c, src2, srcStride2, offset, slice_h,
dst2, dstStride2);
if (scale_dst)
dst2[0] += dstSliceY * dstStride2[0];
} else {
ret = swscale(c, src2, srcStride2, srcSliceY_internal, srcSliceH,
dst2, dstStride2, dstSliceY, dstSliceH);