code wiki / _hdl_build / nx_vcodec_heataq.nx

nx_vcodec_heataq.nx

buildroot/runtime/_hdl_build/nx_vcodec_heataq.nx

13557 B235 linesdepth 6pulls 17 transitivereach 0 importersview sourcekind tooltopic vcodec
docsdependenciesstructsconstsfunctions

about

nx_vcodec_heataq.nx -- Adapts skip thresholds per macroblock based on past behavior to optimize bitrate allocation.

dependencies 3 imports · 0 importers

nx_gate_base.nx nx_syscalls.nx nx_video_codec_wasm.nx nx_vcodec_heataq.nx

imports: nx_gate_base.nxnx_syscalls.nxnx_video_codec_wasm.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close gw sys_write frames fidelity sys_mmap ↻ vc_t8_init nx_dct8_init vc_t8p vv_enc_rct8 vc_enc_frame_packed_rct8 rc_enc_init nx_bw_put vc_aq_level vc_mb_mad vc_mb_t8_ok vc_enc_block_packed_e vc_enc_block_packed_i vm_sad_zero vs_skip nx_bw_put ↻ vc_intra_dc_sad vm_search vc_enc_mb4r_intra vm_sad vc_rd_part_inter vc_t8p ↻ vc_enc_mb_part8_inter vm_search_q vc_mvpred vc_gput vc_mvplane_set ve_vput

structs

none

consts

18const CHURN_MAGIC_2048: i64 = 2048
19const CHURN_MAGIC_4194304: i64 = 4194304
20const CHURN_MAGIC_5120: i64 = 5120
21const CHURN_MAGIC_8192: i64 = 8192
23const SW: i64 = 352
24const SH: i64 = 288
25const NF: i64 = 48
26const SKIPMUL: i64 = 30
27const CHURN_N: i64 = 3 // coded-streak arming the churn discount
28const STABLE_N: i64 = 8 // skip-streak arming the stability protection
29const SKIPBITS: i64 = 4 // CAVLC bits <= this across a block call ~= the MB skipped (mode+coeffs ride the rc section)

functions

31func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
calls 1: gw
33func gn(v: i64) -> i64
37func cpb(d: *u8, s: *u8, n: i64) -> i64 { var i: i64=0; while i<n { d[i]=s[i]; i=i+1 } return 0 }
39func frames(yuv: *u8, hi: i64, total: i64, fp: *i64, fdata: i64) -> i64
49func hq_thr(base: i64, heat: i64, churn: i64, mode: i64) -> i64
65func hq_enc_frame(cur: *u8, prev: *u8, recon: *u8, W: i64, H: i64, qp: i64, keyframe: i64, sad_thresh: i64, buf: *u8, blk: *i64, mv: *i64, tf: i64, rctx: *i64, heat: *i64, churn: *i64, skipf: *i64, mode: i64) -> i64
104func hq_enc_rct8(cur: *u8, prev: *u8, recon: *u8, W: i64, H: i64, qp: i64, keyframe: i64, sad: i64, out: *u8, out_cap: i64, blk: *i64, mv: *i64, rctx: *i64, heat: *i64, churn: *i64, skipf: *i64, mode: i64) -> i64
135func fidelity(fp: *i64, sz: i64) -> i64
168func runpq(fp: *i64, kq: i64, pq: i64, emode: i64, sz: i64, allkey: i64, mode: i64) -> i64
201func main(argc: i64, argv: *i64) -> i64