GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
math

Mathematics and Trigonometric functions. More...

+ Collaboration diagram for math:

Modules

 math2d
 2D Mathematics functions
 
 math3d
 3D Mathematics functions
 

Macros

#define FIX_ONE
 
#define INT2FIX(v)
 
#define FLT2FIX(v)
 
#define FIX2INT(v)
 
#define FIX2FLT(v)
 
#define FIX_EPSILON
 
#define FIX_MAX
 
#define FIX_MIN
 
#define GF_PI2
 
#define GF_PI
 
#define GF_2PI
 
#define gf_invfix(_a)
 
#define gf_mulfix(_a, _b)
 
#define gf_muldiv(_a, _b, _c)
 
#define gf_divfix(_a, _b)
 
#define gf_sqrt(_a)
 
#define gf_ceil(_a)
 
#define gf_floor(_a)
 
#define gf_cos(_a)
 
#define gf_sin(_a)
 
#define gf_tan(_a)
 
#define gf_atan2(_y, _x)
 
#define gf_acos(_a)
 
#define gf_asin(_a)
 

Typedefs

typedef Float Fixed
 

Functions

Fixed gf_angle_diff (Fixed a, Fixed b)
 
u32 gf_get_bit_size (u32 MaxVal)
 Field bit-size. More...
 
u32 gf_get_next_pow2 (u32 val)
 Get power of 2. More...
 

Detailed Description

This section documents the math and trigo functions used in the GPAC framework. GPAC can be compiled with fixed-point support, representing float values on a 16.16 signed integer, which implies a developer must take care of float computations when using GPAC.
A developper should not need to know in which mode the framework has been compiled as long as he uses the math functions of GPAC which work in both float and fixed-point mode.
Using fixed-point version is decided at compilation time and cannot be changed. The feature is signaled through the following macros:

Macro Definition Documentation

#define FIX_ONE

Fixed unit value

#define INT2FIX (   v)

Conversion from integer to fixed

#define FLT2FIX (   v)

Conversion from float to fixed

#define FIX2INT (   v)

Conversion from fixed to integer

#define FIX2FLT (   v)

Conversion from fixed to float

#define FIX_EPSILON

Epsilon Fixed (positive value closest to 0)

#define FIX_MAX

Maximum Fixed (maximum representable fixed value)

#define FIX_MIN

Minimum Fixed (minimum representable fixed value)

#define GF_PI2

PI/2 expressed as Fixed

#define GF_PI

PI expressed as Fixed

#define GF_2PI

2*PI expressed as Fixed

#define gf_invfix (   _a)

1/_a, expressed as fixed number

#define gf_mulfix (   _a,
  _b 
)

_a*_b, expressed as fixed number

#define gf_muldiv (   _a,
  _b,
  _c 
)

_a*_b/_c, expressed as fixed number

#define gf_divfix (   _a,
  _b 
)

_a/_b, expressed as fixed number

#define gf_sqrt (   _a)

sqrt(_a), expressed as fixed number

#define gf_ceil (   _a)

ceil(_a), expressed as fixed number

#define gf_floor (   _a)

floor(_a), expressed as fixed number

#define gf_cos (   _a)

cos(_a), expressed as fixed number

#define gf_sin (   _a)

sin(_a), expressed as fixed number

#define gf_tan (   _a)

tan(_a), expressed as fixed number

#define gf_atan2 (   _y,
  _x 
)

atan2(_y,_x), expressed as fixed number

#define gf_acos (   _a)

acos(_a), expressed as fixed number

#define gf_asin (   _a)

asin(_a), expressed as fixed number

Typedef Documentation

typedef Float Fixed

Fixed is 32bit float number

Note
This documentation has been generated for a float version of the GPAC framework.

Function Documentation

Fixed gf_angle_diff ( Fixed  a,
Fixed  b 
)

+ Here is the caller graph for this function:

u32 gf_get_bit_size ( u32  MaxVal)

Gets the number of bits needed to represent the value.

Parameters
MaxValMaximum value to be represented.
Returns
number of bits required to represent the value.
u32 gf_get_next_pow2 ( u32  val)

Gets the closest power of 2 greater or equal to the value.

Parameters
valvalue to be used.
Returns
requested power of 2.

+ Here is the caller graph for this function: