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

Commit b82b0ddc authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9769041 from e1788e69 to udc-release

Change-Id: I588b0f53fd37a90c6861860e006f30405c732df2
parents b0d22332 e1788e69
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2066,6 +2066,8 @@ static void DumpstateTelephonyOnly(const std::string& calling_package) {
               SEC_TO_MSEC(10));
    RunDumpsys("DUMPSYS", {"telephony.registry"}, CommandOptions::WithTimeout(90).Build(),
               SEC_TO_MSEC(10));
    RunDumpsys("DUMPSYS", {"isub"}, CommandOptions::WithTimeout(90).Build(),
               SEC_TO_MSEC(10));
    RunDumpsys("DUMPSYS", {"telecom"}, CommandOptions::WithTimeout(90).Build(),
               SEC_TO_MSEC(10));
    if (include_sensitive_info) {
+2 −0
Original line number Diff line number Diff line
@@ -555,6 +555,8 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio
 *                     range in use.
 *
 *                     Must be finite && >= 1.0f
 *
 * Available since API level 34.
 */
void ASurfaceTransaction_setExtendedRangeBrightness(ASurfaceTransaction* transaction,
                                            ASurfaceControl* surface_control,
+5 −1
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ public:
     *
     * @param compressed_jpegr_image compressed JPEGR image.
     * @param dest destination of the uncompressed JPEGR image.
     * @param max_display_boost (optional) the maximum available boost supported by a display
     * @param exif destination of the decoded EXIF metadata. The default value is NULL where the
                   decoder will do nothing about it. If configured not NULL the decoder will write
                   EXIF data into this structure. The format is defined in {@code jpegr_exif_struct}
@@ -234,6 +235,7 @@ public:
     */
    status_t decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
                         jr_uncompressed_ptr dest,
                         float max_display_boost = -1.0f,
                         jr_exif_ptr exif = nullptr,
                         jpegr_output_format output_format = JPEGR_OUTPUT_HDR_LINEAR,
                         jr_uncompressed_ptr recovery_map = nullptr,
@@ -281,6 +283,7 @@ protected:
     * @param output_format flag for setting output color format. if set to
     *                      {@code JPEGR_OUTPUT_SDR}, decoder will only decode the primary image
     *                      which is SDR. Default value is JPEGR_OUTPUT_HDR_LINEAR.
     * @param max_display_boost the maximum available boost supported by a display
     * @param dest reconstructed HDR image
     * @return NO_ERROR if calculation succeeds, error code if error occurs.
     */
@@ -288,6 +291,7 @@ protected:
                              jr_uncompressed_ptr uncompressed_recovery_map,
                              jr_metadata_ptr metadata,
                              jpegr_output_format output_format,
                              float max_display_boost,
                              jr_uncompressed_ptr dest);

private:
+11 −0
Original line number Diff line number Diff line
@@ -135,6 +135,16 @@ struct RecoveryLUT {
    }
  }

  RecoveryLUT(jr_metadata_ptr metadata, float displayBoost) {
    float boostFactor = displayBoost > 0 ? displayBoost / metadata->maxContentBoost : 1.0f;
    for (int idx = 0; idx < kRecoveryFactorNumEntries; idx++) {
      float value = static_cast<float>(idx) / static_cast<float>(kRecoveryFactorNumEntries - 1);
      float logBoost = log2(metadata->minContentBoost) * (1.0f - value)
                     + log2(metadata->maxContentBoost) * value;
      mRecoveryTable[idx] = exp2(logBoost * boostFactor);
    }
  }

  ~RecoveryLUT() {
  }

@@ -357,6 +367,7 @@ uint8_t encodeRecovery(float y_sdr, float y_hdr, jr_metadata_ptr metadata);
 * value, with the given hdr ratio, to the given sdr input in the range [0, 1].
 */
Color applyRecovery(Color e, float recovery, jr_metadata_ptr metadata);
Color applyRecovery(Color e, float recovery, jr_metadata_ptr metadata, float displayBoost);
Color applyRecoveryLUT(Color e, float recovery, RecoveryLUT& recoveryLUT);

/*
+11 −6
Original line number Diff line number Diff line
@@ -330,6 +330,7 @@ status_t JpegR::getJPEGRInfo(jr_compressed_ptr compressed_jpegr_image, jr_info_p
/* Decode API */
status_t JpegR::decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
                            jr_uncompressed_ptr dest,
                            float max_display_boost,
                            jr_exif_ptr exif,
                            jpegr_output_format output_format,
                            jr_uncompressed_ptr recovery_map,
@@ -431,7 +432,7 @@ status_t JpegR::decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
  uncompressed_yuv_420_image.height = jpeg_decoder.getDecompressedImageHeight();

  JPEGR_CHECK(applyRecoveryMap(&uncompressed_yuv_420_image, &map, &jr_metadata, output_format,
                               dest));
                               max_display_boost, dest));
  return NO_ERROR;
}

@@ -667,6 +668,7 @@ status_t JpegR::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_image,
                                 jr_uncompressed_ptr uncompressed_recovery_map,
                                 jr_metadata_ptr metadata,
                                 jpegr_output_format output_format,
                                 float max_display_boost,
                                 jr_uncompressed_ptr dest) {
  if (uncompressed_yuv_420_image == nullptr
   || uncompressed_recovery_map == nullptr
@@ -678,13 +680,15 @@ status_t JpegR::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_image,
  dest->width = uncompressed_yuv_420_image->width;
  dest->height = uncompressed_yuv_420_image->height;
  ShepardsIDW idwTable(kMapDimensionScaleFactor);
  RecoveryLUT recoveryLUT(metadata);
  float display_boost = max_display_boost > 0 ?
          std::min(max_display_boost, metadata->maxContentBoost)
          : metadata->maxContentBoost;
  RecoveryLUT recoveryLUT(metadata, display_boost);

  JobQueue jobQueue;
  std::function<void()> applyRecMap = [uncompressed_yuv_420_image, uncompressed_recovery_map,
                                       metadata, dest, &jobQueue, &idwTable, output_format,
                                       &recoveryLUT]() -> void {
    const float hdr_ratio = metadata->maxContentBoost;
                                       &recoveryLUT, display_boost]() -> void {
    size_t width = uncompressed_yuv_420_image->width;
    size_t height = uncompressed_yuv_420_image->height;

@@ -710,12 +714,13 @@ status_t JpegR::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_image,
          } else {
            recovery = sampleMap(uncompressed_recovery_map, map_scale_factor, x, y, idwTable);
          }

#if USE_APPLY_RECOVERY_LUT
          Color rgb_hdr = applyRecoveryLUT(rgb_sdr, recovery, recoveryLUT);
#else
          Color rgb_hdr = applyRecovery(rgb_sdr, recovery, metadata);
          Color rgb_hdr = applyRecovery(rgb_sdr, recovery, metadata, display_boost);
#endif
          rgb_hdr = rgb_hdr / metadata->maxContentBoost;
          rgb_hdr = rgb_hdr / display_boost;
          size_t pixel_idx = x + y * width;

          switch (output_format) {
Loading