Skip to content

Adding NLT type 2 and experimental type 4 - #356

Merged
aous72 merged 35 commits into
masterfrom
nlt_type4
Sep 16, 2026
Merged

aous72 merged 35 commits into
masterfrom
nlt_type4

Conversation

@aous72

@aous72 aous72 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

In this WIP PR, we are attempting to add NLT types 2, and an experimental type 4, which combines type 2 and 3.

Comment thread src/core/codestream/ojph_params.cpp Fixed
@aous72

aous72 commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

After studying the LUT, I discovered the following:

  • Decoding requires a table look up, which is not a problem, as index samples are evenly spaced.
  • For encoding, however, index samples are NOT equally spaces, and therefore a good way of doing this is to have an inverse table that, given the incoming/source value, gives us the LUT index. The alternative is to do search, which a no-no. For 16bit source samples (or half precision), the index of this inverse table is 16bit , which is manageable, and needs 128KB of memory. However, for 32-bit source samples, it is not manageable. It is conceivable to have a combination of a lookup table followed by search, but it is not ideal. I suspect the guys who developed the LUT non-linearity did not consider 32-bit source data, or possibly 38 source data.

Comment thread src/core/codestream/ojph_params.cpp Fixed
Comment thread src/core/codestream/ojph_params.cpp
@aous72
aous72 merged commit f14a9d0 into master Sep 16, 2026
19 of 39 checks passed
@aous72
aous72 deleted the nlt_type4 branch September 16, 2026 14:43
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
openjph 0.32.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>Many updates/PRs have been merged into this release.
This is slightly rushed to go along with the next release of OpenEXR; in particular, I am adding an experimental non-linearity, NLT type 4 #356, which is not part of the standard -- if you do not need it, please do not use it.
There are a couple of PRs I wish to have added to this release; hopefully I will add them to the next release.
It worth saying that for #356, I wrote the whole generic code myself, and then I used AI as explained below.
* I used on-premise Qwen3.8-Flash-Next (Unsloth Q4_K_XL) to generate SSE2 and AVX2 code paths from generic C code; the only difficulty here is the gather command for AVX2, which I never used before.  It is worth saying that this models runs at 10-12 t/s decode at the start, dropping to 4-5 t/s at 50-75% of the context; I am using a context of 262144.
* I used Cloud-based Deepseek-Flash APIs to generate and debug test code. However, the first merged PR failed on the s390x big-endian machine. To fix this problem, AI was a great help; it discovered the problem in like 30 minutes and fixed it.

## What's Changed
* Fix: raw_in reads every .raw file as signed, and zero-extends signed 16-bit samples by @curtisc in aous72/OpenJPH#336
* Cs3d/truncated decode graceful 0.30.1 by @wayfarer3130 in aous72/OpenJPH#331
* Warning fix by @aous72 in aous72/OpenJPH#342
* Add POWER8 support for the VSX kernels by @runlevel5 in aous72/OpenJPH#351
* Makes qfactor a floating-point number by @aous72 in aous72/OpenJPH#343
* fix(build): fix building AVX-512 runtime dispatch code with Clang/MSVC by @solbjorn in aous72/OpenJPH#358
* README.md: use HTTPS for PDF links by @PeterSchuebel in aous72/OpenJPH#369
* Update fuzzing commands to run on Windows and Linux by @aous72 in aous72/OpenJPH#368
* Allow TLM to span multiple marker segments by @ZwaarContrast in aous72/OpenJPH#367
* Adding NLT type 2 and experimental type 4 by @aous72 in aous72/OpenJPH#356
* A bug fix for s390 by @aous72 in aous72/OpenJPH#373

## New Contributors
* @curtisc made their first contribution in aous72/OpenJPH#336
* @wayfarer3130 made their first contribution in aous72/OpenJPH#331
* @solbjorn made their first contribution in aous72/OpenJPH#358
* @PeterSchuebel made their first contribution in aous72/OpenJPH#369
* @ZwaarContrast made their first contribution in aous72/OpenJPH#367

**Full Changelog**: https://github.com/aous72/OpenJPH/compare/0.31.0...0.32.0</pre>
  <p>View the full release notes at <a href="https://github.com/aous72/OpenJPH/releases/tag/0.32.0">https://github.com/aous72/OpenJPH/releases/tag/0.32.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!20496
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.

2 participants