| 474 | } |
| 475 | |
| 476 | static inline bool WelsGetPaddingOffset (int32_t iActualWidth, int32_t iActualHeight, int32_t iWidth, |
| 477 | int32_t iHeight, SCropOffset& pOffset) { |
| 478 | if ((iWidth < iActualWidth) || (iHeight < iActualHeight)) |
| 479 | return false; |
| 480 | |
| 481 | // make actual size even |
| 482 | iActualWidth -= (iActualWidth & 1); |
| 483 | iActualHeight -= (iActualHeight & 1); |
| 484 | |
| 485 | pOffset.iCropLeft = 0; |
| 486 | pOffset.iCropRight = (iWidth - iActualWidth) / 2; |
| 487 | pOffset.iCropTop = 0; |
| 488 | pOffset.iCropBottom = (iHeight - iActualHeight) / 2; |
| 489 | |
| 490 | return (iWidth > iActualWidth) || (iHeight > iActualHeight); |
| 491 | } |
| 492 | int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal, |
| 493 | const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame, |
| 494 | const uint32_t kuiSpsId, const bool kbEnableFrameCropping, bool bEnableRc, |