Skip to content
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

Fix out-of-order dimg grid associations #2312

Merged
merged 11 commits into from
Jul 26, 2024
Merged

Conversation

y-guyon
Copy link
Collaborator

@y-guyon y-guyon commented Jul 23, 2024

Fixes #2311.

A simpler alternative would have been to refuse to decode out-of-order dimg associations.

@y-guyon y-guyon force-pushed the dimg_order branch 5 times, most recently from b74310c to 90e9bfa Compare July 23, 2024 15:49
@y-guyon
Copy link
Collaborator Author

y-guyon commented Jul 23, 2024

Note that the current implementation may not be as optimal as it could be for the following scenario:

  • A part of an encoded grid image with out-of-order dimg associations is received at timeA
  • libavif decodes all the in-order numO tiles among the numA available tiles
  • The rest of the file is received at timeB
  • libavif decodes all of the remaining tiles
  • the image is fully decoded with a delay corresponding to min(timeB - timeA, timeRequiredToDecodeTheNumOTiles - timeRequiredToDecodeTheNumATiles) compared to eager decoding of every available tile at any time

This only concerns the unlikely out-of-order dimg associations use case and is not worth the fixing effort in my opinion.

Copy link
Collaborator

@vigneshvg vigneshvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will take a look at the rest of the PR in a while.

tests/gtest/avifdimgtest.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@wantehchang wantehchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yannis: Here is my first round of review. I saved some style/preference comments for the next round. I did not review the new avifdimgtest.cc file, but I reviewed the changes to read.c carefully.

Please check my first comment in read.c (marked with "IMPORTANT") carefully. If I am right, this pull request needs more work.

src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
tests/CMakeLists.txt Outdated Show resolved Hide resolved
src/read.c Show resolved Hide resolved
@vrabaud vrabaud modified the milestone: v1.1.1 Jul 24, 2024
Copy link
Collaborator

@wantehchang wantehchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks. Please evaluate the optional suggestions and only accept the ones you agree with. There are two important changes that should be made.

src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated Show resolved Hide resolved
@y-guyon y-guyon merged commit 40b5589 into AOMediaCodec:main Jul 26, 2024
30 checks passed
@y-guyon y-guyon deleted the dimg_order branch July 26, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grid image arranges tiles in wrong order if IDs in the iref are not sequential
4 participants