-
Notifications
You must be signed in to change notification settings - Fork 48
revisit gainmapmath constants #227
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
Conversation
|
Does this change affects the entries of ICC box |
096dabf to
9de27e7
Compare
9456267 to
05163a6
Compare
- luminance function for p3 gamut is using weights of DCI P3 instead of Display P3. This is corrected. Accordingly, the gamut conversions involving Display P3 are updated. - Increased precision of some constants used in csc, oetf and eotf functions. fixes google#177 Test: ./ultrahdr_unit_test Change-Id: Iec77b3d24adb7ad887a8f53d805eecc0c0160f28
icc tag does not signal matrix coefficients directly. They signal color primaries. From these color primaries, one can derive the matrix coefficients needed for yuv to rgb conversion using, equations 39-44 of itu h273. In this process bradford chroma adaptation matrix also plays a role. The current change does not do all this. Instead it does a look up mapping of icc tag to color gamut. Successfull harvesting of matrix coefficients from icc tags is dependent on the color gamut dictionary maintained internally. For now, this is okish. If gamut map fails, we will default to srgb color space as per iso 21496-1 sec c.4.4 Test: ./ultrahdr_unit_test Change-Id: I41cb5013c5d29d5ebaa535a78e45a9b487a3c122
Test: ./ultrahdr_app Co-authored-by: Vivek R Jadhav <vivek.jadhav@ittiam.com> Change-Id: I0155a1dc043f3c3e0493e04e5a6eabe160756476
| private: | ||
| static constexpr uint32_t kTrcTableSize = 65; | ||
| static constexpr uint32_t kGridSize = 17; | ||
| static constexpr uint32_t kGridSize = 11; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder where is this change coming from. The original value is aligned with skia: https://cs.android.com/android/platform/superproject/+/android14-qpr3-release:frameworks/native/libs/ultrahdr/include/ultrahdr/icc.h;l=218?q=kGridSize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //#if (defined(UHDR_ENABLE_INTRINSICS) && (defined(__ARM_NEON__) || defined(__ARM_NEON))) | ||
| // UHDR_ERR_CHECK( | ||
| // convertYuv_neon(sdr_intent_yuv, sdr_intent_yuv->cg, (uhdr_color_gamut_t)UHDR_CG_BT_601)); | ||
| //#else | ||
| // UHDR_ERR_CHECK( | ||
| // convertYuv(sdr_intent_yuv, sdr_intent_yuv->cg, (uhdr_color_gamut_t)UHDR_CG_BT_601)); | ||
| //#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we intended to convert YUV. Is there any reason this was removed?
| return status; | ||
| case UHDR_CG_DISPLAY_P3: | ||
| coeffs_ptr = &kYuvBt709ToBt601; | ||
| coeffs_ptr = &kYuvBt709ToDisplayP3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We intended to use BT601 YUV encoding here
DichenZhang1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest separating this change into two: changes before 10/29 to be the first one, and changes after 10/29 to be the second one. Thank you!
Test: ./ultrahdr_unit_test