diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-05-21 15:44:49 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-07-03 16:13:40 +0200 |
commit | 37c0fe49b70ce5f18b67dc7b7578900a684bd0b0 (patch) | |
tree | db4dc651b635e8ca6b8b307d5dcb531107dcd0c5 | |
parent | d6649d9a3badfae00b8735e6d8628ab2b856dccd (diff) | |
download | ffmpeg-37c0fe49b70ce5f18b67dc7b7578900a684bd0b0.tar.gz |
sws: move updating the palette higher up
It does not interact in any way with the code setting up the image
pointers/strides, so it should not be intermixed with it.
-rw-r--r-- | libswscale/swscale.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index d2286357b3..61dfcb4dff 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -911,6 +911,9 @@ int attribute_align_arg sws_scale(struct SwsContext *c, for (i = 0; i < 4; i++) memset(c->dither_error[i], 0, sizeof(c->dither_error[0][0]) * (c->dstW+2)); + if (usePal(c->srcFormat)) + update_palette(c, (const uint32_t *)srcSlice[1]); + memcpy(src2, srcSlice, sizeof(src2)); memcpy(dst2, dst, sizeof(dst2)); memcpy(srcStride2, srcStride, sizeof(srcStride2)); @@ -925,9 +928,6 @@ int attribute_align_arg sws_scale(struct SwsContext *c, c->sliceDir = (srcSliceY == 0) ? 1 : -1; } - if (usePal(c->srcFormat)) - update_palette(c, (const uint32_t *)srcSlice[1]); - if (c->src0Alpha && !c->dst0Alpha && isALPHA(c->dstFormat)) { uint8_t *base; int x,y; |