fix coverity issues

This commit is contained in:
volvet 2014-01-21 16:17:56 +08:00
parent ae027b83d8
commit 1d86dbdc0f
4 changed files with 33 additions and 41 deletions

View File

@ -224,7 +224,7 @@ static inline void HandleLTRMarkFeedback (sWelsEncCtx* pCtx) {
}
pLtr->iLTRMarkSuccessNum++;
pLtr->iCurLtrIdx = (++pLtr->iCurLtrIdx % LONG_TERM_REF_NUM);
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;
@ -350,11 +350,10 @@ BOOL_T WelsUpdateRefList (sWelsEncCtx* pCtx) {
if (NULL == pRefList || NULL == pRefList->pRef[0] || NULL == pRefList->pRef[kiSwapIdx])
return FALSE;
if ((NULL != pCtx->pDecPic)
if (NULL != pCtx->pDecPic) {
#if !defined(ENABLE_FRAME_DUMP) // to save complexity, 1/6/2009
&& (pParamD->iHighestTemporalId == 0 || kuiTid < pParamD->iHighestTemporalId)
if ((pParamD->iHighestTemporalId == 0) || (kuiTid < pParamD->iHighestTemporalId))
#endif// !ENABLE_FRAME_DUMP
)
// Expanding picture for future reference
ExpandReferencingPicture (pCtx->pDecPic, pCtx->pFuncList->pfExpandLumaPicture, pCtx->pFuncList->pfExpandChromaPicture);
@ -371,6 +370,7 @@ BOOL_T WelsUpdateRefList (sWelsEncCtx* pCtx) {
}
pRefList->pShortRefList[0] = pCtx->pDecPic;
pRefList->uiShortRefCount++;
}
if (keSliceType == P_SLICE) {
if (pCtx->uiTemporalId == 0) {
@ -398,7 +398,7 @@ BOOL_T WelsUpdateRefList (sWelsEncCtx* pCtx) {
if (pCtx->pSvcParam->bEnableLongTermReference) {
LTRMarkProcess (pCtx);
pLtr->iCurLtrIdx = (++pLtr->iCurLtrIdx % LONG_TERM_REF_NUM);
pLtr->iCurLtrIdx = (pLtr->iCurLtrIdx+1)%LONG_TERM_REF_NUM;
pLtr->iLTRMarkSuccessNum = 1; //IDR default suceess
pLtr->bLTRMarkEnable = TRUE;
pLtr->uiLtrMarkInterval = 0;

View File

@ -649,7 +649,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) {
(*ppCtx)->pSliceBs = NULL;
}
#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG)
if (pSmt->pSliceConsumeTime != NULL) {
iIdx = 0;
while (iIdx < pCodingParam->iNumDependencyLayer) {
if (pSmt->pSliceConsumeTime[iIdx]) {
@ -664,7 +663,6 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) {
#endif//TRY_SLICING_BALANCE
++ iIdx;
}
}
#endif//#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG)
#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)

View File

@ -179,7 +179,6 @@ void WelsLogDefault (void* pCtx, const int32_t kiLevel, const str_t* kpFmtStr, v
t_now = (struct tm*)LOCALTIME (&l_time);
gettimeofday (&tv, NULL);
#endif//WIN32
if (iBufLeft > 0) {
#ifdef _MSC_VER
#if _MSC_VER >= 1500
iCurUsed = SNPRINTF (&pBuf[iBufUsed], iBufLeft, iBufLeft, "[0x%p @ ", pEncCtx); // confirmed_safe_unsafe_usage
@ -191,9 +190,6 @@ void WelsLogDefault (void* pCtx, const int32_t kiLevel, const str_t* kpFmtStr, v
iBufUsed += iCurUsed;
iBufLeft -= iCurUsed;
}
} else {
return;
}
if (iBufLeft > 0) {
iCurUsed = GetCodeName (&pBuf[iBufUsed], iBufLeft);

View File

@ -451,8 +451,6 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (void* pCtx, const SSourcePicture
// spatial layer is able to encode indeed
if ((iTemporalId != INVALID_TEMPORAL_ID)) {
// down sampling performed
if (NULL == pSrcPic)
return -1;
pDstPic = pEncCtx->pSpatialPic[iDependencyId][iPicturePos]; // small
iShrinkWidth = pScaledPicture->iScaledWidth[iDependencyId];