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.