MCPcopy Create free account
hub / github.com/davisking/dlib / get_target

Method get_target

dlib/entropy_decoder/entropy_decoder_kernel_2.cpp:205–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203// ----------------------------------------------------------------------------------------
204
205 uint32 entropy_decoder_kernel_2::
206 get_target (
207 uint32 total
208 )
209 {
210 // note that we must add one because of the convention that
211 // high == the real upper range minus 1
212 r = (high-low+1)/total;
213 uint32 temp = (target-low)/r;
214 if (temp < total)
215 return temp;
216 else
217 return total-1;
218 }
219
220// ----------------------------------------------------------------------------------------
221

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected