Merge pull request #1488 from mstorsjo/fix-warnings

Fix warnings with gcc and MSVC
This commit is contained in:
sijchen 2014-11-04 09:13:55 +08:00
commit 08baf65251
3 changed files with 6 additions and 9 deletions

View File

@ -214,7 +214,7 @@ int32_t DecodeBypassCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiBinVal) {
int32_t DecodeTerminateCabac (PWelsCabacDecEngine pDecEngine, uint32_t& uiBinVal) {
int32_t iErrorInfo = ERR_NONE;
uint64_t uiRange = pDecEngine->uiRange - 2;
int64_t uiOffset = pDecEngine->uiOffset;
uint64_t uiOffset = pDecEngine->uiOffset;
if (uiOffset >= (uiRange << pDecEngine->iBitsLeft)) {
uiBinVal = 1;

View File

@ -418,7 +418,7 @@ int32_t ParseIntra4x4Mode (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail
iBestMode = kiPredMode;
} else {
WELS_READ_VERIFY (BsGetBits (pBs, 3, &uiCode));
iBestMode = uiCode + (uiCode >= kiPredMode);
iBestMode = uiCode + ((int32_t) uiCode >= kiPredMode);
}
}
@ -501,7 +501,7 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui
int32_t iScanIdxStart = pSlice->sSliceHeaderExt.uiScanIdxStart;
int32_t iScanIdxEnd = pSlice->sSliceHeaderExt.uiScanIdxEnd;
int32_t iMbXy = pCurLayer->iMbXyIndex;
int32_t iMbMode, i;
int32_t i;
uint32_t uiMbType = 0, uiCbp = 0, uiCbpLuma = 0, uiCbpChroma = 0;
ENFORCE_STACK_ALIGN_1D (uint8_t, pNonZeroCount, 48, 16);
@ -538,7 +538,6 @@ int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& ui
WelsFillCacheNonZeroCount (&sNeighAvail, pNonZeroCount, pCurLayer);
WELS_READ_VERIFY (ParseIntra16x16Mode (pCtx, &sNeighAvail, pBsAux, pCurLayer));
}
iMbMode = BASE_MB;
memset (pCurLayer->pScaledTCoeff[iMbXy], 0, 384 * sizeof (pCurLayer->pScaledTCoeff[iMbXy][0]));
ST32 (&pCurLayer->pNzc[iMbXy][0], 0);
@ -671,7 +670,7 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv
int32_t iScanIdxEnd = pSlice->sSliceHeaderExt.uiScanIdxEnd;
int32_t iMbXy = pCurLayer->iMbXyIndex;
int32_t iMbMode, i;
int32_t i;
uint32_t uiMbType = 0, uiCbp = 0, uiCbpLuma = 0, uiCbpChroma = 0;
ENFORCE_STACK_ALIGN_1D (uint8_t, pNonZeroCount, 48, 16);
@ -687,7 +686,6 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv
pCurLayer->pMbType[iMbXy] = g_ksInterMbTypeInfo[uiMbType].iType;
WelsFillCacheInterCabac (pNeighAvail, pNonZeroCount, pMotionVector, pMvdCache, pRefIndex, pCurLayer);
WELS_READ_VERIFY (ParseInterMotionInfoCabac (pCtx, pNeighAvail, pNonZeroCount, pMotionVector, pMvdCache, pRefIndex));
iMbMode = BASE_MB;
pCurLayer->pInterPredictionDoneFlag[iMbXy] = 0;
} else { //Intra mode
uiMbType -= 5;
@ -717,7 +715,6 @@ int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAv
WelsFillCacheNonZeroCount (pNeighAvail, pNonZeroCount, pCurLayer);
WELS_READ_VERIFY (ParseIntra16x16Mode (pCtx, pNeighAvail, pBsAux, pCurLayer));
}
iMbMode = BASE_MB;
}
}

View File

@ -220,7 +220,7 @@ bool CheckRasterMultiSliceSetting (const int32_t kiMbNumInFrame, SSliceArgument*
// GOM based RC related for uiSliceNum decision, only used at SM_FIXEDSLCNUM_SLICE
bool GomValidCheckSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, uint32_t* pSliceNum) {
const int32_t kiCountNumMb = kiMbWidth * kiMbHeight;
int32_t iSliceNum = *pSliceNum;
uint32_t iSliceNum = *pSliceNum;
int32_t iGomSize;
//The default RC is Bit-rate mode[Yi], but need consider as below:
@ -236,7 +236,7 @@ bool GomValidCheckSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, u
iGomSize = kiMbWidth * GOM_ROW_MODE0_720P;
while (true) {
if (kiCountNumMb < iGomSize * iSliceNum) {
if (kiCountNumMb < iGomSize * (int32_t) iSliceNum) {
-- iSliceNum;
iSliceNum = iSliceNum - (iSliceNum & 0x01); // verfiy even num for multiple slices case
if (iSliceNum < 2) // for safe