Commit Graph
7 Commits
Author SHA1 Message Date
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