FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
softfloat.h File Reference
#include <stdint.h>
#include "common.h"
#include "avassert.h"

Go to the source code of this file.

Data Structures

struct  SoftFloat
 

Macros

#define MIN_EXP   -126
 
#define MAX_EXP   126
 
#define ONE_BITS   29
 

Functions

static av_const SoftFloat av_normalize_sf (SoftFloat a)
 
static av_const SoftFloat av_normalize1_sf (SoftFloat a)
 
static av_const SoftFloat av_mul_sf (SoftFloat a, SoftFloat b)
 
static av_const SoftFloat av_div_sf (SoftFloat a, SoftFloat b)
 b has to be normalized and not zero.
 
static av_const int av_cmp_sf (SoftFloat a, SoftFloat b)
 
static av_const SoftFloat av_add_sf (SoftFloat a, SoftFloat b)
 
static av_const SoftFloat av_sub_sf (SoftFloat a, SoftFloat b)
 
static av_const SoftFloat av_int2sf (int v, int frac_bits)
 
static av_const int av_sf2int (SoftFloat v, int frac_bits)
 Rounding is to -inf.
 

Macro Definition Documentation

#define MIN_EXP   -126

Definition at line 29 of file softfloat.h.

Referenced by av_normalize_sf().

#define MAX_EXP   126

Definition at line 30 of file softfloat.h.

#define ONE_BITS   29

Definition at line 31 of file softfloat.h.

Referenced by av_div_sf(), av_int2sf(), av_mul_sf(), av_normalize_sf(), and av_sf2int().

Function Documentation

static av_const SoftFloat av_normalize_sf ( SoftFloat  a)
static

Definition at line 38 of file softfloat.h.

Referenced by av_int2sf(), and main().

static av_const SoftFloat av_normalize1_sf ( SoftFloat  a)
inlinestatic

Definition at line 60 of file softfloat.h.

Referenced by av_add_sf(), av_div_sf(), and av_mul_sf().

static av_const SoftFloat av_mul_sf ( SoftFloat  a,
SoftFloat  b 
)
inlinestatic
Returns
Will not be more denormalized than a+b. So if either input is normalized, then the output will not be worse then the other input. If both are normalized, then the output will be normalized.

Definition at line 82 of file softfloat.h.

Referenced by main().

static av_const SoftFloat av_div_sf ( SoftFloat  a,
SoftFloat  b 
)
static

b has to be normalized and not zero.

Returns
Will not be more denormalized than a.

Definition at line 93 of file softfloat.h.

Referenced by main().

static av_const int av_cmp_sf ( SoftFloat  a,
SoftFloat  b 
)
inlinestatic

Definition at line 99 of file softfloat.h.

static av_const SoftFloat av_add_sf ( SoftFloat  a,
SoftFloat  b 
)
inlinestatic

Definition at line 105 of file softfloat.h.

Referenced by av_sub_sf(), and main().

static av_const SoftFloat av_sub_sf ( SoftFloat  a,
SoftFloat  b 
)
inlinestatic

Definition at line 113 of file softfloat.h.

static av_const SoftFloat av_int2sf ( int  v,
int  frac_bits 
)
inlinestatic

Definition at line 119 of file softfloat.h.

Referenced by main().

static av_const int av_sf2int ( SoftFloat  v,
int  frac_bits 
)
inlinestatic

Rounding is to -inf.

Definition at line 126 of file softfloat.h.

Referenced by main().