DivX is a commercial algorithm that encodes and decodes videos in order to compress their file size. While the source code of DivX is not available to the public, DivX operates similarly to other codecs available to video users. Codecs work by compressing each frame of a video. The process typically works by segmenting each frame into 8-by-8-pixel blocks and applying the codec's compression algorithm to each block.
DivX utilizes a lossy compression method, which means that video data is intentionally lost in order for the codec to reduce its file size to a higher degree. As a result, DivX is able to encode DVD videos at one-tenth the file size. A lossless compression method, such as Lagarith, ensures that all data can be recovered during decoding.
Lossy codecs typically apply a discrete cosine transformation to each block before encoding in order to determine the display frequency of the data in the block. Human sight is sensitive to low-frequency information, so the codec can determine which data is best retained in order to optimize videos for viewers.
One key difference between image and video compression is that video compression compares similar frames and discards data that is the same between them. Video data that moves between similar frames is interpreted as a motion vector and saved by the encoder. As a result, an encoder scans ahead in a video to determine which frames to use as reference frames.