Adaptive entropy encoding and decoding techniques are described. For
example, a screen capture encoder and decoder perform adaptive entropy
encoding and decoding of palettized screen capture content in screen
capture video. The encoder selects between different entropy encoding
modes (such as an arithmetic coding mode and a combined run
length/Huffman encoding mode, which allow the encoder to emphasize
bitrate reduction at some times and encoding speed at other times). The
run length encoding can use run value symbols adapted to common patterns
of redundancy in the content. When the encoder detects series of pixels
that could be encoded with different, alternative runs, the encoder
selects between the alternative runs based upon efficiency criteria. The
encoder also performs adaptive Huffman encoding, efficiently
parameterizing Huffman code tables to reduce overall bitrate while
largely preserving the compression gains of the adaptive Huffman
encoding. A decoder performs converse operations.