From d0d89771ff7c91fd9a1f5c8e92291aa41738101a Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Thu, 9 Nov 2023 18:31:13 -0800 Subject: [PATCH] `fn fguv_32x32xn_rust`: Fix a `bd.iclip_pixel` call in the `add_noise_uv` closure. --- src/filmgrain.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filmgrain.rs b/src/filmgrain.rs index be47cfffd..52a7a13a1 100644 --- a/src/filmgrain.rs +++ b/src/filmgrain.rs @@ -785,11 +785,11 @@ unsafe fn fguv_32x32xn_rust( if !data.chroma_scaling_from_luma { let combined = avg.as_::() * data.uv_luma_mult[uv] + (*src).as_::() * data.uv_mult[uv]; - val = iclip( - (combined >> 6) + data.uv_offset[uv] * ((1 as c_int) << bitdepth_min_8), - 0, - bd.bitdepth_max().as_::(), - ); + val = bd + .iclip_pixel( + (combined >> 6) + data.uv_offset[uv] * ((1 as c_int) << bitdepth_min_8), + ) + .as_::(); } // `val` isn't out of bounds, so we can // eliminate extra panicking code by bit-truncating `val`.