30 #ifndef AVCODEC_LAGARITHRAC_H
31 #define AVCODEC_LAGARITHRAC_H
59 while (l->
range <= 0x800000) {
75 unsigned range_scaled, low_scaled, div;
83 if (l->
low < range_scaled * l->
prob[255]) {
85 if (l->
low < range_scaled * l->
prob[1]) {
89 shift = 30 -
av_log2(range_scaled);
90 div = ((range_scaled << shift) + (1 << 23) - 1) >> 23;
97 low_scaled = (low_scaled << shift) | (low_scaled >> (32 - shift));
100 while (l->
low >= range_scaled * l->
prob[val + 1])
113 l->
low -= range_scaled * l->
prob[val];
static uint8_t lag_get_rac(lag_rac *l)
Decode a single byte from the compressed plane described by *l.
uint8_t range_hash[256]
Hash table mapping upper byte to approximate symbol.
const uint8_t * bytestream_end
End position of input bytestream.
const uint8_t * bytestream_start
Start of input bytestream.
unsigned scale
Number of bits of precision in range.
bitstream reader API header.
Libavcodec external API header.
uint32_t prob[258]
Table of cumulative probability for each symbol.
main external API structure.
common internal and external API header
unsigned hash_shift
Number of bits to shift to calculate hash for radix search.
static void lag_rac_refill(lag_rac *l)
void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
const uint8_t * bytestream
Current position in input bytestream.