schroutils

schroutils

Functions

#define SCHRO_GET()
#define OFFSET()
#define ARRAY_SIZE()
#define MIN()
#define MAX()
#define CLAMP()
#define DIVIDE_ROUND_UP()
#define ROUND_UP_SHIFT()
#define ROUND_UP_POW2()
#define ROUND_UP_2()
#define ROUND_UP_4()
#define ROUND_UP_8()
#define ROUND_UP_64()
#define ROUND_SHIFT()
#define NEED_CLAMP()
#define schro_divide()
double schro_utils_entropy ()
int schro_utils_multiplier_to_quant_index ()
double schro_utils_probability_to_entropy ()
void schro_utils_reduce_fraction ()
int schro_dequantise ()
int schro_quantise ()
void schro_dequantise_s16 ()
void schro_quantise_s16 ()
void * schro_malloc ()
void * schro_malloc0 ()
void * schro_realloc ()
void schro_free ()
double schro_utils_get_time ()
int muldiv64 ()

Types and Values

typedef schro_bool
#define SCHRO_INTERNAL

Description

Functions

SCHRO_GET()

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


OFFSET()

#define OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset)))


ARRAY_SIZE()

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


MIN()

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


MAX()

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


CLAMP()

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


DIVIDE_ROUND_UP()

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


ROUND_UP_SHIFT()

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


ROUND_UP_POW2()

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


ROUND_UP_2()

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


ROUND_UP_4()

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


ROUND_UP_8()

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


ROUND_UP_64()

#define ROUND_UP_64(x) ROUND_UP_POW2(x,6)


ROUND_SHIFT()

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


NEED_CLAMP()

#define NEED_CLAMP(x,y,a,b) ((x) < (a) || (y) > (b))


schro_divide()

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


schro_utils_entropy ()

double
schro_utils_entropy (double a,
                     double total);

Returns


schro_utils_multiplier_to_quant_index ()

int
schro_utils_multiplier_to_quant_index (double x);

Returns


schro_utils_probability_to_entropy ()

double
schro_utils_probability_to_entropy (double x);

Returns


schro_utils_reduce_fraction ()

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


schro_dequantise ()

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

Returns


schro_quantise ()

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

Returns


schro_dequantise_s16 ()

void
schro_dequantise_s16 (int16_t *dest,
                      int16_t *src,
                      int quant_factor,
                      int quant_offset,
                      int n);


schro_quantise_s16 ()

void
schro_quantise_s16 (int16_t *dest,
                    int16_t *src,
                    int quant_factor,
                    int quant_offset,
                    int n);


schro_malloc ()

void *
schro_malloc (int size);

Returns


schro_malloc0 ()

void *
schro_malloc0 (int size);

Returns


schro_realloc ()

void *
schro_realloc (void *ptr,
               int size);

Returns


schro_free ()

void
schro_free (void *ptr);


schro_utils_get_time ()

double
schro_utils_get_time (void);

Returns


muldiv64 ()

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

Returns

Types and Values

schro_bool

typedef unsigned int schro_bool;


SCHRO_INTERNAL

#define SCHRO_INTERNAL __attribute__ ((visibility ("internal")))