jxr: Fix some clang compiler warnings.

This commit is contained in:
Alexandre Julliard 2023-11-23 18:41:58 +01:00
parent 13d2bb57fe
commit f76c3c6ce8
7 changed files with 20 additions and 24 deletions

View file

@ -70,13 +70,14 @@ Int dequantizeMacroblock(CWMImageStrCodec * pSC)
pSC->p1MBbuffer[i][0] = DEQUANT(pMBInfo->iBlockDC[i][0], pTile->pQuantizerDC[i]->iQP);
// dequantize LP
if(pSC->WMISCP.sbSubband != SB_DC_ONLY)
if(pSC->WMISCP.sbSubband != SB_DC_ONLY) {
if(i == 0 || (cf != YUV_422 && cf != YUV_420))
dequantizeBlock4x4(pSC->p1MBbuffer[i] , pMBInfo->iBlockDC[i], dctIndex[2], pTile->pQuantizerLP[i][pMBInfo->iQIndexLP].iQP);
else if(cf == YUV_422)
dequantizeBlock4x2(pSC->p1MBbuffer[i], pMBInfo->iBlockDC[i], pTile->pQuantizerLP[i][pMBInfo->iQIndexLP].iQP);
else // 420
dequantizeBlock2x2(pSC->p1MBbuffer[i], pMBInfo->iBlockDC[i], pTile->pQuantizerLP[i][pMBInfo->iQIndexLP].iQP);
}
}
return ICERR_OK;
@ -536,4 +537,3 @@ Void predCBPDec(CWMImageStrCodec *pSC, CCodingContext *pContext)
}
//}
}

View file

@ -1314,7 +1314,7 @@ static Void InitializeStrEnc(CWMImageStrCodec *pSC,
// set nExpBias
if (pSC->WMISCP.nExpBias == 0)
pSC->WMISCP.nExpBias = 4 + 128;//default
pSC->WMISCP.nExpBias = (I8)(4 + 128);//default
pSC->WMISCP.nExpBias += 128; // rollover arithmetic
pSC->cRow = 0;
@ -2366,5 +2366,3 @@ Int inputMBRow(CWMImageStrCodec* pSC)
return ICERR_OK;
}

View file

@ -459,7 +459,7 @@ Void AdaptDiscriminant (CAdaptiveHuffman *pAdHuff)
assert (t < gMaxTables[iSym]);
//pAdHuff->m_iDiscriminant >>= 1;
pAdHuff->m_iLowerBound = (t == 0) ? (-1 << 31) : -THRESHOLD;
pAdHuff->m_iLowerBound = (t == 0) ? (1u << 31) : -THRESHOLD;
pAdHuff->m_iUpperBound = (t == gMaxTables[iSym] - 1) ? (1 << 30) : THRESHOLD;
switch (iSym) {
@ -508,4 +508,3 @@ Void AdaptDiscriminant (CAdaptiveHuffman *pAdHuff)
pAdHuff->m_pTable = pCodes;
pAdHuff->m_pDelta = pDelta;
}

View file

@ -818,20 +818,20 @@ Void freeTileInfo(CWMImageStrCodec * pSC)
else
freeQuantizer(pSC->pTile[0].pQuantizerDC);
if(pSC->WMISCP.sbSubband != SB_DC_ONLY)
if(pSC->WMISCP.sbSubband != SB_DC_ONLY) {
if((pSC->m_param.uQPMode & 2) != 0) // not LP uniform
for(iTile = 0; iTile <= pSC->WMISCP.cNumOfSliceMinus1V; iTile ++)
freeQuantizer(pSC->pTile[iTile].pQuantizerLP);
else
freeQuantizer(pSC->pTile[0].pQuantizerLP);
if(pSC->WMISCP.sbSubband != SB_DC_ONLY && pSC->WMISCP.sbSubband != SB_NO_HIGHPASS)
}
if(pSC->WMISCP.sbSubband != SB_DC_ONLY && pSC->WMISCP.sbSubband != SB_NO_HIGHPASS) {
if((pSC->m_param.uQPMode & 4) != 0) // not HP uniform
for(iTile = 0; iTile <= pSC->WMISCP.cNumOfSliceMinus1V; iTile ++)
freeQuantizer(pSC->pTile[iTile].pQuantizerHP);
else
freeQuantizer(pSC->pTile[0].pQuantizerHP);
}
if(pSC->pTile != NULL)
free(pSC->pTile);
}
@ -864,11 +864,12 @@ Void formatQuantizer(CWMIQuantizer * pQuantizer[MAX_CHANNELS], U8 cChMode, size_
size_t iCh;
for(iCh = 0; iCh < cCh; iCh ++){
if(iCh > 0)
if(iCh > 0) {
if(cChMode == 0) // uniform
pQuantizer[iCh][iPos] = pQuantizer[0][iPos];
else if(cChMode == 1) // mixed
pQuantizer[iCh][iPos] = pQuantizer[1][iPos];
}
remapQP(pQuantizer[iCh] + iPos, (iCh > 0 && bShiftedUV == TRUE) ? SHIFTZERO - 1 : SHIFTZERO, bScaledArith);
}
}

View file

@ -257,20 +257,22 @@ typedef long ERR;
#define Report(err, szExp, szFile, lLine) err = err
#endif
#define Call(exp) \
#define Call(exp) do { \
if (Failed(err = (exp))) \
{ \
Report(err, #exp, __FILE__, (long)__LINE__); \
goto Cleanup; \
} \
else err = err
else err = err; \
} while(0)
#define CallIgnoreError(errTmp, exp) \
#define CallIgnoreError(errTmp, exp) do { \
if (Failed(errTmp = (exp))) \
{ \
Report(errTmp, #exp, __FILE__, (long)__LINE__); \
} \
else errTmp = errTmp
else errTmp = errTmp; \
} while(0)
#define Test(exp, err) Call((exp) ? WMP_errSuccess : (err))
@ -512,4 +514,3 @@ EXTERN_C Int WMPhotoDetile(
);
#endif // WMI_WINDOWSMEDIAPHOTO_H

View file

@ -36,10 +36,10 @@
#define PACKETLENGTH (1U<<12) // 4kB
#define readIS_L1(pSC, pIO) readIS(pSC, pIO)
#define readIS_L2(pSC, pIO) (void)(pSC, pIO)
#define readIS_L2(pSC, pIO) ((void)(pSC), (void)(pIO))
#define writeIS_L1(pSC, pIO) writeIS(pSC, pIO)
#define writeIS_L2(pSC, pIO) (void)(pSC, pIO)
#define writeIS_L2(pSC, pIO) ((void)(pSC), (void)(pIO))
//================================
@ -54,5 +54,3 @@
// quantization optimization
//================================
#define RECIP_QUANT_OPT

View file

@ -56,9 +56,9 @@ static U32 Convert_Half_To_Float(U16 u16)
{
return s << 31;
}
else if (~(~0 << 5) == e) // inf, snan, qnan
else if (~(~0u << 5) == e) // inf, snan, qnan
{
return (s << 31) | ~(~0 << 8) << 23| (m << 13);
return (s << 31) | ~(~0u << 8) << 23| (m << 13);
}
return (s << 31) | ((e - 15 + 127) << 23) | (m << 13); // norm
@ -2335,4 +2335,3 @@ ERR PKFormatConverter_Release(PKFormatConverter** ppFC)
Cleanup:
return err;
}