History

clean redundant checks in decoder

Licai Guo committed 12 years ago

Commit f589c581 parent 8492aac2 files · +0 −16Browse files

Showing the changes to codec/decoder (2 of 2 files). Show all

Unified · Split

2 files
  1. codec/decoder/core/src/decode_slice.cpp +0 −9
  2. codec/decoder/core/src/decoder_core.cpp +0 −7
codec/decoder/core/src/decode_slice.cpp+0−9
@@ -357,15 +357,6 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal · 356 unmodified lines
357 }357 }
358 358
359 iNextMbXyIndex = pSliceHeader->iFirstMbInSlice;359 iNextMbXyIndex = pSliceHeader->iFirstMbInSlice;
360
361 if ((iNextMbXyIndex < 0) || (iNextMbXyIndex >= kiCountNumMb)) {
362 WelsLog (pCtx, WELS_LOG_ERROR,
363 "WelsDecodeSlice()::iFirstMbInSlice(%d) > pSps->kiTotalMb(%d). ERROR!!! resolution change....\n",
364 iNextMbXyIndex, kiCountNumMb);
365 pCtx->iErrorCode |= dsNoParamSets;
366 return dsNoParamSets;
367 }
368
369 iMbX = iNextMbXyIndex % pCurLayer->iMbWidth;360 iMbX = iNextMbXyIndex % pCurLayer->iMbWidth;
370 iMbY = iNextMbXyIndex / pCurLayer->iMbWidth; // error is introduced by multiple slices case, 11/23/2009361 iMbY = iNextMbXyIndex / pCurLayer->iMbWidth; // error is introduced by multiple slices case, 11/23/2009
371 pSlice->iMbSkipRun = -1;362 pSlice->iMbSkipRun = -1;
codec/decoder/core/src/decoder_core.cpp+0−7
@@ -475,12 +475,6 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 474 unmodified lines
475 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_NO_PARAM_SETS);475 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_NO_PARAM_SETS);
476 }476 }
477 477
478 if (pPps->iSpsId >= MAX_SPS_COUNT) {
479 WelsLog (pCtx, WELS_LOG_WARNING, "iSpsId out of range\n");
480 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_SPS_ID_OVERFLOW);
481 }
482
483 //add check SPS available here
484 if (kbExtensionFlag) {478 if (kbExtensionFlag) {
485 pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];479 pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
486 pSps = &pSubsetSps->sSps;480 pSps = &pSubsetSps->sSps;
@@ -495,7 +489,6 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 8 unmodified lines
495 }489 }
496 pSps = &pCtx->sSpsBuffer[pPps->iSpsId];490 pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
497 }491 }
498 pCtx->pSps = pSps;
499 pSliceHead->iPpsId = iPpsId;492 pSliceHead->iPpsId = iPpsId;
500 pSliceHead->iSpsId = pPps->iSpsId;493 pSliceHead->iSpsId = pPps->iSpsId;
501 pSliceHead->pPps = pPps;494 pSliceHead->pPps = pPps;

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