Bump component to 0.6.2 and add Dolby Dialnorm loudness control
build / windows (push) Canceled after 0s
build / release (push) Canceled after 0s

- Bump JOC_VERSION to 0.6.2.
- Add a "Dolby Dialnorm loudness (-31 dBFS)" preference switch.
- Persist the setting as dialnorm and allow JOC_DIALNORM to override it.
- Apply -target_level -31 only to the ffmpeg-decoded 5.1 E-AC-3 core; leave
  the 7-channel core and ordinary PCM takeover paths unchanged.
- Remove stale SOFA measurement-set wording from the READMEs.
- Rebuild and deploy both x86 and x64 components.
This commit is contained in:
TheM14 committed 2026-11-12 14:53:32 +08:00
1 parent b0751d82b6
commit b52b384145
12 files changed
+37 -9

No files matched your search

+2 -2
View File
@@ -96,8 +96,8 @@ HRTF 文件, 增益.
### HRTF data
A SOFA measurement set or a personalised headphone model is supplied by whoever runs the
component, and is listed in `.gitignore` so it cannot be committed by accident. Speaker layouts
A personalised headphone model (`HRTF\binaural.personalized_headphone`) is supplied by whoever
runs the component, and is listed in `.gitignore` so it cannot be committed by accident. Speaker layouts
need none. Binaural rendering without an HRTF fails with a message naming the file it looked for.
## Speaker layouts and channel order
+3 -1
View File
@@ -74,6 +74,8 @@ Preferences → Tools → **JOC 解码器**:
`.mp4/.m4a/.mkv/.mka/.mov/.webm` 仍先做 JOC 检测,非 JOC 的 E-AC-3 音轨才回退到 ffmpeg。
如果内置解码器在 foobar2000 的 input priority 里排在前面,WAV/AC3/MP3 等文件会先被内置解码器拿走,
本组件不会收到 open 调用;需要把 **JOC decoder** 提到对应内置解码器之前。
* **Dolby Dialnorm 响度均衡(-31 dBFS)** —— 默认关闭。打开后只对 ffmpeg 解码的 E-AC-3 5.1 core 施加 `-target_level -31`,
用于按码流 dialnorm 做响度均衡;普通 PCM 和 7 声道 core 不受影响。
* **ffmpeg.exe** 可执行文件路径。
* **界面语言** —— **跟随系统** / **简体中文** / **English**。设置页的全部文字、状态行和用户可见的
错误信息都用这一项选定的语言,切换后立刻生效;选择存在组件自己的配置里。"跟随系统"按 Windows 的
@@ -84,7 +86,7 @@ Preferences → Tools → **JOC 解码器**:
### HRTF 数据
SOFA 测量集或个性化耳机模型由使用组件的人自己提供,并且写在 `.gitignore` 里,避免误提交。
个性化耳机模型(`HRTF\binaural.personalized_headphone`)由使用组件的人自己提供,并且写在 `.gitignore` 里,避免误提交。
扬声器布局不需要 HRTF。双耳渲染缺少 HRTF 时会报错并指出它找的是哪个文件。
## 扬声器布局与声道顺序
+6
View File
@@ -947,6 +947,8 @@ bool Engine::Impl::start_bed(std::uint64_t source_sample, std::string* error) {
// L R C LFE Ls Rs for 5.1 and L R C LFE BL BR SL SR for 7.1.
// -drc_scale 0 -target_level 0: the bed is taken as stored, without the
// stream's dynrng or target-level metadata being applied by the decoder.
// With Dialnorm enabled the 5.1 core is normalized to -31 dBFS; the 7-channel
// configurations keep the stored bed because this switch is specified for 5.1.
//
// -ac is only passed for the 5.1 configurations: `-ac 6` downmixes 5.1.2/7.1
// into 5.1 and drops the extra pair, and `-ac 8` would remap 5.1.2 into 7.1.
@@ -958,6 +960,10 @@ bool Engine::Impl::start_bed(std::uint64_t source_sample, std::string* error) {
// at the start of the file, which is a low-level, noise-like difference from a
// play-through rather than a misalignment: the position stays exact.
std::wstring input_arguments = L"-drc_scale 0 -target_level 0";
if (settings.dialnorm && bed_channels == kDefaultBedChannels) {
input_arguments = L"-drc_scale 0 -target_level -31";
joc_log::line("core bed: Dolby Dialnorm enabled (-target_level -31)");
}
if (has_mov_timeline(input_path)) input_arguments += L" -ignore_editlist 1";
const std::wstring offset = seek_time(source_sample);
if (!offset.empty()) input_arguments += L" -ss " + offset;
+2
View File
@@ -97,6 +97,8 @@ struct Settings {
bool swap_side_rear = false;
// ffmpeg is the sole decoder for this input; the kernel maps the channels.
bool take_over_pcm = false;
// Apply Dolby Dialnorm to the ffmpeg E-AC-3 5.1 core decode.
bool dialnorm = false;
};
// ---- speaker delivery ------------------------------------------------------
+3 -1
View File
@@ -47,8 +47,10 @@ constexpr Entry kTexts[] = {
{Text::kHrtfDefault, "默认", "default"},
{Text::kHrtfDefaultUnknown, "无法确定默认路径",
"cannot resolve the default location"},
{Text::kGroupGain, "增益", "Gain"},
{Text::kGroupGain, "增益 / 响度", "Gain / loudness"},
{Text::kCheckGain, "应用增益", "Apply gain"},
{Text::kCheckDialnorm, "Dolby Dialnorm 响度均衡(-31 dBFS)",
"Dolby Dialnorm loudness (-31 dBFS)"},
{Text::kLabelGainUnit, "dB", "dB"},
{Text::kGainStatusOn, "增益开 %.2f dB", "gain on, %.2f dB"},
{Text::kGainStatusOff, "增益关(输出不衰减)", "gain off (no attenuation)"},
+1
View File
@@ -46,6 +46,7 @@ enum class Text {
kHrtfDefaultUnknown,
kGroupGain,
kCheckGain,
kCheckDialnorm,
kLabelGainUnit,
kGainStatusOn,
kGainStatusOff,
+1 -1
View File
@@ -14,7 +14,7 @@
// Kept in one place: the string reported to foobar2000 and written to the log
// must not drift apart.
#define JOC_VERSION "0.6.1"
#define JOC_VERSION "0.6.2"
DECLARE_COMPONENT_VERSION("JOC decoder (E-AC-3 JOC)", JOC_VERSION,
"Plays E-AC-3 JOC (Dolby Atmos) files: the JOC objects are "
+8 -2
View File
@@ -285,7 +285,8 @@ private:
return TRUE;
}
if (id == IDC_CHECK_GAIN || id == IDC_CHECK_INT24 ||
id == IDC_CHECK_SWAP_SIDE_REAR || id == IDC_CHECK_PCM) {
id == IDC_CHECK_SWAP_SIDE_REAR || id == IDC_CHECK_PCM ||
id == IDC_CHECK_DIALNORM) {
update_status();
notify();
return TRUE;
@@ -378,7 +379,7 @@ private:
label(IDC_GROUP_GAIN, joc_lang::Text::kGroupGain);
label(IDC_CHECK_GAIN, joc_lang::Text::kCheckGain);
label(IDC_LABEL_GAIN, joc_lang::Text::kLabelGainUnit);
label(IDC_LABEL_GAIN_HINT, joc_lang::Text::kGainHint);
label(IDC_CHECK_DIALNORM, joc_lang::Text::kCheckDialnorm);
label(IDC_GROUP_MISC, joc_lang::Text::kGroupOther);
label(IDC_LABEL_LANGUAGE, joc_lang::Text::kLabelLanguage);
label(IDC_LABEL_FFMPEG, joc_lang::Text::kLabelFfmpeg);
@@ -406,6 +407,8 @@ private:
SendMessageW(GetDlgItem(m_hwnd, IDC_CHECK_GAIN), BM_SETCHECK,
values.gain_enabled ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessageW(GetDlgItem(m_hwnd, IDC_CHECK_DIALNORM), BM_SETCHECK,
values.dialnorm ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessageW(GetDlgItem(m_hwnd, IDC_CHECK_INT24), BM_SETCHECK,
values.force_int24 ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessageW(GetDlgItem(m_hwnd, IDC_CHECK_PCM), BM_SETCHECK,
@@ -461,6 +464,8 @@ private:
values.gain_db = std::atof(get_text(GetDlgItem(m_hwnd, IDC_EDIT_GAIN)).c_str());
values.gain_enabled =
IsDlgButtonChecked(m_hwnd, IDC_CHECK_GAIN) == BST_CHECKED;
values.dialnorm =
IsDlgButtonChecked(m_hwnd, IDC_CHECK_DIALNORM) == BST_CHECKED;
values.force_int24 =
IsDlgButtonChecked(m_hwnd, IDC_CHECK_INT24) == BST_CHECKED;
values.swap_side_rear =
@@ -528,6 +533,7 @@ private:
if (now.hrtf_file != m_initial.hrtf_file) return true;
if (now.binaural_mode != m_initial.binaural_mode) return true;
if (now.gain_enabled != m_initial.gain_enabled) return true;
if (now.dialnorm != m_initial.dialnorm) return true;
if (now.force_int24 != m_initial.force_int24) return true;
if (now.swap_side_rear != m_initial.swap_side_rear) return true;
if (now.take_over_pcm != m_initial.take_over_pcm) return true;
+2 -2
View File
@@ -54,8 +54,8 @@ BEGIN
LTEXT "dB", IDC_LABEL_GAIN, 68, 187, 12, 10
EDITTEXT IDC_EDIT_GAIN, 84, 184, 44, 13, ES_AUTOHSCROLL
LTEXT "", IDC_LABEL_GAIN_STATUS, 134, 187, 182, 10
LTEXT "双耳渲染后可能超过 0 dBFS,可用负值衰减。",
IDC_LABEL_GAIN_HINT, 16, 202, 300, 10
CONTROL "Dolby Dialnorm 响度均衡(-31 dBFS)", IDC_CHECK_DIALNORM, "Button",
BS_AUTOCHECKBOX | WS_TABSTOP, 16, 202, 300, 10
GROUPBOX "其它", IDC_GROUP_MISC, 7, 219, 316, 48
CONTROL "交换侧环绕与后环绕声道", IDC_CHECK_SWAP_SIDE_REAR, "Button",
+1
View File
@@ -32,6 +32,7 @@
#define IDC_EDIT_GAIN 2033
#define IDC_LABEL_GAIN_HINT 2034
#define IDC_LABEL_GAIN_STATUS 2035
#define IDC_CHECK_DIALNORM 2036
#define IDC_GROUP_MISC 2040
#define IDC_LABEL_FFMPEG 2041
+6
View File
@@ -30,6 +30,7 @@ constexpr GUID kGuidGain = {0x6c04d8b2, 0xe75f, 0x4a39, {0x8d, 0x26, 0x51, 0xb3,
constexpr GUID kGuidTail = {0x38f1b6a7, 0x0d24, 0x4e88, {0xb7, 0x95, 0x2c, 0x61, 0x4f, 0xd2, 0x08, 0xa3}};
constexpr GUID kGuidForceInt24 = {0xd2c67f41, 0x8b53, 0x4a2e, {0x97, 0x61, 0x0f, 0xc8, 0x35, 0xba, 0x64, 0x12}};
constexpr GUID kGuidSwapSideRear = {0x2b7f6d18, 0x59c4, 0x4a83, {0x8e, 0x15, 0x73, 0xac, 0x06, 0xd9, 0x4b, 0x27}};
constexpr GUID kGuidDialnorm = {0x47e2a9b3, 0x6c14, 0x4d78, {0x81, 0x5f, 0x2a, 0xc7, 0x90, 0x3e, 0x64, 0xb1}};
constexpr GUID kGuidTakeOverPcm = {0x9f2b6c41, 0x7d38, 0x4a05, {0x86, 0x1e, 0x52, 0xb9, 0x0c, 0x74, 0xe3, 0x28}};
constexpr GUID kGuidObjectDelay = {0x5b2e9c18, 0xa640, 0x4d7b, {0x92, 0x0e, 0x37, 0xc5, 0x81, 0x6b, 0x2a, 0x54}};
constexpr GUID kGuidThreads = {0xcb7a4015, 0x3f98, 0x4c62, {0xa0, 0x8d, 0x1b, 0x74, 0x29, 0xe6, 0x53, 0x0f}};
@@ -50,6 +51,7 @@ cfg_bool g_force_int24(kGuidForceInt24, false);
// Swap the side and rear surround pairs in the delivered PCM.
cfg_bool g_swap_side_rear(kGuidSwapSideRear, false);
cfg_bool g_take_over_pcm(kGuidTakeOverPcm, false);
cfg_bool g_dialnorm(kGuidDialnorm, false);
cfg_uint g_object_delay(kGuidObjectDelay, 1473);
cfg_uint g_threads(kGuidThreads, 0);
cfg_string g_ffmpeg(kGuidFfmpeg, "ffmpeg");
@@ -131,6 +133,7 @@ Values read() {
values.force_int24 = static_cast<bool>(g_force_int24);
values.swap_side_rear = static_cast<bool>(g_swap_side_rear);
values.take_over_pcm = static_cast<bool>(g_take_over_pcm);
values.dialnorm = static_cast<bool>(g_dialnorm);
values.object_delay_samples = static_cast<unsigned>(g_object_delay);
values.native_threads = static_cast<unsigned>(g_threads);
values.ffmpeg_path = g_ffmpeg.get_ptr();
@@ -162,6 +165,7 @@ void write(const Values& values) {
g_force_int24 = values.force_int24;
g_swap_side_rear = values.swap_side_rear;
g_take_over_pcm = values.take_over_pcm;
g_dialnorm = values.dialnorm;
g_object_delay = values.object_delay_samples;
g_threads = values.native_threads;
g_ffmpeg = values.ffmpeg_path.c_str();
@@ -185,6 +189,7 @@ joc_decode::Settings current() {
if (env_string("JOC_FORCE_INT24", &text)) values.force_int24 = (text != "0");
if (env_string("JOC_SWAP_SIDE_REAR", &text)) values.swap_side_rear = (text != "0");
if (env_string("JOC_TAKE_OVER_PCM", &text)) values.take_over_pcm = (text != "0");
if (env_string("JOC_DIALNORM", &text)) values.dialnorm = (text != "0");
(void)env_uint("JOC_OBJECT_DELAY", &values.object_delay_samples);
(void)env_uint("JOC_THREADS", &values.native_threads);
@@ -202,6 +207,7 @@ joc_decode::Settings current() {
settings.force_int24 = values.force_int24;
settings.swap_side_rear = values.swap_side_rear;
settings.take_over_pcm = values.take_over_pcm;
settings.dialnorm = values.dialnorm;
settings.object_delay_samples = values.object_delay_samples;
settings.native_threads = values.native_threads;
settings.ffmpeg_path = values.ffmpeg_path.empty() ? "ffmpeg" : values.ffmpeg_path;
+2
View File
@@ -38,6 +38,8 @@ struct Values {
bool swap_side_rear = false;
// Take over ordinary PCM files and render them binaurally through ffmpeg.
bool take_over_pcm = false;
// Apply Dolby Dialnorm to the ffmpeg E-AC-3 5.1 core decode (-target_level -31).
bool dialnorm = false;
unsigned object_delay_samples = 1473;
unsigned native_threads = 0;
std::string ffmpeg_path = "ffmpeg";