History

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.

Manuel Lauss committed 2 years ago

Commit a786dd41 parent dc98e791 file · +4 −4Browse files

Unified · Split

libavcodec/sanm.c+4−4
@@ -913,8 +913,8 @@ static int old_codec47(SANMVideoContext *ctx, int top, · 912 unmodified lines
913913 int i, j;
914914 ptrdiff_t stride = ctx->pitch;
915915 uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride;
916− uint8_t *prev1 = (uint8_t *)ctx->frm1;
917− uint8_t *prev2 = (uint8_t *)ctx->frm2;
916+ uint8_t *prev1 = (uint8_t *)ctx->frm1 + left + top * stride;
917+ uint8_t *prev2 = (uint8_t *)ctx->frm2 + left + top * stride;
918918 uint8_t auxcol[2];
919919 int tbl_pos = bytestream2_tell(&ctx->gb);
920920 int seq = bytestream2_get_le16(&ctx->gb);
@@ -940,8 +940,8 @@ static int old_codec47(SANMVideoContext *ctx, int top, · 19 unmodified lines
940940 }
941941 if (!seq) {
942942 ctx->prev_seq = -1;
943− memset(prev1, auxcol[0], ctx->height * stride);
944− memset(prev2, auxcol[1], ctx->height * stride);
943+ memset(prev1, auxcol[0], (ctx->height - top) * stride);
944+ memset(prev2, auxcol[1], (ctx->height - top) * stride);
945945 }
946946
947947 switch (compr) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t