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
37433743 EWelsNalUnitType eNalType = NAL_UNIT_UNSPEC_0;
37443744 EWelsNalRefIdc eNalRefIdc = NRI_PRI_LOWEST;
37453745 int8_t iCurDid = 0;
3746− int8_t iCurTid = 0;
3746+ int32_t iCurTid = 0;
37473747 bool bAvcBased = false;
37483748 SLogContext* pLogCtx = & (pCtx->sLogCtx);
37493749 bool bFinishedWriteHeader = false;
@@ -3792,19 +3792,18 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 42 unmodified lines
37923792 pCtx->pCurDqLayer = pCtx->ppDqLayerList[pSpatialIndexMap->iDid];
37933793 pCtx->pCurDqLayer->pRefLayer = NULL;
37943794
3795− while (iSpatialIdx < iSpatialNum) {
3796− bool bEncoding = pCtx->pVpp->BuildSpatialLayer (pCtx, pSrcPic, iSpatialIdx);
3797− if (!bEncoding) {
3798− ++iSpatialIdx;
3799− continue;
3800− }
3795+ while (iSpatialIdx < pSvcParam->iSpatialLayerNum) {
38013796 const int32_t iDidIdx = (pSpatialIndexMap + iSpatialIdx)->iDid;
38023797 SSpatialLayerConfig* pParam = &pSvcParam->sSpatialLayers[iDidIdx];
38033798 SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iDidIdx];
38043799 int32_t iDecompositionStages = pSvcParam->sDependencyLayers[iDidIdx].iDecompositionStages;
38053800 pCtx->pCurDqLayer = pCtx->ppDqLayerList[iDidIdx];
38063801 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+ }
38083807 eFrameType = DecideFrameType (pCtx, iSpatialNum, iDidIdx);
38093808 if (eFrameType == videoFrameTypeSkip) {
38103809 eFrameType = videoFrameTypeSkip;
@@ -3847,11 +3846,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 36 unmodified lines
38473846 }
38483847 }
38493848 pCtx->iContinualSkipFrames = 0;
3850−
3851− InitFrameCoding (pCtx, eFrameType, iDidIdx);
3852− iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iSpatialIdx], pParamInternal->iCodingIndex,
3853− pSvcParam->uiGopSize);
3849+ iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iDidIdx], pParamInternal->iCodingIndex,
3850+ pSvcParam->uiGopSize);
38543851 pCtx->uiTemporalId = iCurTid;
3852+ InitFrameCoding (pCtx, eFrameType, iDidIdx);
38553853
38563854 if (eFrameType == videoFrameTypeIDR) {
38573855 // 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
44334431 pFbi->iSubSeqId, iFrameSize);
44344432 for (int32_t i = 0; i < iLayerNum; i++)
44354433 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,
44374435 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);
44394437 WelsEmms();
44404438
44414439 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