Sync the kernel copy with the OAMD warp and trim controls

The kernel copy follows the new kernel: the OAMD parser reads the trim
element, the speaker renderer applies warp, per-object trim and the
front-back balance, and the ADM writer carries them into the BWF metadata.
joc_kernel.vcxproj lists the new speaker_trim translation unit and header,
and the copied joc_version.h reports kernel 1.2.0 in the session log.

The component keeps its playback settings, its speaker layout table and
the side/rear channel swap; the stream interface is unchanged, so the
decoder wrapper needs no edit. A stream whose OAMD asks for warp 2/3 now
stops at the speaker renderer with JOC_ERR_NOT_SUPPORTED, as the reference
refuses it.

Builds Release-Static|x64 and |Win32. layout_table_test and channel_swap_test
still pass; the render harness renders a warp-1 stream and reports the
unimplemented mode for a warp-3 stream.
This commit is contained in:
TheM14 committed 2026-11-03 13:35:01 +08:00
1 parent 43b16687cc
commit d35f6abe7a
16 files changed
+824 -40

No files matched your search

+44
View File
@@ -17,6 +17,38 @@ inline constexpr int kAxes = 3;
inline constexpr int kNQ12 = 62;
inline constexpr int kNQ3 = 15;
inline constexpr int kQ15Scale = 32768;
inline constexpr std::uint32_t kTrimElementId = 2;
inline constexpr int kTrimConfigs = 9;
// One of the nine per-configuration trim records of the OAMD trim element.
// ``kAbsent`` means the configuration carries no data (the element only
// carries explicit records when global_trim_mode is 2).
enum class TrimConfigKind : std::uint8_t {
kAbsent = 0,
kDefault,
kDisabled,
kExplicit,
};
struct TrimConfig {
TrimConfigKind kind = TrimConfigKind::kAbsent;
std::uint8_t presence = 0; // b_*_trim_present bits of an explicit record
double centre = 0.0; // dB
double surround = 0.0; // dB
double height = 0.0; // dB
double balance_overhead = 0.0; // bal3d_y_tb, [-1, 1]
double balance_listener = 0.0; // bal3d_y_lis, [-1, 1]
};
// Programme calibration carried by the OAMD trim element: warp mode, global
// trim mode, the nine configuration records and the per-object bypass flags.
struct OamdTrim {
std::uint32_t warp_mode = 0;
std::uint32_t global_trim_mode = 0;
TrimConfig configs[kTrimConfigs];
std::uint32_t object_count = 0;
bool disable_per_object[kMaxSlots] = {};
};
// (the reference's None), i.e. hold the previous position.
struct SlotUpdate {
@@ -39,6 +71,11 @@ struct OamdUpdate {
bool content_bed = false;
bool content_isf = false;
bool content_dynamic = false;
// Trim element of this payload. The element describes the programme, so
// ``has_trim`` only marks the payloads that carry it; a payload without it
// keeps whatever controls the caller already holds.
OamdTrim trim;
bool has_trim = false;
};
class OamdState {
@@ -84,6 +121,13 @@ int q_of(int k, int n);
Status parse_id11(const std::uint8_t* payload, std::size_t payload_size, OamdUpdate* out);
// Parses only the trim element of a payload. ``out`` receives the first trim
// element found; ``*present`` is false when the payload carries none. decode
// paths that need the OAMD calibration but no object state can use this
// without requiring an object element.
Status parse_trim(const std::uint8_t* payload, std::size_t payload_size, OamdTrim* out,
bool* present);
struct BedAssignment {
bool lfe_only = false;
bool standard = false;