Dirac uses adaptive binary arithmetic coding to achieve lossless entropy coding. In binary coding the only symbols encoded are 0 and 1. Thus multi-valued symbols must be converted to a string of 1’s and 0’s. The expedient of simply coding the binary representation of a multi-valued symbol is ineffective, so Dirac uses “unary” coding for binarisation of prediction residue wavelet coefficients.
Unary coding is optimal for a Laplacian distribution of values, since the probability P(x>M | x>M-1) is constant coefficient magnitudes with this distribution, and these probabilities are the probabilities of 0 occuring in the Mth bin with unary coding. Since wavelet coefficients are approximately Laplacian distributed, unary coding makes a good scheme when combined with arithmetic coding. However some parts of the picture, e.g. intra coded blocks, may deviate substantially from a Laplacian distribution. For these regions an alternative binarisation might improve compression efficiency. An exp-Golomb code is suitable for this. It is basically an exponent-mantissa representation where the exponent is coded using unary coding.
One possible implementation would be to switch to alternative binarisation (e.g. exp-Golomb) when parent residual wavelet coefficients were greater than a threshold. The current Dirac implementation uses a single probability (context) when wavelet coefficients are greater than 4. This might be an appropriate threshold at which to switch to an alternative binarisation. This scheme uses implicit signalling (i.e. is parent coefficient > threshold) to change binarisation and so does not incur addition overhead to signal the switch. An alternative, similar to using multiple quantisers within a sub-band, may be to use alternative binarisations in different regions of the picture.
The use of alternative binarisations would require a new context structure with corresponding significant knockons to the rest of the codec design. The conceptual complexity of these changes is, however, small. We already have the concepts of changes to the quantiser (and associated contexts) when the parent is non-zero and Dirac already uses the exp-Golomb binarisations so there is little in the way of new concepts. The potential gains from such an approach are unknown, but possibly of the same order of magnitude as the use of multiple quantisers within a sub-band, i.e. on the order of 1-2%.
Proposal: flag the use of alternative binarisations. This flag would, most appropriately, be indicated by an increased version number, which places this idea firmly in the realm of future enhancements.
Status: Open. Efficacy uncertain, experimentation required, leave for future version of codec.