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/encoder_ext.cpp (1 of 7 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+13−10
@@ -898,7 +898,7 @@ void FreeMbCache (SMbCache* pMbCache, CMemoryAlign* pMa) { · 897 unmodified lines
898898
899899 static int32_t WelsGenerateNewSps (sWelsEncCtx* pCtx, const bool kbUseSubsetSps, const int32_t iDlayerIndex,
900900 const int32_t iDlayerCount, const int32_t kiSpsId,
901− SWelsSPS*& pSps, SSubsetSps*& pSubsetSps) {
901+ SWelsSPS*& pSps, SSubsetSps*& pSubsetSps, bool bSVCBaselayer) {
902902 int32_t iRet = 0;
903903
904904 if (!kbUseSubsetSps) {
@@ -914,11 +914,12 @@ static int32_t WelsGenerateNewSps (sWelsEncCtx* pCtx, const bool kbUseSubsetSps, · 9 unmodified lines
914914 if (!kbUseSubsetSps) {
915915 iRet = WelsInitSps (pSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
916916 pParam->iMaxNumRefFrame,
917− kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
917+ kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount,
918+ bSVCBaselayer);
918919 } else {
919920 iRet = WelsInitSubsetSps (pSubsetSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
920921 pParam->iMaxNumRefFrame,
921− kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE);
922+ kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
922923 }
923924 return iRet;
924925 }
@@ -978,7 +979,7 @@ static bool CheckMatchedSubsetSps (SSubsetSps* const pSubsetSps1, SSubsetSps* co · 53 unmodified lines
978979 int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, const int32_t iDlayerIndex,
979980 const int32_t iDlayerCount, const int32_t iSpsNumInUse,
980981 SWelsSPS* pSpsArray,
981− SSubsetSps* pSubsetArray) {
982+ SSubsetSps* pSubsetArray, bool bSVCBaseLayer) {
982983 SSpatialLayerConfig* pDlayerParam = &pParam->sSpatialLayers[iDlayerIndex];
983984
984985 assert (iSpsNumInUse <= MAX_SPS_COUNT);
@@ -986,7 +987,8 @@ int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, · 1 unmodified line
986987 SWelsSPS sTmpSps;
987988 WelsInitSps (&sTmpSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
988989 pParam->iMaxNumRefFrame,
989− 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
990+ 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount,
991+ bSVCBaseLayer);
990992 for (int32_t iId = 0; iId < iSpsNumInUse; iId++) {
991993 if (CheckMatchedSps (&sTmpSps, &pSpsArray[iId])) {
992994 return iId;
@@ -996,7 +998,7 @@ int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, · 3 unmodified lines
996998 SSubsetSps sTmpSubsetSps;
997999 WelsInitSubsetSps (&sTmpSubsetSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod,
9981000 pParam->iMaxNumRefFrame,
999− 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE);
1001+ 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount);
10001002
10011003 for (int32_t iId = 0; iId < iSpsNumInUse; iId++) {
10021004 if (CheckMatchedSubsetSps (&sTmpSubsetSps, &pSubsetArray[iId])) {
@@ -1258,19 +1260,20 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 255 unmodified lines
12581260 SDqIdc* pDqIdc = & (*ppCtx)->pDqIdcMap[iDlayerIndex];
12591261 const bool bUseSubsetSps = (!pParam->bSimulcastAVC) && (iDlayerIndex > BASE_DEPENDENCY_ID);
12601262 SSpatialLayerConfig* pDlayerParam = &pParam->sSpatialLayers[iDlayerIndex];
1261−
1263+ bool bSvcBaselayer = (!pParam->bSimulcastAVC) && (iDlayerCount > BASE_DEPENDENCY_ID)
1264+ && (iDlayerIndex == BASE_DEPENDENCY_ID);
12621265 pDqIdc->uiSpatialId = iDlayerIndex;
12631266
12641267 if (! (SPS_LISTING & pParam->eSpsPpsIdStrategy)) {
12651268 WelsGenerateNewSps (*ppCtx, bUseSubsetSps, iDlayerIndex,
1266− iDlayerCount, iSpsId, pSps, pSubsetSps);
1269+ iDlayerCount, iSpsId, pSps, pSubsetSps, bSvcBaselayer);
12671270 } else {
12681271 //SPS_LISTING_AND_PPS_INCREASING == pParam->eSpsPpsIdStrategy
12691272 //check if the current param can fit in an existing SPS
12701273 const int32_t kiFoundSpsId = FindExistingSps ((*ppCtx)->pSvcParam, bUseSubsetSps, iDlayerIndex, iDlayerCount,
12711274 bUseSubsetSps ? ((*ppCtx)->sPSOVector.uiInUseSubsetSpsNum) : ((*ppCtx)->sPSOVector.uiInUseSpsNum),
12721275 (*ppCtx)->pSpsArray,
1273− (*ppCtx)->pSubsetArray);
1276+ (*ppCtx)->pSubsetArray, bSvcBaselayer);
12741277
12751278
12761279 if (INVALID_ID != kiFoundSpsId) {
@@ -1309,7 +1312,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 32 unmodified lines
13091312 }
13101313
13111314 WelsGenerateNewSps (*ppCtx, bUseSubsetSps, iDlayerIndex,
1312− iDlayerCount, iSpsId, pSps, pSubsetSps);
1315+ iDlayerCount, iSpsId, pSps, pSubsetSps, bSvcBaselayer);
13131316 }
13141317 }
13151318

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