Implement OAMD metadata rendering and runtime table generation

- Add oamd_params/oamd_math for OAMD metadata state, ISF matrix assembly,
  runtime size-table generation and bed routing.
- Apply per-block gain/inactive, zone/elevation, size, snap, divergence,
  position refinement, priority budget, ISF and bed distribution in the
  speaker renderer.
- Compute gain, size, priority, position, refinement and delta values from
  formulas; generate the size spread kernel from speaker-layout geometry.
- Derive bed labels, routing, reference positions and automatic attenuation
  from speaker layouts.
- Correct the surround positions of 5.1, 5.1.2 and 5.1.4 and add the 6.0
  speaker layout.
- Update README, data README and math notes for the metadata path and
  runtime table generation.
This commit is contained in:
TheM14 committed 2026-11-08 00:29:34 +08:00
1 parent 17e52a531c
commit 8dc6e13b16
13 files changed
+2036 -229

No files matched your search

+15
View File
@@ -19,6 +19,21 @@ joc_huff_code_7ch_pos_index_sparse int64[6,2]
`src/joc_qmf.py` loads the QMF tables, while `src/joc_decode.py` loads the JOC Huffman trees.
## ISF coefficient data
`oamd/metadata_params.json` stores only the ISF compressed base coefficients
and layout descriptors, which have no closed form. Gain, size, priority,
position, divergence, delta and refinement values are computed in code from
formulas or fixed constants; the size spread kernel is generated at runtime
from the `speaker_layouts` region geometry with grouped equal-power panning,
an S448 weight and a power sum (20/20/8 virtual points, 20 size nodes, 35/4
position nodes); no stored 12-layout x 7-region table is needed. Bed labels,
routing and reference positions are derived from `speaker_layouts` as well.
`src/oamd_params.py` parses the data file lazily and `src/oamd_math.py`
computes coefficients in a fixed float32 order; `src/speaker_renderer.py`
applies them to the object target coefficients.
## Binaural rendering tables
`rosella_kernels.npz` contains the fixed 64-QMF/77-hybrid tables used by
+12
View File
@@ -19,6 +19,18 @@ joc_huff_code_7ch_pos_index_sparse int64[6,2]
`src/joc_qmf.py` 读取 QMF 表,`src/joc_decode.py` 读取 JOC Huffman 树。
## ISF 系数数据
`oamd/metadata_params.json` 只保存无法由闭式公式生成的 ISF 压缩基系数与布局
描述。gain、size、priority、位置、divergence 与差分/细化表在代码中按公式或
固定常量计算;size 扩散核按分组等功率声像、S448 权重和幂和,在运行时从
`speaker_layouts` 的区域几何生成(20/20/8 虚拟点、20 个尺寸节点、35/4 个
位置节点),不再保存 12 个布局 × 7 个区域的查表。bed 的标签、路由和参考位置
也由 `speaker_layouts` 推导,不再单独保存 bed 表。
`src/oamd_params.py` 延迟解析数据文件,`src/oamd_math.py` 按固定的 float32 运算
顺序生成系数;`src/speaker_renderer.py` 把它们接到对象目标系数上。
## 双耳渲染表
`rosella_kernels.npz` 保存`.jochrtf`压缩渲染和个性化bank 1使用的64-QMF/77-hybrid固定表:
+1
View File
@@ -0,0 +1 @@
{"isf":{"configs":[{"idx":0,"counts":[3,1,0,0,4],"primary_row_map":[0,1,2,3],"secondary_row_map":[0,2,1,3],"matrix_row_stride":73,"matrix_rows":4,"matrix_values":[0.8065544962882996,0.5517973303794861,0.6069754362106323,0.3953828811645508,0.5534031987190247,0.5539230704307556,0.24255745112895966,0.47505271434783936,0.444728285074234,0.17205633223056793,0.4247773289680481,0.5103204250335693,0.18820077180862427,0.17929865419864655,0.452311247587204,-0.280463844537735,0.017338519915938377,-0.28909528255462646,0.0,0.0560874417424202,-0.2892860770225525,-0.013385031372308731,0.10039377957582474,-0.016056396067142487,-0.2825709581375122,-0.04064895957708359,0.10803624987602234,0.05630350857973099,-0.047425154596567154,-0.26719823479652405,-0.06350012123584747,0.097655288875103,0.1266908049583435,-0.029927069321274757,-0.04877259582281113,-0.2535346746444702,-0.050417669117450714,0.09264937043190002,0.07186891883611679,0.05187152326107025,-0.027603687718510628,-0.044422321021556854,-0.2613919973373413,0.0,0.03838589787483215,-0.12560494244098663,0.051136989146471024,-0.09426405280828476,0.06614412367343903,-0.05140332132577896,-0.1441955715417862,0.08474995940923691,-0.036616962403059006,-0.11979598551988602,0.07123114913702011,-0.03924524784088135,-0.03968926891684532,-0.13764509558677673,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.4201984107494354,-0.056425247341394424,0.4477916657924652,0.01371981855481863,0.44707077741622925,-0.05664261803030968,0.05117806792259216,0.4387761950492859,0.02798357792198658,0.05597246438264847,0.4283769726753235,-0.05218393728137016,0.02862025611102581,0.049770887941122055,0.4346124231815338,0.9679709672927856,0.18938815593719482,0.8870320916175842,0.0,0.5337828993797302,0.6927342414855957,-0.048569101840257645,0.36494335532188416,0.4001503586769104,0.6377595067024231,-0.11768897622823715,0.21134333312511444,0.5358392596244812,0.258344829082489,0.5548434853553772,-0.16074039041996002,0.14455674588680267,0.40664923191070557,0.4540003538131714,0.18882706761360168,0.4997166693210602,-0.1372985541820526,0.15293832123279572,0.16712871193885803,0.4936601221561432,0.19720278680324554,0.19437994062900543,0.5300741195678711,0.0,-0.04083092510700226,0.1691703349351883,-0.05588478967547417,0.1370640993118286,-0.07459205389022827,0.08213182538747787,0.1942090392112732,-0.09941107779741287,0.06275865435600281,0.17987869679927826,-0.08116155862808228,0.064299076795578,0.0623021274805069,0.1853865683078766,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.4335499405860901,-0.056425247341394424,-0.3872392475605011,-0.08972250670194626,-0.36937597393989563,-0.05664261803030968,-0.08691781014204025,-0.3389882743358612,-0.11113959550857544,-0.07409896701574326,-0.3167206048965454,-0.05218393728137016,-0.05974094942212105,-0.07198946177959442,-0.32919612526893616,0.09978409111499786,-0.08105161786079407,0.14544576406478882,0.0,-0.15092352032661438,0.2103460729122162,0.025524256750941277,-0.14595693349838257,-0.06471376121044159,0.22086507081985474,0.06565067917108536,-0.11256188154220581,-0.15150493383407593,-0.004101958591490984,0.22987015545368195,0.09314629435539246,-0.08828219771385193,-0.17176778614521027,-0.06250102072954178,0.013875355944037437,0.2309974730014801,0.07791588455438614,-0.08850760757923126,-0.08191754668951035,-0.13957907259464264,-0.012519026175141335,0.007122464943677187,0.23086495697498322,0.0,-0.046477995812892914,0.1691703349351883,-0.06098373979330063,0.11757846176624298,-0.0774788111448288,0.05829664319753647,0.1942090392112732,-0.09704835712909698,0.03865424543619156,0.14466993510723114,-0.08293674886226654,0.043386269360780716,0.045827239751815796,0.1853865683078766,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.006118591409176588,0.0,0.006118591409176588,0.0,0.006118591409176588,0.0,0.0,0.006118591409176588,0.0,0.0,0.006118591409176588,0.0,0.0,0.0,0.006118591409176588,0.6063833832740784,0.3690401017665863,0.3751586675643921,0.0,0.611859142780304,0.0,0.0,0.0,0.611859142780304,0.0,0.0,0.0,0.611859142780304,0.0,0.0,0.0,0.0,0.0,0.611859142780304,0.0,0.0,0.0,0.0,0.0,0.0,0.611859142780304,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.6125019788742065,0.3751586675643921,0.3751586675643921,0.0,0.6125019788742065,0.0,0.0,0.3751586675643921,0.3751586675643921,0.0,0.0,0.0,0.6125019788742065,0.0,0.0]},{"idx":1,"counts":[5,3,0,0,8],"primary_row_map":[0,1,2,3,4,5,6,7],"secondary_row_map":[0,4,3,2,1,5,7,6],"matrix_row_stride":73,"matrix_rows":8,"matrix_values":[0.7620719075202942,0.878515899181366,0.37703391909599304,0.6023024916648865,0.30184605717658997,0.7353588342666626,0.3631182610988617,0.22095273435115814,0.5886307954788208,0.23342837393283844,0.17362885177135468,0.666203498840332,0.2959349751472473,0.23725862801074982,0.19081860780715942,-0.04823773726820946,-0.14693273603916168,-0.07366316765546799,0.0,-0.23600386083126068,0.035208798944950104,0.020941175520420074,-0.15896914899349213,-0.17113232612609863,Line truncated