-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid test files using CleanApertureBox
(clap
) transformation
#150
Labels
Comments
This was referenced May 22, 2021
baumanj
added a commit
to mozilla/mp4parse-rust
that referenced
this issue
May 24, 2021
The main change is adding support for the mirroring (imir) and rotation (irot) transformations. Additional changes include: - Rename existing AvifItem → IsobmffItem since it isn't AVIF-specific - Rename AvifImage → Mp4parseAvifImage (for consistency with the C API) - Create AvifItem for more specific use cases - Expose spatial_extents (i.e., size), image_rotation and image_mirror to C API - Add newtypes for PropertyIndex and ItemId - Store ipma with the nested structure it has in the file rather than flattening it; this facilitates validation (especially of transform ordering) - Simplify mp4parse_avif_get_image to make it safer and eliminate the need for Mp4parseAvifImage to implement Default - Add mp4parse_avif_get_image output to dump example - Add AV1_AVIF_CORRUPT_IMAGES to skip bad upstream examples (see AOMediaCodec/av1-avif#150) - Various testing improvements Note this removes clap code because it's preferable to add that support all together and this change is already big enough.
baumanj
added a commit
to mozilla/mp4parse-rust
that referenced
this issue
May 25, 2021
The main change is adding support for the mirroring (imir) and rotation (irot) transformations. Additional changes include: - Rename existing AvifItem → IsobmffItem since it isn't AVIF-specific - Rename AvifImage → Mp4parseAvifImage (for consistency with the C API) - Create AvifItem for more specific use cases - Expose spatial_extents (i.e., size), image_rotation and image_mirror to C API - Add newtypes for PropertyIndex and ItemId - Store ipma with the nested structure it has in the file rather than flattening it; this facilitates validation (especially of transform ordering) - Simplify mp4parse_avif_get_image to make it safer and eliminate the need for Mp4parseAvifImage to implement Default - Add mp4parse_avif_get_image output to dump example - Add AV1_AVIF_CORRUPT_IMAGES to skip bad upstream examples (see AOMediaCodec/av1-avif#150) - Various testing improvements Note this removes clap code because it's preferable to add that support all together and this change is already big enough.
Merged
This should now be fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All 5 of the files under https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles which use the
CleanApertureBox
(clap
) are invalid.Per ISOBMFF (ISO 14496-12:2020) § 12.1.4.1
Applying these formuæ show that the lines of the clean aperture do not fall on integer pixels. Take
testFiles/Microsoft/Chimera_10bit_cropped_to_1920x1008.avif. Loading this file in MP4Box.js shows the relevant inputs:
ImageSpatialExtents
(ispe
) andCleanApertureBox
(clap
) undermeta::iprp::ipco
:ispe
image_width | 1920
image_height | 1080
clap
cleanApertureWidthN | 1920
cleanApertureWidthD | 1
cleanApertureHeightN | 1008
cleanApertureHeightD | 1
horizOffN | 1
horizOffD | 2
vertOffN | 1
vertOffD | 2
Calculating the vertical clean aperture lines:
A quick test is that if the length of the image dimension and the crop dimension have the same parity, the offset in that dimension must be a while number. If they have opposite parity, the offset must be a half pixel value. The above example fails because 1920 and 1920 are both even, but 1/2 is not a whole number.
There are similar issues with the rest of these files as well:
The text was updated successfully, but these errors were encountered: