* Force coding IDR as follows */
| 3037 | * Force coding IDR as follows |
| 3038 | */ |
| 3039 | int32_t ForceCodingIDR (sWelsEncCtx* pCtx, int32_t iLayerId) { |
| 3040 | if (NULL == pCtx) |
| 3041 | return 1; |
| 3042 | if ((iLayerId < 0) || (iLayerId >= MAX_SPATIAL_LAYER_NUM) || (!pCtx->pSvcParam->bSimulcastAVC)) { |
| 3043 | for (int32_t iDid = 0; iDid < pCtx->pSvcParam->iSpatialLayerNum; iDid++) { |
| 3044 | SSpatialLayerInternal* pParamInternal = &pCtx->pSvcParam->sDependencyLayers[iDid]; |
| 3045 | pParamInternal->iCodingIndex = 0; |
| 3046 | pParamInternal->iFrameIndex = 0; |
| 3047 | pParamInternal->iFrameNum = 0; |
| 3048 | pParamInternal->iPOC = 0; |
| 3049 | pParamInternal->bEncCurFrmAsIdrFlag = true; |
| 3050 | pCtx->sEncoderStatistics[0].uiIDRReqNum++; |
| 3051 | } |
| 3052 | WelsLog (&pCtx->sLogCtx, WELS_LOG_INFO, "ForceCodingIDR(iDid 0-%d)at InputFrameCount=%d\n", |
| 3053 | pCtx->pSvcParam->iSpatialLayerNum - 1, pCtx->sEncoderStatistics[0].uiInputFrameCount); |
| 3054 | |
| 3055 | |
| 3056 | |
| 3057 | } else { |
| 3058 | SSpatialLayerInternal* pParamInternal = &pCtx->pSvcParam->sDependencyLayers[iLayerId]; |
| 3059 | pParamInternal->iCodingIndex = 0; |
| 3060 | pParamInternal->iFrameIndex = 0; |
| 3061 | pParamInternal->iFrameNum = 0; |
| 3062 | pParamInternal->iPOC = 0; |
| 3063 | pParamInternal->bEncCurFrmAsIdrFlag = true; |
| 3064 | pCtx->sEncoderStatistics[iLayerId].uiIDRReqNum++; |
| 3065 | WelsLog (&pCtx->sLogCtx, WELS_LOG_INFO, "ForceCodingIDR(iDid %d)at InputFrameCount=%d\n", iLayerId, |
| 3066 | pCtx->sEncoderStatistics[iLayerId].uiInputFrameCount); |
| 3067 | } |
| 3068 | pCtx->bCheckWindowStatusRefreshFlag = false; |
| 3069 | |
| 3070 | |
| 3071 | return 0; |
| 3072 | } |
| 3073 | |
| 3074 | int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { |
| 3075 | if (NULL == pCtx || NULL == pDst) { |
no test coverage detected