| 67 | } |
| 68 | |
| 69 | void SetPartitonMBNum (SDqLayer* pCurDqLayer, SSpatialLayerConfig* pLayerCfg, int32_t iPartNum) { |
| 70 | int32_t iMBWidth = (pLayerCfg->iVideoWidth + 15) >> 4; |
| 71 | int32_t iMBHeight = (pLayerCfg->iVideoHeight + 15) >> 4; |
| 72 | int32_t iMbNumInFrame = iMBWidth * iMBHeight; |
| 73 | int32_t iMBPerPart = iMbNumInFrame / iPartNum; |
| 74 | |
| 75 | if (0 == iMBPerPart) { |
| 76 | iPartNum = 1; |
| 77 | iMBPerPart = iMbNumInFrame; |
| 78 | } |
| 79 | |
| 80 | for (int32_t iPartIdx = 0; iPartIdx < (iPartNum - 1); iPartIdx++) { |
| 81 | pCurDqLayer->FirstMbIdxOfPartition[iPartIdx] = iMBPerPart * iPartIdx; |
| 82 | pCurDqLayer->EndMbIdxOfPartition[iPartIdx] = pCurDqLayer->FirstMbIdxOfPartition[iPartIdx] + iMBPerPart - 1; |
| 83 | } |
| 84 | |
| 85 | pCurDqLayer->FirstMbIdxOfPartition[iPartNum - 1] = iMBPerPart * (iPartNum - 1); |
| 86 | pCurDqLayer->EndMbIdxOfPartition[iPartNum - 1] = iMbNumInFrame - 1; |
| 87 | |
| 88 | for (int32_t iPartIdx = iPartNum; iPartIdx < MAX_THREADS_NUM; iPartIdx++) { |
| 89 | pCurDqLayer->FirstMbIdxOfPartition[iPartIdx] = 0; |
| 90 | pCurDqLayer->EndMbIdxOfPartition[iPartIdx] = 0; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | int32_t InitParamForSizeLimitSlcMode (sWelsEncCtx* pCtx, const int32_t iLayerIdx) { |
| 95 | SSpatialLayerConfig* pLayerCfg = &pCtx->pSvcParam->sSpatialLayers[iLayerIdx]; |
no outgoing calls
no test coverage detected