Sync the Rosella filterbank choice into the plugin and the fork
The kernel can now render the Rosella path through either bank; expose that choice in both front ends with the same values and the same default. - plugin: joc-rosella-filterbank = 1|2 (public|captured); unset means the kernel default (the public bank), and it applies only to joc-hrtf-source=rosella, logging a warning otherwise - fork: --ad-joc-rosella-filterbank, the same values and default; it sits in the ad_joc option group, so it is read only when ad_joc decodes a Rosella model - log the bank actually selected (public|captured) on both paths - add a bank-2 case to tools/verify_parity.ps1 - document the key in both READMEs and the example config Checked: the plugin builds, the option parser covers the numeric and named spellings plus invalid values, and for both banks the plugin's PCM is bit-identical to joc_cli with --rosella-filterbank 1|2.
This commit is contained in:
1 parent
a9cbffa1cf
commit
ecf14d8c32
12 files changed
+64
No files matched your search
@@ -129,6 +129,7 @@ ad-joc-binaural = yes # 默认就是 yes(双声道输出)
|
||||
ad-joc-hrtf = C:/HRTF/binaural.sofa # 可省:会自动找
|
||||
ad-joc-layout = 7.1 # 仅 binaural=no 时使用
|
||||
ad-joc-mode = mid
|
||||
ad-joc-rosella-filterbank = 1 # Rosella 输入:1=公开版(默认),2=捕获版
|
||||
ad-joc-gain-db = 0
|
||||
```
|
||||
|
||||
@@ -140,9 +141,14 @@ ad-joc-gain-db = 0
|
||||
| `--ad-joc-hrtf` | SOFA / Rosella / `.jochrtf` 路径 | 空(自动搜索) |
|
||||
| `--ad-joc-layout` | `2.0` `3.1` `4.0` `5.1` `7.1` `5.1.2` `5.1.4` `7.1.2` `7.1.4` `9.1.4` `9.1.6`| 7.1 |
|
||||
| `--ad-joc-mode` | near / far / mid | mid |
|
||||
| `--ad-joc-rosella-filterbank` | 1 / 2(或 public / captured) | 1(公开版) |
|
||||
| `--ad-joc-gain-db` | -60 … 12 | 0 |
|
||||
| `--ad-joc-int24` | yes / no | no |
|
||||
|
||||
`--ad-joc-rosella-filterbank=2` 只在 `--ad-joc-hrtf` 指向 `.personalized_headphone` 时生效:
|
||||
`1` 是 13 taps / 6 slots 的公开滤波器组,`2` 是 11 taps / 3 slots 的捕获版(与参考渲染器
|
||||
一致、延迟 448 samples)。SOFA 与 `.jochrtf` 输入忽略该选项并给一条 warning。
|
||||
|
||||
`--ad-joc-int24` 把输出量化到渲染器的 24-bit 规则(与上游前端的 int24 交付一致):
|
||||
clip 到 [-1,1]、乘 8388607、向零截断、取低 24 位,再按 `n / 2^23` 读回。默认关闭,
|
||||
输出就是渲染器的 float32。
|
||||
|
||||
@@ -66,6 +66,9 @@ const struct m_sub_options ad_joc_conf = {
|
||||
{"layout", OPT_STRING(layout), .flags = M_OPT_FILE},
|
||||
{"mode", OPT_CHOICE(binaural_mode,
|
||||
{"near", 1}, {"far", 2}, {"mid", 3})},
|
||||
{"rosella-filterbank", OPT_CHOICE(rosella_filterbank,
|
||||
{"1", 1}, {"public", 1},
|
||||
{"2", 2}, {"captured", 2})},
|
||||
{"gain-db", OPT_DOUBLE(gain_db), M_RANGE(-60.0, 12.0)},
|
||||
{"int24", OPT_BOOL(int24)},
|
||||
{0}
|
||||
@@ -77,6 +80,7 @@ const struct m_sub_options ad_joc_conf = {
|
||||
.hrtf = "",
|
||||
.layout = "7.1",
|
||||
.binaural_mode = 3,
|
||||
.rosella_filterbank = 0,
|
||||
.gain_db = 0.0,
|
||||
},
|
||||
};
|
||||
@@ -790,6 +794,15 @@ static struct mp_decoder *create(struct mp_filter *parent,
|
||||
cfg.input = JOC_STREAM_IN_EAC3;
|
||||
cfg.output = binaural ? JOC_STREAM_OUT_BINAURAL : JOC_STREAM_OUT_SPEAKER;
|
||||
cfg.binaural_mode = (uint32_t)opts->binaural_mode;
|
||||
/* 0 is the kernel's default (the public bank); a SOFA or .jochrtf input
|
||||
* ignores the field, so say so instead of leaving the option a no-op. */
|
||||
cfg.rosella_filterbank = (uint32_t)opts->rosella_filterbank;
|
||||
if (binaural && hrtf_kind != HRTF_ROSELLA && opts->rosella_filterbank != 0)
|
||||
MP_WARN(da, "--ad-joc-rosella-filterbank only applies to a Rosella "
|
||||
"(.personalized_headphone) HRTF; ignoring it\n");
|
||||
if (binaural && hrtf_kind == HRTF_ROSELLA)
|
||||
MP_VERBOSE(da, "rosella filterbank: %s\n",
|
||||
opts->rosella_filterbank == 2 ? "captured" : "public");
|
||||
cfg.gain_db = opts->gain_db;
|
||||
cfg.object_delay_samples = 1473;
|
||||
if (binaural) {
|
||||
|
||||
@@ -21,6 +21,7 @@ struct ad_joc_params {
|
||||
char *layout; /* speaker layout name, e.g. "7.1" or "9.1.6" */
|
||||
bool int24; /* quantise the output to the renderer's int24 rule */
|
||||
int binaural_mode; /* JOC_BINAURAL_NEAR(1) / FAR(2) / MID(3) */
|
||||
int rosella_filterbank; /* Rosella filterbank: 0 default (public), 2 captured */
|
||||
double gain_db;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user