MCPcopy Create free account
hub / github.com/cisco/openh264 / GetMvMvdRange

Function GetMvMvdRange

codec/encoder/core/src/encoder_ext.cpp:1508–1532  ·  view source on GitHub ↗

! * \brief request specific memory for SVC * \pParam pEncCtx sWelsEncCtx* * \return successful - 0; otherwise none 0 for failed */

Source from the content-addressed store, hash-verified

1506 * \return successful - 0; otherwise none 0 for failed
1507 */
1508void GetMvMvdRange (SWelsSvcCodingParam* pParam, int32_t& iMvRange, int32_t& iMvdRange) {
1509 ELevelIdc iMinLevelIdc = LEVEL_5_2;
1510 int32_t iMinMv = 0;
1511 int32_t iMaxMv = 0;
1512 int32_t iFixMvRange = pParam->iUsageType ? EXPANDED_MV_RANGE : CAMERA_STARTMV_RANGE;
1513 int32_t iFixMvdRange = (pParam->iUsageType ? EXPANDED_MVD_RANGE : ((pParam->iSpatialLayerNum == 1) ? CAMERA_MVD_RANGE :
1514 CAMERA_HIGHLAYER_MVD_RANGE));
1515 for (int32_t iLayer = 0; iLayer < pParam->iSpatialLayerNum; iLayer++) {
1516 if (pParam->sSpatialLayers[iLayer].uiLevelIdc < iMinLevelIdc)
1517 iMinLevelIdc = pParam->sSpatialLayers[iLayer].uiLevelIdc;
1518 }
1519 const SLevelLimits* pLevelLimit = g_ksLevelLimits;
1520 while ((pLevelLimit->uiLevelIdc != LEVEL_5_2) && (pLevelLimit->uiLevelIdc != iMinLevelIdc))
1521 pLevelLimit++;
1522 iMinMv = (pLevelLimit->iMinVmv) >> 2;
1523 iMaxMv = (pLevelLimit->iMaxVmv) >> 2;
1524
1525 iMvRange = WELS_MIN (WELS_ABS (iMinMv), iMaxMv);
1526
1527 iMvRange = WELS_MIN (iMvRange, iFixMvRange);
1528
1529 iMvdRange = (iMvRange + 1) << 1;
1530
1531 iMvdRange = WELS_MIN (iMvdRange, iFixMvdRange);
1532}
1533int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingParasetList) {
1534 SWelsSvcCodingParam* pParam = (*ppCtx)->pSvcParam;
1535 CMemoryAlign* pMa = (*ppCtx)->pMemAlign;

Callers 1

encoder_ext.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected