这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Galaxy4594
Copy link
Contributor

@Galaxy4594 Galaxy4594 commented Jun 24, 2025

Addresses the repeating patterns seen when decoding to 8-bit with ordered noise.

This is visual example I made with the brightness cranked up to see the noise patterns better.
Noise_Comp
Edit: Newer comparison.

Fixes #3926

@jonsneyers
Copy link
Member

Seems like a good idea to me. Two things:

  • Some of the tests are failing, probably just because they're comparing the new dithering to a reference decode with the old dithering and getting some differences.
  • Using a 32x32 matrix might cause a bit of slowdown due to some extra pressure on the cpu cache, since it's 4 KiB instead of 0.5 KiB. Could you give some before/after results for djxl input.jxl output.ppm --num_threads=0 --num_reps=100 to see if there's something noticeable?

@jonnyawsom3 jonnyawsom3 mentioned this pull request Jun 27, 2025
@Galaxy4594
Copy link
Contributor Author

A very small but notable difference for me on my intel i5-12400, from 74.889 MP/s to 74.034 MP/s.

Speaking of the failing tests, what would be the best way to fix them?

@jonsneyers
Copy link
Member

A very small but notable difference for me on my intel i5-12400, from 74.889 MP/s to 74.034 MP/s.

Speaking of the failing tests, what would be the best way to fix them?

Best to locally run the tests and check on a case-by-case basis if the failure indicates an actual problem or not.
I think there might be an actual problem related to the dithering weights being too high, making lossless uint8 no longer roundtrip. Once that's fixed, maybe there are no failing tests anymore.

@eustas
Copy link
Contributor

eustas commented Aug 5, 2025

In my ideal world, dithering matrix should be generated at compile time. Most preferably if all values are integer/(2**k) (and no FPs are used in calculations before the final conversion)...

@jonnyawsom3
Copy link
Collaborator

Theoretically, we could just call the photon noise in the decoder to get blue noise for 'free', set to a low level like 200.

@Galaxy4594
Copy link
Contributor Author

Okay I upped the precision from 4 decimal points to 5 and I constrained the values to [-0.49219, 0.49219]. Hopefully this fixes the failing tests.

@Galaxy4594 Galaxy4594 mentioned this pull request Aug 8, 2025
9 tasks
@eustas eustas requested a review from jonsneyers August 8, 2025 11:28
@Galaxy4594
Copy link
Contributor Author

It's seems like @jonsneyers is on holiday. 😅

@eustas
Copy link
Contributor

eustas commented Aug 29, 2025

@jonsneyers friendly ping

@jonsneyers jonsneyers added this pull request to the merge queue Oct 7, 2025
Merged via the queue into libjxl:main with commit 2a4f12b Oct 7, 2025
91 of 93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Blue Noise for dithering

4 participants