Skip to content

Commit

Permalink
Increase tolerance for linear_to_srgb_fast_arb.
Browse files Browse the repository at this point in the history
  • Loading branch information
veluca93 committed Jan 1, 2025
1 parent e235367 commit 7603191
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jxl/src/color/tf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SRGB_POWTABLE_LOWER: [u8; 16] = [
];

/// Converts the linear samples with the sRGB transfer curve.
// Fast linear to sRGB conversion, ported from libjxl. Max error ~1.2e-4
// Fast linear to sRGB conversion, ported from libjxl. Max error ~1.7e-4
pub fn linear_to_srgb_fast(samples: &mut [f32]) {
for s in samples {
let v = s.to_bits() & 0x7fff_ffff;
Expand Down Expand Up @@ -146,7 +146,7 @@ mod test {

linear_to_srgb(&mut samples);
linear_to_srgb_fast(&mut fast);
assert_all_almost_eq!(&samples, &fast, 1.2e-4);
assert_all_almost_eq!(&samples, &fast, 1.7e-4);
Ok(())
});
}
Expand Down

0 comments on commit 7603191

Please sign in to comment.