From 703c69de8164e28212c2df1745e1b4a6dd76fd09 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Tue, 18 Mar 2014 19:14:27 +0100 Subject: [PATCH 1/5] codec: add a new macro for unused functions Variables used only for tracing logs can trigger -Werror=unusef-variable when tracing is disabled. This macro helps to silent gcc in those casesWIP --- codec/common/macros.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codec/common/macros.h b/codec/common/macros.h index 8bfc7d5c..1ff7fdb9 100644 --- a/codec/common/macros.h +++ b/codec/common/macros.h @@ -264,5 +264,12 @@ static inline bool WELS_POWER2_IF (uint32_t v) { return (v && ! (v & (v - 1))); } +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) +#define WELS_GCC_UNUSED __attribute__((__unused__)) +#else +#define WELS_GCC_UNUSED +#endif + + #endif//WELS_MACRO_UTILIZATIONS_H__ From ae60f1bee900e23823b142a05ea273f8b0c16b72 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Mon, 17 Mar 2014 17:12:33 +0100 Subject: [PATCH 2/5] Fix compiler warnings and remove dead code Fix several -Werror=unused-variable and -Werror=unused-but-set-variable and removed dead code found with this warnings --- codec/console/enc/src/welsenc.cpp | 5 --- codec/decoder/core/src/au_parser.cpp | 2 -- codec/decoder/core/src/decode_slice.cpp | 4 --- codec/decoder/core/src/decoder_core.cpp | 3 -- codec/decoder/core/src/manage_dec_ref.cpp | 2 -- codec/decoder/core/src/parse_mb_syn_cavlc.cpp | 10 ------ codec/encoder/core/src/encoder_ext.cpp | 17 ---------- .../core/src/slice_multi_threading.cpp | 4 +-- codec/encoder/core/src/wels_preprocess.cpp | 1 - .../complexityanalysis/ComplexityAnalysis.cpp | 32 ------------------- 10 files changed, 1 insertion(+), 79 deletions(-) diff --git a/codec/console/enc/src/welsenc.cpp b/codec/console/enc/src/welsenc.cpp index a9c6b61a..8522806c 100644 --- a/codec/console/enc/src/welsenc.cpp +++ b/codec/console/enc/src/welsenc.cpp @@ -303,7 +303,6 @@ int ParseConfig (CReadConfig& cRdCfg, SSourcePicture* pSrcPic, SEncParamExt& pSv assert (kiActualLayerNum <= MAX_DEPENDENCY_LAYER); for (int8_t iLayer = 0; iLayer < kiActualLayerNum; ++ iLayer) { - SSpatialLayerConfig* pDLayer = &pSvcParam.sSpatialLayers[iLayer]; CReadConfig cRdLayerCfg (sFileSet.strLayerCfgFile[iLayer]); if (-1==ParseLayerConfig( cRdLayerCfg, iLayer, pSvcParam,sFileSet )) { @@ -414,7 +413,6 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE SLayerPEncCtx sLayerCtx[3]; int n = 0; string str_ ("SlicesAssign"); - const int kiSize = str_.size(); while (n < argc) { pCommand = argv[n++]; @@ -827,7 +825,6 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) { int32_t iActualFrameEncodedCount = 0; int32_t iFrameIdx = 0; int32_t iTotalFrameMax = -1; - int8_t iDlayerIdx = 0; uint8_t* pYUV= NULL; SSourcePicture* pSrcPic = NULL; int32_t iSourceWidth, iSourceHeight, kiPicResSize; @@ -961,8 +958,6 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) { iFrameIdx = 0; while (iFrameIdx < iTotalFrameMax && (((int32_t)sSvcParam.uiFrameToBeCoded <= 0) || (iFrameIdx < (int32_t)sSvcParam.uiFrameToBeCoded))) { - bool bOnePicAvailableAtLeast = false; - bool bSomeSpatialUnavailable = false; #ifdef ONLY_ENC_FRAMES_NUM // Only encoded some limited frames here diff --git a/codec/decoder/core/src/au_parser.cpp b/codec/decoder/core/src/au_parser.cpp index 09f122d0..0f7d782b 100644 --- a/codec/decoder/core/src/au_parser.cpp +++ b/codec/decoder/core/src/au_parser.cpp @@ -598,7 +598,6 @@ int32_t ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs) { int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStringAux pBs) { PSpsSvcExt pExt = NULL; - uint8_t uiChromaArrayType = 1; uint32_t uiCode; int32_t iCode; @@ -617,7 +616,6 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin pExt->uiChromaPhaseXPlus1Flag = 0; // FIXME: Incoherent with JVT X201 standard (= 1), but conformance to JSVM (= 0) implementation. pExt->uiChromaPhaseYPlus1 = 1; - uiChromaArrayType = pSpsExt->sSps.uiChromaArrayType; WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //chroma_phase_x_plus1_flag pExt->uiChromaPhaseXPlus1Flag = uiCode; diff --git a/codec/decoder/core/src/decode_slice.cpp b/codec/decoder/core/src/decode_slice.cpp index 9a63cd4a..485fd777 100644 --- a/codec/decoder/core/src/decode_slice.cpp +++ b/codec/decoder/core/src/decode_slice.cpp @@ -52,8 +52,6 @@ namespace WelsDec { int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) { - int32_t iPreQP = 0; - PDqLayer pCurLayer = pCtx->pCurDqLayer; PSlice pCurSlice = &pCurLayer->sLayerInfo.sSliceInLayer; PSliceHeader pSliceHeader = &pCurSlice->sSliceHeaderExt.sSliceHeader; @@ -87,8 +85,6 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) { } do { - iPreQP = pCurLayer->pLumaQp[pCurLayer->iMbXyIndex]; - if (WelsTargetMbConstruction (pCtx)) { WelsLog (pCtx, WELS_LOG_WARNING, "WelsTargetSliceConstruction():::MB(%d, %d) construction error. pCurSlice_type:%d\n", pCurLayer->iMbX, pCurLayer->iMbY, pCurSlice->eSliceType); diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp index 911c447c..ea1daead 100644 --- a/codec/decoder/core/src/decoder_core.cpp +++ b/codec/decoder/core/src/decoder_core.cpp @@ -206,7 +206,6 @@ int32_t ParseRefPicListReordering (PBitStringAux pBs, PSliceHeader pSh) { int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSliceHeader pSh, PSps pSps, const bool kbIdrFlag) { PRefPicMarking const kpRefMarking = &pSh->sRefMarking; - PRefPic pRefPic = &pCtx->sRefPic; uint32_t uiCode; if (kbIdrFlag) { WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //no_output_of_prior_pics_flag @@ -990,7 +989,6 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid void UninitialDqLayersContext (PWelsDecoderContext pCtx) { int32_t i = 0; - int32_t j = 0; do { PDqLayer pDq = pCtx->pDqLayersList[i]; @@ -1642,7 +1640,6 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 uint8_t uiNalRefIdc = 0; bool bFreshSliceAvailable = true; // Another fresh slice comingup for given dq layer, for multiple slices in case of header parts of slices sometimes loss over error-prone channels, 8/14/2008 - PPicture pStoreBasePic = NULL; //update pCurDqLayer at the starting of AU decoding if (pCtx->bInitialDqLayersMem) { diff --git a/codec/decoder/core/src/manage_dec_ref.cpp b/codec/decoder/core/src/manage_dec_ref.cpp index 30960cd9..b1568632 100644 --- a/codec/decoder/core/src/manage_dec_ref.cpp +++ b/codec/decoder/core/src/manage_dec_ref.cpp @@ -105,7 +105,6 @@ void WelsResetRefPic (PWelsDecoderContext pCtx) { */ int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) { int32_t i, iCount = 0; - const bool kbUseRefBasePicFlag = pCtx->pCurDqLayer->bUseRefBasePicFlag; PPicture* ppShoreRefList = pCtx->sRefPic.pShortRefList[LIST_0]; PPicture* ppLongRefList = pCtx->sRefPic.pLongRefList[LIST_0]; memset (pCtx->sRefPic.pRefList[LIST_0], 0, MAX_REF_PIC_COUNT * sizeof (PPicture)); @@ -206,7 +205,6 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) { int32_t WelsMarkAsRef (PWelsDecoderContext pCtx) { PRefPic pRefPic = &pCtx->sRefPic; PRefPicMarking pRefPicMarking = pCtx->pCurDqLayer->pRefPicMarking; - PRefBasePicMarking pRefPicBaseMarking = pCtx->pCurDqLayer->pRefPicBaseMarking; PAccessUnit pCurAU = pCtx->pAccessUnitList; bool bIsIDRAU = false; uint32_t j; diff --git a/codec/decoder/core/src/parse_mb_syn_cavlc.cpp b/codec/decoder/core/src/parse_mb_syn_cavlc.cpp index 9f9affe2..fcc6dd42 100644 --- a/codec/decoder/core/src/parse_mb_syn_cavlc.cpp +++ b/codec/decoder/core/src/parse_mb_syn_cavlc.cpp @@ -666,7 +666,6 @@ int32_t WelsResidualBlockCavlc (SVlcTable* pVlcTable, uint8_t* pNonZeroCountCach PWelsDecoderContext pCtx) { int32_t iLevel[16], iZerosLeft, iCoeffNum; int32_t iRun[16] = {0}; - const uint8_t* kpBitNumMap; int32_t iCurNonZeroCacheIdx, i; const uint16_t* kpDequantCoeff = g_kuiDequantCoeff[uiQp]; int8_t nA, nB, nC; @@ -688,18 +687,10 @@ int32_t WelsResidualBlockCavlc (SVlcTable* pVlcTable, uint8_t* pNonZeroCountCach iCurNonZeroCacheIdx = g_kuiCacheNzcScanIdx[iIndex]; nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1]; nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8]; - - if (bChromaDc) { - kpBitNumMap = g_kuiTotalZerosBitNumChromaMap; - } else { - kpBitNumMap = g_kuiTotalZerosBitNumMap; - } } else { //luma iCurNonZeroCacheIdx = g_kuiCacheNzcScanIdx[iIndex]; nA = pNonZeroCountCache[iCurNonZeroCacheIdx - 1]; nB = pNonZeroCountCache[iCurNonZeroCacheIdx - 8]; - - kpBitNumMap = g_kuiTotalZerosBitNumMap; } WELS_NON_ZERO_COUNT_AVERAGE (nC, nA, nB); @@ -981,7 +972,6 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M PSlice pSlice = &pCtx->pCurDqLayer->sLayerInfo.sSliceInLayer; PSliceHeader pSliceHeader = &pSlice->sSliceHeaderExt.sSliceHeader; PPicture* ppRefPic = pCtx->sRefPic.pRefList[LIST_0]; - int32_t iNumRefFrames = pSliceHeader->pSps->iNumRefFrames; int32_t iRefCount[2]; PDqLayer pCurDqLayer = pCtx->pCurDqLayer; int32_t i, j; diff --git a/codec/encoder/core/src/encoder_ext.cpp b/codec/encoder/core/src/encoder_ext.cpp index 6352cb26..a5b488e3 100644 --- a/codec/encoder/core/src/encoder_ext.cpp +++ b/codec/encoder/core/src/encoder_ext.cpp @@ -78,11 +78,6 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { float fMaxFrameRate = 0.0f; const float fEpsn = 0.000001f; int32_t i = 0; - int32_t iLastSpatialWidth = 0; - int32_t iLastSpatialHeight = 0; - float fLastFrameRateIn = 0.0f; - float fLastFrameRateOut = 0.0f; - SDLayerParam* pLastSpatialParam = NULL; assert (pCfg != NULL); @@ -118,16 +113,6 @@ int32_t ParamValidation (SWelsSvcCodingParam* pCfg) { pCfg->fMaxFrameRate = fMaxFrameRate; } - for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) { - SDLayerParam* fDlp = &pCfg->sDependencyLayers[i]; - - pLastSpatialParam = fDlp; - iLastSpatialWidth = fDlp->iFrameWidth; - iLastSpatialHeight = fDlp->iFrameHeight; - fLastFrameRateIn = fDlp->fInputFrameRate; - fLastFrameRateOut = fDlp->fOutputFrameRate; - } - return 0; } @@ -680,7 +665,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { SSubsetSps* pSubsetSps = NULL; SWelsPPS* pPps = NULL; CMemoryAlign* pMa = NULL; - SStrideTables* pStrideTab = NULL; int32_t iDlayerCount = 0; int32_t iDlayerIndex = 0; uint32_t iSpsId = 0; @@ -696,7 +680,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { iDlayerCount = pParam->iSpatialLayerNum; iNumRef = pParam->iNumRefFrame; // highest_layers_in_temporal = 1 + WELS_MAX(pParam->iDecompStages, 1); - pStrideTab = (*ppCtx)->pStrideTab; iDlayerIndex = 0; while (iDlayerIndex < iDlayerCount) { diff --git a/codec/encoder/core/src/slice_multi_threading.cpp b/codec/encoder/core/src/slice_multi_threading.cpp index 1cccbba8..82000bdf 100644 --- a/codec/encoder/core/src/slice_multi_threading.cpp +++ b/codec/encoder/core/src/slice_multi_threading.cpp @@ -353,7 +353,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara MT_TRACE_LOG ((*ppCtx), WELS_LOG_INFO, "encpEncCtx= 0x%p\n", (void*) (*ppCtx)); char name[SEM_NAME_MAX] = {0}; - WELS_THREAD_ERROR_CODE err = 0; + WELS_GCC_UNUSED WELS_THREAD_ERROR_CODE err = 0; iIdx = 0; while (iIdx < iThreadNum) { @@ -602,7 +602,6 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr SWelsSliceBs* pSliceBs = &pCtx->pSliceBs[iSliceIdx]; SNalUnitHeaderExt* pNalHdrExt = &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt; uint8_t* pDst = pFrameBsBuffer; - int32_t pNalLen[2]; const int32_t kiNalCnt = pSliceBs->iNalIndex; int32_t iNalIdx = 0; int32_t iNalSize = 0; @@ -616,7 +615,6 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr iNalSize = 0; iReturn = WelsEncodeNal (&pSliceBs->sNalList[iNalIdx], pNalHdrExt, pCtx->iFrameBsSize-kiWrittenLength-iSliceSize, pDst, &iNalSize); WELS_VERIFY_RETURN_IFNEQ(iReturn, ENC_RETURN_SUCCESS) - pNalLen[iNalIdx] = iNalSize; iSliceSize += iNalSize; pDst += iNalSize; pLbi->iNalLengthInByte[iNalBase + iNalIdx] = iNalSize; diff --git a/codec/encoder/core/src/wels_preprocess.cpp b/codec/encoder/core/src/wels_preprocess.cpp index baf8243c..42bff7ed 100644 --- a/codec/encoder/core/src/wels_preprocess.cpp +++ b/codec/encoder/core/src/wels_preprocess.cpp @@ -306,7 +306,6 @@ void CWelsPreProcess::FreeSpatialPictures (sWelsEncCtx* pCtx) { int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePicture* kpSrcPic) { SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam; - int32_t iNumDependencyLayer = (int32_t)pSvcParam->iSpatialLayerNum; int32_t iSpatialNum = 0; if (!m_bInitDone) { diff --git a/codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp b/codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp index 33864f6d..5482ec3c 100644 --- a/codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp +++ b/codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp @@ -178,7 +178,6 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM int32_t iGomMbStartIndex = 0, iGomMbEndIndex = 0, iGomMbRowNum = 0; int32_t iMbStartIndex = 0, iMbEndIndex = 0; - int32_t iStartSampleIndex = 0; uint8_t* pBackgroundMbFlag = (uint8_t*)m_sComplexityAnalysisParam.pBackgroundMbFlag; uint32_t* uiRefMbType = (uint32_t*)m_sComplexityAnalysisParam.uiRefMbType; @@ -186,18 +185,9 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM int32_t* pGomForegroundBlockNum = (int32_t*)m_sComplexityAnalysisParam.pGomForegroundBlockNum; int32_t* pGomComplexity = (int32_t*)m_sComplexityAnalysisParam.pGomComplexity; - uint8_t* pRefY = NULL, *pSrcY = NULL; - int32_t iRefStride = 0, iCurStride = 0; - uint8_t* pRefTmp = NULL, *pCurTmp = NULL; uint32_t uiGomSad = 0, uiFrameSad = 0; - pRefY = (uint8_t*)pRefPixMap->pPixel[0]; - pSrcY = (uint8_t*)pSrcPixMap->pPixel[0]; - - iRefStride = pRefPixMap->iStride[0]; - iCurStride = pSrcPixMap->iStride[0]; - InitGomSadFunc (m_pfGomSad, m_sComplexityAnalysisParam.iCalcBgd); for (int32_t j = 0; j < iGomMbNum; j ++) { @@ -210,13 +200,7 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM iMbStartIndex = iGomMbStartIndex; iMbEndIndex = WELS_MIN ((iMbStartIndex / iMbWidth + 1) * iMbWidth, iGomMbEndIndex); - iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iRefStride + (iMbStartIndex % iMbWidth) * - MB_WIDTH_LUMA; - do { - pRefTmp = pRefY + iStartSampleIndex; - pCurTmp = pSrcY + iStartSampleIndex; - for (int32_t i = iMbStartIndex; i < iMbEndIndex; i ++) { m_pfGomSad (&uiGomSad, pGomForegroundBlockNum + j, pVaaCalcResults->pSad8x8[i], pBackgroundMbFlag[i] && !IS_INTRA (uiRefMbType[i])); @@ -225,9 +209,6 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM iMbStartIndex = iMbEndIndex; iMbEndIndex = WELS_MIN (iMbEndIndex + iMbWidth , iGomMbEndIndex); - iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iRefStride + (iMbStartIndex % iMbWidth) * - MB_WIDTH_LUMA; - } while (--iGomMbRowNum); pGomComplexity[j] = uiGomSad; @@ -251,20 +232,13 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaVar (SPixMap* pSrcPixMap, SPixM int32_t iGomMbStartIndex = 0, iGomMbEndIndex = 0, iGomMbRowNum = 0; int32_t iMbStartIndex = 0, iMbEndIndex = 0; - int32_t iStartSampleIndex = 0; SVAACalcResult* pVaaCalcResults = m_sComplexityAnalysisParam.pCalcResult; int32_t* pGomComplexity = (int32_t*)m_sComplexityAnalysisParam.pGomComplexity; - uint8_t* pSrcY = NULL; - int32_t iCurStride = 0; - uint8_t* pCurTmp = NULL; uint32_t uiSampleSum = 0, uiSquareSum = 0; - pSrcY = (uint8_t*)pSrcPixMap->pPixel[0]; - iCurStride = pSrcPixMap->iStride[0]; - for (int32_t j = 0; j < iGomMbNum; j ++) { uiSampleSum = 0; uiSquareSum = 0; @@ -276,13 +250,9 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaVar (SPixMap* pSrcPixMap, SPixM iMbStartIndex = iGomMbStartIndex; iMbEndIndex = WELS_MIN ((iMbStartIndex / iMbWidth + 1) * iMbWidth, iGomMbEndIndex); - iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iCurStride + (iMbStartIndex % iMbWidth) * - MB_WIDTH_LUMA; iGomSampleNum = (iMbEndIndex - iMbStartIndex) * MB_WIDTH_LUMA * MB_WIDTH_LUMA; do { - pCurTmp = pSrcY + iStartSampleIndex; - for (int32_t i = iMbStartIndex; i < iMbEndIndex; i ++) { uiSampleSum += pVaaCalcResults->pSum16x16[i]; uiSquareSum += pVaaCalcResults->pSumOfSquare16x16[i]; @@ -291,8 +261,6 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaVar (SPixMap* pSrcPixMap, SPixM iMbStartIndex = iMbEndIndex; iMbEndIndex = WELS_MIN (iMbEndIndex + iMbWidth, iGomMbEndIndex); - iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iCurStride + (iMbStartIndex % iMbWidth) * - MB_WIDTH_LUMA; } while (--iGomMbRowNum); pGomComplexity[j] = uiSquareSum - (uiSampleSum * uiSampleSum / iGomSampleNum); From e9e332bf4c4c0997bc6efe768e64abd4d598eaa9 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Tue, 18 Mar 2014 07:47:45 +0100 Subject: [PATCH 3/5] Fix -Werror=sign-compare compiler warnings --- codec/decoder/core/src/au_parser.cpp | 4 ++-- codec/decoder/core/src/decoder_core.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/decoder/core/src/au_parser.cpp b/codec/decoder/core/src/au_parser.cpp index 0f7d782b..3ada6caa 100644 --- a/codec/decoder/core/src/au_parser.cpp +++ b/codec/decoder/core/src/au_parser.cpp @@ -897,7 +897,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW WelsLog (pCtx, WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth); return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); } - if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (8 * pSLevelLimits->iMaxFS)) { + if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t)(8 * pSLevelLimits->iMaxFS)) { WelsLog (pCtx, WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n"); } WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 @@ -906,7 +906,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW WelsLog (pCtx, WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight); return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); } - if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (8 * pSLevelLimits->iMaxFS)) { + if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) { WelsLog (pCtx, WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n"); } uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight; diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp index ea1daead..47750719 100644 --- a/codec/decoder/core/src/decoder_core.cpp +++ b/codec/decoder/core/src/decoder_core.cpp @@ -184,7 +184,7 @@ int32_t ParseRefPicListReordering (PBitStringAux pBs, PSliceHeader pSh) { // abs_diff_pic_num_minus1 should be in range 0 to MaxPicNum-1, MaxPicNum is derived as // 2^(4+log2_max_frame_num_minus4) WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //abs_diff_pic_num_minus1 - WELS_CHECK_SE_UPPER_ERROR_NOLOG (uiCode, (1 << pSps->uiLog2MaxFrameNum), "abs_diff_pic_num_minus1", + WELS_CHECK_SE_UPPER_ERROR_NOLOG (uiCode, (uint32_t) (1 << pSps->uiLog2MaxFrameNum), "abs_diff_pic_num_minus1", GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_REF_REORDERING)); pRefPicListReordering->sReorderingSyn[iList][iIdx].uiAbsDiffPicNumMinus1 = uiCode; // uiAbsDiffPicNumMinus1 } else if (kuiIdc == 2) { From 8be8fe17757aa298881811b35016a06872b13228 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Tue, 18 Mar 2014 07:57:01 +0100 Subject: [PATCH 4/5] Fix compiler warning -Werror=maybe-uninitialized --- codec/decoder/core/src/mv_pred.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/decoder/core/src/mv_pred.cpp b/codec/decoder/core/src/mv_pred.cpp index 670b5e0f..31f88107 100644 --- a/codec/decoder/core/src/mv_pred.cpp +++ b/codec/decoder/core/src/mv_pred.cpp @@ -48,7 +48,7 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { int32_t iCurSliceIdc, iTopSliceIdc, iLeftTopSliceIdc, iRightTopSliceIdc, iLeftSliceIdc; int32_t iLeftTopType, iRightTopType, iTopType, iLeftType; - int32_t iCurX, iCurY, iCurXy, iLeftXy, iTopXy, iLeftTopXy, iRightTopXy; + int32_t iCurX, iCurY, iCurXy, iLeftXy, iTopXy, iLeftTopXy, iRightTopXy = 0; int8_t iLeftRef; int8_t iTopRef; From c55429d7a5db72e045d8f0ccd350de822a970c00 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Tue, 18 Mar 2014 07:57:27 +0100 Subject: [PATCH 5/5] Replace -Werror with -Wall Treating warnings as error is useless if no warning is activated. Several build systems enable -Wall in the CLFAGS, which in combination with -Werror can trigger undesired build errors. --- build/platform-darwin.mk | 2 +- build/platform-linux.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/platform-darwin.mk b/build/platform-darwin.mk index 40d00f54..383c3afd 100644 --- a/build/platform-darwin.mk +++ b/build/platform-darwin.mk @@ -1,7 +1,7 @@ include build/platform-arch.mk SHAREDLIBSUFFIX = dylib SHARED = -dynamiclib -CFLAGS += -Werror -fPIC -DMACOS -DMT_ENABLED -MMD -MP +CFLAGS += -Wall -fPIC -DMACOS -DMT_ENABLED -MMD -MP LDFLAGS += -lpthread ifeq ($(ASM_ARCH), x86) ASMFLAGS += --prefix _ diff --git a/build/platform-linux.mk b/build/platform-linux.mk index e95ff2cd..4eb7c045 100644 --- a/build/platform-linux.mk +++ b/build/platform-linux.mk @@ -1,6 +1,6 @@ include build/platform-arch.mk SHAREDLIBSUFFIX = so -CFLAGS += -Werror -fPIC -DLINUX -DMT_ENABLED -MMD -MP +CFLAGS += -Wall -fPIC -DLINUX -DMT_ENABLED -MMD -MP LDFLAGS += -lpthread ifeq ($(ASM_ARCH), x86) ifeq ($(ENABLE64BIT), Yes)