History

fix temporal layer skip issue

Karina committed 10 years ago

Commit c298d661 parent 6d796011 file · +21 −19Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+21−19
@@ -3489,22 +3489,29 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 3488 unmodified lines
34893489 pCtx->iContinualSkipFrames = 0;
34903490 iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iCurDid], pParamInternal->iCodingIndex,
34913491 pSvcParam->uiGopSize);
3492− pCtx->uiTemporalId = iCurTid;
3493− if (eFrameType == videoFrameTypeIDR) {
3494− // write parameter sets bitstream or SEI/SSEI (if any) here
3495− // TODO: use function pointer instead
3496− if (! (SPS_LISTING & pCtx->pSvcParam->eSpsPpsIdStrategy)) {
3497− if (pSvcParam->bSimulcastAVC) {
3498− pCtx->iEncoderError = WriteSavcParaset (pCtx, iCurDid, pLayerBsInfo, iLayerNum, iFrameSize);
3499− ++ pCtx->uiIdrPicId;
3492+ //skip this spatial layer
3493+ if (iCurTid == INVALID_TEMPORAL_ID) {
3494+ pParamInternal->iCodingIndex ++;
3495+ eFrameType = videoFrameTypeSkip;
3496+ pLayerBsInfo->eFrameType = videoFrameTypeSkip;
3497+ } else {
3498+ pCtx->uiTemporalId = iCurTid;
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+ }
35003510 } else {
3501− pCtx->iEncoderError = WriteSsvcParaset (pCtx, iSpatialNum, pLayerBsInfo, iLayerNum, iFrameSize);
3511+ pCtx->iEncoderError = WriteSavcParaset_Listing (pCtx, iSpatialNum, pLayerBsInfo, iLayerNum, iFrameSize);
3512+
35023513 ++ pCtx->uiIdrPicId;
35033514 }
3504− } else {
3505− pCtx->iEncoderError = WriteSavcParaset_Listing (pCtx, iSpatialNum, pLayerBsInfo, iLayerNum, iFrameSize);
3506−
3507− ++ pCtx->uiIdrPicId;
35083515 }
35093516 }
35103517
@@ -3609,12 +3616,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 98 unmodified lines
36093616 int32_t iDecompositionStages = pSvcParam->sDependencyLayers[iCurDid].iDecompositionStages;
36103617 pCtx->pCurDqLayer = pCtx->ppDqLayerList[iCurDid];
36113618 pCtx->uiDependencyId = iCurDid;
3612− //skip this spatial layer
3613− if (GetTemporalLevel (pParamInternal, pParamInternal->iCodingIndex, pSvcParam->uiGopSize) == INVALID_TEMPORAL_ID) {
3614− ++iSpatialIdx;
3615− pParamInternal->iCodingIndex ++;
3616− continue;
3617− }
3619+
36183620 if (pSvcParam->bSimulcastAVC) {
36193621 eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum , iCurDid, iCurTid, iLayerNum, iFrameSize,
36203622 pFbi->uiTimeStamp);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t