diff --git a/audio/decoders/qdm2.cpp b/audio/decoders/qdm2.cpp index 842ca586549..19b30217e97 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 2ad71cee65a..d1f3e77abf0 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 a21582e5f3f..1f3190dff1b 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(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; }