[Scummvm-cvs-logs] scummvm master -> 84d4e97d08f78ee282ba3275fe0c8a0a1d24daae

eriktorbjorn eriktorbjorn at telia.com
Wed Jan 1 20:00:42 CET 2014


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

Summary:
75806cd73c VIDEO: Fix Smacker palette upscaling to match Multimedia Wiki
84d4e97d08 VIDEO: Rename variables and remove pointless assertion


Commit: 75806cd73c45278105ac4a3326ba7c80e86618ba
    https://github.com/scummvm/scummvm/commit/75806cd73c45278105ac4a3326ba7c80e86618ba
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-01-01T10:48:17-08:00

Commit Message:
VIDEO: Fix Smacker palette upscaling to match Multimedia Wiki

The Multimedia Wiki suggests using a lookup table, but this should
produce the same result.

Changed paths:
    video/smk_decoder.cpp



diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index 3dbcebc..868050e 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -732,10 +732,11 @@ void SmackerDecoder::SmackerVideoTrack::unpackPalette(Common::SeekableReadStream
 
 			assert(g < 0xc0 && b < 0xc0);
 
-			// upscale to full 8-bit color values by multiplying by 4
-			*pal++ = b * 4;
-			*pal++ = g * 4;
-			*pal++ = r * 4;
+			// upscale to full 8-bit color values. The Multimedia Wiki suggests
+			// a lookup table for this, but this should produce the same result.
+			*pal++ = (b * 4 + b / 16);
+			*pal++ = (g * 4 + g / 16);
+			*pal++ = (r * 4 + r / 16);
 		}
 	}
 


Commit: 84d4e97d08f78ee282ba3275fe0c8a0a1d24daae
    https://github.com/scummvm/scummvm/commit/84d4e97d08f78ee282ba3275fe0c8a0a1d24daae
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-01-01T10:55:04-08:00

Commit Message:
VIDEO: Rename variables and remove pointless assertion

It's RGB, not BGR apparently. This seems to contradict the
Multimedia Wiki, but not reality.

Changed paths:
    video/smk_decoder.cpp



diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index 868050e..0247fe5 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -726,17 +726,15 @@ void SmackerDecoder::SmackerVideoTrack::unpackPalette(Common::SeekableReadStream
 		} else {                       // top 2 bits are 00
 			sz++;
 			// get the lower 6 bits for each component (0x3f = 00111111)
-			byte b = b0 & 0x3f;
+			byte r = b0 & 0x3f;
 			byte g = (*p++) & 0x3f;
-			byte r = (*p++) & 0x3f;
-
-			assert(g < 0xc0 && b < 0xc0);
+			byte b = (*p++) & 0x3f;
 
 			// upscale to full 8-bit color values. The Multimedia Wiki suggests
 			// a lookup table for this, but this should produce the same result.
-			*pal++ = (b * 4 + b / 16);
-			*pal++ = (g * 4 + g / 16);
 			*pal++ = (r * 4 + r / 16);
+			*pal++ = (g * 4 + g / 16);
+			*pal++ = (b * 4 + b / 16);
 		}
 	}
 






More information about the Scummvm-git-logs mailing list