History

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

Andoni Morales Alastruey committed 12 years ago

Commit ae60f1b1 parent 703c69d10 files · +1 −79Browse files

Showing the changes to codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp (1 of 10 files). Show all

Unified · Split

codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp+0−32
@@ -178,7 +178,6 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM · 177 unmodified lines
178 178
179 int32_t iGomMbStartIndex = 0, iGomMbEndIndex = 0, iGomMbRowNum = 0;179 int32_t iGomMbStartIndex = 0, iGomMbEndIndex = 0, iGomMbRowNum = 0;
180 int32_t iMbStartIndex = 0, iMbEndIndex = 0;180 int32_t iMbStartIndex = 0, iMbEndIndex = 0;
181 int32_t iStartSampleIndex = 0;
182 181
183 uint8_t* pBackgroundMbFlag = (uint8_t*)m_sComplexityAnalysisParam.pBackgroundMbFlag;182 uint8_t* pBackgroundMbFlag = (uint8_t*)m_sComplexityAnalysisParam.pBackgroundMbFlag;
184 uint32_t* uiRefMbType = (uint32_t*)m_sComplexityAnalysisParam.uiRefMbType;183 uint32_t* uiRefMbType = (uint32_t*)m_sComplexityAnalysisParam.uiRefMbType;
@@ -186,18 +185,9 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM · 1 unmodified line
186 int32_t* pGomForegroundBlockNum = (int32_t*)m_sComplexityAnalysisParam.pGomForegroundBlockNum;185 int32_t* pGomForegroundBlockNum = (int32_t*)m_sComplexityAnalysisParam.pGomForegroundBlockNum;
187 int32_t* pGomComplexity = (int32_t*)m_sComplexityAnalysisParam.pGomComplexity;186 int32_t* pGomComplexity = (int32_t*)m_sComplexityAnalysisParam.pGomComplexity;
188 187
189 uint8_t* pRefY = NULL, *pSrcY = NULL;
190 int32_t iRefStride = 0, iCurStride = 0;
191 188
192 uint8_t* pRefTmp = NULL, *pCurTmp = NULL;
193 uint32_t uiGomSad = 0, uiFrameSad = 0;189 uint32_t uiGomSad = 0, uiFrameSad = 0;
194 190
195 pRefY = (uint8_t*)pRefPixMap->pPixel[0];
196 pSrcY = (uint8_t*)pSrcPixMap->pPixel[0];
197
198 iRefStride = pRefPixMap->iStride[0];
199 iCurStride = pSrcPixMap->iStride[0];
200
201 InitGomSadFunc (m_pfGomSad, m_sComplexityAnalysisParam.iCalcBgd);191 InitGomSadFunc (m_pfGomSad, m_sComplexityAnalysisParam.iCalcBgd);
202 192
203 for (int32_t j = 0; j < iGomMbNum; j ++) {193 for (int32_t j = 0; j < iGomMbNum; j ++) {
@@ -210,13 +200,7 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM · 6 unmodified lines
210 iMbStartIndex = iGomMbStartIndex;200 iMbStartIndex = iGomMbStartIndex;
211 iMbEndIndex = WELS_MIN ((iMbStartIndex / iMbWidth + 1) * iMbWidth, iGomMbEndIndex);201 iMbEndIndex = WELS_MIN ((iMbStartIndex / iMbWidth + 1) * iMbWidth, iGomMbEndIndex);
212 202
213 iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iRefStride + (iMbStartIndex % iMbWidth) *
214 MB_WIDTH_LUMA;
215
216 do {203 do {
217 pRefTmp = pRefY + iStartSampleIndex;
218 pCurTmp = pSrcY + iStartSampleIndex;
219
220 for (int32_t i = iMbStartIndex; i < iMbEndIndex; i ++) {204 for (int32_t i = iMbStartIndex; i < iMbEndIndex; i ++) {
221 m_pfGomSad (&uiGomSad, pGomForegroundBlockNum + j, pVaaCalcResults->pSad8x8[i], pBackgroundMbFlag[i]205 m_pfGomSad (&uiGomSad, pGomForegroundBlockNum + j, pVaaCalcResults->pSad8x8[i], pBackgroundMbFlag[i]
222 && !IS_INTRA (uiRefMbType[i]));206 && !IS_INTRA (uiRefMbType[i]));
@@ -225,9 +209,6 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaSad (SPixMap* pSrcPixMap, SPixM · 2 unmodified lines
225 iMbStartIndex = iMbEndIndex;209 iMbStartIndex = iMbEndIndex;
226 iMbEndIndex = WELS_MIN (iMbEndIndex + iMbWidth , iGomMbEndIndex);210 iMbEndIndex = WELS_MIN (iMbEndIndex + iMbWidth , iGomMbEndIndex);
227 211
228 iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iRefStride + (iMbStartIndex % iMbWidth) *
229 MB_WIDTH_LUMA;
230
231 } while (--iGomMbRowNum);212 } while (--iGomMbRowNum);
232 213
233 pGomComplexity[j] = uiGomSad;214 pGomComplexity[j] = uiGomSad;
@@ -251,20 +232,13 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaVar (SPixMap* pSrcPixMap, SPixM · 17 unmodified lines
251 232
252 int32_t iGomMbStartIndex = 0, iGomMbEndIndex = 0, iGomMbRowNum = 0;233 int32_t iGomMbStartIndex = 0, iGomMbEndIndex = 0, iGomMbRowNum = 0;
253 int32_t iMbStartIndex = 0, iMbEndIndex = 0;234 int32_t iMbStartIndex = 0, iMbEndIndex = 0;
254 int32_t iStartSampleIndex = 0;
255 235
256 SVAACalcResult* pVaaCalcResults = m_sComplexityAnalysisParam.pCalcResult;236 SVAACalcResult* pVaaCalcResults = m_sComplexityAnalysisParam.pCalcResult;
257 int32_t* pGomComplexity = (int32_t*)m_sComplexityAnalysisParam.pGomComplexity;237 int32_t* pGomComplexity = (int32_t*)m_sComplexityAnalysisParam.pGomComplexity;
258 238
259 uint8_t* pSrcY = NULL;
260 int32_t iCurStride = 0;
261 239
262 uint8_t* pCurTmp = NULL;
263 uint32_t uiSampleSum = 0, uiSquareSum = 0;240 uint32_t uiSampleSum = 0, uiSquareSum = 0;
264 241
265 pSrcY = (uint8_t*)pSrcPixMap->pPixel[0];
266 iCurStride = pSrcPixMap->iStride[0];
267
268 for (int32_t j = 0; j < iGomMbNum; j ++) {242 for (int32_t j = 0; j < iGomMbNum; j ++) {
269 uiSampleSum = 0;243 uiSampleSum = 0;
270 uiSquareSum = 0;244 uiSquareSum = 0;
@@ -276,13 +250,9 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaVar (SPixMap* pSrcPixMap, SPixM · 5 unmodified lines
276 iMbStartIndex = iGomMbStartIndex;250 iMbStartIndex = iGomMbStartIndex;
277 iMbEndIndex = WELS_MIN ((iMbStartIndex / iMbWidth + 1) * iMbWidth, iGomMbEndIndex);251 iMbEndIndex = WELS_MIN ((iMbStartIndex / iMbWidth + 1) * iMbWidth, iGomMbEndIndex);
278 252
279 iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iCurStride + (iMbStartIndex % iMbWidth) *
280 MB_WIDTH_LUMA;
281 iGomSampleNum = (iMbEndIndex - iMbStartIndex) * MB_WIDTH_LUMA * MB_WIDTH_LUMA;253 iGomSampleNum = (iMbEndIndex - iMbStartIndex) * MB_WIDTH_LUMA * MB_WIDTH_LUMA;
282 254
283 do {255 do {
284 pCurTmp = pSrcY + iStartSampleIndex;
285
286 for (int32_t i = iMbStartIndex; i < iMbEndIndex; i ++) {256 for (int32_t i = iMbStartIndex; i < iMbEndIndex; i ++) {
287 uiSampleSum += pVaaCalcResults->pSum16x16[i];257 uiSampleSum += pVaaCalcResults->pSum16x16[i];
288 uiSquareSum += pVaaCalcResults->pSumOfSquare16x16[i];258 uiSquareSum += pVaaCalcResults->pSumOfSquare16x16[i];
@@ -291,8 +261,6 @@ void CComplexityAnalysis::AnalyzeGomComplexityViaVar (SPixMap* pSrcPixMap, SPixM · 2 unmodified lines
291 iMbStartIndex = iMbEndIndex;261 iMbStartIndex = iMbEndIndex;
292 iMbEndIndex = WELS_MIN (iMbEndIndex + iMbWidth, iGomMbEndIndex);262 iMbEndIndex = WELS_MIN (iMbEndIndex + iMbWidth, iGomMbEndIndex);
293 263
294 iStartSampleIndex = (iMbStartIndex / iMbWidth) * MB_WIDTH_LUMA * iCurStride + (iMbStartIndex % iMbWidth) *
295 MB_WIDTH_LUMA;
296 } while (--iGomMbRowNum);264 } while (--iGomMbRowNum);
297 265
298 pGomComplexity[j] = uiSquareSum - (uiSampleSum * uiSampleSum / iGomSampleNum);266 pGomComplexity[j] = uiSquareSum - (uiSampleSum * uiSampleSum / iGomSampleNum);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t