Skip to content

Commit

Permalink
Remove unnecessary .max(255)
Browse files Browse the repository at this point in the history
This is a `u8` which has a max value of 255
  • Loading branch information
FreezyLemon committed Sep 14, 2024
1 parent eca2b49 commit a1bfdd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ impl QuantizerParameters {

// delta_q only gets 6 bits + a sign bit, so it can differ by 63 at most.
let min_qi = base_q_idx.saturating_sub(63).max(1);
let max_qi = base_q_idx.saturating_add(63).min(255);
let max_qi = base_q_idx.saturating_add(63);
let clamp_qi = |qi: u8| qi.clamp(min_qi, max_qi);

QuantizerParameters {
Expand Down

0 comments on commit a1bfdd0

Please sign in to comment.