A similar arithmetic coder, called the QM-coder, is used by several image compression schemes. These routines implement this coder in a (hopefully) reusable way.