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

Set lossless mode on alpha channel when encoding rav1e, when supported #19

Closed
joedrago opened this issue Oct 30, 2019 · 7 comments
Closed

Comments

@joedrago
Copy link
Collaborator

It doesn't appear rav1e has a lossless flag on encode:

xiph/rav1e#151

When this is added, hook up alpha encoding to always use it, and enable it when QP[0,0] is passed in for color as well.

@cryptomilk
Copy link
Contributor

Well, what could be done, is that you add a codec flag SUPPORTS_LOSSLESS. And based on that flag you select the available codec if you want to use lossless.

@novomesk
Copy link
Contributor

novomesk commented Mar 3, 2020

I understand that libavif always use highest quality (~lossless) for alpha channel.
However one of our users observed that HEIC uses various levels of quality also for the alpha channel, so in some circumstances HEIC achieves smaller files (lower alpha quality):
https://www.reddit.com/r/AV1/comments/fccpge/avif_alpha_compression/
Some people might believe that HEIC compress significantly better.
What do you think, would it be good to have separate Quantizer settings for the alpha channel?

@joedrago
Copy link
Collaborator Author

joedrago commented Mar 3, 2020

libavif spends 0 bytes on alpha for a fully opaque alpha channel, and I think the alpha payload on a uniform lossless alpha channel is maybe 50 bytes (top-of-head).

My opinion is any other alpha channel (masks, gradients, vignettes, etc) are a huge mistake to encode lossy as you will see the artifacts of it in the oddest ways, but as long as the alpha QP defaults are lossless, I don't mind exposing an option to users.

@novomesk
Copy link
Contributor

novomesk commented Mar 3, 2020

I agree, the default for alpha must remain lossless.
How it is going to look like?
int maxAlphaQuantizer;
in avifEncoder?

@joedrago
Copy link
Collaborator Author

joedrago commented Mar 3, 2020 via email

@joedrago
Copy link
Collaborator Author

joedrago commented Mar 3, 2020

I added these today.

56fa2bc

@joedrago joedrago closed this as completed Mar 3, 2020
@joedrago
Copy link
Collaborator Author

joedrago commented Mar 3, 2020

I decided to not leave a big comment in that the default is lossless for both color and alpha anyway, and people can decide for themselves which artifacts they want to live with.

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

3 participants