Don't use tabs for indentation in multi-line macros

The astyle configuration makes sure normal code is indented consistently
with 2 spaces, but astyle doesn't seem to touch the indentation in
these multi-line macros.
This commit is contained in:
Martin Storsjö 2015-05-04 10:52:40 +03:00
parent cf33d7031e
commit dd913ef878
9 changed files with 85 additions and 85 deletions

View File

@ -55,16 +55,16 @@
* auxiliary var: _nm ## _tEmP
*/
#define ENFORCE_STACK_ALIGN_1D(_tp, _nm, _sz, _al) \
_tp _nm ## _tEmP[(_sz)+(_al)-1]; \
_tp *_nm = _nm ## _tEmP + ((_al)-1) - (((uintptr_t)(_nm ## _tEmP + ((_al)-1)) & ((_al)-1))/sizeof(_tp));
_tp _nm ## _tEmP[(_sz)+(_al)-1]; \
_tp *_nm = _nm ## _tEmP + ((_al)-1) - (((uintptr_t)(_nm ## _tEmP + ((_al)-1)) & ((_al)-1))/sizeof(_tp));
#define ENFORCE_STACK_ALIGN_2D(_tp, _nm, _cx, _cy, _al) \
assert( ((_al) && !((_al) & ((_al) - 1))) && ((_al) >= sizeof(_tp)) ); /*_al should be power-of-2 and >= sizeof(_tp)*/\
_tp _nm ## _tEmP[(_cx)*(_cy)+(_al)/sizeof(_tp)-1]; \
_tp *_nm ## _tEmP_al = _nm ## _tEmP + ((_al)/sizeof(_tp)-1); \
_nm ## _tEmP_al -= (((uintptr_t)_nm ## _tEmP_al & ((_al)-1))/sizeof(_tp)); \
_tp (*_nm)[(_cy)] = (_tp (*)[(_cy)])_nm ## _tEmP_al;
assert( ((_al) && !((_al) & ((_al) - 1))) && ((_al) >= sizeof(_tp)) ); /*_al should be power-of-2 and >= sizeof(_tp)*/\
_tp _nm ## _tEmP[(_cx)*(_cy)+(_al)/sizeof(_tp)-1]; \
_tp *_nm ## _tEmP_al = _nm ## _tEmP + ((_al)/sizeof(_tp)-1); \
_nm ## _tEmP_al -= (((uintptr_t)_nm ## _tEmP_al & ((_al)-1))/sizeof(_tp)); \
_tp (*_nm)[(_cy)] = (_tp (*)[(_cy)])_nm ## _tEmP_al;
#if defined(_MSC_VER)
@ -129,10 +129,10 @@
#define WELS_DIV_ROUND64(x,y) ((int64_t)((y)==0?((x)/((y)+1)):(((y)/2+(x))/(y))))
#endif//WELS_DIV_ROUND64
#define WELS_NON_ZERO_COUNT_AVERAGE(nC,nA,nB) { \
nC = nA + nB + 1; \
nC >>= (uint8_t)( nA != -1 && nB != -1); \
nC += (uint8_t)(nA == -1 && nB == -1); \
#define WELS_NON_ZERO_COUNT_AVERAGE(nC,nA,nB) { \
nC = nA + nB + 1; \
nC >>= (uint8_t)( nA != -1 && nB != -1); \
nC += (uint8_t)(nA == -1 && nB == -1); \
}
static inline int32_t CeilLog2 (int32_t i) {
@ -212,9 +212,9 @@ template<typename T> T WelsClip3(T iX, T iY, T iZ) {
*/
#ifndef WELS_VERIFY_RETURN_IFNEQ
#define WELS_VERIFY_RETURN_IFNEQ(iResult, iExpected) \
if ( iResult != iExpected ){ \
return iResult; \
}
if (iResult != iExpected) { \
return iResult; \
}
#endif//#if WELS_VERIFY_RETURN_IF
/*
@ -224,9 +224,9 @@ template<typename T> T WelsClip3(T iX, T iY, T iZ) {
*/
#ifndef WELS_VERIFY_RETURN_IF
#define WELS_VERIFY_RETURN_IF(iResult, bCaseIf) \
if ( bCaseIf ){ \
return iResult; \
}
if (bCaseIf) { \
return iResult; \
}
#endif//#if WELS_VERIFY_RETURN_IF
/*
@ -238,10 +238,10 @@ template<typename T> T WelsClip3(T iX, T iY, T iZ) {
*/
#ifndef WELS_VERIFY_RETURN_PROC_IF
#define WELS_VERIFY_RETURN_PROC_IF(iResult, bCaseIf, fProc) \
if ( bCaseIf ){ \
fProc; \
return iResult; \
}
if (bCaseIf) { \
fProc; \
return iResult; \
}
#endif//#if WELS_VERIFY_RETURN_PROC_IF
static inline int32_t WELS_LOG2 (uint32_t v) {

View File

@ -58,20 +58,20 @@ namespace WelsDec {
if (iReadBytes > iAllowedBytes+1) { \
return ERR_INFO_READ_OVERFLOW; \
} \
iCurBits |= ((uint32_t)((pBufPtr[0] << 8) | pBufPtr[1])) << (iLeftBits); \
iLeftBits -= 16; \
pBufPtr +=2; \
iCurBits |= ((uint32_t)((pBufPtr[0] << 8) | pBufPtr[1])) << (iLeftBits); \
iLeftBits -= 16; \
pBufPtr +=2; \
}
#define NEED_BITS(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes) { \
if( iLeftBits > 0 ) { \
GET_WORD(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \
} \
if (iLeftBits > 0) { \
GET_WORD(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \
} \
}
#define UBITS(iCurBits, iNumBits) (iCurBits>>(32-(iNumBits)))
#define DUMP_BITS(iCurBits, pBufPtr, iLeftBits, iNumBits, iAllowedBytes, iReadBytes) { \
iCurBits <<= (iNumBits); \
iLeftBits += (iNumBits); \
NEED_BITS(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \
iCurBits <<= (iNumBits); \
iLeftBits += (iNumBits); \
NEED_BITS(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \
}
static inline int32_t BsGetBits (PBitStringAux pBs, int32_t iNumBits, uint32_t* pCode) {

View File

@ -105,12 +105,12 @@ extern const uint8_t g_kuiZeroLeftBitNumMap[16];
#if defined(_MSC_VER) && defined(_M_IX86)
//TODO need linux version
#define WELS_GET_PREFIX_BITS(inval,outval){\
uint32_t local = inval;\
__asm xor eax, eax\
__asm bsr eax, local\
__asm sub eax, 32\
__asm neg eax\
__asm mov outval, eax\
uint32_t local = inval;\
__asm xor eax, eax\
__asm bsr eax, local\
__asm sub eax, 32\
__asm neg eax\
__asm mov outval, eax\
}
#else
#define WELS_GET_PREFIX_BITS(inval, outval) outval = GetPrefixBits(inval)

View File

@ -81,9 +81,9 @@ namespace WelsDec {
#define GET_ALPHA_BETA_FROM_QP(iQp, iAlphaOffset, iBetaOffset, iIndex, iAlpha, iBeta) \
{\
iIndex = (iQp + iAlphaOffset);\
iAlpha = g_kuiAlphaTable(iIndex);\
iBeta = g_kiBetaTable((iQp + iBetaOffset));\
iIndex = (iQp + iAlphaOffset);\
iAlpha = g_kuiAlphaTable(iIndex);\
iBeta = g_kiBetaTable((iQp + iBetaOffset));\
}
static const uint8_t g_kuiAlphaTable[52 + 24] = { //this table refers to Table 8-16 in H.264/AVC standard
@ -151,10 +151,10 @@ static const uint8_t g_kuiTableB8x8Idx[2][16] = {
#define TC0_TBL_LOOKUP(tc, iIndexA, pBS, bChroma) \
{\
tc[0] = g_kiTc0Table(iIndexA)[pBS[0]] + bChroma;\
tc[1] = g_kiTc0Table(iIndexA)[pBS[1]] + bChroma;\
tc[2] = g_kiTc0Table(iIndexA)[pBS[2]] + bChroma;\
tc[3] = g_kiTc0Table(iIndexA)[pBS[3]] + bChroma;\
tc[0] = g_kiTc0Table(iIndexA)[pBS[0]] + bChroma;\
tc[1] = g_kiTc0Table(iIndexA)[pBS[1]] + bChroma;\
tc[2] = g_kiTc0Table(iIndexA)[pBS[2]] + bChroma;\
tc[3] = g_kiTc0Table(iIndexA)[pBS[3]] + bChroma;\
}
void inline DeblockingBSInsideMBAvsbase (int8_t* pNnzTab, uint8_t nBS[2][4][4], int32_t iLShiftFactor) {

View File

@ -497,16 +497,16 @@ int32_t PredIntra4x4Mode (int8_t* pIntraPredMode, int32_t iIdx4) {
#define CHECK_I16_MODE(a, b, c, d) \
((a == g_ksI16PredInfo[a].iPredMode) && \
(b >= g_ksI16PredInfo[a].iLeftAvail) && \
(c >= g_ksI16PredInfo[a].iTopAvail) && \
(d >= g_ksI16PredInfo[a].iLeftTopAvail));
(b >= g_ksI16PredInfo[a].iLeftAvail) && \
(c >= g_ksI16PredInfo[a].iTopAvail) && \
(d >= g_ksI16PredInfo[a].iLeftTopAvail));
#define CHECK_CHROMA_MODE(a, b, c, d) \
((a == g_ksChromaPredInfo[a].iPredMode) && \
(b >= g_ksChromaPredInfo[a].iLeftAvail) && \
(c >= g_ksChromaPredInfo[a].iTopAvail) && \
(d >= g_ksChromaPredInfo[a].iLeftTopAvail));
((a == g_ksChromaPredInfo[a].iPredMode) && \
(b >= g_ksChromaPredInfo[a].iLeftAvail) && \
(c >= g_ksChromaPredInfo[a].iTopAvail) && \
(d >= g_ksChromaPredInfo[a].iLeftTopAvail));
#define CHECK_I4_MODE(a, b, c, d) \
((a == g_ksI4PredInfo[a].iPredMode) && \
((a == g_ksI4PredInfo[a].iPredMode) && \
(b >= g_ksI4PredInfo[a].iLeftAvail) && \
(c >= g_ksI4PredInfo[a].iTopAvail) && \
(d >= g_ksI4PredInfo[a].iLeftTopAvail));

View File

@ -48,25 +48,25 @@ namespace WelsEnc {
#define g_kiTc0Table(x) g_kiTc0Table[(x)]
#define MB_BS_MV(sCurMv, sNeighMv, uiBIdx, uiBnIdx) \
(\
( WELS_ABS( sCurMv[uiBIdx].iMvX - sNeighMv[uiBnIdx].iMvX ) >= 4 ) ||\
( WELS_ABS( sCurMv[uiBIdx].iMvY - sNeighMv[uiBnIdx].iMvY ) >= 4 )\
)
(\
( WELS_ABS( sCurMv[uiBIdx].iMvX - sNeighMv[uiBnIdx].iMvX ) >= 4 ) ||\
( WELS_ABS( sCurMv[uiBIdx].iMvY - sNeighMv[uiBnIdx].iMvY ) >= 4 )\
)
#define SMB_EDGE_MV(uiRefIndex, sMotionVector, uiBIdx, uiBnIdx) \
(\
!!((WELS_ABS(sMotionVector[uiBIdx].iMvX - sMotionVector[uiBnIdx].iMvX) &(~3)) | (WELS_ABS(sMotionVector[uiBIdx].iMvY - sMotionVector[uiBnIdx].iMvY) &(~3)))\
)
(\
!!((WELS_ABS(sMotionVector[uiBIdx].iMvX - sMotionVector[uiBnIdx].iMvX) &(~3)) | (WELS_ABS(sMotionVector[uiBIdx].iMvY - sMotionVector[uiBnIdx].iMvY) &(~3)))\
)
#define BS_EDGE(bsx1, uiRefIndex, sMotionVector, uiBIdx, uiBnIdx) \
( (bsx1|SMB_EDGE_MV(uiRefIndex, sMotionVector, uiBIdx, uiBnIdx))<<(bsx1?1:0))
( (bsx1|SMB_EDGE_MV(uiRefIndex, sMotionVector, uiBIdx, uiBnIdx))<<(bsx1?1:0))
#define GET_ALPHA_BETA_FROM_QP(QP, iAlphaOffset, iBetaOffset, iIdexA, iAlpha, iBeta) \
{\
iIdexA = (QP + iAlphaOffset);\
iIdexA = CLIP3_QP_0_51(iIdexA);\
iAlpha = g_kuiAlphaTable(iIdexA);\
iBeta = g_kiBetaTable((CLIP3_QP_0_51(QP + iBetaOffset)));\
iIdexA = (QP + iAlphaOffset);\
iIdexA = CLIP3_QP_0_51(iIdexA);\
iAlpha = g_kuiAlphaTable(iIdexA);\
iBeta = g_kiBetaTable((CLIP3_QP_0_51(QP + iBetaOffset)));\
}
static const uint8_t g_kuiAlphaTable[52 + 12] = { //this table refers to Table 8-16 in H.264/AVC standard
@ -117,10 +117,10 @@ static const uint8_t g_kuiTableBIdx[2][8] = {
#define TC0_TBL_LOOKUP(iTc, iIdexA, pBS, bchroma) \
{\
iTc[0] = g_kiTc0Table(iIdexA)[pBS[0]] + bchroma;\
iTc[1] = g_kiTc0Table(iIdexA)[pBS[1]] + bchroma;\
iTc[2] = g_kiTc0Table(iIdexA)[pBS[2]] + bchroma;\
iTc[3] = g_kiTc0Table(iIdexA)[pBS[3]] + bchroma;\
iTc[0] = g_kiTc0Table(iIdexA)[pBS[0]] + bchroma;\
iTc[1] = g_kiTc0Table(iIdexA)[pBS[1]] + bchroma;\
iTc[2] = g_kiTc0Table(iIdexA)[pBS[2]] + bchroma;\
iTc[3] = g_kiTc0Table(iIdexA)[pBS[3]] + bchroma;\
}
void inline DeblockingBSInsideMBAvsbase (int8_t* pNnzTab, uint8_t uiBS[2][4][4], int32_t iLShiftFactor) {

View File

@ -522,10 +522,10 @@ typedef struct TagQuarParams {
} SQuarRefineParams;
#define SWITCH_BEST_TMP_BUF(prev_best, curr_best){\
pParams->iBestCost = iCurCost;\
pTmp = prev_best;\
prev_best = curr_best;\
curr_best = pTmp;\
pParams->iBestCost = iCurCost;\
pTmp = prev_best;\
prev_best = curr_best;\
curr_best = pTmp;\
}
#define CALC_COST(me_buf, lm) ( pFunc->sSampleDealingFuncs.pfMeCost[kuiPixel](pEncMb, iStrideEnc, me_buf, ME_REFINE_BUF_STRIDE) + lm )

View File

@ -45,10 +45,10 @@ WELSVP_NAMESPACE_BEGIN
#define CHECK_OFFSET 25
#define MAX_SCROLL_MV_Y 511
#define REGION_NUMBER 9
#define RECORD_COLOR(a, x) \
{ \
int32_t _t = (uint8_t)(a); \
x[_t>>5] |= (1 << (_t&31)); \
#define RECORD_COLOR(a, x) \
{ \
int32_t _t = (uint8_t)(a); \
x[_t>>5] |= (1 << (_t&31)); \
}
int32_t CheckLine (uint8_t* pData, int32_t iWidth);

View File

@ -576,20 +576,20 @@ TEST (VAACalcFuncTest, func) { \
if (0 == (m_uiCpuFeatureFlag & CPUFLAGS)) \
return; \
} \
ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_c, BUFFER_SIZE, 16); \
ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_c, BUFFER_SIZE, 16); \
ENFORCE_STACK_ALIGN_1D (uint8_t, ref_data_c, BUFFER_SIZE, 16); \
ENFORCE_STACK_ALIGN_1D (int32_t, psad8x8_c, BUFFER_SIZE/64, 16); \
int32_t pic_width_c; \
int32_t pic_height_c; \
int32_t pic_stride_c; \
int32_t psadframe_c; \
ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_a, BUFFER_SIZE, 16); \
int32_t pic_width_c; \
int32_t pic_height_c; \
int32_t pic_stride_c; \
int32_t psadframe_c; \
ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_a, BUFFER_SIZE, 16); \
ENFORCE_STACK_ALIGN_1D (uint8_t, ref_data_a, BUFFER_SIZE, 16); \
ENFORCE_STACK_ALIGN_1D (int32_t, psad8x8_a, BUFFER_SIZE/64, 16); \
int32_t pic_width_a; \
int32_t pic_height_a; \
int32_t pic_stride_a; \
int32_t psadframe_a; \
int32_t pic_width_a; \
int32_t pic_height_a; \
int32_t pic_stride_a; \
int32_t psadframe_a; \
pic_width_c = pic_width_a = 320-16; \
pic_height_c = pic_height_a = 320; \
pic_stride_c = pic_stride_a = 320; \