| @@ -1127,18 +1127,16 @@ void InitSliceRefInfoWithBase (SSlice* pSlice, SSlice* pBaseSlice, const uint8_t · 1126 unmodified lines |
| 1127 | | 1127 | |
| 1128 | } | 1128 | } |
| 1129 | | 1129 | |
| 1130 | static inline int32_t InitSliceRC (SSlice* pSlice, const int32_t kiGlobalQp, const int32_t kiBitsPerMb) { | 1130 | static inline int32_t InitSliceRC (SSlice* pSlice, const int32_t kiGlobalQp) { |
| 1131 | | 1131 | |
| 1132 | if (NULL == pSlice || kiGlobalQp < 0 || kiBitsPerMb < 0) | 1132 | if (NULL == pSlice || kiGlobalQp < 0) |
| 1133 | return ENC_RETURN_INVALIDINPUT; | 1133 | return ENC_RETURN_INVALIDINPUT; |
| 1134 | | 1134 | |
| 1135 | pSlice->sSlicingOverRc.iComplexityIndexSlice = 0; | 1135 | pSlice->sSlicingOverRc.iComplexityIndexSlice = 0; |
| 1136 | pSlice->sSlicingOverRc.iCalculatedQpSlice = kiGlobalQp; | 1136 | pSlice->sSlicingOverRc.iCalculatedQpSlice = kiGlobalQp; |
| 1137 | pSlice->sSlicingOverRc.iTotalQpSlice = 0; | 1137 | pSlice->sSlicingOverRc.iTotalQpSlice = 0; |
| 1138 | pSlice->sSlicingOverRc.iTotalMbSlice = 0; | 1138 | pSlice->sSlicingOverRc.iTotalMbSlice = 0; |
| 1139 | pSlice->sSlicingOverRc.iTargetBitsSlice = WELS_DIV_ROUND (kiBitsPerMb * | 1139 | pSlice->sSlicingOverRc.iTargetBitsSlice = 0; |
| 1140 | pSlice->iCountMbNumInSlice, | | |
| 1141 | INT_MULTIPLY); | | |
| 1142 | pSlice->sSlicingOverRc.iFrameBitsSlice = 0; | 1140 | pSlice->sSlicingOverRc.iFrameBitsSlice = 0; |
| 1143 | pSlice->sSlicingOverRc.iGomBitsSlice = 0; | 1141 | pSlice->sSlicingOverRc.iGomBitsSlice = 0; |
| 1144 | | 1142 | |
| @@ -1158,8 +1156,6 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 13 unmodified lines |
| 1158 | int32_t iRet = 0; | 1156 | int32_t iRet = 0; |
| 1159 | const int32_t kiCurDid = pCtx->uiDependencyId; | 1157 | const int32_t kiCurDid = pCtx->uiDependencyId; |
| 1160 | int32_t iMaxSliceBufferSize = (pCtx)->iSliceBufferSize[kiCurDid]; | 1158 | int32_t iMaxSliceBufferSize = (pCtx)->iSliceBufferSize[kiCurDid]; |
| 1161 | int32_t iBitsPerMb = WELS_DIV_ROUND (pCtx->pWelsSvcRc[kiCurDid].iTargetBits * INT_MULTIPLY, | | |
| 1162 | pCtx->pWelsSvcRc[kiCurDid].iNumberMbFrame); | | |
| 1163 | bool bIndependenceBsBuffer = (pCtx->pSvcParam->iMultipleThreadIdc > 1 && | 1159 | bool bIndependenceBsBuffer = (pCtx->pSvcParam->iMultipleThreadIdc > 1 && |
| 1164 | SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false; | 1160 | SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false; |
| 1165 | | 1161 | |
| @@ -1211,7 +1207,7 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 45 unmodified lines |
| 1211 | InitSliceHeadWithBase (pSlice, pBaseSlice); | 1207 | InitSliceHeadWithBase (pSlice, pBaseSlice); |
| 1212 | InitSliceRefInfoWithBase (pSlice, pBaseSlice, pCtx->iNumRef0); | 1208 | InitSliceRefInfoWithBase (pSlice, pBaseSlice, pCtx->iNumRef0); |
| 1213 | | 1209 | |
| 1214 | iRet = InitSliceRC (pSlice, pCtx->iGlobalQp, iBitsPerMb); | 1210 | iRet = InitSliceRC (pSlice, pCtx->iGlobalQp); |
| 1215 | if (ENC_RETURN_SUCCESS != iRet) { | 1211 | if (ENC_RETURN_SUCCESS != iRet) { |
| 1216 | FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "ReallocateSliceList()::InitSliceBsBuffer()"); | 1212 | FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "ReallocateSliceList()::InitSliceBsBuffer()"); |
| 1217 | return iRet; | 1213 | return iRet; |
| @@ -1345,6 +1341,7 @@ int32_t ReallocSliceBuffer (sWelsEncCtx* pCtx) { · 127 unmodified lines |
| 1345 | pMA->WelsFree (pCurLayer->pCountMbNumInSlice, "pCountMbNumInSlice"); | 1341 | pMA->WelsFree (pCurLayer->pCountMbNumInSlice, "pCountMbNumInSlice"); |
| 1346 | pCurLayer->pCountMbNumInSlice = pCountMbNumInSlice; | 1342 | pCurLayer->pCountMbNumInSlice = pCountMbNumInSlice; |
| 1347 | | 1343 | |
| | 1344 | |
| 1348 | for (iSliceIdx = 0; iSliceIdx < iMaxSliceNumNew; iSliceIdx++) { | 1345 | for (iSliceIdx = 0; iSliceIdx < iMaxSliceNumNew; iSliceIdx++) { |
| 1349 | pCurLayer->ppSliceInLayer[iSliceIdx] = pCurLayer->sSliceThreadInfo.pSliceInThread[0] + iSliceIdx; | 1346 | pCurLayer->ppSliceInLayer[iSliceIdx] = pCurLayer->sSliceThreadInfo.pSliceInThread[0] + iSliceIdx; |
| 1350 | } | 1347 | } |
| @@ -1358,7 +1355,6 @@ int32_t ReallocSliceBuffer (sWelsEncCtx* pCtx) { · 7 unmodified lines |
| 1358 | return ENC_RETURN_SUCCESS; | 1355 | return ENC_RETURN_SUCCESS; |
| 1359 | } | 1356 | } |
| 1360 | | 1357 | |
| 1361 | | | |
| 1362 | /* | 1358 | /* |
| 1363 | int32_t ReOrderSliceInLayer (SDqLayer* pCurLayer, | 1359 | int32_t ReOrderSliceInLayer (SDqLayer* pCurLayer, |
| 1364 | const int32_t kiThreadNum, | 1360 | const int32_t kiThreadNum, |