Lines Matching defs:prob
63 // prob -= (prob + tmp) >> RC_MOVE_BITS;
173 /// rc_if_0(prob) {
174 /// rc_update_0(prob);
177 /// rc_update_1(prob);
181 #define rc_if_0(prob) \
183 rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * (prob); \
187 #define rc_if_0_safe(prob, seq) \
189 rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * (prob); \
198 #define rc_update_0(prob) \
201 prob += (RC_BIT_MODEL_TOTAL - (prob)) >> RC_MOVE_BITS; \
202 /* prob -= ((prob) + RC_BIT_MODEL_OFFSET) >> RC_MOVE_BITS; */ \
208 #define rc_update_1(prob) \
212 prob -= (prob) >> RC_MOVE_BITS; \
220 #define rc_bit_last(prob, action0, action1) \
222 rc_if_0(prob) { \
223 rc_update_0(prob); \
226 rc_update_1(prob); \
232 #define rc_bit_last_safe(prob, action0, action1, seq) \
234 rc_if_0_safe(prob, seq) { \
235 rc_update_0(prob); \
238 rc_update_1(prob); \
246 #define rc_bit(prob, action0, action1) \
247 rc_bit_last(prob, \
252 #define rc_bit_safe(prob, action0, action1, seq) \
253 rc_bit_last_safe(prob, \
268 #define rc_bittree_bit(prob) \
269 rc_bit(prob, , )
396 #define rc_c_bit(prob, action_bit, action_neg) \
398 probability *p = &(prob); \
429 #define rc_bittree_bit(prob) \
430 rc_c_bit(prob, \
498 // rc_asm_calc(prob) is roughly equivalent to the C version of rc_if_0(prob)...
500 // rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * (prob);
506 // range = (range >> RC_BIT_MODEL_TOTAL_BITS) * (prob);
513 // The values in t0 and t1 are needed for rc_update_0(prob) and
514 // rc_update_1(prob). If the bit is 0, rc_update_0(prob)...
519 // the old value stored in t1. (Also, prob needs to be updated.)
521 // If the bit is 1, rc_update_1(prob)...
527 // from t0. (Also, prob needs to be updated here as well.)
532 #define rc_asm_calc(prob) \
535 "imul %[" prob "], %[range]\n\t" \
540 // Also, prob needs to be updated: The update math depends on the decoded bit.
544 // prob -= (prob + (bit ? 0 : RC_BIT_MODEL_OFFSET)) >> RC_MOVE_BITS;
547 // both "prob" and "prob + RC_BIT_MODEL_OFFSET" are needed. Then the desired
551 // (This prob update method is a tiny bit different from LZMA SDK 23.01.
553 // be used with CMOV when updating prob. That is fine since there are enough
560 // and needs one prob variable. To make it faster, the prob variable of
562 // prob variables to choose from for N+1. Both are loaded from memory and
567 // useless moves from "preloaded prob register" to "current prob register",
590 // a = number of the current prob variable (0 or 1)
591 // b = number of the next prob variable (1 or 0)
595 "movzwl 2(%[probs_base]), %[prob" #a "]\n\t" \
597 "movzwl 4(%[probs_base]), %[prob" #b "]\n\t" \
601 "movzwl (%[probs_base], %q[symbol], 4), %[prob" #b "]\n\t" \
608 rc_asm_calc("prob" #a) \
614 "cmovae %[t0], %[prob" #b "]\n\t" \
619 "cmovae %[t0], %[prob" #b "]\n\t" \
622 "lea %c[bit_model_offset](%q[prob" #a "]), %[t0]\n\t" \
625 "cmovae %[prob" #a "], %[t0]\n\t" \
638 "sub %[t0], %[prob" #a "]\n\t" \
640 "mov %w[prob" #a "], (%[probs_base], %q[t1], 1)\n\t"
719 "movzwl 2(%[probs_base]), %[prob" #a "]\n\t" \
721 "movzwl 4(%[probs_base]), %[prob" #b "]\n\t" \
725 "%[prob" #b "]\n\t" \
729 rc_asm_calc("prob" #a) \
735 "cmovae %[t0], %[prob" #b "]\n\t" \
739 "cmovae %[t0], %[prob" #b "]\n\t" \
751 "lea %c[bit_model_offset](%q[prob" #a "]), %[t0]\n\t" \
752 "cmovae %[prob" #a "], %[t0]\n\t" \
755 "sub %[t0], %[prob" #a "]\n\t" \
757 "mov %w[prob" #a "], 2(%[probs_base])\n\t" \
760 "mov %w[prob" #a "], " \
764 "mov %w[prob" #a "], " \
791 "movzwl (%[probs_base], %q[symbol], 2), %[prob]\n\t" \
798 rc_asm_calc("prob") \
801 "lea %c[bit_model_offset](%q[prob]), %[t0]\n\t" \
803 "cmovae %[prob], %[t0]\n\t" \
809 "sub %[t0], %[prob]\n\t" \
810 "mov %w[prob], (%[probs_base], %q[index], 2)" \
816 [prob] "=&r"(t_prob), \
837 // subtree. This doesn't use preloading/prefetching of the next prob because
847 "movzwl (%[probs_base], %q[symbol], 2), %[prob]\n\t" \
857 rc_asm_calc("prob") \
860 "lea %c[bit_model_offset](%q[prob]), %[t0]\n\t" \
863 "cmovae %[prob], %[t0]\n\t" \
875 "sub %[t0], %[prob]\n\t" \
878 "mov %w[prob], (%[probs_base], %q[t1], 1)\n\t"
907 [prob] "=&r"(t_prob), \