nx_av1_seq.nx
buildroot/runtime/nx_av1_seq.nx
about
nx_av1_seq.nx -- AV1/AV2 sequence header, writer and reader.
Layer three, on top of nx_av1_ec.nx (symbol coder) and nx_av1_obu.nx (OBU
framing). The sequence header is what tells a decoder the frame dimensions,
bit depth, chroma subsampling and which coding tools are enabled -- nothing
downstream can be parsed without it.
THE REDUCED PATH IS THE AVIF PATH. A still image sets
reduced_still_picture_header, which collapses the operating-point list, the
timing model and every inter-frame tool flag out of the syntax. AVIF files
take this branch, so implementing it correctly is what makes AVIF reachable
once the tile decoder lands. The full path is written too, but the reduced
one is the one round-tripped here.
FRAME SIZE IS SELF-DESCRIBING. max_frame_width_minus_1 is written in
frame_width_bits_minus_1 + 1 bits -- the WIDTH OF THE WIDTH FIELD is itself
coded in the header, immediately before it. Reading the dimension with a
fixed width works on 16-bit-ish sizes and silently mis-parses everything
after it on any other, because the bit cursor is then wrong for the entire
remainder of the header.
THE sRGB SHORTCUT. When colour primaries are BT.709, transfer is sRGB and
the matrix is identity, the spec SKIPS color_range and forces 4:4:4 full
range. A parser that reads color_range anyway consumes one bit too many and
desynchronises the rest of colour config.
genealogy_id: av1_spec_5_5_sequence_header
lineage_id: nx_av1_seq_v1
license_tier: ORIGINAL
dependencies 2 imports · 5 importers
imports: nx_syscalls.nxnx_bitstream.nx
imported by: nx_av1_frame.nxnx_av1_frame_gate.nxnx_av1_seq_gate.nxnx_av1_tile.nxnx_av1_tile_gate.nx
structs
| 62 | struct NxAv1Bw |
consts
| 34 | const NX_SEQ_BW_BYTES: i64 = 32 |
| 37 | const NX_SEQ_PROFILE: i64 = 0 |
| 38 | const NX_SEQ_STILL: i64 = 1 |
| 39 | const NX_SEQ_REDUCED: i64 = 2 |
| 40 | const NX_SEQ_LEVEL: i64 = 3 |
| 41 | const NX_SEQ_MAXW: i64 = 4 |
| 42 | const NX_SEQ_MAXH: i64 = 5 |
| 43 | const NX_SEQ_SB128: i64 = 6 |
| 44 | const NX_SEQ_FILTER_INTRA: i64 = 7 |
| 45 | const NX_SEQ_EDGE_FILTER: i64 = 8 |
| 46 | const NX_SEQ_SUPERRES: i64 = 9 |
| 47 | const NX_SEQ_CDEF: i64 = 10 |
| 48 | const NX_SEQ_RESTORATION: i64 = 11 |
| 49 | const NX_SEQ_BITDEPTH: i64 = 12 |
| 50 | const NX_SEQ_MONO: i64 = 13 |
| 51 | const NX_SEQ_SUBX: i64 = 14 |
| 52 | const NX_SEQ_SUBY: i64 = 15 |
| 53 | const NX_SEQ_RANGE: i64 = 16 |
| 54 | const NX_SEQ_FILMGRAIN: i64 = 17 |
| 55 | const NX_SEQ_BITS: i64 = 18 |
functions
| 68 | func nx_av1_bw_new(buf: *u8, cap: i64) -> *NxAv1Bw |
| 78 | func nx_av1_bw_put(w: *NxAv1Bw, v: i64, n: i64) -> i64 |
| 97 | func nx_av1_bw_bytes(w: *NxAv1Bw) -> i64 |
| 103 | func nx_av1_bits_for(v: i64) -> i64 |
| 115 | func nx_av1_seq_write_still(out: *u8, cap: i64, profile: i64, level: i64, |
| 189 | func nx_av1_seq_parse(d: *u8, n: i64, fld: *i64) -> i64 |