From f589c580eb87c558f34c7640aa157495c7f0fabd Mon Sep 17 00:00:00 2001 From: Licai Guo Date: Thu, 13 Mar 2014 23:56:54 -0700 Subject: [PATCH] clean redundant checks in decoder --- codec/decoder/core/src/decode_slice.cpp | 9 --------- codec/decoder/core/src/decoder_core.cpp | 7 ------- 2 files changed, 16 deletions(-) diff --git a/codec/decoder/core/src/decode_slice.cpp b/codec/decoder/core/src/decode_slice.cpp index b03b3d5b..1d761a71 100644 --- a/codec/decoder/core/src/decode_slice.cpp +++ b/codec/decoder/core/src/decode_slice.cpp @@ -357,15 +357,6 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal } 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; diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp index 262123c3..911c447c 100644 --- a/codec/decoder/core/src/decoder_core.cpp +++ b/codec/decoder/core/src/decoder_core.cpp @@ -475,12 +475,6 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co 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 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co } pSps = &pCtx->sSpsBuffer[pPps->iSpsId]; } - pCtx->pSps = pSps; pSliceHead->iPpsId = iPpsId; pSliceHead->iSpsId = pPps->iSpsId; pSliceHead->pPps = pPps;