avcodec/texturedspenc: Add () to protect macro / argument evaluation order
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
88325c2e0b
commit
9f997acdd0
@ -140,14 +140,14 @@ const static uint8_t match6[256][2] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Multiplication over 8 bit emulation */
|
/* Multiplication over 8 bit emulation */
|
||||||
#define mul8(a, b) (a * b + 128 + ((a * b + 128) >> 8)) >> 8
|
#define mul8(a, b) (((a) * (b) + 128 + (((a) * (b) + 128) >> 8)) >> 8)
|
||||||
|
|
||||||
/* Conversion from rgb24 to rgb565 */
|
/* Conversion from rgb24 to rgb565 */
|
||||||
#define rgb2rgb565(r, g, b) \
|
#define rgb2rgb565(r, g, b) \
|
||||||
(mul8(r, 31) << 11) | (mul8(g, 63) << 5) | (mul8(b, 31) << 0)
|
((mul8(r, 31) << 11) | (mul8(g, 63) << 5) | (mul8(b, 31) << 0))
|
||||||
|
|
||||||
/* Linear interpolation at 1/3 point between a and b */
|
/* Linear interpolation at 1/3 point between a and b */
|
||||||
#define lerp13(a, b) (2 * a + b) / 3
|
#define lerp13(a, b) ((2 * (a) + (b)) / 3)
|
||||||
|
|
||||||
/* Linear interpolation on an RGB pixel */
|
/* Linear interpolation on an RGB pixel */
|
||||||
static inline void lerp13rgb(uint8_t *out, uint8_t *p1, uint8_t *p2)
|
static inline void lerp13rgb(uint8_t *out, uint8_t *p1, uint8_t *p2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user