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

Significantly simplify gain map API #2481

Merged
merged 7 commits into from
Oct 24, 2024
Merged

Conversation

maryla-uc
Copy link
Collaborator

  • Remove enableParsingGainMapMetadata: gain map metadata is always parsed now
  • Replace enableDecodingGainMap and ignoreColorAndAlpha with imageContentToDecode bit field
  • Remove gainMapPresent, the same information is available by checking decoder->image->gainMap != NULL

@maryla-uc maryla-uc requested a review from wantehchang October 18, 2024 11:50
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.

Maryla: Thanks a lot for the pull request! I only reviewed the changes to avif.h. Please see my comments in CHANGLOG.md and at avif.h:1182.

include/avif/avif.h Outdated Show resolved Hide resolved
include/avif/avif.h Outdated Show resolved Hide resolved
include/avif/avif.h Outdated Show resolved Hide resolved
apps/avifgainmaputil/printmetadata_command.cc Show resolved Hide resolved
include/avif/avif.h Outdated Show resolved Hide resolved
include/avif/avif.h Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
src/read.c Show resolved Hide resolved
include/avif/avif.h 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.

LGTM. Thanks!

I didn't check the changes related to grid images in src/read.c. It would be good to ask Yannis or Vignesh check those changes.

src/read.c Outdated Show resolved Hide resolved
src/read.c Outdated

// If the item is a grid, copies the codec type property (av1C or av2C) from the first grid tile to the grid item.
// Also checks that all tiles have the same codec type and that it's valid.
static avifResult avifAdoptGridTileCodecTypeIfNeeded(avifDecoder * decoder, avifDecoderItem * item, const avifTileInfo * info)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Same here, this function probably should be named "avifDecoderAdoptGridTileCodecTypeIfNeeded".

tests/gtest/avifdecodetest.cc Show resolved Hide resolved
tests/gtest/avif_fuzztest_helpers.h Outdated Show resolved Hide resolved
tests/gtest/avif_fuzztest_helpers.h Show resolved Hide resolved
@maryla-uc maryla-uc requested a review from y-guyon October 24, 2024 08:53
Gain map metadata is now alwayas parsed (when gain map code is enabled
at compile time).

Ideally, gain map metadata should be stored towards the beginning of the file
(since it's in the 'mdat' part).
It can be replaced with a check that image->gainMap is not NULL.
And rename to AVIF_IMAGE_CONTENT_...
@maryla-uc maryla-uc merged commit 094d841 into AOMediaCodec:main Oct 24, 2024
17 checks passed
copybara-service bot pushed a commit to webmproject/CrabbyAvif that referenced this pull request Oct 24, 2024
Following changes in libavif AOMediaCodec/libavif#2481

PiperOrigin-RevId: 689374767
copybara-service bot pushed a commit to webmproject/CrabbyAvif that referenced this pull request Oct 24, 2024
Following changes in libavif AOMediaCodec/libavif#2481

PiperOrigin-RevId: 689374767
copybara-service bot pushed a commit to webmproject/CrabbyAvif that referenced this pull request Oct 25, 2024
Following changes in libavif AOMediaCodec/libavif#2481

PiperOrigin-RevId: 689374767
copybara-service bot pushed a commit to webmproject/CrabbyAvif that referenced this pull request Oct 29, 2024
Following changes in libavif AOMediaCodec/libavif#2481

PiperOrigin-RevId: 689374767
copybara-service bot pushed a commit to webmproject/CrabbyAvif that referenced this pull request Oct 29, 2024
Following changes in libavif AOMediaCodec/libavif#2481

PiperOrigin-RevId: 689374767
copybara-service bot pushed a commit to webmproject/CrabbyAvif that referenced this pull request Oct 29, 2024
Following changes in libavif AOMediaCodec/libavif#2481

PiperOrigin-RevId: 689374767
copybara-service bot pushed a commit to webmproject/CrabbyAvif that referenced this pull request Oct 29, 2024
Following changes in libavif AOMediaCodec/libavif#2481

PiperOrigin-RevId: 690987236
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.

3 participants