Skip to main content

Module htj2k97_codeblock_oracle

Module htj2k97_codeblock_oracle 

Source
Expand description

Shared scalar oracle: float 9/7 bands into prequantized HTJ2K code-blocks.

This module uses the native encoder’s public irreversible 9/7 quantization step helper plus the native code-block layout rules, so both GPU backends can compare their fused code-block kernels against one authoritative CPU reference instead of each re-deriving the math.

The re-derivation is anchored to native truth by a codestream pin test (see the module tests): encoding the oracle’s prequantized output reproduces the native precomputed-DWT codestream byte-for-byte.

Functions§

htj2k97_subband_delta
Deadzone quantization step size Δ for a subband.
htj2k97_subband_total_bitplanes
Total declared bitplanes for every code-block in a subband.
prequantized_component_from_dwt97
Quantize one level of float 9/7 bands into a prequantized HTJ2K component.
quantize_codeblock_subband
Quantize a single float subband and slice it into code-block-major layout.
validate_htj2k97_codeblock_options
Validate 9/7 code-block options against the numeric limits both GPU backends must agree on, returning the decoded (cb_width, cb_height).