schroutils

schroutils

Synopsis




typedef             schro_bool;
#define             SCHRO_GET                           (ptr, offset, type)
#define             OFFSET                              (ptr,offset)
#define             SCHRO_INTERNAL
#define             ARRAY_SIZE                          (x)
#define             MIN                                 (a,b)
#define             MAX                                 (a,b)
#define             CLAMP                               (x,a,b)
#define             DIVIDE_ROUND_UP                     (a,b)
#define             ROUND_UP_SHIFT                      (x,y)
#define             ROUND_UP_POW2                       (x,y)
#define             ROUND_UP_2                          (x)
#define             ROUND_UP_4                          (x)
#define             ROUND_UP_8                          (x)
#define             schro_divide                        (a,b)
double              schro_utils_entropy                 (double a,
                                                         double total);
int                 schro_utils_multiplier_to_quant_index
                                                        (double x);
double              schro_utils_probability_to_entropy  (double x);
void                schro_utils_reduce_fraction         (int *n,
                                                         int *d);
int                 schro_dequantise                    (int q,
                                                         int quant_factor,
                                                         int quant_offset);
int                 schro_quantise                      (int value,
                                                         int quant_factor,
                                                         int quant_offset);
int                 muldiv64                            (int a,
                                                         int b,
                                                         int c);

Description

Details

schro_bool

typedef unsigned int schro_bool;


SCHRO_GET()

#define SCHRO_GET(ptr, offset, type) (*(type *)((uint8_t *)(ptr) + (offset)) )

ptr :
offset :
type :

OFFSET()

#define             OFFSET(ptr,offset)

ptr :
offset :

SCHRO_INTERNAL

#define             SCHRO_INTERNAL


ARRAY_SIZE()

#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))

x :

MIN()

#define MIN(a,b) ((a)<(b) ? (a) : (b))

a :
b :

MAX()

#define MAX(a,b) ((a)>(b) ? (a) : (b))

a :
b :

CLAMP()

#define CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))

x :
a :
b :

DIVIDE_ROUND_UP()

#define DIVIDE_ROUND_UP(a,b) (((a) + (b) - 1)/(b))

a :
b :

ROUND_UP_SHIFT()

#define ROUND_UP_SHIFT(x,y) (((x) + (1<<(y)) - 1)>>(y))

x :
y :

ROUND_UP_POW2()

#define ROUND_UP_POW2(x,y) (((x) + (1<<(y)) - 1)&((~0)<<(y)))

x :
y :

ROUND_UP_2()

#define ROUND_UP_2(x) ROUND_UP_POW2(x,1)

x :

ROUND_UP_4()

#define ROUND_UP_4(x) ROUND_UP_POW2(x,2)

x :

ROUND_UP_8()

#define ROUND_UP_8(x) ROUND_UP_POW2(x,3)

x :

schro_divide()

#define schro_divide(a,b) (((a)<0)?(((a) - (b) + 1)/(b)):((a)/(b)))

a :
b :

schro_utils_entropy ()

double              schro_utils_entropy                 (double a,
                                                         double total);

a :
total :
Returns :

schro_utils_multiplier_to_quant_index ()

int                 schro_utils_multiplier_to_quant_index
                                                        (double x);

x :
Returns :

schro_utils_probability_to_entropy ()

double              schro_utils_probability_to_entropy  (double x);

x :
Returns :

schro_utils_reduce_fraction ()

void                schro_utils_reduce_fraction         (int *n,
                                                         int *d);

n :
d :

schro_dequantise ()

int                 schro_dequantise                    (int q,
                                                         int quant_factor,
                                                         int quant_offset);

q :
quant_factor :
quant_offset :
Returns :

schro_quantise ()

int                 schro_quantise                      (int value,
                                                         int quant_factor,
                                                         int quant_offset);

value :
quant_factor :
quant_offset :
Returns :

muldiv64 ()

int                 muldiv64                            (int a,
                                                         int b,
                                                         int c);

a :
b :
c :
Returns :