After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793787 - [gstreamer-msdk-master][SKL] some cases mjpeg decoding fail with error message "jpegparse0: Internal data stream error".
[gstreamer-msdk-master][SKL] some cases mjpeg decoding fail with error messag...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 795117
Blocks: 789886
 
 
Reported: 2018-02-24 08:19 UTC by zj,wang
Modified: 2018-04-16 21:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
jpeg decoding stream (36.00 KB, image/jpeg)
2018-02-26 01:35 UTC, zj,wang
  Details
jpegdec: Fix non-interleaved sample decode (1.57 KB, patch)
2018-03-29 22:51 UTC, sreerenj
committed Details | Review

Description zj,wang 2018-02-24 08:19:34 UTC
Test Env:
============================================
Platform:               SKL
Arch:          		x86_64
CentOS Linux release    7.3.1611 (Core)
Kernel:			4.4.0 
libva			MediaServerStudioEssentials2017R3.tar.gz (libva 
                        1.67.0.pre1)
media_driver		MediaServerStudioEssentials2017R3.tar.gz 16.5.2.64009-
                        ubit
gstreamer               master branch 91798e16cc09420163684d13779f13f374164ea2
gst-bad 		master branch 1c81bf4bdc67b518d6b3bbc22398c17fe8ced1da


Reproduce Steps:
============================================
take one case for example
1. build enc as above lists
2. gst-launch-1.0 filesrc location=/media/JPEG_RefCompare/400_f_11014777_vbypseclj6jfkjhgn5wsiidtrm5j0ukm.jpg '!' jpegparse '!' msdkmjpegdec '!' videoconvert '!' video/x-raw,format=I420 '!' filesink location=400_f_11014777_vbypseclj6jfkjhgn5wsiidtrm5j0ukm.jpg.yuv
3. decoding fails and error message occurs.

error info
ot context from element 'msdkmjpegdec0': gst.msdk.Context=context, gst.msdk.Context=(GstMsdkContext)"\(GstMsdkContext\)\ msdkcontext0";
Redistribute latency...
0:00:00.033336237 13613       0x8948f0 ERROR                msdkdec gstmsdkdec.c:723:gst_msdkdec_handle_frame:<msdkmjpegdec0> DecodeFrameAsync failed (device operation failure)
ERROR: from element /GstPipeline:pipeline0/GstJpegParse:jpegparse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstJpegParse:jpegparse0:
streaming stopped, reason error (-5)
Comment 1 zj,wang 2018-02-26 01:35:09 UTC
Created attachment 368914 [details]
jpeg decoding stream
Comment 2 sreerenj 2018-03-29 22:51:03 UTC
Created attachment 370316 [details] [review]
jpegdec: Fix non-interleaved sample decode
Comment 3 sreerenj 2018-03-29 22:53:31 UTC
@wang: Could you please have try with the attached patch?
Please make sure that other conformance test samples are not failing due to this patch. If this patch causing any regression, then we need a fix from Msdk + some other changes in the decoder.
Comment 4 zj,wang 2018-04-09 06:23:14 UTC
Hi Sree
   
   after apply this patch, it still has 13 cases which will fail
failed cases
decode_jpeg/010309_0800_4680_nshs.jpg   DECODEFAIL
decode_jpeg/126296226_bf7eba45c21.jpg   DECODEFAIL
decode_jpeg/127746-fb.jpg   DECODEFAIL
decode_jpeg/1-gbb-peace-389.jpg   DECODEFAIL
decode_jpeg/1_lifeplus_01.jpg_l.jpg   DECODEFAIL
decode_jpeg/230400-kerala-girl-0.jpg   DECODEFAIL
decode_jpeg/27022005_198.sized.jpg   DECODEFAIL
decode_jpeg/29-4673tourists-rice-boat-on-the-backwaters-near-kayamkulam-kerala-india-posters.jpg   DECODEFAIL
decode_jpeg/29-725.jpg   DECODEFAIL
decode_jpeg/3245_by_chris_johansen-thumb.jpg   DECODEFAIL
decode_jpeg/34tew40.jpg   DECODEFAIL
decode_jpeg/390-2377.jpg   DECODEFAIL
decode_jpeg/394939.jpg   DECODEFAIL

error info:
ERROR: from element /GstPipeline:pipeline0/GstJpegParse:jpegparse0: Internal data stream error.
Additional debug info:
gstbaseparse.c(3611): gst_base_parse_loop (): /GstPipeline:pipeline0/GstJpegParse:jpegparse0:
streaming stopped, reason not-negotiated (-4)
Comment 5 sreerenj 2018-04-09 22:06:03 UTC
The issue is that jpeg parser is not reading the header and decoder is not getting the width/height information from caps.
Providing width/height in capsfilter will fix the issue for conformance testing.

eg: 
gst-launch-1.0 filesrc location= 394939.jpg ! jpegparse ! image/jpeg, width=500, height=330 !  msdkmjpegdec ! videoconvert ! ximagesink

The proper fix can be done in two ways:

1: Investigate why jpegparser is failing and get a fix in parser so that we don't need to add anything in decoder side.

Pros: decoder code will be simple, no need to header parsing with msdk which will help to avoid start-up(if any) delay.

Cons: always will have a tight dependency to parser. 

2: Use MSDK routines to extract headers from jpeg stream without relying on parser output. This requires changes in current decoder code flow.

Pros: No dependency on parser output

Cons: Will make the decoder implementation bit more complicated.
Comment 6 sreerenj 2018-04-10 01:00:21 UTC
@zj,wang, Please have a test with the patch attached in :https://bugzilla.gnome.org/show_bug.cgi?id=795117
Comment 7 zj,wang 2018-04-11 07:20:16 UTC
Hi Sree

    after apply the patch "0001-msdk-jpegdec-Fix-non-interleaved-sample-decode.patch" and "0001-jpegparse-Fix-APP1-marker-segment-parsing.patch", this issue will be fixed.
Comment 8 sreerenj 2018-04-16 21:45:08 UTC
Review of attachment 370316 [details] [review]:

pushed as commit 142ad9dbad7a4f0e0af7e033d01e22b069d4ace9