[Scummvm-git-logs] scummvm master -> 94d960597e8e9a6d41edec83239465d0706fece0

sev- noreply at scummvm.org
Fri May 3 22:06:20 UTC 2024


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

Summary:
f55925e58a IMAGE: INDEO3: Reduce the size of _corrector_type
67fc0b6b7d IMAGE: INDEO3: Make more use of aligned loads
94d960597e IMAGE: Whitespace fixes


Commit: f55925e58a8541b69c72171486d9ba4c98b50d08
    https://github.com/scummvm/scummvm/commit/f55925e58a8541b69c72171486d9ba4c98b50d08
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-05-04T00:06:15+02:00

Commit Message:
IMAGE: INDEO3: Reduce the size of _corrector_type

Changed paths:
    image/codecs/indeo3.cpp
    image/codecs/indeo3.h


diff --git a/image/codecs/indeo3.cpp b/image/codecs/indeo3.cpp
index dc5f31886ee..edb9740f844 100644
--- a/image/codecs/indeo3.cpp
+++ b/image/codecs/indeo3.cpp
@@ -107,7 +107,7 @@ void Indeo3Decoder::buildModPred() {
 		_ModPred[i+7*128] =                   2*((i + 5) - ((i + 4) % 9));
 	}
 
-	_corrector_type = new uint16[24 * 256];
+	_corrector_type = new byte[24 * 256];
 
 	for (int i = 0; i < 24; i++) {
 		for (int j = 0; j < 256; j++) {
@@ -393,7 +393,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 	byte *cur_frm_pos, *ref_frm_pos, *cp, *cp2;
 	uint32 *cur_lp, *ref_lp;
 	const uint32 *correction_lp[2], *correctionloworder_lp[2], *correctionhighorder_lp[2];
-	uint16 *correction_type_sp[2];
+	byte *correction_type_sp[2];
 	ustr_t strip_tbl[20], *strip;
 	int i, j, k, lp1, lp2, flag1, cmd;
 	int blks_width, blks_height, region_160_width;
@@ -1191,13 +1191,13 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 // static data
 
-const int Indeo3Decoder::_corrector_type_0[24] = {
+const byte Indeo3Decoder::_corrector_type_0[24] = {
 	195, 159, 133, 115, 101,  93,  87,  77,
 	195, 159, 133, 115, 101,  93,  87,  77,
 	128,  79,  79,  79,  79,  79,  79,  79
 };
 
-const int Indeo3Decoder::_corrector_type_2[8] = { 9, 7, 6, 8, 5, 4, 3, 2 };
+const byte Indeo3Decoder::_corrector_type_2[8] = { 9, 7, 6, 8, 5, 4, 3, 2 };
 
 const uint32 Indeo3Decoder::correction[] = {
 	0x00000000, 0x00000202, 0xfffffdfe, 0x000002ff, 0xfffffd01, 0xffffff03, 0x000000fd, 0x00000404,
diff --git a/image/codecs/indeo3.h b/image/codecs/indeo3.h
index d223c1b3de6..5ca0c4d45c9 100644
--- a/image/codecs/indeo3.h
+++ b/image/codecs/indeo3.h
@@ -61,8 +61,8 @@ private:
 	uint16 _height;
 	Graphics::PixelFormat _pixelFormat;
 
-	static const int _corrector_type_0[24];
-	static const int _corrector_type_2[8];
+	static const byte _corrector_type_0[24];
+	static const byte _corrector_type_2[8];
 	static const uint32 correction[];
 	static const uint32 correctionloworder[];
 	static const uint32 correctionhighorder[];
@@ -82,7 +82,7 @@ private:
 	YUVBufs *_ref_frame;
 
 	byte *_ModPred;
-	uint16 *_corrector_type;
+	byte *_corrector_type;
 
 	void buildModPred();
 	void allocFrames();


Commit: 67fc0b6b7d0f409a5562d934a9180aadb1c24427
    https://github.com/scummvm/scummvm/commit/67fc0b6b7d0f409a5562d934a9180aadb1c24427
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-05-04T00:06:15+02:00

Commit Message:
IMAGE: INDEO3: Make more use of aligned loads

Changed paths:
    image/codecs/indeo3.cpp


diff --git a/image/codecs/indeo3.cpp b/image/codecs/indeo3.cpp
index edb9740f844..508ae6be44e 100644
--- a/image/codecs/indeo3.cpp
+++ b/image/codecs/indeo3.cpp
@@ -382,6 +382,28 @@ typedef struct {
 	}                     \
 	lp2 = 4;
 
+#define COPY_4_PIXELS(dst, src, count, pitch) \
+	if (IS_ALIGNED(src, 4)) { \
+		for (i = 0, j = 0; i < count; i++, j += pitch) \
+			dst[j] = src[j]; \
+	} else { \
+		for (i = 0, j = 0; i < count; i++, j += pitch) \
+			dst[j] = READ_UINT32(src+j); \
+	}
+
+#define COPY_8_PIXELS(dst, src, count, pitch) \
+	if (IS_ALIGNED(src, 4)) { \
+		for (i = 0, j = 0; i < count; i++, j += pitch) {\
+			dst[j] = src[j]; \
+			dst[j+1] = src[j+1]; \
+		} \
+	} else { \
+		for (i = 0, j = 0; i < count; i++, j += pitch) { \
+			dst[j] = READ_UINT32(src+j); \
+			dst[j+1] = READ_UINT32(src+j+1); \
+		} \
+	}
+
 void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 		const byte *buf1, uint32 fflags2, const byte *hdr,
 		const byte *buf2, int min_width_160) {
@@ -390,7 +412,8 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 	uint32 bit_pos, lv, lv1, lv2;
 	int32 *width_tbl, width_tbl_arr[10];
 	const int8 *ref_vectors;
-	byte *cur_frm_pos, *ref_frm_pos, *cp, *cp2;
+	uint32 *cur_frm_pos, *ref_frm_pos;
+	byte *cp, *cp2;
 	uint32 *cur_lp, *ref_lp;
 	const uint32 *correction_lp[2], *correctionloworder_lp[2], *correctionhighorder_lp[2];
 	byte *correction_type_sp[2];
@@ -402,7 +425,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 	if ((width & 3) != 0) {
 		// This isn't a valid width according to http://wiki.multimedia.cx/index.php?title=Indeo_3
-		warning("Indeo3 file with width not divisible by 4. This will cause unaligned writes");
+		error("Indeo3 file with width not divisible by 4. This will cause unaligned writes");
 	}
 
 	bit_buf = 0;
@@ -468,7 +491,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 			}
 		}
 
-		cur_frm_pos = cur + width * strip->ypos + strip->xpos;
+		cur_frm_pos = (uint32 *)(cur + width * strip->ypos + strip->xpos);
 
 		if ((blks_width = strip->width) < 0)
 			blks_width += 3;
@@ -476,10 +499,11 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 		blks_height = strip->height;
 
 		if (ref_vectors != NULL) {
-			ref_frm_pos = ref + (ref_vectors[0] + strip->ypos) * width +
-				ref_vectors[1] + strip->xpos;
+			/* This may not be aligned, so is accessed using functions like READ_UINT32 */
+			ref_frm_pos = (uint32 *)(ref + (ref_vectors[0] + strip->ypos) * width +
+				ref_vectors[1] + strip->xpos);
 		} else
-			ref_frm_pos = cur_frm_pos - width_tbl[4];
+			ref_frm_pos = (uint32 *)(((byte *)cur_frm_pos) - width_tbl[4]);
 
 		if (cmd == 2) {
 			if (bit_pos <= 0) {
@@ -492,10 +516,9 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 			if (cmd == 0 || ref_vectors != NULL) {
 				for (lp1 = 0; lp1 < blks_width; lp1++) {
-					for (i = 0, j = 0; i < blks_height; i++, j += width_tbl[1])
-						((uint32 *)cur_frm_pos)[j] = READ_UINT32(((uint32 *)ref_frm_pos)+j);
-					cur_frm_pos += 4;
-					ref_frm_pos += 4;
+					COPY_4_PIXELS(cur_frm_pos, ref_frm_pos, blks_height, width_tbl[1]);
+					cur_frm_pos++;
+					ref_frm_pos++;
 				}
 			} else if (cmd != 1)
 				return;
@@ -507,7 +530,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 			if ((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) {
 				cp2 = _ModPred + ((lv - 8) << 7);
-				cp = ref_frm_pos;
+				cp = (byte *)ref_frm_pos;
 				for (i = 0; i < blks_width << 2; i++) {
 						int v = *cp >> 1;
 						*(cp++) = cp2[v];
@@ -535,8 +558,8 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 						for (lp1 = 0; lp1 < blks_width; lp1++) {
 							for (lp2 = 0; lp2 < 4; ) {
 								k = *buf1++;
-								cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2];
-								ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2];
+								cur_lp = cur_frm_pos + width_tbl[lp2];
+								ref_lp = ref_frm_pos + width_tbl[lp2];
 
 								switch (correction_type_sp[0][k]) {
 									case 0:
@@ -565,16 +588,14 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 									case 2:
 										if (lp2 == 0) {
-											for (i = 0, j = 0; i < 2; i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp+j);
+											COPY_4_PIXELS(cur_lp, ref_lp, 2, width_tbl[1]);
 											lp2 += 2;
 										}
 										break;
 
 									case 3:
 										if (lp2 < 2) {
-											for (i = 0, j = 0; i < (3 - lp2); i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp+j);
+											COPY_4_PIXELS(cur_lp, ref_lp, (3 - lp2), width_tbl[1]);
 											lp2 = 3;
 										}
 										break;
@@ -584,8 +605,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 											RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
 
 											if (rle_v1 == 1 || ref_vectors != NULL) {
-												for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
-													cur_lp[j] = READ_UINT32(ref_lp+j);
+												COPY_4_PIXELS(cur_lp, ref_lp, 4, width_tbl[1]);
 											}
 
 											RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
@@ -599,8 +619,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 										LP2_CHECK(buf1,rle_v3,lp2)
 										// fall through
 									case 4:
-										for (i = 0, j = 0; i < (4 - lp2); i++, j += width_tbl[1])
-											cur_lp[j] = READ_UINT32(ref_lp+j);
+										COPY_4_PIXELS(cur_lp, ref_lp, (4 - lp2), width_tbl[1]);
 										lp2 = 4;
 										break;
 
@@ -620,8 +639,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 											return;
 										}
 										if (ref_vectors != NULL) {
-											for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp+j);
+											COPY_4_PIXELS(cur_lp, ref_lp, 4, width_tbl[1]);
 										}
 										lp2 = 4;
 										break;
@@ -642,12 +660,12 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 								}
 							}
 
-							cur_frm_pos += 4;
-							ref_frm_pos += 4;
+							cur_frm_pos++;
+							ref_frm_pos++;
 						}
 
-						cur_frm_pos += ((width - blks_width) * 4);
-						ref_frm_pos += ((width - blks_width) * 4);
+						cur_frm_pos += (width - blks_width);
+						ref_frm_pos += (width - blks_width);
 					}
 					break;
 
@@ -662,8 +680,8 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 							for (lp2 = 0; lp2 < 4; ) {
 								k = *buf1++;
 
-								cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
-								ref_lp = ((uint32 *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1];
+								cur_lp = cur_frm_pos + width_tbl[lp2 * 2];
+								ref_lp = cur_frm_pos + width_tbl[(lp2 * 2) - 1];
 
 								switch (correction_type_sp[lp2 & 0x01][k]) {
 									case 0:
@@ -691,16 +709,18 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 									case 2:
 										if (lp2 == 0) {
+											lv = READ_UINT32(ref_lp);
 											for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp);
+												cur_lp[j] = lv;
 											lp2 += 2;
 										}
 										break;
 
 									case 3:
 										if (lp2 < 2) {
+											lv = READ_UINT32(ref_lp);
 											for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp);
+												cur_lp[j] = lv;
 											lp2 = 3;
 										}
 										break;
@@ -724,8 +744,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 											RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
 
 											if (rle_v1 == 1) {
-												for (i = 0, j = 0; i < 8; i++, j += width_tbl[1])
-													cur_lp[j] = READ_UINT32(ref_lp+j);
+												COPY_4_PIXELS(cur_lp, ref_lp, 8, width_tbl[1]);
 											}
 
 											RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
@@ -739,8 +758,9 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 										LP2_CHECK(buf1,rle_v3,lp2)
 										// fall through
 									case 4:
+										lv = READ_UINT32(ref_lp);
 										for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
-											cur_lp[j] = READ_UINT32(ref_lp);
+											cur_lp[j] = lv;
 										lp2 = 4;
 										break;
 
@@ -762,10 +782,10 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 								}
 							}
 
-							cur_frm_pos += 4;
+							cur_frm_pos++;
 						}
 
-						cur_frm_pos += (((width * 2) - blks_width) * 4);
+						cur_frm_pos += ((width * 2) - blks_width);
 						flag1 = 0;
 					}
 					break;
@@ -778,8 +798,8 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 							for (lp1 = 0; lp1 < blks_width; lp1 += 2) {
 								for (lp2 = 0; lp2 < 4; ) {
 									k = *buf1++;
-									cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
-									ref_lp = ((uint32 *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1];
+									cur_lp = cur_frm_pos + width_tbl[lp2 * 2];
+									ref_lp = cur_frm_pos + width_tbl[(lp2 * 2) - 1];
 									lv1 = READ_UINT32(ref_lp);
 									lv2 = READ_UINT32(ref_lp+1);
 									if (lp2 == 0 && flag1 != 0) {
@@ -944,10 +964,10 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 									}
 								}
 
-								cur_frm_pos += 8;
+								cur_frm_pos += 2;
 							}
 
-							cur_frm_pos += (((width * 2) - blks_width) * 4);
+							cur_frm_pos += ((width * 2) - blks_width);
 							flag1 = 0;
 						}
 					} else {
@@ -955,8 +975,8 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 							for (lp1 = 0; lp1 < blks_width; lp1 += 2) {
 								for (lp2 = 0; lp2 < 4; ) {
 									k = *buf1++;
-									cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
-									ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2 * 2];
+									cur_lp = cur_frm_pos + width_tbl[lp2 * 2];
+									ref_lp = ref_frm_pos + width_tbl[lp2 * 2];
 
 									switch (correction_type_sp[lp2 & 0x01][k]) {
 										case 0:
@@ -981,20 +1001,14 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 										case 2:
 											if (lp2 == 0) {
-												for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
-													cur_lp[j] = READ_UINT32(ref_lp+j);
-													cur_lp[j+1] = READ_UINT32(ref_lp+j+1);
-												}
+												COPY_8_PIXELS(cur_lp, ref_lp, 4, width_tbl[1]);
 												lp2 += 2;
 											}
 											break;
 
 										case 3:
 											if (lp2 < 2) {
-												for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
-													cur_lp[j] = READ_UINT32(ref_lp+j);
-													cur_lp[j+1] = READ_UINT32(ref_lp+j+1);
-												}
+												COPY_8_PIXELS(cur_lp, ref_lp, 6 - (lp2 * 2), width_tbl[1]);
 												lp2 = 3;
 											}
 											break;
@@ -1002,10 +1016,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 										case 8:
 											if (lp2 == 0) {
 												RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
-												for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
-													((uint32 *)cur_frm_pos)[j] = READ_UINT32(((uint32 *)ref_frm_pos)+j);
-													((uint32 *)cur_frm_pos)[j+1] = READ_UINT32(((uint32 *)ref_frm_pos)+j+1);
-												}
+												COPY_8_PIXELS(cur_frm_pos, ref_frm_pos, 8, width_tbl[1]);
 												RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
 												break;
 											} else {
@@ -1019,10 +1030,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 											// fall through
 										case 6:
 										case 4:
-											for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
-												cur_lp[j] = READ_UINT32(ref_lp+j);
-												cur_lp[j+1] = READ_UINT32(ref_lp+j+1);
-											}
+											COPY_8_PIXELS(cur_lp, ref_lp, 8 - (lp2 * 2), width_tbl[1]);
 											lp2 = 4;
 											break;
 
@@ -1033,7 +1041,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 											lv += (lv << 8);
 											lv += (lv << 16);
 											for (i = 0, j = 0; i < 8; i++, j += width_tbl[1])
-												((uint32 *)cur_frm_pos)[j] = ((uint32 *)cur_frm_pos)[j+1] = lv;
+												cur_frm_pos[j] = cur_frm_pos[j+1] = lv;
 											LV1_CHECK(buf1,rle_v3,lv1,lp2)
 											break;
 
@@ -1042,12 +1050,12 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 									}
 								}
 
-								cur_frm_pos += 8;
-								ref_frm_pos += 8;
+								cur_frm_pos += 2;
+								ref_frm_pos += 2;
 							}
 
-							cur_frm_pos += (((width * 2) - blks_width) * 4);
-							ref_frm_pos += (((width * 2) - blks_width) * 4);
+							cur_frm_pos += ((width * 2) - blks_width);
+							ref_frm_pos += ((width * 2) - blks_width);
 						}
 					}
 					break;
@@ -1060,8 +1068,8 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 						for (lp1 = 0; lp1 < blks_width; lp1++) {
 							for (lp2 = 0; lp2 < 4; ) {
 								k = *buf1++;
-								cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
-								ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2 * 2];
+								cur_lp = cur_frm_pos + width_tbl[lp2 * 2];
+								ref_lp = ref_frm_pos + width_tbl[lp2 * 2];
 
 								switch (correction_type_sp[lp2 & 0x01][k]) {
 									case 0:
@@ -1092,16 +1100,14 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 
 									case 2:
 										if (lp2 == 0) {
-											for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp+j);
+											COPY_4_PIXELS(cur_lp, ref_lp, 4, width_tbl[1]);
 											lp2 += 2;
 										}
 										break;
 
 									case 3:
 										if (lp2 < 2) {
-											for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp+j);
+											COPY_4_PIXELS(cur_lp, ref_lp, 6 - (lp2 * 2), width_tbl[1]);
 											lp2 = 3;
 										}
 										break;
@@ -1109,10 +1115,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 									case 8:
 										if (lp2 == 0) {
 											RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
-
-											for (i = 0, j = 0; i < 8; i++, j += width_tbl[1])
-												cur_lp[j] = READ_UINT32(ref_lp+j);
-
+											COPY_4_PIXELS(cur_lp, ref_lp, 8, width_tbl[1]);
 											RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
 											break;
 										} else {
@@ -1126,8 +1129,7 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 										// fall through
 									case 4:
 									case 6:
-										for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
-											cur_lp[j] = READ_UINT32(ref_lp+j);
+										COPY_4_PIXELS(cur_lp, ref_lp, 8 - (lp2 * 2), width_tbl[1]);
 										lp2 = 4;
 										break;
 
@@ -1147,12 +1149,12 @@ void Indeo3Decoder::decodeChunk(byte *cur, byte *ref, int width, int height,
 								}
 							}
 
-							cur_frm_pos += 4;
-							ref_frm_pos += 4;
+							cur_frm_pos++;
+							ref_frm_pos++;
 						}
 
-						cur_frm_pos += (((width * 2) - blks_width) * 4);
-						ref_frm_pos += (((width * 2) - blks_width) * 4);
+						cur_frm_pos += ((width * 2) - blks_width);
+						ref_frm_pos += ((width * 2) - blks_width);
 					}
 					break;
 


Commit: 94d960597e8e9a6d41edec83239465d0706fece0
    https://github.com/scummvm/scummvm/commit/94d960597e8e9a6d41edec83239465d0706fece0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-05-04T00:06:15+02:00

Commit Message:
IMAGE: Whitespace fixes

Changed paths:
    image/codecs/indeo3.cpp


diff --git a/image/codecs/indeo3.cpp b/image/codecs/indeo3.cpp
index 508ae6be44e..dead6b528f4 100644
--- a/image/codecs/indeo3.cpp
+++ b/image/codecs/indeo3.cpp
@@ -388,19 +388,19 @@ typedef struct {
 			dst[j] = src[j]; \
 	} else { \
 		for (i = 0, j = 0; i < count; i++, j += pitch) \
-			dst[j] = READ_UINT32(src+j); \
+			dst[j] = READ_UINT32(src + j); \
 	}
 
 #define COPY_8_PIXELS(dst, src, count, pitch) \
 	if (IS_ALIGNED(src, 4)) { \
 		for (i = 0, j = 0; i < count; i++, j += pitch) {\
 			dst[j] = src[j]; \
-			dst[j+1] = src[j+1]; \
+			dst[j + 1] = src[j + 1]; \
 		} \
 	} else { \
 		for (i = 0, j = 0; i < count; i++, j += pitch) { \
-			dst[j] = READ_UINT32(src+j); \
-			dst[j+1] = READ_UINT32(src+j+1); \
+			dst[j] = READ_UINT32(src + j); \
+			dst[j + 1] = READ_UINT32(src + j + 1); \
 		} \
 	}
 




More information about the Scummvm-git-logs mailing list