Mercurial > libavcodec.hg
comparison mathops.h @ 12030:22da8afd75a5 libavcodec
Add more int packing macros, name them consistently
author | mru |
---|---|
date | Wed, 30 Jun 2010 22:33:38 +0000 |
parents | 2013535ff4e5 |
children |
comparison
equal
deleted
inserted
replaced
12029:934968bd410d | 12030:22da8afd75a5 |
---|---|
144 | 144 |
145 #ifndef NEG_USR32 | 145 #ifndef NEG_USR32 |
146 # define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) | 146 # define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) |
147 #endif | 147 #endif |
148 | 148 |
149 #ifndef PACK4x8 | 149 #if HAVE_BIGENDIAN |
150 # if HAVE_BIGENDIAN | 150 # ifndef PACK_2U8 |
151 # define PACK4UINT8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) | 151 # define PACK_2U8(a,b) (((a) << 8) | (b)) |
152 # else | |
153 # define PACK4UINT8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a)) | |
154 # endif | 152 # endif |
153 # ifndef PACK_4U8 | |
154 # define PACK_4U8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) | |
155 # endif | |
156 # ifndef PACK_2U16 | |
157 # define PACK_2U16(a,b) (((a) << 16) | (b)) | |
158 # endif | |
159 #else | |
160 # ifndef PACK_2U8 | |
161 # define PACK_2U8(a,b) (((b) << 8) | (a)) | |
162 # endif | |
163 # ifndef PACK_4U2 | |
164 # define PACK_4U8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a)) | |
165 # endif | |
166 # ifndef PACK_2U16 | |
167 # define PACK_2U16(a,b) (((b) << 16) | (a)) | |
168 # endif | |
169 #endif | |
170 | |
171 #ifndef PACK_2S8 | |
172 # define PACK_2S8(a,b) PACK_2U8((a)&255, (b)&255) | |
173 #endif | |
174 #ifndef PACK_4S8 | |
175 # define PACK_4S8(a,b,c,d) PACK_4U8((a)&255, (b)&255, (c)&255, (d)&255) | |
176 #endif | |
177 #ifndef PACK_2S16 | |
178 # define PACK_2S16(a,b) PACK_2U16((a)&0xffff, (b)&0xffff) | |
155 #endif | 179 #endif |
156 | 180 |
157 #endif /* AVCODEC_MATHOPS_H */ | 181 #endif /* AVCODEC_MATHOPS_H */ |
158 | 182 |