check the number of spatial layer for screen content

This commit is contained in:
ruil2 2014-06-19 14:46:04 +08:00
parent a6f44f5f79
commit 66447349f6
2 changed files with 23 additions and 12 deletions

View File

@ -84,6 +84,13 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidation(),Invalid usage type = %d\n", pCfg->iUsageType);
return ENC_RETURN_UNSUPPORTED_PARA;
}
if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) {
if (pCfg->iSpatialLayerNum > 1) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidation(),Invalid the number of Spatial layer(%d)for screen content\n",
pCfg->iSpatialLayerNum);
return ENC_RETURN_UNSUPPORTED_PARA;
}
}
for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
SSpatialLayerInternal* fDlp = &pCfg->sDependencyLayers[i];
if (fDlp->fOutputFrameRate > fDlp->fInputFrameRate || (fDlp->fInputFrameRate >= -fEpsn
@ -2941,9 +2948,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
//loop each layer to check if have skip frame when RC and frame skip enable
if (RC_OFF_MODE != pCtx->pSvcParam->iRCMode && true == pCtx->pSvcParam->bEnableFrameSkip) {
bool bSkipMustFlag = false;
for (int32_t i = 0; i< iSpatialNum; i++) {
pCtx->uiDependencyId = (uint8_t)(pSpatialIndexMap+i)->iDid;
pCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge(pCtx);
for (int32_t i = 0; i < iSpatialNum; i++) {
pCtx->uiDependencyId = (uint8_t) (pSpatialIndexMap + i)->iDid;
pCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pCtx);
if (true == pCtx->pWelsSvcRc[pCtx->uiDependencyId].bSkipFlag) {
bSkipMustFlag = true;
}

View File

@ -457,16 +457,20 @@ int32_t CWelsPreProcess::InitLastSpatialPictures (sWelsEncCtx* pCtx) {
SWelsSvcCodingParam* pParam = pCtx->pSvcParam;
const int32_t kiDlayerCount = pParam->iSpatialLayerNum;
int32_t iDlayerIndex = 0;
for (; iDlayerIndex < kiDlayerCount; iDlayerIndex++) {
const int32_t kiLayerInTemporal = m_uiSpatialLayersInTemporal[iDlayerIndex];
m_pLastSpatialPicture[iDlayerIndex][0] = m_pSpatialPic[iDlayerIndex][kiLayerInTemporal - 2];
m_pLastSpatialPicture[iDlayerIndex][1] = NULL;
if (pParam->iUsageType == SCREEN_CONTENT_REAL_TIME) {
for (; iDlayerIndex < MAX_DEPENDENCY_LAYER; iDlayerIndex++) {
m_pLastSpatialPicture[iDlayerIndex][0] = m_pLastSpatialPicture[iDlayerIndex][1] = NULL;
}
} else {
for (; iDlayerIndex < kiDlayerCount; iDlayerIndex++) {
const int32_t kiLayerInTemporal = m_uiSpatialLayersInTemporal[iDlayerIndex];
m_pLastSpatialPicture[iDlayerIndex][0] = m_pSpatialPic[iDlayerIndex][kiLayerInTemporal - 2];
m_pLastSpatialPicture[iDlayerIndex][1] = NULL;
}
for (; iDlayerIndex < MAX_DEPENDENCY_LAYER; iDlayerIndex++) {
m_pLastSpatialPicture[iDlayerIndex][0] = m_pLastSpatialPicture[iDlayerIndex][1] = NULL;
}
}
for (; iDlayerIndex < MAX_DEPENDENCY_LAYER; iDlayerIndex++) {
m_pLastSpatialPicture[iDlayerIndex][0] = m_pLastSpatialPicture[iDlayerIndex][1] = NULL;
}
return 0;
}
//*********************************************************************************************************/