A method, apparatus, and a computer readable hardware storage medium with
instructions to encode a series of quantized transform coefficients. The
method includes identifying runs of one or more non-zero coefficients,
and for each such run, identifying events of consecutive amplitude-1
coefficients followed by a single amplitude>1 coefficient. The method
further includes encoding the identified event with a codeword, each
event identified according to the length of the consecutive amplitude-1
coefficients and the amplitude of the ending coefficient. The method is
such that relatively short codewords are formed to represent values or
sequences of values that are relatively more likely-to-occur, and
relatively long codewords are formed to represent values or sequences of
values that are relatively less likely-to-occur. The method is applicable
to encoding a region in the series where there is likely to be a cluster
of non-zero-valued coefficients.