webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Macros | Functions
laplace.c File Reference
#include "laplace.h"
#include "mathops.h"

Macros

#define LAPLACE_LOG_MINP   (0)
 
#define LAPLACE_MINP   (1<<LAPLACE_LOG_MINP)
 
#define LAPLACE_NMIN   (16)
 

Functions

void ec_laplace_encode (ec_enc *enc, int *value, unsigned fs, int decay)
 
int ec_laplace_decode (ec_dec *dec, unsigned fs, int decay)
 

Macro Definition Documentation

◆ LAPLACE_LOG_MINP

#define LAPLACE_LOG_MINP   (0)

◆ LAPLACE_MINP

#define LAPLACE_MINP   (1<<LAPLACE_LOG_MINP)

◆ LAPLACE_NMIN

#define LAPLACE_NMIN   (16)

Function Documentation

◆ ec_laplace_decode()

int ec_laplace_decode ( ec_dec dec,
unsigned  fs,
int  decay 
)

Decode a value that is assumed to be the realisation of a Laplace-distributed random process

Parameters
decEntropy decoder state
fsProbability of 0, multiplied by 32768
decayProbability of the value +/- 1, multiplied by 16384
Returns
Value decoded

◆ ec_laplace_encode()

void ec_laplace_encode ( ec_enc enc,
int *  value,
unsigned  fs,
int  decay 
)

Encode a value that is assumed to be the realisation of a Laplace-distributed random process

Parameters
encEntropy encoder state
valueValue to encode
fsProbability of 0, multiplied by 32768
decayProbability of the value +/- 1, multiplied by 16384