image-rs / jpeg-decoder

JPEG decoder written in Rust
Apache License 2.0
147 stars 88 forks source link

Use the 'Wrapping' integer type instead of wrapping methods in IDCT #144

Closed lovasoa closed 4 years ago

lovasoa commented 4 years ago

The IDCT code is full of wrapping integer arithmetic. This commit changes the code to use std::num::Wrapping instead of i32::wrapping_* methods.

This is a big commit in term of number of lines changed, but this should have absolutely no impact on the generated machine code.

This just makes the IDCT code much easier to read, which should in turn make it easier to optimize.