Render SOFA HRIRs directly and place bed channels by their labels
ci / ubuntu-latest (push) Failing after 11s
ci / macos-latest (push) Canceled after 0s
ci / windows-latest (push) Canceled after 0s
ci / release (push) Canceled after 0s

Two changes that belong to the same reproduction model: a bed channel has
one position, defined by its label, and a SOFA set keeps the impulse
responses it was measured with.

CBA bed channels: the position comes from the channel's label in ETSI
TS 103 420 Table B.10, not from the layout the decoder is asked to render
to. The per-layout anchor table displaced bed channels onto the nearest
target speaker, which silently moved content whenever the target layout
changed.

- Drop the anchor table and the geometry lookup; bed_channel_q15 is the
  only source of bed positions, so stream and task no longer need a
  layout to ask for one
- Keep the 17-bit non-standard bed mask in channel order, as Table 13 /
  TS 103 190-2 Table 65 transmit it
- Exclude LFE channels from the object list while keeping them in the
  coverage mask
- Cover the Table B.10 coordinates, the q15 encoding, the 10-bit and
  17-bit masks and the LFE split in tests

SOFA rendering: compiling a SOFA set into a fifth-order directional field
threw away the measured impulse response - the SH projection, the
64-QMF/77-hybrid round trip and the synthetic room replaced it. The full
IRs are now kept and rendered as such, with the reproduction defined by a
configuration that names a personalized model rather than by the renderer
itself.

- Add SphericalMesh: incremental convex hull over the measurement
  directions, barycentric weights inside the containing triangle and
  spherical Voronoi areas for the centre spectrum
- Add FullHrirField: rfft of the selected shell, 200-1500 Hz phase fit for
  the delay, delay-aligned spectra, log-magnitude/phase or MCA
  interpolation, rigid-sphere radial ratio, recording origin and the
  common FFT/2 latency
- Add Uniform/MultiSourcePartitionedConvolver: block 128, numpy FFT
  conventions, zero-fade filter rebuild from the blocks in flight
- Move the Rosella reference arithmetic (profile geometry, direction
  basis, direct gains and room send, table-A room) out of the renderer
  into rosella_reference so both renderers share it
- Add ReferenceEnvironment and SofaReferenceRuntime: JSON configuration
  with model hash and distance-profile mapping, level calibration over
  equal-area directions, the reference room, 1536-sample batching and a
  single latency removal
- Keep .jochrtf an explicit input and the SOFA compile step behind
  --hrtf-cache-policy/--hrtf-cache-dir; add --reference-config and
  --sofa-interpolation, and make --hrtf-radius-m optional for a single
  shell
- Cover the mesh weights and Voronoi areas, the sphere series and the
  partitioned convolver with reference values in tests
- Document both rules in the READMEs and the binaural notes

Rosella renders stay byte-identical (d5877e89...) and so do renders of
the legacy compiled path (6f0a75d2...). Direct SOFA renders match the
Python reference to 1e-4 in level; the residual comes from the
barycentric solve (analytic inverse here, LAPACK there) on near-degenerate
triangles.
This commit is contained in:
TheM14 committed 2026-11-01 02:54:55 +08:00
1 parent 34a722f56a
commit fd842db26f
27 files changed
+4746 -1065

No files matched your search

+7 -3
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 using a compiled HRTF
directional field.
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).
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
@@ -224,7 +224,11 @@ 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. When one audio frame holds several EMDF containers carrying ID11/ID14, they
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
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