History

libavcodec/sanm: clear codec47 diff buffers with specific color

The codec47 header provides colors to use to clear the 2 difference buffers. This fixes artifacts (black hair, faces) in Curse of Monkey Island "CURSERNG.SAN" video.

Manuel Lauss committed 2 years ago

Commit dc98e791 parent 85fec8d1 file · +6 −3Browse files

Unified · Split

libavcodec/sanm.c+6−3
@@ -915,13 +915,16 @@ static int old_codec47(SANMVideoContext *ctx, int top, · 914 unmodified lines
915915 uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride;
916916 uint8_t *prev1 = (uint8_t *)ctx->frm1;
917917 uint8_t *prev2 = (uint8_t *)ctx->frm2;
918+ uint8_t auxcol[2];
918919 int tbl_pos = bytestream2_tell(&ctx->gb);
919920 int seq = bytestream2_get_le16(&ctx->gb);
920921 int compr = bytestream2_get_byte(&ctx->gb);
921922 int new_rot = bytestream2_get_byte(&ctx->gb);
922923 int skip = bytestream2_get_byte(&ctx->gb);
923924
924− bytestream2_skip(&ctx->gb, 9);
925+ bytestream2_skip(&ctx->gb, 7);
926+ auxcol[0] = bytestream2_get_byteu(&ctx->gb);
927+ auxcol[1] = bytestream2_get_byteu(&ctx->gb);
925928 decoded_size = bytestream2_get_le32(&ctx->gb);
926929 bytestream2_skip(&ctx->gb, 8);
927930
@@ -937,8 +940,8 @@ static int old_codec47(SANMVideoContext *ctx, int top, · 9 unmodified lines
937940 }
938941 if (!seq) {
939942 ctx->prev_seq = -1;
940− memset(prev1, 0, ctx->height * stride);
941− memset(prev2, 0, ctx->height * stride);
943+ memset(prev1, auxcol[0], ctx->height * stride);
944+ memset(prev2, auxcol[1], ctx->height * stride);
942945 }
943946
944947 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