Skip to content

Commit ae65aea

Browse files
committed
Drop % hacks to improve readability since they don't seem to affect performance
1 parent 9b9b687 commit ae65aea

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/vp8.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,9 +1669,7 @@ impl<R: Read> Vp8Decoder<R> {
16691669
let mut skip = false;
16701670

16711671
for i in first..16usize {
1672-
// `% 8` is added to eliminate a bounds check.
1673-
// as of rustc 1.82 it's not smart enough to realize all the constant indices are below 8.
1674-
let table = &probs[(COEFF_BANDS[i] % 8) as usize][complexity];
1672+
let table = &probs[COEFF_BANDS[i] as usize][complexity];
16751673

16761674
let token = if !skip {
16771675
reader.read_with_tree(tree, table, 0)?
@@ -1723,8 +1721,7 @@ impl<R: Read> Vp8Decoder<R> {
17231721
abs_value = -abs_value;
17241722
}
17251723

1726-
// % 16 is added to eliminate a bounds check. Same as above.
1727-
block[(ZIGZAG[i] % 16) as usize] =
1724+
block[ZIGZAG[i] as usize] =
17281725
abs_value * i32::from(if ZIGZAG[i] > 0 { acq } else { dcq });
17291726

17301727
has_coefficients = true;

0 commit comments

Comments
 (0)