code wiki / (root) / nx_jpeg_ycbcr_test.nx

nx_jpeg_ycbcr_test.nx

buildroot/runtime/nx_jpeg_ycbcr_test.nx

4595 B116 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic jpeg
docsdependenciesstructsconstsfunctions

about

nx_jpeg_ycbcr_test.nx -- KAT for YCbCr -> RGB conversion. Canonical reference points from JFIF v1.02: (Y= 0, Cb=128, Cr=128) -> black (R=0, G=0, B=0) (Y=255, Cb=128, Cr=128) -> white (R=255, G=255, B=255) (Y=128, Cb=128, Cr=128) -> mid grey (R=128, G=128, B=128) (Y= 76, Cb= 85, Cr=255) -> pure red (R=~255, G=~0, B=~0) (Y=150, Cb= 44, Cr= 21) -> pure green (R=~0, G=~255, B=~0) (Y= 29, Cb=255, Cr=107) -> pure blue (R=~0, G=~0, B=~255) JPEG conversion is approximate (Rec 601 coefficients + fixed-point rounding) so we allow +/- 2 ULP tolerance on the pure-colour cases. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_jpeg_ycbcr.nx nx_jpeg_ycbcr_test.nx

imports: nx_syscalls.nxnx_jpeg_ycbcr.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_jpeg_ycbcr_to_rgb_one _ycbcr_clamp_u8 _fail sys_mmap ↻ sys_write _within nx_jpeg_ycbcr_to_rgb_block sys_mmap ↻ nx_jpeg_ycbcr_to_rgb_one ↻ sys_write ↻

structs

none

consts

none

functions

20func _fail(n: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
40func _within(actual: i64, expected: i64, tol: i64) -> i64
called by 1: main
47func main() -> i64