History

encoder interface update step1

ruil2 committed 12 years ago

Commit 35fa4291 parent 3ff7e3d20 files · +598 −501Browse files

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

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+10−10
@@ -263,7 +263,7 @@ int32_t CWelsPreProcess::WelsPreprocessReset (sWelsEncCtx* pCtx) { · 262 unmodified lines
263263 int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePicture** kppSrcPicList,
264264 const int32_t kiConfiguredLayerNum) {
265265 SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam;
266− int32_t iNumDependencyLayer = (int32_t)pSvcParam->iNumDependencyLayer;
266+ int32_t iNumDependencyLayer = (int32_t)pSvcParam->iSpatialLayerNum;
267267 int32_t iSpatialNum = 0;
268268
269269 if (!m_bInitDone) {
@@ -359,7 +359,7 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD · 89 unmodified lines
359359 int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSourcePicture* kpSrc,
360360 Scaled_Picture* pScaledPicture) {
361361 SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam;
362− int8_t iDependencyId = pSvcParam->iNumDependencyLayer - 1;
362+ int8_t iDependencyId = pSvcParam->iSpatialLayerNum - 1;
363363 int32_t iPicturePos = pCtx->uiSpatialLayersInTemporal[iDependencyId] - 1;
364364
365365 SPicture* pSrcPic = NULL; // large
@@ -410,7 +410,7 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 44 unmodified lines
410410 pCtx->pVaa->bSceneChangeFlag = DetectSceneChange (pDstPic, pRefPic);
411411 }
412412
413− for (int32_t i = 0; i < pSvcParam->iNumDependencyLayer; i++) {
413+ for (int32_t i = 0; i < pSvcParam->iSpatialLayerNum; i++) {
414414 if (pSvcParam->sDependencyLayers[i].uiCodingIdx2TemporalId[pCtx->iCodingIndex & (pSvcParam->uiGopSize - 1)]
415415 != INVALID_TEMPORAL_ID) {
416416 ++ iActualSpatialLayerNum;
@@ -430,7 +430,7 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 13 unmodified lines
430430 // pSrc is
431431 // -- padded input pic, if downsample should be applied to generate highest layer, [if] block above
432432 // -- highest layer, if no downsampling, [else] block above
433− if (pSvcParam->iNumDependencyLayer > 1) {
433+ if (pSvcParam->iSpatialLayerNum > 1) {
434434 while (iDependencyId >= 0) {
435435 pDlayerParam = &pSvcParam->sDependencyLayers[iDependencyId];
436436 iTargetWidth = pDlayerParam->iFrameWidth;
@@ -468,7 +468,7 @@ int32_t CWelsPreProcess::MultiLayerPreprocess (sWelsEncCtx* pCtx, const SSourceP · 31 unmodified lines
468468 const SSourcePicture* pSrc = NULL;
469469 SPicture* pDstPic = NULL;
470470 const int32_t iSpatialLayersCfgCount =
471− pSvcParam->iNumDependencyLayer; // count number of spatial layers to be encoded in cfg
471+ pSvcParam->iSpatialLayerNum; // count number of spatial layers to be encoded in cfg
472472 int32_t i = 0;
473473 int32_t j = -1;
474474
@@ -498,7 +498,7 @@ int32_t CWelsPreProcess::MultiLayerPreprocess (sWelsEncCtx* pCtx, const SSourceP · 23 unmodified lines
498498 ++ i;
499499 } while (i < kiSpatialNum);
500500
501− if (pSvcParam->bEnableSceneChangeDetect && (kiSpatialNum == pSvcParam->iNumDependencyLayer)
501+ if (pSvcParam->bEnableSceneChangeDetect && (kiSpatialNum == pSvcParam->iSpatialLayerNum)
502502 && !pCtx->pVaa->bIdrPeriodFlag && !pCtx->bEncCurFrmAsIdrFlag) {
503503 SPicture* pRef = pCtx->pLtr[0].bReceivedT0LostFlag ?
504504 pCtx->pSpatialPic[0][pCtx->uiSpatialLayersInTemporal[0] + pCtx->pVaa->uiValidLongTermPicIdx] :
@@ -516,11 +516,11 @@ int32_t CWelsPreProcess::MultiLayerPreprocess (sWelsEncCtx* pCtx, const SSourceP · 11 unmodified lines
516516 bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPicture) {
517517 const int32_t kiInputPicWidth = pParam->SUsedPicRect.iWidth;
518518 const int32_t kiInputPicHeight = pParam->SUsedPicRect.iHeight;
519− const int32_t kiDstPicWidth = pParam->sDependencyLayers[pParam->iNumDependencyLayer - 1].iActualWidth;
520− const int32_t kiDstPicHeight = pParam->sDependencyLayers[pParam->iNumDependencyLayer - 1].iActualHeight;
519+ const int32_t kiDstPicWidth = pParam->sDependencyLayers[pParam->iSpatialLayerNum - 1].iActualWidth;
520+ const int32_t kiDstPicHeight = pParam->sDependencyLayers[pParam->iSpatialLayerNum - 1].iActualHeight;
521521 bool bNeedDownsampling = true;
522522
523− int32_t iSpatialIdx = pParam->iNumDependencyLayer - 1;
523+ int32_t iSpatialIdx = pParam->iSpatialLayerNum - 1;
524524
525525 if (kiDstPicWidth >= kiInputPicWidth && kiDstPicHeight >= kiInputPicHeight) {
526526 iSpatialIdx --; // highest D layer do not need downsampling
@@ -566,7 +566,7 @@ void FreeScaledPic (Scaled_Picture* pScaledPicture, CMemoryAlign* pMemoryAlign · 39 unmodified lines
566566
567567 int32_t CWelsPreProcess::InitLastSpatialPictures (sWelsEncCtx* pCtx) {
568568 SWelsSvcCodingParam* pParam = pCtx->pSvcParam;
569− const int32_t kiDlayerCount = pParam->iNumDependencyLayer;
569+ const int32_t kiDlayerCount = pParam->iSpatialLayerNum;
570570 int32_t iDlayerIndex = 0;
571571
572572 for (; iDlayerIndex < kiDlayerCount; iDlayerIndex++) {

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