History

refine build spatial list in processing

volvet committed 12 years ago

Commit 775eeba1 parent e3bf5ce3 files · +11 −22Browse files

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

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+9−20
@@ -305,8 +305,7 @@ void CWelsPreProcess::FreeSpatialPictures (sWelsEncCtx* pCtx) { · 304 unmodified lines
305305 }
306306 }
307307
308−int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePicture** kppSrcPicList,
309− const int32_t kiConfiguredLayerNum) {
308+int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePicture* kpSrcPic) {
310309 SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam;
311310 int32_t iNumDependencyLayer = (int32_t)pSvcParam->iSpatialLayerNum;
312311 int32_t iSpatialNum = 0;
@@ -317,17 +316,11 @@ int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePi · 4 unmodified lines
317316 if (WelsPreprocessReset (pCtx) != 0)
318317 return -1;
319318
320− m_bOfficialBranch = (iNumDependencyLayer != kiConfiguredLayerNum);
321− if (!m_bOfficialBranch && (iNumDependencyLayer == 1)) {
322− // check the input source uiSize to decide if need switch to official branch
323− // NOTICE: the layernum=1 case is confused in official/non-official cases!
324− SSourcePicture** pic_queue = (SSourcePicture**)kppSrcPicList;
325− for (int32_t i = 0; i < iNumDependencyLayer; i++) {
326− if (pSvcParam->sDependencyLayers[i].iFrameWidth != pic_queue[i]->iPicWidth ||
327− pSvcParam->sDependencyLayers[i].iFrameHeight != pic_queue[i]->iPicHeight) {
328− m_bOfficialBranch = true;
329− break;
330− }
319+ m_bOfficialBranch = (iNumDependencyLayer != 1);
320+ if ( iNumDependencyLayer == 1 ) {
321+ if (pSvcParam->sDependencyLayers[0].iFrameWidth != kpSrcPic->iPicWidth ||
322+ pSvcParam->sDependencyLayers[0].iFrameHeight != kpSrcPic->iPicHeight) {
323+ m_bOfficialBranch = true;
331324 }
332325 }
333326 m_bInitDone = true;
@@ -336,19 +329,15 @@ int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePi · 2 unmodified lines
336329 if (m_pInterfaceVp == NULL)
337330 return -1;
338331
339− if (kiConfiguredLayerNum <= 0)
340− return -1;
341−
342332 pCtx->pVaa->bSceneChangeFlag = pCtx->pVaa->bIdrPeriodFlag = false;
343333 if (pSvcParam->uiIntraPeriod)
344334 pCtx->pVaa->bIdrPeriodFlag = (1 + pCtx->iFrameIndex >= (int32_t)pSvcParam->uiIntraPeriod) ? true : false;
345335
346336 if (m_bOfficialBranch) { // Perform Down Sampling potentially due to application
347− assert (kiConfiguredLayerNum == 1);
348− iSpatialNum = SingleLayerPreprocess (pCtx, kppSrcPicList[0], &m_sScaledPicture);
337+ iSpatialNum = SingleLayerPreprocess (pCtx, kpSrcPic, &m_sScaledPicture);
349338 } else { // for console each spatial pictures are available there
350− iSpatialNum = kiConfiguredLayerNum;
351− MultiLayerPreprocess (pCtx, kppSrcPicList, iSpatialNum);
339+ iSpatialNum = 1;
340+ MultiLayerPreprocess (pCtx, &kpSrcPic, iSpatialNum);
352341 }
353342
354343 return iSpatialNum;

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