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 748335 - encoder: JPEG: Add scaling of the quality factor and Quantization tables
encoder: JPEG: Add scaling of the quality factor and Quantization tables
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
0.5.11
Other Linux
: Normal major
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks: 743569
 
 
Reported: 2015-04-22 20:56 UTC by sreerenj
Modified: 2015-06-02 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sreerenj 2015-04-22 20:56:33 UTC
The jpeg encoder won't work correctly unless we do the quality factor scaling and quanization matrix scaling as driver is doing.

Issue is clearly visible if we set quality value to 100.

Reason(considering Intel-vaapi driver):
The driver is internally doing quality factor normalization(on top of q value submitted by the upper layer) and scaling of user supplied quantization matrix with this normalized quality factor. This is the same normalization + scaling that is doing by the libjpeg software library too.

But we are submitting packed headers from gstreamer-vaapi to the driver with original (un-scaled) quantization matrix which is going to embed in the encoded stream. This will result in wrong decoding of the corresponding encoded stream. The only way to fix this issue is to do the scaling as exactly as what driver is doing (or the driver needs to do the frame header packing by itself which is not implemented yet).
Comment 1 sreerenj 2015-06-02 13:00:31 UTC
commit 2a2ecbe8652555ecd2c888be025a9720ddf36214
Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Date:   Tue Jun 2 08:52:53 2015 +0300

    encoder: jpeg: Fix the packed header generation
    
    This is a work-around to satisfy the va-intel-driver.
    Normalize the quality factor and scale QM values (only for packed header
    generation) similar to what VA-Intel driver is doing . Otherwise the
    generated packed headers will be wrong, since the driver itself is
    scaling the QM values using the normalized quality factor.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748335
    
    Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>