Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 7 files). Show all
Unified · Split
| @@ -898,7 +898,7 @@ void FreeMbCache (SMbCache* pMbCache, CMemoryAlign* pMa) { · 897 unmodified lines | ||
| 898 | 898 | |
| 899 | 899 | static int32_t WelsGenerateNewSps (sWelsEncCtx* pCtx, const bool kbUseSubsetSps, const int32_t iDlayerIndex, |
| 900 | 900 | const int32_t iDlayerCount, const int32_t kiSpsId, |
| 901 | − SWelsSPS*& pSps, SSubsetSps*& pSubsetSps) { | |
| 901 | + SWelsSPS*& pSps, SSubsetSps*& pSubsetSps, bool bSVCBaselayer) { | |
| 902 | 902 | int32_t iRet = 0; |
| 903 | 903 | |
| 904 | 904 | if (!kbUseSubsetSps) { |
| @@ -914,11 +914,12 @@ static int32_t WelsGenerateNewSps (sWelsEncCtx* pCtx, const bool kbUseSubsetSps, · 9 unmodified lines | ||
| 914 | 914 | if (!kbUseSubsetSps) { |
| 915 | 915 | iRet = WelsInitSps (pSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod, |
| 916 | 916 | pParam->iMaxNumRefFrame, |
| 917 | − kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount); | |
| 917 | + kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount, | |
| 918 | + bSVCBaselayer); | |
| 918 | 919 | } else { |
| 919 | 920 | iRet = WelsInitSubsetSps (pSubsetSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod, |
| 920 | 921 | pParam->iMaxNumRefFrame, |
| 921 | − kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE); | |
| 922 | + kiSpsId, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount); | |
| 922 | 923 | } |
| 923 | 924 | return iRet; |
| 924 | 925 | } |
| @@ -978,7 +979,7 @@ static bool CheckMatchedSubsetSps (SSubsetSps* const pSubsetSps1, SSubsetSps* co · 53 unmodified lines | ||
| 978 | 979 | int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, const int32_t iDlayerIndex, |
| 979 | 980 | const int32_t iDlayerCount, const int32_t iSpsNumInUse, |
| 980 | 981 | SWelsSPS* pSpsArray, |
| 981 | − SSubsetSps* pSubsetArray) { | |
| 982 | + SSubsetSps* pSubsetArray, bool bSVCBaseLayer) { | |
| 982 | 983 | SSpatialLayerConfig* pDlayerParam = &pParam->sSpatialLayers[iDlayerIndex]; |
| 983 | 984 | |
| 984 | 985 | assert (iSpsNumInUse <= MAX_SPS_COUNT); |
| @@ -986,7 +987,8 @@ int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, · 1 unmodified line | ||
| 986 | 987 | SWelsSPS sTmpSps; |
| 987 | 988 | WelsInitSps (&sTmpSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod, |
| 988 | 989 | pParam->iMaxNumRefFrame, |
| 989 | − 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount); | |
| 990 | + 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount, | |
| 991 | + bSVCBaseLayer); | |
| 990 | 992 | for (int32_t iId = 0; iId < iSpsNumInUse; iId++) { |
| 991 | 993 | if (CheckMatchedSps (&sTmpSps, &pSpsArray[iId])) { |
| 992 | 994 | return iId; |
| @@ -996,7 +998,7 @@ int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, · 3 unmodified lines | ||
| 996 | 998 | SSubsetSps sTmpSubsetSps; |
| 997 | 999 | WelsInitSubsetSps (&sTmpSubsetSps, pDlayerParam, &pParam->sDependencyLayers[iDlayerIndex], pParam->uiIntraPeriod, |
| 998 | 1000 | pParam->iMaxNumRefFrame, |
| 999 | − 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE); | |
| 1001 | + 0, pParam->bEnableFrameCroppingFlag, pParam->iRCMode != RC_OFF_MODE, iDlayerCount); | |
| 1000 | 1002 | |
| 1001 | 1003 | for (int32_t iId = 0; iId < iSpsNumInUse; iId++) { |
| 1002 | 1004 | if (CheckMatchedSubsetSps (&sTmpSubsetSps, &pSubsetArray[iId])) { |
| @@ -1258,19 +1260,20 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 255 unmodified lines | ||
| 1258 | 1260 | SDqIdc* pDqIdc = & (*ppCtx)->pDqIdcMap[iDlayerIndex]; |
| 1259 | 1261 | const bool bUseSubsetSps = (!pParam->bSimulcastAVC) && (iDlayerIndex > BASE_DEPENDENCY_ID); |
| 1260 | 1262 | SSpatialLayerConfig* pDlayerParam = &pParam->sSpatialLayers[iDlayerIndex]; |
| 1261 | − | |
| 1263 | + bool bSvcBaselayer = (!pParam->bSimulcastAVC) && (iDlayerCount > BASE_DEPENDENCY_ID) | |
| 1264 | + && (iDlayerIndex == BASE_DEPENDENCY_ID); | |
| 1262 | 1265 | pDqIdc->uiSpatialId = iDlayerIndex; |
| 1263 | 1266 | |
| 1264 | 1267 | if (! (SPS_LISTING & pParam->eSpsPpsIdStrategy)) { |
| 1265 | 1268 | WelsGenerateNewSps (*ppCtx, bUseSubsetSps, iDlayerIndex, |
| 1266 | − iDlayerCount, iSpsId, pSps, pSubsetSps); | |
| 1269 | + iDlayerCount, iSpsId, pSps, pSubsetSps, bSvcBaselayer); | |
| 1267 | 1270 | } else { |
| 1268 | 1271 | //SPS_LISTING_AND_PPS_INCREASING == pParam->eSpsPpsIdStrategy |
| 1269 | 1272 | //check if the current param can fit in an existing SPS |
| 1270 | 1273 | const int32_t kiFoundSpsId = FindExistingSps ((*ppCtx)->pSvcParam, bUseSubsetSps, iDlayerIndex, iDlayerCount, |
| 1271 | 1274 | bUseSubsetSps ? ((*ppCtx)->sPSOVector.uiInUseSubsetSpsNum) : ((*ppCtx)->sPSOVector.uiInUseSpsNum), |
| 1272 | 1275 | (*ppCtx)->pSpsArray, |
| 1273 | − (*ppCtx)->pSubsetArray); | |
| 1276 | + (*ppCtx)->pSubsetArray, bSvcBaselayer); | |
| 1274 | 1277 | |
| 1275 | 1278 | |
| 1276 | 1279 | if (INVALID_ID != kiFoundSpsId) { |
| @@ -1309,7 +1312,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 32 unmodified lines | ||
| 1309 | 1312 | } |
| 1310 | 1313 | |
| 1311 | 1314 | WelsGenerateNewSps (*ppCtx, bUseSubsetSps, iDlayerIndex, |
| 1312 | − iDlayerCount, iSpsId, pSps, pSubsetSps); | |
| 1315 | + iDlayerCount, iSpsId, pSps, pSubsetSps, bSvcBaselayer); | |
| 1313 | 1316 | } |
| 1314 | 1317 | } |
| 1315 | 1318 | |