gstfloatcast

gstfloatcast — Floating point platform independence macros

Synopsis


#include <gst/floatcast/floatcast.h>


#define             GDOUBLE_FROM_BE                     (val)
#define             GDOUBLE_FROM_LE                     (val)
#define             GDOUBLE_TO_BE                       (val)
#define             GDOUBLE_TO_LE                       (val)
#define             GFLOAT_FROM_BE                      (val)
#define             GFLOAT_FROM_LE                      (val)
#define             GFLOAT_TO_BE                        (val)
#define             GFLOAT_TO_LE                        (val)
#define             gst_cast_double                     (x)
#define             gst_cast_float                      (x)

Description

The floatcast.h header file contains a couple of convenience macros for floating point numbers.

If you include this header, your application or library must link against libm (for maths.h support).

For optimal results, your application's or library's build system should check whether the C99 functions lrint and lrintf are supported and define the preprocessor symbols HAVE_LRINT and HAVE_LRINTF if so. If you are using autoconf, you can do this by using the AC_C99_FUNC_LRINT and AC_C99_FUNC_LRINTF checks in your configure.ac or configure.in file and including your application's config.h header before you include floatcast.h.

Details

GDOUBLE_FROM_BE()

#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))

Convert 64-bit floating point value (double) from big endian byte order into native byte order.

val : value

GDOUBLE_FROM_LE()

#define GDOUBLE_FROM_LE(val) (GDOUBLE_TO_LE (val))

Convert 64-bit floating point value (double) from little endian byte order into native byte order.

val : value

GDOUBLE_TO_BE()

#define             GDOUBLE_TO_BE(val)

Convert 64-bit floating point value (double) from native byte order into big endian byte order.

val : value

GDOUBLE_TO_LE()

#define             GDOUBLE_TO_LE(val)

Convert 64-bit floating point value (double) from native byte order into little endian byte order.

val : value

GFLOAT_FROM_BE()

#define GFLOAT_FROM_BE(val)  (GFLOAT_TO_BE (val))

Convert 32-bit floating point value (float) from big endian byte order into native byte order.

val : value

GFLOAT_FROM_LE()

#define GFLOAT_FROM_LE(val)  (GFLOAT_TO_LE (val))

Convert 32-bit floating point value (float) from little endian byte order into native byte order.

val : value

GFLOAT_TO_BE()

#define             GFLOAT_TO_BE(val)

Convert 32-bit floating point value (float) from native byte order into big endian byte order.

val : value

GFLOAT_TO_LE()

#define             GFLOAT_TO_LE(val)

Convert 32-bit floating point value (float) from native byte order into little endian byte order.

val : value

gst_cast_double()

#define             gst_cast_double(x)

Casts a 64-bit floating point value (double) to an integer without bias.

x : input value

gst_cast_float()

#define             gst_cast_float(x)

Casts a 32-bit floating point value (float) to an integer without bias.

x : input value