image-rs / jpeg-decoder

JPEG decoder written in Rust
Apache License 2.0
148 stars 87 forks source link

Fix #132 #135

Closed lovasoa closed 4 years ago

lovasoa commented 4 years ago
 Benchmarking decode a 512x512 progressive JPEG: Collecting 100 samples in estimated 27.108 s (5050 i                                                                                                    decode a 512x512 progressive JPEG
                         time:   [5.3440 ms 5.3549 ms 5.3669 ms]
                         change: [-24.307% -23.085% -21.920%] (p = 0.00 < 0.05)
                         Performance has improved.
 Found 3 outliers among 100 measurements (3.00%)
   2 (2.00%) high mild
   1 (1.00%) high severe
fintelia commented 4 years ago

Just to confirm, are you sure that the logical OR operation what this code is supposed to be doing? I posted that as a guess in the issue thread, but I don't actually know how jpeg decoding works so I was just speculating based on the shape of the surrounding code.

lovasoa commented 4 years ago

No, I did not check... The specification for the part in the code in in G 1.2.3 of the JPEG specification, if you want to have a look yourself : https://books.google.fr/books?id=AepB_PZ_WMkC&pg=PA484&lpg=PA484&dq=Jpeg+Section+G.1.2.3&source=bl&ots=USKKer5RuP&sig=ACfU3U27xg2SO6Xh3LzRCXmCkqZxwFmspg&hl=en&sa=X&ved=2ahUKEwjv4bb11s7nAhUDXqwKHXnjClQQ6AEwCnoECAsQAQ#v=onepage&q&f=false

lovasoa commented 4 years ago

I also gave maintainers edit rights on this pull request, so if you want to fix something, you can commit directly on lovasoa:master if you want

lovasoa commented 4 years ago

I added the whitespace. But what I think we need more is someone reviewing that against the JPEG specification.