For Programmers: Free Programming Magazines  


Home > Archive > Compression > August 2005 > JPEG decoding with only 1 quantization table??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JPEG decoding with only 1 quantization table??
deepaa@gmail.com

2005-08-19, 6:55 pm

Is it possible to decode a JPEG that comes with only 1 quantization
table in its EXIF header? I have one such file that I am unable to
decode with my decoder because it expects 1 luminance & 1 chorminance
quantization table to be found. However, Windows seems to be able to
show this file fine.

Any help on this will be much appreciated!

Matt Mahoney

2005-08-20, 6:55 pm

deepaa@gmail.com wrote:
> Is it possible to decode a JPEG that comes with only 1 quantization
> table in its EXIF header? I have one such file that I am unable to
> decode with my decoder because it expects 1 luminance & 1 chorminance
> quantization table to be found. However, Windows seems to be able to
> show this file fine.
>
> Any help on this will be much appreciated!


It's allowed by the standard to have only one quantization table, but
unusual. However the standard allows lots of formats that are rarely
used (hierarchical, arithmetic coding, lossless, 12 bit pixels,
monochrome, alpha channel) and probably not supported by most software.

I scanned my computer and found 90-95% are baseline DCT Huffman coded,
and the remainder are progressive encodings. Just about all (including
black and white images) have 3 color components, even though 1-4 are
allowed. They almost always use different Huffman and quantization
tables for the luminance (first component) and chrominance (2nd and
3rd). Most use 1x1, 2x1 or 2x2 resolution for the luminance signal.
This includes jpegs embedded in .doc, .pdf, .dll, etc.

I'm not familiar with the EXIF format but AFAIK the quantization tables
are specified in the standard, not in the optional APPx headers like
JFIF.

-- Matt Mahoney

Flavius Vespasianus

2005-08-20, 6:55 pm

deepaa@gmail.com wrote in news:1124487971.820620.215210
@g47g2000cwa.googlegroups.com:

> Is it possible to decode a JPEG that comes with only 1 quantization
> table in its EXIF header? I have one such file that I am unable to
> decode with my decoder because it expects 1 luminance & 1 chorminance
> quantization table to be found. However, Windows seems to be able to
> show this file fine.


There is no reason whatsoever to require two quantization tables. It is
perfectly legal to have 1, 2, or 3 (one for each component)...or even 4, 5,
6.... tables where some are not even used.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com