Showing the changes to codec/encoder/core/src/au_set.cpp (1 of 7 files). Show all
Unified · Split
| @@ -267,7 +267,7 @@ int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_ · 266 unmodified lines | ||
| 267 | 267 | BsWriteUE (pLocalBitStringAux, pSps->iLog2MaxPocLsb - 4); // log2_max_pic_order_cnt_lsb_minus4 |
| 268 | 268 | |
| 269 | 269 | BsWriteUE (pLocalBitStringAux, pSps->iNumRefFrames); // max_num_ref_frames |
| 270 | − BsWriteOneBit (pLocalBitStringAux, true/*pSps->bGapsInFrameNumValueAllowedFlag*/); // bGapsInFrameNumValueAllowedFlag | |
| 270 | + BsWriteOneBit (pLocalBitStringAux, pSps->bGapsInFrameNumValueAllowedFlag); //gaps_in_frame_numvalue_allowed_flag | |
| 271 | 271 | BsWriteUE (pLocalBitStringAux, pSps->iMbWidth - 1); // pic_width_in_mbs_minus1 |
| 272 | 272 | BsWriteUE (pLocalBitStringAux, pSps->iMbHeight - 1); // pic_height_in_map_units_minus1 |
| 273 | 273 | BsWriteOneBit (pLocalBitStringAux, true/*pSps->bFrameMbsOnlyFlag*/); // bFrameMbsOnlyFlag |
| @@ -464,7 +464,7 @@ static inline bool WelsGetPaddingOffset (int32_t iActualWidth, int32_t iActualHe · 190 unmodified lines | ||
| 464 | 464 | int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal, |
| 465 | 465 | const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame, |
| 466 | 466 | const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc, |
| 467 | − const int32_t kiDlayerCount) { | |
| 467 | + const int32_t kiDlayerCount, bool bSVCBaselayer) { | |
| 468 | 468 | memset (pSps, 0, sizeof (SWelsSPS)); |
| 469 | 469 | pSps->uiSpsId = kuiSpsId; |
| 470 | 470 | pSps->iMbWidth = (pLayerParam->iVideoWidth + 15) >> 4; |
| @@ -483,7 +483,6 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 12 unmodified lines | ||
| 483 | 483 | } else { |
| 484 | 484 | pSps->bFrameCroppingFlag = false; |
| 485 | 485 | } |
| 486 | − | |
| 487 | 486 | pSps->uiProfileIdc = pLayerParam->uiProfileIdc ? pLayerParam->uiProfileIdc : PRO_BASELINE; |
| 488 | 487 | if (pLayerParam->uiProfileIdc == PRO_BASELINE) { |
| 489 | 488 | pSps->bConstraintSet0Flag = true; |
| @@ -491,7 +490,7 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 1 unmodified line | ||
| 491 | 490 | if (pLayerParam->uiProfileIdc <= PRO_MAIN) { |
| 492 | 491 | pSps->bConstraintSet1Flag = true; |
| 493 | 492 | } |
| 494 | − if (kiDlayerCount > 1) { | |
| 493 | + if ((kiDlayerCount > 1) && bSVCBaselayer) { | |
| 495 | 494 | pSps->bConstraintSet2Flag = true; |
| 496 | 495 | } |
| 497 | 496 | |
| @@ -508,6 +507,13 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 10 unmodified lines | ||
| 508 | 507 | pLayerParam->uiLevelIdc = uiLevel; |
| 509 | 508 | } |
| 510 | 509 | pSps->iLevelIdc = g_kuiLevelMaps[pLayerParam->uiLevelIdc - 1]; |
| 510 | + | |
| 511 | + //bGapsInFrameNumValueAllowedFlag is false when only spatial layer number and temporal layer number is 1, and ltr is 0. | |
| 512 | + if ((kiDlayerCount == 1) && (pSps->iNumRefFrames == 1)) | |
| 513 | + pSps->bGapsInFrameNumValueAllowedFlag = false; | |
| 514 | + else | |
| 515 | + pSps->bGapsInFrameNumValueAllowedFlag = true; | |
| 516 | + | |
| 511 | 517 | pSps->bVuiParamPresentFlag = true; |
| 512 | 518 | return 0; |
| 513 | 519 | } |
| @@ -516,13 +522,14 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 2 unmodified lines | ||
| 516 | 522 | int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerParam, |
| 517 | 523 | SSpatialLayerInternal* pLayerParamInternal, |
| 518 | 524 | const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame, |
| 519 | − const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc) { | |
| 525 | + const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc, | |
| 526 | + const int32_t kiDlayerCount) { | |
| 520 | 527 | SWelsSPS* pSps = &pSubsetSps->pSps; |
| 521 | 528 | |
| 522 | 529 | memset (pSubsetSps, 0, sizeof (SSubsetSps)); |
| 523 | 530 | |
| 524 | 531 | WelsInitSps (pSps, pLayerParam, pLayerParamInternal, kuiIntraPeriod, kiNumRefFrame, kuiSpsId, kbEnableFrameCropping, |
| 525 | − bEnableRc, 1); | |
| 532 | + bEnableRc, kiDlayerCount, false); | |
| 526 | 533 | |
| 527 | 534 | pSps->uiProfileIdc = (pLayerParam->uiProfileIdc >= PRO_SCALABLE_BASELINE) ? pLayerParam->uiProfileIdc : |
| 528 | 535 | PRO_SCALABLE_BASELINE; |