History

Merge pull request #2325 from ruil2/trace1

separate each layer trace output

HaiboZhu committed 10 years ago

Commit b940e2c2 parents 737548f d4f979c4 files · +147 −115Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+22−14
@@ -3412,7 +3412,7 @@ int32_t ForceCodingIDR (sWelsEncCtx* pCtx) { · 3411 unmodified lines
34123412 pCtx->bCheckWindowStatusRefreshFlag = false;
34133413
34143414 WelsLog (&pCtx->sLogCtx, WELS_LOG_INFO, "ForceCodingIDR at InputFrameCount=%d\n",
3415− pCtx->sEncoderStatistics.uiInputFrameCount);
3415+ pCtx->sEncoderStatistics[0].uiInputFrameCount);
34163416 return 0;
34173417 }
34183418
@@ -3435,7 +3435,7 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { · 16 unmodified lines
34353435 pLayerBsInfo->uiQualityId = 0;
34363436 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
34373437 pLayerBsInfo->iNalCount = iCountNal;
3438−
3438+ pLayerBsInfo->eFrameType = videoFrameTypeIDR;
34393439 //pCtx->eLastNalPriority = NRI_PRI_HIGHEST;
34403440 pFbi->iLayerNum = 1;
34413441 pFbi->eFrameType = videoFrameTypeInvalid;
@@ -3473,7 +3473,7 @@ int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 31 unmodified lines
34733473 pLayerBsInfo->uiQualityId = 0;
34743474 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
34753475 pLayerBsInfo->iNalCount = iCountNal;
3476−
3476+ pLayerBsInfo->eFrameType = videoFrameTypeIDR;
34773477 //point to next pLayerBsInfo
34783478 ++ pLayerBsInfo;
34793479 ++ pCtx->pOut->iLayerBsIndex;
@@ -3514,7 +3514,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 34 unmodified lines
35143514 pLayerBsInfo->uiQualityId = 0;
35153515 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
35163516 pLayerBsInfo->iNalCount = iCountNal;
3517−
3517+ pLayerBsInfo->eFrameType = videoFrameTypeIDR;
35183518 //point to next pLayerBsInfo
35193519 ++ pLayerBsInfo;
35203520 ++ pCtx->pOut->iLayerBsIndex;
@@ -3547,7 +3547,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 26 unmodified lines
35473547 pLayerBsInfo->uiQualityId = 0;
35483548 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
35493549 pLayerBsInfo->iNalCount = iCountNal;
3550−
3550+ pLayerBsInfo->eFrameType = videoFrameTypeIDR;
35513551 //point to next pLayerBsInfo
35523552 ++ pLayerBsInfo;
35533553 ++ pCtx->pOut->iLayerBsIndex;
@@ -3595,7 +3595,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 41 unmodified lines
35953595 pLayerBsInfo->uiQualityId = 0;
35963596 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
35973597 pLayerBsInfo->iNalCount = iCountNal;
3598−
3598+ pLayerBsInfo->eFrameType = videoFrameTypeIDR;
35993599 //point to next pLayerBsInfo
36003600 ++ pLayerBsInfo;
36013601 ++ pCtx->pOut->iLayerBsIndex;
@@ -3630,7 +3630,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 28 unmodified lines
36303630 pLayerBsInfo->uiQualityId = 0;
36313631 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
36323632 pLayerBsInfo->iNalCount = iCountNal;
3633−
3633+ pLayerBsInfo->eFrameType = videoFrameTypeIDR;
36343634 //point to next pLayerBsInfo
36353635 ++ pLayerBsInfo;
36363636 ++ pCtx->pOut->iLayerBsIndex;
@@ -3745,6 +3745,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 108 unmodified lines
37453745 pCtx->bCurFrameMarkedAsSceneLtr = false;
37463746 pFbi->iLayerNum = 0; // for initialization
37473747 pFbi->uiTimeStamp = pSrcPic->uiTimeStamp;
3748+ for (int32_t iNalIdx = 0; iNalIdx < MAX_LAYER_NUM_OF_FRAME; iNalIdx++) {
3749+ pFbi->sLayerInfo[iNalIdx].eFrameType = videoFrameTypeSkip;
3750+ }
37483751 // perform csc/denoise/downsample/padding, generate spatial layers
37493752 iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic);
37503753 if (pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus) {
@@ -3953,12 +3956,14 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 202 unmodified lines
39533956 pLayerBsInfo->uiTemporalId = iCurTid;
39543957 pLayerBsInfo->uiQualityId = 0;
39553958 pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;
3959+ pLayerBsInfo->eFrameType = eFrameType;
39563960 }
39573961 // for dynamic slicing single threading..
39583962 else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) {
39593963 const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->sSliceEncCtx.iMbNumInFrame;
39603964 pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0,
39613965 kiLastMbInFrame, 0);
3966+ pLayerBsInfo->eFrameType = eFrameType;
39623967 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
39633968 } else {
39643969 //other multi-slice uiSliceMode
@@ -3984,7 +3989,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 19 unmodified lines
39843989 pLayerBsInfo->uiTemporalId = pCtx->uiTemporalId;
39853990 pLayerBsInfo->uiQualityId = 0;
39863991 pLayerBsInfo->iNalCount = 0;
3987−
3992+ pLayerBsInfo->eFrameType = eFrameType;
39883993 pCtx->pTaskManage->ExecuteTasks();
39893994 if (pCtx->iEncoderError) {
39903995 WelsLog (pLogCtx, WELS_LOG_ERROR,
@@ -4035,7 +4040,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 44 unmodified lines
40354040 pLbi->uiTemporalId = pCtx->uiTemporalId;
40364041 pLbi->uiQualityId = 0;
40374042 pLbi->iNalCount = 0;
4038−
4043+ pLbi->eFrameType = eFrameType;
40394044 int32_t iIdx = 0;
40404045 while (iIdx < kiPartitionCnt) {
40414046 pCtx->pSliceThreading->pThreadPEncCtx[iIdx].pFrameBsInfo = pFbi;
@@ -4103,6 +4108,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 61 unmodified lines
41034108 pLayerBsInfo->uiTemporalId = iCurTid;
41044109 pLayerBsInfo->uiQualityId = 0;
41054110 pLayerBsInfo->iNalCount = iNalIdxInLayer;
4111+ pLayerBsInfo->eFrameType = eFrameType;
41064112 }
41074113 }
41084114
@@ -4281,6 +4287,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 172 unmodified lines
42814287 pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
42824288 pLayerBsInfo->iNalCount = 1;
42834289 pLayerBsInfo->pNalLengthInByte[0] = iPaddingNalSize;
4290+ pLayerBsInfo->eFrameType = eFrameType;
42844291 ++ pLayerBsInfo;
42854292 ++ pCtx->pOut->iLayerBsIndex;
42864293 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
@@ -4314,6 +4321,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 27 unmodified lines
43144321 "WelsEncoderEncodeExt(), Logic Error Found in Preprocess updating. ForceCodingIDR!");
43154322 //the above is to set the next frame IDR
43164323 pFbi->eFrameType = eFrameType;
4324+ pLayerBsInfo->eFrameType = eFrameType;
43174325 return ENC_RETURN_CORRECTED;
43184326 }
43194327
@@ -4326,9 +4334,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 6 unmodified lines
43264334 if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) {
43274335 pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid);
43284336 ForceCodingIDR (pCtx);
4329− WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!");
4337+ WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!");
43304338 //the above is to set the next frame IDR
43314339 pFbi->eFrameType = eFrameType;
4340+ pLayerBsInfo->eFrameType = eFrameType;
43324341 return ENC_RETURN_CORRECTED;
43334342 }
43344343
@@ -4509,7 +4518,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 174 unmodified lines
45094518 int32_t iTmpPpsIdList[MAX_DQ_LAYER_NUM * MAX_PPS_COUNT];
45104519 uint16_t uiTmpIdrPicId = (*ppCtx)->uiIdrPicId;//this is for LTR!
45114520
4512− SEncoderStatistics sTempEncoderStatistics = (*ppCtx)->sEncoderStatistics;
4521+ SEncoderStatistics sTempEncoderStatistics[MAX_DEPENDENCY_LAYER];
4522+ memcpy (sTempEncoderStatistics, (*ppCtx)->sEncoderStatistics, sizeof (sTempEncoderStatistics));
45134523
45144524 SExistingParasetList sExistingParasetList;
45154525 SExistingParasetList* pExistingParasetList = NULL;
@@ -4568,8 +4578,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 52 unmodified lines
45684578 (*ppCtx)->uiIdrPicId = uiTmpIdrPicId;
45694579
45704580 //for sEncoderStatistics
4571− (*ppCtx)->sEncoderStatistics = sTempEncoderStatistics;
4572−
4581+ memcpy ((*ppCtx)->sEncoderStatistics, sTempEncoderStatistics, sizeof (sTempEncoderStatistics));
45734582 //load back the needed structure for eSpsPpsIdStrategy
45744583 if ((CONSTANT_ID != iOldSpsPpsIdStrategy) && (CONSTANT_ID != pNewParam->eSpsPpsIdStrategy)) {
45754584 memcpy ((*ppCtx)->sPSOVector.sParaSetOffsetVariable, sTmpPsoVariable,
@@ -4934,7 +4943,6 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 358 unmodified lines
49344943 pLayerBsInfo->uiTemporalId = pCtx->uiTemporalId;
49354944 pLayerBsInfo->uiQualityId = 0;
49364945 pLayerBsInfo->iNalCount = iNalIdxInLayer;
4937−
49384946 return ENC_RETURN_SUCCESS;
49394947 }
49404948 } // namespace WelsEnc

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