History

update bGapsInFrameNumValueAllowedFlag according to parameters setting

ruil2 committed 11 years ago

Commit cce966f1 parent b6670317 files · +58 −46Browse files

Showing the changes to codec/encoder/core/src/au_set.cpp (1 of 7 files). Show all

Unified · Split

codec/encoder/core/src/au_set.cpp+13−6
@@ -267,7 +267,7 @@ int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_ · 266 unmodified lines
267267 BsWriteUE (pLocalBitStringAux, pSps->iLog2MaxPocLsb - 4); // log2_max_pic_order_cnt_lsb_minus4
268268
269269 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
271271 BsWriteUE (pLocalBitStringAux, pSps->iMbWidth - 1); // pic_width_in_mbs_minus1
272272 BsWriteUE (pLocalBitStringAux, pSps->iMbHeight - 1); // pic_height_in_map_units_minus1
273273 BsWriteOneBit (pLocalBitStringAux, true/*pSps->bFrameMbsOnlyFlag*/); // bFrameMbsOnlyFlag
@@ -464,7 +464,7 @@ static inline bool WelsGetPaddingOffset (int32_t iActualWidth, int32_t iActualHe · 190 unmodified lines
464464 int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal,
465465 const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,
466466 const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc,
467− const int32_t kiDlayerCount) {
467+ const int32_t kiDlayerCount, bool bSVCBaselayer) {
468468 memset (pSps, 0, sizeof (SWelsSPS));
469469 pSps->uiSpsId = kuiSpsId;
470470 pSps->iMbWidth = (pLayerParam->iVideoWidth + 15) >> 4;
@@ -483,7 +483,6 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 12 unmodified lines
483483 } else {
484484 pSps->bFrameCroppingFlag = false;
485485 }
486−
487486 pSps->uiProfileIdc = pLayerParam->uiProfileIdc ? pLayerParam->uiProfileIdc : PRO_BASELINE;
488487 if (pLayerParam->uiProfileIdc == PRO_BASELINE) {
489488 pSps->bConstraintSet0Flag = true;
@@ -491,7 +490,7 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 1 unmodified line
491490 if (pLayerParam->uiProfileIdc <= PRO_MAIN) {
492491 pSps->bConstraintSet1Flag = true;
493492 }
494− if (kiDlayerCount > 1) {
493+ if ((kiDlayerCount > 1) && bSVCBaselayer) {
495494 pSps->bConstraintSet2Flag = true;
496495 }
497496
@@ -508,6 +507,13 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 10 unmodified lines
508507 pLayerParam->uiLevelIdc = uiLevel;
509508 }
510509 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+
511517 pSps->bVuiParamPresentFlag = true;
512518 return 0;
513519 }
@@ -516,13 +522,14 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 2 unmodified lines
516522 int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerParam,
517523 SSpatialLayerInternal* pLayerParamInternal,
518524 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) {
520527 SWelsSPS* pSps = &pSubsetSps->pSps;
521528
522529 memset (pSubsetSps, 0, sizeof (SSubsetSps));
523530
524531 WelsInitSps (pSps, pLayerParam, pLayerParamInternal, kuiIntraPeriod, kiNumRefFrame, kuiSpsId, kbEnableFrameCropping,
525− bEnableRc, 1);
532+ bEnableRc, kiDlayerCount, false);
526533
527534 pSps->uiProfileIdc = (pLayerParam->uiProfileIdc >= PRO_SCALABLE_BASELINE) ? pLayerParam->uiProfileIdc :
528535 PRO_SCALABLE_BASELINE;

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