code wiki / (root) / nx_h264_bitwriter.nx

nx_h264_bitwriter.nx

buildroot/runtime/nx_h264_bitwriter.nx

1828 B58 linesdepth 2pulls 2 transitivereach 52 importersview sourcekind librarytopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_bitwriter.nx -- MSB-first bit writer (hardware-rung primitive). The inverse of nx_h264_bits' reader: accumulate bits MSB-first into a byte buffer. Foundational for sovereign self-verification (encode->decode round trip = the oracle, no third-party reference) and for re-encode/transcode. Buffer must be zero-initialised (sys_mmap zeroes); we OR set-bits in. genealogy_id: msb_bitstream_writer lineage_id: bit_accumulate_msb_first license_tier: ORIGINAL

dependencies 1 imports · 35 importers

nx_syscalls.nx nx_h264_bitwriter.nx nx_cam_poster.nx nx_codec_rd2_gate.nx nx_codec_rd_gate.nx nx_codec_real_rd2.nx nx_codec_real_rd2f.nx nx_codec_real_rd2g.nx nx_codec_real_rd3.nx nx_h264_block_e2e_gate.nx nx_h264_cavlc_enc.nx nx_h264_cavlc_rt_gate.nx

diagram shows first 10 each side; +0 more imports, +25 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_cam_poster.nxnx_codec_rd2_gate.nxnx_codec_rd_gate.nxnx_codec_real_rd2.nxnx_codec_real_rd2f.nxnx_codec_real_rd2g.nxnx_codec_real_rd3.nxnx_h264_block_e2e_gate.nxnx_h264_cavlc_enc.nxnx_h264_cavlc_rt_gate.nxnx_h264_cdc_gate.nxnx_h264_cdc_tz_gate.nxnx_h264_coeff_token.nxnx_h264_coeff_token_gate.nxnx_h264_ctctx_gate.nxnx_h264_ctfull_gate.nxnx_h264_mb_pred.nxnx_h264_mb_pred_gate.nxnx_h264_residual.nxnx_h264_residual_gate.nxnx_h264_run_before.nxnx_h264_run_before_gate.nxnx_h264_total_zeros.nxnx_h264_total_zeros_gate.nxnx_h264_tzrb_gate.nxnx_jpeg_block_enc.nxnx_jpeg_block_enc_gate.nxnx_jpeg_color_write.nxnx_jpeg_color_write_gate.nxnx_jpeg_huff_enc.nxnx_jpeg_huff_enc_gate.nxnx_jpeg_rst_gate.nxnx_jpeg_sym.nxnx_jpeg_write.nxnx_jpeg_write_gate.nx

structs

12struct BitWriter

consts

18const NX_BW_BYTES: i64 = 32

functions

20func bw_init(bw: *BitWriter, buf: *u8, cap: i64) -> i64
called by 27: mainmainmainmainmainmain+21
28func bw_write_bit(bw: *BitWriter, bit: i64) -> i64
called by 15: mainmainmainmainmainmain+9
40func bw_write_bits(bw: *BitWriter, val: i64, n: i64) -> i64
46func bw_total_bits(bw: *BitWriter) -> i64 { return bw.byte_pos * 8 + bw.bit_pos }
called by 13: mainmainmainmainmainmain+7
49func bw_write_ue(bw: *BitWriter, v: i64) -> i64