Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -3489,22 +3489,29 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 3488 unmodified lines | |||
| 3489 | pCtx->iContinualSkipFrames = 0; | 3489 | pCtx->iContinualSkipFrames = 0; |
| 3490 | iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iCurDid], pParamInternal->iCodingIndex, | 3490 | iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iCurDid], pParamInternal->iCodingIndex, |
| 3491 | pSvcParam->uiGopSize); | 3491 | pSvcParam->uiGopSize); |
| 3492 | pCtx->uiTemporalId = iCurTid; | 3492 | //skip this spatial layer |
| 3493 | if (eFrameType == videoFrameTypeIDR) { | 3493 | if (iCurTid == INVALID_TEMPORAL_ID) { |
| 3494 | // write parameter sets bitstream or SEI/SSEI (if any) here | 3494 | pParamInternal->iCodingIndex ++; |
| 3495 | // TODO: use function pointer instead | 3495 | eFrameType = videoFrameTypeSkip; |
| 3496 | if (! (SPS_LISTING & pCtx->pSvcParam->eSpsPpsIdStrategy)) { | 3496 | pLayerBsInfo->eFrameType = videoFrameTypeSkip; |
| 3497 | if (pSvcParam->bSimulcastAVC) { | 3497 | } else { |
| 3498 | pCtx->iEncoderError = WriteSavcParaset (pCtx, iCurDid, pLayerBsInfo, iLayerNum, iFrameSize); | 3498 | pCtx->uiTemporalId = iCurTid; |
| 3499 | ++ pCtx->uiIdrPicId; | 3499 | if (eFrameType == videoFrameTypeIDR) { |
| 3500 | // write parameter sets bitstream or SEI/SSEI (if any) here | ||
| 3501 | // TODO: use function pointer instead | ||
| 3502 | if (! (SPS_LISTING & pCtx->pSvcParam->eSpsPpsIdStrategy)) { | ||
| 3503 | if (pSvcParam->bSimulcastAVC) { | ||
| 3504 | pCtx->iEncoderError = WriteSavcParaset (pCtx, iCurDid, pLayerBsInfo, iLayerNum, iFrameSize); | ||
| 3505 | ++ pCtx->uiIdrPicId; | ||
| 3506 | } else { | ||
| 3507 | pCtx->iEncoderError = WriteSsvcParaset (pCtx, iSpatialNum, pLayerBsInfo, iLayerNum, iFrameSize); | ||
| 3508 | ++ pCtx->uiIdrPicId; | ||
| 3509 | } | ||
| 3500 | } else { | 3510 | } else { |
| 3501 | pCtx->iEncoderError = WriteSsvcParaset (pCtx, iSpatialNum, pLayerBsInfo, iLayerNum, iFrameSize); | 3511 | pCtx->iEncoderError = WriteSavcParaset_Listing (pCtx, iSpatialNum, pLayerBsInfo, iLayerNum, iFrameSize); |
| 3512 | |||
| 3502 | ++ pCtx->uiIdrPicId; | 3513 | ++ pCtx->uiIdrPicId; |
| 3503 | } | 3514 | } |
| 3504 | } else { | ||
| 3505 | pCtx->iEncoderError = WriteSavcParaset_Listing (pCtx, iSpatialNum, pLayerBsInfo, iLayerNum, iFrameSize); | ||
| 3506 | |||
| 3507 | ++ pCtx->uiIdrPicId; | ||
| 3508 | } | 3515 | } |
| 3509 | } | 3516 | } |
| 3510 | 3517 | ||
| @@ -3609,12 +3616,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 98 unmodified lines | |||
| 3609 | int32_t iDecompositionStages = pSvcParam->sDependencyLayers[iCurDid].iDecompositionStages; | 3616 | int32_t iDecompositionStages = pSvcParam->sDependencyLayers[iCurDid].iDecompositionStages; |
| 3610 | pCtx->pCurDqLayer = pCtx->ppDqLayerList[iCurDid]; | 3617 | pCtx->pCurDqLayer = pCtx->ppDqLayerList[iCurDid]; |
| 3611 | pCtx->uiDependencyId = iCurDid; | 3618 | pCtx->uiDependencyId = iCurDid; |
| 3612 | //skip this spatial layer | 3619 | |
| 3613 | if (GetTemporalLevel (pParamInternal, pParamInternal->iCodingIndex, pSvcParam->uiGopSize) == INVALID_TEMPORAL_ID) { | ||
| 3614 | ++iSpatialIdx; | ||
| 3615 | pParamInternal->iCodingIndex ++; | ||
| 3616 | continue; | ||
| 3617 | } | ||
| 3618 | if (pSvcParam->bSimulcastAVC) { | 3620 | if (pSvcParam->bSimulcastAVC) { |
| 3619 | eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum , iCurDid, iCurTid, iLayerNum, iFrameSize, | 3621 | eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum , iCurDid, iCurTid, iLayerNum, iFrameSize, |
| 3620 | pFbi->uiTimeStamp); | 3622 | pFbi->uiTimeStamp); |