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

Gainmap computation: fix handling of extreme values. #1868

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

maryla-uc
Copy link
Collaborator

Gain map values outside of [-6, +6] were being clamped.

src/gainmap.c Outdated Show resolved Hide resolved
src/gainmap.c Outdated
Comment on lines 344 to 348
const float bucketMin = min;
// Use a bucket range of constant size 12 so that each bucket has a fixed size.
// 12 is an arbitrary empirical value, equivalent to a [-6, +6] range, where
// +6 is roughly equivalent to bringing SDR white to max PQ white (log2(10000/203) ~= 5.62).
const float bucketMax = min + 12;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not use [0:12] rather than [min:min+12]? It seems weird to fix the relative maximum but not the absolute minimum.

Also [-6:+6] is mentioned but the used range is [min:min+12]. Is min expected to be around -6?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was intentional but the intention was not very clear :) I reworked the code to make it clearer hopefully that the idea is to have buckets of fixed size.

Gain map values outside of [-6, +6] were being clamped.
src/gainmap.c Outdated Show resolved Hide resolved
tests/gtest/avifgainmaptest.cc Outdated Show resolved Hide resolved
The idea is to have buckets of fixed size.

Add test.
@maryla-uc maryla-uc merged commit a1eb55d into AOMediaCodec:main Dec 12, 2023
17 checks passed
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.

2 participants