aboutsummaryrefslogtreecommitdiff
path: root/audio/decoders
diff options
context:
space:
mode:
authorMatthew Hoops2011-04-13 09:43:08 -0400
committerMatthew Hoops2011-04-13 09:45:13 -0400
commitdeb46ab38b8a904543ede68ff2d2315f40168096 (patch)
tree6e2ad650d4fc2f255607e22c779db13935be1de5 /audio/decoders
parent3be6ff23d7f83254e8282d801d38dedfc36b51a1 (diff)
downloadscummvm-rg350-deb46ab38b8a904543ede68ff2d2315f40168096.tar.gz
scummvm-rg350-deb46ab38b8a904543ede68ff2d2315f40168096.tar.bz2
scummvm-rg350-deb46ab38b8a904543ede68ff2d2315f40168096.zip
AUDIO: Split the Intel DVI ADPCM into its own class
IMA is really just the definition on how to decode a sample from a nibble, DVI is just a way for those nibbles to be stored in the stream.
Diffstat (limited to 'audio/decoders')
-rw-r--r--audio/decoders/adpcm.cpp6
-rw-r--r--audio/decoders/adpcm.h2
-rw-r--r--audio/decoders/adpcm_intern.h11
3 files changed, 12 insertions, 7 deletions
diff --git a/audio/decoders/adpcm.cpp b/audio/decoders/adpcm.cpp
index 43b5a0b3da..ac18b244c5 100644
--- a/audio/decoders/adpcm.cpp
+++ b/audio/decoders/adpcm.cpp
@@ -121,7 +121,7 @@ int16 Oki_ADPCMStream::decodeOKI(byte code) {
#pragma mark -
-int Ima_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) {
+int DVI_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) {
int samples;
byte data;
@@ -453,8 +453,8 @@ RewindableAudioStream *makeADPCMStream(Common::SeekableReadStream *stream, Dispo
return new MSIma_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign, true);
case kADPCMMS:
return new MS_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign);
- case kADPCMIma:
- return new Ima_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign);
+ case kADPCMDVI:
+ return new DVI_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign);
case kADPCMApple:
return new Apple_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign);
case kADPCMDK3:
diff --git a/audio/decoders/adpcm.h b/audio/decoders/adpcm.h
index 06cda69225..7202d6bc9c 100644
--- a/audio/decoders/adpcm.h
+++ b/audio/decoders/adpcm.h
@@ -58,7 +58,7 @@ enum typesADPCM {
kADPCMMSIma, // Microsoft IMA ADPCM
kADPCMMSImaLastExpress, // Microsoft IMA ADPCM (with inverted samples)
kADPCMMS, // Microsoft ADPCM
- kADPCMIma, // Standard IMA ADPCM
+ kADPCMDVI, // Intel DVI IMA ADPCM
kADPCMApple, // Apple QuickTime IMA ADPCM
kADPCMDK3 // Duck DK3 IMA ADPCM
};
diff --git a/audio/decoders/adpcm_intern.h b/audio/decoders/adpcm_intern.h
index b566f2c765..2d56c9d468 100644
--- a/audio/decoders/adpcm_intern.h
+++ b/audio/decoders/adpcm_intern.h
@@ -104,15 +104,20 @@ public:
memset(&_status, 0, sizeof(_status));
}
- virtual int readBuffer(int16 *buffer, const int numSamples);
-
-
/**
* This table is used by decodeIMA.
*/
static const int16 _imaTable[89];
};
+class DVI_ADPCMStream : public Ima_ADPCMStream {
+public:
+ DVI_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign)
+ : Ima_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) {}
+
+ virtual int readBuffer(int16 *buffer, const int numSamples);
+};
+
class Apple_ADPCMStream : public Ima_ADPCMStream {
protected:
// Apple QuickTime IMA ADPCM