shithub: openh264

Download patch

ref: 447d7e19c975f896c7381cd701a52518a9d905e6
parent: 8492aac917af81807ca7b3c33d27b318e44ee3e7
parent: f589c580eb87c558f34c7640aa157495c7f0fabd
author: volvet <qizh@cisco.com>
date: Fri Mar 14 11:07:00 EDT 2014

Merge pull request #488 from licaiguo/clean-redundant-check

clean redundant checks in decoder

--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -357,15 +357,6 @@
   }
 
   iNextMbXyIndex = pSliceHeader->iFirstMbInSlice;
-
-  if ((iNextMbXyIndex < 0) || (iNextMbXyIndex >= kiCountNumMb)) {
-    WelsLog (pCtx, WELS_LOG_ERROR,
-             "WelsDecodeSlice()::iFirstMbInSlice(%d) > pSps->kiTotalMb(%d). ERROR!!! resolution change....\n",
-             iNextMbXyIndex, kiCountNumMb);
-    pCtx->iErrorCode |= dsNoParamSets;
-    return dsNoParamSets;
-  }
-
   iMbX = iNextMbXyIndex % pCurLayer->iMbWidth;
   iMbY = iNextMbXyIndex / pCurLayer->iMbWidth; // error is introduced by multiple slices case, 11/23/2009
   pSlice->iMbSkipRun = -1;
--- a/codec/decoder/core/src/decoder_core.cpp
+++ b/codec/decoder/core/src/decoder_core.cpp
@@ -475,12 +475,6 @@
     return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_NO_PARAM_SETS);
   }
 
-  if (pPps->iSpsId >= MAX_SPS_COUNT) {
-    WelsLog (pCtx, WELS_LOG_WARNING, "iSpsId out of range\n");
-    return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_SPS_ID_OVERFLOW);
-  }
-
-  //add check SPS available here
   if (kbExtensionFlag) {
     pSubsetSps	= &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
     pSps		= &pSubsetSps->sSps;
@@ -495,7 +489,6 @@
     }
     pSps		= &pCtx->sSpsBuffer[pPps->iSpsId];
   }
-  pCtx->pSps			= pSps;
   pSliceHead->iPpsId = iPpsId;
   pSliceHead->iSpsId = pPps->iSpsId;
   pSliceHead->pPps   = pPps;