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:
TheM14 committed 2026-10-31 02:29:23 +08:00
1 parent a9cbffa1cf
commit ecf14d8c32
12 files changed
+64

No files matched your search

+8
View File
@@ -317,6 +317,14 @@ struct Plugin {
settings.speaker_layout = config.layout;
settings.hrtf_source = (config.hrtf_source == 0) ? joc_decode::HrtfSource::kSofa
: joc_decode::HrtfSource::kRosella;
settings.rosella_filterbank =
static_cast<std::uint32_t>(config.rosella_filterbank);
if (config.rosella_filterbank != 0 &&
settings.hrtf_source != joc_decode::HrtfSource::kRosella) {
joc_log::line("config: joc-rosella-filterbank=%d ignored: it applies to "
"joc-hrtf-source=rosella only",
config.rosella_filterbank);
}
settings.hrtf_file = config.hrtf_file;
if (settings.hrtf_file.empty() && settings.output == joc_decode::Output::kBinaural) {
settings.hrtf_file = default_hrtf_file(config);
+7
View File
@@ -1025,6 +1025,8 @@ bool Engine::start(const std::string& input_path, const Settings& settings, std:
config.speaker_layout_name = settings.speaker_layout.c_str();
config.speaker_metadata_offset = 0;
config.binaural_mode = settings.binaural_mode;
// 0 selects the kernel's default (the public bank); the SOFA path ignores it.
config.rosella_filterbank = settings.rosella_filterbank;
// The filter bank tables live in the library (hrtf::builtin_kernels in
// kernel_tables.cpp), so there is no table path to configure and none is
// passed: the field stays null. The same goes for the compiled-HRTF cache:
@@ -1087,6 +1089,11 @@ bool Engine::start(const std::string& input_path, const Settings& settings, std:
joc_log::line("core: stream created, %u output channel(s), layout=%s, hrtf=%s", impl.channels,
settings.speaker_layout.c_str(),
hrtf_in_use.empty() ? "(none)" : hrtf_in_use.c_str());
if (settings.output == Output::kBinaural &&
settings.hrtf_source == HrtfSource::kRosella) {
joc_log::line("core: rosella filterbank=%s",
settings.rosella_filterbank == 2u ? "captured" : "public");
}
// ffmpeg's stderr lands next to the component rather than in whatever working
// directory the host process happens to have. The two children write separate
+3
View File
@@ -65,6 +65,9 @@ struct Settings {
unsigned audio_index = 0;
std::string speaker_layout = "7.1";
HrtfSource hrtf_source = HrtfSource::kSofa;
// Filterbank of the Rosella path: 0 = the renderer's default (public bank),
// 2 = the captured bank. Only the Rosella input reads it.
std::uint32_t rosella_filterbank = 0;
// Empty means the default file in the default folder, see resolve_hrtf_file().
std::string hrtf_file;
std::string hrtf_cache_dir; // SOFA compile cache (disk policy)
+8
View File
@@ -91,6 +91,14 @@ Config parse_config(const std::string& script_opts, std::string* warnings) {
} else {
unsupported(key + "=" + value);
}
} else if (key == "joc-rosella-filterbank") {
if (value == "1" || value == "public") {
config.rosella_filterbank = 1;
} else if (value == "2" || value == "captured") {
config.rosella_filterbank = 2;
} else {
unsupported(key + "=" + value);
}
} else if (key == "joc-hrtf") {
config.hrtf_file = value;
} else if (key == "joc-mode") {
+3
View File
@@ -13,6 +13,9 @@ struct Config {
std::string layout = "7.1";
// 0 = SOFA, 1 = Rosella personalized headphone model.
int hrtf_source = 0;
// Rosella filterbank: 0 = the renderer's default (public bank), 2 = captured.
// Only the Rosella input reads it; the SOFA and .jochrtf paths ignore it.
int rosella_filterbank = 0;
std::string hrtf_file; // empty: <plugin dir>\\HRTF\\binaural.<ext>
// 1 = near, 2 = far, 3 = mid (the renderer's own default).
int binaural_mode = 3;