Commit Graph
18 Commits
Author SHA1 Message Date
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 17e52a531c Fix JOC passthrough layout and no-previous-state interpolation
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.
2026-11-06 11:53:05 +08:00
TheM14 0820444f45 Fix JOC clipgain, offset_ts, frame status, and renderer state machine
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.
2026-11-06 11:35:59 +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 9e7185fde5 Remove the 4.0 Surround layout and make 4.0 the quad layout 2026-10-29 00:44:03 +08:00
TheM14 56d0b852e7 Align the math notes with the QMF-domain implementation 2026-10-28 19:19:32 +08:00
TheM14 8c96f7ac91 Add the 4.0 Surround and 4.0 Quad speaker layouts 2026-10-27 23:38:29 +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 704ea0897b Fix formula errors in math.md.
Native builds / linux-x64 (push) Failing after 12s
Native builds / macos-arm64 (push) Has been cancelled
Native builds / macos-x64 (push) Has been cancelled
Native builds / windows-x64 (push) Has been cancelled
Native builds / Publish GitHub Release (push) Has been cancelled
2026-09-16 03:13:20 +08:00
TheM14 c6859e6b02 Fix formula errors in math.md.
Native builds / linux-x64 (push) Failing after 9s
Native builds / macos-arm64 (push) Has been cancelled
Native builds / macos-x64 (push) Has been cancelled
Native builds / windows-x64 (push) Has been cancelled
Native builds / Publish GitHub Release (push) Has been cancelled
2026-09-16 02:58:55 +08:00
TheM14 afef6d2c52 Add Sparse JOC decoding support.
Native builds / linux-x64 (push) Failing after 18s
Native builds / macos-arm64 (push) Has been cancelled
Native builds / macos-x64 (push) Has been cancelled
Native builds / windows-x64 (push) Has been cancelled
Native builds / Publish GitHub Release (push) Has been cancelled
2026-09-16 02:51:28 +08:00
TheM14 c8676d7aa3 Fix the syntax in docs 2026-09-11 02:22:36 +08:00
TheM14 b619dee523 Fix the syntax in docs 2026-09-11 02:22:36 +08:00
TheM14 7da3a5eb95 Fix the syntax in math.md 2026-09-11 02:22:36 +08:00
TheM14 887b3e317f Align OAMD metadata delay with decoder output 2026-09-02 22:17:09 +08:00
TheM14 aa3a519f79 Initial public release of JustOneCacophony 2026-09-01 16:31:38 +08:00