Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compression > #3121

Re: lossless JPEG questions

From Thomas Richter <thor@math.tu-berlin.de>
Newsgroups comp.compression
Subject Re: lossless JPEG questions
Date 2015-07-30 09:18 +0200
Organization University of Stuttgart, FRG
Message-ID <mpcj3e$5ef$1@news2.informatik.uni-stuttgart.de> (permalink)
References <eli$1507281629@qz.little-neck.ny.us> <mp9rmc$da7$1@news2.informatik.uni-stuttgart.de> <eli$1507291701@qz.little-neck.ny.us>

Show all headers | View raw


On 29.07.2015 23:10, Eli the Bearded wrote:
> In comp.compression, Thomas Richter  <thor@math.tu-berlin.de> wrote:
>> IOW, if you have a color image encoded in the lossless mode of 10918-1,
>> colorspace is undefined since there is no standard that defines them, 
>> and 10918-1 did not intend to define it *on purpose* (it was not 
>> "forgotten", it was excluded deliberately!). You can use the XT 
>> implementation as a start which assumes 601 YCbCr, and if you get 
>> seemingly wrong colors, you can run the decoder with the "-c" command 
>> line argument to disable this transformation and use 601 RGB and see how 
>> that goes. It might probably get what you want. Maybe.
> 
> In my tests your JPEG-XT decoder produced bit-for-bit identical output
> with and without "-c". The input file was not created by me, but was
> probably created with IJG code. The apparently correct decode I got
> was not using IJG or JPEG-XT, but PVRG JPEG.

A couple of comments if I may: As long as you create the input by the
JPEG XT demo software, it will also reconstruct correctly, so it always
puts in all the markers to identify a codestream as RGB or YCbCr, so
that is not a problem. If you want really lossless, you may want to
specify "-c" on encoding as otherwise it *will* run a transformation to
YCbCr, and that transformation creates loss.

A problem exists if you feed it with a codestream that lacks any
identification of the colorspace whatsoever. In that case, and only in
that case, the decoder command line option "-c" will indicate that the
stream is supposed to be reconstructed in RGB, not YCbCr. I just tested
this, and this also works.

Concering IJG: No, Guido's code does not support the predictive lossless
mode of JPEG. He "invented" some non-JPEG compliant mode for lossless
that has nothing to do with one of our JPEG standards, so for anything
lossless, just stay away from it. Actually, I would even say stay away
from this code in first place and check with libJPEGturbo.

As a last comment, the demo software (now actually reference software)
supports four lossless modes, all of which are "standard compliant",
just to different standards:

-p -c		: 	this is the lossless predictive mode of 10918-1
-ls <x>	-c	:	this is JPEG LS, one of the three modes
-l -c -q 100	:	JPEG XT part 8 lossless, this generates images
			that are also reconstructable by any JPEG
 			decoder, though only XT decoders will be able
			to reconstruct without loss.
-r -h -Q 100 -q xx:	*also* JPEG XT part 8 lossless, same comments
			as below: Reconstructable by any JPEG decoder,
			only lossless for a -8 decoder.

The difference between the last two modes is that the first one is a
single-layer encoder (lower encoding complexity, lower compression
performance) whereas the latter is a double-layer encoder (higher
complexity, higher compression efficiency). The "xx" is the quality of
the "base layer", i.e the quality of the image a regular JPEG decoder is
able to reconstruct.

Greetings,
	THomas

Back to comp.compression | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

lossless JPEG questions Eli the Bearded <*@eli.users.panix.com> - 2015-07-28 21:16 +0000
  Re: lossless JPEG questions Thomas Richter <thor@math.tu-berlin.de> - 2015-07-29 08:26 +0200
    Re: lossless JPEG questions Eli the Bearded <*@eli.users.panix.com> - 2015-07-29 21:10 +0000
      Re: lossless JPEG questions Thomas Richter <thor@math.tu-berlin.de> - 2015-07-30 09:18 +0200
        Re: lossless JPEG questions Eli the Bearded <*@eli.users.panix.com> - 2015-07-31 02:33 +0000
          Re: lossless JPEG questions Thomas Richter <thor@math.tu-berlin.de> - 2015-07-31 11:19 +0200
            Re: lossless JPEG questions Eli the Bearded <*@eli.users.panix.com> - 2015-07-31 18:55 +0000
              Re: lossless JPEG questions Thomas Richter <thor@math.tu-berlin.de> - 2015-08-01 16:39 +0200
                Re: lossless JPEG questions Eli the Bearded <*@eli.users.panix.com> - 2015-08-03 21:07 +0000
                Re: lossless JPEG questions Thomas Richter <thor@math.tu-berlin.de> - 2015-08-04 10:17 +0200
                Re: lossless JPEG questions Eli the Bearded <*@eli.users.panix.com> - 2015-08-04 20:28 +0000
                Re: lossless JPEG questions Thomas Richter <thor@math.tu-berlin.de> - 2015-08-05 11:31 +0200

csiph-web