Fold the rear surrounds for warp modes 2 and 3
ci / ubuntu-latest (push) Failing after 13s
ci / macos-latest (push) Canceled after 0s
ci / windows-latest (push) Canceled after 0s
ci / release (push) Canceled after 0s

The OAMD warp field is two bits wide; modes 2 and 3 now render instead of
failing. For a 5.1, 5.1.2 or 5.1.4 target the speaker renderer pans objects
in the corresponding 7.1, 7.1.2 or 7.1.4 intermediate layout and folds the
rear pair into the target surround pair: mode 2 uses the PLIIx coefficients
(sqrt(3)/2 and 1/2), mode 3 the Standard (Lo/Ro) coefficients (1 and 0).
4.0 gains a rear pair the same way, built from the 7.1 geometry without a
centre or LFE channel. Layouts that already have both surround pairs, or
none, render directly.

The intermediate layout only changes geometry and panning. Trim
configuration selection, both balance layers and the automatic position
compensation stay with the final target layout, so 5.1.2 keeps configuration
4 and its compensation while panning on 7.1.2. Per-object bypass drops
balance and trim but keeps the fold, and LFE still passes through. The
folded object vector enters the existing gain ramp and mix unchanged; the
public API and the ADM metadata do not change.

parameters_from_oamd accepts the whole two-bit warp field and rejects
values above 3; the renderer builds the fold matrices once per layout and
keeps the 4.0 intermediate geometry internally. The bilingual notes describe
the fold and the evaluation order, and the READMEs no longer call 2/3
unsupported. ctest covers PLIIx and Lo/Ro on 5.1, 5.1.2, 5.1.4 and 4.0, the
target-layout calibration, bypass, LFE and the event path; speaker output
over the shared objects16 stream is byte-identical to the reference for all
layouts in both warp modes 2 and 3.
This commit is contained in:
TheM14 committed 2026-11-03 13:35:43 +08:00
1 parent 58e3403642
commit a2760286b0
9 files changed
+426 -41

No files matched your search

+36 -4
View File
@@ -451,7 +451,7 @@ v_{\mathrm{floor}}=
$$
`warp_mode=0` 或其他布局使用 $v_{\mathrm{floor}}=v$。高度层不做该缩放。
未携带 warp 元数据时采用 0;命令行不提供覆盖选项。2/3 保留为未实现,报错而不回退。
未携带 warp 元数据时采用 0;命令行不提供覆盖选项。warp 2/3 使用 §12.5 的中间布局与折叠矩阵。
有 front/back balance 时,先求这里的分支坐标,再应用 §12.3 的 balance。
### 10.3 高度层
@@ -557,7 +557,7 @@ warp、trim 和 balance 均从 OAMD 元数据读取。各参数的取值与作
| 参数 | 取值或单位 | 行为 |
|---|---|---|
| `warp_mode` | 0 / 1 | 选择 §10.2 的地面 Y 映射;2/3 暂不支持,遇到时明确报错 |
| `warp_mode` | 0 / 1 / 2 / 3 | 直接渲染 / 地面 Y 缩放 / PLIIx 折叠 / Standard(Lo/Ro)折叠 |
| `global_trim_mode` | 0 / 1 / 2 | automatic / disabled / 按目标布局配置选择;3 为保留值,明确报错 |
| $T_s$、$T_h$ | dB | 显式 surround、height trim 参数,正值按 0 处理 |
| $T_c$ | dB | 显式 centre trim 参数,保留符号 |
@@ -628,7 +628,7 @@ $$
### 12.4 施加位置
记 §12.3 的高度混合 balance 映射为 $B_z(y)$,§10.2 的 warp 映射为 $W(y)$。
普通点对象的实际分支顺序为
warp 0/1 直接渲染点对象时,分支顺序为
$$
y_f=B_z(W(y)),\qquad y_h=B_z(y),\qquad y_t=B_z(y).
@@ -642,11 +642,43 @@ $$
因此可概括为 warp → balance → trim 与声像增益合成,但不能让所有阶段共用一个
已经 warp 的 Y。balance 仅在 explicit 且未逐对象 bypass 时启用;warp 不受 trim
状态或 trim bypass 控制。源坐标保持原值,ADM 与 binaural 不预烘焙此变换。
状态或 trim bypass 控制。源坐标保持原值,ADM 与 binaural 不预处理此变换。
地面坐标依次经过 warp、balance,再用于地面声像;顶部坐标和 trim 求值坐标只经过
balance。trim 标量乘到该对象的整条声像增益向量后,再累加到输出声道。LFE 直接通过。
### 12.5 warp 2/3 的环绕折叠
目标为 5.1、5.1.2 或 5.1.4 时,warp 2/3 先把对象渲染到对应的 7.1、7.1.2 或
7.1.4 中间布局,再将后环绕折叠到目标的环绕对。4.0 同样先增加一对后环绕,
中间布局不增加 centre 或 LFE。其他现有布局直接渲染。
中间布局只改变扬声器几何与声像分配。Trim 配置、两层 Balance 和 Auto Trim 的
最大位置补偿仍按最终目标布局选择。例如,5.1.2 使用配置 4,最大位置补偿为
$-2.25$ dB,即使其中间布局是 7.1.2,也继续使用这些参数。中间布局已有独立
side/rear 两对,地面 Y 不再乘 2;Balance 和逐对象 Trim 在中间渲染时求值。
设中间布局输出为 $L_s,R_s,L_{rs},R_{rs}$,最终目标的环绕输出为 $L'_s,R'_s$:
$$
L'_s=L_s+aL_{rs}+bR_{rs},\qquad
R'_s=R_s+bL_{rs}+aR_{rs}.
$$
| 模式 | $a$ | $b$ |
|---|---|---|
| 2:PLIIx | $\sqrt{3}/2$ | $1/2$ |
| 3:Standard(Lo/Ro) | $1$ | $0$ |
两种矩阵都按线性幅度相加,不做折叠后的能量归一化。共同的前方、高度和 LFE
声道按对应位置直接通过。折叠后的对象增益向量进入 §13 的目标增益更新与斜坡,
然后累加对象音频。
完整顺序为:按目标布局选择校准参数 → 在中间布局应用 Balance、Trim 并计算声像
增益 → 折叠水平环绕 → 更新增益斜坡与混音。逐对象 bypass 关闭 Balance 和 Trim,
但仍保留 warp 2/3 的布局选择与折叠。上述模式属于通用扬声器渲染控制;E-AC-3 JOC
公开定义的 warp 值仍为 0/1,源对象轨迹、ADM 和 binaural 不预处理折叠结果。
## 13. OAMD 时间对齐与增益斜坡
OAMD 更新的编码位置为