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

Add avifRange ranges in avif.h #2120

Merged
merged 3 commits into from
Jun 4, 2024
Merged

Conversation

y-guyon
Copy link
Collaborator

@y-guyon y-guyon commented Apr 17, 2024

Taken from libaom.

[skip ci]

Taken from libaom.

[skip ci]
/**<- Y [256..3760], UV [256..3840] (bit depth 12) */
AVIF_RANGE_FULL = 1 /**<- YUV/RGB [0..255] (bit depth 8) */
/**<- YUV/RGB [0..1023] (bit depth 10) */
/**<- YUV/RGB [0..4095] (bit depth 12) */
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is better to remove "/RGB" from this comment. I think "/RGB" means that R, G, B are always in full range, but this is not obvious from reading the comment.

Note: There is a special case for limited range: Identity (MatrixCoefficients=0) and YCgCo (MatrixCoefficients=8). In this special case, the limited range is the same for all three channels (G,B,R, or Y,Cg,Co).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we can write the comments as follows:

    AVIF_RANGE_LIMITED = 0, /**<- Y  [16..235],  UV  [16..240]  (bit depth 8) */
                            /**<- Y  [64..940],  UV  [64..960]  (bit depth 10) */
                            /**<- Y [256..3760], UV [256..3840] (bit depth 12) */
    AVIF_RANGE_FULL = 1     /**<- [0..255]  (bit depth 8) */
                            /**<- [0..1023] (bit depth 10) */
                            /**<- [0..4095] (bit depth 12) */

And add another comment that says "avifRange is not applicable to RGB and alpha planes." or "avifRange is only applicable to YUV planes. RGB and alpha planes are always full range."

@y-guyon y-guyon requested a review from wantehchang May 13, 2024 08:52
@y-guyon y-guyon requested a review from vrabaud May 22, 2024 08:04
include/avif/avif.h Outdated Show resolved Hide resolved
@y-guyon y-guyon merged commit 7b80b01 into AOMediaCodec:main Jun 4, 2024
12 checks passed
@y-guyon y-guyon deleted the avifrange_ranges branch June 4, 2024 08:54
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.

None yet

2 participants