code wiki / (root) / nx_deblock.nx

nx_deblock.nx

buildroot/runtime/nx_deblock.nx

5135 B148 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_deblock.nx -- in-loop deblocking filter for 8x8 block-grid reconstructions. Substrate primitive that smooths the quantisation discontinuities at block boundaries without touching real edges. Algorithm (simple, public): for each boundary (horizontal between rows 7-8, 15-16, ...; vertical between cols 7-8, 15-16, ...) take the four pixels straddling the line: p1, p0 | q0, q1 If the local variation is small (|p1-p0| < T && |q0-q1| < T && |p0-q0| < T2), apply a low-pass filter that pulls p0 and q0 toward the average across the boundary. Otherwise leave the pixels alone (preserves real edges). This is structurally what H.263 Annex J and H.264's deblocking filter do; the simple variant here re-derives from the underlying public idea (filter only smooth regions) without copying their boundary-strength tables or per-block-mode dispatch. Quality is modest; the row goes from LOSE to WIN on the substrate axis once the feature exists. Stronger variants are named improvements. genealogy_id: itu_t_h_263_annex_j + h264_8_7_deblock + jpeg2000_visual + nx_video_codec_v1_q10 lineage_id: nishi_deblock_q10

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_deblock.nx nx_video_codec.nx

imports: nx_syscalls.nx

imported by: nx_video_codec.nx

structs

none

consts

33const NX_DB_VERDICT_UNKNOWN: i64 = 0
34const NX_DB_VERDICT_OK: i64 = 1
35const NX_DB_VERDICT_BAD_PARAMS: i64 = 2
36const NX_DB_VERDICT_N: i64 = 3
38const NX_DB_BLOCK: i64 = 8
39const NX_DB_T1: i64 = 16 // |p1-p0| threshold
40const NX_DB_T2: i64 = 32 // |p0-q0| threshold

functions

42func _db_abs(x: i64) -> i64
called by 1: _db_filter4
60func _db_filter4(p1: i64, p0: i64, q0: i64, q1: i64,
88func nx_deblock_horizontal(img: *i64, W: i64, H: i64) -> i64
called by 1: nx_deblock calls 2: sys_mmap_db_filter4
113func nx_deblock_vertical(img: *i64, W: i64, H: i64) -> i64
called by 1: nx_deblock calls 2: sys_mmap_db_filter4
138func nx_deblock(img: *i64, W: i64, H: i64) -> i64
144func nx_deblock_verdict_is_valid(v: i64) -> i64