LibGfx/JPEGLoader: Check earlier for huffman tables presence
We now check the table presence only once per scan instead of once per component value. This makes the 3% spent in compute_sip_hash() disappear.
LG! This is much nicer than before imho :)
From a functionnal point of view I can only agree, spending any time in the hash computation is inadmissible. I wonder if it's a regression, as I don't remember seeing that in a profile. I'm still not a huge fan of having two Arrays though, it really looks like a handrolled Array<Optional<>> to my eyes.
(very nit: I'd probably find "has_ac_table" more readable than "registered_ac_table", but :hypeshed:)
Too late! Let's stay consistent with registered_quantization_tables.
The table array type will become public API for people to pass in fata, and the public API doesn't need the ability to pass in optionals. That's only needed when reading from the file. (Which also makes the struct not work.)
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!