Read the OAMD trim element into speaker rendering and ADM
The OAMD parser reads the trim element: warp mode, global trim mode, the nine per-configuration records (centre, surround and height level, the two front-back balances) and the per-object bypass flags. OamdUpdate carries it, so the file task and the streaming step see the same state; a payload without the element keeps the previous controls, and an absent element starts at warp 0 with automatic trim. Speaker rendering reads the controls from OAMD only; neither the CLI nor the frontends offer an override. Eligible layouts leave the floor Y alone at warp 0 and use clamp(2Y, 0, 1) at warp 1, the height layer is never scaled, and warp 2/3 is reported as unsupported where the speaker consumes it. Floor, height and trim evaluation keep separate coordinates: floor Y is balance(warp(Y)), while height Y and trim Y are balance(Y). An explicit configuration contributes a position-dependent scalar for each object, applied before accumulation instead of to the output channels after the mix; automatic, disabled and explicit are mutually exclusive, and a bypassed object keeps its warp but loses balance and trim. Automatic still uses the layout position compensation, disabled uses unity, and layouts without trim semantics stay disabled. LFE passes through, and ADM source positions and binaural rendering are unchanged. The controls travel in ejoc_speaker_controls, a C struct a future decoder can fill without knowing the layout; the layout table now carries the surround and height channel counts and the seven layouts that have trim semantics. The internal ABI goes to version 3 for the new process parameter. The ADM writer mirrors the element into both carriers. AXML gains DolbyAtmosMasterFile with DolbyMasterContentInfo, DolbyTrimModeSetup (one record per configuration, zero values for a disabled one) and DolbyWarpMode. dbmd segment 10 carries the nine 15-byte records (automatic flag, three float32 levels and two sign-magnitude balances), and segment 9 writes the warp code into the low three bits of at[152] while keeping the other packed fields. The task scans the first 64 audio frames for the element, as the reference does, so a duration-limited render still writes it. The bilingual mathematical notes describe the configuration index, the balance map, the three coordinates and the evaluation order; the READMEs state that the controls come from OAMD and that warp 2/3 is refused. ctest covers the element parse, configuration selection, warp 0/1 with the Q15 clamp, the height coordinate, explicit trim and balance, per-object bypass, LFE passthrough, the step's metadata updates and the exact dbmd/AXML bytes. Speaker output over the same objects16 stream is byte-identical to the reference for the seven trimmed layouts and the wider ones, and both ADM carriers of a rendered BWF are byte-identical to the reference writer. The product version goes to 1.2.0; the public ABI stays at 5.
This commit is contained in:
1 parent
20f2e77664
commit
58e3403642
21 files changed
+1597
-48
No files matched your search
+41
-1
@@ -23,7 +23,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
EJOC_ABI_VERSION = 2,
|
||||
EJOC_ABI_VERSION = 3,
|
||||
EJOC_FRAME_SAMPLES = 1536,
|
||||
EJOC_TIMESLOTS = 24,
|
||||
EJOC_SUBBANDS = 64,
|
||||
@@ -35,6 +35,7 @@ enum {
|
||||
EJOC_MAX_PARAMETER_BANDS = 23,
|
||||
EJOC_SPEAKER_BLOCK_SAMPLES = 32,
|
||||
EJOC_SPEAKER_COORDINATES = 3,
|
||||
EJOC_SPEAKER_CONTROLS_VERSION = 1,
|
||||
EJOC_BINAURAL_BLOCK_SAMPLES = 512,
|
||||
EJOC_BINAURAL_INPUT_CHANNELS = 16,
|
||||
EJOC_BINAURAL_OUTPUT_CHANNELS = 2,
|
||||
@@ -123,6 +124,44 @@ metadata_offsets must be nondecreasing and <= sample_count. sample_count must
|
||||
be a multiple of EJOC_SPEAKER_BLOCK_SAMPLES. State and unfinished ramps are
|
||||
preserved across calls.
|
||||
*/
|
||||
|
||||
/*
|
||||
Per-object speaker controls taken from OAMD metadata: warp mode, trim mode,
|
||||
the three trim levels and the two front-back balances. trim_bypass is indexed
|
||||
by object slot (1..15); slot 0 carries the LFE and is unused.
|
||||
|
||||
warp_mode 0 leaves the floor Y coordinate unchanged; mode 1 maps it through
|
||||
clamp(2Y, 0, 1). warp modes 2 and 3 have no speaker implementation and are
|
||||
rejected by the caller that builds this structure.
|
||||
|
||||
trim_mode selects where the gain comes from: automatic applies the layout
|
||||
position compensation, disabled applies no trim, and explicit applies the
|
||||
position-dependent trim from centre_db / surround_db / height_db. A bypassed
|
||||
object keeps its warp but loses the balance and the trim gain.
|
||||
|
||||
Controls may change between calls; each call's metadata events use the
|
||||
controls passed with that call. A null pointer means warp 0, no trim and no
|
||||
balance.
|
||||
*/
|
||||
typedef enum ejoc_speaker_trim_mode {
|
||||
EJOC_SPEAKER_TRIM_AUTOMATIC = 0,
|
||||
EJOC_SPEAKER_TRIM_DISABLED = 1,
|
||||
EJOC_SPEAKER_TRIM_EXPLICIT = 2
|
||||
} ejoc_speaker_trim_mode;
|
||||
|
||||
typedef struct ejoc_speaker_controls {
|
||||
uint32_t struct_size;
|
||||
uint32_t struct_version;
|
||||
uint32_t warp_mode;
|
||||
uint32_t trim_mode; /* ejoc_speaker_trim_mode */
|
||||
double centre_db;
|
||||
double surround_db; /* positive values are treated as zero */
|
||||
double height_db; /* positive values are treated as zero */
|
||||
double listener_balance; /* [-1, 1] */
|
||||
double overhead_balance; /* [-1, 1] */
|
||||
uint8_t trim_bypass[EJOC_MAX_OBJECTS + 1]; /* per object slot, slot 0 unused */
|
||||
} ejoc_speaker_controls;
|
||||
|
||||
EJOC_API uint32_t EJOC_CALL ejoc_speaker_layout_channel_count(uint32_t speaker_bitfield);
|
||||
EJOC_API ejoc_speaker_renderer_handle EJOC_CALL ejoc_speaker_renderer_create(uint32_t speaker_bitfield);
|
||||
EJOC_API void EJOC_CALL ejoc_speaker_renderer_destroy(ejoc_speaker_renderer_handle handle);
|
||||
@@ -139,6 +178,7 @@ EJOC_API int EJOC_CALL ejoc_speaker_renderer_process(
|
||||
const uint8_t* region_indices,
|
||||
const uint8_t* height_enabled,
|
||||
const double* object_gains,
|
||||
const ejoc_speaker_controls* controls,
|
||||
double* output_interleaved);
|
||||
|
||||
EJOC_API ejoc_binaural_renderer_handle EJOC_CALL ejoc_binaural_renderer_create(void);
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#define JOC_VERSION_H
|
||||
|
||||
#define JOC_VERSION_MAJOR 1
|
||||
#define JOC_VERSION_MINOR 1
|
||||
#define JOC_VERSION_MINOR 2
|
||||
#define JOC_VERSION_PATCH 0
|
||||
#define JOC_VERSION_STRING "1.1.0"
|
||||
#define JOC_VERSION_STRING "1.2.0"
|
||||
|
||||
#endif /* JOC_VERSION_H */
|
||||
Reference in new issue
Block a user