use func pointer for deblocking to save judgements at each slice
This commit is contained in:
parent
a8ae134610
commit
cae5af52d7
@ -84,6 +84,7 @@ void PerformDeblockingFilter (sWelsEncCtx* pEnc);
|
||||
void DeblockingFilterFrameAvcbase (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc);
|
||||
|
||||
void DeblockingFilterSliceAvcbase (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, const int32_t kiSliceIdx);
|
||||
void DeblockingFilterSliceAvcbaseNull (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, const int32_t kiSliceIdx);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -83,6 +83,7 @@ typedef void (*PChromaDeblockingEQ4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr
|
||||
int32_t iBeta);
|
||||
typedef void (*PDeblockingBSCalc) (SWelsFuncPtrList* pFunc, SMB* pCurMb, uint8_t uiBS[2][4][4], Mb_Type uiCurMbType,
|
||||
int32_t iMbStride, int32_t iLeftFlag, int32_t iTopFlag);
|
||||
typedef void (*PDeblockingFilterSlice) (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, const int32_t kiSliceIdx);
|
||||
|
||||
typedef struct tagDeblockingFunc {
|
||||
PLumaDeblockingLT4Func pfLumaDeblockingLT4Ver;
|
||||
@ -96,6 +97,8 @@ typedef struct tagDeblockingFunc {
|
||||
PChromaDeblockingEQ4Func pfChromaDeblockingEQ4Hor;
|
||||
|
||||
PDeblockingBSCalc pfDeblockingBSCalc;
|
||||
|
||||
PDeblockingFilterSlice pfDeblockingFilterSlice;
|
||||
} DeblockingFunc;
|
||||
|
||||
typedef void (*PSetNoneZeroCountZeroFunc) (int8_t* pNonZeroCount);
|
||||
|
@ -739,6 +739,9 @@ void DeblockingFilterSliceAvcbase (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, co
|
||||
}
|
||||
}
|
||||
|
||||
void DeblockingFilterSliceAvcbaseNull (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, const int32_t kiSliceIdx) {
|
||||
}
|
||||
|
||||
void PerformDeblockingFilter (sWelsEncCtx* pEnc) {
|
||||
const int32_t kiCurDid = pEnc->uiDependencyId;
|
||||
SWelsSvcCodingParam* pSvcParam = pEnc->pSvcParam;
|
||||
|
@ -3071,6 +3071,20 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) {
|
||||
// update some layer dependent variable to save judgements in mb-level
|
||||
pCurLayer->bSatdInMdFlag = ((pFuncList->sSampleDealingFuncs.pfMeCost == pFuncList->sSampleDealingFuncs.pfSampleSatd)
|
||||
&& (pFuncList->sSampleDealingFuncs.pfMdCost == pFuncList->sSampleDealingFuncs.pfSampleSatd));
|
||||
|
||||
const int32_t kiCurDid = pCtx->uiDependencyId;
|
||||
const int32_t kiCurTid = pCtx->uiTemporalId;
|
||||
if (pCurLayer->bDeblockingParallelFlag && (pCurLayer->iLoopFilterDisableIdc != 1)
|
||||
#if !defined(ENABLE_FRAME_DUMP)
|
||||
&& ( NRI_PRI_LOWEST != pCtx->eNalPriority )
|
||||
&& (pCtx->pSvcParam->sDependencyLayers[kiCurDid].iHighestTemporalId == 0
|
||||
|| kiCurTid < pCtx->pSvcParam->sDependencyLayers[kiCurDid].iHighestTemporalId)
|
||||
#endif// !ENABLE_FRAME_DUMP
|
||||
) {
|
||||
pFuncList->pfDeblocking.pfDeblockingFilterSlice = DeblockingFilterSliceAvcbase;
|
||||
} else {
|
||||
pFuncList->pfDeblocking.pfDeblockingFilterSlice = DeblockingFilterSliceAvcbaseNull;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -753,7 +753,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
||||
if (WELS_THREAD_ERROR_WAIT_OBJECT_0 == iWaitRet) { // start pSlice coding signal waited
|
||||
SLayerBSInfo* pLbi = pPrivateData->pLayerBs;
|
||||
const int32_t kiCurDid = pEncPEncCtx->uiDependencyId;
|
||||
const int32_t kiCurTid = pEncPEncCtx->uiTemporalId;
|
||||
SWelsSvcCodingParam* pCodingParam = pEncPEncCtx->pSvcParam;
|
||||
SSpatialLayerConfig* pParamD = &pCodingParam->sSpatialLayers[kiCurDid];
|
||||
|
||||
@ -829,15 +828,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
||||
}
|
||||
}
|
||||
|
||||
if (pCurDq->bDeblockingParallelFlag && pSlice->sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc != 1
|
||||
#if !defined(ENABLE_FRAME_DUMP)
|
||||
&& (eNalRefIdc != NRI_PRI_LOWEST) &&
|
||||
(pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId == 0
|
||||
|| kiCurTid < pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId)
|
||||
#endif// !ENABLE_FRAME_DUMP
|
||||
) {
|
||||
DeblockingFilterSliceAvcbase (pCurDq, pEncPEncCtx->pFuncList, iSliceIdx);
|
||||
}
|
||||
pEncPEncCtx->pFuncList->pfDeblocking.pfDeblockingFilterSlice (pCurDq, pEncPEncCtx->pFuncList, iSliceIdx);
|
||||
|
||||
if (bDsaFlag) {
|
||||
pEncPEncCtx->pSliceThreading->pSliceConsumeTime[pEncPEncCtx->uiDependencyId][iSliceIdx] = (uint32_t) (
|
||||
@ -947,15 +938,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
||||
}
|
||||
}
|
||||
|
||||
if (pCurDq->bDeblockingParallelFlag && pSlice->sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc != 1
|
||||
#if !defined(ENABLE_FRAME_DUMP)
|
||||
&& (eNalRefIdc != NRI_PRI_LOWEST) &&
|
||||
(pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId == 0
|
||||
|| kiCurTid < pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId)
|
||||
#endif// !ENABLE_FRAME_DUMP
|
||||
) {
|
||||
DeblockingFilterSliceAvcbase (pCurDq, pEncPEncCtx->pFuncList, iSliceIdx);
|
||||
}
|
||||
pEncPEncCtx->pFuncList->pfDeblocking.pfDeblockingFilterSlice (pCurDq, pEncPEncCtx->pFuncList, iSliceIdx);
|
||||
|
||||
#if defined(SLICE_INFO_OUTPUT)
|
||||
fprintf (stderr,
|
||||
|
Loading…
Reference in New Issue
Block a user