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

[Do not merge] test dovi tonemapx #404

Closed
wants to merge 2 commits into from
Closed

[Do not merge] test dovi tonemapx #404

wants to merge 2 commits into from

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented Jun 22, 2024

Changes

Issues

+ lms2rgb(c3, c3[0], c3[1], c3[2], s->dovi->linear);
+ lms2rgb(c4, c4[0], c4[1], c4[2], s->dovi->linear);
+
+ r[0] = av_clip_int16(c1[0] * 28672);
Copy link
Member

Choose a reason for hiding this comment

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

This will make the picture look slightly correct, but it won't solve the problem.
r[0] = av_clip_int16((int)(c1[0] * 28672) >> in_sh);

In theory, this will give you the normalized pixel value for p010 input.
pix_val / ((1<<10)-1) => 0.0f~1.0f

But anyway the result of reshaped rgb output is wrong (I commented out tonemap_int16() to check)

This is really weird. I'll check it out again when I have some free time.

Copy link
Member Author

@gnattu gnattu Aug 1, 2024

Choose a reason for hiding this comment

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

I have investigated this a little bit more and found that:

For yuv420p10 inputs, we need to divide by 1023, to get the normalization, but then we convert it back we need to multiple by 65535 to reinterpret it as a full 16bit color. the yuv420p10 inputs does not need to be shifted to low 10bits.

Current reshaping implementation seems to only reshape the intensity correctly and the chromas are not correctly reshaped. Doing CLAMP(s, comp->pivots[0], comp->pivots[comp->num_pivots-1]); on chromas will make all chromas to be a very small number (and mostly zero), the resulting video is mostly black-white. Not doing this the output video will behave like having a blue mask on it.

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