diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-08-30 16:01:36 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-08-30 16:01:36 +0200 |
commit | 315c69034767ae8d3afdbab09a99394aabc553ca (patch) | |
tree | 683d45109cd08065f80c88ef0daa90b9078ce78f /ext/cog | |
parent | 940d253b7824644d1088386049f22444c389fbc2 (diff) | |
download | gstreamer-plugins-bad-315c69034767ae8d3afdbab09a99394aabc553ca.tar.gz |
0.10.19.5 pre-release
Diffstat (limited to 'ext/cog')
-rw-r--r-- | ext/cog/gstcogorc-dist.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/cog/gstcogorc-dist.c b/ext/cog/gstcogorc-dist.c index 755636d59..f8645c9d0 100644 --- a/ext/cog/gstcogorc-dist.c +++ b/ext/cog/gstcogorc-dist.c @@ -154,11 +154,20 @@ void cogorc_unpack_axyz_3 (orc_uint8 * d1, const orc_uint32 * s1, int n); #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) +#define ORC_SWAP_Q(x) ((((x)&0xffULL)<<56) | (((x)&0xff00ULL)<<40) | (((x)&0xff0000ULL)<<24) | (((x)&0xff000000ULL)<<8) | (((x)&0xff00000000ULL)>>8) | (((x)&0xff0000000000ULL)>>24) | (((x)&0xff000000000000ULL)>>40) | (((x)&0xff00000000000000ULL)>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) -#define ORC_MIN_NORMAL (1.1754944909521339405e-38) -#define ORC_DENORMAL(x) (((x) > -ORC_MIN_NORMAL && (x) < ORC_MIN_NORMAL) ? ((x)<0 ? (-0.0f) : (0.0f)) : (x)) -#define ORC_MINF(a,b) (isnan(a) ? a : isnan(b) ? b : ((a)<(b)) ? (a) : (b)) -#define ORC_MAXF(a,b) (isnan(a) ? a : isnan(b) ? b : ((a)>(b)) ? (a) : (b)) +#define ORC_RECAST_INT(x) (((orc_union32)(x)).i) +#define ORC_RECAST_FLOAT(x) (((orc_union32)(orc_int32)(x)).f) +#define ORC_DENORMAL(x) ORC_RECAST_FLOAT(ORC_RECAST_INT(x) & (((ORC_RECAST_INT(x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) +#define ORC_ISNAN(x) (((ORC_RECAST_INT(x)&0x7f800000) == 0x7f800000) && ((ORC_RECAST_INT(x)&0x007fffff) != 0)) +#define ORC_MINF(a,b) (ORC_ISNAN(a) ? a : ORC_ISNAN(b) ? b : ((a)<(b)) ? (a) : (b)) +#define ORC_MAXF(a,b) (ORC_ISNAN(a) ? a : ORC_ISNAN(b) ? b : ((a)>(b)) ? (a) : (b)) +#define ORC_RECAST_INT64(x) (((orc_union64)(x)).i) +#define ORC_RECAST_DOUBLE(x) (((orc_union64)(orc_int64)(x)).f) +#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0) ? 0xfff0000000000000ULL : 0xffffffffffffffffULL)) +#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0x7ff0000000000000ULL) && ((ORC_RECAST_INT64(x)&0x000fffffffffffffULL) != 0)) +#define ORC_MIND(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)<(b)) ? (a) : (b)) +#define ORC_MAXD(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)>(b)) ? (a) : (b)) #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 |