Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -77,7 +77,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 76 unmodified lines | ||
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | 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)) { | |
| 81 | 82 | pCtx->sDecoderStatistics.uiResolutionChangeTimes++; |
| 82 | 83 | pCtx->sDecoderStatistics.uiWidth = kiActualWidth; |
| 83 | 84 | pCtx->sDecoderStatistics.uiHeight = kiActualHeight; |
| @@ -438,6 +439,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 354 unmodified lines | ||
| 438 | 439 | kpRefMarking->bAdaptiveRefPicMarkingModeFlag = !!uiCode; |
| 439 | 440 | if (kpRefMarking->bAdaptiveRefPicMarkingModeFlag) { |
| 440 | 441 | int32_t iIdx = 0; |
| 442 | + bool bAllowMmco5 = true, bMmco4Exist = false, bMmco5Exist = false, bMmco6Exist = false; | |
| 441 | 443 | do { |
| 442 | 444 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //memory_management_control_operation |
| 443 | 445 | const uint32_t kuiMmco = uiCode; |
| @@ -447,20 +449,31 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 3 unmodified lines | ||
| 447 | 449 | break; |
| 448 | 450 | |
| 449 | 451 | if (kuiMmco == MMCO_SHORT2UNUSED || kuiMmco == MMCO_SHORT2LONG) { |
| 452 | + bAllowMmco5 = false; | |
| 450 | 453 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //difference_of_pic_nums_minus1 |
| 451 | 454 | kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum = 1 + uiCode; |
| 452 | 455 | kpRefMarking->sMmcoRef[iIdx].iShortFrameNum = (pSh->iFrameNum - kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum) & (( |
| 453 | 456 | 1 << pSps->uiLog2MaxFrameNum) - 1); |
| 454 | 457 | } else if (kuiMmco == MMCO_LONG2UNUSED) { |
| 458 | + bAllowMmco5 = false; | |
| 455 | 459 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_pic_num |
| 456 | 460 | kpRefMarking->sMmcoRef[iIdx].uiLongTermPicNum = uiCode; |
| 457 | 461 | } |
| 458 | 462 | if (kuiMmco == MMCO_SHORT2LONG || kuiMmco == MMCO_LONG) { |
| 463 | + if (kuiMmco == MMCO_LONG) { | |
| 464 | + WELS_VERIFY_RETURN_IF (-1, bMmco6Exist); | |
| 465 | + bMmco6Exist = true; | |
| 466 | + } | |
| 459 | 467 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_frame_idx |
| 460 | 468 | kpRefMarking->sMmcoRef[iIdx].iLongTermFrameIdx = uiCode; |
| 461 | 469 | } else if (kuiMmco == MMCO_SET_MAX_LONG) { |
| 470 | + WELS_VERIFY_RETURN_IF (-1, bMmco4Exist); | |
| 471 | + bMmco4Exist = true; | |
| 462 | 472 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1 |
| 463 | 473 | kpRefMarking->sMmcoRef[iIdx].iMaxLongTermFrameIdx = -1 + uiCode; |
| 474 | + } else if (kuiMmco == MMCO_RESET) { | |
| 475 | + WELS_VERIFY_RETURN_IF (-1, (!bAllowMmco5 || bMmco5Exist)); | |
| 476 | + bMmco5Exist = true; | |
| 464 | 477 | } |
| 465 | 478 | ++ iIdx; |
| 466 | 479 | |