diff options
author | D G Turner | 2011-07-19 02:29:13 +0100 |
---|---|---|
committer | D G Turner | 2011-07-19 02:29:13 +0100 |
commit | 54f25aa84373715001c56155673fb59cfe44b573 (patch) | |
tree | 636cbbacffd6b5adfcf125917bbb70ed38503dea | |
parent | 1f3ccd4eed78c94da4856044d5351c1fccc53607 (diff) | |
download | scummvm-rg350-54f25aa84373715001c56155673fb59cfe44b573.tar.gz scummvm-rg350-54f25aa84373715001c56155673fb59cfe44b573.tar.bz2 scummvm-rg350-54f25aa84373715001c56155673fb59cfe44b573.zip |
COMMON: Renamed Integer Log2 function from log2 to intLog2.
This avoids naming collisions with system libraries on some platforms
i.e. DS, DC where the log2 is realised by macro.
-rw-r--r-- | audio/decoders/qdm2.cpp | 4 | ||||
-rw-r--r-- | common/math.h | 2 | ||||
-rw-r--r-- | video/bink_decoder.cpp | 20 |
3 files changed, 13 insertions, 13 deletions
diff --git a/audio/decoders/qdm2.cpp b/audio/decoders/qdm2.cpp index 842ca58654..19b30217e9 100644 --- a/audio/decoders/qdm2.cpp +++ b/audio/decoders/qdm2.cpp @@ -1822,11 +1822,11 @@ QDM2Stream::QDM2Stream(Common::SeekableReadStream *extraData, DisposeAfterUse::F warning("QDM2Stream::QDM2Stream() u4 field not 0"); } - _fftOrder = log2(_frameSize) + 1; + _fftOrder = Common::intLog2(_frameSize) + 1; _fftFrameSize = 2 * _frameSize; // complex has two floats // something like max decodable tones - _groupOrder = log2(_blockSize) + 1; + _groupOrder = Common::intLog2(_blockSize) + 1; _sFrameSize = _blockSize / 16; // 16 iterations per super block _subSampling = _fftOrder - 7; diff --git a/common/math.h b/common/math.h index 2ad71cee65..d1f3e77abf 100644 --- a/common/math.h +++ b/common/math.h @@ -61,7 +61,7 @@ static const char LogTable256[256] = { LT(7), LT(7), LT(7), LT(7), LT(7), LT(7), LT(7), LT(7) }; -inline uint32 log2(uint32 v) { +inline uint32 intLog2(uint32 v) { register uint32 t, tt; if ((tt = v >> 16)) diff --git a/video/bink_decoder.cpp b/video/bink_decoder.cpp index a21582e5f3..1f3190dff1 100644 --- a/video/bink_decoder.cpp +++ b/video/bink_decoder.cpp @@ -701,15 +701,15 @@ void BinkDecoder::initBundles() { for (int i = 0; i < 2; i++) { int width = MAX<uint32>(cw[i], 8); - _bundles[kSourceBlockTypes ].countLengths[i] = Common::log2((width >> 3) + 511) + 1; - _bundles[kSourceSubBlockTypes].countLengths[i] = Common::log2((width >> 4) + 511) + 1; - _bundles[kSourceColors ].countLengths[i] = Common::log2((width >> 3)*64 + 511) + 1; - _bundles[kSourceIntraDC ].countLengths[i] = Common::log2((width >> 3) + 511) + 1; - _bundles[kSourceInterDC ].countLengths[i] = Common::log2((width >> 3) + 511) + 1; - _bundles[kSourceXOff ].countLengths[i] = Common::log2((width >> 3) + 511) + 1; - _bundles[kSourceYOff ].countLengths[i] = Common::log2((width >> 3) + 511) + 1; - _bundles[kSourcePattern ].countLengths[i] = Common::log2((cbw[i] << 3) + 511) + 1; - _bundles[kSourceRun ].countLengths[i] = Common::log2((width >> 3)*48 + 511) + 1; + _bundles[kSourceBlockTypes ].countLengths[i] = Common::intLog2((width >> 3) + 511) + 1; + _bundles[kSourceSubBlockTypes].countLengths[i] = Common::intLog2((width >> 4) + 511) + 1; + _bundles[kSourceColors ].countLengths[i] = Common::intLog2((width >> 3)*64 + 511) + 1; + _bundles[kSourceIntraDC ].countLengths[i] = Common::intLog2((width >> 3) + 511) + 1; + _bundles[kSourceInterDC ].countLengths[i] = Common::intLog2((width >> 3) + 511) + 1; + _bundles[kSourceXOff ].countLengths[i] = Common::intLog2((width >> 3) + 511) + 1; + _bundles[kSourceYOff ].countLengths[i] = Common::intLog2((width >> 3) + 511) + 1; + _bundles[kSourcePattern ].countLengths[i] = Common::intLog2((cbw[i] << 3) + 511) + 1; + _bundles[kSourceRun ].countLengths[i] = Common::intLog2((width >> 3)*48 + 511) + 1; } } @@ -1426,7 +1426,7 @@ void BinkDecoder::audioBlock(AudioTrack &audio, int16 *out) { if (!audio.first) { int count = audio.overlapLen * audio.channels; - int shift = Common::log2(count); + int shift = Common::intLog2(count); for (int i = 0; i < count; i++) { out[i] = (audio.prevCoeffs[i] * (count - i) + out[i] * i) >> shift; } |