nx_h264_dequant.nx
buildroot/runtime/nx_h264_dequant.nx
about
nx_h264_dequant.nx -- H.264 inverse quantization / scaling for 4x4 residual
blocks (spec 8.5.12.1). Turns quantized levels c[] into the coefficient block
d[] that feeds the inverse transform (nx_h264_idct). Flat weightScale=16 (no
custom scaling list).
m = QP % 6 ; shift = QP / 6
LevelScale = 16 * normAdjust4x4[m][posClass(i,j)]
QP >= 24: d = (c * LevelScale) << (shift - 4)
QP < 24: d = (c * LevelScale + (1 << (3 - shift))) >> (4 - shift)
posClass: 0 if (i,j both even), 1 if (both odd), else 2.
normAdjust4x4 is the spec V matrix; verified by KAT (level 1 at QP0 -> 10/13/16
for the 3 position classes). Pure integer, table-driven.
genealogy_id: itu_t_h264_sec8_5_12_1_scaling + normadjust4x4_matrix
lineage_id: qp_mod6_levelscale + round_shift_dequant
license_tier: ORIGINAL
dependencies 1 imports · 10 importers
imports: nx_syscalls.nx
imported by: nx_h264_block_e2e_gate.nxnx_h264_brecon.nxnx_h264_decode_frame.nxnx_h264_dequant_gate.nxnx_h264_fdct.nxnx_h264_fdct_gate.nxnx_h264_iframe.nxnx_h264_intra_gate.nxnx_h264_intra_recon.nxnx_h264_pframe_recon.nx
structs
| none |
consts
| none |
functions
| 20 | func nx_dq_posclass(i: i64, j: i64) -> i64 |
| 32 | func nx_dq_normadjust(m: i64, pc: i64) -> i64 called by 1: nx_h264_dequant4x4 |
| 56 | func nx_h264_dequant4x4(c: *i64, qp: i64, d: *i64) -> i64 called by 17: mainrecon_b_4x4chroma_add_resrecon_i16_lumarecon_i4_blockrecon_chroma_comp+11 calls 2: nx_dq_posclassnx_dq_normadjust |