background image
JPEG File Interchange Format, Version 1.02
4
Spatial Relationship of Components
Specification of the spatial positioning of pixel samples within components relative to the
samples of other components is necessary for proper image post processing and accurate
image presentation. In JFIF files, the position of the pixels in subsampled components are
defined with respect to the highest resolution component. Since components must be
sampled orthogonally (along rows and columns), the spatial position of the samples in a
given subsampled component may be determined by specifying the horizontal and vertical
offsets of the first sample, i.e. the sample in the upper left corner, with respect to the
highest resolution component.
The horizontal and vertical offsets of the first sample in a subsampled component,
Xoffseti[0,0] and Yoffseti[0,0], is defined to be
Xoffseti[0,0] = ( Nsamplesref / Nsamplesi ) / 2 - 0.5
Yoffseti[0,0] = ( Nlinesref / Nlinesi ) / 2 - 0.5
where
Nsamplesref is the number of samples per line in the largest component,
Nsamplesi is the number of samples per line in the ith component,
Nlinesref is the number of lines in the largest component,
Nlinesi is the number of lines in the ith component.
Proper subsampling of components incorporates an anti-aliasing filter which reduces the
spectral bandwidth of the full resolution components. Subsampling can easily be
accomplished using a symmetrical digital filter with an even number of taps (coefficients).
A commonly used filter for 2:1 subsampling utilizes two taps (1/2,1/2).
As an example, consider a 3 component image which is comprised of components having
the following dimensions:
Component 1: 256 samples, 288 lines
Component 2: 128 samples, 144 lines
Component 3: 64 samples, 96 lines
In a JFIF file, centers of the samples are positioned as illustrated below:
Component 1
Component 2
Component 3
NOTE - This definition is compatible with industry standards such as Postcript
Level 2 and QuickTime. This defintition is not compatible with the conventions
used by CCIR Recommendation 601-1 and other digital video formats. For these
formats, pre-processing of the chrominance components is necessary prior to
compression in order to ensure accurate reconstruction of the compressed image.
[1] [2] [3] [4] [5] [6] [7] [8] [9]