Improve: default the x264 bitrate cap off and label it for weak links

The cap is capped CRF (VBV): when a frame needs more bits than the
profile's nominal bitrate allows, x264 has to raise QP to stay under the
ceiling. Scenes with lots of change (video, scrolling, window dragging)
therefore lose detail and look blurry, while static scenes stay sharp -
the cap only bites on motion. That trade is worth it on intercontinental
or otherwise constrained links, where an uncapped frame can take seconds
to transmit and stall everything queued behind it, but it is a pure
quality loss on a LAN.

The tuning item now defaults to unchecked, so a master sends 0x3 (GDI
no-sleep and send pacing) by default; machines that already stored
TuningX264Vbv keep their explicit choice. The menu entry is renamed to
"x264 码率封顶 (VBV,仅限洲际弱网)" and the en_US, zh_TW and de_DE
translations were updated to match the new source string.

Only newly opened remote desktops pick up the flag, since CMD_SCREEN_TUNING
is sent when the session starts. Verified by rebuilding the Debug x64
server and client, and by finding the new menu and translation strings in
the built binary.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-07 09:52:54 +01:00
1 parent f77b18aa68
commit 4884b080e8
12 files changed
+23 -16

No files matched your search

+7 -4
View File
@@ -2834,9 +2834,11 @@ BOOL CMy2015RemoteDlg::OnInitDialog()
m_runNormal = THIS_CFG.GetInt("settings", "RunNormal", 0);
// 高级菜单:DLL内嵌TLS证书(勾选状态来自 [settings] EmbedTlsInDll,见上面的加载)
// 以及「远程桌面调优」子菜单里的三项,默认全开;取消勾选即回到加开关前的行为。
// 第三参数是默认值:只对从没写过该键的机器生效,已写过 0 的存量机器保持关。
m_bTuningX264Vbv = THIS_CFG.GetInt("settings", "TuningX264Vbv", 1) != 0;
// 以及「远程桌面调优」子菜单。GDI 去延时、发送节流帧率下限默认开;
// x264 码率封顶默认关 —— 它靠压 QP 兑现码率上限,画面变化多时会明显发糊,
// 只适合洲际/弱网链路(防止单帧打爆链路导致"卡几秒再猛跳")。
// 第三参数是默认值:只对从没写过该键的机器生效,已写过值的存量机器保持原样。
m_bTuningX264Vbv = THIS_CFG.GetInt("settings", "TuningX264Vbv", 0) != 0;
m_bTuningGdiNoSleep = THIS_CFG.GetInt("settings", "TuningGdiNoSleep", 1) != 0;
m_bTuningPaceFpsFloor = THIS_CFG.GetInt("settings", "TuningPaceFpsFloor", 1) != 0;
// 自适应加吞吐判据:纯服务端,默认开。判据分不清"链路慢"和"本机慢",
@@ -10943,7 +10945,8 @@ void CMy2015RemoteDlg::SyncTuningMenuChecks()
m_bAdaptiveDualCriteria ? MF_CHECKED : MF_UNCHECKED);
}
// 高级→远程桌面调优→x264 码率封顶(VBV):默认开,取消勾选即关闭。
// 高级→远程桌面调优→x264 码率封顶(VBV):默认关,勾选即开启,仅限洲际/弱网链路。
// 开启后动场(视频、滚动、拖窗)会被 VBV 上限压 QP 而发糊,换来的是单帧不炸链路。
// 只影响此后打开的远程桌面窗口(打开时经 CMD_SCREEN_TUNING 下发),已打开的窗口不变,
// 因为改编码器参数要重建编码器,会在画面上留下一次可感知的断流。
void CMy2015RemoteDlg::OnToolTuningX264Vbv()