16#ifndef DRACO_COMPRESSION_BIT_CODERS_ADAPTIVE_RANS_BIT_CODING_SHARED_H_
17#define DRACO_COMPRESSION_BIT_CODERS_ADAPTIVE_RANS_BIT_CODING_SHARED_H_
27 uint32_t p_int =
static_cast<uint32_t
>((p * 256) + 0.5);
28 p_int -= (p_int == 256);
29 p_int += (p_int == 0);
30 return static_cast<uint8_t
>(p_int);
35 static constexpr double w = 128.0;
36 static constexpr double w0 = (w - 1.0) / w;
37 static constexpr double w1 = 1.0 / w;
38 return old_p * w0 + (!bit) * w1;
#define DRACO_DCHECK_LE(a, b)
Definition macros.h:85
Definition attribute_octahedron_transform.cc:21
double update_probability(double old_p, bool bit)
Definition adaptive_rans_bit_coding_shared.h:34
uint8_t clamp_probability(double p)
Definition adaptive_rans_bit_coding_shared.h:24