Lines Matching refs:pos
25 // pos return
51 // get_pos_slot(pos) is the basic version. get_pos_slot_2(pos)
52 // assumes that pos >= FULL_DISTANCES, thus the result is at least
53 // FULL_DISTANCES_BITS * 2. Using get_pos_slot(pos) instead of
54 // get_pos_slot_2(pos) would give the same result, but get_pos_slot_2(pos)
79 # define get_pos_slot(pos) ((pos) <= 4 ? (pos) : get_pos_slot_2(pos))
82 get_pos_slot_2(uint32_t pos)
84 const uint32_t i = bsr32(pos);
85 return (i + i) + ((pos >> (i - 1)) & 1);
102 #define fastpos_result(pos, extra, n) \
103 lzma_fastpos[(pos) >> fastpos_shift(extra, n)] \
108 get_pos_slot(uint32_t pos)
112 if (pos < fastpos_limit(0, 0))
113 return lzma_fastpos[pos];
115 if (pos < fastpos_limit(0, 1))
116 return fastpos_result(pos, 0, 1);
118 return fastpos_result(pos, 0, 2);
124 get_pos_slot_2(uint32_t pos)
126 assert(pos >= FULL_DISTANCES);
128 if (pos < fastpos_limit(FULL_DISTANCES_BITS - 1, 0))
129 return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 0);
131 if (pos < fastpos_limit(FULL_DISTANCES_BITS - 1, 1))
132 return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 1);
134 return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 2);