28 #ifndef AVCODEC_DIRAC_ARITH_H
29 #define AVCODEC_DIRAC_ARITH_H
64 #define CTX_SB_F1 CTX_ZP_F5
66 #define CTX_PMODE_REF1 0
67 #define CTX_PMODE_REF2 1
68 #define CTX_GLOBAL_BLOCK 2
69 #define CTX_MV_F1 CTX_ZP_F2
71 #define CTX_DC_F1 CTX_ZP_F5
98 while (c->
range <= 0x4000) {
111 int new = bytestream_get_be16(&c->
bytestream);
122 c->
low +=
new << counter;
131 int range_times_prob, bit;
132 unsigned low = c->
low;
133 int range = c->
range;
135 range_times_prob = (c->
range * prob_zero) >> 16;
137 #if HAVE_FAST_CMOV && HAVE_INLINE_ASM
138 low -= range_times_prob << 16;
139 range -= range_times_prob;
146 :
"+q"(bit),
"+r"(range),
"+r"(low)
147 :
"r"(c->
low),
"r"(c->
low>>16),
148 "r"(range_times_prob)
151 bit = (low >> 16) >= range_times_prob;
153 low -= range_times_prob << 16;
154 range -= range_times_prob;
156 range = range_times_prob;