Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 1 file). Show all
Unified · Split
| @@ -252,12 +252,11 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD · 251 unmodified lines | |||
| 252 | 252 | ||
| 253 | AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic); | 253 | AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic); |
| 254 | } | 254 | } |
| 255 | WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]); | ||
| 256 | } | 255 | } |
| 257 | return 0; | 256 | return 0; |
| 258 | } | 257 | } |
| 259 | 258 | ||
| 260 | int32_t CWelsPreProcess::GetCurPicPosition(const int32_t kiDidx) { | 259 | int32_t CWelsPreProcess::GetCurPicPosition (const int32_t kiDidx) { |
| 261 | return (m_uiSpatialLayersInTemporal[kiDidx] - 1); | 260 | return (m_uiSpatialLayersInTemporal[kiDidx] - 1); |
| 262 | } | 261 | } |
| 263 | 262 | ||
| @@ -265,7 +264,10 @@ int32_t CWelsPreProcess::UpdateSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodin · 1 unmodified line | |||
| 265 | const int8_t iCurTid, const int32_t kiDidx) { | 264 | const int8_t iCurTid, const int32_t kiDidx) { |
| 266 | if (pCtx->pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) | 265 | if (pCtx->pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) |
| 267 | return 0; | 266 | return 0; |
| 268 | const int32_t kiCurPos = GetCurPicPosition(kiDidx); | 267 | |
| 268 | WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]); | ||
| 269 | |||
| 270 | const int32_t kiCurPos = GetCurPicPosition (kiDidx); | ||
| 269 | if (iCurTid < kiCurPos || pParam->iDecompStages == 0) { | 271 | if (iCurTid < kiCurPos || pParam->iDecompStages == 0) { |
| 270 | if ((iCurTid >= MAX_TEMPORAL_LEVEL) || (kiCurPos > MAX_TEMPORAL_LEVEL)) { | 272 | if ((iCurTid >= MAX_TEMPORAL_LEVEL) || (kiCurPos > MAX_TEMPORAL_LEVEL)) { |
| 271 | InitLastSpatialPictures (pCtx); | 273 | InitLastSpatialPictures (pCtx); |
| @@ -278,7 +280,7 @@ int32_t CWelsPreProcess::UpdateSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodin · 6 unmodified lines | |||
| 278 | pCtx->bRefOfCurTidIsLtr[kiDidx][iCurTid] = false; | 280 | pCtx->bRefOfCurTidIsLtr[kiDidx][iCurTid] = false; |
| 279 | } | 281 | } |
| 280 | WelsExchangeSpatialPictures (&m_pSpatialPic[kiDidx][kiCurPos], | 282 | WelsExchangeSpatialPictures (&m_pSpatialPic[kiDidx][kiCurPos], |
| 281 | &m_pSpatialPic[kiDidx][iCurTid]); | 283 | &m_pSpatialPic[kiDidx][iCurTid]); |
| 282 | } | 284 | } |
| 283 | return 0; | 285 | return 0; |
| 284 | } | 286 | } |
| @@ -332,7 +334,8 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 47 unmodified lines | |||
| 332 | iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId]; | 334 | iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId]; |
| 333 | iShrinkHeight = pScaledPicture->iScaledHeight[iDependencyId]; | 335 | iShrinkHeight = pScaledPicture->iScaledHeight[iDependencyId]; |
| 334 | } | 336 | } |
| 335 | DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight, false); | 337 | DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight, |
| 338 | false); | ||
| 336 | 339 | ||
| 337 | if (pSvcParam->bEnableSceneChangeDetect && !pCtx->pVaa->bIdrPeriodFlag) { | 340 | if (pSvcParam->bEnableSceneChangeDetect && !pCtx->pVaa->bIdrPeriodFlag) { |
| 338 | if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) { | 341 | if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) { |
| @@ -387,7 +390,8 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 48 unmodified lines | |||
| 387 | pDstPic = m_pSpatialPic[iDependencyId][iPicturePos]; // small | 390 | pDstPic = m_pSpatialPic[iDependencyId][iPicturePos]; // small |
| 388 | iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId]; | 391 | iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId]; |
| 389 | iShrinkHeight = pScaledPicture->iScaledHeight[iDependencyId]; | 392 | iShrinkHeight = pScaledPicture->iScaledHeight[iDependencyId]; |
| 390 | DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight, true); | 393 | DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight, |
| 394 | true); | ||
| 391 | 395 | ||
| 392 | WelsUpdateSpatialIdxMap (pCtx, iActualSpatialLayerNum - 1, pDstPic, iDependencyId); | 396 | WelsUpdateSpatialIdxMap (pCtx, iActualSpatialLayerNum - 1, pDstPic, iDependencyId); |
| 393 | 397 | ||