History

change downsampling logic that downsampling source is from the nearest layer instead of the highest layer

Karina committed 10 years ago

Commit f84f2311 parent 25f53a25 files · +53 −72Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+12−14
@@ -3743,7 +3743,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3742 unmodified lines
3743 EWelsNalUnitType eNalType = NAL_UNIT_UNSPEC_0;3743 EWelsNalUnitType eNalType = NAL_UNIT_UNSPEC_0;
3744 EWelsNalRefIdc eNalRefIdc = NRI_PRI_LOWEST;3744 EWelsNalRefIdc eNalRefIdc = NRI_PRI_LOWEST;
3745 int8_t iCurDid = 0;3745 int8_t iCurDid = 0;
3746 int8_t iCurTid = 0;3746 int32_t iCurTid = 0;
3747 bool bAvcBased = false;3747 bool bAvcBased = false;
3748 SLogContext* pLogCtx = & (pCtx->sLogCtx);3748 SLogContext* pLogCtx = & (pCtx->sLogCtx);
3749 bool bFinishedWriteHeader = false;3749 bool bFinishedWriteHeader = false;
@@ -3792,19 +3792,18 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 42 unmodified lines
3792 pCtx->pCurDqLayer = pCtx->ppDqLayerList[pSpatialIndexMap->iDid];3792 pCtx->pCurDqLayer = pCtx->ppDqLayerList[pSpatialIndexMap->iDid];
3793 pCtx->pCurDqLayer->pRefLayer = NULL;3793 pCtx->pCurDqLayer->pRefLayer = NULL;
3794 3794
3795 while (iSpatialIdx < iSpatialNum) {3795 while (iSpatialIdx < pSvcParam->iSpatialLayerNum) {
3796 bool bEncoding = pCtx->pVpp->BuildSpatialLayer (pCtx, pSrcPic, iSpatialIdx);
3797 if (!bEncoding) {
3798 ++iSpatialIdx;
3799 continue;
3800 }
3801 const int32_t iDidIdx = (pSpatialIndexMap + iSpatialIdx)->iDid;3796 const int32_t iDidIdx = (pSpatialIndexMap + iSpatialIdx)->iDid;
3802 SSpatialLayerConfig* pParam = &pSvcParam->sSpatialLayers[iDidIdx];3797 SSpatialLayerConfig* pParam = &pSvcParam->sSpatialLayers[iDidIdx];
3803 SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iDidIdx];3798 SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iDidIdx];
3804 int32_t iDecompositionStages = pSvcParam->sDependencyLayers[iDidIdx].iDecompositionStages;3799 int32_t iDecompositionStages = pSvcParam->sDependencyLayers[iDidIdx].iDecompositionStages;
3805 pCtx->pCurDqLayer = pCtx->ppDqLayerList[iDidIdx];3800 pCtx->pCurDqLayer = pCtx->ppDqLayerList[iDidIdx];
3806 pCtx->uiDependencyId = iCurDid = (int8_t)iDidIdx;3801 pCtx->uiDependencyId = iCurDid = (int8_t)iDidIdx;
3807 3802 //skip this spatial layer
3803 if(GetTemporalLevel (pParamInternal, pParamInternal->iCodingIndex,pSvcParam->uiGopSize) == INVALID_TEMPORAL_ID){
3804 ++iSpatialIdx;
3805 continue;
3806 }
3808 eFrameType = DecideFrameType (pCtx, iSpatialNum, iDidIdx);3807 eFrameType = DecideFrameType (pCtx, iSpatialNum, iDidIdx);
3809 if (eFrameType == videoFrameTypeSkip) {3808 if (eFrameType == videoFrameTypeSkip) {
3810 eFrameType = videoFrameTypeSkip;3809 eFrameType = videoFrameTypeSkip;
@@ -3847,11 +3846,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 36 unmodified lines
3847 }3846 }
3848 }3847 }
3849 pCtx->iContinualSkipFrames = 0;3848 pCtx->iContinualSkipFrames = 0;
3850 3849 iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iDidIdx], pParamInternal->iCodingIndex,
3851 InitFrameCoding (pCtx, eFrameType, iDidIdx);3850 pSvcParam->uiGopSize);
3852 iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iSpatialIdx], pParamInternal->iCodingIndex,
3853 pSvcParam->uiGopSize);
3854 pCtx->uiTemporalId = iCurTid;3851 pCtx->uiTemporalId = iCurTid;
3852 InitFrameCoding (pCtx, eFrameType, iDidIdx);
3855 3853
3856 if (eFrameType == videoFrameTypeIDR) {3854 if (eFrameType == videoFrameTypeIDR) {
3857 // write parameter sets bitstream or SEI/SSEI (if any) here3855 // write parameter sets bitstream or SEI/SSEI (if any) here
@@ -4433,9 +4431,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 575 unmodified lines
4433 pFbi->iSubSeqId, iFrameSize);4431 pFbi->iSubSeqId, iFrameSize);
4434 for (int32_t i = 0; i < iLayerNum; i++)4432 for (int32_t i = 0; i < iLayerNum; i++)
4435 WelsLog (pLogCtx, WELS_LOG_DEBUG,4433 WelsLog (pLogCtx, WELS_LOG_DEBUG,
4436 "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d", i,4434 "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d,uiTemporalId = %d", i,
4437 pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0],4435 pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0],
4438 pFbi->sLayerInfo[i].uiSpatialId);4436 pFbi->sLayerInfo[i].uiSpatialId,pFbi->sLayerInfo[i].uiTemporalId);
4439 WelsEmms();4437 WelsEmms();
4440 4438
4441 pLayerBsInfo->eFrameType = eFrameType;4439 pLayerBsInfo->eFrameType = eFrameType;

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