Hierarchical JPEG: Non-Differential vs Differential
Hierarchical JPEG encoding provides a multi-resolution image representation, allowing systems to access low-resolution previews before reconstructing full-resolution details. Within this hierarchical framework, non-differential and differential compression represent two distinct methods for handling transitions across resolution layers. Non-differential compression stores each resolution layer by encoding the complete visual signal directly, while differential compression encodes only the prediction residual—the mathematical difference between an upsampled lower-resolution layer and the target higher-resolution image.
The Hierarchical Framework
The JPEG standard (ITU-T T.81 / ISO/IEC 10918-1) defines hierarchical mode as a pyramidal structure. An image is downsampled into a sequence of increasing resolutions: a base low-resolution frame followed by one or more higher-resolution enhancement frames. This structure is designed for environments with limited bandwidth, progressive display requirements, or varying display sizes. How each subsequent layer is encoded determines whether the process is non-differential or differential.
Non-Differential Hierarchical Compression
In non-differential hierarchical mode, each resolution level is encoded directly without subtracting a spatial prediction from the lower-resolution levels:
- Direct Sample Encoding: The intermediate or final higher-resolution frames are compressed using standard Discrete Cosine Transform (DCT) or lossless coding directly on the source pixel values for that scale.
- Independence of Layers: Because each layer does not rely on subtracting the interpolated prior layer, error propagation between stages is minimized.
- Data Redundancy: Storing complete pixel representations at multiple resolutions inherently duplicates visual information across tiers. This creates higher spatial redundancy and results in a larger overall file size compared to residual-based encoding.
Differential Hierarchical Compression
Differential hierarchical compression minimizes redundancy between pyramidal layers by leveraging predictive coding:
- Predictive Residuals: A lower-resolution image is first decoded and then spatially interpolated (upsampled) to match the dimensions of the next resolution level. This interpolated image acts as a prediction.
- Difference Frames: The prediction is subtracted from the original, uncompressed image at that higher resolution. The resulting differences—known as residual error samples—are what actually undergo DCT transformation and quantization.
- Reconstruction: During decoding, the system reconstructs the base image, upsamples it, and adds the decoded residual frame back to it to restore the final pixel values for that stage.
- Compression Efficiency: Because the upsampled image already contains significant low-frequency structural information, the residual contains mostly high-frequency details (edges, textures) centered near zero. These zero-biased residuals compress far more efficiently with run-length and Huffman or arithmetic coding.
Key Trade-offs
- File Size: Differential compression achieves noticeably higher compression ratios than non-differential mode across multi-resolution layers because it eliminates shared low-frequency data between scales.
- Computational Complexity: Differential encoding and decoding require interpolation routines and arithmetic subtraction/addition stages for every resolution step, increasing CPU and memory processing compared to direct non-differential parsing.
- Artifact Behavior: In differential mode, quantization noise introduced at lower resolutions can interact with the interpolation step, requiring careful design of the residual quantization tables to prevent compounding compression artifacts. Non-differential frames avoid this interaction by coding each resolution scale directly.