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
915 uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride;915 uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride;
916 uint8_t *prev1 = (uint8_t *)ctx->frm1;916 uint8_t *prev1 = (uint8_t *)ctx->frm1;
917 uint8_t *prev2 = (uint8_t *)ctx->frm2;917 uint8_t *prev2 = (uint8_t *)ctx->frm2;
918 uint8_t auxcol[2];
918 int tbl_pos = bytestream2_tell(&ctx->gb);919 int tbl_pos = bytestream2_tell(&ctx->gb);
919 int seq = bytestream2_get_le16(&ctx->gb);920 int seq = bytestream2_get_le16(&ctx->gb);
920 int compr = bytestream2_get_byte(&ctx->gb);921 int compr = bytestream2_get_byte(&ctx->gb);
921 int new_rot = bytestream2_get_byte(&ctx->gb);922 int new_rot = bytestream2_get_byte(&ctx->gb);
922 int skip = bytestream2_get_byte(&ctx->gb);923 int skip = bytestream2_get_byte(&ctx->gb);
923 924
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);
925 decoded_size = bytestream2_get_le32(&ctx->gb);928 decoded_size = bytestream2_get_le32(&ctx->gb);
926 bytestream2_skip(&ctx->gb, 8);929 bytestream2_skip(&ctx->gb, 8);
927 930
@@ -937,8 +940,8 @@ static int old_codec47(SANMVideoContext *ctx, int top, · 9 unmodified lines
937 }940 }
938 if (!seq) {941 if (!seq) {
939 ctx->prev_seq = -1;942 ctx->prev_seq = -1;
940 memset(prev1, 0, ctx->height * stride);943 memset(prev1, auxcol[0], ctx->height * stride);
941 memset(prev2, 0, ctx->height * stride);944 memset(prev2, auxcol[1], ctx->height * stride);
942 }945 }
943 946
944 switch (compr) {947 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