mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
Move float endianness conversion macros to core. Second part of bug ##555196.
Original commit message from CVS: * docs/libs/gst-plugins-base-libs-sections.txt: * gst-libs/gst/floatcast/floatcast.h: Move float endianness conversion macros to core. Second part of bug ##555196.
This commit is contained in:
parent
2aaf298543
commit
4d7ebf29d9
3 changed files with 7 additions and 130 deletions
|
@ -1,3 +1,10 @@
|
|||
2008-10-23 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||
|
||||
* docs/libs/gst-plugins-base-libs-sections.txt:
|
||||
* gst-libs/gst/floatcast/floatcast.h:
|
||||
Move float endianness conversion macros to core. Second part of
|
||||
bug ##555196.
|
||||
|
||||
2008-10-22 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* sys/ximage/ximagesink.h:
|
||||
|
|
|
@ -298,14 +298,6 @@ gst_fft_f64_free
|
|||
<SECTION>
|
||||
<FILE>gstfloatcast</FILE>
|
||||
<INCLUDE>gst/floatcast/floatcast.h</INCLUDE>
|
||||
GDOUBLE_FROM_BE
|
||||
GDOUBLE_FROM_LE
|
||||
GDOUBLE_TO_BE
|
||||
GDOUBLE_TO_LE
|
||||
GFLOAT_FROM_BE
|
||||
GFLOAT_FROM_LE
|
||||
GFLOAT_TO_BE
|
||||
GFLOAT_TO_LE
|
||||
gst_cast_double
|
||||
gst_cast_float
|
||||
</SECTION>
|
||||
|
|
|
@ -97,128 +97,6 @@ G_BEGIN_DECLS
|
|||
|
||||
#endif
|
||||
|
||||
/* FIXME 0.11: don't use GLib namespace (GDOUBLE_SWAP_LE_BE, GFLOAT_TO_LE,
|
||||
* GFLOAT_TO_BE, GDOUBLE_TO_LE, GDOUBLE_TO_BE) */
|
||||
|
||||
/**
|
||||
* GFLOAT_SWAP_LE_BE:
|
||||
* @in: input value
|
||||
*
|
||||
* Swap byte order of a 32-bit floating point value (float).
|
||||
*/
|
||||
inline static gfloat
|
||||
GFLOAT_SWAP_LE_BE(gfloat in)
|
||||
{
|
||||
union
|
||||
{
|
||||
guint32 i;
|
||||
gfloat f;
|
||||
} u;
|
||||
|
||||
u.f = in;
|
||||
u.i = GUINT32_SWAP_LE_BE (u.i);
|
||||
return u.f;
|
||||
}
|
||||
|
||||
/**
|
||||
* GDOUBLE_SWAP_LE_BE:
|
||||
* @in: input value
|
||||
*
|
||||
* Swap byte order of a 64-bit floating point value (double).
|
||||
*/
|
||||
inline static gdouble
|
||||
GDOUBLE_SWAP_LE_BE(gdouble in)
|
||||
{
|
||||
union
|
||||
{
|
||||
guint64 i;
|
||||
gdouble d;
|
||||
} u;
|
||||
|
||||
u.d = in;
|
||||
u.i = GUINT64_SWAP_LE_BE (u.i);
|
||||
return u.d;
|
||||
}
|
||||
|
||||
/**
|
||||
* GDOUBLE_TO_LE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 64-bit floating point value (double) from native byte order into
|
||||
* little endian byte order.
|
||||
*/
|
||||
/**
|
||||
* GDOUBLE_TO_BE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 64-bit floating point value (double) from native byte order into
|
||||
* big endian byte order.
|
||||
*/
|
||||
/**
|
||||
* GDOUBLE_FROM_LE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 64-bit floating point value (double) from little endian byte order
|
||||
* into native byte order.
|
||||
*/
|
||||
/**
|
||||
* GDOUBLE_FROM_BE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 64-bit floating point value (double) from big endian byte order
|
||||
* into native byte order.
|
||||
*/
|
||||
|
||||
/**
|
||||
* GFLOAT_TO_LE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 32-bit floating point value (float) from native byte order into
|
||||
* little endian byte order.
|
||||
*/
|
||||
/**
|
||||
* GFLOAT_TO_BE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 32-bit floating point value (float) from native byte order into
|
||||
* big endian byte order.
|
||||
*/
|
||||
/**
|
||||
* GFLOAT_FROM_LE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 32-bit floating point value (float) from little endian byte order
|
||||
* into native byte order.
|
||||
*/
|
||||
/**
|
||||
* GFLOAT_FROM_BE:
|
||||
* @val: value
|
||||
*
|
||||
* Convert 32-bit floating point value (float) from big endian byte order
|
||||
* into native byte order.
|
||||
*/
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
#define GFLOAT_TO_LE(val) ((gfloat) (val))
|
||||
#define GFLOAT_TO_BE(val) (GFLOAT_SWAP_LE_BE (val))
|
||||
#define GDOUBLE_TO_LE(val) ((gdouble) (val))
|
||||
#define GDOUBLE_TO_BE(val) (GDOUBLE_SWAP_LE_BE (val))
|
||||
|
||||
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
#define GFLOAT_TO_LE(val) (GFLOAT_SWAP_LE_BE (val))
|
||||
#define GFLOAT_TO_BE(val) ((gfloat) (val))
|
||||
#define GDOUBLE_TO_LE(val) (GDOUBLE_SWAP_LE_BE (val))
|
||||
#define GDOUBLE_TO_BE(val) ((gdouble) (val))
|
||||
|
||||
#else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
|
||||
#error unknown ENDIAN type
|
||||
#endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
|
||||
|
||||
#define GFLOAT_FROM_LE(val) (GFLOAT_TO_LE (val))
|
||||
#define GFLOAT_FROM_BE(val) (GFLOAT_TO_BE (val))
|
||||
#define GDOUBLE_FROM_LE(val) (GDOUBLE_TO_LE (val))
|
||||
#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __FLOATCAST_H__ */
|
||||
|
|
Loading…
Reference in a new issue