[Bug 783267] jpegdec: Outputting garbled colors

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Dec 28 17:59:48 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=783267

Antonio Ospite <ao2 at ao2.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ao2 at ao2.it

--- Comment #6 from Antonio Ospite <ao2 at ao2.it> ---
Created attachment 366050
  --> https://bugzilla.gnome.org/attachment.cgi?id=366050&action=edit
The first frame of the video from the Debian bug report

I got curious and I tried to understand what was going on in more details,

As pointed out the sub-sampling strategy of jpegdec makes it behave correctly
only for 420-sampled input images.

However something more is going on with this specific test case: the problem is
not _only_ that the image is 422, it is also in a weird variant of it which
looks _especially_ broken because the sampling layout is not handled right by
jpegdec when setting the output frame data pointers.

In particular the problematic data has frames encoded with a 422-sampling
scheme of 2x2,1x2,1x2 while a normal 422 scheme would be 2x1,1x1,1x1.

It looks to me like jpegdec does not handle very well the cases where
v_samp_factor[i] != h_samp_factor[i], not even in gst_jpeg_dec_decode_direct().

About using the original subsampling (e.g. Y42B, Y444) and
gst_jpeg_dec_decode_direct(), would that work when the dimensions are not
multiple of DCTSIZE?

After some hints from
https://github.com/libjpeg-turbo/libjpeg-turbo/issues/92#issuecomment-236642411
I wrote something to reproduce the problem with a synthetic test:
https://git.ao2.it/experiments/gstreamer.git/blob/HEAD:/shell/gst-test-jpegdec.sh

The script can also be run on the attached wave_anim_frame_000.jpg image which
shows the artifacts more clearly, for instance compare:
decoded_wave_anim_frame_000_NORMAL_422_jpegdec.png and
decoded_wave_anim_frame_000_WEIRD_422_jpegdec.png, IIUC the first one would be
the "expected" output of a 422 image represented as I420, even if it's a little
funny looking.

wave_anim_frame_000.jpg is the first frame of the video from the Debian bug
report, extracted without decoding it.

Ciao,
   Antonio

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list