From 91331e1ba451ae3b7628d075b6ac8d7075e36e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 20 Jul 2016 11:51:57 +0300 Subject: [PATCH] Silence warnings with GCC 5.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes warnings like the following: codec/decoder/core/src/mv_pred.cpp: In function ‘void WelsDec::PredPSkipMvFromNeighbor(WelsDec::PDqLayer, int16_t*)’: codec/decoder/core/src/mv_pred.cpp:158:51: warning: ‘iLeftTopXy’ may be used uninitialized in this function [-Wmaybe-uninitialized] codec/processing/src/backgrounddetection/BackgroundDetection.cpp: In member function ‘void WelsVP::CBackgroundDetection::ForegroundDilation(WelsVP::SBackgroundOU*, WelsVP::SBackgroundOU**, WelsVP::CBackgroundDetection::vBGDParam*, int32_t)’: codec/processing/src/backgrounddetection/BackgroundDetection.cpp:281:63: warning: suggest parentheses around operand of ‘!’ or change ‘|’ to ‘||’ or ‘!’ to ‘~’ [-Wparentheses] For the possibly uninitialized variables, this is similar to earlier commits 8be8fe17 and af2666fd. --- codec/decoder/core/src/mv_pred.cpp | 2 +- .../processing/src/backgrounddetection/BackgroundDetection.cpp | 2 +- test/decoder/DecUT_PredMv.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/decoder/core/src/mv_pred.cpp b/codec/decoder/core/src/mv_pred.cpp index 7ab88b19..680d1690 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 = 0; + int32_t iCurX, iCurY, iCurXy, iLeftXy, iTopXy = 0, iLeftTopXy = 0, iRightTopXy = 0; int8_t iLeftRef; int8_t iTopRef; diff --git a/codec/processing/src/backgrounddetection/BackgroundDetection.cpp b/codec/processing/src/backgrounddetection/BackgroundDetection.cpp index 408a5f96..1e66a629 100644 --- a/codec/processing/src/backgrounddetection/BackgroundDetection.cpp +++ b/codec/processing/src/backgrounddetection/BackgroundDetection.cpp @@ -278,7 +278,7 @@ inline void CBackgroundDetection::ForegroundDilation (SBackgroundOU* pBackground // chroma component check if (pBackgroundOU->iBackgroundFlag == 1) { - int8_t iNeighbourForegroundFlags = !pOUNeighbours[0]->iBackgroundFlag | ((!pOUNeighbours[1]->iBackgroundFlag) << 1) + int8_t iNeighbourForegroundFlags = (!pOUNeighbours[0]->iBackgroundFlag) | ((!pOUNeighbours[1]->iBackgroundFlag) << 1) | ((!pOUNeighbours[2]->iBackgroundFlag) << 2) | ((!pOUNeighbours[3]->iBackgroundFlag) << 3); pBackgroundOU->iBackgroundFlag = !ForegroundDilation23Chroma (iNeighbourForegroundFlags, iChromaSampleStartPos, iPicStrideUV, pBgdParam); diff --git a/test/decoder/DecUT_PredMv.cpp b/test/decoder/DecUT_PredMv.cpp index 32ea24be..9ed2f6d1 100644 --- a/test/decoder/DecUT_PredMv.cpp +++ b/test/decoder/DecUT_PredMv.cpp @@ -266,7 +266,7 @@ void AnchorPredPSkipMvFromNeighbor (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 = 0; + int32_t iCurX, iCurY, iCurXy, iLeftXy, iTopXy = 0, iLeftTopXy = 0, iRightTopXy = 0; int8_t iLeftRef; int8_t iTopRef;