-
Notifications
You must be signed in to change notification settings - Fork 212
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
Allow YCgCoRe and YCgCoRo decoding. #2078
Conversation
I rebased and updated the enums that indeed got changed. |
H.273 V4 was published:
This PR can be merged. I would like to also remove the encoding compile flag:
|
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. Thanks!
CMakeLists.txt
Outdated
@@ -64,7 +64,7 @@ option(BUILD_SHARED_LIBS "Build shared avif library" ON) | |||
|
|||
option(AVIF_ENABLE_WERROR "Treat all compiler warnings as errors" OFF) | |||
|
|||
option(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R "Enable experimental YCgCo-R matrix code" OFF) | |||
option(AVIF_ENABLE_YCGCO_R_ENCODING "Enable YCgCo-R matrix codes for encoding" OFF) |
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.
It would be good to add a comment to explain why this option is disabled by default and the risk of enabling it.
I guess we are concerned that there isn't widespread decoder-side support initially?
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.
It would be good to add a comment to explain why this option is disabled by default and the risk of enabling it.
Would it be enough to do that on avifenc --help
and print a warning on avifenc --cicp x/x/16
? See #2078 (comment).
I guess we are concerned that there isn't widespread decoder-side support initially?
Yes.
What happens when decoding such files with current versions of libavif and libheif with all compile flags set to OFF?
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.
Right now, it depends on what you do with it. E.g., using avifdec: outputing to a png creates an error but not outputing to a y4m ... That should be fixed first.
I just saw Yannis's comment:
I agree with Yannis's suggestion. I also think we are being a little too cautious. Maybe we can note in a comment the date of addition to alert the users, something like this:
Also, if the decoding application doesn't support YCgCo-Re, the result is either a failure or noticeable wrong colors. So the lack of support will be detected quickly. |
8e37b0a
to
b14ca3a
Compare
YCgCo encoding is now enabled. I added a test for it. |
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.
Should there be a warning when using avifenc --cicp x/x/16
? Such as "YCgCo-Ro was added in libavif 1.2.0 (Feb 2025) and will render incorrectly in older implementations, use at your own risk" for users of avifenc
that do not look at avif.h.
Yannis: The reason you gave before, "libavif v1.2.0 will likely stick for a long time", is also a reason against having |
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. Thanks!
Now that the https://www.itu.int/rec/T-REC-H.273 update is out published, we can allow for decoding by default. Encoding will come once decoding is sufficiently deployed. This is the first phase of AOMediaCodec#2077
Now that the https://www.itu.int/rec/T-REC-H.273 update is to be published, we can allow for decoding by default.
Encoding will come once decoding is sufficiently deployed.
This is the first phase of
#2077