diff options
author | David Schleef <ds@schleef.org> | 2003-07-26 03:01:58 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2003-07-26 03:01:58 +0000 |
commit | 2f0cc8ec30e8c26fed7b2c9ac2614c9a7655fb65 (patch) | |
tree | 25c3fbda1c8f8f5a33cad05c78b40887be7d2fba /gst-libs/ext/mplex/fastintfns.h | |
parent | 4df5590ec318054389219b84153cce0ce363613b (diff) | |
download | gst-plugins-bad-2f0cc8ec30e8c26fed7b2c9ac2614c9a7655fb65.tar.gz gst-plugins-bad-2f0cc8ec30e8c26fed7b2c9ac2614c9a7655fb65.tar.bz2 gst-plugins-bad-2f0cc8ec30e8c26fed7b2c9ac2614c9a7655fb65.zip |
Moved from gst-plugins/ext/mplex/. See that directory for older changelogs.
Original commit message from CVS:
Moved from gst-plugins/ext/mplex/. See that directory for older
changelogs.
Diffstat (limited to 'gst-libs/ext/mplex/fastintfns.h')
-rw-r--r-- | gst-libs/ext/mplex/fastintfns.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gst-libs/ext/mplex/fastintfns.h b/gst-libs/ext/mplex/fastintfns.h new file mode 100644 index 00000000..db78af1e --- /dev/null +++ b/gst-libs/ext/mplex/fastintfns.h @@ -0,0 +1,32 @@ +/* fast int primitives. min,max,abs,samesign + * + * WARNING: Assumes 2's complement arithmetic. + * + */ + + +static __inline__ int intmax( register int x, register int y ) +{ + return x < y ? y : x; +} + +static __inline__ int intmin( register int x, register int y ) +{ + return x < y ? x : y; +} + +static __inline__ int intabs( register int x ) +{ + return x < 0 ? -x : x; +} + +#define fabsshift ((8*sizeof(unsigned int))-1) + +#define signmask(x) (((int)x)>>fabsshift) +static __inline__ int intsamesign(int x, int y) +{ + return (y+(signmask(x) & -(y<<1))); +} +#undef signmask +#undef fabsshift + |