Introduction - If you have any usage issues, please Google them yourself
This technique doesn t involve sorting of probabilities as in Shannon-Fano coding. The following formula is used to calculate F (x) which in turn generates the code
F (x) = F(x) + p(x) / 2,
where F(x) is cummulative sum of probabilities p(x).
It can be further understood with the following C code