pub fn validate_htj2k97_codeblock_options(
options: Htj2k97CodeBlockOptions,
) -> Result<(usize, usize), &'static str>Expand description
Validate 9/7 code-block options against the numeric limits both GPU
backends must agree on, returning the decoded (cb_width, cb_height).
One shared implementation keeps Metal and CUDA from drifting: the same options must be accepted or rejected identically by every backend. Errors are backend-neutral static strings for the caller’s unsupported-job error.
§Errors
Rejects zero/oversized bit depths and guard bits, non-finite or non-positive quantization scales, code-block dimensions beyond the HTJ2K limits (sides ≤ 1024, area ≤ 4096), and subband deltas or total bitplane counts outside the supported range.