Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

RE: [GMLJP2] NetCDF <--> GML/JPEG2000

John wrote:

Im wondering if its fair to think of JPEG as inherently 2D arrays of
integers (perhaps floats in the future) ?. I assume that the wavelet
compression is optimized for 2D ?

If so, it may not be the right data structure for representing
observations, which may be thought of as lists of tuples, more like a
database table ?

Some background that might help (or just muddle things further...):

* JPEG 2000 considers an image to be a 2D array, where each array
element is a tuple ("pixel") which can contain N samples.  In the
usual case, the samples are 3 uint8's ("red", "green", "blue"). However, the standard allows N to be very large (2^16 or so, I'd have
to check), and futhermore the N samples need not all be of the same
datatype.

* Additionally, you can have M images ("codestreams") per file.  This
is how they do movies/video, among other things; each frame is a
separate codestream.  In general, of course, the M images need not all
be of the same shape (width, height, number of samples, etc).

* The wavelet is indeed a 2-D construct.  There was some work on an
extension for 3-D, but this has been abandoned (and that project also
included the floating point support, unfortunately).

* While the wavelet is 2-D, the "compression" part is not.  Under JPEG
2000, the main compression win comes from the arithmetic encoder --
this mechanism operates deep down in the bit domain, and so is
agnostic as to number, type, etc of the samples.

* Early on in the encoding process, there is a colorspace transform
that is done to improve compression ratios for RGB data: the data is
(losslessly) mapped into the YCbCr domain, which essentially
decorrelates the color bands better than RGB does.  If your data is
not RGB, this transform can be skipped -- or, indeed, if you know
something about the properties of your data's bands, with one of the
extensions you can supply your own decorrelating transformation...

-mpg


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690