Skip to content

Commit 49f05ab

Browse files
authored
Merge pull request #216 from paolobarbolini/remove-10-bounds
Remove 10 bounds checks from `dequantize_and_idct_block_8x8`
2 parents 3afcdf2 + 5338cd7 commit 49f05ab

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
@@ -142,6 +142,9 @@ fn dequantize_and_idct_block_8x8_inner<'a, I>(
142142
// to encode as 0..255 by adding 128, so we'll add that before the shift
143143
const X_SCALE: i32 = 65536 + (128 << 17);
144144

145+
// eliminate downstream bounds checks
146+
let output_chunk = &mut output_chunk[..8];
147+
145148
// TODO When the minimum rust version supports it
146149
// let [s0, rest @ ..] = chunk;
147150
let (s0, rest) = chunk.split_first().unwrap();

0 commit comments

Comments
 (0)