Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 2 files). Show all
Unified · Split
| @@ -3114,11 +3114,8 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 3113 unmodified lines | |||
| 3114 | * \brief swap pDq layers between current pDq layer and reference pDq layer | 3114 | * \brief swap pDq layers between current pDq layer and reference pDq layer |
| 3115 | */ | 3115 | */ |
| 3116 | 3116 | ||
| 3117 | static inline void WelsSwapDqLayers (sWelsEncCtx* pCtx) { | 3117 | static inline void WelsSwapDqLayers (sWelsEncCtx* pCtx, const int32_t kiNextDqIdx) { |
| 3118 | // swap and assign reference | 3118 | // swap and assign reference |
| 3119 | const int32_t kiDid = pCtx->uiDependencyId; | ||
| 3120 | const int32_t kiNextDqIdx = 1 + kiDid; | ||
| 3121 | |||
| 3122 | SDqLayer* pTmpLayer = pCtx->ppDqLayerList[kiNextDqIdx]; | 3119 | SDqLayer* pTmpLayer = pCtx->ppDqLayerList[kiNextDqIdx]; |
| 3123 | SDqLayer* pRefLayer = pCtx->pCurDqLayer; | 3120 | SDqLayer* pRefLayer = pCtx->pCurDqLayer; |
| 3124 | pCtx->pCurDqLayer = pTmpLayer; | 3121 | pCtx->pCurDqLayer = pTmpLayer; |
| @@ -4384,7 +4381,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1259 unmodified lines | |||
| 4384 | ++ iSpatialIdx; | 4381 | ++ iSpatialIdx; |
| 4385 | 4382 | ||
| 4386 | if (iCurDid + 1 < pSvcParam->iSpatialLayerNum) { | 4383 | if (iCurDid + 1 < pSvcParam->iSpatialLayerNum) { |
| 4387 | WelsSwapDqLayers (pCtx); | 4384 | //for next layer, note that iSpatialIdx has been ++ so it is pointer to next layer |
| 4385 | WelsSwapDqLayers (pCtx, (pSpatialIndexMap + iSpatialIdx)->iDid); | ||
| 4388 | } | 4386 | } |
| 4389 | 4387 | ||
| 4390 | if (pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx) != 0) { | 4388 | if (pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx) != 0) { |
| @@ -4400,7 +4398,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 9 unmodified lines | |||
| 4400 | && (pCtx->pLtr[pCtx->uiDependencyId].iLTRMarkMode == LTR_DIRECT_MARK)) || eFrameType == videoFrameTypeIDR)) { | 4398 | && (pCtx->pLtr[pCtx->uiDependencyId].iLTRMarkMode == LTR_DIRECT_MARK)) || eFrameType == videoFrameTypeIDR)) { |
| 4401 | pCtx->bRefOfCurTidIsLtr[iDidIdx][iCurTid] = true; | 4399 | pCtx->bRefOfCurTidIsLtr[iDidIdx][iCurTid] = true; |
| 4402 | } | 4400 | } |
| 4403 | } | 4401 | }//end of (iSpatialIdx/iSpatialNum) |
| 4404 | 4402 | ||
| 4405 | if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) { | 4403 | if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) { |
| 4406 | pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid); | 4404 | pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid); |
| @@ -4448,8 +4446,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 41 unmodified lines | |||
| 4448 | iLayerNum, | 4446 | iLayerNum, |
| 4449 | pFbi->iSubSeqId, iFrameSize); | 4447 | pFbi->iSubSeqId, iFrameSize); |
| 4450 | for (int32_t i = 0; i < iLayerNum; i++) | 4448 | for (int32_t i = 0; i < iLayerNum; i++) |
| 4451 | WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d", i, | 4449 | WelsLog (pLogCtx, WELS_LOG_DEBUG, |
| 4452 | pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount); | 4450 | "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d", i, |
| 4451 | pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0]); | ||
| 4453 | WelsEmms(); | 4452 | WelsEmms(); |
| 4454 | 4453 | ||
| 4455 | pFbi->eFrameType = eFrameType; | 4454 | pFbi->eFrameType = eFrameType; |