Skip to content

Commit 5338cd7

Browse files
Remove 10 bounds checks from dequantize_and_idct_block_8x8_inner
1 parent 55a4a9a commit 5338cd7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/idct.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ fn dequantize_and_idct_block_8x8_inner<'a, I>(
145145
// to encode as 0..255 by adding 128, so we'll add that before the shift
146146
const X_SCALE: i32 = 65536 + (128 << 17);
147147

148+
// eliminate downstream bounds checks
149+
let output_chunk = &mut output_chunk[..8];
150+
148151
// TODO When the minimum rust version supports it
149152
// let [s0, rest @ ..] = chunk;
150153
let (s0, rest) = chunk.split_first().unwrap();

0 commit comments

Comments
 (0)