mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
Use glib macros for byte order conversion.
Original commit message from CVS: Use glib macros for byte order conversion.
This commit is contained in:
parent
da7eb8492f
commit
608eaa3d42
2 changed files with 2 additions and 32 deletions
|
@ -17,22 +17,7 @@
|
||||||
#include <sse.h>
|
#include <sse.h>
|
||||||
#endif /* HAVE_LIBSSE */
|
#endif /* HAVE_LIBSSE */
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#define swab32(x) GUINT32_FROM_BE(x)
|
||||||
# define swab32(x) (x)
|
|
||||||
#else
|
|
||||||
# if defined (__i386__)
|
|
||||||
# define swab32(x) __i386_swab32(x)
|
|
||||||
static inline const unsigned long __i386_swab32(unsigned long x)
|
|
||||||
{
|
|
||||||
__asm__("bswap %0" : "=r" (x) : "0" (x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
# else
|
|
||||||
# define swab32(x)\
|
|
||||||
((((guint8*)&x)[0] << 24) | (((guint8*)&x)[1] << 16) | \
|
|
||||||
(((guint8*)&x)[2] << 8) | (((guint8*)&x)[3]))
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _gst_getbits_t gst_getbits_t;
|
typedef struct _gst_getbits_t gst_getbits_t;
|
||||||
typedef void (*GstGetbitsCallback) (gst_getbits_t *gb, void *data);
|
typedef void (*GstGetbitsCallback) (gst_getbits_t *gb, void *data);
|
||||||
|
|
|
@ -73,22 +73,7 @@
|
||||||
#define checklength2(src, dst)
|
#define checklength2(src, dst)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#define swab32(x) GUINT32_FROM_BE(x)
|
||||||
# define swab32(x) (x)
|
|
||||||
#else
|
|
||||||
# if defined (__i386__)
|
|
||||||
# define swab32(x) __i386_swab32(x)
|
|
||||||
static inline const guint32 __i386_swab32(guint32 x)
|
|
||||||
{
|
|
||||||
__asm__("bswap %0" : "=r" (x) : "0" (x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
# else
|
|
||||||
# define swab32(x)\
|
|
||||||
((((guint8*)&x)[0] << 24) | (((guint8*)&x)[1] << 16) | \
|
|
||||||
(((guint8*)&x)[2] << 8) | (((guint8*)&x)[3]))
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* External declarations for bitstream i/o operations. */
|
/* External declarations for bitstream i/o operations. */
|
||||||
extern unsigned long gst_getbits_nBitMask[];
|
extern unsigned long gst_getbits_nBitMask[];
|
||||||
|
|
Loading…
Reference in a new issue