On Tue Mar 18 23:33:01 2025 +0000, Connor McAdams wrote:
I probably spent way longer investigating this than I should have, but basically what I found was: Native had a max diff of 5, we had a max diff of 40. Even setting the libjpeg encoder to the maximum quality didn't get us within the same max diff as native. I then also enabled smoothing, the best I could get was a max diff of 10. For some reason I thought JPG blocks were 4x4, they're 8x8. I've updated the tests now to have the quadrants as 8x8 and now we're within a max diff of 1, which is the same as native. I feel like that "resolves" things, although it does seem like our JPEG encoding is inferior to native and I've only masked the issue. Not sure if anything would rely upon this, or if I should make a note of it somewhere.
Okay I don't know what I was saying earlier, spent some time thinking this over while taking a walk :D it had 8x8 quadrants before. AFAIU from some researching just now, JPEG is usually encoded as 4:2:0, which results in 8x8 blocks for luma, and 16x16 blocks for chroma IIUC. Which would explain why upping the size to 32x32 increases the accuracy of compression here.
Not sure how much it matters, but wanted to make sure what I did actually made sense.