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