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
267 BsWriteUE (pLocalBitStringAux, pSps->iLog2MaxPocLsb - 4); // log2_max_pic_order_cnt_lsb_minus4267 BsWriteUE (pLocalBitStringAux, pSps->iLog2MaxPocLsb - 4); // log2_max_pic_order_cnt_lsb_minus4
268 268
269 BsWriteUE (pLocalBitStringAux, pSps->iNumRefFrames); // max_num_ref_frames269 BsWriteUE (pLocalBitStringAux, pSps->iNumRefFrames); // max_num_ref_frames
270 BsWriteOneBit (pLocalBitStringAux, true/*pSps->bGapsInFrameNumValueAllowedFlag*/); // bGapsInFrameNumValueAllowedFlag270 BsWriteOneBit (pLocalBitStringAux, pSps->bGapsInFrameNumValueAllowedFlag); //gaps_in_frame_numvalue_allowed_flag
271 BsWriteUE (pLocalBitStringAux, pSps->iMbWidth - 1); // pic_width_in_mbs_minus1271 BsWriteUE (pLocalBitStringAux, pSps->iMbWidth - 1); // pic_width_in_mbs_minus1
272 BsWriteUE (pLocalBitStringAux, pSps->iMbHeight - 1); // pic_height_in_map_units_minus1272 BsWriteUE (pLocalBitStringAux, pSps->iMbHeight - 1); // pic_height_in_map_units_minus1
273 BsWriteOneBit (pLocalBitStringAux, true/*pSps->bFrameMbsOnlyFlag*/); // bFrameMbsOnlyFlag273 BsWriteOneBit (pLocalBitStringAux, true/*pSps->bFrameMbsOnlyFlag*/); // bFrameMbsOnlyFlag
@@ -464,7 +464,7 @@ static inline bool WelsGetPaddingOffset (int32_t iActualWidth, int32_t iActualHe · 190 unmodified lines
464int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal,464int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal,
465 const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,465 const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,
466 const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc,466 const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc,
467 const int32_t kiDlayerCount) {467 const int32_t kiDlayerCount, bool bSVCBaselayer) {
468 memset (pSps, 0, sizeof (SWelsSPS));468 memset (pSps, 0, sizeof (SWelsSPS));
469 pSps->uiSpsId = kuiSpsId;469 pSps->uiSpsId = kuiSpsId;
470 pSps->iMbWidth = (pLayerParam->iVideoWidth + 15) >> 4;470 pSps->iMbWidth = (pLayerParam->iVideoWidth + 15) >> 4;
@@ -483,7 +483,6 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 12 unmodified lines
483 } else {483 } else {
484 pSps->bFrameCroppingFlag = false;484 pSps->bFrameCroppingFlag = false;
485 }485 }
486
487 pSps->uiProfileIdc = pLayerParam->uiProfileIdc ? pLayerParam->uiProfileIdc : PRO_BASELINE;486 pSps->uiProfileIdc = pLayerParam->uiProfileIdc ? pLayerParam->uiProfileIdc : PRO_BASELINE;
488 if (pLayerParam->uiProfileIdc == PRO_BASELINE) {487 if (pLayerParam->uiProfileIdc == PRO_BASELINE) {
489 pSps->bConstraintSet0Flag = true;488 pSps->bConstraintSet0Flag = true;
@@ -491,7 +490,7 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 1 unmodified line
491 if (pLayerParam->uiProfileIdc <= PRO_MAIN) {490 if (pLayerParam->uiProfileIdc <= PRO_MAIN) {
492 pSps->bConstraintSet1Flag = true;491 pSps->bConstraintSet1Flag = true;
493 }492 }
494 if (kiDlayerCount > 1) {493 if ((kiDlayerCount > 1) && bSVCBaselayer) {
495 pSps->bConstraintSet2Flag = true;494 pSps->bConstraintSet2Flag = true;
496 }495 }
497 496
@@ -508,6 +507,13 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 10 unmodified lines
508 pLayerParam->uiLevelIdc = uiLevel;507 pLayerParam->uiLevelIdc = uiLevel;
509 }508 }
510 pSps->iLevelIdc = g_kuiLevelMaps[pLayerParam->uiLevelIdc - 1];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 pSps->bVuiParamPresentFlag = true;517 pSps->bVuiParamPresentFlag = true;
512 return 0;518 return 0;
513}519}
@@ -516,13 +522,14 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 2 unmodified lines
516int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerParam,522int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerParam,
517 SSpatialLayerInternal* pLayerParamInternal,523 SSpatialLayerInternal* pLayerParamInternal,
518 const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,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 SWelsSPS* pSps = &pSubsetSps->pSps;527 SWelsSPS* pSps = &pSubsetSps->pSps;
521 528
522 memset (pSubsetSps, 0, sizeof (SSubsetSps));529 memset (pSubsetSps, 0, sizeof (SSubsetSps));
523 530
524 WelsInitSps (pSps, pLayerParam, pLayerParamInternal, kuiIntraPeriod, kiNumRefFrame, kuiSpsId, kbEnableFrameCropping,531 WelsInitSps (pSps, pLayerParam, pLayerParamInternal, kuiIntraPeriod, kiNumRefFrame, kuiSpsId, kbEnableFrameCropping,
525 bEnableRc, 1);532 bEnableRc, kiDlayerCount, false);
526 533
527 pSps->uiProfileIdc = (pLayerParam->uiProfileIdc >= PRO_SCALABLE_BASELINE) ? pLayerParam->uiProfileIdc :534 pSps->uiProfileIdc = (pLayerParam->uiProfileIdc >= PRO_SCALABLE_BASELINE) ? pLayerParam->uiProfileIdc :
528 PRO_SCALABLE_BASELINE;535 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