You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YUV encoding/deconding usually works well enough in fixed-point arithmetic and it is faster than floating point. Therefore, it may be possible to replace current JPEG encoding pipeline with Q16 multiplication. Notably, libjpeg-turbo also done in fixed-point arithmetic, so there will be no significant deviation from almost reference implementation.
However, switching to fixed-point is unlikely to yield significant improvements, there is only a few percent gains in end-to-end encoding.
Getting 2% - 7% over the whole pipeline while improving the accuracy in the process is quite massive. Would you submit a PR with the change to the numeric conversion? Without the benchmarks probably as they won't measure active code, though it'd be nice to refer to them somehow in the evolution. (Quirky idea: maybe you could split that into two commits and then also add a revert of the benchmark addition 😂). Also please do keep the comment with the original coefficients, I think they explain the magic integer coefficients nicely.
YUV encoding/deconding usually works well enough in fixed-point arithmetic and it is faster than floating point. Therefore, it may be possible to replace current JPEG encoding pipeline with Q16 multiplication. Notably, libjpeg-turbo also done in fixed-point arithmetic, so there will be no significant deviation from almost reference implementation.
However, switching to fixed-point is unlikely to yield significant improvements, there is only a few percent gains in end-to-end encoding.
Here is an experimental implementation to try out this approach: https://github.com/awxkee/image/tree/test_yuv_jpeg_fixed_point
Tests shows that fixed-point faster something about 20%, but in end-to-end encoding gain are varies from 2% to 7%.
P.S.
Anyway, it seems here
.round()
is missing, so luma and chroma values are truncated on each pass. Over time, this truncation leads to #2311image/src/codecs/jpeg/encoder.rs
Lines 773 to 789 in 5080752
The text was updated successfully, but these errors were encountered: