| 686 | } |
| 687 | |
| 688 | SWelsSvcRc* RcJudgeBaseUsability (sWelsEncCtx* pEncCtx) { |
| 689 | SWelsSvcRc* pWelsSvcRc = NULL, *pWelsSvcRc_Base = NULL; |
| 690 | SSpatialLayerConfig* pDlpBase = NULL, *pDLayerParam = NULL; |
| 691 | SSpatialLayerInternal* pDlpBaseInternal = NULL; |
| 692 | if (pEncCtx->uiDependencyId <= 0) |
| 693 | return NULL; |
| 694 | pDlpBaseInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId - 1]; |
| 695 | pDlpBase = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId - 1]; |
| 696 | pWelsSvcRc_Base = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId - 1]; |
| 697 | if (pEncCtx->uiTemporalId <= pDlpBaseInternal->iDecompositionStages) { |
| 698 | pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |
| 699 | pWelsSvcRc_Base = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId - 1]; |
| 700 | pDLayerParam = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId]; |
| 701 | pDlpBase = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId - 1]; |
| 702 | if ((pDLayerParam->iVideoWidth * pDLayerParam->iVideoHeight / pWelsSvcRc->iNumberMbGom) == |
| 703 | (pDlpBase->iVideoWidth * pDlpBase->iVideoHeight / pWelsSvcRc_Base->iNumberMbGom)) |
| 704 | return pWelsSvcRc_Base; |
| 705 | else |
| 706 | return NULL; |
| 707 | } else |
| 708 | return NULL; |
| 709 | } |
| 710 | |
| 711 | void RcGomTargetBits (sWelsEncCtx* pEncCtx, SSlice* pSlice) { |
| 712 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |