GNOME Bugzilla – Bug 748335
encoder: JPEG: Add scaling of the quality factor and Quantization tables
Last modified: 2015-06-02 13:00:31 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).
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>