This repository was archived by the owner on Jan 31, 2025. It is now read-only.
Fix JPEG decoding of an oddly encoded files on gen7/8#530
Open
digetx wants to merge 1 commit intointel:masterfrom
Open
Fix JPEG decoding of an oddly encoded files on gen7/8#530digetx wants to merge 1 commit intointel:masterfrom
digetx wants to merge 1 commit intointel:masterfrom
Conversation
The VAAPI driver fails to decode JPEG if encoded data has component ID set to 255 (-1) and selector to 0 because this produces a wrong result of the final ID calculation since the component value is expanded to a 32bit signed integer by compiler instead of keeping it unsigned 8bit, thus the result is calculated as "0 - 255 + 1 = -254" instead of "0 - (-1) + 1 = 2". Example output from FFmpeg: ... [mjpeg @ 0x56156be1cc40] component 0 1:1 id: -1 quant:0 [mjpeg @ 0x56156be1cc40] component 1 1:1 id: 0 quant:1 [mjpeg @ 0x56156be1cc40] component 2 1:1 id: 1 quant:1 ... src/gen7_mfd.c:2549: gen7_mfd_jpeg_bsd_object: Assertion `0' failed. This patch fixes the offending integer expansion, JPEG is successfully decoded now. Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
|
@digetx could you provide a sample JPEG file that fails to decode? I have a Haswell CPU and cannot find any JPEGs that would fail to decode locally. |
Author
|
Don't have those files anymore. IIRC, the fix was inspired by the FFMPEG swdec code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intel VA-API driver fails to decode couple JPEG files for me because of the offending implicit u8->int32 expansion in the code of the driver. This PR fixes the implicit integer expansion and decoding works properly now.