code wiki / (root) / nx_av1_seq.nx

nx_av1_seq.nx

buildroot/runtime/nx_av1_seq.nx

10432 B287 linesdepth 4pulls 4 transitivereach 5 importersview sourcekind librarytopic av1
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_bitstream.nx nx_av1_seq.nx nx_av1_frame.nx nx_av1_frame_gate.nx nx_av1_seq_gate.nx nx_av1_tile.nx nx_av1_tile_gate.nx

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

62struct NxAv1Bw

consts

34const NX_SEQ_BW_BYTES: i64 = 32
37const NX_SEQ_PROFILE: i64 = 0
38const NX_SEQ_STILL: i64 = 1
39const NX_SEQ_REDUCED: i64 = 2
40const NX_SEQ_LEVEL: i64 = 3
41const NX_SEQ_MAXW: i64 = 4
42const NX_SEQ_MAXH: i64 = 5
43const NX_SEQ_SB128: i64 = 6
44const NX_SEQ_FILTER_INTRA: i64 = 7
45const NX_SEQ_EDGE_FILTER: i64 = 8
46const NX_SEQ_SUPERRES: i64 = 9
47const NX_SEQ_CDEF: i64 = 10
48const NX_SEQ_RESTORATION: i64 = 11
49const NX_SEQ_BITDEPTH: i64 = 12
50const NX_SEQ_MONO: i64 = 13
51const NX_SEQ_SUBX: i64 = 14
52const NX_SEQ_SUBY: i64 = 15
53const NX_SEQ_RANGE: i64 = 16
54const NX_SEQ_FILMGRAIN: i64 = 17
55const NX_SEQ_BITS: i64 = 18

functions

68func nx_av1_bw_new(buf: *u8, cap: i64) -> *NxAv1Bw
78func nx_av1_bw_put(w: *NxAv1Bw, v: i64, n: i64) -> i64
97func nx_av1_bw_bytes(w: *NxAv1Bw) -> i64
103func nx_av1_bits_for(v: i64) -> i64
115func nx_av1_seq_write_still(out: *u8, cap: i64, profile: i64, level: i64,
189func nx_av1_seq_parse(d: *u8, n: i64, fld: *i64) -> i64