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 | if (pCtx->pParam->eEcActiveIdc == ERROR_CON_DISABLE) { | 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 | pCtx->sDecoderStatistics.uiResolutionChangeTimes++; | 82 | pCtx->sDecoderStatistics.uiResolutionChangeTimes++; |
| 82 | pCtx->sDecoderStatistics.uiWidth = kiActualWidth; | 83 | pCtx->sDecoderStatistics.uiWidth = kiActualWidth; |
| 83 | pCtx->sDecoderStatistics.uiHeight = kiActualHeight; | 84 | pCtx->sDecoderStatistics.uiHeight = kiActualHeight; |
| @@ -438,6 +439,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 354 unmodified lines | |||
| 438 | kpRefMarking->bAdaptiveRefPicMarkingModeFlag = !!uiCode; | 439 | kpRefMarking->bAdaptiveRefPicMarkingModeFlag = !!uiCode; |
| 439 | if (kpRefMarking->bAdaptiveRefPicMarkingModeFlag) { | 440 | if (kpRefMarking->bAdaptiveRefPicMarkingModeFlag) { |
| 440 | int32_t iIdx = 0; | 441 | int32_t iIdx = 0; |
| 442 | bool bAllowMmco5 = true, bMmco4Exist = false, bMmco5Exist = false, bMmco6Exist = false; | ||
| 441 | do { | 443 | do { |
| 442 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //memory_management_control_operation | 444 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //memory_management_control_operation |
| 443 | const uint32_t kuiMmco = uiCode; | 445 | const uint32_t kuiMmco = uiCode; |
| @@ -447,20 +449,31 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli · 3 unmodified lines | |||
| 447 | break; | 449 | break; |
| 448 | 450 | ||
| 449 | if (kuiMmco == MMCO_SHORT2UNUSED || kuiMmco == MMCO_SHORT2LONG) { | 451 | if (kuiMmco == MMCO_SHORT2UNUSED || kuiMmco == MMCO_SHORT2LONG) { |
| 452 | bAllowMmco5 = false; | ||
| 450 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //difference_of_pic_nums_minus1 | 453 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //difference_of_pic_nums_minus1 |
| 451 | kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum = 1 + uiCode; | 454 | kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum = 1 + uiCode; |
| 452 | kpRefMarking->sMmcoRef[iIdx].iShortFrameNum = (pSh->iFrameNum - kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum) & (( | 455 | kpRefMarking->sMmcoRef[iIdx].iShortFrameNum = (pSh->iFrameNum - kpRefMarking->sMmcoRef[iIdx].iDiffOfPicNum) & (( |
| 453 | 1 << pSps->uiLog2MaxFrameNum) - 1); | 456 | 1 << pSps->uiLog2MaxFrameNum) - 1); |
| 454 | } else if (kuiMmco == MMCO_LONG2UNUSED) { | 457 | } else if (kuiMmco == MMCO_LONG2UNUSED) { |
| 458 | bAllowMmco5 = false; | ||
| 455 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_pic_num | 459 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_pic_num |
| 456 | kpRefMarking->sMmcoRef[iIdx].uiLongTermPicNum = uiCode; | 460 | kpRefMarking->sMmcoRef[iIdx].uiLongTermPicNum = uiCode; |
| 457 | } | 461 | } |
| 458 | if (kuiMmco == MMCO_SHORT2LONG || kuiMmco == MMCO_LONG) { | 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 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_frame_idx | 467 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //long_term_frame_idx |
| 460 | kpRefMarking->sMmcoRef[iIdx].iLongTermFrameIdx = uiCode; | 468 | kpRefMarking->sMmcoRef[iIdx].iLongTermFrameIdx = uiCode; |
| 461 | } else if (kuiMmco == MMCO_SET_MAX_LONG) { | 469 | } else if (kuiMmco == MMCO_SET_MAX_LONG) { |
| 470 | WELS_VERIFY_RETURN_IF (-1, bMmco4Exist); | ||
| 471 | bMmco4Exist = true; | ||
| 462 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1 | 472 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1 |
| 463 | kpRefMarking->sMmcoRef[iIdx].iMaxLongTermFrameIdx = -1 + uiCode; | 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 | ++ iIdx; | 478 | ++ iIdx; |
| 466 | 479 | ||