A couple recoverymap fixes.
Fix decoding of P010 narrow range code points. Also fix scaling for
input to OETF during application of the map.
NOTE: tests pass, although there is still an expected failure for
encoding against just P010 input (API-0), sine toneMap() isn't
implemented yet.
Bug: 252835416, 261479255
Test: libjpegrecoverymap_test passes
Change-Id: Ibfd036c6c0cd55de7c5886e32fff69f461cf45d9
diff --git a/libs/jpegrecoverymap/tests/recoverymapmath_test.cpp b/libs/jpegrecoverymap/tests/recoverymapmath_test.cpp
index 169201c..f8dd490 100644
--- a/libs/jpegrecoverymap/tests/recoverymapmath_test.cpp
+++ b/libs/jpegrecoverymap/tests/recoverymapmath_test.cpp
@@ -36,9 +36,9 @@
}
Color P010(uint16_t y, uint16_t u, uint16_t v) {
- return {{{ static_cast<float>(y) / 940.0f,
- (static_cast<float>(u) - 64.0f) / 940.0f - 0.5f,
- (static_cast<float>(v) - 64.0f) / 940.0f - 0.5f }}};
+ return {{{ (static_cast<float>(y) - 64.0f) / 876.0f,
+ (static_cast<float>(u) - 64.0f) / 896.0f - 0.5f,
+ (static_cast<float>(v) - 64.0f) / 896.0f - 0.5f }}};
}
float Map(uint8_t e) {
@@ -821,7 +821,6 @@
bt2100Luminance(RgbBlue()) * kPqMaxNits, LuminanceEpsilon());
}
-//Color Recover(Color yuv_gamma, float recovery, float range_scaling_factor) {
TEST_F(RecoveryMapMathTest, ApplyMap) {
EXPECT_RGB_EQ(Recover(YuvWhite(), 1.0f, 8.0f),
RgbWhite() * 8.0f);