Artefact Characterisation for JPEG and JPEG 2000 Image Codecs: Edge Blur and Ringing

: This paper presents a method of objective evaluation of the edge blur and ringing artefacts produced by image codecs. It is difficult to detect and measure individual artefacts in coded images. A synthetic test pattern is developed to separate and measure edge blur and ringing artefacts due to image compression. The influence of contrast on the quality metrics is investigated. The performance of five JPEG and JPEG2000 codec implementations is compared. All five codecs show an increasing level of artefacts with increasing compression ratio. Different implementations of a codec have different artefact characteristics. The objective artefact measures can be used in the image and video codec development process and in parameter optimisation of codec performance. These metrics can also be used to select suitable parameters for video codecs such as MPEG-1, MPEG-2 and MPEG-4 while creating video streams for the Internet applications and in any multimedia application in general.


Introduction
In digital television broadcasting, video streaming and other multimedia communications, image and video are the dominant components.With limited communication bandwidth and storage capacity in terminal devices, it is necessary to reduce data rates using digital codecs.The techniques and quantisation used in image and video compression codecs introduce distortions known as artefacts.Tlie Digital Fact Book defines artefacts as "particular visible effects, which are a direct result of some technical limitation" [1].Artefacts are generally not evaluated by traditional methods of signal evaluation.For instance, the visual perception of contouring in a picture cannot be related to signal-to-noise ratio [1].
High levels of compression result in undesirable spurious features and errorpatterns in the reconstructed image; these are the artefacts defined above.Image compression schemes such as JPEG use the techniques of discrete cosine transform (DCT), block processing and quantisation.JPEG2000 uses tiling, wavelet transformation and quantisation.Figure 1 shows some of the resulting artefacts, namely blur, ringing and blockiness in coded images [2].
When the original pattern is not fully known, quantifying these artefacts is difficult.In particular, it is difficult to isolate the individual components of artefacts.Other researchers have developed objective metrics based on non-referenced or reduced reference techniques [3,4].They are good for in-service measurements and as estimates.If the original pattern is unknown it is often difficult to determine the presence and extent of artefacts.Image codec development, parameter tuning and benchmarking all require availability of more accurate and swifter measurements.This can be achieved by using a synthetic pattern having known spatial Edge-blur, ringing and blockiness distributions of pixel values designed to emphasise the artefacts to be assessed.The study, concentrates primarily on two coding artefacts, namely edge blur and ringing.

Objective Quality Metrics
Peak signal-to-noise ratio (PSNR) and mean square error (MSB) are commonly used as objective quality measures.They are not good indicators of artefacts present since PSNR and MSB are global pixel error calculations, which do not detect artefacts separately.Yao et al. presented a blurring distortion measure based on the full reference approach and computed the correlation between the original and error image edges [5].However the method does not distinguish blur and ringing which in general may occur concurrently.The author has already developed objective artefact metrics and synthetic test patterns for evaluation of blockiness and colour bleeding artefacts [6,7].A search of the literature did not reveal any objective artefact metric for ringing or edge blur using a synthetic test pattern.

Methodology
The aim of this research was to make use of the concentric circles synthetic test pattern to evaluate the performance of JEPG and JPEG2000 codecs.The test pattern has been designed such that the spatial distribution of pixel values will emphasise edge blur and ringing artefacts due to codec operation [6].Many image compressors have a control parameter, the quality factor, that can be set by the user to adjust the compression ratio.In general the lower the quality factor the higher the compression ratio and the more visible artefacts become.At low compression ratios, the artefacts may not be obvious or apparent to the human eye.

Definition of artefact metrics
Ringing is an undesirable visible effect that always occurs at edges and blur generally occurs at edges.Since I am concerned with the blur occurring at the edge, the rest of this paper concentrates on edge blur.
Many codecs transform the pixel values into the frequency domain where the transformed coefficients are then quantised.Quantisation errors resulting from this approach give rise to ringing around sharp discontinuities in the image.
A sharp edge contains components at all frequencies.Any change in the relative amplitudes of any of the components will result in ripples in the image with amplitude corresponding to the error.
As a result of energy compaction in a codec, many of the high frequency components are very small, and get quantised to zero.This loss of high frequency components leads to blur in the reconstructed pattern.Ringing and edge blur are defined in Figure 2 (Taken from [6]).I define the region between the first crossings on each side of the edge transition as the edge blur region.Outside of this, from the start of the first overshoot on each side, the errors are classified as ringing.

Original step edge
To obtain a measure of edge blur, consider the shaded area in Figure 2. The greater the blur, the larger will be the shaded area.By dividing the area by the step height h, a measure of average blur width can be obtained.In a similar manner, the area between the ringing signal and ideal signal provides a measure of the severity of ringing.The measures can be normalised by dividing the average measures by the number of edge pixels N.With sampled data, an ideal step edge would involve a transition between two pixels, as illustrated by the circles in Figure 3.
The crosses in Figure 3 are the pixel values near the edge of the reconstructed image from a codec.The transition involves many pixels and pixel values may oscillate around each level of pixel values.
The edge blur and ringing artefact metrics may therefore be quantified as, In 2-D images, edges may appear at any orientation.Therefore I consider edge blur and ringing perpendicular to the edge under consideration.By summing the separate errors of individual artefacts over the whole test pattern and normalising by the number of edge pixels and step size as given in equations ( 1) and (2), I can obtain a measure of edge blur and ringing per edge pixel.

Design of the test signal
To test for edge blur and ringing it is necessary to have step edges within the pattern.These should include edges of all orientations in order to detect any orientation sensitivity inherent in the codec.A circular pattern contains edges of i-very orientation.Initially, pixel values of 64 and 192 have been chosen on either side of the boundary, so that after reconstruction there is adequate amplitude margin to allow for ringing in the reconstructed pattern.To allow for more edges and resulting error pixels, concentric circles have been incorporated (see Figure 4a  and 4b).The spacing has been chosen as a prime number (for example, a spacing of 29) so that if block processing is used, the edges fall at different places within the blocks.
The synthetic test pattern has been designed to emphasise visible edge blur and ringing artefacts.The pixel values and the shape of the pattern have been carefully chosen so that the algorithm could detect coding artefacts completely and adequately

Results
The artefact metrics were evaluated by applying the synthetic test pattern described in the previous section.A JPEG codec was tested at a range of step heights.A set of five JPEG and JPEG2000 codecs were tested at a range of compression ratios.

Impact of step height on edge blur and ringing
The loss of high frequency components results in ringing around discontinuities and a spread of the transition region.The variation of edge blur and ringing were investigated under different step heights by evaluating the artefact metrics for a given quality factor of 20 using a JPEG codec.This experiment was repeated for many quality factor values between 1 and 100.A general observation is that with increasing quality factor, edge blur and ringing demonstrated a similar trend of rapid decrease with increasing step height, and decrease in absolute values over the decreasing quality factors.The Figure 5 and Figure 6 show the metrics evaluated on a JPEG codec at a quality factor of 20.Step height Step height It was observed that ringing errors are not monotonic because of a threshold effect.As the step height is changed, the dominant components move from one quantisation band to another, with consequent differences in the level of ringing.The low step heights resulted in smaller errors, however, because of quantisation, these errors become more significant relative to the step height.Therefore, when normalised, the results become almost random.When averaged over the whole test pattern these results in the large measures seen.At the other end, for very high steps, there is inadequate range available to adequately represent the ringing in reconstructed values.

Figure 4(a). Original concentric circles synthetic test pattern
Hence 64 and 192 were set as suitable pixel intensities of the synthetic concentric test pattern.

Performance comparison of JPEG and JPEG2000 codecs
It is observed that there is a general increasing trend of ringing and edge blur with increasing compression ratio.This is evident in Figures 7 to 12. JPEG codec 2 and codec 3 perform with a similar objective artefact measure where as codec 1 introduces the same level of artefacts as codec 2 and 3 at much lower compression ratios.Hence for a given degree of artefacts, JPEG codec 2 and 3 could yield higher level of compression (approximately four fold increase than JPEG codec 1) as shown in Figure 7 and Figure 8.At some compression levels, ringing errors may actually reduce for higher compression depending on exactly where quantisation levels fall.Figure 11 and Figure 12 depict that both JPEG and JPEG2000 codecs introduce increasing amount of ringing and edge blur with increasing compression ratio.Two codecs, JPEG and JPEG2000 are from a single codec developer and JPEG2000 codec resulted in better picture quality in terms of edge blur and ringing.

Conclusions
Edge blur and ringing are an undesirable visible effect found around edges of reconstructed, digitally coded images.In this paper a performance comparison of JPEG and JPEG2000 codecs for edge blur and ringing artefacts was presented using two objective artefact measures for edge blur and ringing.The approach is based on a known test pattern and measurements of the strength of each artefact in the spatial domain.The artefact metrics are a good representation of artefacts and are swift to calculate.The two measures clearly distinguish between the two artefacts.The concentric circles test pattern was designed with knowledge of the specific mechanisms and weaknesses inherent in transform coding.The concentric circles test pattern can be used to evaluate edge-blur and ringing produced by either block based or wavelet based codecs.
Edge blur and ringing were present in reconstructed pattern from both types of codecs.For low compression ratios, both JPEG and JPEG2000 codecs perform similarly.Based on the concentric circles test pattern, it is observed that edge blur and ringing decrease with increasing step height.Thus pixel intensities need to be set in the synthetic pattern such that the reconstructed pattern enables measurable quantities for the metric values.The optimised concentric circles test pattern resulted in increases in edge blur and ringing with increasing compression ratio.At higher levels of compression, the loss of ac components of the frequency transforms is greater Since video codecs use wavelets or DCT for intra-frame coding, the synthetic test pattern and the two artefact metrics described here can also be applied to evaluate the performance of video codecs.
The concentric circles test pattern is proved to be useful over a wide range of compressions (compression ratio of 2 to 150).The test pattern has been designed and optimized with knowledge of the specific mechanisms and weaknesses inherent in compression algorithms.At very high compression ratios other artefacts such as blockiness and global blur become prominent.The author intends to perform further research to investigate the applicability of the concentric circles test pattern for global blur and to develop a new artefact metric for global blur.

Figure 1 .
Figure 1.Example of Blur and Ringing resulting from JPEG codec at high compression ratio.

Figure 2 .
Figure 2. Ringing and edge blur at an edge of a onedimensional signal.

Figure 3 .
Figure 3. Edge blur and ringing for one-dimensional sampled data.Circles represent original pixel value and cross represent reconstructed pixel value.

Figure 4 (
Figure 4(b).Reconstructed concentric circles synthetic test pattern with blur and ringing artefacts at edges

Figure 5 :
Figure 5: The variation of Edge blur with step height for a JPEG codec at quality factor of 20.

Figure 6 :
Figure 6: The variation of ringing with step height for a JPEG codec at quality factor of 20.

Figure 7 :
Figure 7: Comparison of three JPEG codecs for edge blur against compression ratio.
figure 8: Comparison of three JPEG codecs for ringing against compression ratio.

Figure 9
Figure9and Figure10show the edge blur and ringing resulted from two JPEG2000 codecs.Both implementations are similar in relation to edge blur.At high compression ratio JPEG2000 codec 1 performs better.At maximum compression, the ringing artefact decreases in Figure8and Figure10because of severe quantisation.

Figure 11 :
Figure 11: Comparison of JPEG and JPEG2000 codecs for edge blur against compression ratio.

Figure 10 :
Figure 10: Comparison of two JPEG2000 codecs for ringing against compression ratio.

Figure 12 :
Figure 12: Comparison of JPEG and JPEG2000 codecs for edge blur vs. compression ratio.