Keep only the Rosella and .jochrtf binaural paths
ci / ubuntu-latest (push) Failing after 18s
ci / macos-latest (push) Canceled after 0s
ci / windows-latest (push) Canceled after 0s
ci / release (push) Canceled after 0s

The kernel renders two inputs now: the Rosella .personalized_headphone model and
an already compiled .jochrtf field. The SOFA reader, its compile cache and the
field fit leave the kernel, and the direct SOFA runtime built on them goes with
them: the point-source distance reference, the shoebox image-source model, the
generated FDN tables and the asset archives are all gone. Fitting a SOFA into a
.jochrtf belongs to the offline toolchain.

The compiled-field runtime is the one that predates that work: 64-QMF analysis,
77 hybrid bands, per-object path delays and the project room (image sources plus
the shared unitary FDN) computed in code. It keeps its behaviour and takes the
.jochrtf name throughout: sofa_binaural_renderer.cpp -> jochrtf_renderer.cpp,
binaural_runtime.* -> jochrtf_runtime.*, SofaBinauralRuntime -> JochrtfRuntime,
ejoc_sofa_binaural_* -> ejoc_jochrtf_*.

The room becomes a switch. --jochrtf-room on|off (default on) drives the
enable_early_reflections and enable_late_room flags of the existing room
configuration; off renders the field's direct binaural sound only.
joc_task_config and joc_stream_config drop hrtf_sofa_path, hrtf_cache_dir,
hrtf_cache_policy and hrtf_radius_m, and gain jochrtf_room. The CLI no longer
accepts --sofa-hrtf, --hrtf-cache-policy, --hrtf-cache-dir or --hrtf-radius-m;
without an explicit input the renderer uses HRTF/binaural.personalized_headphone,
and a .jochrtf has to be named through --compiled-hrtf-cache. The SOFA-only unit
tests go with the reader.

Rosella parsing, filterbank, room and timing are untouched. Both .jochrtf modes
reproduce the Python reference sample for sample, and ctest passes.
This commit is contained in:
TheM14 committed 2026-11-01 19:19:00 +08:00
1 parent 29f4f83c29
commit 20f2e77664
46 files changed
+1180 -8377

No files matched your search

+8 -11
View File
@@ -6,8 +6,8 @@ The C++ implementation of JustOneCacophony: an execution core for E-AC-3 JOC
bitstream parsing, object reconstruction and rendering. It extracts EMDF, ID14 JOC
parameters and ID11 OAMD metadata from E-AC-3 syncframes, combines them with the
core 5.1 PCM decoded by FFmpeg to rebuild the LFE and 15 object signals, and writes
ADM BWF, a WAV for a chosen speaker layout, or a binaural WAV rendered directly from
full SOFA HRIRs (or from a compiled `.jochrtf` directional field).
ADM BWF, a WAV for a chosen speaker layout, or a binaural WAV using a compiled HRTF
directional field.
This is research code, not a complete, standard-conformant or production JOC
decoder. It covers the bitstream forms it implements and reports an explicit error
@@ -30,7 +30,7 @@ The heaviest binaural loops are **runtime-dispatched**: one binary carries sever
ISA variants and picks the widest one at startup from CPUID/XGETBV, with the output
byte-identical either way (see [SIMD dispatch](docs/simd.en.md)). `JOC_ENABLE_AVX2` /
`JOC_ENABLE_AVX512` (both ON by default) only decide whether those units are linked
in: carrying the AVX2 unit buys 12.4% on the SOFA binaural kernel and 1.8% on
in: carrying the AVX2 unit buys 12.4% on the .jochrtf binaural kernel and 1.8% on
Rosella, while a CPU without AVX2 still runs the baseline (SSE2) path. To produce a
baseline-only binary:
@@ -77,9 +77,10 @@ joc_cli input.m4a -o out/adm.wav # explicit output
joc_cli input.m4a --speaker-layout 5.1 # -> output/<name>.5.1.wav
joc_cli input.m4a --speaker-layout 7.1.4 --speaker-output out/714.wav --speaker-format int24
# Binaural (HRTF defaults to <exe>/HRTF/binaural.sofa, then <exe>/HRTF/binaural.personalized_headphone)
# Binaural (defaults to <exe>/HRTF/binaural.personalized_headphone)
joc_cli input.m4a --binaural
joc_cli input.m4a --binaural --sofa-hrtf HRTF/other.sofa # another SOFA
joc_cli input.m4a --binaural --compiled-hrtf-cache HRTF/subject.jochrtf # offline compiled field
joc_cli input.m4a --binaural --compiled-hrtf-cache HRTF/subject.jochrtf --jochrtf-room off
joc_cli input.m4a --binaural --personalized-headphone # Rosella personalisation
# -> output/<name>.binaural.wav
joc_cli input.m4a --binaural --personalized-headphone --rosella-filterbank 2 # captured bank
@@ -100,7 +101,7 @@ defaults. A run always writes `<output>.report.json` (`--report-json` overrides
path: `1` (default) is the public 13-tap / 6-slot bank, `2` is the captured 11-tap /
3-slot bank. Their latencies are 961 and 448 samples, and each keeps its own
coefficients, history and flush capacity. The option only applies to the Rosella
model; the SOFA and `.jochrtf` paths reject it. See
model; the `.jochrtf` path rejects it. See
[Rosella filterbank](docs/rosella_filterbank.en.md).
**Differences from the reference:** `--backend python` and the metadata sidecars
@@ -224,11 +225,7 @@ The extra pair's **identity** never reaches the DSP (section 10.1): when the dep
renders, with the bed mapping following the channel codes the `chanmap` declares. The bed
layout the OAMD declares may hold more channels than the core substream codes (a 9.1.6 bed
with a 5.1 core, for example): only a core channel missing from that layout counts as a
mismatch. For bed-only content the 15 JOC object slots are the bed channels, each rendered as
a point source at the fixed position its channel label defines (ETSI TS 103 420 table B.10);
speaker, ADM and binaural output share those source coordinates and never re-place them per
layout, while LFE keeps its separate path. When one audio frame holds several EMDF
containers carrying ID11/ID14, they
mismatch. When one audio frame holds several EMDF containers carrying ID11/ID14, they
are scored by the association rule of section 8.2 and its Table 56: a container whose OAMD and JOC
payloads share a group id and whose ID14 parses completely wins, then one whose ID14 merely parses;
only a unique best score is used and the others are recorded as a diagnostic