aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-06-21 07:18:28 -0500
committerColin Snover2016-06-21 08:14:11 -0500
commitdcc6234d816f7aab8f7ce0f473a7edf626dd03c6 (patch)
treeddb48a32a6423a9d1c091969ac86346b9e6169bf
parentf939868f3a10c0d8a48e602e4ce330982b7fa198 (diff)
downloadscummvm-rg350-dcc6234d816f7aab8f7ce0f473a7edf626dd03c6.tar.gz
scummvm-rg350-dcc6234d816f7aab8f7ce0f473a7edf626dd03c6.tar.bz2
scummvm-rg350-dcc6234d816f7aab8f7ce0f473a7edf626dd03c6.zip
SCI32: Add low-pass filter to 8-bit SOL audio
This improves the perceived quality of audio in games that use 8-bit samples for music, like Torin.
-rw-r--r--engines/sci/sound/decoders/sol.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/sound/decoders/sol.cpp b/engines/sci/sound/decoders/sol.cpp
index 280b24fd3a..a899cc4c77 100644
--- a/engines/sci/sound/decoders/sol.cpp
+++ b/engines/sci/sound/decoders/sol.cpp
@@ -70,13 +70,14 @@ static void deDPCM16(int16 *out, Common::ReadStream &audioStream, uint32 numByte
* byte.
*/
static void deDPCM8Nibble(int16 *out, uint8 &sample, uint8 delta) {
+ const uint8 lastSample = sample;
if (delta & 8) {
sample -= tableDPCM8[delta & 7];
} else {
sample += tableDPCM8[delta & 7];
}
sample = CLIP<byte>(sample, 0, 255);
- *out = (sample << 8) ^ 0x8000;
+ *out = ((lastSample + sample) << 7) ^ 0x8000;
}
/**