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.
This commit is contained in:
D G Turner 2011-07-19 02:29:13 +01:00
parent 1f3ccd4eed
commit 54f25aa843
3 changed files with 13 additions and 13 deletions

View File

@ -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;

View File

@ -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))

View File

@ -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;
}