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
Add AV2 support #1361
Add AV2 support #1361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok, but I'm wondering if this should have an EXPERIMENTAL
define to avoid adding av2 support to the common code unnecessarily. Others might have some thoughts.
|
I didn't look at the code too closely. I have a question about the behavior of |
Yes, that's what I was referring to. Anything in the common code.
Making it explicit provides some documentation for the user and does avoid some code in production builds. It's not common right now, so we can get the group's opinion later. |
That was the intent, yes.
Good point. I guarded a few places with
The code for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i took a first pass at reviewing the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly okay. just a few minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in read.c, write.c and obu.c look fine now. I still haven't looked at codec_avm.c. I will look into it sometime today. Sorry for the delay and thanks for the patience in working through this.
For easier diff of later changes.
Experimental. The AV2 specification is not finalized. Handle av02 image item type and av2C configuration property. Handle av02 track sample format. Add avifavmtest. Disable AV1 tests when all AV1 codecs are disabled. Add presubmit ci-unix-static-av2.yml. libavif can only generate AV2 files if it is built with AVIF_CODEC_AVM set to ON. The avifEncoder API can only output AV2 files if codecChoice is explicitly set to AVIF_CODEC_CHOICE_AVM to avoid mistakes. avifenc can only output AV2 files if --codec=avm is specified to avoid mistakes. aom and avm conflict and cannot be used together in the same libavif binary. Other AV1 codecs can be enabled alongside aom. libavif will decode any AV1 or AV2 file by default as long as the relevant codecs are enabled. The main behavior change for libavif with only AV1 codecs enabled is that before this change, items or tracks of type 'av02' were ignored. After this change, conformant AV1-AVIF files with extra 'av02' items will fail to decode unless avm is enabled. This change allows decoding files with mixed AV1 and AV2 items or tracks (untested because no encoding tool for that). This decision can be changed in the future.
The codecType is now checked in avifDecoderParse() so no need to do it in avifDecoderNextImage(). Add comment.
I rebased this PR.
No worries, it is not urgent. Thanks for your time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. thank you.
// We prefer to simply set the aomImage.planes[] pointers to the plane buffers in 'image'. When | ||
// doing this, we set aomImage.w equal to aomImage.d_w and aomImage.h equal to aomImage.d_h and | ||
// do not "align" aomImage.w and aomImage.h. Unfortunately this exposes a bug in libaom | ||
// (https://crbug.com/aomedia/3113) if chroma is subsampled and image->width or image->height is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this was carried over to avm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. See avm's extend.c vs aom's extend.c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yannis: My review is supplemental because I only checked avif.h, internal.h, and the top-level CMakelists.txt. You can merge this pull request with James and Vignesh's approval.
Experimental. The AV2 specification is not finalized.
Handle
av02
image item type andav2C
configuration property.Handle
av02
track sample format.Add
avifavmtest
.Disable AV1 tests when all AV1 codecs are disabled.
Add presubmit
ci-unix-static-av2.yml
.libavif can only generate AV2 files if it is built with
AVIF_CODEC_AVM
set toON
.The
avifEncoder
API can only output AV2 files ifcodecChoice
is explicitly set toAVIF_CODEC_CHOICE_AVM
to avoid mistakes.avifenc
can only output AV2 files if--codec=avm
is specified to avoid mistakes.aom and avm conflict and cannot be used together in the same libavif binary. Other AV1 codecs can be enabled alongside aom.
libavif will decode any AV1 or AV2 file by default as long as the relevant codecs are enabled. The main behavior change for libavif with only AV1 codecs enabled is that before this change, items or tracks of type
av02
were ignored. After this change, conformant AV1-AVIF files with extraav02
items will fail to decode unless avm is enabled.This change allows decoding files with mixed AV1 and AV2 items or tracks (untested because no encoding tool for that). This decision can be changed in the future.
Note: The first commit exists just to reduce diffs. Please review the second and third commits.