diff options
author | Colin Snover | 2016-06-21 07:18:28 -0500 |
---|---|---|
committer | Colin Snover | 2016-06-21 08:14:11 -0500 |
commit | dcc6234d816f7aab8f7ce0f473a7edf626dd03c6 (patch) | |
tree | ddb48a32a6423a9d1c091969ac86346b9e6169bf | |
parent | f939868f3a10c0d8a48e602e4ce330982b7fa198 (diff) | |
download | scummvm-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.cpp | 3 |
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; } /** |