image-rs / jpeg-decoder

JPEG decoder written in Rust -- currently in maintenance mode
Apache License 2.0
148 stars 89 forks source link

Decoded data contains imperceptible errors #91

Closed tdryer closed 6 years ago

tdryer commented 6 years ago

Why does reftest allow a pixel component to be off by 2 from the reference? Changing it to 0 makes the test fail, indicating the output does not exactly match the reference.

I noticed this because I was trying to check the output of my own program against a reference, but the difference introduced by jpeg-decoder caused it to fail.

kaksmet commented 6 years ago

The reference images have been created by decoding the jpegs with libjpeg-turbo and then converting to png. jpeg-decoder's output can differ slightly from libjpeg-turbo's because the upsampling implementation is not the same. But that is acceptable since the JPEG specification doesn't specify what upsampling algorithm should be used, so implementations are free to do whatever they want.

tdryer commented 6 years ago

Thanks for the explanation.