Commit cf60d669 authored by Måns Rullgård's avatar Måns Rullgård

Add more int packing macros, name them consistently

Originally committed as revision 23916 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bce3bd1c
...@@ -109,7 +109,7 @@ static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright, int st ...@@ -109,7 +109,7 @@ static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright, int st
const int lt= src[-1-1*stride]; const int lt= src[-1-1*stride];
LOAD_TOP_EDGE LOAD_TOP_EDGE
LOAD_TOP_RIGHT_EDGE LOAD_TOP_RIGHT_EDGE
uint32_t v = PACK4UINT8((lt + 2*t0 + t1 + 2) >> 2, uint32_t v = PACK_4U8((lt + 2*t0 + t1 + 2) >> 2,
(t0 + 2*t1 + t2 + 2) >> 2, (t0 + 2*t1 + t2 + 2) >> 2,
(t1 + 2*t2 + t3 + 2) >> 2, (t1 + 2*t2 + t3 + 2) >> 2,
(t2 + 2*t3 + t4 + 2) >> 2); (t2 + 2*t3 + t4 + 2) >> 2);
......
...@@ -146,12 +146,36 @@ if ((y) < (x)) {\ ...@@ -146,12 +146,36 @@ if ((y) < (x)) {\
# define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) # define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
#endif #endif
#ifndef PACK4x8 #if HAVE_BIGENDIAN
# if HAVE_BIGENDIAN # ifndef PACK_2U8
# define PACK4UINT8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) # define PACK_2U8(a,b) (((a) << 8) | (b))
# else
# define PACK4UINT8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
# endif # endif
# ifndef PACK_4U8
# define PACK_4U8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
# endif
# ifndef PACK_2U16
# define PACK_2U16(a,b) (((a) << 16) | (b))
# endif
#else
# ifndef PACK_2U8
# define PACK_2U8(a,b) (((b) << 8) | (a))
# endif
# ifndef PACK_4U2
# define PACK_4U8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
# endif
# ifndef PACK_2U16
# define PACK_2U16(a,b) (((b) << 16) | (a))
# endif
#endif
#ifndef PACK_2S8
# define PACK_2S8(a,b) PACK_2U8((a)&255, (b)&255)
#endif
#ifndef PACK_4S8
# define PACK_4S8(a,b,c,d) PACK_4U8((a)&255, (b)&255, (c)&255, (d)&255)
#endif
#ifndef PACK_2S16
# define PACK_2S16(a,b) PACK_2U16((a)&0xffff, (b)&0xffff)
#endif #endif
#endif /* AVCODEC_MATHOPS_H */ #endif /* AVCODEC_MATHOPS_H */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment