ref: 80862eec774e2c5ddc14c4ab085c3bdd18ee6421
parent: f2bd22acd5713cdb92ec2db8851e0f97ad26cc1f
author: Martin Storsjö <martin@martin.st>
date: Sat Feb 8 18:39:27 EST 2014
Use the C++ constants true/false instead of defining our own TRUE/FALSE has intentionally been left in use for the few platform specific APIs that define these constants themselves and expect them to be used, for consistency.
--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -211,7 +211,7 @@
bool bEnableAdaptiveQuant; // adaptive quantization control
bool bEnableFrameSkip; // allow skipping frames to keep the bitrate within limits
bool bEnableCropPic; // enable cropping source picture. 8/25/2010
- // FALSE: Streaming Video Sharing; TRUE: Video Conferencing Meeting;
+ // false: Streaming Video Sharing; true: Video Conferencing Meeting;
bool bEnableLongTermReference; // 0: on, 1: off
int iLtrMarkPeriod;
--- a/codec/common/typedefs.h
+++ b/codec/common/typedefs.h
@@ -67,13 +67,5 @@
#endif//EPSN
#define EPSN (0.000001f) // (1e-6) // desired float precision
-#ifndef FALSE
-#define FALSE ((int32_t)0)
-#endif//FALSE
-
-#ifndef TRUE
-#define TRUE ((int32_t)1)
-#endif//TRUE
-
#endif //WELS_TYPE_DEFINES_H__
--- a/codec/decoder/core/inc/dec_golomb.h
+++ b/codec/decoder/core/inc/dec_golomb.h
@@ -133,7 +133,7 @@
return (g_kuiLeadingZeroTable[iValue] + 8);
}
-//ASSERT(FALSE); // should not go here
+//ASSERT(false); // should not go here
return -1;
}
--- a/codec/decoder/core/inc/decoder_context.h
+++ b/codec/decoder/core/inc/decoder_context.h
@@ -319,7 +319,7 @@
int32_t iFeedbackVclNalInAu;
int32_t iFeedbackTidInAu;
- bool bAuReadyFlag; // TRUE: one au is ready for decoding; FALSE: default value
+ bool bAuReadyFlag; // true: one au is ready for decoding; false: default value
//trace handle
void* pTraceHandle;
--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -368,56 +368,56 @@
//Sub-clause 7.1.4.1.1 temporal_id
if (pLastNalHdrExt->uiTemporalId != pCurNalHeaderExt->uiTemporalId) {
- return TRUE;
+ return true;
}
// Subclause 7.4.1.2.5
if (pLastSliceHeader->iRedundantPicCnt < pCurSliceHeader->iRedundantPicCnt)
- return FALSE;
+ return false;
else if (pLastSliceHeader->iRedundantPicCnt > pCurSliceHeader->iRedundantPicCnt)
- return TRUE;
+ return true;
// Subclause G7.4.1.2.4
if (pLastNalHdrExt->uiDependencyId < pCurNalHeaderExt->uiDependencyId)
- return FALSE;
+ return false;
else if (pLastNalHdrExt->uiDependencyId > pCurNalHeaderExt->uiDependencyId)
- return TRUE;
+ return true;
if (pLastNalHdrExt->uiQualityId < pCurNalHeaderExt->uiQualityId)
- return FALSE;
+ return false;
else if (pLastNalHdrExt->uiQualityId > pCurNalHeaderExt->uiQualityId)
- return TRUE;
+ return true;
// Subclause 7.4.1.2.4
if (pLastSliceHeader->iFrameNum != pCurSliceHeader->iFrameNum)
- return TRUE;
+ return true;
if (pLastSliceHeader->iPpsId != pCurSliceHeader->iPpsId)
- return TRUE;
+ return true;
if (pLastSliceHeader->bFieldPicFlag != pCurSliceHeader->bFieldPicFlag)
- return TRUE;
+ return true;
if (pLastSliceHeader->bBottomFiledFlag != pCurSliceHeader->bBottomFiledFlag)
- return TRUE;
+ return true;
if ((pLastNalHdrExt->sNalUnitHeader.uiNalRefIdc != NRI_PRI_LOWEST) != (pCurNalHeaderExt->sNalUnitHeader.uiNalRefIdc !=
NRI_PRI_LOWEST))
- return TRUE;
+ return true;
if (pLastNalHdrExt->bIdrFlag != pCurNalHeaderExt->bIdrFlag)
- return TRUE;
+ return true;
if (pCurNalHeaderExt->bIdrFlag) {
if (pLastSliceHeader->uiIdrPicId != pCurSliceHeader->uiIdrPicId)
- return TRUE;
+ return true;
}
if (kpSps->uiPocType == 0) {
if (pLastSliceHeader->iPicOrderCntLsb != pCurSliceHeader->iPicOrderCntLsb)
- return TRUE;
+ return true;
if (pLastSliceHeader->iDeltaPicOrderCntBottom != pCurSliceHeader->iDeltaPicOrderCntBottom)
- return TRUE;
+ return true;
} else if (kpSps->uiPocType == 1) {
if (pLastSliceHeader->iDeltaPicOrderCnt[0] != pCurSliceHeader->iDeltaPicOrderCnt[0])
- return TRUE;
+ return true;
if (pLastSliceHeader->iDeltaPicOrderCnt[1] != pCurSliceHeader->iDeltaPicOrderCnt[1])
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
@@ -429,56 +429,56 @@
//Sub-clause 7.1.4.1.1 temporal_id
if (kpLastNalHeaderExt->uiTemporalId != kpCurNalHeaderExt->uiTemporalId) {
- return TRUE;
+ return true;
}
// Subclause 7.4.1.2.5
if (kpLastSliceHeader->iRedundantPicCnt < kpCurSliceHeader->iRedundantPicCnt)
- return FALSE;
+ return false;
else if (kpLastSliceHeader->iRedundantPicCnt > kpCurSliceHeader->iRedundantPicCnt)
- return TRUE;
+ return true;
// Subclause G7.4.1.2.4
if (kpLastNalHeaderExt->uiDependencyId < kpCurNalHeaderExt->uiDependencyId)
- return FALSE;
+ return false;
else if (kpLastNalHeaderExt->uiDependencyId > kpCurNalHeaderExt->uiDependencyId)
- return TRUE;
+ return true;
if (kpLastNalHeaderExt->uiQualityId < kpCurNalHeaderExt->uiQualityId)
- return FALSE;
+ return false;
else if (kpLastNalHeaderExt->uiQualityId > kpCurNalHeaderExt->uiQualityId)
- return TRUE;
+ return true;
// Subclause 7.4.1.2.4
if (kpLastSliceHeader->iFrameNum != kpCurSliceHeader->iFrameNum)
- return TRUE;
+ return true;
if (kpLastSliceHeader->iPpsId != kpCurSliceHeader->iPpsId)
- return TRUE;
+ return true;
if (kpLastSliceHeader->bFieldPicFlag != kpCurSliceHeader->bFieldPicFlag)
- return TRUE;
+ return true;
if (kpLastSliceHeader->bBottomFiledFlag != kpCurSliceHeader->bBottomFiledFlag)
- return TRUE;
+ return true;
if ((kpLastNalHeaderExt->sNalUnitHeader.uiNalRefIdc != NRI_PRI_LOWEST) != (kpCurNalHeaderExt->sNalUnitHeader.uiNalRefIdc
!= NRI_PRI_LOWEST))
- return TRUE;
+ return true;
if (kpLastNalHeaderExt->bIdrFlag != kpCurNalHeaderExt->bIdrFlag)
- return TRUE;
+ return true;
if (kpCurNalHeaderExt->bIdrFlag) {
if (kpLastSliceHeader->uiIdrPicId != kpCurSliceHeader->uiIdrPicId)
- return TRUE;
+ return true;
}
if (kpSps->uiPocType == 0) {
if (kpLastSliceHeader->iPicOrderCntLsb != kpCurSliceHeader->iPicOrderCntLsb)
- return TRUE;
+ return true;
if (kpLastSliceHeader->iDeltaPicOrderCntBottom != kpCurSliceHeader->iDeltaPicOrderCntBottom)
- return TRUE;
+ return true;
} else if (kpSps->uiPocType == 1) {
if (kpLastSliceHeader->iDeltaPicOrderCnt[0] != kpCurSliceHeader->iDeltaPicOrderCnt[0])
- return TRUE;
+ return true;
if (kpLastSliceHeader->iDeltaPicOrderCnt[1] != kpCurSliceHeader->iDeltaPicOrderCnt[1])
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*!
--- a/codec/decoder/core/src/deblocking.cpp
+++ b/codec/decoder/core/src/deblocking.cpp
@@ -252,8 +252,8 @@
int32_t iMbY = pCurDqLayer->iMbY;
int32_t iMbX = pCurDqLayer->iMbX;
int32_t iMbXy = pCurDqLayer->iMbXyIndex;
- bool bLeftFlag = FALSE;
- bool bTopFlag = FALSE;
+ bool bLeftFlag = false;
+ bool bTopFlag = false;
if (2 == iFilterIdc) {
bLeftFlag = (iMbX > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - 1]);
--- a/codec/decoder/core/src/manage_dec_ref.cpp
+++ b/codec/decoder/core/src/manage_dec_ref.cpp
@@ -220,7 +220,7 @@
PRefPicMarking pRefPicMarking = pCtx->pCurDqLayer->pRefPicMarking;
PRefBasePicMarking pRefPicBaseMarking = pCtx->pCurDqLayer->pRefPicBaseMarking;
PAccessUnit pCurAU = pCtx->pAccessUnitList;
- bool bIsIDRAU = FALSE;
+ bool bIsIDRAU = false;
uint32_t j;
int32_t iRet = ERR_NONE;
@@ -228,7 +228,7 @@
return ERR_INFO_INVALID_MMCO_REF_NUM_NOT_ENOUGH;
}
- pCtx->pDec->bUsedAsRef = TRUE;
+ pCtx->pDec->bUsedAsRef = true;
pCtx->pDec->uiQualityId = pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.uiQualityId;
pCtx->pDec->uiTemporalId = pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.uiTemporalId;
pCtx->pDec->bRefBaseFlag = kbRefBaseMarkingFlag;
@@ -236,7 +236,7 @@
for (j = pCurAU->uiStartPos; j <= pCurAU->uiEndPos; j++) {
if (pCurAU->pNalUnitsList[j]->sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR
|| pCurAU->pNalUnitsList[j]->sNalHeaderExt.bIdrFlag) {
- bIsIDRAU = TRUE;
+ bIsIDRAU = true;
break;
}
}
@@ -290,7 +290,7 @@
if (uiMmcoType > MMCO_LONG2UNUSED) {
return ERR_INFO_INVALID_MMCO_OPCODE_BASE;
}
- iRet = MMCOProcess (pCtx, uiMmcoType, TRUE, iShortFrameNum, uiLongTermPicNum, 0, 0);
+ iRet = MMCOProcess (pCtx, uiMmcoType, true, iShortFrameNum, uiLongTermPicNum, 0, 0);
if (iRet != ERR_NONE) {
return iRet;
@@ -314,7 +314,7 @@
if (uiMmcoType > MMCO_LONG) {
return ERR_INFO_INVALID_MMCO_OPCODE_BASE;
}
- iRet = MMCOProcess (pCtx, uiMmcoType, FALSE, iShortFrameNum, uiLongTermPicNum, iLongTermFrameIdx, iMaxLongTermFrameIdx);
+ iRet = MMCOProcess (pCtx, uiMmcoType, false, iShortFrameNum, uiLongTermPicNum, iLongTermFrameIdx, iMaxLongTermFrameIdx);
if (iRet != ERR_NONE) {
return iRet;
}
@@ -450,8 +450,8 @@
if (((eRemoveFlag == REMOVE_TARGET) && ! (pPic->bRefBaseFlag)) || ((eRemoveFlag == REMOVE_BASE)
&& pPic->bRefBaseFlag)) {
int32_t iMoveSize = pRefPic->uiLongRefCount[LIST_0] - i - 1;
- pPic->bUsedAsRef = FALSE;
- pPic->bIsLongRef = FALSE;
+ pPic->bUsedAsRef = false;
+ pPic->bIsLongRef = false;
if (iMoveSize > 0) {
memmove (&pRefPic->pLongRefList[LIST_0][i], &pRefPic->pLongRefList[LIST_0][i + 1],
iMoveSize * sizeof (PPicture)); //confirmed_safe_unsafe_usage
@@ -474,8 +474,8 @@
}
static int32_t AddShortTermToList (PRefPic pRefPic, PPicture pPic) {
- pPic->bUsedAsRef = TRUE;
- pPic->bIsLongRef = FALSE;
+ pPic->bUsedAsRef = true;
+ pPic->bIsLongRef = false;
pPic->iLongTermFrameIdx = -1;
if (pRefPic->uiShortRefCount[LIST_0] > 0) {
memmove (&pRefPic->pShortRefList[LIST_0][1], &pRefPic->pShortRefList[LIST_0][0],
@@ -489,8 +489,8 @@
static int32_t AddLongTermToList (PRefPic pRefPic, PPicture pPic, int32_t iLongTermFrameIdx) {
int32_t i = 0;
- pPic->bUsedAsRef = TRUE;
- pPic->bIsLongRef = TRUE;
+ pPic->bUsedAsRef = true;
+ pPic->bIsLongRef = true;
pPic->iLongTermFrameIdx = iLongTermFrameIdx;
if (pRefPic->uiLongRefCount[LIST_0] == 0) {
pRefPic->pLongRefList[LIST_0][pRefPic->uiLongRefCount[LIST_0]] = pPic;
--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -143,10 +143,10 @@
bool bDeblockingParallelFlag; // deblocking filter parallelization control flag
bool bMgsT0OnlyStrategy; //MGS_T0_only_strategy
bool bEnableSSEI;
-bool bEnableFrameCroppingFlag; // enable frame cropping flag: TRUE alwayse in application
+bool bEnableFrameCroppingFlag; // enable frame cropping flag: true alwayse in application
bool bEnableCropPic; // enable cropping source picture. , 8/25/2010
-// FALSE: Streaming Video Sharing; TRUE: Video Conferencing Meeting;
+// false: Streaming Video Sharing; true: Video Conferencing Meeting;
int8_t iDecompStages; // GOP size dependency
/* Deblocking loop filter */
@@ -225,9 +225,9 @@
bMgsT0OnlyStrategy =
true; // Strategy of have MGS only at T0 frames (0: do not use this strategy; 1: use this strategy)
bEnableSSEI = true;
- bEnableFrameCroppingFlag = true; // enable frame cropping flag: TRUE alwayse in application
+ bEnableFrameCroppingFlag = true; // enable frame cropping flag: true alwayse in application
bEnableCropPic = true; // enable cropping source picture. , 8/25/2010
- // FALSE: Streaming Video Sharing; TRUE: Video Conferencing Meeting;
+ // false: Streaming Video Sharing; true: Video Conferencing Meeting;
iDecompStages = 0; // GOP size dependency, unknown here and be revised later
/* Deblocking loop filter */
--- a/codec/encoder/core/inc/wels_common_basis.h
+++ b/codec/encoder/core/inc/wels_common_basis.h
@@ -311,7 +311,7 @@
#define MB_TYPE_UNAVAILABLE 0xFF000000
#define REF_NOT_AVAIL -2
#define REF_NOT_IN_LIST -1 //intra
-#define REF_PIC_REORDER_DEFAULT TRUE
+#define REF_PIC_REORDER_DEFAULT true
#define IS_INTRA4x4(type) ( MB_TYPE_INTRA4x4 == (type) )
#define IS_INTRA16x16(type) ( MB_TYPE_INTRA16x16 == (type) )
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3359,7 +3359,7 @@
pCtx->iActiveThreadsNum = iSliceCount;
// to fire slice coding threads
err = FiredSliceThreads (&pCtx->pSliceThreading->pThreadPEncCtx[0], &pCtx->pSliceThreading->pReadySliceCodingEvent[0],
- pLayerBsInfo, iSliceCount, pCtx->pCurDqLayer->pSliceEncCtx, FALSE);
+ pLayerBsInfo, iSliceCount, pCtx->pCurDqLayer->pSliceEncCtx, false);
if (err) {
WelsLog (pCtx, WELS_LOG_ERROR,
"[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
@@ -3418,7 +3418,7 @@
iNumThreadsRunning = iNumThreadsScheduled;
// to fire slice coding threads
err = FiredSliceThreads (&pCtx->pSliceThreading->pThreadPEncCtx[0], &pCtx->pSliceThreading->pReadySliceCodingEvent[0],
- pLayerBsInfo, iNumThreadsRunning, pCtx->pCurDqLayer->pSliceEncCtx, FALSE);
+ pLayerBsInfo, iNumThreadsRunning, pCtx->pCurDqLayer->pSliceEncCtx, false);
if (err) {
WelsLog (pCtx, WELS_LOG_ERROR,
"[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
@@ -3510,7 +3510,7 @@
// to fire slice coding threads
err = FiredSliceThreads (&pCtx->pSliceThreading->pThreadPEncCtx[0], &pCtx->pSliceThreading->pReadySliceCodingEvent[0],
- pLayerBsInfo, kiPartitionCnt, pCtx->pCurDqLayer->pSliceEncCtx, TRUE);
+ pLayerBsInfo, kiPartitionCnt, pCtx->pCurDqLayer->pSliceEncCtx, true);
if (err) {
WelsLog (pCtx, WELS_LOG_ERROR,
"[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
--- a/codec/encoder/core/src/ratectl.cpp
+++ b/codec/encoder/core/src/ratectl.cpp
@@ -108,7 +108,7 @@
int32_t j = 0;
int32_t iMbWidth = 0;
- bool bMultiSliceMode = FALSE;
+ bool bMultiSliceMode = false;
int32_t iGomRowMode0 = 1, iGomRowMode1 = 1;
#ifdef _TEST_TEMP_RC_
fp_test_rc = fopen ("testRC.dat", "w");
--- a/codec/encoder/core/src/ref_list_mgr_svc.cpp
+++ b/codec/encoder/core/src/ref_list_mgr_svc.cpp
@@ -55,7 +55,7 @@
* reset LTR marking , recovery ,feedback state to default
*/
void ResetLtrState (SLTRState* pLtr) {
- pLtr->bReceivedT0LostFlag = FALSE;
+ pLtr->bReceivedT0LostFlag = false;
pLtr->iLastRecoverFrameNum = 0;
pLtr->iLastCorFrameNumDec = -1;
pLtr->iCurFrameNumInDec = -1;
@@ -63,8 +63,8 @@
// LTR mark
pLtr->iLTRMarkMode = LTR_DIRECT_MARK;
pLtr->iLTRMarkSuccessNum = 0; //successful marked num
- pLtr->bLTRMarkingFlag = FALSE; //decide whether current frame marked as LTR
- pLtr->bLTRMarkEnable = FALSE; //when LTR is confirmed and the interval is no smaller than the marking period
+ pLtr->bLTRMarkingFlag = false; //decide whether current frame marked as LTR
+ pLtr->bLTRMarkEnable = false; //when LTR is confirmed and the interval is no smaller than the marking period
pLtr->iCurLtrIdx = 0;
pLtr->iLastLtrIdx = 0;
pLtr->uiLtrMarkInterval = 0;
@@ -165,7 +165,7 @@
pLongRefList[i]->iLongTermPicNum, pLongRefList[i]->iFrameNum);
SetUnref (pLongRefList[i]);
DeleteLTRFromLongList (pCtx, i);
- pLtr->bLTRMarkEnable = TRUE;
+ pLtr->bLTRMarkEnable = true;
if (pRefList->uiLongRefCount == 0) {
pCtx->bEncCurFrmAsIdrFlag = true;
}
@@ -178,7 +178,7 @@
pLongRefList[i]->iLongTermPicNum, pLongRefList[i]->iFrameNum);
SetUnref (pLongRefList[i]);
DeleteLTRFromLongList (pCtx, i);
- pLtr->bLTRMarkEnable = TRUE;
+ pLtr->bLTRMarkEnable = true;
if (pRefList->uiLongRefCount == 0) {
pCtx->bEncCurFrmAsIdrFlag = true;
}
@@ -221,7 +221,7 @@
pLtr->iCurLtrIdx = (pLtr->iCurLtrIdx+1)%LONG_TERM_REF_NUM;
pLtr->iLTRMarkMode = (pLtr->iLTRMarkSuccessNum >= (LONG_TERM_REF_NUM)) ? (LTR_DELAY_MARK) : (LTR_DIRECT_MARK);
WelsLog (pCtx, WELS_LOG_WARNING, "LTR mark mode =%d", pLtr->iLTRMarkMode);
- pLtr->bLTRMarkEnable = TRUE;
+ pLtr->bLTRMarkEnable = true;
break;
}
}
@@ -235,7 +235,7 @@
}
}
pLtr->uiLtrMarkState = NO_LTR_MARKING_FEEDBACK;
- pLtr->bLTRMarkEnable = TRUE;
+ pLtr->bLTRMarkEnable = true;
if (pLtr->iLTRMarkSuccessNum == 0) {
pCtx->bEncCurFrmAsIdrFlag = true; // no LTR , means IDR recieve failed, force next frame IDR
@@ -339,10 +339,10 @@
uint32_t i = 0;
// Need update pRef list in case store base layer or target dependency layer construction
if (NULL == pCtx->pCurDqLayer)
- return FALSE;
+ return false;
if (NULL == pRefList || NULL == pRefList->pRef[0] || NULL == pRefList->pRef[kiSwapIdx])
- return FALSE;
+ return false;
if (NULL != pCtx->pDecPic) {
#if !defined(ENABLE_FRAME_DUMP) // to save complexity, 1/6/2009
@@ -373,8 +373,8 @@
DeleteInvalidLTR (pCtx);
HandleLTRMarkFeedback (pCtx);
- pLtr->bReceivedT0LostFlag = FALSE; // reset to false due to the recovery is finished
- pLtr->bLTRMarkingFlag = FALSE;
+ pLtr->bReceivedT0LostFlag = false; // reset to false due to the recovery is finished
+ pLtr->bLTRMarkingFlag = false;
++pLtr->uiLtrMarkInterval;
}
@@ -394,7 +394,7 @@
pLtr->iCurLtrIdx = (pLtr->iCurLtrIdx+1)%LONG_TERM_REF_NUM;
pLtr->iLTRMarkSuccessNum = 1; //IDR default suceess
- pLtr->bLTRMarkEnable = TRUE;
+ pLtr->bLTRMarkEnable = true;
pLtr->uiLtrMarkInterval = 0;
pCtx->pVaa->uiValidLongTermPicIdx = 0;
@@ -402,7 +402,7 @@
}
}
PrefetchNextBuffer (pCtx);
- return TRUE;
+ return true;
}
bool CheckCurMarkFrameNumUsed (sWelsEncCtx* pCtx) {
@@ -417,11 +417,11 @@
if ((pCtx->iFrameNum == pLongRefList[i]->iFrameNum && pLtr->iLTRMarkMode == LTR_DIRECT_MARK) ||
(CompareFrameNum (pCtx->iFrameNum + iGoPFrameNumInterval, pLongRefList[i]->iFrameNum,
iMaxFrameNumPlus1) == FRAME_NUM_EQUAL && pLtr->iLTRMarkMode == LTR_DELAY_MARK)) {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
void WelsMarkPic (sWelsEncCtx* pCtx) {
SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId];
@@ -432,12 +432,12 @@
if (pCtx->pSvcParam->bEnableLongTermReference && pLtr->bLTRMarkEnable && pCtx->uiTemporalId == 0) {
if (!pLtr->bReceivedT0LostFlag && pLtr->uiLtrMarkInterval > pCtx->pSvcParam->uiLtrMarkPeriod
&& CheckCurMarkFrameNumUsed (pCtx)) {
- pLtr->bLTRMarkingFlag = TRUE;
- pLtr->bLTRMarkEnable = FALSE;
+ pLtr->bLTRMarkingFlag = true;
+ pLtr->bLTRMarkEnable = false;
pLtr->uiLtrMarkInterval = 0;
pLtr->iLastLtrIdx = pLtr->iCurLtrIdx;
} else {
- pLtr->bLTRMarkingFlag = FALSE;
+ pLtr->bLTRMarkingFlag = false;
}
}
@@ -478,10 +478,10 @@
if (pRequest->uiFeedbackType == LTR_RECOVERY_REQUEST && pRequest->uiIDRPicId == pCtx->sPSOVector.uiIdrPicId) {
if (pRequest->iLastCorrectFrameNum == -1) {
pCtx->bEncCurFrmAsIdrFlag = true;
- return TRUE;
+ return true;
} else if (pRequest->iCurrentFrameNum == -1) {
pLtr->bReceivedT0LostFlag = true;
- return TRUE;
+ return true;
} else if ((CompareFrameNum (pLtr->iLastRecoverFrameNum , pRequest->iLastCorrectFrameNum,
iMaxFrameNumPlus1) & (FRAME_NUM_EQUAL | FRAME_NUM_SMALLER)) // t0 lost
|| ((CompareFrameNum (pLtr->iLastRecoverFrameNum , pRequest->iCurrentFrameNum,
@@ -502,9 +502,9 @@
, pRequest->uiFeedbackType, pRequest->uiIDRPicId, pRequest->iCurrentFrameNum, pRequest->iLastCorrectFrameNum);
}
} else if (!pCtx->pSvcParam->bEnableLongTermReference) {
- pCtx->bEncCurFrmAsIdrFlag = TRUE;
+ pCtx->bEncCurFrmAsIdrFlag = true;
}
- return TRUE;
+ return true;
}
void FilterLTRMarkingFeedback (sWelsEncCtx* pCtx, SLTRMarkingFeedback* pLTRMarkingFeedback) {
SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId];
@@ -576,7 +576,7 @@
if (pCtx->iNumRef0 > kiNumRef)
pCtx->iNumRef0 = kiNumRef;
- return (pCtx->iNumRef0 > 0 || pCtx->eSliceType == I_SLICE) ? (TRUE) : (FALSE);
+ return (pCtx->iNumRef0 > 0 || pCtx->eSliceType == I_SLICE) ? (true) : (false);
}
/*
--- a/codec/encoder/core/src/slice_multi_threading.cpp
+++ b/codec/encoder/core/src/slice_multi_threading.cpp
@@ -967,7 +967,7 @@
InitBits (&pSliceBs->sBsWrite, pSliceBs->pBsBuffer, pSliceBs->uiSize);
#if MT_DEBUG_BS_WR
- pSliceBs->bSliceCodedFlag = FALSE;
+ pSliceBs->bSliceCodedFlag = false;
#endif//MT_DEBUG_BS_WR
if (bNeedPrefix) {
@@ -1041,7 +1041,7 @@
#endif//SLICE_INFO_OUTPUT
#if MT_DEBUG_BS_WR
- pSliceBs->bSliceCodedFlag = TRUE;
+ pSliceBs->bSliceCodedFlag = true;
#endif//MT_DEBUG_BS_WR
#ifdef _WIN32
--- a/codec/encoder/core/src/svc_base_layer_md.cpp
+++ b/codec/encoder/core/src/svc_base_layer_md.cpp
@@ -1342,15 +1342,15 @@
SMVUnitXY sQpelMvp = { sMvp.iMvX >> 2, sMvp.iMvY >> 2 };
n = (pCurMb->iMbX << 4) + sQpelMvp.iMvX;
if (n < -29)
- return FALSE;
+ return false;
else if (n > (int32_t) ((pCurLayer->iMbWidth << 4) + 12))
- return FALSE;
+ return false;
n = (pCurMb->iMbY << 4) + sQpelMvp.iMvY;
if (n < -29)
- return FALSE;
+ return false;
else if (n > (int32_t) ((pCurLayer->iMbHeight << 4) + 12))
- return FALSE;
+ return false;
//luma
pRefLuma += sQpelMvp.iMvY * iLineSizeY + sQpelMvp.iMvX;
@@ -1395,7 +1395,7 @@
pCurMb->sP16x16Mv = sMvp;
pCurLayer->pDecPic->sMvList[pCurMb->iMbXY] = sMvp;
- return TRUE;
+ return true;
}
WelsDctMb (pMbCache->pCoeffLevel, pEncMb, iEncStride, pDstLuma, pEncCtx->pFuncList->pfDctFourT4);
@@ -1428,11 +1428,11 @@
pCurMb->sP16x16Mv = sMvp;
pCurLayer->pDecPic->sMvList[pCurMb->iMbXY] = sMvp;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
const int32_t g_kiPixStrideIdx8x8[4] = { 0, ME_REFINE_BUF_WIDTH_BLK8,
@@ -1611,10 +1611,10 @@
WelsIMbChromaEncode (pEncCtx, pCurMb, pMbCache); //add pEnc&rec to MD--2010.3.15
pCurMb->pSadCost[0] = 0;
- return TRUE; //intra_mb_type is best
+ return true; //intra_mb_type is best
}
- return FALSE;
+ return false;
}
void WelsMdInterMb (void* pEnc, void* pMd, SSlice* pSlice, SMB* pCurMb, SMbCache* pUnused) {
@@ -1631,7 +1631,7 @@
const bool bMbTopRightAvailPskip = ((kuiNeighborAvail & TOPRIGHT_MB_POS) ? IS_SKIP ((top_mb + 1)->uiMbType) : false);
bool bTrySkip = bMbLeftAvailPskip || bMbTopAvailPskip || bMbTopLeftAvailPskip || bMbTopRightAvailPskip;
bool bKeepSkip = bMbLeftAvailPskip && bMbTopAvailPskip && bMbTopRightAvailPskip;
- bool bSkip = FALSE;
+ bool bSkip = false;
if (pEncCtx->pFuncList->pfInterMdBackgroundDecision (pEncCtx, pWelsMd, pSlice, pCurMb, pMbCache, &bKeepSkip)) {
return;
--- a/codec/encoder/core/src/svc_encode_mb.cpp
+++ b/codec/encoder/core/src/svc_encode_mb.cpp
@@ -339,17 +339,17 @@
pEncCtx->pFuncList->pfQuantizationFour4x4Max (pRes, pFF, pMF, (int16_t*)aMax);
for (j = 0; j < 4; j++) {
- if (aMax[j] > 1) return FALSE; // iSingleCtrMb += 9, can't be P_SKIP
+ if (aMax[j] > 1) return false; // iSingleCtrMb += 9, can't be P_SKIP
else if (aMax[j] == 1) {
pEncCtx->pFuncList->pfScan4x4 (pBlock, pRes); //
iSingleCtrMb += pEncCtx->pFuncList->pfCalculateSingleCtr4x4 (pBlock);
}
- if (iSingleCtrMb >= 6) return FALSE; //from JVT-O079
+ if (iSingleCtrMb >= 6) return false; //from JVT-O079
pRes += 16;
pBlock += 16;
}
}
- return TRUE;
+ return true;
}
bool WelsTryPUVskip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, int32_t iUV) {
@@ -362,7 +362,7 @@
const int16_t* pFF = g_kiQuantInterFF[kuiQp];
if (pEncCtx->pFuncList->pfQuantizationHadamard2x2Skip (pRes, pFF[0] << 1, pMF[0]>>1))
- return FALSE;
+ return false;
else {
uint16_t aMax[4], j;
int32_t iSingleCtrMb = 0;
@@ -370,16 +370,16 @@
pEncCtx->pFuncList->pfQuantizationFour4x4Max (pRes, pFF, pMF, (int16_t*)aMax);
for (j = 0; j < 4; j++) {
- if (aMax[j] > 1) return FALSE; // iSingleCtrMb += 9, can't be P_SKIP
+ if (aMax[j] > 1) return false; // iSingleCtrMb += 9, can't be P_SKIP
else if (aMax[j] == 1) {
pEncCtx->pFuncList->pfScan4x4Ac (pBlock, pRes);
iSingleCtrMb += pEncCtx->pFuncList->pfCalculateSingleCtr4x4 (pBlock);
}
- if (iSingleCtrMb >= 7) return FALSE; //from JVT-O079
+ if (iSingleCtrMb >= 7) return false; //from JVT-O079
pRes += 16;
pBlock += 16;
}
- return TRUE;
+ return true;
}
}
--- a/codec/encoder/core/src/svc_encode_slice.cpp
+++ b/codec/encoder/core/src/svc_encode_slice.cpp
@@ -874,7 +874,7 @@
WelsMutexUnlock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);
#endif//MT_ENABLED
- return TRUE;
+ return true;
}
if (
@@ -896,7 +896,7 @@
WelsMutexUnlock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate);
#endif//MT_ENABLED
- return FALSE;
+ return false;
}
///////////////
--- a/codec/encoder/core/src/svc_mode_decision.cpp
+++ b/codec/encoder/core/src/svc_mode_decision.cpp
@@ -63,7 +63,7 @@
bool bTrySkip = kbMbLeftAvailPskip | kbMbTopAvailPskip | kbMbTopLeftAvailPskip | kbMbTopRightAvailPskip;
bool bKeepSkip = kbMbLeftAvailPskip & kbMbTopAvailPskip & kbMbTopRightAvailPskip;
- bool bSkip = FALSE;
+ bool bSkip = false;
if (pEncCtx->pFuncList->pfInterMdBackgroundDecision (pEncCtx, pWelsMd, pSlice, pCurMb, pMbCache, &bKeepSkip)) {
return;
--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -208,7 +208,7 @@
m_pInterfaceVp = NULL;
m_pEncLib = NULL;
m_bInitDone = false;
- m_bOfficialBranch = FALSE;
+ m_bOfficialBranch = false;
m_pEncCtx = pEncCtx;
memset (&m_sScaledPicture, 0, sizeof (m_sScaledPicture));
}
@@ -281,12 +281,12 @@
for (int32_t i = 0; i < iNumDependencyLayer; i++) {
if (pSvcParam->sDependencyLayers[i].iFrameWidth != pic_queue[i]->iPicWidth ||
pSvcParam->sDependencyLayers[i].iFrameHeight != pic_queue[i]->iPicHeight) {
- m_bOfficialBranch = TRUE;
+ m_bOfficialBranch = true;
break;
}
}
}
- m_bInitDone = TRUE;
+ m_bInitDone = true;
}
if (m_pInterfaceVp == NULL)
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -68,7 +68,7 @@
m_iMaxPicWidth (0),
m_iMaxPicHeight (0),
m_iCspInternal (0),
- m_bInitialFlag (FALSE) {
+ m_bInitialFlag (false) {
#ifdef REC_FRAME_COUNT
int32_t m_uiCountFrameNum = 0;
#endif//REC_FRAME_COUNT
@@ -135,7 +135,7 @@
m_pFileBs = WelsFopen (strStreamFileName, "wb");
m_pFileBsSize = WelsFopen (strLenFileName, "wb");
- m_bSwitch = FALSE;
+ m_bSwitch = false;
m_iSwitchTimes = 0;
#endif//OUTPUT_BIT_STREAM
@@ -171,7 +171,7 @@
WelsFclose (m_pFileBsSize);
m_pFileBsSize = NULL;
}
- m_bSwitch = FALSE;
+ m_bSwitch = false;
m_iSwitchTimes = 0;
#endif//OUTPUT_BIT_STREAM
@@ -414,7 +414,7 @@
}
m_iCspInternal = iColorspace;
- m_bInitialFlag = TRUE;
+ m_bInitialFlag = true;
return cmResultSuccess;
}
@@ -458,7 +458,7 @@
m_pEncContext = NULL;
}
- m_bInitialFlag = FALSE;
+ m_bInitialFlag = false;
return 0;
}
@@ -587,7 +587,7 @@
m_pFileBsSize = WelsFopen (strStreamFileName, "wb");
- m_bSwitch = FALSE;
+ m_bSwitch = false;
}
for (i = 0; i < pBsInfo->iLayerNum; i++) {
@@ -665,7 +665,7 @@
return cmInitParaError;
}
- if (NULL == m_pEncContext || FALSE == m_bInitialFlag) {
+ if (NULL == m_pEncContext || false == m_bInitialFlag) {
return cmInitExpected;
}
@@ -783,7 +783,7 @@
if (sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoWidth !=
m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iNumDependencyLayer - 1].iFrameWidth) {
++ m_iSwitchTimes;
- m_bSwitch = TRUE;
+ m_bSwitch = true;
}
#endif//OUTPUT_BIT_STREAM
if (sEncodingParam.iSpatialLayerNum < 1
@@ -926,7 +926,7 @@
if (NULL == pOption) {
return cmInitParaError;
}
- if (NULL == m_pEncContext || FALSE == m_bInitialFlag) {
+ if (NULL == m_pEncContext || false == m_bInitialFlag) {
return cmInitExpected;
}
--- a/codec/processing/src/common/WelsFrameWork.cpp
+++ b/codec/processing/src/common/WelsFrameWork.cpp
@@ -221,7 +221,7 @@
}
bool CVpFrameWork::CheckValid (EMethods eMethod, SPixMap& pSrcPixMap, SPixMap& pDstPixMap) {
- bool eReturn = FALSE;
+ bool eReturn = false;
if (eMethod == METHOD_NULL)
goto exit;
@@ -253,7 +253,7 @@
|| pDstPixMap.sRect.iRectLeft >= pDstPixMap.sRect.iRectWidth || pDstPixMap.sRect.iRectWidth > pDstPixMap.iStride[0])
goto exit;
}
- eReturn = TRUE;
+ eReturn = true;
exit:
return eReturn;
--- a/codec/processing/src/common/WelsFrameWork.h
+++ b/codec/processing/src/common/WelsFrameWork.h
@@ -62,7 +62,7 @@
m_eMethod = METHOD_NULL;
m_eFormat = VIDEO_FORMAT_I420;
m_iIndex = 0;
- m_bInit = FALSE;
+ m_bInit = false;
};
virtual ~IStrategy() {}
--- a/codec/processing/src/common/typedef.h
+++ b/codec/processing/src/common/typedef.h
@@ -73,11 +73,6 @@
#endif
-enum {
- FALSE = 0,
- TRUE = !FALSE
-};
-
WELSVP_NAMESPACE_END
#endif