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 706406 - codecparsers: h264: fix the quantization matrix scan order
codecparsers: h264: fix the quantization matrix scan order
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Gwenole Beauchesne
gstreamer-vaapi maintainer(s)
Depends on: 708629 720099
Blocks: 719412
 
 
Reported: 2013-08-20 14:53 UTC by sreerenj
Modified: 2013-12-09 11:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codecparsers: h264: store quantization matrices in zig-zag order. (1.54 KB, patch)
2013-08-20 14:53 UTC, sreerenj
none Details | Review
codecparsers: h264: add helpers to convert quantization matrices. (4.50 KB, patch)
2013-08-20 14:53 UTC, sreerenj
none Details | Review

Description sreerenj 2013-08-20 14:53:18 UTC
Created attachment 252435 [details] [review]
codecparsers: h264: store quantization matrices in zig-zag order.

This is just the copy of what we did for mpeg2 in https://bugzilla.gnome.org/show_bug.cgi?id=693000.

Attaching two patches were the first one is to store the quantization matrix as it is in the bitstream (zig-zag order) and the second one is to add utility functions to convert the scan order.

The patch_2 is adding four APIs to convert the scanning orders. We can squash this to two with more parameters to the function. But i prefer the current one which is in sync with mpeg2 apis to do the same.

I think the driver is expecting raster scan order for h264 since i can see glitches in this video because of the zig-zag order when using vaapidecode.
sample: http://samples.mplayerhq.hu/Matroska/H264+EAC3.mkv
Comment 1 sreerenj 2013-08-20 14:53:52 UTC
Created attachment 252436 [details] [review]
codecparsers: h264: add helpers to convert quantization matrices.
Comment 2 sreerenj 2013-10-09 11:08:45 UTC
This has been already merged to upstream gst-plugins-bad.
Comment 3 sreerenj 2013-12-03 09:40:51 UTC
Please close this bug once you merge the patch to gstreamer-codecparsers.
Comment 4 Gwenole Beauchesne 2013-12-06 13:44:32 UTC
For reference, here is the original bug report
https://bugs.freedesktop.org/show_bug.cgi?id=57904

A conformance bitstream that used to exhibit the incorrect behaviour is:
FRExt/freh5.264
Comment 5 Gwenole Beauchesne 2013-12-09 10:43:42 UTC
Hi, additional patches were needed. I will push them to gst-plugins-bad next.
Comment 6 Gwenole Beauchesne 2013-12-09 11:50:42 UTC
Fixed in git master branch. Thanks.
Comment 7 Gwenole Beauchesne 2013-12-09 11:50:51 UTC
commit bd5ae1b2205edaaf5581463cab200d15d80e7fd5
Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Date:   Mon Dec 9 12:46:45 2013 +0100

    decoder: h264: fix decoding of scaling lists.
    
    The GStreamer codecparser layer now parses the scaling lists in zigzag
    scan order, as expected, so that to match the original bitstream layout
    and specification. However, further convert the scaling lists into
    raster scan order to fit the existing practice in most VA drivers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706406

commit f870469b0a4451f885de5a1d0e81f31ac7687150
Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Date:   Mon Dec 9 12:07:28 2013 +0100

    codecparsers: update to gst-vaapi-branch commit 177c73b.
    
    a7e3255 add H.265 (HEVC) bitstream parser
    177c73b h264: fix picture level scaling lists derivation (rule B)
    14733f1 h264: fix parsing of VCL HRD parameters
    59a0b47 h264: store quantization matrices in zig-zag order
    ffb6e26 h264: add helpers to convert quantization matrices
    c78a504 mpeg2: also initialize debug category in parse_sequence_header()
    719d1b0 mpeg2: turn internal consistency check into a g_assert()
    5241d8e all: remove some unused functions
    18eb312 all: fix for GST_DISABLE_GST_DEBUG
    963c04a all: make warnings more meaningful