DSC compression works on a horizontal line of pixels encoded using groups of three consecutive pixels for native 4:4:4 and simple 4:2:2 formats, or six pixels (three compressed containers) for native 4:2:2 and 4:2:0 formats. If RGB encoding is used, it is first converted to reversible YCC. Simple conversion from 4:2:2 to 4:4:4 can add missing chroma samples by interpolating neighboring pixels. Each luma component is coded separately using three independent substreams (four substreams in native 4:2:2 mode). Prediction step is performed using one of the three modes: modified median adaptive coding (MMAP) algorithm similar to the one used by JPEG-LS, block prediction (optional for decoders due to high computational complexity, negotiated at DSC handshake), and midpoint prediction. Bit rate control algorithm tracks color flatness and buffer fullness to adjust the quantization bit depth for a pixel group in a way that minimizes compression artifacts while staying within the bitrate limits. Repeating recent pixels can be stored in 32-entry Indexed Color History (ICH) buffer, which can be referenced directly by each group in a slice; this improves compression quality of computer-generated images. Alternatively, prediction residuals are computed and encoded with entropy coding algorithm based on delta size unit-variable length coding (DSU-VLC). Encoded pixel groups are then combined into slices of various height and width; common combinations include 100% or 25% picture width, and 8-, 32-, or 108-line height.