Commit Graph
9 Commits
Author SHA1 Message Date
TheM14 76074a05ba Put the CBA bed height row on the 62-level grid and render PCM 2.0/5.1/7.1 binaurally
The height row of the bed reference coordinates sits at ADM 62-level steps
15/62 and 47/62, not at the room corners: Tfl/Tfr, Tsl/Tsr and Tbl/Tbr move
from x = -1 / 1 to -0.516113 / 0.516113, which puts their Q15 numerators at
7928 / 24840 so every bed channel lands on its reference position instead of
being snapped to the nearest neighbour. Lw/Rw keep Y = 21/31 (5285). The
ADM-to-Q15 conversion scales by 32768, the full scale the renderer divides
by, so half-step positions such as 16384 and 7928 are no longer one count
low.

5.1, 5.1.2 and 5.1.4 keep their single surround pair at the rear corners
(y = 32767) instead of y = 16384. That family has no side pair, so its Ls/Rs
is the rear pair, which is the same point the multichannel PCM virtual
sources use; 7.1.x and 9.1.x keep Ls/Rs at 0.5 and Lrs/Rrs at 1.

Add the multichannel PCM binaural path. src/multichannel_binaural.py maps the
2.0 / 5.1 / 7.1 WAV channel order to synthetic objects (LFE on slot 0, the
full-band channels on slots 1..N in ffmpeg order, the remaining slots
silent), resamples the input to the native 48 kHz and drives the Rosella or
.jochrtf adapter. FixedPositionTimeline gives those static directions the
positions_at interface the OAMD timeline exposes, and both adapters accept an
optional fixed_positions argument instead of deriving a timeline from bed
labels.

Checked: the fifteen bed labels convert to the reference Q15 triples, the nine
output layouts agree with the layout table region by region, bed routing and
the derived direct bed labels are unchanged for every layout, and the
regression suite passes.
2026-11-18 17:05:30 +08:00
TheM14 42a05d7722 Implement OAMD metadata rendering and runtime table generation
- 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.
2026-11-08 14:01:07 +08:00
TheM14 4aef8db36e Implement PLIIx and Lo/Ro folding for warp modes 2/3
- 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.
2026-11-03 13:02:41 +08:00
TheM14 0e28cd085c Honor OAMD warp modes and position-dependent speaker trims
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.
2026-11-03 00:11:23 +08:00
TheM14 8424e6bdfb Apply the OAMD trim and front-back balance in speaker rendering
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.
2026-11-02 17:18:53 +08:00
TheM14 26e84569c2 Place CBA bed channels at the positions their labels define
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.
2026-11-01 01:34:05 +08:00
TheM14 5c4f876411 Read the OAMD bed layout and place bed objects at their fixed positions 2026-10-30 03:59:52 +08:00
TheM14 a1853f2dc5 Add JOC downmix configurations 0..4, cross-layer checks, and drop the native core 2026-10-16 19:46:24 +08:00
TheM14 aa3a519f79 Initial public release of JustOneCacophony 2026-09-01 16:31:38 +08:00