History

SliceBufferReallocate:RBC#1796:New flag for slice buffer/slice bs buffer

Huade Shi (huashi) committed 9 years ago

Commit d1e25d71 parent 9f30ffc3 files · +26 −18Browse files

Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 3 files). Show all

Unified · Split

codec/encoder/core/src/svc_encode_slice.cpp+20−15
@@ -928,21 +928,16 @@ void FreeSliceBuffer (SSlice*& pSliceList, const int32_t kiMaxSliceNum, CMemoryA · 927 unmodified lines
928928 }
929929 }
930930
931−int32_t InitSliceList (sWelsEncCtx* pCtx,
932− SSlice*& pSliceList,
931+int32_t InitSliceList (SSlice*& pSliceList,
932+ SBitStringAux* pBsWrite,
933933 const int32_t kiMaxSliceNum,
934− const int32_t kiDlayerIndex,
934+ const int32_t kiMaxSliceBufferSize,
935+ const bool bIndependenceBsBuffer,
935936 CMemoryAlign* pMa) {
936− SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiDlayerIndex].sSliceArgument;
937− int32_t iMaxSliceBufferSize = (pCtx)->iSliceBufferSize[kiDlayerIndex];
938937 int32_t iSliceIdx = 0;
939938 int32_t iRet = 0;
940939
941− //SM_SINGLE_SLICE mode using single-thread bs writer pOut->sBsWrite
942− //even though multi-thread is on for other layers
943− bool bIndependenceBsBuffer = (pCtx->pSvcParam->iMultipleThreadIdc > 1 &&
944− SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false;
945− if (iMaxSliceBufferSize <= 0) {
940+ if (kiMaxSliceBufferSize <= 0) {
946941 return ENC_RETURN_UNEXPECTED;
947942 }
948943
@@ -958,9 +953,9 @@ int32_t InitSliceList (sWelsEncCtx* pCtx, · 9 unmodified lines
958953 pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = 0;
959954
960955 iRet = InitSliceBsBuffer (pSlice,
961− &pCtx->pOut->sBsWrite,
956+ pBsWrite,
962957 bIndependenceBsBuffer,
963− iMaxSliceBufferSize,
958+ kiMaxSliceBufferSize,
964959 pMa);
965960 if (ENC_RETURN_SUCCESS != iRet) {
966961 return iRet;
@@ -1043,10 +1038,11 @@ int32_t InitSliceThreadInfo (sWelsEncCtx* pCtx, · 76 unmodified lines
10431038 "CWelsH264SVCEncoder::InitSliceThreadInfo: pSliceThreadInfo->pSliceInThread[iIdx] is NULL");
10441039 return ENC_RETURN_MEMALLOCERR;
10451040 }
1046− iRet = InitSliceList (pCtx,
1047− pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread,
1041+ iRet = InitSliceList (pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread,
1042+ &pCtx->pOut->sBsWrite,
10481043 iMaxSliceNum,
1049− kiDlayerIndex,
1044+ pCtx->iSliceBufferSize[kiDlayerIndex],
1045+ pDqLayer->bSliceBsBufferFlag,
10501046 pMa);
10511047 if (ENC_RETURN_SUCCESS != iRet) {
10521048 return iRet;
@@ -1071,6 +1067,15 @@ int32_t InitSliceInLayer (sWelsEncCtx* pCtx, · 18 unmodified lines
10711067 int32_t iThreadIdx = 0;
10721068 int32_t iStartIdx = 0;
10731069 int32_t iMaxSliceNum = pDqLayer->iMaxSliceNum;
1070+ SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiDlayerIndex].sSliceArgument;
1071+
1072+ //SM_SINGLE_SLICE mode using single-thread bs writer pOut->sBsWrite
1073+ //even though multi-thread is on for other layers
1074+ pDqLayer->bSliceBsBufferFlag = (pCtx->pSvcParam->iMultipleThreadIdc > 1 &&
1075+ SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false;
1076+
1077+ pDqLayer->bThreadSlcBufferFlag = (pCtx->pSvcParam->iMultipleThreadIdc > 1 &&
1078+ SM_SIZELIMITED_SLICE == pSliceArgument->uiSliceMode) ? true : false;
10741079
10751080 iRet = InitSliceThreadInfo (pCtx,
10761081 pDqLayer,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t