[FFmpeg-cvslog] libavcodec/sanm: codec47: apply top offset also to diff buffers
Manuel Lauss
git at videolan.org
Thu Nov 28 15:43:22 EET 2024
ffmpeg | branch: master | Manuel Lauss <manuel.lauss at gmail.com> | Fri Nov 8 12:51:15 2024 +0100| [a786dd4889ec82ddbddd869ad49a767a7b6cc42b] | committer: Anton Khirnov
libavcodec/sanm: codec47: apply top offset also to diff buffers
SAN FRME objects specify width/height as well as offsets from top/left.
These offsets need to be taken into account for the diff buffers
as well. Fixes playback of all SAN videos of "Shadows of the Empire",
which have a constant top offset of 60 (640x272 video on a 640x480 window)
and show tons of ghosting and block artifacts.
Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a786dd4889ec82ddbddd869ad49a767a7b6cc42b
---
libavcodec/sanm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index fcf6234d8a..8bcffb1e90 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -913,8 +913,8 @@ static int old_codec47(SANMVideoContext *ctx, int top,
int i, j;
ptrdiff_t stride = ctx->pitch;
uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride;
- uint8_t *prev1 = (uint8_t *)ctx->frm1;
- uint8_t *prev2 = (uint8_t *)ctx->frm2;
+ uint8_t *prev1 = (uint8_t *)ctx->frm1 + left + top * stride;
+ uint8_t *prev2 = (uint8_t *)ctx->frm2 + left + top * stride;
uint8_t auxcol[2];
int tbl_pos = bytestream2_tell(&ctx->gb);
int seq = bytestream2_get_le16(&ctx->gb);
@@ -940,8 +940,8 @@ static int old_codec47(SANMVideoContext *ctx, int top,
}
if (!seq) {
ctx->prev_seq = -1;
- memset(prev1, auxcol[0], ctx->height * stride);
- memset(prev2, auxcol[1], ctx->height * stride);
+ memset(prev1, auxcol[0], (ctx->height - top) * stride);
+ memset(prev2, auxcol[1], (ctx->height - top) * stride);
}
switch (compr) {
More information about the ffmpeg-cvslog
mailing list