nx_jpeg_progressive.nx
buildroot/runtime/nx_jpeg_progressive.nx
about
nx_jpeg_progressive.nx -- PROGRESSIVE JPEG decode (SOF2), the eat-the-debt unblock for real web photos.
Baseline decodes one scan block->IDCT->pixel; progressive has MANY scans that each refine a spectral band of
a full-image COEFFICIENT buffer (spectral selection Ss..Se + successive approximation Ah/Al), then a single
IDCT pass at the end. Four scan kinds: DC-first, DC-refine, AC-first (EOBRUN), AC-refine (the fiddly one).
Faithful to T.81 G.1.2 / libjpeg jdphuff. Restart intervals (DRI>0) NOT yet handled (assumes DRI=0). ORIGINAL.
dependencies 10 imports · 2 importers
imports: nx_syscalls.nxnx_jpeg_sof.nxnx_jpeg_sos.nxnx_jpeg_dqt.nxnx_jpeg_dht.nxnx_jpeg_entropy.nxnx_jpeg_dequant.nxnx_jpeg_idct.nxnx_jpeg_mcu.nxnx_jpeg_decode.nx
imported by: nx_jpeg_ascii.nxnx_jpegprobe.nx
structs
| none |
consts
| 17 | const NX_JPEG_PROG_OK: i64 = 0 |
| 18 | const NX_JPEG_PROG_FAIL: i64 = 1 |
functions
| 20 | func pgw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(2, s, n); return 0 } calls 1: sys_write |
| 21 | func pgd(v: i64) -> i64 |
| 34 | func nx_jpeg_is_progressive(jpeg: *u8, jpeg_len: i64) -> i64 |
| 56 | func prog_next_marker(j: *u8, len: i64, from: i64) -> i64 called by 1: nx_jpeg_prog_decode |
| 71 | func prog_refine_nz(coeffs: *i64, k: i64, p1: i64, bit: i64) -> i64 called by 1: prog_scan |
| 82 | func prog_scan(j: *u8, len: i64, scan: *NxJpegScan, frame: *NxJpegFrame, |
| 256 | func prog_be16(j: *u8, o: i64) -> i64 { return ((j[o] & 0xff) << 8) | (j[o + 1] & 0xff) } |
| 261 | func nx_jpeg_prog_decode(jpeg: *u8, jpeg_len: i64, ctx: *NxJpegDecCtx, planes: *u8, strides: *i64) -> i64 |