ref: 097734e7b7d11d5a90509746c55d4b75c93a8383
parent: f77d19042dbaad1426cbe13876fe430c334c9929
author: Huade Shi (huashi) <huashi@cisco.com>
date: Wed Mar 29 08:01:35 EDT 2017
slice buffer variable rename: pSliceInThread replace by pSliceBuffer
--- a/codec/encoder/core/inc/svc_enc_frame.h
+++ b/codec/encoder/core/inc/svc_enc_frame.h
@@ -69,8 +69,7 @@
} SFeatureSearchPreparation; //maintain only one
typedef struct TagSliceThreadInfo {
-SSlice* pSliceInThread;// slice buffer for multi thread,
- // pSliceInThread[0] for single thread
+SSlice* pSliceBuffer; // slice buffer for multi thread,
int32_t iMaxSliceNum;
int32_t iCodedSliceNum;
}SSliceThreadInfo;
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -923,9 +923,9 @@
void FreeSliceInLayer (SDqLayer* pDq, CMemoryAlign* pMa) {
int32_t iIdx = 0;
for (; iIdx < MAX_THREADS_NUM; iIdx ++) {
- FreeSliceBuffer (pDq->sSliceThreadInfo[iIdx].pSliceInThread,
+ FreeSliceBuffer (pDq->sSliceThreadInfo[iIdx].pSliceBuffer,
pDq->sSliceThreadInfo[iIdx].iMaxSliceNum,
- pMa, "pSliceInThread");
+ pMa, "pSliceBuffer");
}
}
@@ -3643,7 +3643,7 @@
if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer
int32_t iSliceSize = 0;
int32_t iPayloadSize = 0;
- SSlice* pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[0].pSliceInThread[0];
+ SSlice* pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[0].pSliceBuffer[0];
if (pCtx->bNeedPrefixNalFlag) {
pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType,
@@ -3795,7 +3795,7 @@
WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);
- pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iSliceIdx];
+ pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceBuffer[iSliceIdx];
assert (iSliceIdx == pCurSlice->iSliceIdx);
pCtx->iEncoderError = SetSliceBoundaryInfo(pCtx->pCurDqLayer, pCurSlice, iSliceIdx);
@@ -4443,7 +4443,7 @@
SDqLayer* pCurLayer = pCtx->pCurDqLayer;
uint32_t uiTheadIdx = 0;
- SSlice* pStartSlice = &pCurLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iStartSliceIdx];
+ SSlice* pStartSlice = &pCurLayer->sSliceThreadInfo[uiTheadIdx].pSliceBuffer[iStartSliceIdx];
int32_t iNalIdxInLayer = *pNalIdxInLayer;
int32_t iSliceIdx = iStartSliceIdx;
const int32_t kiSliceStep = pCtx->iActiveThreadsNum;
@@ -4487,7 +4487,7 @@
}
WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc);
- pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iSliceIdx];
+ pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceBuffer[iSliceIdx];
pCurSlice->iSliceIdx = iSliceIdx;
iReturn = WelsCodeOneSlice (pCtx, pCurSlice, keNalType);
--- a/codec/encoder/core/src/svc_encode_slice.cpp
+++ b/codec/encoder/core/src/svc_encode_slice.cpp
@@ -1000,9 +1000,9 @@
if (pCtx->pCurDqLayer->bThreadSlcBufferFlag) {
const int32_t kiCodedNumInThread = pCtx->pCurDqLayer->sSliceThreadInfo[kiThreadIdx].iCodedSliceNum;
assert(kiCodedNumInThread <= pCtx->pCurDqLayer->sSliceThreadInfo[kiThreadIdx].iMaxSliceNum -1 );
- pSlice = &pCtx->pCurDqLayer->sSliceThreadInfo [kiThreadIdx].pSliceInThread[kiCodedNumInThread];
+ pSlice = &pCtx->pCurDqLayer->sSliceThreadInfo [kiThreadIdx].pSliceBuffer[kiCodedNumInThread];
} else {
- pSlice = &pCtx->pCurDqLayer->sSliceThreadInfo [0].pSliceInThread[kiSliceIdx];
+ pSlice = &pCtx->pCurDqLayer->sSliceThreadInfo [0].pSliceBuffer[kiSliceIdx];
}
pSlice->iSliceIdx = kiSliceIdx;
pSlice->uiThreadIdx = kiThreadIdx;
@@ -1039,13 +1039,13 @@
while (iIdx < iSlcBufferNum) {
pDqLayer->sSliceThreadInfo[iIdx].iMaxSliceNum = iMaxSliceNum;
pDqLayer->sSliceThreadInfo[iIdx].iCodedSliceNum = 0;
- pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInThread");
- if (NULL == pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread) {
+ pDqLayer->sSliceThreadInfo[iIdx].pSliceBuffer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceBuffer");
+ if (NULL == pDqLayer->sSliceThreadInfo[iIdx].pSliceBuffer) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
- "CWelsH264SVCEncoder::InitSliceThreadInfo: pSliceThreadInfo->pSliceInThread[iIdx] is NULL");
+ "CWelsH264SVCEncoder::InitSliceThreadInfo: pSliceThreadInfo->pSliceBuffer[iIdx] is NULL");
return ENC_RETURN_MEMALLOCERR;
}
- iRet = InitSliceList (pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread,
+ iRet = InitSliceList (pDqLayer->sSliceThreadInfo[iIdx].pSliceBuffer,
&pCtx->pOut->sBsWrite,
iMaxSliceNum,
pCtx->iSliceBufferSize[kiDlayerIndex],
@@ -1060,7 +1060,7 @@
for (; iIdx < MAX_THREADS_NUM; iIdx++) {
pDqLayer->sSliceThreadInfo[iIdx].iMaxSliceNum = 0;
pDqLayer->sSliceThreadInfo[iIdx].iCodedSliceNum = 0;
- pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread = NULL;
+ pDqLayer->sSliceThreadInfo[iIdx].pSliceBuffer = NULL;
}
return ENC_RETURN_SUCCESS;
@@ -1124,7 +1124,7 @@
iStartIdx = 0;
for(iThreadIdx = 0; iThreadIdx < pCtx->iActiveThreadsNum; iThreadIdx++ ) {
for (iSliceIdx = 0; iSliceIdx < pDqLayer->sSliceThreadInfo[iThreadIdx].iMaxSliceNum; iSliceIdx++ ) {
- pDqLayer->ppSliceInLayer[iStartIdx + iSliceIdx] = pDqLayer->sSliceThreadInfo[iThreadIdx].pSliceInThread+ iSliceIdx;
+ pDqLayer->ppSliceInLayer[iStartIdx + iSliceIdx] = pDqLayer->sSliceThreadInfo[iThreadIdx].pSliceBuffer+ iSliceIdx;
}
iStartIdx += pDqLayer->sSliceThreadInfo[iThreadIdx].iMaxSliceNum;
@@ -1200,7 +1200,7 @@
bool bIndependenceBsBuffer = (pCtx->pSvcParam->iMultipleThreadIdc > 1 &&
SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false;
- pNewSliceList = (SSlice*)pMA->WelsMallocz (sizeof (SSlice) * kiMaxSliceNumNew, "pSliceInThread");
+ pNewSliceList = (SSlice*)pMA->WelsMallocz (sizeof (SSlice) * kiMaxSliceNumNew, "pSliceBuffer");
if (NULL == pNewSliceList) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "CWelsH264SVCEncoder::ReallocateSliceList: pNewSliceList is NULL");
return ENC_RETURN_MEMALLOCERR;
@@ -1212,7 +1212,7 @@
for (iSliceIdx = 0; iSliceIdx < kiMaxSliceNumOld; iSliceIdx++) {
pSlice = pNewSliceList + iSliceIdx;
if (NULL == pSlice) {
- FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceInThread");
+ FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceBuffer");
return ENC_RETURN_MEMALLOCERR;
}
@@ -1230,7 +1230,7 @@
for (iSliceIdx = kiMaxSliceNumOld; iSliceIdx < kiMaxSliceNumNew; iSliceIdx++) {
pSlice = pNewSliceList + iSliceIdx;
if (NULL == pSlice) {
- FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceInThread");
+ FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceBuffer");
return ENC_RETURN_MEMALLOCERR;
}
@@ -1245,13 +1245,13 @@
iMaxSliceBufferSize,
pMA);
if (ENC_RETURN_SUCCESS != iRet) {
- FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceInThread");
+ FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceBuffer");
return iRet;
}
iRet = AllocateSliceMBBuffer (pSlice, pMA);
if (ENC_RETURN_SUCCESS != iRet) {
- FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceInThread");
+ FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceBuffer");
return iRet;
}
@@ -1260,12 +1260,12 @@
iRet = InitSliceRC (pSlice, pCtx->iGlobalQp);
if (ENC_RETURN_SUCCESS != iRet) {
- FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceInThread");
+ FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "pSliceBuffer");
return iRet;
}
}
- pMA->WelsFree (pSliceList, "pSliceInThread");
+ pMA->WelsFree (pSliceList, "pSliceBuffer");
pSliceList = pNewSliceList;
return ENC_RETURN_SUCCESS;
@@ -1304,7 +1304,7 @@
int32_t iMaxSliceNum = pDqLayer->sSliceThreadInfo[kiThreadIndex].iMaxSliceNum;
int32_t iMaxSliceNumNew = 0;
int32_t iRet = 0;
- SSlice* pLastCodedSlice = &pDqLayer->sSliceThreadInfo[kiThreadIndex].pSliceInThread [iMaxSliceNum - 1];
+ SSlice* pLastCodedSlice = &pDqLayer->sSliceThreadInfo[kiThreadIndex].pSliceBuffer [iMaxSliceNum - 1];
SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiDlayerIdx].sSliceArgument;
iRet = CalculateNewSliceNum (pCtx,
@@ -1317,7 +1317,7 @@
iRet = ReallocateSliceList (pCtx,
pSliceArgument,
- pDqLayer->sSliceThreadInfo[kiThreadIndex].pSliceInThread,
+ pDqLayer->sSliceThreadInfo[kiThreadIndex].pSliceBuffer,
iMaxSliceNum,
iMaxSliceNumNew);
if (ENC_RETURN_SUCCESS != iRet) {
@@ -1382,7 +1382,7 @@
int32_t iThreadIdx = 0;
int32_t iStartIdx = 0;
const int32_t kiCurDid = pCtx->uiDependencyId;
- SSlice* pLastCodedSlice = pCurLayer->sSliceThreadInfo[0].pSliceInThread + (iMaxSliceNumOld - 1);
+ SSlice* pLastCodedSlice = pCurLayer->sSliceThreadInfo[0].pSliceBuffer + (iMaxSliceNumOld - 1);
SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiCurDid].sSliceArgument;
iRet = CalculateNewSliceNum (pCtx,
pLastCodedSlice,
@@ -1395,7 +1395,7 @@
iRet = ReallocateSliceList (pCtx,
pSliceArgument,
- pCurLayer->sSliceThreadInfo[0].pSliceInThread,
+ pCurLayer->sSliceThreadInfo[0].pSliceBuffer,
iMaxSliceNumOld,
iMaxSliceNumNew);
if (ENC_RETURN_SUCCESS != iRet) {
@@ -1416,7 +1416,7 @@
for(iThreadIdx = 0; iThreadIdx < pCtx->iActiveThreadsNum; iThreadIdx++ ) {
for (iSliceIdx = 0; iSliceIdx < pCurLayer->sSliceThreadInfo[iThreadIdx].iMaxSliceNum; iSliceIdx++) {
- pCurLayer->ppSliceInLayer[iStartIdx + iSliceIdx] = pCurLayer->sSliceThreadInfo[iThreadIdx].pSliceInThread + iSliceIdx;
+ pCurLayer->ppSliceInLayer[iStartIdx + iSliceIdx] = pCurLayer->sSliceThreadInfo[iThreadIdx].pSliceBuffer + iSliceIdx;
}
iStartIdx += pCurLayer->sSliceThreadInfo[iThreadIdx].iMaxSliceNum;
}
@@ -1445,7 +1445,7 @@
const SliceModeEnum kuiSliceMode,
const int32_t kiThreadNum) {
SDqLayer* pCurLayer = pCtx->pCurDqLayer;
- SSlice* pSliceInThread = NULL;
+ SSlice* pSliceBuffer = NULL;
int32_t iThreadIdx = 0;
int32_t iPartitionIdx = 0;
int32_t iPartitionID = 0;
@@ -1475,24 +1475,24 @@
}
//before encode all slices in layer, slices' index are init with -1
- //pSliceInThread->iSliceIdx will be set to actual slice index when encode one slice
+ //pSliceBuffer->iSliceIdx will be set to actual slice index when encode one slice
for (iThreadIdx = 0; iThreadIdx < kiThreadNum; iThreadIdx++) {
iSliceNumInThread = pCurLayer->sSliceThreadInfo[iThreadIdx].iMaxSliceNum;
for(iSliceIdx =0; iSliceIdx < iSliceNumInThread; iSliceIdx++) {
- pSliceInThread = pCurLayer->sSliceThreadInfo[iThreadIdx].pSliceInThread + iSliceIdx;
- if (NULL == pSliceInThread) {
+ pSliceBuffer = pCurLayer->sSliceThreadInfo[iThreadIdx].pSliceBuffer + iSliceIdx;
+ if (NULL == pSliceBuffer) {
return ENC_RETURN_UNEXPECTED;
}
- if( -1 != pSliceInThread->iSliceIdx) {
- iPartitionID = pSliceInThread->iSliceIdx % iPartitionNum;
- iActualSliceIdx = aiPartitionOffset[iPartitionID] + pSliceInThread->iSliceIdx / iPartitionNum;
- pSliceInThread->iSliceIdx = iActualSliceIdx;
- pCurLayer->ppSliceInLayer[iActualSliceIdx] = pSliceInThread;
+ if( -1 != pSliceBuffer->iSliceIdx) {
+ iPartitionID = pSliceBuffer->iSliceIdx % iPartitionNum;
+ iActualSliceIdx = aiPartitionOffset[iPartitionID] + pSliceBuffer->iSliceIdx / iPartitionNum;
+ pSliceBuffer->iSliceIdx = iActualSliceIdx;
+ pCurLayer->ppSliceInLayer[iActualSliceIdx] = pSliceBuffer;
iUsedSliceNum ++;
} else {
- pCurLayer->ppSliceInLayer[iEncodeSliceNum + iNonUsedBufferNum] = pSliceInThread;
+ pCurLayer->ppSliceInLayer[iEncodeSliceNum + iNonUsedBufferNum] = pSliceBuffer;
iNonUsedBufferNum ++;
}
}
@@ -1594,7 +1594,7 @@
pCtx->pCurDqLayer->iMaxSliceNum = iMaxSliceNum;
}
- //update ppSliceInLayer based on pSliceInThread, reordering based on slice index
+ //update ppSliceInLayer based on pSliceBuffer, reordering based on slice index
iRet = ReOrderSliceInLayer (pCtx, kuiSliceMode, pCtx->iActiveThreadsNum);
if (ENC_RETURN_SUCCESS != iRet) {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
@@ -1678,7 +1678,7 @@
void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSliceCtx, SMB* pCurMb,
int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) {
SDqLayer* pCurLayer = pEncCtx->pCurDqLayer;
- SSlice* pSliceInThread = pCurLayer->sSliceThreadInfo[pCurSlice->uiThreadIdx].pSliceInThread;
+ SSlice* pSliceBuffer = pCurLayer->sSliceThreadInfo[pCurSlice->uiThreadIdx].pSliceBuffer;
int32_t iCodedSliceNum = pCurLayer->sSliceThreadInfo[pCurSlice->uiThreadIdx].iCodedSliceNum;
int32_t iCurMbIdx = pCurMb->iMbXY;
uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ];
@@ -1693,9 +1693,9 @@
//pNextSlice pointer/initialization
if(pEncCtx->iActiveThreadsNum > 1) {
- pNextSlice = &pSliceInThread[ iCodedSliceNum + 1 ];
+ pNextSlice = &pSliceBuffer[ iCodedSliceNum + 1 ];
} else {
- pNextSlice = &pSliceInThread[ iNextSliceIdc ];
+ pNextSlice = &pSliceBuffer[ iNextSliceIdc ];
}
#if _DEBUG
--- a/codec/encoder/core/src/wels_task_encoder.cpp
+++ b/codec/encoder/core/src/wels_task_encoder.cpp
@@ -238,7 +238,7 @@
const int32_t kiFirstMbInPartition = pCurDq->FirstMbIdxOfPartition[kiPartitionId];
const int32_t kiEndMbIdxInPartition = pCurDq->EndMbIdxOfPartition[kiPartitionId];
const int32_t kiCodedSliceNumByThread = pCurDq->sSliceThreadInfo[m_iThreadIdx].iCodedSliceNum;
- m_pSlice = &pCurDq->sSliceThreadInfo[m_iThreadIdx].pSliceInThread[kiCodedSliceNumByThread];
+ m_pSlice = &pCurDq->sSliceThreadInfo[m_iThreadIdx].pSliceBuffer[kiCodedSliceNumByThread];
m_pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = kiFirstMbInPartition;
int32_t iReturn = 0;
bool bNeedReallocate = false;
--- a/test/encoder/EncUT_SliceBufferReallocate.cpp
+++ b/test/encoder/EncUT_SliceBufferReallocate.cpp
@@ -149,7 +149,7 @@
int32_t iMBNumInPatition = 0;
int32_t iCodedSlcNum = pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].iMaxSliceNum - 1;
int32_t iLastCodeSlcIdx = iPartitionID + iCodedSlcNum * iPartitionNum;
- SSlice* pLastCodedSlc = &pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].pSliceInThread[iCodedSlcNum - 1];
+ SSlice* pLastCodedSlc = &pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].pSliceBuffer[iCodedSlcNum - 1];
pLastCodedSlc->iSliceIdx = iLastCodeSlcIdx;
SetPartitonMBNum(pCtx->ppDqLayerList[iLayerIdx], pLayerCfg, iPartitionNum);
@@ -371,13 +371,13 @@
if(m_EncContext.pCurDqLayer->bThreadSlcBufferFlag) {
int32_t iCodedSlcNumInThrd = m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].iCodedSliceNum;
- EXPECT_TRUE(NULL != m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].pSliceInThread);
- EXPECT_TRUE(NULL != &m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].pSliceInThread[iCodedSlcNumInThrd]);
+ EXPECT_TRUE(NULL != m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].pSliceBuffer);
+ EXPECT_TRUE(NULL != &m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].pSliceBuffer[iCodedSlcNumInThrd]);
- m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].pSliceInThread[iCodedSlcNumInThrd].iSliceIdx = kiSlcIdx;
+ m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].pSliceBuffer[iCodedSlcNumInThrd].iSliceIdx = kiSlcIdx;
m_EncContext.pCurDqLayer->sSliceThreadInfo[kiThreadIdx].iCodedSliceNum ++;
} else {
- m_EncContext.pCurDqLayer->sSliceThreadInfo[0].pSliceInThread[kiSlcIdx].iSliceIdx = kiSlcIdx;
+ m_EncContext.pCurDqLayer->sSliceThreadInfo[0].pSliceBuffer[kiSlcIdx].iSliceIdx = kiSlcIdx;
}
}
@@ -454,8 +454,9 @@
ParamSetForReallocateTest(pCtx, iLayerIdx, iThreadIndex, iPartitionNum);
iRet = ReallocateSliceInThread(pCtx, pCtx->pCurDqLayer, iLayerIdx, iThreadIndex);
+
EXPECT_TRUE(cmResultSuccess == iRet);
- EXPECT_TRUE(NULL != pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].pSliceInThread);
+ EXPECT_TRUE(NULL != pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].pSliceBuffer);
EXPECT_TRUE(iSlcBufferNum < pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].iMaxSliceNum);
UnInitParamForTestCase(iLayerIdx);
@@ -487,8 +488,9 @@
iSlcBufferNum = pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].iMaxSliceNum;
iRet = ReallocateSliceInThread(pCtx, pCtx->pCurDqLayer, iLayerIdx, iThreadIndex);
+
EXPECT_TRUE(cmResultSuccess == iRet);
- EXPECT_TRUE(NULL != pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].pSliceInThread);
+ EXPECT_TRUE(NULL != pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].pSliceBuffer);
EXPECT_TRUE(iSlcBufferNum < pCtx->pCurDqLayer->sSliceThreadInfo[iThreadIndex].iMaxSliceNum);
}
@@ -511,13 +513,13 @@
//before extend, simulate reallocate slice buffer in one thread
int32_t iReallocateThrdIdx = rand() % pCtx->iActiveThreadsNum;
iSlcBuffNumInThrd = pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].iMaxSliceNum;
- pSlcListInThrd = pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceInThread;
+ pSlcListInThrd = pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceBuffer;
iRet = ReallocateSliceList(pCtx, &pCtx->pSvcParam->sSpatialLayers[iLayerIdx].sSliceArgument,
pSlcListInThrd, iSlcBuffNumInThrd, iSlcBuffNumInThrd * 2);
EXPECT_TRUE(cmResultSuccess == iRet);
EXPECT_TRUE(NULL != pSlcListInThrd);
- pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceInThread = pSlcListInThrd;
+ pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceBuffer = pSlcListInThrd;
pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].iMaxSliceNum = iSlcBuffNumInThrd * 2;
for (int32_t iThreadIdx = 0; iThreadIdx < pCtx->iActiveThreadsNum; iThreadIdx++) {
@@ -608,7 +610,7 @@
int32_t iReallocateThrdIdx = rand() % pCtx->iActiveThreadsNum;
int32_t iSlcBuffNumInThrd = pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].iMaxSliceNum;
int32_t iCodedSlcNumInThrd = pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].iCodedSliceNum;
- SSlice* pSlcListInThrd = pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceInThread;
+ SSlice* pSlcListInThrd = pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceBuffer;
SliceModeEnum eSlcMode = pCtx->pSvcParam->sSpatialLayers[iLayerIdx].sSliceArgument.uiSliceMode;
int32_t iSlcIdxInThrd = 0;
int32_t iPartitionNum = (SM_SIZELIMITED_SLICE == eSlcMode) ? pCtx->iActiveThreadsNum : 1;
@@ -620,7 +622,7 @@
pSlcListInThrd, iSlcBuffNumInThrd, iSlcBuffNumInThrd * 2);
EXPECT_TRUE(cmResultSuccess == iRet);
EXPECT_TRUE(NULL != pSlcListInThrd);
- pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceInThread = pSlcListInThrd;
+ pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].pSliceBuffer = pSlcListInThrd;
pCtx->pCurDqLayer->sSliceThreadInfo[iReallocateThrdIdx].iMaxSliceNum = iSlcBuffNumInThrd * 2;
//update reallocate slice idx/NalNum info