diff options
| author | 2022-11-08 21:37:39 +0000 | |
|---|---|---|
| committer | 2022-11-08 21:37:39 +0000 | |
| commit | 361bd81e4ddca6ecb7d5780f66425123ed02e514 (patch) | |
| tree | 59d22468482cd995486db239df02d716682a2853 | |
| parent | f05289e3b9397ea310069bbb6a3f7e9f1f90da60 (diff) | |
| parent | 95cbb9fb54bfd588c73e8fb68e724cdeb285405f (diff) | |
Merge "libjpegrecoverymap: refactor encode APIs"
| -rw-r--r-- | libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h | 15 | ||||
| -rw-r--r-- | libs/jpegrecoverymap/recoverymap.cpp | 12 |
2 files changed, 7 insertions, 20 deletions
diff --git a/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h b/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h index 941b0eace2..b2ca481aa7 100644 --- a/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h +++ b/libs/jpegrecoverymap/include/jpegrecoverymap/recoverymap.h @@ -82,16 +82,13 @@ public: * @param quality target quality of the JPEG encoding, must be in range of 0-100 where 100 is * the highest quality * @param exif pointer to the exif metadata. - * @param hdr_ratio HDR ratio. If not configured, this value will be calculated by the JPEG/R - * encoder. * @return NO_ERROR if encoding succeeds, error code if error occurs. */ status_t encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, jr_uncompressed_ptr uncompressed_yuv_420_image, jr_compressed_ptr dest, int quality, - jr_exif_ptr exif, - float hdr_ratio = 0.0f); + jr_exif_ptr exif); /* * Compress JPEGR image from 10-bit HDR YUV, 8-bit SDR YUV and compressed 8-bit JPEG. @@ -104,15 +101,12 @@ public: * @param uncompressed_yuv_420_image uncompressed SDR image in YUV_420 color format * @param compressed_jpeg_image compressed 8-bit JPEG image * @param dest destination of the compressed JPEGR image - * @param hdr_ratio HDR ratio. If not configured, this value will be calculated by the JPEG/R - * encoder. * @return NO_ERROR if encoding succeeds, error code if error occurs. */ status_t encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, jr_uncompressed_ptr uncompressed_yuv_420_image, jr_compressed_ptr compressed_jpeg_image, - jr_compressed_ptr dest, - float hdr_ratio = 0.0f); + jr_compressed_ptr dest); /* * Compress JPEGR image from 10-bit HDR YUV and 8-bit SDR YUV. @@ -125,14 +119,11 @@ public: * @param uncompressed_p010_image uncompressed HDR image in P010 color format * @param compressed_jpeg_image compressed 8-bit JPEG image * @param dest destination of the compressed JPEGR image - * @param hdr_ratio HDR ratio. If not configured, this value will be calculated by the JPEG/R - * encoder. * @return NO_ERROR if encoding succeeds, error code if error occurs. */ status_t encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, jr_compressed_ptr compressed_jpeg_image, - jr_compressed_ptr dest, - float hdr_ratio = 0.0f); + jr_compressed_ptr dest); /* * Decompress JPEGR image. diff --git a/libs/jpegrecoverymap/recoverymap.cpp b/libs/jpegrecoverymap/recoverymap.cpp index b79db1a04b..bd16a68b0d 100644 --- a/libs/jpegrecoverymap/recoverymap.cpp +++ b/libs/jpegrecoverymap/recoverymap.cpp @@ -83,8 +83,7 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, jr_uncompressed_ptr uncompressed_yuv_420_image, jr_compressed_ptr dest, int quality, - jr_exif_ptr /* exif */, - float /* hdr_ratio */) { + jr_exif_ptr /* exif */) { if (uncompressed_p010_image == nullptr || uncompressed_yuv_420_image == nullptr || dest == nullptr) { @@ -114,11 +113,10 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, JPEGR_CHECK(compressRecoveryMap(&map, &compressed_map)); JpegEncoder jpeg_encoder; - // TODO: what quality to use? // TODO: ICC data - need color space information if (!jpeg_encoder.compressImage(uncompressed_yuv_420_image->data, uncompressed_yuv_420_image->width, - uncompressed_yuv_420_image->height, 95, nullptr, 0)) { + uncompressed_yuv_420_image->height, quality, nullptr, 0)) { return ERROR_JPEGR_ENCODE_ERROR; } jpegr_compressed_struct jpeg; @@ -133,8 +131,7 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, jr_uncompressed_ptr uncompressed_yuv_420_image, jr_compressed_ptr compressed_jpeg_image, - jr_compressed_ptr dest, - float /* hdr_ratio */) { + jr_compressed_ptr dest) { if (uncompressed_p010_image == nullptr || uncompressed_yuv_420_image == nullptr || compressed_jpeg_image == nullptr @@ -167,8 +164,7 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, jr_compressed_ptr compressed_jpeg_image, - jr_compressed_ptr dest, - float /* hdr_ratio */) { + jr_compressed_ptr dest) { if (uncompressed_p010_image == nullptr || compressed_jpeg_image == nullptr || dest == nullptr) { |