From b43ee8f6853b76f99819a696f5b7c5f7d02410ce Mon Sep 17 00:00:00 2001 From: TheM14 Date: Fri, 30 Oct 2026 04:20:06 +0800 Subject: [PATCH] Sync the kernel copy with the bed layout map and the stream path --- README.en.md | 4 +- README.md | 2 +- kernel/joc_kernel.vcxproj | 2 + kernel/src/adm/adm_metadata.cpp | 8 +++ kernel/src/adm/adm_tracks.cpp | 15 ++++++ kernel/src/adm/adm_tracks.h | 14 ++++++ kernel/src/binaural/binaural_runtime.h | 5 ++ kernel/src/joc_bitstream/joc_parser.cpp | 57 +++++++++++++++------- kernel/src/oamd/oamd_parser.cpp | 9 ++++ kernel/src/oamd/oamd_parser.h | 4 ++ kernel/src/speaker/speaker_step.cpp | 8 +++ kernel/src/speaker/speaker_step.h | 4 ++ kernel/src/stream/stream.cpp | 41 ++++++++++++++++ kernel/src/stream/stream.h | 4 ++ kernel/src/task/task.cpp | 59 +++++++++++++++++++++-- kernel/src/timeline/position_timeline.cpp | 4 ++ kernel/src/timeline/position_timeline.h | 13 +++++ 17 files changed, 227 insertions(+), 26 deletions(-) diff --git a/README.en.md b/README.en.md index 9f46cbf..efab57d 100644 --- a/README.en.md +++ b/README.en.md @@ -169,8 +169,8 @@ every container in the library, which is where the volume comes from. ## Known limitations * ADM BWF output is not implemented. -* Speaker layouts go up to 9.1.6 (16 channels), which is the renderer's own limit — there is no - 22.2, see [Speaker layouts and channel order](#speaker-layouts-and-channel-order). +* Speaker layouts go up to 9.1.6 (16 channels), the renderer's own output limit; see + [Speaker layouts and channel order](#speaker-layouts-and-channel-order). * A multichannel layout declares no speaker positions in Properties, and the per-chunk map used for playback is only foobar2000's default for the channel count; output mapping is up to the user's channel assignment (same section). diff --git a/README.md b/README.md index 147f886..48a8782 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ pwsh -File tools/package.ps1 # 两个架构,打包到 dist\*.fb2k-c ## 已知限制 * 不实现 ADM BWF 输出。 -* 扬声器布局到 9.1.6(16 声道)为止;内核输出上限就是 16 声道,没有 22.2,见 +* 扬声器布局到 9.1.6(16 声道)为止;内核输出上限就是 16 声道,见 [扬声器布局与声道顺序](#扬声器布局与声道顺序)。 * 多声道布局在 Properties 里不声明扬声器位置,播放时的块内映射只是 foobar2000 对该声道数的 默认值;输出映射要按声道编号自行完成(同上)。 diff --git a/kernel/joc_kernel.vcxproj b/kernel/joc_kernel.vcxproj index 3935ec4..9ddb582 100644 --- a/kernel/joc_kernel.vcxproj +++ b/kernel/joc_kernel.vcxproj @@ -175,6 +175,7 @@ + @@ -250,6 +251,7 @@ + diff --git a/kernel/src/adm/adm_metadata.cpp b/kernel/src/adm/adm_metadata.cpp index fa9329d..4240162 100644 --- a/kernel/src/adm/adm_metadata.cpp +++ b/kernel/src/adm/adm_metadata.cpp @@ -151,6 +151,14 @@ Status build_dbmd(std::uint32_t object_count, BinauralMode mode, std::string* ou for (std::size_t i = 5u + 262u; i < segment10.size(); ++i) { segment10[i] = static_cast(0x84); } + // Nine 15-byte configuration trims start at byte 7; the first byte of each + // carries the auto-trim flag in bit 0 (1 = automatic, 0 = manual). The + // default is automatic, so a freshly rendered master opens with automatic + // trims in the renderer. + for (std::size_t layout = 0; layout < 9; ++layout) { + const std::size_t flag = 7u + 15u * layout; + segment10[flag] = static_cast(static_cast(segment10[flag]) | 0x01u); + } const std::size_t object_modes = 4u + 2u + 1u + 9u * 15u + object_count; for (std::uint32_t i = 10; i < std::min(object_count, 10u + kObjectCount); ++i) { const std::size_t index = object_modes + i; diff --git a/kernel/src/adm/adm_tracks.cpp b/kernel/src/adm/adm_tracks.cpp index 067f8fa..437ea9e 100644 --- a/kernel/src/adm/adm_tracks.cpp +++ b/kernel/src/adm/adm_tracks.cpp @@ -236,6 +236,9 @@ void TrajectoryBuilder::submit_frame(std::int64_t frame_index, const oamd::OamdU ramp_samples = static_cast(update->ramp_duration_samples); } for (int object = 1; object <= kObjectCount; ++object) { + if (fixed_[object - 1]) { + continue; // 固定 bed 声道:位置由布局给出,不跟 OAMD 更新 + } double x = 0.0; double y = 0.0; double z = 0.0; @@ -260,6 +263,18 @@ Status TrajectoryBuilder::build(std::int64_t total_samples, TrajectoryMode mode, for (int object = 1; object <= kObjectCount; ++object) { Track track; track.name = "JOC_Object_" + std::to_string(object); + if (fixed_[object - 1]) { + Keyframe block; + block.rtime_samples = 0; + block.x = fixed_xyz_[object - 1][0]; + block.y = fixed_xyz_[object - 1][1]; + block.z = fixed_xyz_[object - 1][2]; + block.duration_samples = total_samples; + block.interpolation_samples = 0; + track.blocks.push_back(block); + out->push_back(std::move(track)); + continue; + } const Status status = (mode == TrajectoryMode::Compact) ? expand_compact(events_[object - 1], total_samples, rate_, block_, diff --git a/kernel/src/adm/adm_tracks.h b/kernel/src/adm/adm_tracks.h index 8ad2505..316ccb1 100644 --- a/kernel/src/adm/adm_tracks.h +++ b/kernel/src/adm/adm_tracks.h @@ -38,6 +38,18 @@ public: Status build(std::int64_t total_samples, TrajectoryMode mode, std::vector* out) const; + // bed 声道是固定通道:OAMD 不给位置,整片静止在声明的 bed 方位。 + void set_fixed_position(int object_index, double x, double y, double z) { + if (object_index < 1 || object_index > kObjectCount) { + return; + } + const int slot = object_index - 1; + fixed_[slot] = true; + fixed_xyz_[slot][0] = x; + fixed_xyz_[slot][1] = y; + fixed_xyz_[slot][2] = z; + } + const std::vector& events(int object_index) const { return events_[object_index]; } std::uint32_t rate() const { return rate_; } std::int64_t object_delay_samples() const { return object_delay_; } @@ -50,6 +62,8 @@ private: std::vector events_[kObjectCount]; bool has_previous_[kObjectCount] = {}; double previous_[kObjectCount][3] = {}; + bool fixed_[kObjectCount] = {}; + double fixed_xyz_[kObjectCount][3] = {}; }; Status expand_compact(const std::vector& events, std::int64_t total_samples, std::uint32_t rate, diff --git a/kernel/src/binaural/binaural_runtime.h b/kernel/src/binaural/binaural_runtime.h index 79111db..db9fc75 100644 --- a/kernel/src/binaural/binaural_runtime.h +++ b/kernel/src/binaural/binaural_runtime.h @@ -72,6 +72,11 @@ public: std::size_t staged_samples() const { return staged_; } const timeline::OamdPositionTimeline& timeline() const { return timeline_; } + // bed 声道是固定通道:OAMD 不给位置,方位由声明的 bed 布局给出。 + void set_fixed_position(int object_index, const double position[3]) { + timeline_.set_fixed_position(object_index, position); + } + // finish_output_capacity as the reference computes it (plan 21.4). std::uint32_t finish_capacity(double tail_seconds) const; diff --git a/kernel/src/joc_bitstream/joc_parser.cpp b/kernel/src/joc_bitstream/joc_parser.cpp index 6650d3c..8c079f9 100644 --- a/kernel/src/joc_bitstream/joc_parser.cpp +++ b/kernel/src/joc_bitstream/joc_parser.cpp @@ -1,5 +1,7 @@ #include "joc_bitstream/joc_parser.h" +#include "joc_bitstream/bed_layout_map.h" + #include #include #include @@ -545,6 +547,26 @@ std::string position_name(Position position) { } } +// 核心声道位置 → bed 布局声道;返回 kCount 表示本标准表没有对应身份。 +BedChannel bed_channel_for_position(Position position) { + switch (position) { + case Position::kLeft: return BedChannel::kLeft; + case Position::kRight: return BedChannel::kRight; + case Position::kCenter: return BedChannel::kCenter; + case Position::kLfe: return BedChannel::kLfe; + case Position::kLfe2: return BedChannel::kLfe2; + case Position::kLeftSurround: return BedChannel::kLeftSurround; + case Position::kRightSurround: return BedChannel::kRightSurround; + case Position::kLeftRearSurround: return BedChannel::kLeftRearSurround; + case Position::kRightRearSurround: return BedChannel::kRightRearSurround; + case Position::kVerticalHeightLeft: return BedChannel::kTopFrontLeft; + case Position::kVerticalHeightRight: return BedChannel::kTopFrontRight; + case Position::kTopSurroundLeft: return BedChannel::kTopSideLeft; + case Position::kTopSurroundRight: return BedChannel::kTopSideRight; + default: return BedChannel::kCount; + } +} + std::string position_list(const std::vector& positions) { std::string text = "["; for (std::size_t index = 0; index < positions.size(); ++index) { @@ -917,25 +939,24 @@ Status check_cross_layer(const joc_frame_params& params, const eac3::Frame* core error); } - if (bed_assignments != nullptr) { - static constexpr std::uint32_t kBedBitLeftRear = 1u << 4; // RC_LB/RC_RB - static constexpr std::uint32_t kBedBitTopFront = 1u << 5; // RC_TFL/RC_TFR - std::vector declared_pair; - for (const oamd::BedAssignment& assignment : *bed_assignments) { - if (!assignment.standard || assignment.mask == 0u) { - continue; + if (bed_assignments != nullptr && !bed_assignments->empty()) { + // OAMD 的 bed 掩码描述的是内容的 bed 布局,可以比核心子流实际编码的声道多 + // (例如 9.1.6 bed 只编 5.1 核心)。只有核心声道在 bed 布局里找不到位置才是 + // 真正的不一致;多出来的 bed 声道是布局的一部分。 + const BedLayout bed = resolve_bed_layout(*bed_assignments, true); + if (bed.present && bed.complete) { + bool covered = true; + for (const Position position : core_positions) { + const BedChannel channel = bed_channel_for_position(position); + if (channel == BedChannel::kCount) { + continue; + } + if (!bed_layout_has(bed, channel)) { + covered = false; + break; + } } - if ((assignment.mask & kBedBitLeftRear) != 0u) { - push_unique(&declared_pair, Position::kLeftRearSurround); - push_unique(&declared_pair, Position::kRightRearSurround); - } - if ((assignment.mask & kBedBitTopFront) != 0u) { - push_unique(&declared_pair, Position::kVerticalHeightLeft); - push_unique(&declared_pair, Position::kVerticalHeightRight); - } - } - if (!declared_pair.empty() && declared_pair != wanted) { - if (notes != nullptr) { + if (!covered && notes != nullptr) { notes->bed_mask_mismatch = true; } } diff --git a/kernel/src/oamd/oamd_parser.cpp b/kernel/src/oamd/oamd_parser.cpp index 8e8094a..41ba3f1 100644 --- a/kernel/src/oamd/oamd_parser.cpp +++ b/kernel/src/oamd/oamd_parser.cpp @@ -64,6 +64,9 @@ bool variable_bits_max(bits::BitReader& reader, unsigned width, unsigned max_gro struct ProgramInfo { bool dynamic_object_only = false; bool lfe_present = false; + bool content_bed = false; + bool content_isf = false; + bool content_dynamic = false; std::uint32_t num_bed_objects = 0; std::uint32_t num_isf_objects = 0; std::int32_t num_dynamic_objects = -1; @@ -88,6 +91,9 @@ Status parse_program_assignment(bits::BitReader& reader, ProgramInfo* program) { if (reader.failed()) { return syntax("program_assignment truncated"); } + program->content_bed = (mask & 0x1u) != 0u; + program->content_isf = (mask & 0x2u) != 0u; + program->content_dynamic = (mask & 0x4u) != 0u; if ((mask & 0x1u) != 0u) { reader.read(1); const std::uint32_t multi = reader.read(1); @@ -520,6 +526,9 @@ Status parse_id11_verbose(const std::uint8_t* payload, std::size_t payload_size, out->num_bed_objects = program.num_bed_objects; out->num_isf_objects = program.num_isf_objects; out->num_dynamic_objects = program.num_dynamic_objects; + out->content_bed = program.content_bed; + out->content_isf = program.content_isf; + out->content_dynamic = program.content_dynamic; if (trace != nullptr) { trace->bed_assignments = program.bed_assignments; diff --git a/kernel/src/oamd/oamd_parser.h b/kernel/src/oamd/oamd_parser.h index 10a8af3..cfff0e7 100644 --- a/kernel/src/oamd/oamd_parser.h +++ b/kernel/src/oamd/oamd_parser.h @@ -35,6 +35,10 @@ struct OamdUpdate { std::uint32_t num_bed_objects = 0; std::uint32_t num_isf_objects = 0; std::int32_t num_dynamic_objects = -1; + // program_assignment() 的 content_description:bed / ISF / 动态对象三类内容。 + bool content_bed = false; + bool content_isf = false; + bool content_dynamic = false; }; class OamdState { diff --git a/kernel/src/speaker/speaker_step.cpp b/kernel/src/speaker/speaker_step.cpp index 58f99a7..8d97362 100644 --- a/kernel/src/speaker/speaker_step.cpp +++ b/kernel/src/speaker/speaker_step.cpp @@ -37,6 +37,14 @@ Status step(SpeakerStep* context, const std::vector& objects16_planar, std::uint16_t positions[oamd::kObjects][3] = {}; context->state.object_positions_q15(positions); + for (int object = 0; object < oamd::kObjects; ++object) { + if (!context->bed_override[object]) { + continue; + } + for (int axis = 0; axis < oamd::kAxes; ++axis) { + positions[object][axis] = context->bed_positions[object][axis]; + } + } // A frame without OAMD must not touch the gains at all (no event), otherwise a // pending ramp would snap - matching the reference exactly. const std::uint32_t event_count = context->last_had_payload ? 1u : 0u; diff --git a/kernel/src/speaker/speaker_step.h b/kernel/src/speaker/speaker_step.h index 26ed6ce..28d23f5 100644 --- a/kernel/src/speaker/speaker_step.h +++ b/kernel/src/speaker/speaker_step.h @@ -23,6 +23,10 @@ struct SpeakerStep { std::uint32_t last_ramp_duration = 0; std::uint32_t last_object_count = 0; bool last_had_payload = false; + // bed 声道是固定通道:OAMD 不给位置,方位由声明的 bed 布局给出。这里存 + // 对象槽 → Q15 方位;bed_override 为 false 的槽仍按 OAMD 坐标声像。 + std::uint16_t bed_positions[oamd::kObjects][oamd::kAxes] = {}; + bool bed_override[oamd::kObjects] = {}; }; Status step(SpeakerStep* context, const std::vector& objects16_planar, diff --git a/kernel/src/stream/stream.cpp b/kernel/src/stream/stream.cpp index c1ad822..c00ba2f 100644 --- a/kernel/src/stream/stream.cpp +++ b/kernel/src/stream/stream.cpp @@ -9,6 +9,7 @@ #include "hrtf/jochrtf.h" #include "hrtf/rosella_model.h" #include "hrtf/sofa_cache.h" +#include "joc_bitstream/bed_layout_map.h" #include "joc_bitstream/joc_parser.h" #include "joc_core/objects16.h" @@ -186,12 +187,52 @@ Status Stream::create(const Config& config) { return Status::success(); } +void Stream::apply_bed_positions(const FrameMetadata& entry) { + if (bed_positions_ready_ || entry.bed_assignments.empty()) { + return; + } + const bool bed_only = entry.has_update && entry.update.content_bed && + !entry.update.content_isf && !entry.update.content_dynamic; + const ::joc::joc::BedLayout bed = ::joc::joc::resolve_bed_layout(entry.bed_assignments, bed_only); + if (!bed.present) { + return; + } + bed_positions_ready_ = true; + if (!bed.bed_only) { + return; + } + for (std::size_t slot = 0; slot < bed.channels.size() && + slot < static_cast(oamd::kObjects); + ++slot) { + const ::joc::joc::BedChannel channel = bed.channels[slot]; + double xyz[3] = {0.0, 0.0, 0.0}; + if (binaural_ready_ && ::joc::joc::bed_channel_adm_position(channel, xyz)) { + binaural_.set_fixed_position(static_cast(slot) + 1, xyz); + } + if (!speaker_enabled_) { + continue; + } + std::uint16_t q15[3] = {0, 0, 0}; + if (!::joc::joc::layout_bed_anchor(speaker_.layout.out_ch_config, channel, q15) && + !::joc::joc::bed_channel_q15(channel, q15)) { + continue; + } + speaker_.bed_override[slot] = true; + for (int axis = 0; axis < oamd::kAxes; ++axis) { + speaker_.bed_positions[slot][axis] = q15[axis]; + } + } +} + Status Stream::flush_pending_frame() { if (pending_frame_.streams.empty()) { return Status::success(); } FrameMetadata entry = pending_frame_; pending_frame_ = FrameMetadata(); + if (entry.has_joc) { + apply_bed_positions(entry); + } if (entry.has_joc) { std::string error; joc::CrossLayerNotes notes; diff --git a/kernel/src/stream/stream.h b/kernel/src/stream/stream.h index 4ac439a..7d7e168 100644 --- a/kernel/src/stream/stream.h +++ b/kernel/src/stream/stream.h @@ -128,6 +128,9 @@ private: return rosella_ready_ ? (rosella_pending_.size() - rosella_read_offset_) / 2u : 0u; } void reset_state(); + // 声明的 bed 布局只在首帧解析一次:bed 声道在 OAMD 里没有位置字段,方位由布局 + // 给出;流式路径和文件任务走同一套 SpeakerStep/双耳运行时,所以这里也要下发。 + void apply_bed_positions(const FrameMetadata& entry); // Drops the bed samples that have already been rendered, keeping the rest. void compact_bed_pending(); // Closes the audio frame currently being assembled and queues it. @@ -173,6 +176,7 @@ private: bool speaker_enabled_ = false; bool binaural_enabled_ = false; bool binaural_ready_ = false; + bool bed_positions_ready_ = false; bool rosella_ready_ = false; float gain_ = 1.0f; }; diff --git a/kernel/src/task/task.cpp b/kernel/src/task/task.cpp index 1467bd1..247eafb 100644 --- a/kernel/src/task/task.cpp +++ b/kernel/src/task/task.cpp @@ -41,6 +41,7 @@ #include "io/process.h" #include "io/wav_writer.h" #include "joc_bitstream/joc_parser.h" +#include "joc_bitstream/bed_layout_map.h" #include "joc_core/objects16.h" #include "oamd/oamd_parser.h" #include "speaker/speaker_step.h" @@ -1322,6 +1323,7 @@ Status run(const joc_task_config& raw, const joc_event_sink* sink, joc_task_resu } ::joc::speaker::SpeakerStep speaker; + bool bed_positions_ready = false; const bool speaker_enabled = cfg.operation == JOC_OP_SPEAKER; if (speaker_enabled) { if (!::joc::speaker::layout_by_name(cfg.layout.c_str(), &speaker.layout)) { @@ -1745,6 +1747,58 @@ Status run(const joc_task_config& raw, const joc_event_sink* sink, joc_task_resu job.outer_offset = static_cast(payload->sample_offset); const Status bed_ok = ::joc::oamd::parse_id11_bed_assignments( bytes.data(), bytes.size(), &group_bed_assignments); + if (bed_ok.ok() && !bed_positions_ready && + !group_bed_assignments.empty()) { + const ::joc::joc::BedLayout bed_layout = + ::joc::joc::resolve_bed_layout( + group_bed_assignments, + job.update.content_bed && !job.update.content_isf && + !job.update.content_dynamic); + if (bed_layout.present) { + bed_positions_ready = true; + bus.emit(JOC_EV_RENDERER_INITIALIZED, JOC_STAGE_RENDER, + JOC_LOG_INFO, + fmt("bed layout: %s (%u bed channels)", + bed_layout.name[0] != '\0' + ? bed_layout.name : "custom", + static_cast( + bed_layout.channels.size()))); + if (bed_layout.bed_only) { + // bed 声道是固定通道:OAMD 不给位置,方位由声明的 bed 布局给出。 + for (std::size_t slot = 0; + slot < bed_layout.channels.size() && + slot < static_cast(::joc::oamd::kObjects); + ++slot) { + const ::joc::joc::BedChannel channel = + bed_layout.channels[slot]; + double xyz[3] = {0.0, 0.0, 0.0}; + if (::joc::joc::bed_channel_adm_position(channel, xyz)) { + trajectory.set_fixed_position( + static_cast(slot) + 1, xyz[0], xyz[1], + xyz[2]); + if (binaural_enabled) { + binaural.set_fixed_position( + static_cast(slot) + 1, xyz); + } + } + if (!speaker_enabled) { + continue; + } + // 目标布局有同名扬声器时直连该声道,否则按标准方位声像。 + std::uint16_t q15[3] = {0, 0, 0}; + if (!::joc::joc::layout_bed_anchor( + speaker.layout.out_ch_config, channel, q15) && + !::joc::joc::bed_channel_q15(channel, q15)) { + continue; + } + speaker.bed_override[slot] = true; + for (int axis = 0; axis < ::joc::oamd::kAxes; ++axis) { + speaker.bed_positions[slot][axis] = q15[axis]; + } + } + } + } + } if (!bed_ok.ok()) { failures.record(produced, StageRank::kJoc, bed_ok.code(), bed_ok.stage(), bed_ok.message()); @@ -2039,11 +2093,6 @@ Status run(const joc_task_config& raw, const joc_event_sink* sink, joc_task_resu " audio frame(s): the chanmap declares a different extra pair than " "joc_dmx_config_idx; the bed mapping follows the chanmap"); } - if (bed_mask_mismatch_frames != 0u) { - bus.warning(std::to_string(bed_mask_mismatch_frames) + - " audio frame(s): the OAMD bed mask declares a different extra pair than " - "joc_dmx_config_idx; the bed mask only affects metadata"); - } StageFailure recorded; if (failures.earliest(&recorded)) { return finalize_with_error(recorded.code, recorded.stage_text, recorded.message); diff --git a/kernel/src/timeline/position_timeline.cpp b/kernel/src/timeline/position_timeline.cpp index 329016c..5c0f2e5 100644 --- a/kernel/src/timeline/position_timeline.cpp +++ b/kernel/src/timeline/position_timeline.cpp @@ -114,6 +114,10 @@ Status OamdPositionTimeline::submit_update(const oamd::OamdUpdate& update, double targets[kTimelineObjects][3] = {}; for (int index = 0; index < kTimelineObjects; ++index) { + if (fixed_[index]) { + std::memcpy(targets[index], fixed_xyz_[index], sizeof(targets[index])); + continue; + } geometry::q_to_adm_xyz(state_.q(index + 1, 0), state_.q(index + 1, 1), state_.q(index + 1, 2), &targets[index][0], &targets[index][1], &targets[index][2]); diff --git a/kernel/src/timeline/position_timeline.h b/kernel/src/timeline/position_timeline.h index 8b40c6d..cf87d39 100644 --- a/kernel/src/timeline/position_timeline.h +++ b/kernel/src/timeline/position_timeline.h @@ -49,6 +49,17 @@ public: // positions[15][3]; queries must be monotonically increasing. Status positions_at(std::int64_t sample, double positions[kTimelineObjects][3]); + // bed 声道是固定通道:OAMD 不给位置,方位由声明的 bed 布局给出。 + void set_fixed_position(int object_index, const double position[3]) { + if (object_index < 1 || object_index > kTimelineObjects) { + return; + } + fixed_[object_index - 1] = true; + fixed_xyz_[object_index - 1][0] = position[0]; + fixed_xyz_[object_index - 1][1] = position[1]; + fixed_xyz_[object_index - 1][2] = position[2]; + } + std::uint64_t payload_count() const { return payload_count_; } std::uint64_t transition_count() const { return transition_count_; } bool initialized() const { return initialized_; } @@ -62,6 +73,8 @@ private: bool initialized_ = false; double previous_targets_[kTimelineObjects][3] = {}; bool has_previous_[kTimelineObjects] = {}; + bool fixed_[kTimelineObjects] = {}; + double fixed_xyz_[kTimelineObjects][3] = {}; std::uint64_t payload_count_ = 0; std::uint64_t transition_count_ = 0; std::int64_t last_coded_event_sample_ = -1;