diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-30 18:21:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-03 20:38:29 +0200 |
commit | f80120756879293b66b5ff3d74b2d3fcb052693a (patch) | |
tree | 8d0f4657e37d70a74c3dc47e02a562a413ad75e6 /libswscale | |
parent | 06d67265881249566f385309e2fb5a9449720b6e (diff) | |
download | ffmpeg-f80120756879293b66b5ff3d74b2d3fcb052693a.tar.gz |
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>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index c7069ae7b2..75cde31f4f 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -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); |