nx_jpeg_ycbcr.nx
buildroot/runtime/nx_jpeg_ycbcr.nx
about
nx_jpeg_ycbcr.nx -- YCbCr -> RGB colour-space conversion for JPEG.
Per JFIF v1.02 (ITU-T T.871) the inverse transform is:
R = Y + 1.402 * (Cr - 128)
G = Y - 0.344136 * (Cb-128) - 0.714136 * (Cr - 128)
B = Y + 1.772 * (Cb-128)
Where Y, Cb, Cr are post-IDCT 8-bit samples (after level-shift by
+128 and clamp to [0..255]).
Fixed-point form using 16-bit fractional precision (multiplier 65536):
1.402 -> 91881
0.344136 -> 22554
0.714136 -> 46802
1.772 -> 116130
Clamping: output R, G, B to [0..255].
nx_safety_envelope:
intended_use: "YCbCr-to-RGB conversion for JPEG decode."
sil_target: SIL1
evidence: [jfif_1_02_canonical_basis,
fixed_point_no_floats,
clamp_at_boundary]
verdict: NOT_YET_EVALUATED
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_jpeg_ascii.nxnx_jpeg_ycbcr_test.nx
structs
| none |
consts
| none |
functions
| 31 | func _ycbcr_clamp_u8(v: i64) -> i64 called by 1: nx_jpeg_ycbcr_to_rgb_one |
| 42 | func nx_jpeg_ycbcr_to_rgb_one(y: i64, cb: i64, cr: i64, |
| 65 | func nx_jpeg_ycbcr_to_rgb_block(y_buf: *i64, cb_buf: *i64, cr_buf: *i64, |