Skip to content

Proposal to remove non-complient images from Jpeg test suite and introduce new validation check #1894

@br3aker

Description

@br3aker

Jpeg test suite has invalid image. It was introduced due to the index out of range exception but right now it's used to actually test jpeg decoder with reference image.

This image is invalid according to the itu spec:
image

As it has Hi parameter equal to 10:
image

Current implementation does not validate this value in any way and tries to decode spectral data with input parameters. Test suite assumes this image to be parsable just because libjpeg can parse it. Problem is that this image is small enough not to be affected by artifacts, any real world size image would produce pixel mess with invalid sampling rate. Thus this image should not be used to test decoder.

As for the solution, we can force invalid values to 1 or do % 4 but I don't think it's a good way to handle this. It's more convenient to get an exception of what is wrong (ideally with byte(s) start index) rather than random collection of pixels.

P.S.
This is not really relevant to the 'no itu spec compliance' reasoning but it also blocks my decoder optimization with ugly redundant checks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions