Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 20 files). Show all
Unified · Split
| @@ -263,7 +263,7 @@ int32_t CWelsPreProcess::WelsPreprocessReset (sWelsEncCtx* pCtx) { · 262 unmodified lines | ||
| 263 | 263 | int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePicture** kppSrcPicList, |
| 264 | 264 | const int32_t kiConfiguredLayerNum) { |
| 265 | 265 | SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam; |
| 266 | − int32_t iNumDependencyLayer = (int32_t)pSvcParam->iNumDependencyLayer; | |
| 266 | + int32_t iNumDependencyLayer = (int32_t)pSvcParam->iSpatialLayerNum; | |
| 267 | 267 | int32_t iSpatialNum = 0; |
| 268 | 268 | |
| 269 | 269 | if (!m_bInitDone) { |
| @@ -359,7 +359,7 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD · 89 unmodified lines | ||
| 359 | 359 | int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSourcePicture* kpSrc, |
| 360 | 360 | Scaled_Picture* pScaledPicture) { |
| 361 | 361 | SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam; |
| 362 | − int8_t iDependencyId = pSvcParam->iNumDependencyLayer - 1; | |
| 362 | + int8_t iDependencyId = pSvcParam->iSpatialLayerNum - 1; | |
| 363 | 363 | int32_t iPicturePos = pCtx->uiSpatialLayersInTemporal[iDependencyId] - 1; |
| 364 | 364 | |
| 365 | 365 | SPicture* pSrcPic = NULL; // large |
| @@ -410,7 +410,7 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 44 unmodified lines | ||
| 410 | 410 | pCtx->pVaa->bSceneChangeFlag = DetectSceneChange (pDstPic, pRefPic); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | − for (int32_t i = 0; i < pSvcParam->iNumDependencyLayer; i++) { | |
| 413 | + for (int32_t i = 0; i < pSvcParam->iSpatialLayerNum; i++) { | |
| 414 | 414 | if (pSvcParam->sDependencyLayers[i].uiCodingIdx2TemporalId[pCtx->iCodingIndex & (pSvcParam->uiGopSize - 1)] |
| 415 | 415 | != INVALID_TEMPORAL_ID) { |
| 416 | 416 | ++ iActualSpatialLayerNum; |
| @@ -430,7 +430,7 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 13 unmodified lines | ||
| 430 | 430 | // pSrc is |
| 431 | 431 | // -- padded input pic, if downsample should be applied to generate highest layer, [if] block above |
| 432 | 432 | // -- highest layer, if no downsampling, [else] block above |
| 433 | − if (pSvcParam->iNumDependencyLayer > 1) { | |
| 433 | + if (pSvcParam->iSpatialLayerNum > 1) { | |
| 434 | 434 | while (iDependencyId >= 0) { |
| 435 | 435 | pDlayerParam = &pSvcParam->sDependencyLayers[iDependencyId]; |
| 436 | 436 | iTargetWidth = pDlayerParam->iFrameWidth; |
| @@ -468,7 +468,7 @@ int32_t CWelsPreProcess::MultiLayerPreprocess (sWelsEncCtx* pCtx, const SSourceP · 31 unmodified lines | ||
| 468 | 468 | const SSourcePicture* pSrc = NULL; |
| 469 | 469 | SPicture* pDstPic = NULL; |
| 470 | 470 | 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 | |
| 472 | 472 | int32_t i = 0; |
| 473 | 473 | int32_t j = -1; |
| 474 | 474 | |
| @@ -498,7 +498,7 @@ int32_t CWelsPreProcess::MultiLayerPreprocess (sWelsEncCtx* pCtx, const SSourceP · 23 unmodified lines | ||
| 498 | 498 | ++ i; |
| 499 | 499 | } while (i < kiSpatialNum); |
| 500 | 500 | |
| 501 | − if (pSvcParam->bEnableSceneChangeDetect && (kiSpatialNum == pSvcParam->iNumDependencyLayer) | |
| 501 | + if (pSvcParam->bEnableSceneChangeDetect && (kiSpatialNum == pSvcParam->iSpatialLayerNum) | |
| 502 | 502 | && !pCtx->pVaa->bIdrPeriodFlag && !pCtx->bEncCurFrmAsIdrFlag) { |
| 503 | 503 | SPicture* pRef = pCtx->pLtr[0].bReceivedT0LostFlag ? |
| 504 | 504 | pCtx->pSpatialPic[0][pCtx->uiSpatialLayersInTemporal[0] + pCtx->pVaa->uiValidLongTermPicIdx] : |
| @@ -516,11 +516,11 @@ int32_t CWelsPreProcess::MultiLayerPreprocess (sWelsEncCtx* pCtx, const SSourceP · 11 unmodified lines | ||
| 516 | 516 | bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPicture) { |
| 517 | 517 | const int32_t kiInputPicWidth = pParam->SUsedPicRect.iWidth; |
| 518 | 518 | 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; | |
| 521 | 521 | bool bNeedDownsampling = true; |
| 522 | 522 | |
| 523 | − int32_t iSpatialIdx = pParam->iNumDependencyLayer - 1; | |
| 523 | + int32_t iSpatialIdx = pParam->iSpatialLayerNum - 1; | |
| 524 | 524 | |
| 525 | 525 | if (kiDstPicWidth >= kiInputPicWidth && kiDstPicHeight >= kiInputPicHeight) { |
| 526 | 526 | iSpatialIdx --; // highest D layer do not need downsampling |
| @@ -566,7 +566,7 @@ void FreeScaledPic (Scaled_Picture* pScaledPicture, CMemoryAlign* pMemoryAlign · 39 unmodified lines | ||
| 566 | 566 | |
| 567 | 567 | int32_t CWelsPreProcess::InitLastSpatialPictures (sWelsEncCtx* pCtx) { |
| 568 | 568 | SWelsSvcCodingParam* pParam = pCtx->pSvcParam; |
| 569 | − const int32_t kiDlayerCount = pParam->iNumDependencyLayer; | |
| 569 | + const int32_t kiDlayerCount = pParam->iSpatialLayerNum; | |
| 570 | 570 | int32_t iDlayerIndex = 0; |
| 571 | 571 | |
| 572 | 572 | for (; iDlayerIndex < kiDlayerCount; iDlayerIndex++) { |