[Scummvm-git-logs] scummvm master -> 357a8b8b812dc3424be43e3ab68021a59f5261c4

Scorpeg noreply at scummvm.org
Mon Sep 21 20:50:50 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
357a8b8b81 VIDEO: Fix big-endian mcdc pair for 4xm


Commit: 357a8b8b812dc3424be43e3ab68021a59f5261c4
    https://github.com/scummvm/scummvm/commit/357a8b8b812dc3424be43e3ab68021a59f5261c4
Author: Scorp (scorp at mrs.mn)
Date: 2026-09-21T23:50:42+03:00

Commit Message:
VIDEO: Fix big-endian mcdc pair for 4xm

Changed paths:
    video/4xm_decoder.cpp


diff --git a/video/4xm_decoder.cpp b/video/4xm_decoder.cpp
index bfb6dbf0e8b..5b89e25aab1 100644
--- a/video/4xm_decoder.cpp
+++ b/video/4xm_decoder.cpp
@@ -1340,6 +1340,13 @@ void FourXMDecoder::FourXMVideoTrack::decode_ifrm(Common::SeekableReadStream *st
 
 namespace {
 
+static inline void addMCDCPair(uint16 *dst, const uint16 *src, uint32 dc) {
+	uint32 pixels = src[0] | (uint32(src[1]) << 16);
+	pixels += dc;
+	dst[0] = pixels;
+	dst[1] = pixels >> 16;
+}
+
 template<bool Scale>
 void mcdc(uint16_t *dst, const uint16_t *src, int log2w,
 		  int log2h, int stride, uint dc) {
@@ -1349,14 +1356,14 @@ void mcdc(uint16_t *dst, const uint16_t *src, int log2w,
 		for (int i = 0; i < h; ++i) {
 			switch (log2w) {
 			case 3:
-				WRITE_UINT32(dst + 4, READ_UINT32(src + 4) + dc);
-				WRITE_UINT32(dst + 6, READ_UINT32(src + 6) + dc);
+				addMCDCPair(dst + 4, src + 4, dc);
+				addMCDCPair(dst + 6, src + 6, dc);
 				// fall through
 			case 2:
-				WRITE_UINT32(dst + 2, READ_UINT32(src + 2) + dc);
+				addMCDCPair(dst + 2, src + 2, dc);
 				// fall through
 			case 1:
-				WRITE_UINT32(dst, READ_UINT32(src) + dc);
+				addMCDCPair(dst, src, dc);
 				break;
 			case 0:
 				*dst = *src + dc;




More information about the Scummvm-git-logs mailing list