History

stop early error for parse/recon MB

huili2 committed 12 years ago

Commit 1ec213d1 parent 5a60d0f1 file · +8 −6Browse files

Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 1 file). Show all

Unified · Split

codec/decoder/core/src/decode_slice.cpp+8−6
@@ -85,6 +85,10 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) { · 84 unmodified lines
8585 }
8686
8787 do {
88+ if (iCountNumMb >= iTotalNumMb) {
89+ break;
90+ }
91+
8892 if (WelsTargetMbConstruction (pCtx)) {
8993 WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsTargetSliceConstruction():::MB(%d, %d) construction error. pCurSlice_type:%d\n",
9094 pCurLayer->iMbX, pCurLayer->iMbY, pCurSlice->eSliceType);
@@ -98,9 +102,6 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) { · 7 unmodified lines
98102 ++pCtx->iTotalNumMbRec;
99103 }
100104
101− if (iCountNumMb >= iTotalNumMb) {
102− break;
103− }
104105 if (pCtx->iTotalNumMbRec > iTotalMbTargetLayer) {
105106 WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsTargetSliceConstruction():::pCtx->iTotalNumMbRec:%d, iTotalMbTargetLayer:%d\n",
106107 pCtx->iTotalNumMbRec, iTotalMbTargetLayer);
@@ -390,6 +391,10 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal · 283 unmodified lines
390391 }
391392
392393 do {
394+ if ((-1 == iNextMbXyIndex) || (iNextMbXyIndex >= kiCountNumMb)) { // slice group boundary or end of a frame
395+ break;
396+ }
397+
393398 pCurLayer->pSliceIdc[iNextMbXyIndex] = iSliceIdc;
394399 iRet = pDecMbCavlcFunc (pCtx, pNalCur);
395400
@@ -404,9 +409,6 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal · 8 unmodified lines
404409 } else {
405410 ++iNextMbXyIndex;
406411 }
407− if ((-1 == iNextMbXyIndex) || (iNextMbXyIndex >= kiCountNumMb)) { // slice group boundary or end of a frame
408− break;
409− }
410412
411413 // check whether there is left bits to read next time in case multiple slices
412414 iUsedBits = ((pBs->pCurBuf - pBs->pStartBuf) << 3) - (16 - pBs->iLeftBits);

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