code wiki / (root) / nx_h264_deblock.nx

nx_h264_deblock.nx

buildroot/runtime/nx_h264_deblock.nx

7445 B177 linesdepth 2pulls 2 transitivereach 8 importersview sourcekind librarytopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_deblock.nx -- H.264 in-loop deblocking, normal luma edge filter (spec 8.7.2.3) + the alpha/beta (Table 8-16) and tc0 (Table 8-17) threshold tables. Smooths block edges; this is the stage that was producing the <=1 pixel diffs vs ffmpeg at internal 4x4 edges. Edge line = [p3,p2,p1,p0,q0,q1,q2,q3] across the edge; the normal filter (bS 1..3) modifies p1,p0,q0,q1 in place. indexA/indexB = qP (filter offsets 0). filter if |p0-q0|<alpha && |p1-p0|<beta && |q1-q0|<beta ap=|p2-p0| aq=|q2-q0| ; tc = tc0 + (ap<beta) + (aq<beta) delta = Clip3(-tc,tc, ((q0-p0)*4 + (p1-q1) + 4) >> 3) p0+=delta ; q0-=delta (clip 0..255) if ap<beta: p1 += Clip3(-tc0,tc0,(p2 + ((p0o+q0o+1)>>1) - 2*p1)>>1) if aq<beta: q1 += Clip3(-tc0,tc0,(q2 + ((p0o+q0o+1)>>1) - 2*q1)>>1) genealogy_id: itu_t_h264_sec8_7_deblocking + table8_16_alpha_beta + table8_17_tc0 lineage_id: normal_luma_edge_filter + threshold_tables license_tier: ORIGINAL

dependencies 1 imports · 6 importers

nx_syscalls.nx nx_h264_deblock.nx nx_h264_brecon.nx nx_h264_deblock_gate.nx nx_h264_decode_frame.nx nx_h264_pframe_recon.nx nx_h264_slice_extract.nx nx_vdeblock.nx

imports: nx_syscalls.nx

imported by: nx_h264_brecon.nxnx_h264_deblock_gate.nxnx_h264_decode_frame.nxnx_h264_pframe_recon.nxnx_h264_slice_extract.nxnx_vdeblock.nx

structs

none

consts

none

functions

20func db_asr(x: i64, n: i64) -> i64
25func db_clip3(lo: i64, hi: i64, v: i64) -> i64
30func db_clip1(v: i64) -> i64
35func db_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
37func nx_db_alpha(idx: i64) -> i64
47func nx_db_beta(idx: i64) -> i64
58func nx_db_tc0(bs: i64, idx: i64) -> i64
80func nx_deblock_luma_edge(s: *i64, bs: i64, qp: i64) -> i64
111func nx_deblock_luma_bs4(s: *i64, qp: i64) -> i64
156func nx_deblock_chroma_edge(s: *i64, bs: i64, qp: i64) -> i64