Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 2 files). Show all
Unified · Split
| @@ -3181,6 +3181,7 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) { · 3180 unmodified lines | |||
| 3181 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; | 3181 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3182 | pLayerBsInfo->iNalCount = iCountNal; | 3182 | pLayerBsInfo->iNalCount = iCountNal; |
| 3183 | pLayerBsInfo->eFrameType = videoFrameTypeInvalid; | 3183 | pLayerBsInfo->eFrameType = videoFrameTypeInvalid; |
| 3184 | pLayerBsInfo->iSubSeqId = 0; | ||
| 3184 | //pCtx->eLastNalPriority = NRI_PRI_HIGHEST; | 3185 | //pCtx->eLastNalPriority = NRI_PRI_HIGHEST; |
| 3185 | pFbi->iLayerNum = 1; | 3186 | pFbi->iLayerNum = 1; |
| 3186 | pFbi->eFrameType = videoFrameTypeInvalid; | 3187 | pFbi->eFrameType = videoFrameTypeInvalid; |
| @@ -3218,6 +3219,7 @@ int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 31 unmodified lines | |||
| 3218 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; | 3219 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3219 | pLayerBsInfo->iNalCount = iCountNal; | 3220 | pLayerBsInfo->iNalCount = iCountNal; |
| 3220 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; | 3221 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; |
| 3222 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR); | ||
| 3221 | //point to next pLayerBsInfo | 3223 | //point to next pLayerBsInfo |
| 3222 | ++ pLayerBsInfo; | 3224 | ++ pLayerBsInfo; |
| 3223 | ++ pCtx->pOut->iLayerBsIndex; | 3225 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3262,6 +3264,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t iIdx, · 38 unmodified lines | |||
| 3262 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; | 3264 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3263 | pLayerBsInfo->iNalCount = iCountNal; | 3265 | pLayerBsInfo->iNalCount = iCountNal; |
| 3264 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; | 3266 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; |
| 3267 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR); | ||
| 3265 | //point to next pLayerBsInfo | 3268 | //point to next pLayerBsInfo |
| 3266 | ++ pLayerBsInfo; | 3269 | ++ pLayerBsInfo; |
| 3267 | ++ pCtx->pOut->iLayerBsIndex; | 3270 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3296,6 +3299,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t iIdx, · 28 unmodified lines | |||
| 3296 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; | 3299 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3297 | pLayerBsInfo->iNalCount = iCountNal; | 3300 | pLayerBsInfo->iNalCount = iCountNal; |
| 3298 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; | 3301 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; |
| 3302 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR); | ||
| 3299 | //point to next pLayerBsInfo | 3303 | //point to next pLayerBsInfo |
| 3300 | ++ pLayerBsInfo; | 3304 | ++ pLayerBsInfo; |
| 3301 | ++ pCtx->pOut->iLayerBsIndex; | 3305 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3343,6 +3347,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 41 unmodified lines | |||
| 3343 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; | 3347 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3344 | pLayerBsInfo->iNalCount = iCountNal; | 3348 | pLayerBsInfo->iNalCount = iCountNal; |
| 3345 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; | 3349 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; |
| 3350 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR); | ||
| 3346 | //point to next pLayerBsInfo | 3351 | //point to next pLayerBsInfo |
| 3347 | ++ pLayerBsInfo; | 3352 | ++ pLayerBsInfo; |
| 3348 | ++ pCtx->pOut->iLayerBsIndex; | 3353 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3376,6 +3381,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 27 unmodified lines | |||
| 3376 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; | 3381 | pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER; |
| 3377 | pLayerBsInfo->iNalCount = iCountNal; | 3382 | pLayerBsInfo->iNalCount = iCountNal; |
| 3378 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; | 3383 | pLayerBsInfo->eFrameType = videoFrameTypeIDR; |
| 3384 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR); | ||
| 3379 | //point to next pLayerBsInfo | 3385 | //point to next pLayerBsInfo |
| 3380 | ++ pLayerBsInfo; | 3386 | ++ pLayerBsInfo; |
| 3381 | ++ pCtx->pOut->iLayerBsIndex; | 3387 | ++ pCtx->pOut->iLayerBsIndex; |
| @@ -3772,6 +3778,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 390 unmodified lines | |||
| 3772 | pLayerBsInfo->uiQualityId = 0; | 3778 | pLayerBsInfo->uiQualityId = 0; |
| 3773 | pLayerBsInfo->iNalCount = ++ iNalIdxInLayer; | 3779 | pLayerBsInfo->iNalCount = ++ iNalIdxInLayer; |
| 3774 | pLayerBsInfo->eFrameType = eFrameType; | 3780 | pLayerBsInfo->eFrameType = eFrameType; |
| 3781 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | ||
| 3775 | } | 3782 | } |
| 3776 | // for dynamic slicing single threading.. | 3783 | // for dynamic slicing single threading.. |
| 3777 | else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) { | 3784 | else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) { |
| @@ -3779,6 +3786,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1 unmodified line | |||
| 3779 | pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0, | 3786 | pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0, |
| 3780 | kiLastMbInFrame, 0); | 3787 | kiLastMbInFrame, 0); |
| 3781 | pLayerBsInfo->eFrameType = eFrameType; | 3788 | pLayerBsInfo->eFrameType = eFrameType; |
| 3789 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | ||
| 3782 | WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS) | 3790 | WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS) |
| 3783 | } else { | 3791 | } else { |
| 3784 | //other multi-slice uiSliceMode | 3792 | //other multi-slice uiSliceMode |
| @@ -3805,6 +3813,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 20 unmodified lines | |||
| 3805 | pLayerBsInfo->uiQualityId = 0; | 3813 | pLayerBsInfo->uiQualityId = 0; |
| 3806 | pLayerBsInfo->iNalCount = 0; | 3814 | pLayerBsInfo->iNalCount = 0; |
| 3807 | pLayerBsInfo->eFrameType = eFrameType; | 3815 | pLayerBsInfo->eFrameType = eFrameType; |
| 3816 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | ||
| 3808 | pCtx->pTaskManage->ExecuteTasks(); | 3817 | pCtx->pTaskManage->ExecuteTasks(); |
| 3809 | if (pCtx->iEncoderError) { | 3818 | if (pCtx->iEncoderError) { |
| 3810 | WelsLog (pLogCtx, WELS_LOG_ERROR, | 3819 | WelsLog (pLogCtx, WELS_LOG_ERROR, |
| @@ -3856,7 +3865,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 45 unmodified lines | |||
| 3856 | pLbi->uiQualityId = 0; | 3865 | pLbi->uiQualityId = 0; |
| 3857 | pLbi->iNalCount = 0; | 3866 | pLbi->iNalCount = 0; |
| 3858 | pLbi->eFrameType = eFrameType; | 3867 | pLbi->eFrameType = eFrameType; |
| 3859 | 3868 | pLbi->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | |
| 3860 | int32_t iIdx = 0; | 3869 | int32_t iIdx = 0; |
| 3861 | while (iIdx < kiPartitionCnt) { | 3870 | while (iIdx < kiPartitionCnt) { |
| 3862 | pCtx->pSliceThreading->pThreadPEncCtx[iIdx].pFrameBsInfo = pFbi; | 3871 | pCtx->pSliceThreading->pThreadPEncCtx[iIdx].pFrameBsInfo = pFbi; |
| @@ -3925,6 +3934,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 62 unmodified lines | |||
| 3925 | pLayerBsInfo->uiQualityId = 0; | 3934 | pLayerBsInfo->uiQualityId = 0; |
| 3926 | pLayerBsInfo->iNalCount = iNalIdxInLayer; | 3935 | pLayerBsInfo->iNalCount = iNalIdxInLayer; |
| 3927 | pLayerBsInfo->eFrameType = eFrameType; | 3936 | pLayerBsInfo->eFrameType = eFrameType; |
| 3937 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | ||
| 3928 | } | 3938 | } |
| 3929 | } | 3939 | } |
| 3930 | 3940 | ||
| @@ -4103,6 +4113,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 172 unmodified lines | |||
| 4103 | pLayerBsInfo->iNalCount = 1; | 4113 | pLayerBsInfo->iNalCount = 1; |
| 4104 | pLayerBsInfo->pNalLengthInByte[0] = iPaddingNalSize; | 4114 | pLayerBsInfo->pNalLengthInByte[0] = iPaddingNalSize; |
| 4105 | pLayerBsInfo->eFrameType = eFrameType; | 4115 | pLayerBsInfo->eFrameType = eFrameType; |
| 4116 | pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | ||
| 4106 | ++ pLayerBsInfo; | 4117 | ++ pLayerBsInfo; |
| 4107 | ++ pCtx->pOut->iLayerBsIndex; | 4118 | ++ pCtx->pOut->iLayerBsIndex; |
| 4108 | pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer; | 4119 | pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer; |
| @@ -4187,17 +4198,14 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 78 unmodified lines | |||
| 4187 | 4198 | ||
| 4188 | 4199 | ||
| 4189 | pFbi->iLayerNum = iLayerNum; | 4200 | pFbi->iLayerNum = iLayerNum; |
| 4190 | pFbi->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); | ||
| 4191 | 4201 | ||
| 4192 | WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iSubSeqId = %d,iFrameSize = %d", | 4202 | WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iFrameSize = %d", |
| 4193 | iLayerNum, | 4203 | iLayerNum,iFrameSize); |
| 4194 | pFbi->iSubSeqId, iFrameSize); | ||
| 4195 | for (int32_t i = 0; i < iLayerNum; i++) | 4204 | for (int32_t i = 0; i < iLayerNum; i++) |
| 4196 | WelsLog (pLogCtx, WELS_LOG_DEBUG, | 4205 | WelsLog (pLogCtx, WELS_LOG_DEBUG, |
| 4197 | "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d,uiTemporalId = %d", | 4206 | "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d,uiTemporalId = %d,iSubSeqId = %d",i, |
| 4198 | i, | ||
| 4199 | pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0], | 4207 | pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0], |
| 4200 | pFbi->sLayerInfo[i].uiSpatialId, pFbi->sLayerInfo[i].uiTemporalId); | 4208 | pFbi->sLayerInfo[i].uiSpatialId, pFbi->sLayerInfo[i].uiTemporalId,pFbi->sLayerInfo[i].iSubSeqId); |
| 4201 | WelsEmms(); | 4209 | WelsEmms(); |
| 4202 | 4210 | ||
| 4203 | pLayerBsInfo->eFrameType = eFrameType; | 4211 | pLayerBsInfo->eFrameType = eFrameType; |