Remove the pBuffer parameter from the entropy encoder stash functions
The parameter didn't make sense since it only pointed to the pSliceBsa field, which isn't what should be used to stash the cabac context.
This commit is contained in:
parent
9a9f92bcfe
commit
f2c1395ab6
@ -202,8 +202,8 @@ typedef void (*PAfterBuildRefListFunc) (void* pCtx);
|
||||
typedef int32_t (*PCavlcParamCalFunc) (int16_t* pCoff, uint8_t* pRun, int16_t* pLevel, int32_t* pTotalCoeffs,
|
||||
int32_t iEndIdx);
|
||||
typedef int32_t (*PWelsSpatialWriteMbSyn) (void* pCtx, SSlice* pSlice, SMB* pCurMb);
|
||||
typedef void (*PStashMBStatus) (SDynamicSlicingStack* pDss, void* pBuffer, SSlice* pSlice, int32_t iMbSkipRun);
|
||||
typedef int32_t (*PStashPopMBStatus) (SDynamicSlicingStack* pDss, void* pBuffer, SSlice* pSlice);
|
||||
typedef void (*PStashMBStatus) (SDynamicSlicingStack* pDss, SSlice* pSlice, int32_t iMbSkipRun);
|
||||
typedef int32_t (*PStashPopMBStatus) (SDynamicSlicingStack* pDss, SSlice* pSlice);
|
||||
|
||||
struct TagWelsFuncPointerList {
|
||||
SExpandPicFunc sExpandPicFunc;
|
||||
|
@ -199,29 +199,29 @@ int32_t WriteBlockResidualCavlc (SWelsFuncPtrList* pFuncList, int16_t* pCoffLev
|
||||
return ENC_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
void StashMBStatusCavlc (SDynamicSlicingStack* pDss, void* pBuffer, SSlice* pSlice, int32_t iMbSkipRun) {
|
||||
SBitStringAux* pBs = (SBitStringAux*)pBuffer;
|
||||
void StashMBStatusCavlc (SDynamicSlicingStack* pDss, SSlice* pSlice, int32_t iMbSkipRun) {
|
||||
SBitStringAux* pBs = pSlice->pSliceBsa;
|
||||
pDss->pBsStackBufPtr = pBs->pBufPtr;
|
||||
pDss->uiBsStackCurBits = pBs->uiCurBits;
|
||||
pDss->iBsStackLeftBits = pBs->iLeftBits;
|
||||
pDss->uiLastMbQp = pSlice->uiLastMbQp;
|
||||
pDss->iMbSkipRunStack = iMbSkipRun;
|
||||
}
|
||||
int32_t StashPopMBStatusCavlc (SDynamicSlicingStack* pDss, void* pBuffer, SSlice* pSlice) {
|
||||
SBitStringAux* pBs = (SBitStringAux*)pBuffer;
|
||||
int32_t StashPopMBStatusCavlc (SDynamicSlicingStack* pDss, SSlice* pSlice) {
|
||||
SBitStringAux* pBs = pSlice->pSliceBsa;
|
||||
pBs->pBufPtr = pDss->pBsStackBufPtr;
|
||||
pBs->uiCurBits = pDss->uiBsStackCurBits;
|
||||
pBs->iLeftBits = pDss->iBsStackLeftBits;
|
||||
pSlice->uiLastMbQp = pDss->uiLastMbQp;
|
||||
return pDss->iMbSkipRunStack;
|
||||
}
|
||||
void StashMBStatusCabac (SDynamicSlicingStack* pDss, void* pBuffer, SSlice* pSlice, int32_t iMbSkipRun) {
|
||||
void StashMBStatusCabac (SDynamicSlicingStack* pDss, SSlice* pSlice, int32_t iMbSkipRun) {
|
||||
SCabacCtx* pCtx = &pSlice->sCabacCtx;
|
||||
memcpy (&pDss->sStoredCabac, pCtx, sizeof (SCabacCtx));
|
||||
pDss->uiLastMbQp = pSlice->uiLastMbQp;
|
||||
pDss->iMbSkipRunStack = iMbSkipRun;
|
||||
}
|
||||
int32_t StashPopMBStatusCabac (SDynamicSlicingStack* pDss, void* pBuffer, SSlice* pSlice) {
|
||||
int32_t StashPopMBStatusCabac (SDynamicSlicingStack* pDss, SSlice* pSlice) {
|
||||
SCabacCtx* pCtx = &pSlice->sCabacCtx;
|
||||
memcpy (pCtx, &pDss->sStoredCabac, sizeof (SCabacCtx));
|
||||
pSlice->uiLastMbQp = pDss->uiLastMbQp;
|
||||
|
@ -493,13 +493,12 @@ int32_t WelsISliceMdEnc (sWelsEncCtx* pEncCtx, SSlice* pSlice) { //pMd + encodin
|
||||
|
||||
SWelsMD sMd;
|
||||
int32_t iEncReturn = ENC_RETURN_SUCCESS;
|
||||
SBitStringAux* pBs = pSlice->pSliceBsa;
|
||||
SDynamicSlicingStack sDss;
|
||||
if (pEncCtx->pSvcParam->iEntropyCodingModeFlag) {
|
||||
WelsInitSliceCabac (pEncCtx, pSlice);
|
||||
}
|
||||
for (; ;) {
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, 0);
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0);
|
||||
iCurMbIdx = iNextMbIdx;
|
||||
pCurMb = &pMbList[ iCurMbIdx ];
|
||||
|
||||
@ -514,7 +513,7 @@ TRY_REENCODING:
|
||||
|
||||
iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb);
|
||||
if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) {
|
||||
pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice);
|
||||
pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
|
||||
UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
|
||||
goto TRY_REENCODING;
|
||||
}
|
||||
@ -567,7 +566,7 @@ int32_t WelsISliceMdEncDynamic (sWelsEncCtx* pEncCtx, SSlice* pSlice) { //pMd +
|
||||
iCurMbIdx = iNextMbIdx;
|
||||
pCurMb = &pMbList[ iCurMbIdx ];
|
||||
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, 0);
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0);
|
||||
pEncCtx->pFuncList->pfRc.pfWelsRcMbInit (pEncCtx, pCurMb, pSlice);
|
||||
// if already reaches the largest number of slices, set QPs to the upper bound
|
||||
if (pSlice->bDynamicSlicingSliceSizeCtrlFlag) {
|
||||
@ -583,7 +582,7 @@ TRY_REENCODING:
|
||||
|
||||
iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb);
|
||||
if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) {
|
||||
pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice);
|
||||
pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
|
||||
UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
|
||||
goto TRY_REENCODING;
|
||||
}
|
||||
@ -593,7 +592,7 @@ TRY_REENCODING:
|
||||
sDss.iCurrentPos = BsGetBitsPos (pBs);
|
||||
|
||||
if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) { //islice
|
||||
pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice);
|
||||
pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
|
||||
pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx -
|
||||
1; // update pLastCodedMbIdxOfPartition, need to -1 due to stepping back
|
||||
++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId];
|
||||
@ -954,7 +953,7 @@ int32_t WelsMdInterMbLoop (sWelsEncCtx* pEncCtx, SSlice* pSlice, void* pWelsMd,
|
||||
}
|
||||
pSlice->iMbSkipRun = 0;
|
||||
for (;;) {
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, pSlice->iMbSkipRun);
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun);
|
||||
//point to current pMb
|
||||
iCurMbIdx = iNextMbIdx;
|
||||
pCurMb = &pMbList[ iCurMbIdx ];
|
||||
@ -985,7 +984,7 @@ TRY_REENCODING:
|
||||
|
||||
iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb);
|
||||
if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) {
|
||||
pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice);
|
||||
pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
|
||||
UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
|
||||
goto TRY_REENCODING;
|
||||
}
|
||||
@ -1050,7 +1049,7 @@ int32_t WelsMdInterMbLoopOverDynamicSlice (sWelsEncCtx* pEncCtx, SSlice* pSlice,
|
||||
for (;;) {
|
||||
//DYNAMIC_SLICING_ONE_THREAD - MultiD
|
||||
//stack pBs pointer
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, pSlice->iMbSkipRun);
|
||||
pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun);
|
||||
|
||||
//point to current pMb
|
||||
iCurMbIdx = iNextMbIdx;
|
||||
@ -1091,7 +1090,7 @@ TRY_REENCODING:
|
||||
|
||||
iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb);
|
||||
if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) {
|
||||
pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice);
|
||||
pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
|
||||
UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset);
|
||||
goto TRY_REENCODING;
|
||||
}
|
||||
@ -1102,7 +1101,7 @@ TRY_REENCODING:
|
||||
//DYNAMIC_SLICING_ONE_THREAD - MultiD
|
||||
sDss.iCurrentPos = BsGetBitsPos (pBs);
|
||||
if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) {
|
||||
pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice);
|
||||
pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice);
|
||||
pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx -
|
||||
1; // update pLastCodedMbIdxOfPartition, need to -1 due to stepping back
|
||||
++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId];
|
||||
|
Loading…
Reference in New Issue
Block a user