separate each layer trace output
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 4 files). Show all
Unified · Split
| @@ -3412,7 +3412,7 @@ int32_t ForceCodingIDR (sWelsEncCtx* pCtx) { · 3411 unmodified lines | ||
| 3412 | 3412 | pCtx->bCheckWindowStatusRefreshFlag = false; |
| 3413 | 3413 | |
| 3414 | 3414 | WelsLog (&pCtx->sLogCtx, WELS_LOG_INFO, "ForceCodingIDR at InputFrameCount=%d\n", |
| 3415 | − pCtx->sEncoderStatistics.uiInputFrameCount); | |
| 3415 | + pCtx->sEncoderStatistics[0].uiInputFrameCount); | |
| 3416 | 3416 | return 0; |
| 3417 | 3417 | } |
| 3418 | 3418 | |
| @@ -3435,7 +3435,7 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { · 16 unmodified lines | ||
| 3435 | 3435 | pLayerBsInfo->uiQualityId = 0; |
| 3436 | 3436 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3437 | 3437 | pLayerBsInfo->iNalCount = iCountNal; |
| 3438 | − | |
| 3438 | + pLayerBsInfo->eFrameType = videoFrameTypeIDR; | |
| 3439 | 3439 | //pCtx->eLastNalPriority = NRI_PRI_HIGHEST; |
| 3440 | 3440 | pFbi->iLayerNum = 1; |
| 3441 | 3441 | pFbi->eFrameType = videoFrameTypeInvalid; |
| @@ -3473,7 +3473,7 @@ int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 31 unmodified lines | ||
| 3473 | 3473 | pLayerBsInfo->uiQualityId = 0; |
| 3474 | 3474 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3475 | 3475 | pLayerBsInfo->iNalCount = iCountNal; |
| 3476 | − | |
| 3476 | + pLayerBsInfo->eFrameType = videoFrameTypeIDR; | |
| 3477 | 3477 | //point to next pLayerBsInfo |
| 3478 | 3478 | ++ pLayerBsInfo; |
| 3479 | 3479 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3514,7 +3514,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 34 unmodified lines | ||
| 3514 | 3514 | pLayerBsInfo->uiQualityId = 0; |
| 3515 | 3515 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3516 | 3516 | pLayerBsInfo->iNalCount = iCountNal; |
| 3517 | − | |
| 3517 | + pLayerBsInfo->eFrameType = videoFrameTypeIDR; | |
| 3518 | 3518 | //point to next pLayerBsInfo |
| 3519 | 3519 | ++ pLayerBsInfo; |
| 3520 | 3520 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3547,7 +3547,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 26 unmodified lines | ||
| 3547 | 3547 | pLayerBsInfo->uiQualityId = 0; |
| 3548 | 3548 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3549 | 3549 | pLayerBsInfo->iNalCount = iCountNal; |
| 3550 | − | |
| 3550 | + pLayerBsInfo->eFrameType = videoFrameTypeIDR; | |
| 3551 | 3551 | //point to next pLayerBsInfo |
| 3552 | 3552 | ++ pLayerBsInfo; |
| 3553 | 3553 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3595,7 +3595,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 41 unmodified lines | ||
| 3595 | 3595 | pLayerBsInfo->uiQualityId = 0; |
| 3596 | 3596 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3597 | 3597 | pLayerBsInfo->iNalCount = iCountNal; |
| 3598 | − | |
| 3598 | + pLayerBsInfo->eFrameType = videoFrameTypeIDR; | |
| 3599 | 3599 | //point to next pLayerBsInfo |
| 3600 | 3600 | ++ pLayerBsInfo; |
| 3601 | 3601 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3630,7 +3630,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 28 unmodified lines | ||
| 3630 | 3630 | pLayerBsInfo->uiQualityId = 0; |
| 3631 | 3631 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3632 | 3632 | pLayerBsInfo->iNalCount = iCountNal; |
| 3633 | − | |
| 3633 | + pLayerBsInfo->eFrameType = videoFrameTypeIDR; | |
| 3634 | 3634 | //point to next pLayerBsInfo |
| 3635 | 3635 | ++ pLayerBsInfo; |
| 3636 | 3636 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3745,6 +3745,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 108 unmodified lines | ||
| 3745 | 3745 | pCtx->bCurFrameMarkedAsSceneLtr = false; |
| 3746 | 3746 | pFbi->iLayerNum = 0; // for initialization |
| 3747 | 3747 | pFbi->uiTimeStamp = pSrcPic->uiTimeStamp; |
| 3748 | + for (int32_t iNalIdx = 0; iNalIdx < MAX_LAYER_NUM_OF_FRAME; iNalIdx++) { | |
| 3749 | + pFbi->sLayerInfo[iNalIdx].eFrameType = videoFrameTypeSkip; | |
| 3750 | + } | |
| 3748 | 3751 | // perform csc/denoise/downsample/padding, generate spatial layers |
| 3749 | 3752 | iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic); |
| 3750 | 3753 | if (pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus) { |
| @@ -3953,12 +3956,14 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 202 unmodified lines | ||
| 3953 | 3956 | pLayerBsInfo->uiTemporalId = iCurTid; |
| 3954 | 3957 | pLayerBsInfo->uiQualityId = 0; |
| 3955 | 3958 | pLayerBsInfo->iNalCount = ++ iNalIdxInLayer; |
| 3959 | + pLayerBsInfo->eFrameType = eFrameType; | |
| 3956 | 3960 | } |
| 3957 | 3961 | // for dynamic slicing single threading.. |
| 3958 | 3962 | else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) { |
| 3959 | 3963 | const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->sSliceEncCtx.iMbNumInFrame; |
| 3960 | 3964 | pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0, |
| 3961 | 3965 | kiLastMbInFrame, 0); |
| 3966 | + pLayerBsInfo->eFrameType = eFrameType; | |
| 3962 | 3967 | WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS) |
| 3963 | 3968 | } else { |
| 3964 | 3969 | //other multi-slice uiSliceMode |
| @@ -3984,7 +3989,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 19 unmodified lines | ||
| 3984 | 3989 | pLayerBsInfo->uiTemporalId = pCtx->uiTemporalId; |
| 3985 | 3990 | pLayerBsInfo->uiQualityId = 0; |
| 3986 | 3991 | pLayerBsInfo->iNalCount = 0; |
| 3987 | − | |
| 3992 | + pLayerBsInfo->eFrameType = eFrameType; | |
| 3988 | 3993 | pCtx->pTaskManage->ExecuteTasks(); |
| 3989 | 3994 | if (pCtx->iEncoderError) { |
| 3990 | 3995 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| @@ -4035,7 +4040,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 44 unmodified lines | ||
| 4035 | 4040 | pLbi->uiTemporalId = pCtx->uiTemporalId; |
| 4036 | 4041 | pLbi->uiQualityId = 0; |
| 4037 | 4042 | pLbi->iNalCount = 0; |
| 4038 | − | |
| 4043 | + pLbi->eFrameType = eFrameType; | |
| 4039 | 4044 | int32_t iIdx = 0; |
| 4040 | 4045 | while (iIdx < kiPartitionCnt) { |
| 4041 | 4046 | pCtx->pSliceThreading->pThreadPEncCtx[iIdx].pFrameBsInfo = pFbi; |
| @@ -4103,6 +4108,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 61 unmodified lines | ||
| 4103 | 4108 | pLayerBsInfo->uiTemporalId = iCurTid; |
| 4104 | 4109 | pLayerBsInfo->uiQualityId = 0; |
| 4105 | 4110 | pLayerBsInfo->iNalCount = iNalIdxInLayer; |
| 4111 | + pLayerBsInfo->eFrameType = eFrameType; | |
| 4106 | 4112 | } |
| 4107 | 4113 | } |
| 4108 | 4114 | |
| @@ -4281,6 +4287,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 172 unmodified lines | ||
| 4281 | 4287 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 4282 | 4288 | pLayerBsInfo->iNalCount = 1; |
| 4283 | 4289 | pLayerBsInfo->pNalLengthInByte[0] = iPaddingNalSize; |
| 4290 | + pLayerBsInfo->eFrameType = eFrameType; | |
| 4284 | 4291 | ++ pLayerBsInfo; |
| 4285 | 4292 | ++ pCtx->pOut->iLayerBsIndex; |
| 4286 | 4293 | pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer; |
| @@ -4314,6 +4321,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 27 unmodified lines | ||
| 4314 | 4321 | "WelsEncoderEncodeExt(), Logic Error Found in Preprocess updating. ForceCodingIDR!"); |
| 4315 | 4322 | //the above is to set the next frame IDR |
| 4316 | 4323 | pFbi->eFrameType = eFrameType; |
| 4324 | + pLayerBsInfo->eFrameType = eFrameType; | |
| 4317 | 4325 | return ENC_RETURN_CORRECTED; |
| 4318 | 4326 | } |
| 4319 | 4327 | |
| @@ -4326,9 +4334,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 6 unmodified lines | ||
| 4326 | 4334 | if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) { |
| 4327 | 4335 | pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid); |
| 4328 | 4336 | 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!"); | |
| 4330 | 4338 | //the above is to set the next frame IDR |
| 4331 | 4339 | pFbi->eFrameType = eFrameType; |
| 4340 | + pLayerBsInfo->eFrameType = eFrameType; | |
| 4332 | 4341 | return ENC_RETURN_CORRECTED; |
| 4333 | 4342 | } |
| 4334 | 4343 | |
| @@ -4509,7 +4518,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 174 unmodified lines | ||
| 4509 | 4518 | int32_t iTmpPpsIdList[MAX_DQ_LAYER_NUM * MAX_PPS_COUNT]; |
| 4510 | 4519 | uint16_t uiTmpIdrPicId = (*ppCtx)->uiIdrPicId;//this is for LTR! |
| 4511 | 4520 | |
| 4512 | − SEncoderStatistics sTempEncoderStatistics = (*ppCtx)->sEncoderStatistics; | |
| 4521 | + SEncoderStatistics sTempEncoderStatistics[MAX_DEPENDENCY_LAYER]; | |
| 4522 | + memcpy (sTempEncoderStatistics, (*ppCtx)->sEncoderStatistics, sizeof (sTempEncoderStatistics)); | |
| 4513 | 4523 | |
| 4514 | 4524 | SExistingParasetList sExistingParasetList; |
| 4515 | 4525 | SExistingParasetList* pExistingParasetList = NULL; |
| @@ -4568,8 +4578,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 52 unmodified lines | ||
| 4568 | 4578 | (*ppCtx)->uiIdrPicId = uiTmpIdrPicId; |
| 4569 | 4579 | |
| 4570 | 4580 | //for sEncoderStatistics |
| 4571 | − (*ppCtx)->sEncoderStatistics = sTempEncoderStatistics; | |
| 4572 | − | |
| 4581 | + memcpy ((*ppCtx)->sEncoderStatistics, sTempEncoderStatistics, sizeof (sTempEncoderStatistics)); | |
| 4573 | 4582 | //load back the needed structure for eSpsPpsIdStrategy |
| 4574 | 4583 | if ((CONSTANT_ID != iOldSpsPpsIdStrategy) && (CONSTANT_ID != pNewParam->eSpsPpsIdStrategy)) { |
| 4575 | 4584 | memcpy ((*ppCtx)->sPSOVector.sParaSetOffsetVariable, sTmpPsoVariable, |
| @@ -4934,7 +4943,6 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 358 unmodified lines | ||
| 4934 | 4943 | pLayerBsInfo->uiTemporalId = pCtx->uiTemporalId; |
| 4935 | 4944 | pLayerBsInfo->uiQualityId = 0; |
| 4936 | 4945 | pLayerBsInfo->iNalCount = iNalIdxInLayer; |
| 4937 | − | |
| 4938 | 4946 | return ENC_RETURN_SUCCESS; |
| 4939 | 4947 | } |
| 4940 | 4948 | } // namespace WelsEnc |