ref: 43f767d06ed79d9950178622f52cd9e64adec5bd
parent: a8d9576297ffdf10f5c76ff0cf3ef59f51936db1
author: Haibo Zhu <[email protected]>
date: Thu Mar 17 06:39:22 EDT 2016
Diable assert in release with -DNDEBUG macro Update the code to avoid the function unused warning
--- a/Makefile
+++ b/Makefile
@@ -51,6 +51,7 @@
# Configurations
ifeq ($(BUILDTYPE), Release)
CFLAGS += $(CFLAGS_OPT)
+CFLAGS += -DNDEBUG
USE_ASM = Yes
ifeq ($(DEBUGSYMBOLS), True)
CFLAGS += -g
--- a/codec/encoder/core/src/ref_list_mgr_svc.cpp
+++ b/codec/encoder/core/src/ref_list_mgr_svc.cpp
@@ -155,7 +155,7 @@
SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId];
int32_t iMaxFrameNumPlus1 = (1 << pCtx->pSps->uiLog2MaxFrameNum);
int32_t i;
- SSpatialLayerInternal *pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
+ SSpatialLayerInternal* pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
SLogContext* pLogCtx = & (pCtx->sLogCtx);
for (i = 0; i < LONG_TERM_REF_NUM; i++) {
@@ -196,7 +196,7 @@
SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
SPicture** pLongRefList = pRefList->pLongRefList;
SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId];
- SSpatialLayerInternal *pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
+ SSpatialLayerInternal* pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
int32_t i, j;
if (pLtr->uiLtrMarkState == LTR_MARKING_SUCCESS) {
@@ -258,7 +258,7 @@
int32_t i = 0;
int32_t j = 0;
bool bMoveLtrFromShortToLong = false;
- SSpatialLayerInternal *pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
+ SSpatialLayerInternal* pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
if (pCtx->eSliceType == I_SLICE) {
i = 0;
@@ -436,7 +436,7 @@
SPicture** pLongRefList = pRefList->pLongRefList;
int32_t iGoPFrameNumInterval = ((pCtx->pSvcParam->uiGopSize >> 1) > 1) ? (pCtx->pSvcParam->uiGopSize >> 1) : (1);
int32_t iMaxFrameNumPlus1 = (1 << pCtx->pSps->uiLog2MaxFrameNum);
- SSpatialLayerInternal *pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
+ SSpatialLayerInternal* pParamInternal = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
int32_t i;
for (i = 0; i < pRefList->uiLongRefCount; i++) {
@@ -449,8 +449,8 @@
return true;
}
-void WlesMarkMMCORefInfo(sWelsEncCtx* pCtx, SLTRState* pLtr,
- SSlice* pSliceList, const int32_t kiCountSliceNum) {
+void WlesMarkMMCORefInfo (sWelsEncCtx* pCtx, SLTRState* pLtr,
+ SSlice* pSliceList, const int32_t kiCountSliceNum) {
int32_t iSliceIdx = 0;
int32_t iGoPFrameNumInterval = ((pCtx->pSvcParam->uiGopSize >> 1) > 1) ? (pCtx->pSvcParam->uiGopSize >> 1) : (1);
@@ -459,7 +459,7 @@
SSliceHeader* pSliceHdr = &pSliceHdrExt->sSliceHeader;
SRefPicMarking* pRefPicMark = &pSliceHdr->sRefMarking;
- memset(pRefPicMark, 0, sizeof(SRefPicMarking));
+ memset (pRefPicMark, 0, sizeof (SRefPicMarking));
if (pCtx->pSvcParam->bEnableLongTermReference && pLtr->bLTRMarkingFlag) {
if (pLtr->iLTRMarkMode == LTR_DIRECT_MARK) {
@@ -471,8 +471,7 @@
pRefPicMark->SMmcoRef[pRefPicMark->uiMmcoCount].iLongTermFrameIdx = pLtr->iCurLtrIdx;
pRefPicMark->SMmcoRef[pRefPicMark->uiMmcoCount++].iMmcoType = MMCO_LONG;
- }
- else if (pLtr->iLTRMarkMode == LTR_DELAY_MARK) {
+ } else if (pLtr->iLTRMarkMode == LTR_DELAY_MARK) {
pRefPicMark->SMmcoRef[pRefPicMark->uiMmcoCount].iDiffOfPicNum = iGoPFrameNumInterval;
pRefPicMark->SMmcoRef[pRefPicMark->uiMmcoCount].iLongTermFrameIdx = pLtr->iCurLtrIdx;
pRefPicMark->SMmcoRef[pRefPicMark->uiMmcoCount++].iMmcoType = MMCO_SHORT2LONG;
@@ -505,11 +504,10 @@
if (pCtx->iActiveThreadsNum > 1) {
//will replace with thread-base pslice buffer later
pSliceList = pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer;
- WlesMarkMMCORefInfo(pCtx, pLtr, pSliceList, kiCountSliceNum);
- }
- else {
+ WlesMarkMMCORefInfo (pCtx, pLtr, pSliceList, kiCountSliceNum);
+ } else {
pSliceList = pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer;
- WlesMarkMMCORefInfo(pCtx, pLtr, pSliceList, kiCountSliceNum);
+ WlesMarkMMCORefInfo (pCtx, pLtr, pSliceList, kiCountSliceNum);
}
}
@@ -643,13 +641,13 @@
}
}
-void WelsUpdateSliceHeaderSyntax(sWelsEncCtx* pCtx, const int32_t iAbsDiffPicNumMinus1,
- SSlice* pSliceList, const int32_t uiFrameType) {
- const int32_t kiCountSliceNum = GetCurrentSliceNum(pCtx->pCurDqLayer);
+void WelsUpdateSliceHeaderSyntax (sWelsEncCtx* pCtx, const int32_t iAbsDiffPicNumMinus1,
+ SSlice* pSliceList, const int32_t uiFrameType) {
+ const int32_t kiCountSliceNum = GetCurrentSliceNum (pCtx->pCurDqLayer);
SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId];
int32_t iIdx = 0;
- assert(kiCountSliceNum > 0);
+ assert (kiCountSliceNum > 0);
for (iIdx = 0; iIdx < kiCountSliceNum; iIdx++) {
SSliceHeaderExt* pSliceHdrExt = &pSliceList[iIdx].sSliceHeaderExt;
@@ -664,8 +662,7 @@
pRefReorder->SReorderingSyntax[0].uiReorderingOfPicNumsIdc = 0;
pRefReorder->SReorderingSyntax[0].uiAbsDiffPicNumMinus1 = iAbsDiffPicNumMinus1;
pRefReorder->SReorderingSyntax[1].uiReorderingOfPicNumsIdc = 3;
- }
- else {
+ } else {
pRefReorder->SReorderingSyntax[0].uiReorderingOfPicNumsIdc = 2;
pRefReorder->SReorderingSyntax[0].iLongTermPicNum = pCtx->pRefList0[0]->iLongTermPicNum;
pRefReorder->SReorderingSyntax[1].uiReorderingOfPicNumsIdc = 3;
@@ -676,13 +673,12 @@
if (videoFrameTypeIDR == uiFrameType) {
pRefPicMark->bNoOutputOfPriorPicsFlag = false;
pRefPicMark->bLongTermRefFlag = pCtx->pSvcParam->bEnableLongTermReference;
- }
- else {
+ } else {
if (pCtx->pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME)
pRefPicMark->bAdaptiveRefPicMarkingModeFlag = pCtx->pSvcParam->bEnableLongTermReference;
else
pRefPicMark->bAdaptiveRefPicMarkingModeFlag = (pCtx->pSvcParam->bEnableLongTermReference
- && pLtr->bLTRMarkingFlag) ? (true) : (false);
+ && pLtr->bLTRMarkingFlag) ? (true) : (false);
}
}
}
@@ -696,18 +692,18 @@
SSlice* pSliceList = NULL;
SSpatialLayerInternal* pParamD = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
/*syntax for ref_pic_list_reordering()*/
- if (pCtx->iNumRef0 > 0){
+ if (pCtx->iNumRef0 > 0) {
iAbsDiffPicNumMinus1 = pParamD->iFrameNum - (pCtx->pRefList0[0]->iFrameNum) - 1;
if (iAbsDiffPicNumMinus1 < 0) {
- WelsLog(&(pCtx->sLogCtx), WELS_LOG_INFO, "WelsUpdateRefSyntax():::uiAbsDiffPicNumMinus1:%d", iAbsDiffPicNumMinus1);
- iAbsDiffPicNumMinus1 += (1 << (pCtx->pSps->uiLog2MaxFrameNum));
- WelsLog(&(pCtx->sLogCtx), WELS_LOG_INFO, "WelsUpdateRefSyntax():::uiAbsDiffPicNumMinus1< 0, update as:%d",
- iAbsDiffPicNumMinus1);
- }
+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "WelsUpdateRefSyntax():::uiAbsDiffPicNumMinus1:%d", iAbsDiffPicNumMinus1);
+ iAbsDiffPicNumMinus1 += (1 << (pCtx->pSps->uiLog2MaxFrameNum));
+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "WelsUpdateRefSyntax():::uiAbsDiffPicNumMinus1< 0, update as:%d",
+ iAbsDiffPicNumMinus1);
}
+ }
- if (pCtx->iActiveThreadsNum >0) {
+ if (pCtx->iActiveThreadsNum > 0) {
// to do: will replace with thread based buffer later
pSliceList = pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer;
} else {
@@ -714,7 +710,7 @@
pSliceList = pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer;
}
- WelsUpdateSliceHeaderSyntax(pCtx, iAbsDiffPicNumMinus1,pSliceList, uiFrameType);
+ WelsUpdateSliceHeaderSyntax (pCtx, iAbsDiffPicNumMinus1, pSliceList, uiFrameType);
}
@@ -882,8 +878,8 @@
return (kiFrameNum < (1 << 30)); // TODO: use the original judge first, may be improved
}
-void WlesMarkMMCORefInfoScreen(sWelsEncCtx* pCtx, SLTRState* pLtr,
- SSlice* pSliceList, const int32_t kiCountSliceNum) {
+void WlesMarkMMCORefInfoScreen (sWelsEncCtx* pCtx, SLTRState* pLtr,
+ SSlice* pSliceList, const int32_t kiCountSliceNum) {
const int32_t iMaxLtrIdx = pCtx->pSvcParam->iNumRefFrame - STR_ROOM - 1;
for (int32_t iSliceIdx = 0; iSliceIdx < kiCountSliceNum; iSliceIdx++) {
@@ -891,7 +887,7 @@
SSliceHeader* pSliceHdr = &pSliceHdrExt->sSliceHeader;
SRefPicMarking* pRefPicMark = &pSliceHdr->sRefMarking;
- memset(pRefPicMark, 0, sizeof(SRefPicMarking));
+ memset (pRefPicMark, 0, sizeof (SRefPicMarking));
if (pCtx->pSvcParam->bEnableLongTermReference) {
pRefPicMark->SMmcoRef[pRefPicMark->uiMmcoCount].iMaxLongTermFrameIdx = iMaxLtrIdx;
pRefPicMark->SMmcoRef[pRefPicMark->uiMmcoCount++].iMmcoType = MMCO_SET_MAX_LONG;
@@ -957,7 +953,10 @@
for (i = 0 ; i < pRefList->uiLongRefCount ; ++i) {
if (ppLongRefList[i]->bUsedAsRef && ppLongRefList[i]->bIsLongRef && (!ppLongRefList[i]->bIsSceneLTR)
&& iMaxMultiRefTid == ppLongRefList[i]->uiTemporalId) {
- assert (IsValidFrameNum (ppLongRefList[i]->iFrameNum)); // pLtr->iCurLtrIdx must have a value
+ if (!IsValidFrameNum (ppLongRefList[i]->iFrameNum)) { // pLtr->iCurLtrIdx must have a value
+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "WelsMarkPicScreen, Invalid Frame Number");
+ return;
+ }
int32_t iDeltaFrameNum = (pParamD->iFrameNum >= ppLongRefList[i]->iFrameNum)
? (pParamD->iFrameNum - ppLongRefList[i]->iFrameNum)
: (pParamD->iFrameNum + iMaxFrameNum - ppLongRefList[i]->iFrameNum);
@@ -978,16 +977,15 @@
}
}
- const int32_t iSliceNum = GetCurrentSliceNum(pCtx->pCurDqLayer);
+ const int32_t iSliceNum = GetCurrentSliceNum (pCtx->pCurDqLayer);
if (pCtx->iActiveThreadsNum > 1) {
// to do: will replace with thread based buffer later
pSliceList = pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer;
- }
- else {
+ } else {
pSliceList = pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer;
}
- WlesMarkMMCORefInfoScreen(pCtx, pLtr, pSliceList, iSliceNum);
+ WlesMarkMMCORefInfoScreen (pCtx, pLtr, pSliceList, iSliceNum);
return;
}