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 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;