28 #ifndef AVCODEC_DIRAC_ARITH_H 29 #define AVCODEC_DIRAC_ARITH_H 65 #define CTX_SB_F1 CTX_ZP_F5 67 #define CTX_PMODE_REF1 0 68 #define CTX_PMODE_REF2 1 69 #define CTX_GLOBAL_BLOCK 2 70 #define CTX_MV_F1 CTX_ZP_F2 72 #define CTX_DC_F1 CTX_ZP_F5 99 while (c->
range <= 0x4000) {
112 int new = bytestream_get_be16(&c->
bytestream);
123 c->
low +=
new << counter;
132 int range_times_prob, bit;
133 unsigned low = c->
low;
134 int range = c->
range;
136 range_times_prob = (c->
range * prob_zero) >> 16;
138 #if ARCH_X86 && HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS 139 low -= range_times_prob << 16;
140 range -= range_times_prob;
147 :
"+q"(bit),
"+r"(range),
"+r"(low)
148 :
"r"(c->
low),
"r"(c->
low>>16),
149 "r"(range_times_prob)
152 bit = (low >> 16) >= range_times_prob;
154 low -= range_times_prob << 16;
155 range -= range_times_prob;
157 range = range_times_prob;
174 if (ret >= 0x40000000) {
static int shift(int a, int b)
int16_t ff_dirac_prob_branchless[256][2]
uint16_t contexts[DIRAC_CTX_COUNT]
static int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_ctx)
const uint8_t ff_dirac_next_ctx[DIRAC_CTX_COUNT]
static void renorm(DiracArith *c)
bitstream reader API header.
static void refill(DiracArith *c)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const uint8_t * bytestream
const uint8_t * bytestream_end
static int dirac_get_arith_bit(DiracArith *c, int ctx)
const uint16_t ff_dirac_prob[256]
static int dirac_get_arith_int(DiracArith *c, int follow_ctx, int data_ctx)
void ff_dirac_init_arith_tables(void)
void ff_dirac_init_arith_decoder(DiracArith *c, GetBitContext *gb, int length)