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

Function AddSliceBoundary

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

Source from the content-addressed store, hash-verified

1699}
1700
1701void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSliceCtx, SMB* pCurMb,
1702 int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) {
1703 SDqLayer* pCurLayer = pEncCtx->pCurDqLayer;
1704 SSlice* pSliceBuffer = pCurLayer->sSliceBufferInfo[pCurSlice->uiBufferIdx].pSliceBuffer;
1705 int32_t iCodedSliceNum = pCurLayer->sSliceBufferInfo[pCurSlice->uiBufferIdx].iCodedSliceNum;
1706 int32_t iCurMbIdx = pCurMb->iMbXY;
1707 uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ];
1708 const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum;
1709 uint16_t iNextSliceIdc = iCurSliceIdc + kiSliceIdxStep;
1710 SSlice* pNextSlice = NULL;
1711
1712 SMB* pMbList = pCurLayer->sMbDataP;
1713
1714 //update cur pSlice info
1715 pCurSlice->sSliceHeaderExt.uiNumMbsInSlice = 1 + iCurMbIdx - pCurSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice;
1716
1717 //pNextSlice pointer/initialization
1718 if (pEncCtx->iActiveThreadsNum > 1) {
1719 pNextSlice = &pSliceBuffer[ iCodedSliceNum + 1 ];
1720 } else {
1721 pNextSlice = &pSliceBuffer[ iNextSliceIdc ];
1722 }
1723
1724#if _DEBUG
1725 assert (NULL != pNextSlice);
1726#endif
1727
1728 //init next pSlice info
1729 pNextSlice->bSliceHeaderExtFlag =
1730 (NAL_UNIT_CODED_SLICE_EXT == pCurLayer->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType);
1731 memcpy (&pNextSlice->sSliceHeaderExt, &pCurSlice->sSliceHeaderExt,
1732 sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage
1733 pNextSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbIdxOfNextSlice;
1734 WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, iNextSliceIdc,
1735 (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1), sizeof (uint16_t));
1736
1737 //DYNAMIC_SLICING_ONE_THREAD: update pMbList slice_neighbor_info
1738 UpdateMbNeighbourInfoForNextSlice (pCurLayer, pMbList, iFirstMbIdxOfNextSlice, kiLastMbIdxInPartition);
1739}
1740
1741bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb,
1742 SDynamicSlicingStack* pDss) {

Callers 1

Calls 2

Tested by

no test coverage detected