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

Function ReallocateSliceInThread

codec/encoder/core/src/svc_encode_slice.cpp:1321–1352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1319}
1320
1321int32_t ReallocateSliceInThread (sWelsEncCtx* pCtx,
1322 SDqLayer* pDqLayer,
1323 const int32_t kiDlayerIdx,
1324 const int32_t KiSlcBuffIdx) {
1325 int32_t iMaxSliceNum = pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].iMaxSliceNum;
1326 int32_t iCodedSliceNum = pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].iCodedSliceNum;
1327 int32_t iMaxSliceNumNew = 0;
1328 int32_t iRet = 0;
1329 SSlice* pLastCodedSlice = &pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].pSliceBuffer [iCodedSliceNum - 1];
1330 SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiDlayerIdx].sSliceArgument;
1331
1332 iRet = CalculateNewSliceNum (pCtx,
1333 pLastCodedSlice,
1334 iMaxSliceNum,
1335 iMaxSliceNumNew);
1336 if (ENC_RETURN_SUCCESS != iRet) {
1337 return iRet;
1338 }
1339
1340 iRet = ReallocateSliceList (pCtx,
1341 pSliceArgument,
1342 pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].pSliceBuffer,
1343 iMaxSliceNum,
1344 iMaxSliceNumNew);
1345 if (ENC_RETURN_SUCCESS != iRet) {
1346 return iRet;
1347 }
1348
1349 pDqLayer->sSliceBufferInfo[KiSlcBuffIdx].iMaxSliceNum = iMaxSliceNumNew;
1350
1351 return ENC_RETURN_SUCCESS;
1352}
1353
1354int32_t ExtendLayerBuffer (sWelsEncCtx* pCtx,
1355 const int32_t kiMaxSliceNumOld,

Callers 2

TEST_FFunction · 0.85
ExecuteTaskMethod · 0.85

Calls 2

CalculateNewSliceNumFunction · 0.85
ReallocateSliceListFunction · 0.85

Tested by

no test coverage detected