Skip to content

Commit

Permalink
Fix gamma curve
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Jun 16, 2024
1 parent 1d7df85 commit 7b1922e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ workspace = { members = ["src/app"] }

[package]
name = "colorutils-rs"
version = "0.4.4"
version = "0.4.5"
edition = "2021"
description = "High performance utilities for color format handling and conversion."
readme = "README.md"
Expand Down
8 changes: 1 addition & 7 deletions src/neon/gamma_curves.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ pub unsafe fn neon_rec709_to_linear(linear: float32x4_t) -> float32x4_t {

#[inline(always)]
pub unsafe fn neon_pure_gamma_function(gamma: float32x4_t, gamma_constant: f32) -> float32x4_t {
let zero_mask = vceqzq_f32(gamma);
let ones = vdupq_n_f32(1f32);
let one_mask = vcgtq_f32(gamma, ones);
let mut rs = vpowq_n_f32(gamma, gamma_constant);
rs = vbslq_f32(zero_mask, vdupq_n_f32(0f32), rs);
rs = vbslq_f32(one_mask, ones, rs);
rs
vpowq_n_f32(gamma, gamma_constant)
}

#[inline(always)]
Expand Down

0 comments on commit 7b1922e

Please sign in to comment.