History

avcodec/sanm: codec37: reimplement comp4

Compression 4 code 0 means copy from delta buffer without mv, AND start of a skip run. This gets rid of the extra case and column index manipulation and implements this as it is implemented in the original game exe, i.e. as a special case for after mv copy.

Manuel Lauss committed 1 year ago

Commit 8a045261 parent fb951b21 file · +6 −5Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/sanm.c+6−5
@@ -1106,16 +1106,17 @@ static int old_codec37(SANMVideoContext *ctx, int width, int height) · 1105 unmodified lines
11061106 t = bytestream2_get_byteu(&ctx->gb);
11071107 for (k = 0; k < 4; k++)
11081108 memset(dst + i + k * stride, t, 4);
1109− } else if ((compr == 4) && (code == 0)) {
1110− if (bytestream2_get_bytes_left(&ctx->gb) < 1)
1111− return AVERROR_INVALIDDATA;
1112− skip_run = bytestream2_get_byteu(&ctx->gb) + 1;
1113− i -= 4;
11141109 } else {
11151110 mx = c37_mv[(mvoff * 255 + code) * 2];
11161111 my = c37_mv[(mvoff * 255 + code) * 2 + 1];
11171112 codec37_mv(dst + i, prev + i + mx + my * stride,
11181113 ctx->height, stride, i + mx, j + my);
1114+
1115+ if ((compr == 4) && (code == 0)) {
1116+ if (bytestream2_get_bytes_left(&ctx->gb) < 1)
1117+ return AVERROR_INVALIDDATA;
1118+ skip_run = bytestream2_get_byteu(&ctx->gb);
1119+ }
11191120 }
11201121 }
11211122 dst += stride * 4;

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