| 232 | } |
| 233 | |
| 234 | void UpdateFrameNum (sWelsEncCtx* pEncCtx, const int32_t kiDidx) { |
| 235 | SSpatialLayerInternal* pParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[kiDidx]; |
| 236 | bool bNeedFrameNumIncreasing = false; |
| 237 | |
| 238 | if (NRI_PRI_LOWEST != pEncCtx->eLastNalPriority[kiDidx]) { |
| 239 | bNeedFrameNumIncreasing = true; |
| 240 | } |
| 241 | |
| 242 | if (bNeedFrameNumIncreasing) { |
| 243 | if (pParamInternal->iFrameNum < (1 << pEncCtx->pSps->uiLog2MaxFrameNum) - 1) |
| 244 | ++ pParamInternal->iFrameNum; |
| 245 | else |
| 246 | pParamInternal->iFrameNum = 0; // if iFrameNum overflow |
| 247 | } |
| 248 | |
| 249 | pEncCtx->eLastNalPriority[kiDidx] = NRI_PRI_LOWEST; |
| 250 | } |
| 251 | |
| 252 | |
| 253 | void LoadBackFrameNum (sWelsEncCtx* pEncCtx, const int32_t kiDidx) { |