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

Improve selection of HDR content #632

Merged

Conversation

shssoichiro
Copy link
Collaborator

Currently this only applies to grain synth generation,
but the prior implementation of HDR detection only looked at the props
on the input video. Those may not necessarily be set correctly even if
the user is encoding to HDR, so we want to prioritize looking at the
encoder params, then fallback to checking the input if the user has not
set a transfer characteristic on the encoder.

return Ok(TransferFunction::SMPTE2084);
}
if enc_params.iter().any(|p| {
let p = p.to_lowercase();
Copy link
Collaborator

Choose a reason for hiding this comment

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

My only (extremely minor) nitpick is that these 2 to_lowercase function calls could instead be to_ascii_lowercase, which are theoretically a lot faster because they don't have to load values from a huge utf8 lookup table.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Technically true. It won't affect overall performance as this function is called at most twice per encode, but since it's still in PR might as well make it the better version.

Currently this only applies to grain synth generation,
but the prior implementation of HDR detection only looked at the props
on the input video. Those may not necessarily be set correctly even if
the user is encoding to HDR, so we want to prioritize looking at the
encoder params, then fallback to checking the input if the user has not
set a transfer characteristic on the encoder.
@mergify mergify bot merged commit 460fa3c into master-of-zen:master May 16, 2022
@shssoichiro shssoichiro deleted the improve-hdr-input-detection branch May 16, 2022 18:39
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