39 for (version = 0; version < 2; version++) {
40 for (p = 0; p< 1024; p++) {
44 memset(state, 128,
sizeof(state));
46 for (i = 0; i <
SIZE; i++)
49 for (i = 0; i <
SIZE; i++)
56 memset(state, 128,
sizeof(state));
58 for (i = 0; i <
SIZE; i++)
59 if ((r[i] & 1) !=
get_rac(&c, state)) {
static int get_rac(RangeCoder *c, uint8_t *const state)
int ff_rac_check_termination(RangeCoder *c, int version)
Check if at the current position there is a valid looking termination.
#define i(width, name, range_min, range_max)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void ff_build_rac_states(RangeCoder *c, int factor, int max_p)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
av_cold void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size)
av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
int ff_rac_terminate(RangeCoder *c, int version)
Terminates the range coder.
uint8_t * bytestream_start