Sync the kernel copy with the OAMD frame-level core

The kernel copy follows the new kernel. The renderer has a frame-level state
machine (normal, hold, hard cut and passthrough, the 8-plane passthrough, the
LFE clipgain ramp and interpolation when no previous state exists), the OAMD
parser carries the complete frame state (several blocks, more than 16 objects)
and the speaker renderer applies the metadata (gain and inactive flags,
zone/elevation, size, snap, divergence, ISF and bed distribution). oamd_math and
oamd_params are new modules, the ISF tables are compiled in now that the
upstream data/ directory is gone, and the binaural timeline accepts a complete
frame state. joc_core.h moves to ABI 6 (frame parameters and EMDF payload info
at v2, JOC_FRAME_STATUS_*, raw 5-bit offset_ts) and eac3joc_core.h to EJOC ABI 4
(EJOC_FRAME_STATUS_*, ejoc_frame_input v1, ejoc_renderer_render_frame,
EJOC_CORE_OUT_CHANNELS and EJOC_LFE_SLOT; the old ejoc_renderer_process stays).
joc_stream.h and joc_version.h are unchanged.

joc_kernel.vcxproj lists the two new translation units and the four new
headers. The component's layout table gains the kernel's 6.0 layout (L R Ls Rs
Lrs Rrs) after 9.1.6, and layout_table_test expects twelve layouts, so the list
the preferences page shows and the list the renderer accepts are the same
again. README, THIRD_PARTY_NOTICES and the CI comment pin the copy to commit
3f0d5e87fe41b90d9350528d2dca2ca82a637a3f; tag v1.2.0 points at the older
a276028 and is not the sync baseline.

Builds Release-Static|x64 and |Win32 with no errors. The offline test tools
build and pass on both architectures: layout_table_test reports 12 layouts, and
channel_swap_test, log_rotation_test and long_path_test pass. scan_crosscheck
agrees with the core on the upstream test material, and the render harness
delivers 7.1.4 speaker output and binaural output on both architectures, with
the speaker-path WAV byte-identical between them.

The core is still vendored under kernel/; building it from the upstream
checkout at build time is a separate change.
This commit is contained in:
TheM14 committed 2026-11-08 16:11:57 +08:00
1 parent 5b41868e94
commit defe9538fe
39 files changed
+6714 -616

No files matched your search

+24 -23
View File
@@ -6,31 +6,12 @@
#include <vector>
#include "oamd/oamd_parser.h"
#include "speaker/speaker_layout_lookup.h"
namespace joc::joc {
// OAMD Table 12 的标准 bed 声道。LSB 顺序与声明顺序一致:L/R、C、LFE、
// Ls/Rs、Lrs/Rrs、TFL/TFR、TSL/TSR、TBL/TBR、LW/RW、LFE2。
enum class BedChannel : std::uint8_t {
kLeft = 0,
kRight,
kCenter,
kLfe,
kLeftSurround,
kRightSurround,
kLeftRearSurround,
kRightRearSurround,
kTopFrontLeft,
kTopFrontRight,
kTopSideLeft,
kTopSideRight,
kTopBackLeft,
kTopBackRight,
kLeftWide,
kRightWide,
kLfe2,
kCount,
};
// BedChannel lives in oamd/oamd_parser.h: the enum is the OAMD Table 12
// label order and OAMD frame state carries it directly.
// 内容声明的 bed 布局。bed 对象在 OAMD 里没有位置字段,位置由这里的布局决定。
struct BedLayout {
@@ -61,8 +42,28 @@ bool bed_channel_adm_position(BedChannel channel, double xyz[3]);
bool bed_channel_q15(BedChannel channel, std::uint16_t q15[3]);
// 目标布局里同名扬声器的 Q15 方位:bed 声道直连到该扬声器,而不是参与声像。
// 目标布局没有这个声道时返回 false。
// 目标布局没有这个声道时返回 false。4.0 与 6.0 共用未分配的 out_ch_config
// 0xFF,因此这里按 4.0 的声道集合解释 0xFF。
bool layout_bed_anchor(std::uint32_t out_ch_config, BedChannel channel,
std::uint16_t q15[3]);
// 参考位置网格 ``BED_REFERENCE_POSITIONS_Q15``:bed 标签与输出 slots 的最近邻
// 匹配都用这一组固定 Q15 点。索引 3 是 (-1,-1,-1),表示 LFE 那样的非空间声源。
inline constexpr int kBedReferencePositionCount = 38;
const std::int32_t (*bed_reference_positions_q15())[3];
// 一个目标扬声器布局的 bed 路由描述(bed_layout.bed_output_description):
// 按标准 bed 标签序(Table 12 的 17 个标签)给出目标 layout 的输出参考位置、
// 每个标签的输出 slot 与直连参考位置,以及该布局的自动 trim 基准衰减。
struct BedOutputDescription {
std::vector<int> output_labels; // 每个输出声道最近邻的参考位置索引
int label_to_slot[oamd::kBedLabelCount] = {}; // -2 不可达,-1 LFE 通路
int direct_output_labels[oamd::kBedLabelCount] = {};
double automatic_attenuation_db = 0.0;
};
// 由布局名/几何派生 bed 路由描述;``layout.channel_names`` 必须按标准声道
// 顺序给出 ``layout.channel_count`` 个名字。
BedOutputDescription bed_output_description(const speaker::LayoutInfo& layout);
} // namespace joc::joc