[FFmpeg-devel] [PATCH v2 12/13] avcodec/sanm: ignore codec45
Manuel Lauss
manuel.lauss at gmail.com
Sat Mar 15 11:32:19 EET 2025
Codec45 is used in some RA2 videos on top of codec37.
It consists of 2 tables (768 and 32768 bytes), and datapackets
like codec2 (delta-x, delta-y) with a pixel counter instead of a color value.
It then reads the 4 surrounding pixels, looks up 3 separate values
for each in table1, adds them together to form an index into
table2 for a new pixel value, in a row.
The data coming in gets the x/y coordinates out of the visible
area very quickly (2-3 iterations); I don't see any visual
difference between the ffmpeg-produced frames and ones captured
with dosbox from rebel assault 2, which leads me to believe this
codec never worked as intended.
Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
---
v2: newly added.
libavcodec/sanm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index b86f67c3bf..7e39c5eeb0 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -1676,6 +1676,8 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
return old_codec23(ctx, gb, top, left, w, h, param, parm2);
case 37:
return old_codec37(ctx, w, h);
+ case 45:
+ return 0;
case 47:
return old_codec47(ctx, w, h);
case 48:
--
2.48.1
More information about the ffmpeg-devel
mailing list