Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80a1dd74 authored by Nick Deakin's avatar Nick Deakin Committed by Android (Google) Code Review
Browse files

Merge "A couple recoverymap fixes."

parents 2b436dd3 38125336
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -554,7 +554,7 @@ status_t RecoveryMap::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_
      float recovery = sampleMap(uncompressed_recovery_map, kMapDimensionScaleFactor, x, y);
      Color rgb_hdr = applyRecovery(rgb_sdr, recovery, metadata->rangeScalingFactor);

      Color rgb_gamma_hdr = hdrOetf(rgb_hdr);
      Color rgb_gamma_hdr = hdrOetf(rgb_hdr / metadata->rangeScalingFactor);
      uint32_t rgba1010102 = colorToRgba1010102(rgb_gamma_hdr);

      size_t pixel_idx =  x + y * width;
+3 −3
Original line number Diff line number Diff line
@@ -336,9 +336,9 @@ Color getP010Pixel(jr_uncompressed_ptr image, size_t x, size_t y) {
                  >> 6;

  // Conversions include taking narrow-range into account.
  return {{{ static_cast<float>(y_uint) / 940.0f,
             (static_cast<float>(u_uint) - 64.0f) / 940.0f - 0.5f,
             (static_cast<float>(v_uint) - 64.0f) / 940.0f - 0.5f }}};
  return {{{ (static_cast<float>(y_uint) - 64.0f) / 876.0f,
             (static_cast<float>(u_uint) - 64.0f) / 896.0f - 0.5f,
             (static_cast<float>(v_uint) - 64.0f) / 896.0f - 0.5f }}};
}

typedef Color (*getPixelFn)(jr_uncompressed_ptr, size_t, size_t);
+3 −4
Original line number Diff line number Diff line
@@ -36,9 +36,9 @@ public:
  }

  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 @@ TEST_F(RecoveryMapMathTest, GenerateMapLuminancePq) {
              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);