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 | 253 | AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic); |
| 254 | 254 | } |
| 255 | − WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]); | |
| 256 | 255 | } |
| 257 | 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 | 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 | 264 | const int8_t iCurTid, const int32_t kiDidx) { |
| 266 | 265 | if (pCtx->pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) |
| 267 | 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 | 271 | if (iCurTid < kiCurPos || pParam->iDecompStages == 0) { |
| 270 | 272 | if ((iCurTid >= MAX_TEMPORAL_LEVEL) || (kiCurPos > MAX_TEMPORAL_LEVEL)) { |
| 271 | 273 | InitLastSpatialPictures (pCtx); |
| @@ -278,7 +280,7 @@ int32_t CWelsPreProcess::UpdateSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodin · 6 unmodified lines | ||
| 278 | 280 | pCtx->bRefOfCurTidIsLtr[kiDidx][iCurTid] = false; |
| 279 | 281 | } |
| 280 | 282 | WelsExchangeSpatialPictures (&m_pSpatialPic[kiDidx][kiCurPos], |
| 281 | − &m_pSpatialPic[kiDidx][iCurTid]); | |
| 283 | + &m_pSpatialPic[kiDidx][iCurTid]); | |
| 282 | 284 | } |
| 283 | 285 | return 0; |
| 284 | 286 | } |
| @@ -332,7 +334,8 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 47 unmodified lines | ||
| 332 | 334 | iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId]; |
| 333 | 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 | 340 | if (pSvcParam->bEnableSceneChangeDetect && !pCtx->pVaa->bIdrPeriodFlag) { |
| 338 | 341 | if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) { |
| @@ -387,7 +390,8 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 48 unmodified lines | ||
| 387 | 390 | pDstPic = m_pSpatialPic[iDependencyId][iPicturePos]; // small |
| 388 | 391 | iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId]; |
| 389 | 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 | 396 | WelsUpdateSpatialIdxMap (pCtx, iActualSpatialLayerNum - 1, pDstPic, iDependencyId); |
| 393 | 397 | |