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

Can alpha or depth image have different size to a primary image? #68

Closed
ledyba-z opened this issue Feb 24, 2020 · 6 comments
Closed

Can alpha or depth image have different size to a primary image? #68

ledyba-z opened this issue Feb 24, 2020 · 6 comments

Comments

@ledyba-z
Copy link
Contributor

According to doc, there is no constraint about alpha or depth image's sizes.

Can alpha or depth image have different size to a primary image? As an decoder developer, I hope primary image's size and alpha image's size must be the same..

@aklemets
Copy link
Contributor

They can be different. Section 6.7 of the MIAF specification says this:

If both a master image and an associated alpha plane are provided as inputs to the processing model, the following applies:
— When the width or the height of the alpha plane differs from the width or the height of the master image, respectively, the alpha plane is resized to have the same width and height as those of the master image.

The following note also appears in the glossary in section 3.1:

Note 1 to entry: When the resolution of an alpha plane differs from that of the master image, MIAF renderers are expected to rescale the alpha plane to the resolution of the master image, but the rescaling operation is not specified exactly and thus the exact behaviour of different MIAF renderer implementations can differ.

@ledyba-z
Copy link
Contributor Author

@aklemets Thanks to quick response!(And sorry to miss it...)

I have an additional question. How about bits per component? For example, can I attach 12bit (alpha or depth) image(s) to a 8bit RGB image?

@aklemets
Copy link
Contributor

That seems to be allowed. The spec does not mandate a particular bit depth for alpha. But I would expect the bit depth to be constrained by the profile. Let's say the file is labeled with a profile that allows up to 10-bit images. Then 8 and 10 bits would be allowed for the alpha plane, but 12 would not be allowed in that case. If the file does not adhere to any profile, then anything goes.

The spec only says this about the encoding of the alpha plane:

Depth maps and alpha planes should be encoded in monochrome format (i.e. 4:0:0 chroma format) if possible; if they are encoded in colour, they shall be encoded in a colour format with a luma plane and chroma planes, e.g. as 4:2:0 YCbCr, in which case only the luma plane is relevant, and the chroma planes shall be ignored by the MIAF renderer.

@ledyba-z
Copy link
Contributor Author

ledyba-z commented Mar 2, 2020

@aklemets Thanks! and sorry to be late....

If I understand correctly, there are two AV1 Sequence Headers for a primary image and for an alpha image in the same file. So, it is possible to make an image with different profiles, such as an image which contains 8bit primary image (profile=0) and 12-bit alpha image (profile=2), isn't it?

(If the file is marked as MA1B or MA1A, I agree that the profile of alpha image also be restricted)

@aklemets
Copy link
Contributor

aklemets commented Mar 3, 2020

Yes, you can have an image where the main image is 8 bits and the alpha plane is 12 bits. It would be a valid file.
But currently, such an AVIF file cannot use any of the defined profiles, since both MA1B and MA1A support at most 10 bits per sample.

ledyba-z added a commit to link-u/cavif that referenced this issue Mar 3, 2020
AVIF profile depends on all of primary, alpha and depth images.

Please see this discussion for details:
AOMediaCodec/av1-avif#68
ledyba-z added a commit to link-u/cavif that referenced this issue Mar 3, 2020
AVIF profile depends on all of primary, alpha and depth images.

Please see this discussion for details:
AOMediaCodec/av1-avif#68
@ledyba-z
Copy link
Contributor Author

ledyba-z commented Mar 3, 2020

I understand (and I implemented that to cavif).
Thank you for answering!

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

No branches or pull requests

2 participants