Skip to content

Commit

Permalink
fn fguv_32x32xn_rust: Fix a bd.iclip_pixel call in the `add_noise…
Browse files Browse the repository at this point in the history
…_uv` closure (#564)
  • Loading branch information
kkysen authored Nov 15, 2023
2 parents 6a37eb6 + d0d8977 commit 1795a10
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/filmgrain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,11 +785,11 @@ unsafe fn fguv_32x32xn_rust<BD: BitDepth>(
if !data.chroma_scaling_from_luma {
let combined = avg.as_::<c_int>() * data.uv_luma_mult[uv]
+ (*src).as_::<c_int>() * data.uv_mult[uv];
val = iclip(
(combined >> 6) + data.uv_offset[uv] * ((1 as c_int) << bitdepth_min_8),
0,
bd.bitdepth_max().as_::<c_int>(),
);
val = bd
.iclip_pixel(
(combined >> 6) + data.uv_offset[uv] * ((1 as c_int) << bitdepth_min_8),
)
.as_::<c_int>();
}
// `val` isn't out of bounds, so we can
// eliminate extra panicking code by bit-truncating `val`.
Expand Down

0 comments on commit 1795a10

Please sign in to comment.