History

strict follow MMCO's constraint for 4,5,6

huili2 committed 9 years ago

Commit 986f3d01 parent eac070c1 file · +14 −1Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+14−1
@@ -77,7 +77,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 76 unmodified lines
7777
7878
7979 if (pCtx->pParam->eEcActiveIdc == ERROR_CON_DISABLE) {
80− if ((pCtx->sDecoderStatistics.uiWidth != (unsigned int) kiActualWidth) || (pCtx->sDecoderStatistics.uiHeight != (unsigned int) kiActualHeight)) {
80+ if ((pCtx->sDecoderStatistics.uiWidth != (unsigned int) kiActualWidth)
81+ || (pCtx->sDecoderStatistics.uiHeight != (unsigned int) kiActualHeight)) {
8182 pCtx->sDecoderStatistics.uiResolutionChangeTimes++;
8283 pCtx->sDecoderStatistics.uiWidth = kiActualWidth;
8384 pCtx->sDecoderStatistics.uiHeight = kiActualHeight;
@@ -438,6 +439,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 354 unmodified lines
438439 kpRefMarking->bAdaptiveRefPicMarkingModeFlag = !!uiCode;
439440 if (kpRefMarking->bAdaptiveRefPicMarkingModeFlag) {
440441 int32_t iIdx = 0;
442+ bool bAllowMmco5 = true, bMmco4Exist = false, bMmco5Exist = false, bMmco6Exist = false;
441443 do {
442444 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //memory_management_control_operation
443445 const uint32_t kuiMmco = uiCode;
@@ -447,20 +449,31 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 3 unmodified lines
447449 break;
448450
449451 if (kuiMmco == MMCO_SHORT2UNUSED || kuiMmco == MMCO_SHORT2LONG) {
452+ bAllowMmco5 = false;
450453 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //difference_of_pic_nums_minus1
451454 kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum = 1 + uiCode;
452455 kpRefMarking->sMmcoRef[iIdx].iShortFrameNum = (pSh->iFrameNum - kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum) & ((
453456 1 << pSps->uiLog2MaxFrameNum) - 1);
454457 } else if (kuiMmco == MMCO_LONG2UNUSED) {
458+ bAllowMmco5 = false;
455459 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_pic_num
456460 kpRefMarking->sMmcoRef[iIdx].uiLongTermPicNum = uiCode;
457461 }
458462 if (kuiMmco == MMCO_SHORT2LONG || kuiMmco == MMCO_LONG) {
463+ if (kuiMmco == MMCO_LONG) {
464+ WELS_VERIFY_RETURN_IF (-1, bMmco6Exist);
465+ bMmco6Exist = true;
466+ }
459467 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_frame_idx
460468 kpRefMarking->sMmcoRef[iIdx].iLongTermFrameIdx = uiCode;
461469 } else if (kuiMmco == MMCO_SET_MAX_LONG) {
470+ WELS_VERIFY_RETURN_IF (-1, bMmco4Exist);
471+ bMmco4Exist = true;
462472 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1
463473 kpRefMarking->sMmcoRef[iIdx].iMaxLongTermFrameIdx = -1 + uiCode;
474+ } else if (kuiMmco == MMCO_RESET) {
475+ WELS_VERIFY_RETURN_IF (-1, (!bAllowMmco5 || bMmco5Exist));
476+ bMmco5Exist = true;
464477 }
465478 ++ iIdx;
466479

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