| 216 | } |
| 217 | |
| 218 | int32_t CWelsPreProcess::BuildSpatialPicList (sWelsEncCtx* pCtx, const SSourcePicture* kpSrcPic) { |
| 219 | SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam; |
| 220 | int32_t iSpatialNum = 0; |
| 221 | int32_t iWidth = ((kpSrcPic->iPicWidth >> 1) << 1); |
| 222 | int32_t iHeight = ((kpSrcPic->iPicHeight >> 1) << 1); |
| 223 | |
| 224 | if (!m_bInitDone) { |
| 225 | if (WelsPreprocessCreate() != 0) |
| 226 | return -1; |
| 227 | |
| 228 | if (WelsPreprocessReset (pCtx, iWidth, iHeight) != 0) |
| 229 | return -1; |
| 230 | |
| 231 | m_iAvaliableRefInSpatialPicList = pSvcParam->iNumRefFrame; |
| 232 | |
| 233 | m_bInitDone = true; |
| 234 | } else { |
| 235 | if ((iWidth != pSvcParam->SUsedPicRect.iWidth) || (iHeight != pSvcParam->SUsedPicRect.iHeight)) { |
| 236 | if (WelsPreprocessReset (pCtx, iWidth, iHeight) != 0) |
| 237 | return -1; |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | if (m_pInterfaceVp == NULL) |
| 242 | return -1; |
| 243 | |
| 244 | pCtx->pVaa->bSceneChangeFlag = pCtx->pVaa->bIdrPeriodFlag = false; |
| 245 | |
| 246 | iSpatialNum = SingleLayerPreprocess (pCtx, kpSrcPic, &m_sScaledPicture); |
| 247 | |
| 248 | return iSpatialNum; |
| 249 | } |
| 250 | |
| 251 | SPicture* CWelsPreProcess::GetBestRefPic (EUsageType iUsageType, bool bSceneLtr, EWelsSliceType eSliceType, |
| 252 | int32_t kiDidx, int32_t iRefTemporalIdx) { |
no outgoing calls
no test coverage detected