Runlength encoding of quantized discrete cosine transform (DCT) coefficients
Viresh Ratnakar, Ephraim Feig, Eric Viscito, Sudhakar Kalluri · Proceedings of SPIE, the International Society for Optical Engineering/Proceedings of SPIE · 1995
Runlength encoding is used in image and video compression methods to efficiently store quantized Discrete Cosine Transform coefficients. The coefficients for each block are scanned in a zig-zag fashion, and runs of zeros are entropy coded. In this paper we present a comparison of the bit-rate resulting from runlength encoding with the bit-rate calculated as the coefficient-wise sum of entropies. Our experiments with several images show that the two are very close in practice. This is a useful result, for example, for designing quantization matrices to meet any bit-rate requirement. We also present an analytical framework to study these bit- rates. We consider two variants of runlength encoding. In the first one, the symbols that are entropy-coded are (runlength, value) pairs. In the second variant, which is the one used in JPEG, values are grouped together into categories based on magnitude.