diff --git a/codec/encoder/core/inc/encoder_context.h b/codec/encoder/core/inc/encoder_context.h index 9acc5622..6de71f2b 100644 --- a/codec/encoder/core/inc/encoder_context.h +++ b/codec/encoder/core/inc/encoder_context.h @@ -64,7 +64,7 @@ namespace WelsSVCEnc { */ typedef struct TagRefList { SPicture* pShortRefList[1 + MAX_SHORT_REF_COUNT]; // reference list 0 - int16_t - SPicture* pLongRefList[1 + MAX_LONG_REF_COUNT]; // reference list 1 - int32_t + SPicture* pLongRefList[1 + MAX_REF_PIC_COUNT]; // reference list 1 - int32_t SPicture* pNextBuffer; SPicture* pRef[1 + MAX_REF_PIC_COUNT]; // plus 1 for swap intend uint8_t uiShortRefCount; diff --git a/codec/processing/src/common/util.h b/codec/processing/src/common/util.h index 27efbbc1..e7d0dde0 100644 --- a/codec/processing/src/common/util.h +++ b/codec/processing/src/common/util.h @@ -67,12 +67,23 @@ WELSVP_NAMESPACE_BEGIN #define WELS_MAX(x, y) ((x) > (y) ? (x) : (y)) #define WELS_MIN(x, y) ((x) < (y) ? (x) : (y)) + +#ifndef WELS_SIGN #define WELS_SIGN(a) ((int32_t)(a) >> 31) +#endif + +#ifndef WELS_ABS #define WELS_ABS(a) ((WELS_SIGN(a) ^ (int32_t)(a)) - WELS_SIGN(a)) +#endif + #define WELS_CLAMP(x, minv, maxv) WELS_MIN(WELS_MAX(x, minv), maxv) #define ALIGNBYTES (16) /* Worst case is requiring alignment to an 16 byte boundary */ + +#ifndef WELS_ALIGN #define WELS_ALIGN(iInput) ((iInput+(ALIGNMENT-1)) & ~(ALIGNMENT-1)) +#endif + #define WELS_ALIGN2(iInput) ((iInput+1) & ~1) #define WELS_ALIGN4(iInput) ((iInput+3) & ~3) #define WELS_ALIGN8(iInput) ((iInput+7) & ~7)