Skip to content

Commit

Permalink
Update jpeg-xl to v0.10.1
Browse files Browse the repository at this point in the history
Summary: This diff, and the stack underneath, updates jpeg-xl to version 0.10.1.

Reviewed By: erikandre

Differential Revision: D54665141

fbshipit-source-id: 2491f513704e120541f000d6f301cc4cd10fb3bc
  • Loading branch information
Georges Berenger authored and facebook-github-bot committed Mar 13, 2024
1 parent 9110efa commit e24fc39
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions vrs/utils/PixelFrameJxl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@

#ifdef JXL_IS_AVAILABLE

/// About Jpeg-XL support
/// This code requires Jpeg-XL v0.7 (won't compile with v0.61)
/// About jpeg-xl support
/// This code requires jpeg-xl v0.10
/// Jpeg-XL is support is still considered experimental, as the API still changes in breaking ways,
/// which is why support is disabled by default in VRS OSS.
/// As of Sep 23, 2022, get jpg-xl from https://github.com/libjxl and use the v0.7.x branch

#include <vrs/helpers/MemBuffer.h>

Expand Down Expand Up @@ -101,9 +100,6 @@ JxlEncoder* getThreadJxlEncoder() {
}

inline float percent_to_butteraugli_distance(float quality) {
// Make quality behave more like jpg's quality setting accoding to MS-SSIM. Very empirical.
float to100 = 100 - quality;
quality = 100 - to100 / 4;
// Quality calculation inspired by cjxl.cc
// Extended to work meaningfully between 99.99 and 99.999, so with quality = 99.999,
// the file size is now getting close to that of lossless.
Expand Down Expand Up @@ -172,7 +168,7 @@ bool PixelFrame::readJxlFrame(const vector<uint8_t>& jxlBuf, bool decodePixels)
case JXL_DEC_COLOR_ENCODING: {
JxlColorEncoding colorEncoding;
DEC_CHECK(JxlDecoderGetColorAsEncodedProfile(
dec, &format, JXL_COLOR_PROFILE_TARGET_ORIGINAL, &colorEncoding));
dec, JXL_COLOR_PROFILE_TARGET_ORIGINAL, &colorEncoding));
DEC_CHECK(JxlDecoderSetPreferredColorProfile(dec, &colorEncoding));
} break;

Expand Down

0 comments on commit e24fc39

Please sign in to comment.