History

move the post-encoding exchanging in preprocessing to more reasonable function

Sijia Chen committed 11 years ago

Commit 84b441d1 parent 32d15101 file · +10 −6Browse files

Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+10−6
@@ -252,12 +252,11 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD · 251 unmodified lines
252252
253253 AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic);
254254 }
255− WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]);
256255 }
257256 return 0;
258257 }
259258
260−int32_t CWelsPreProcess::GetCurPicPosition(const int32_t kiDidx) {
259+int32_t CWelsPreProcess::GetCurPicPosition (const int32_t kiDidx) {
261260 return (m_uiSpatialLayersInTemporal[kiDidx] - 1);
262261 }
263262
@@ -265,7 +264,10 @@ int32_t CWelsPreProcess::UpdateSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodin · 1 unmodified line
265264 const int8_t iCurTid, const int32_t kiDidx) {
266265 if (pCtx->pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME)
267266 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);
269271 if (iCurTid < kiCurPos || pParam->iDecompStages == 0) {
270272 if ((iCurTid >= MAX_TEMPORAL_LEVEL) || (kiCurPos > MAX_TEMPORAL_LEVEL)) {
271273 InitLastSpatialPictures (pCtx);
@@ -278,7 +280,7 @@ int32_t CWelsPreProcess::UpdateSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodin · 6 unmodified lines
278280 pCtx->bRefOfCurTidIsLtr[kiDidx][iCurTid] = false;
279281 }
280282 WelsExchangeSpatialPictures (&m_pSpatialPic[kiDidx][kiCurPos],
281− &m_pSpatialPic[kiDidx][iCurTid]);
283+ &m_pSpatialPic[kiDidx][iCurTid]);
282284 }
283285 return 0;
284286 }
@@ -332,7 +334,8 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 47 unmodified lines
332334 iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId];
333335 iShrinkHeight = pScaledPicture->iScaledHeight[iDependencyId];
334336 }
335− DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight, false);
337+ DownsamplePadding (pSrcPic, pDstPic, iSrcWidth, iSrcHeight, iShrinkWidth, iShrinkHeight, iTargetWidth, iTargetHeight,
338+ false);
336339
337340 if (pSvcParam->bEnableSceneChangeDetect && !pCtx->pVaa->bIdrPeriodFlag) {
338341 if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) {
@@ -387,7 +390,8 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 48 unmodified lines
387390 pDstPic = m_pSpatialPic[iDependencyId][iPicturePos]; // small
388391 iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId];
389392 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);
391395
392396 WelsUpdateSpatialIdxMap (pCtx, iActualSpatialLayerNum - 1, pDstPic, iDependencyId);
393397

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