The ADM writer only exported object positions, so the size, gain and divergence
present in the E-AC-3 JOC metadata never reached the ADM BWF.
build_adm_tracks now keeps the per-object render state that frame_state()
already produces (gain, size, divergence, snap). The state is carried across
frames without an OAMD payload and a snapshot is attached to every ADM
keyframe; inactive objects write gain 0 so their PCM is muted in the ADM.
Divergence follows the speaker renderer's per-payload behaviour: it is taken
from the current payload and is 0 when the extended element does not carry it,
rather than holding a stale value.
adm_serializer writes the metadata on each audioBlockFormat:
- size -> width/height/depth (relative units 0..1, OAMD width/depth/height
order; all three are written together);
- gain -> gain gainUnit="linear" (only when it is not unity);
- divergence -> objectDivergence positionRange (only when non-zero).
Defaults (point source, 0 dB, no divergence) omit the elements, so existing
outputs are unchanged.
Verified on a 30 s E-AC-3 JOC excerpt: PCM and the default axml stay
byte-identical to the previous writer, the ADM validator passes, and a
metadata-override ADM carries width/height/depth with unchanged PCM. The
speaker controls tests still pass.
A frame without JOC metadata (status 8) used to select passthrough in every
state, the middle of a stream included. Passthrough replaces the object render
with the delayed core planes, and the object synthesis restarts from silence on
the next frame, so every such frame produced a step at the frame boundary and a
second one when the metadata came back.
Status 8 now follows the state machine like the other invalid statuses: state 0
(no valid frame rendered yet, i.e. plain E-AC-3 or before the first JOC frame)
keeps the passthrough, state 3 (mid-stream) selects hold and reuses the previous
object matrices, so the bed and the objects stay continuous. The compatibility
note in the renderer records the old and the new state machine and states that
the choice is a concession for non-standard streams, not a normative reading.
A real E-AC-3 JOC stream carried one ID14 payload that ends inside joc_data:
the header, clipgain, sequence counter and object parameters are complete,
only the per-object matrices are missing. The bit reader used to raise
IndexError there, so the metadata scan and the frame loop stopped instead of
playing.
The overrun now raises a typed JocTruncatedPayload, and parse_joc classifies
it as frame status 7 after the 12-bit joc_header: the parsed fields are kept
and the renderer takes its existing invalid-frame path (hold the previous
matrices). A payload too short for the header still raises, the container
score ignores status 7, and the metadata summary reports a frame-status
histogram.
- Add oamd_params/oamd_math for OAMD metadata state, ISF matrix assembly,
runtime size-table generation and bed routing.
- Apply per-block gain/inactive, zone/elevation, size, snap, divergence,
position refinement, priority budget, ISF and bed distribution in the
speaker renderer.
- Compute gain, size, priority, position, refinement and delta values from
formulas; generate the size spread kernel from speaker-layout geometry.
- Derive bed labels, routing, reference positions and automatic attenuation
from speaker layouts.
- Correct the surround positions of 5.1, 5.1.2 and 5.1.4 and add the 6.0
speaker layout.
- Update README, data README and math notes for the metadata path and
runtime table generation.
Interpolate the second half of a two-data-point frame from dp0 to dp1 when
the object has no previous matrix; a single data point keeps the hard cut.
Rebuild the passthrough frame as the 8-plane core order L, R, C, LFE, Ls,
Rs, (Lrs, Rrs) written to output slots 0..7, all delayed by 1217 samples,
and keep that 8-plane history updated on every frame. Frames without JOC
metadata always take this passthrough path, and a core channel count
change clears the LFE ring while keeping the clipgain ramp state.
Reject unsupported downmix configurations with a structured variant error
in the metadata scan, and score ID14 payloads by the frame status instead
of accepting any lenient parse.
Update the math notes and README for the two-data-point interpolation
without a previous state and the 8-plane passthrough output.
Decode clipgain multiplicatively as 2^(x-4)*(1 + y/32), keep the raw
5-bit offset_ts values and reject frames whose offsets leave 0..23 or are
not strictly increasing, and read the EMDF sample offset as
variable_bits(11). Report parse errors through the frame status: 2
unsupported downmix configuration, 3 object count clamped, 4 parameter
band index, 5 invalid offset_ts, 6 trailing data after byte padding.
Correct the 15/9/5/3 subband-to-parameter-band rows.
Apply the clipgain ramp to the LFE samples before the 1217-sample delay,
stop fading objects in from zero when they have no previous matrix, and
keep disappeared objects published with an all-zero matrix until they
reappear.
Render each frame through the seq state machine: hold the previous
matrices while the decoder is unsynchronized, hard cut on seq 0 or a core
channel count change, and pass the delayed core PCM through when no JOC
metadata is present. Keep the 16-channel output as LFE + 15 objects so
CBA bed channels stay on the fixed-position object path that the ADM,
speaker, and binaural backends already consume.
Update the math notes and README for the multiplicative clipgain, the
no-previous-state interpolation, the LFE gain ramp, and the frame-level
decoding behavior. State that E-AC-3 input without JOC metadata is
outside the supported scope.
- Render 5.1-family and 4.0 layouts through expanded surround geometry before folding.
- Keep trim, balance and automatic position compensation tied to the final target layout.
- Preserve height channels, LFE passthrough and per-object trim bypass behavior.
- Update the bilingual README and mathematical documentation.
Read warp mode from OAMD instead of always scaling the floor Y coordinate.
For eligible layouts, mode 1 uses clamp(2Y, 0, 1), while mode 0 leaves Y
unchanged. Height coordinates are not scaled. Modes 2/3 remain explicitly
unsupported, and the CLI provides no warp override.
Keep separate coordinates for floor panning, height panning and trim
evaluation, with W denoting warp and B denoting front-back balance:
floor Y = B(W(Y))
height Y = B(Y)
trim Y = B(Y)
Apply explicit trims as a position-dependent gain for each object before
accumulation, replacing fixed gains applied to output channels after mixing.
Automatic, disabled and explicit trim modes are mutually exclusive.
Per-object bypass disables balance and trim while retaining warp.
Update controls at OAMD metadata events and retain the previous controls
when a payload has no trim element. Keep source trajectories and binaural
rendering unchanged.
Write the OAMD warp code into dbmd segment 9 while preserving the other
packed fields. Update the bilingual mathematical notes, README files and
code comments to describe parameters and rendering behavior.
Checked: warp 0/1, Y clipping, height coordinates, balance/trim ordering,
per-object bypass, metadata updates, bed positions and LFE passthrough.
Select the trim configuration that applies to the output layout from its
surround and height speaker counts:
cfg = kappa_f(surrounds) + 3 * kappa_h(heights)
Trim and balance apply to seven layouts: 2.0, 3.1, 4.0, 5.1, 5.1.2, 5.1.4
and 7.1. Wider layouts are left untrimmed.
An explicit configuration contributes a static level for the centre,
surround and height groups, which multiplies the panning gains per output
channel. Automatic and disabled configurations contribute no static
level: the attenuation an automatic configuration describes is already
applied per object by the layout position compensation.
An explicit configuration also contributes the two front-back balance
values. Writing n = round(16 |b|) and s = n / 18, each balance
reparameterises the OAMD front-back axis in [0, 1]:
y <= 0.05 or y >= 0.95 -> y
y < 0.5, b > 0 -> (1 + s) y - 0.05 s
y >= 0.5, b > 0 -> (1 - s) (y - 0.5) + 0.5 + 0.45 s
y < 0.5, b < 0 -> (1 - s) y + 0.05 s
y >= 0.5, b < 0 -> (1 + s) (y - 0.5) + 0.5 - 0.45 s
The map is monotonic onto [0.05, 0.95], keeps both walls fixed, and needs
no clamping. Height blends the listener-plane and overhead values before
panning; the horizontal and vertical coordinates are untouched.
Warp is not read here: it selects a downmix mode and does not enter the
speaker path.
Parse the trim element: warp_mode, global_trim_mode, the nine
per-configuration trim_balance_presence records, and the per-object
bypass flags. Select the configuration that applies to a layout from
its surround and height speaker counts:
cfg = kappa_f(surrounds) + 3 * kappa_h(heights)
kappa_f: 0 -> 0, 2..3 -> 1, otherwise 2
kappa_h: 0 -> 0, 2 -> 1, otherwise 2
Write the configuration to both carriers:
* AXML gets a DolbyAtmosMasterFile container holding
DolbyMasterContentInfo, DolbyTrimModeSetup (one records entry per
configuration with centerTrim, surroundTrim, heightTrim and the two
balance fields) and DolbyWarpMode.
* Segment 10 of the dbmd chunk gets the nine 15-byte records: bit 0
is the automatic flag, and an explicit record carries three float32
trims followed by two sign-magnitude balance bytes.
Configurations left at default keep the automatic flag and carry no
value elements.
The runtime renders two inputs now: the Rosella .personalized_headphone model and
an already compiled .jochrtf field. SOFA import, the full-HRIR direct renderer
and the SOFA -> .jochrtf fitting compiler leave this checkout; they continue as
an offline tool that only produces caches this repository loads.
The .jochrtf renderer goes back to the implementation that predates the direct
SOFA work: 64-QMF analysis, 77 hybrid bands, per-object hybrid path delays and
the project room (six first-order images plus the shared FDN tail) computed in
code. It is restored verbatim under the .jochrtf vocabulary
(SofaBinauralBackend -> JochrtfBackend) and gains one switch:
--jochrtf-room on|off, off by default. With the room off the renderer outputs
only the field's direct binaural sound, and in either mode it reads no audio
assets.
Because the room is computed in code again, the generated sofa-room*.npz assets
and the modules only the SOFA path used are removed (sofa_canonical, sofa_hrir,
sofa_direct_backend, sofa_room, hybrid_paths, partitioned_convolution,
point_source, compile_hrtf, generate_sofa_room). data/ keeps the decode tables
and the Rosella filterbanks.
The CLI drops --sofa-hrtf, --hrtf-radius-m, --sofa-interpolation,
--hrtf-cache-policy, --hrtf-cache-dir, --sofa-room, --sofa-room-preset and
--source-reference-distance-m. A .jochrtf is still explicit through
--compiled-hrtf-cache, and the default binaural input is the personalized model.
Rosella parsing, filterbank, room and timing are untouched and its output stays
bit-identical. The .jochrtf path reproduces the pre-SOFA renderer sample for
sample, with the room on and with it off.
SOFA and explicit .jochrtf inputs now render direct sound by default.
--sofa-room enables the project image-source/FDN room, with the compact
preset for Near/Mid and the original large room for Far.
- preserve native HRIR timing and apply Data.Delay once
- remove external reference configuration, radial head synthesis and the
artificial centre response
- ship both generated float64 room assets and their generator
- retain .jochrtf as an explicit lightweight input and offline export
- keep personalized headphone processing unchanged and update bilingual
documentation
Checked: independent direct/reflection convolution, FDN FIR/recursive
agreement, fractional delay and metadata timing, chunk invariance,
8 bit-exact personalized regressions, CLI smoke tests, and full-song
D1/D2 renders of two tracks.
A bed channel is a fixed source: its PCM is an object at the position its
OAMD speaker label names, so the coordinate comes only from the label
(ETSI TS 103 420 V1.2.1 clause B.2.1.4 table B.10) and never from the
target output layout.
- src/bed_layout.py carries table B.10 for all seventeen labels, including
Tfl/Tfr at (±1, 1, 1), Tbl/Tbr at (±1, -1, 1) and Lw/Rw at Y = 21/31
(0,677419); LFE and LFE2 are recorded but stay out of the object slots
- src/speaker_renderer.py sends the bed slots through the same point-source
path as dynamic objects at those fixed positions; the layout region-0
anchor lookup is gone, so every layout and the binaural timeline share
one source position per bed channel
- src/oamd_bits.py expands the 17-bit non-standard bed mask in table 12
channel order (RC_L first, RC_LFE2 last); both mask expansions are now
single helpers, standard_bed_channels and nonstandard_bed_channels
- src/metadata.py reports the bed coverage mismatch only when a bed is
declared, so an object-only program no longer logs it on every frame
- README.md and README.en.md describe bed rendering by channel label
instead of by output layout
Checked: table B.10 coordinates, table 12/13 channel order and masks,
object slot order, identical source positions across all eleven speaker
layouts plus the binaural timeline and the ADM tracks, and LFE passthrough;
a 180 s 9.1.6 bed stream renders to 25-channel ADM BWF with all fifteen
objects static at those positions.
SOFA inputs now use delay-aligned local interpolation and partitioned
convolution instead of compiling a compressed directional field.
- preserve full FIR support, complex phase and explicit delay handling
- add log-magnitude/phase and local magnitude-corrected interpolation
- support Near/Mid/Far with a shared calibration anchor
- retain .jochrtf as an explicit lightweight input and offline export
- keep personalized headphone rendering unchanged
- update the CLI, reports and bilingual documentation
Checked: 21 automated tests, 8 bit-exact personalized regressions,
and full-song D2 renders in Near/Mid/Far.
The Rosella path now chooses its filterbank. Bank 1 is the public bank
the reference implementation has always used (13 taps / 6 slots,
961 samples); bank 2 is the captured bank the reference headphone
renderer actually runs (11 taps / 3 slots, 448 samples).
- src/rosella_captured_filterbank.py implements the four half-steps in
float64/complex128; the captured prototype, rotation and hybrid
coefficients live in data/rosella_captured_kernels.npz
- src/rosella_bank.py owns the choice: both banks expose the same four
stages, each with its own coefficients, history and latency
- RosellaBinauralRenderer takes filterbank= and derives the startup
skip, the flush capacity and the report fields from it
- --rosella-filterbank 1|2 selects the bank, default 1; it is rejected
for the SOFA and .jochrtf inputs instead of being ignored
- document both banks in docs/rosella_filterbank.{md,en.md}, and point
the binaural docs, the data README and the options tables at it
Checked: the captured stages reproduce the reference vectors the C++
core checks (within 1e-10), an impulse returns at 961 and 448 samples,
and chunking, reset and bank independence hold for both.