Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
feat: add live SDR display override for HDR previews
Veyra Goal Agent5a5a4b0afed6
diff --git a/README.md b/README.mdindex 0074a599..a00b1bee 100644--- a/README.md+++ b/README.md@@ -138,6 +138,7 @@ Veyra 原有源码采用 [GPLv3](LICENSE);含串流的组合程序同时适用以下能力属于 `codex/hdr-multichannel` 的本地开发版,**GitHub 1.1.1 不包含**。- **HDR 输入 / 增强**:文件、P010/P016 采集与 PS5 HDR;支持明确标记的 BT.2020 NCL / PQ 或 HLG。Windows HDR 开启时,可组合 NR、DLSS SR / RTX Video SR、DLSS / XeSS 补帧。NR / Video SR 使用 SDR 代理和 HDR 基底合成,压缩高光和近黑区域的增强会衰减;不把 SDR 结果逆造为原始 HDR。HLG 使用 1000nit / gamma 1.2 参考转换。+- **SDR 显示开关**:采集卡面板的“转为 SDR 显示”默认关闭,控制所有实时预览。打开后将 HDR 映射为 SDR,增强照常可用;播放中切换无需重连,可能短暂停顿。关闭后跟随显示器 HDR 状态。截图跟随当前画面,视频导出保持原有 HDR 规则。- **采集颜色**:默认使用设备元数据。设备漏报时,在采集面板选择手动 PQ 或 HLG,且必须选择 P010/P016。10bit 本身不代表 HDR;RGB / YUY2 HDR 及 BT.2020 constant-luminance 暂不支持。- **HDR 导出 / 截图**:视频选择 HEVC,输出 Main10 / BT.2020 / PQ;HLG 也统一输出 PQ。支持 NR、超分和内部 DLSS 补帧。XeSS 仍只支持预览;H.264 不承载此 HDR 导出。截图为 FP16 scRGB JPEG XR。导出不虚构或沿用处理前的峰值元数据;普通 PNG/JPEG 保持 SDR。- **5.1 音频**:文件解码与采集 PCM 保留声道位置,共用一套音频时钟、补偿和音量处理。采集优先尝试设备真实提供的多声道模式。Windows 输出设备须配置成 5.1;仅支持立体声时明确降混,在详细状态中显示输入 / 输出声道数。PS5 保持上游提供的立体声,不伪装成 5.1;本轮不提供 Dolby/DTS 压缩码流直通或 Atmos 对象音频。diff --git a/README_EN.md b/README_EN.mdindex fa6589bf..7c34478d 100644--- a/README_EN.md+++ b/README_EN.md@@ -148,6 +148,8 @@ These changes are local to `codex/hdr-multichannel`; **the GitHub 1.1.1 packageRTX 5070 GPU output, HDR export and software channel isolation have local test evidence. HDR display appearance, real 5.1 speaker positioning and individual capture cards require hardware acceptance. See the [execution record](docs/HDR_MULTICHANNEL_EXECUTION_2026-09-14.md). Fresh-install effects remain off.+The capture panel also offers **Convert to SDR display**, off by default. It controls all live previews, maps HDR to SDR without changing input metadata or disabling enhancement, and can be toggled during playback without reconnecting. Disabling it follows the display HDR state. Screenshots follow the preview; video export retains its existing HDR policy.+## AcknowledgmentsThanks to [Magpie Experimental](https://github.com/SAOG0721/Magpie/tree/experimental) for research insights into NR residual composition, optical flow, and enhancement pipelines; to [chiaki-ng](https://github.com/streetpea/chiaki-ng) for the PS5 streaming foundation; and to [XeSS-GPU-Motion](https://github.com/gggz114514-oss/XeSS-GPU-Motion) for its GPU DIS optical-flow implementation.diff --git a/apps/veyra/ui/AppShell.cpp b/apps/veyra/ui/AppShell.cppindex e1ea8730..f54de724 100644--- a/apps/veyra/ui/AppShell.cpp+++ b/apps/veyra/ui/AppShell.cpp@@ -53,7 +53,7 @@ std::wstring smokeView;bool smokeViewApplied=false;std::wstring smokeDualOutput;bool smokeEmpty=false;DWORD modeGdiStart=0,modeHandlesStart=0;SIZE_T modePrivateStart=0;bool smokeDual=false,smokeDualPause=false,smokeMaster=false,smokeMasterReject=false,smokeAudio=false,smokeJob=false,smokeJobCancel=false,smokeJobExit=false;int dualStep=0,masterStep=0,audioStep=0,jobStep=0;double pausedPosition=-1,jobPosition=0;uint64_t pausedFrames=0;ULONGLONG jobPauseTick=0;HANDLE workerMapping=nullptr;void switchMode();void selectInspector(int);void refreshDailyPresets();-bool applySettings(veyra::engine::EnhancementSettings s){if(masterPendingRevision)return false;uiState.configured=s;if(uiState.enhanced)engine.requestSettings(s);else {auto effective=engine.snapshot().desired;if(effective.captureCompatible!=s.captureCompatible){effective.captureCompatible=s.captureCompatible;engine.requestSettings(effective);}veyra::log::info("ui-settings","enhancement off: draft saved; presentation setting applied independently");}veyra::ui::settingsEnabled(uiState.enhanced,uiState.configured);return true;}+bool applySettings(veyra::engine::EnhancementSettings s){if(masterPendingRevision)return false;uiState.configured=s;if(uiState.enhanced)engine.requestSettings(s);else {auto effective=engine.snapshot().desired;if(effective.captureCompatible!=s.captureCompatible||effective.forceSdrPreview!=s.forceSdrPreview){effective.captureCompatible=s.captureCompatible;effective.forceSdrPreview=s.forceSdrPreview;engine.requestSettings(effective);}veyra::log::info("ui-settings","enhancement off: draft saved; presentation setting applied independently");}veyra::ui::settingsEnabled(uiState.enhanced,uiState.configured);return true;}struct ToolbarItem{HWND hwnd;int width;};std::vector<ToolbarItem> toolbar;bool full=false,holdOriginal=false,referenceBase=false;int compareMode=0;float compareSplit=.5f;WINDOWPLACEMENT windowPlacement{sizeof(windowPlacement)};@@ -373,7 +373,7 @@ case RemotePlay:veyra::ui::showRemotePlayPanel(hwnd,[](veyra::source::RemotePlay}return result;},[]{engine.stop();},[]{return remoteController.calibrate();});break;#endif-case Capture:case ProRailCapture:veyra::ui::showCapturePanel(hwnd,[](const std::wstring& path){openFile(path);layout();});break;+case Capture:case ProRailCapture:veyra::ui::showCapturePanel(hwnd,[](const std::wstring& path){openFile(path);layout();},[]{return (uiState.enhanced?engine.snapshot().desired:uiState.configured).forceSdrPreview;},[](bool enabled){auto s=uiState.enhanced?engine.snapshot().desired:uiState.configured;s.forceSdrPreview=enabled;return applySettings(s);});break;case Export:if(uiState.mode==veyra::ui::Mode::Professional)startVideoExport(false);break;case Info:showDiagnostics=!showDiagnostics;layout();break;}return 0;diff --git a/apps/veyra/ui/CapturePanel.cpp b/apps/veyra/ui/CapturePanel.cppindex 4d50f303..de0b3682 100644--- a/apps/veyra/ui/CapturePanel.cpp+++ b/apps/veyra/ui/CapturePanel.cpp@@ -10,23 +10,25 @@ HWND window=nullptr;HFONT font=nullptr;std::function<void(const std::wstring&)>struct Query {int device=-1;std::vector<std::wstring> video,audio;std::vector<source::CaptureFormat> formats;};std::future<Query> pending;bool busy=false;int queriedDevice=-1;ULONGLONG queryStarted=0;std::vector<source::CaptureFormat> formats;+std::function<bool()> readSdr;std::function<bool(bool)> setSdr;void query(int device){if(busy)return;busy=true;queriedDevice=device;queryStarted=GetTickCount64();SetDlgItemTextW(window,8,L"正在查询设备能力…当前播放继续");EnableWindow(GetDlgItem(window,4),FALSE);EnableWindow(GetDlgItem(window,5),FALSE);EnableWindow(GetDlgItem(window,1),FALSE);pending=std::async(std::launch::async,[device]{CoInitializeEx(nullptr,COINIT_MULTITHREADED);Query result;result.device=device;try{if(device<0){result.video=source::CaptureCardSource::devices();result.audio=source::CaptureCardSource::devices(true);}else result.formats=source::CaptureCardSource::formats(unsigned(device));}catch(...){}CoUninitialize();return result;});}-void arrange(){RECT r{};GetClientRect(window,&r);const int width=MulDiv(r.right,96,veyra::ui::layoutDpi(window));const int ys[]={0,44,114,184,368,368,14,84,300,154,254,224};for(int id=1;id<=11;++id){int x=id==5?width-152:16;int w=id==4?width-184:id==5?136:width-32;MoveWindow(GetDlgItem(window,id),dip(window,x),dip(window,ys[id]),dip(window,w),dip(window,(id<=3||id==10)?180:id==8?56:id==4||id==5?36:24),TRUE);}}+void arrange(){RECT r{};GetClientRect(window,&r);const int width=MulDiv(r.right,96,veyra::ui::layoutDpi(window));const int ys[]={0,44,114,184,412,412,14,84,344,154,254,224,294};for(int id=1;id<=12;++id){int x=id==5?width-152:16;int w=id==4?width-184:id==5?136:width-32;MoveWindow(GetDlgItem(window,id),dip(window,x),dip(window,ys[id]),dip(window,w),dip(window,(id<=3||id==10)?180:id==8?56:id==4||id==5?36:24),TRUE);}}LRESULT CALLBACK proc(HWND h,UINT msg,WPARAM wp,LPARAM lp){switch(msg){case WM_CREATE:{window=h;font=makeFont(h);titleTheme(h);auto add=[&](const wchar_t* cls,const wchar_t* label,int id,DWORD style){auto c=CreateWindowExW(0,cls,label,WS_CHILD|WS_VISIBLE|style,0,0,1,1,h,HMENU(INT_PTR(id)),GetModuleHandleW(nullptr),nullptr);SendMessageW(c,WM_SETFONT,WPARAM(font),TRUE);themeControl(c);};for(int i=1;i<=3;++i)add(L"COMBOBOX",L"",i,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP);add(L"COMBOBOX",L"",10,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP);add(L"STATIC",L"输入颜色(变更需重连)",11,0);- for(auto name:{L"自动 · 使用设备元数据",L"手动 HDR10 / PQ · BT.2020",L"手动 HLG · BT.2020 / 1000nit参考"})SendDlgItemMessageW(h,10,CB_ADDSTRING,0,LPARAM(name));SendDlgItemMessageW(h,10,CB_SETCURSEL,0,0);+ for(auto name:{L"自动识别 SDR / HDR · 设备元数据",L"手动 HDR10 / PQ · BT.2020",L"手动 HLG · BT.2020 / 1000nit参考"})SendDlgItemMessageW(h,10,CB_ADDSTRING,0,LPARAM(name));SendDlgItemMessageW(h,10,CB_SETCURSEL,0,0);+ add(L"BUTTON",L"转为 SDR 显示(所有预览,立即生效)",12,BS_AUTOCHECKBOX|WS_TABSTOP);SendDlgItemMessageW(h,12,BM_SETCHECK,readSdr()?BST_CHECKED:BST_UNCHECKED,0);add(L"BUTTON",L"连接并开始观看",4,BS_PUSHBUTTON|WS_TABSTOP);marked(GetDlgItem(h,4));add(L"BUTTON",L"刷新设备",5,BS_PUSHBUTTON|WS_TABSTOP);add(L"STATIC",L"视频输入设备",6,0);add(L"STATIC",L"设备实际支持的格式",7,0);add(L"STATIC",L"",8,0);add(L"STATIC",L"HDMI 音频监听",9,0);- installDialogHelp(h,{{10,L"设备没报HDR信息时手动指定,需选P010/P016。P010也可能装SDR,别给普通画面强戴HDR帽子。"},{1,L"选采集卡的视频设备。别把摄像头误请来直播PS5。"},{2,L"选设备真实提供的分辨率、帧率和像素格式。清晰度、带宽和延迟都受它影响。"},{3,L"选择对应的采集音频设备,也可不采声音。画面和声音要认对门。"},{4,L"按当前格式连接采集卡,并应用当前增强设置。"},{5,L"重新扫描设备和格式。设备被其他软件占用时,刷新不一定能抢回来。"}});+ installDialogHelp(h,{{12,L"收到HDR也转成SDR显示,不用改PS5或Windows。增强照常用;只改预览,视频导出不受影响。切换会短暂停顿,截图跟随当前画面。关闭后跟随显示器。"},{10,L"设备没报HDR信息时手动指定,需选P010/P016。P010也可能装SDR,别给普通画面强戴HDR帽子。"},{1,L"选采集卡的视频设备。别把摄像头误请来直播PS5。"},{2,L"选设备真实提供的分辨率、帧率和像素格式。清晰度、带宽和延迟都受它影响。"},{3,L"选择对应的采集音频设备,也可不采声音。画面和声音要认对门。"},{4,L"按当前格式连接采集卡,并应用当前增强设置。"},{5,L"重新扫描设备和格式。设备被其他软件占用时,刷新不一定能抢回来。"}});EnableWindow(GetDlgItem(h,4),FALSE);arrange();SetTimer(h,1,100,nullptr);if(!busy)query(-1);return 0;}-case WM_TIMER:if(busy&&pending.wait_for(std::chrono::seconds(0))==std::future_status::ready){auto result=pending.get();busy=false;EnableWindow(GetDlgItem(h,5),TRUE);EnableWindow(GetDlgItem(h,1),TRUE);if(result.device<0){SendDlgItemMessageW(h,1,CB_RESETCONTENT,0,0);SendDlgItemMessageW(h,2,CB_RESETCONTENT,0,0);SendDlgItemMessageW(h,3,CB_RESETCONTENT,0,0);formats.clear();for(auto& name:result.video)SendDlgItemMessageW(h,1,CB_ADDSTRING,0,LPARAM(name.c_str()));SendDlgItemMessageW(h,3,CB_ADDSTRING,0,LPARAM(L"不监听音频"));for(auto& name:result.audio)SendDlgItemMessageW(h,3,CB_ADDSTRING,0,LPARAM(name.c_str()));SendDlgItemMessageW(h,3,CB_SETCURSEL,0,0);SetDlgItemTextW(h,8,result.video.empty()?L"未找到采集设备。连接后点击刷新。":L"请选择设备以查询实际格式;点击连接前不会中断当前视频。");}+case WM_TIMER:SendDlgItemMessageW(h,12,BM_SETCHECK,readSdr()?BST_CHECKED:BST_UNCHECKED,0);if(busy&&pending.wait_for(std::chrono::seconds(0))==std::future_status::ready){auto result=pending.get();busy=false;EnableWindow(GetDlgItem(h,5),TRUE);EnableWindow(GetDlgItem(h,1),TRUE);if(result.device<0){SendDlgItemMessageW(h,1,CB_RESETCONTENT,0,0);SendDlgItemMessageW(h,2,CB_RESETCONTENT,0,0);SendDlgItemMessageW(h,3,CB_RESETCONTENT,0,0);formats.clear();for(auto& name:result.video)SendDlgItemMessageW(h,1,CB_ADDSTRING,0,LPARAM(name.c_str()));SendDlgItemMessageW(h,3,CB_ADDSTRING,0,LPARAM(L"不监听音频"));for(auto& name:result.audio)SendDlgItemMessageW(h,3,CB_ADDSTRING,0,LPARAM(name.c_str()));SendDlgItemMessageW(h,3,CB_SETCURSEL,0,0);SetDlgItemTextW(h,8,result.video.empty()?L"未找到采集设备。连接后点击刷新。":L"请选择设备以查询实际格式;点击连接前不会中断当前视频。");}else{formats=std::move(result.formats);SendDlgItemMessageW(h,2,CB_RESETCONTENT,0,0);for(auto& format:formats)SendDlgItemMessageW(h,2,CB_ADDSTRING,0,LPARAM(format.label.c_str()));if(!formats.empty())SendDlgItemMessageW(h,2,CB_SETCURSEL,0,0);EnableWindow(GetDlgItem(h,4),!formats.empty());SetDlgItemTextW(h,8,formats.empty()?L"未读到有效的4K以内采集格式,或设备正被其他应用占用。":L"连接后使用当前增强设置。格式与音频变更需要重新连接。");}}else if(busy&&GetTickCount64()-queryStarted>5000)SetDlgItemTextW(h,8,L"设备查询耗时较长。可以关闭此面板,当前播放不受影响。");return 0;-case WM_COMMAND:if(LOWORD(wp)==1&&HIWORD(wp)==CBN_SELCHANGE)query(int(SendDlgItemMessageW(h,1,CB_GETCURSEL,0,0)));else if(LOWORD(wp)==5)query(-1);else if(LOWORD(wp)==4){int device=int(SendDlgItemMessageW(h,1,CB_GETCURSEL,0,0)),format=int(SendDlgItemMessageW(h,2,CB_GETCURSEL,0,0)),audio=int(SendDlgItemMessageW(h,3,CB_GETCURSEL,0,0))-1;if(!busy&&device==queriedDevice&&format>=0&&size_t(format)<formats.size()){start(std::format(L"capture:{}:{}:{}:{}",device,formats[format].index,audio,int(SendDlgItemMessageW(h,10,CB_GETCURSEL,0,0))));DestroyWindow(h);}}return 0;+case WM_COMMAND:if(LOWORD(wp)==12&&HIWORD(wp)==BN_CLICKED){const bool enabled=SendDlgItemMessageW(h,12,BM_GETCHECK,0,0)==BST_CHECKED;if(!setSdr(enabled))SetDlgItemTextW(h,8,L"当前正在切换增强,请稍后再试。");SendDlgItemMessageW(h,12,BM_SETCHECK,readSdr()?BST_CHECKED:BST_UNCHECKED,0);}else if(LOWORD(wp)==1&&HIWORD(wp)==CBN_SELCHANGE)query(int(SendDlgItemMessageW(h,1,CB_GETCURSEL,0,0)));else if(LOWORD(wp)==5)query(-1);else if(LOWORD(wp)==4){int device=int(SendDlgItemMessageW(h,1,CB_GETCURSEL,0,0)),format=int(SendDlgItemMessageW(h,2,CB_GETCURSEL,0,0)),audio=int(SendDlgItemMessageW(h,3,CB_GETCURSEL,0,0))-1;if(!busy&&device==queriedDevice&&format>=0&&size_t(format)<formats.size()){start(std::format(L"capture:{}:{}:{}:{}",device,formats[format].index,audio,int(SendDlgItemMessageW(h,10,CB_GETCURSEL,0,0))));DestroyWindow(h);}}return 0;case WM_CTLCOLORSTATIC:case WM_CTLCOLOREDIT:case WM_CTLCOLORLISTBOX:case WM_CTLCOLORBTN:return colors(msg,wp,lp);case WM_SIZE:arrange();return 0;case WM_DPICHANGED:{auto r=reinterpret_cast<RECT*>(lp);SetWindowPos(h,nullptr,r->left,r->top,r->right-r->left,r->bottom-r->top,SWP_NOZORDER|SWP_NOACTIVATE);auto old=font;font=makeFont(h);EnumChildWindows(h,[](HWND c,LPARAM f)->BOOL{SendMessageW(c,WM_SETFONT,WPARAM(f),TRUE);return TRUE;},LPARAM(font));DeleteObject(old);arrange();return 0;}@@ -35,5 +37,5 @@ case WM_CLOSE:DestroyWindow(h);return 0;case WM_DESTROY:KillTimer(h,1);DeleteObject(font);window=nullptr;return 0;}return DefWindowProcW(h,msg,wp,lp);}}-void showCapturePanel(HWND parent,std::function<void(const std::wstring&)> callback){start=std::move(callback);if(window){SetForegroundWindow(window);return;}WNDCLASSW wc{};wc.lpfnWndProc=proc;wc.hInstance=GetModuleHandleW(nullptr);wc.lpszClassName=L"VeyraCaptureSetup";wc.hbrBackground=panelBrush();wc.hCursor=LoadCursorW(nullptr,IDC_ARROW);RegisterClassW(&wc);CreateWindowExW(WS_EX_TOOLWINDOW,wc.lpszClassName,L"采集卡 · 连接设置",WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_VISIBLE,CW_USEDEFAULT,CW_USEDEFAULT,dip(parent,560),dip(parent,470),parent,nullptr,wc.hInstance,nullptr);}+void showCapturePanel(HWND parent,std::function<void(const std::wstring&)> callback,std::function<bool()> read,std::function<bool(bool)> write){start=std::move(callback);readSdr=std::move(read);setSdr=std::move(write);if(window){SetForegroundWindow(window);return;}WNDCLASSW wc{};wc.lpfnWndProc=proc;wc.hInstance=GetModuleHandleW(nullptr);wc.lpszClassName=L"VeyraCaptureSetup";wc.hbrBackground=panelBrush();wc.hCursor=LoadCursorW(nullptr,IDC_ARROW);RegisterClassW(&wc);CreateWindowExW(WS_EX_TOOLWINDOW,wc.lpszClassName,L"采集卡 · 连接设置",WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_VISIBLE,CW_USEDEFAULT,CW_USEDEFAULT,dip(parent,560),dip(parent,514),parent,nullptr,wc.hInstance,nullptr);}}diff --git a/apps/veyra/ui/CapturePanel.h b/apps/veyra/ui/CapturePanel.hindex c9334942..5b830595 100644--- a/apps/veyra/ui/CapturePanel.h+++ b/apps/veyra/ui/CapturePanel.h@@ -2,4 +2,4 @@#include <windows.h>#include <string>#include <functional>-namespace veyra::ui {void showCapturePanel(HWND,std::function<void(const std::wstring&)>);}+namespace veyra::ui {void showCapturePanel(HWND,std::function<void(const std::wstring&)>,std::function<bool()> readSdr,std::function<bool(bool)> setSdr);}diff --git a/docs/HDR_MULTICHANNEL_EXECUTION_2026-09-14.md b/docs/HDR_MULTICHANNEL_EXECUTION_2026-09-14.mdindex ab150f79..5e0f1189 100644--- a/docs/HDR_MULTICHANNEL_EXECUTION_2026-09-14.md+++ b/docs/HDR_MULTICHANNEL_EXECUTION_2026-09-14.md@@ -75,3 +75,23 @@ HLG参考:[ITU-R BT.2100-2](https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-- 修复后的JXR独立逐像素检查、采集6ch/10ms协商、完整HDR/SDR颜色检查及最终交付短测均以当前代码通过。`git diff --check`通过;无SDK、运行库、模型、用户配置或媒体进入Git。- XeSS验证的是HDR10初始化、真实SDK生成计数与软件原帧数值;本轮没有独立回读XeSS驱动交换链生成帧作逐像素比较。实际生成帧观感仍需用户验收。- 对外状态:本地开发版可测,非发布版、非全部硬件验收完成。下一步只需用户进行上节列出的HDR屏/采集卡/5.1实机验收,收到日志后针对问题修复;未经新授权不发布。+++## C — 2026-09-14 手动 SDR 预览输出++用户要求在 HDR 输入下自行选择 SDR 显示。采集面板增加“转为 SDR 显示(所有预览,立即生效)”,默认关闭;输入自动选项改为“自动识别 SDR / HDR · 设备元数据”。这是全局预览显示设置,作用于文件、采集和串流;不改变源 PQ/HLG 元数据,不修改 Windows HDR,不关闭 NR/SR/FG。视频导出仍按独立的 HDR 合同,截图跟随当前预览。++实现:EnhancementSettings.forceSdrPreview 与 useHdrPreview 统一启动、实时事务、显示器状态轮询和尺寸变更的输出判定,避免强制 SDR 时被 2 秒轮询反复恢复 HDR。实时切换沿用原子 drain/reset/rebuild 与失败恢复;关闭总增强时单独提交显示设置。采集面板保持开关同步,关闭后重开不丢;设置通过 v12 预设/最近应用设置保存,旧 v1–v11 默认关闭。新增 display-color 日志报告实际 hdrInput/hdrOutput/forceSdrPreview。++修改文件:apps/veyra/ui/{AppShell.cpp,CapturePanel.cpp,CapturePanel.h}、include/veyra/engine/EnhancementSettings.h、src/engine/{EngineController.cpp,PresetStore.cpp}、tests/unit/{RepairPresetTests.cpp,UiContractTests.cpp}、双语 README 与本记录/WORKLOG。没有改变 SDK、运行库、颜色 shader 或导出流程。++实际检查:+- `cmd /c out\release-1.1.0-build.cmd`:最终 exit 0,out/force-sdr-build-verified.log。首次链接失败 LNK1104 是旧 veyra.exe 仍运行,占用输出;用户确认已关闭后向残留进程正常发送关闭请求,进程退出,再构建通过。原失败记录 out/force-sdr-build.log 保留。+- `veyra_repair_preset_tests.exe out/force-sdr-presets-final.v1`:exit 0,48 组旧预设迁移、新开关 roundtrip;out/force-sdr-presets-final.log。+- `veyra_ui_contract_tests.exe out/force-sdr-ui-final`:exit 0;检查 8 种输入/显示器/强制 SDR 组合、关闭增强保留显示选择、持久化与已有布局合同;out/force-sdr-ui-final.log。+- `veyra_hdr_color_tests.exe`:exit 0,30 采集颜色 GPU 用例与 16 PQ/HLG、planar/P010、range、HDR/SDR 输出数值组合通过;out/force-sdr-color.log。测试末尾销毁未提交列表的诊断不是测试失败。+- `python out/force_sdr_ui_check.py`:真实产品加载 PQ 文件,总增强关闭,开关默认关闭,连续切换四次、关闭面板重开保持、控件在窗口内均通过;out/force-sdr-ui-live-result.txt。out/force-sdr-live.log 记录 revisions 3–6 Applied、source kept open、hdrInput=true 始终保留;18 秒 smoke 30 帧、failed=false,exit 0。素材约 1 秒,后半段为末帧显示,不冒充 18 秒持续运动视频。+- `powershell -NoProfile -ExecutionPolicy Bypass -File scripts/gates/delivery.ps1 -Root . -BuildDirectory out/remoteplay/product-repair`:23/23、45.20 秒,logs/delivery/6a7c3d4a27e140ec9145e8e016bc7453/result.json。实际 NR CreateFeature id18 result0x1、SEH0;60 次 Evaluate、NVOF 非零运动,SDR4K导出等原有回归通过。+- `git diff --check` 通过。EXE SHA256 9D3DFFA2D397F00F512B962A349453430CD3F0039ECF55FAB9961279291B2C76。patched avcodec-63.dll 仍为 0710F0D87A7FFCC9F998F1A35D0500345F6C66EB9A5A39C51D60D293142BD84F。++当前 Windows HDR 关闭:本轮 UI 实测均 hdrOutput=false;开关从 HDR 交换链切到 SDR 的物理显示验收、跨 HDR 屏移动及 HDR 实卡仍未执行。GPU 色调映射数值通过不等于 HDR 显示器观感通过。下一步用户从桌面“Veyra PS5 测试版”打开采集面板,在实际 HDR 输入/显示器上开关比较;不用重连采集卡。未发布或推送 GitHub。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 48a329cc..aeda7b9f 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -1978,3 +1978,12 @@ GitHub Release https://github.com/Likely7/Veyra-NRVideo/releases/tag/v1.0.0 于本轮发现并纠正FP16截图只拷半行、六声道上游缓冲仍限定8字节、旧测试/播放器probe将单声道送进立体声renderer;首轮JXR自回读不能证明原图完整、首轮audio-timeline包含4失败,均保留失败日志并由独立检查/重跑覆盖。其他编译/夹具失败和真实Create/Evaluate结果详见docs/HDR_MULTICHANNEL_EXECUTION_2026-09-14.md及logs/hdr-multichannel。没有把失败删掉或把尾部PASS当整套通过。桌面Veyra PS5测试版快捷方式指向当前构建。当前桌面HDR未启用、音频输出2ch,真实UI测试明确走HDR转SDR和6→2降混;HDR输出数值/接口验证与HDR实屏是分开的证据。未测真实5.1扬声器、HDR实卡、30/40系列、PS5新会话、OBS HDR及跨显示器切换。只完成软件实施,不宣称所有设备和画质验收。下一步用户在HDR屏与真5.1设备上验收;没有新push、Release、运行库替换或关机。+++## 2026-09-14 — 手动转为 SDR 显示++用户授权增加 SDR 输出开关。采集面板默认关闭的“转为 SDR 显示”立即作用于所有预览,源 HDR 元数据保留、总增强关闭时也生效;启动/显示器轮询/尺寸变更/实时事务统一输出策略,避免轮询恢复 HDR。v12 预设保存,旧设置默认关闭;导出 HDR 合同不变,截图跟随预览。双语 README 更新,致谢仍在底部。++最终构建 cmd /c out\release-1.1.0-build.cmd 成功;首次旧进程占用造成 LNK1104,正常关闭后重建成功,失败日志保留。48 组预设迁移与 roundtrip、UI/输出策略合同、30 采集 GPU 颜色 +16 HDR 组合通过;真实 UI 加载 PQ 文件,在总增强关闭下连续切换/重开面板通过,源保持开启,日志记录实际 HDR 输入/SDR 输出。delivery23/23、45.20秒,logs/delivery/6a7c3d4a27e140ec9145e8e016bc7453/result.json;NR Create0x1 SEH0、60次Evaluate。EXE SHA256 9D3DFFA2D397F00F512B962A349453430CD3F0039ECF55FAB9961279291B2C76,patched FFmpeg未变。++完整命令/文件/证据与失败见 docs/HDR_MULTICHANNEL_EXECUTION_2026-09-14.md C节。当前Windows HDR关闭,物理HDR↔SDR交换链与实卡视觉切换未测;下一步用户用桌面测试版在HDR设备上验收。只更新本地开发版,没有push/Release。diff --git a/include/veyra/engine/EnhancementSettings.h b/include/veyra/engine/EnhancementSettings.hindex 938ed62f..0b8f51ab 100644--- a/include/veyra/engine/EnhancementSettings.h+++ b/include/veyra/engine/EnhancementSettings.h@@ -70,6 +70,8 @@ struct EnhancementSettings {bool lowLatency=false; // preview only: NR before SR, opt-inNrRuntime nrRuntime=NrRuntime::Original;bool captureCompatible=false;+ bool forceSdrPreview=false; // display only; retain actual HDR source metadata+ bool useHdrPreview(bool hdrInput,bool hdrDisplayActive)const{return hdrInput&&hdrDisplayActive&&!forceSdrPreview;}pipeline::SrTarget srTarget=pipeline::SrTarget::Uhd4K;uint32_t videoSrQuality=0; // 0 DLSS SR; 1–4 RTX Video SRuint32_t multiplier=1;diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cppindex a28fe5f3..c2230404 100644--- a/src/engine/EngineController.cpp+++ b/src/engine/EngineController.cpp@@ -193,7 +193,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sgd.nrBeforeSr=!isImage&&options.settings.lowLatency&&options.nr&&resolution.srApplied;gd.enableSr=resolution.srApplied&&nvidiaAdapter;gd.videoSrQuality=options.settings.videoSrQuality;gd.enableNr=options.nr&&nvidiaAdapter;gd.nrRuntime=options.settings.nrRuntime;gd.enableFg=options.fg&&(nvidiaAdapter||xessFg);gd.fgMultiplier=options.fgMultiplier;gd.frameGenerationBackend=options.settings.frameGenerationBackend;gd.enableNvofStandalone=gd.enableNr;gd.noFeatures=false;gd.model=options.settings.model;gd.residual=options.settings.residual;gd.protection=options.settings.protection;gd.settingsRevision=options.settings.revision;gd.flowQuality=options.settings.flow;gd.contentRate=options.settings.content;gd.opticalFlowBackend=options.settings.opticalFlowBackend;gd.amdFlowHalfResolution=options.settings.amdFlowHalfResolution;- gd.hdrOutput=gd.hdrInput&&gfx::PresentSink::hdrDisplayActive(window);+ gd.hdrOutput=options.settings.useHdrPreview(gd.hdrInput,gfx::PresentSink::hdrDisplayActive(window));+ veyra::log::info("display-color",std::format("hdrInput={} hdrOutput={} forceSdrPreview={}",gd.hdrInput,gd.hdrOutput,options.settings.forceSdrPreview));gd.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();if(!graph.initialize(gd)||!presenter.open(ctx,window,graph,options.settings.captureCompatible)||!graph.createViews()){status(L"增强初始化失败,请核对本地运行时",true);break;}if(!nvidiaAdapter&&(options.nr||options.sr||(options.fg&&!xessFg))){@@ -371,7 +372,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,swhile(!stop_){if(gd.hdrInput&&GetTickCount64()-hdrDisplayCheck>2000){hdrDisplayCheck=GetTickCount64();- const bool native=gfx::PresentSink::hdrDisplayActive(window);+ const bool native=options.settings.useHdrPreview(gd.hdrInput,gfx::PresentSink::hdrDisplayActive(window));if(native!=gd.hdrOutput){std::lock_guard lock(mutex_);if(desired_.revision==options.settings.revision){desired_.revision=++nextRevision_;snapshot_.desired=desired_;snapshot_.applying=true;}}}if(audioStarted)publishAudioStatus();@@ -428,7 +429,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,snextDesc.nrBeforeSr=!isImage&&requested.lowLatency&&requested.nr&&plan.srApplied;nextDesc.enableSr=plan.srApplied&&nvidiaAdapter;nextDesc.videoSrQuality=next.settings.videoSrQuality;nextDesc.enableNr=next.nr&&nvidiaAdapter;nextDesc.nrRuntime=next.settings.nrRuntime;nextDesc.enableFg=next.fg&&(nvidiaAdapter||xessFg);nextDesc.fgMultiplier=next.fgMultiplier;nextDesc.frameGenerationBackend=next.settings.frameGenerationBackend;nextDesc.enableNvofStandalone=nextDesc.enableNr;nextDesc.model=requested.model;nextDesc.residual=requested.residual;nextDesc.protection=requested.protection;nextDesc.settingsRevision=requested.revision;nextDesc.flowQuality=requested.flow;nextDesc.contentRate=requested.content;nextDesc.opticalFlowBackend=requested.opticalFlowBackend;nextDesc.amdFlowHalfResolution=requested.amdFlowHalfResolution;- nextDesc.hdrOutput=nextDesc.hdrInput&&gfx::PresentSink::hdrDisplayActive(window);+ nextDesc.hdrOutput=requested.useHdrPreview(nextDesc.hdrInput,gfx::PresentSink::hdrDisplayActive(window));const bool rebuild=gd.hdrOutput!=nextDesc.hdrOutput||previous.captureCompatible!=requested.captureCompatible||gd.nrRuntime!=nextDesc.nrRuntime||gd.opticalFlowBackend!=nextDesc.opticalFlowBackend||gd.amdFlowHalfResolution!=nextDesc.amdFlowHalfResolution||gd.enableNr!=nextDesc.enableNr||gd.enableFg!=nextDesc.enableFg||gd.frameGenerationBackend!=nextDesc.frameGenerationBackend||gd.fgMultiplier!=nextDesc.fgMultiplier||gd.videoSrQuality!=nextDesc.videoSrQuality||gd.flowQuality!=nextDesc.flowQuality||gd.nrBeforeSr!=nextDesc.nrBeforeSr||gd.workWidth!=nextDesc.workWidth||gd.workHeight!=nextDesc.workHeight||gd.nrWidth!=nextDesc.nrWidth||gd.nrHeight!=nextDesc.nrHeight||gd.flowWidth!=nextDesc.flowWidth||gd.flowHeight!=nextDesc.flowHeight;bool accepted=ring.drainQueue();out={};hasOutput=false;resetRecord->rebuilt=rebuild;@@ -521,7 +522,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,swidth=uint32_t(frame->width);height=uint32_t(frame->height);auto plan=pipeline::ResolutionPlan::make({width,height},options.sr,options.settings.nrPolicy,false,options.settings.revision,options.settings.srTarget,options.settings.lowLatency&&options.nr);gd.nrBeforeSr=options.settings.lowLatency&&options.nr&&plan.srApplied;gd.enableSr=plan.srApplied&&ctx.adapter().isNvidia;- gd.sourceWidth=width;gd.sourceHeight=height;gd.hdrInput=!isImage&&activeSource->info().color.isHdrPath();gd.hdrOutput=gd.hdrInput&&gfx::PresentSink::hdrDisplayActive(window);gd.workWidth=plan.base.width;gd.workHeight=plan.base.height;gd.nrWidth=plan.nr.width;gd.nrHeight=plan.nr.height;gd.flowWidth=plan.flow.width;gd.flowHeight=plan.flow.height;+ gd.sourceWidth=width;gd.sourceHeight=height;gd.hdrInput=!isImage&&activeSource->info().color.isHdrPath();gd.hdrOutput=options.settings.useHdrPreview(gd.hdrInput,gfx::PresentSink::hdrDisplayActive(window));gd.workWidth=plan.base.width;gd.workHeight=plan.base.height;gd.nrWidth=plan.nr.width;gd.nrHeight=plan.nr.height;gd.flowWidth=plan.flow.width;gd.flowHeight=plan.flow.height;presenter.close();graph.shutdown();out={};hasOutput=false;if(!graph.initialize(gd)||!presenter.open(ctx,window,graph,options.settings.captureCompatible)||!graph.createViews()){status(L"串流尺寸切换失败",true);break;}reset=true;pendingResetCause=pipeline::ResetReason::Resize;@@ -654,7 +655,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s}else{status(L"参数回滚失败,已停止",true);break;}}else{status(L"增强执行失败;请查看日志",true);break;}}- if(transaction){std::lock_guard lock(mutex_);snapshot_.applied=options.snapshot();snapshot_.applying=desired_!=snapshot_.applied;snapshot_.status=std::format(L"输入 {}×{} / 底图 {}×{} / NR {}×{} / 光流 {}×{} / FG与输出 {}×{} | {}",width,height,gd.workWidth,gd.workHeight,gd.nrWidth,gd.nrHeight,gd.flowWidth,gd.flowHeight,gd.workWidth,gd.workHeight,gd.nrBeforeSr?L"低延迟 · NR先行后超分":gd.nrWidth<gd.workWidth?L"实时内部处理并回填":L"原生NR(性能成本较高)");veyra::log::info("settings",std::format("Applied revision={} sourcePtsMs={} fgBackend={} flowBackend={} multiplier={} (source kept open)",options.settings.revision,pts,frameGenerationBackendName(options.settings.frameGenerationBackend),opticalFlowBackendName(options.settings.opticalFlowBackend),options.snapshot().multiplier));}+ if(transaction){std::lock_guard lock(mutex_);snapshot_.applied=options.snapshot();snapshot_.applying=desired_!=snapshot_.applied;snapshot_.status=std::format(L"输入 {}×{} / 底图 {}×{} / NR {}×{} / 光流 {}×{} / FG与输出 {}×{} | {}",width,height,gd.workWidth,gd.workHeight,gd.nrWidth,gd.nrHeight,gd.flowWidth,gd.flowHeight,gd.workWidth,gd.workHeight,gd.nrBeforeSr?L"低延迟 · NR先行后超分":gd.nrWidth<gd.workWidth?L"实时内部处理并回填":L"原生NR(性能成本较高)");veyra::log::info("display-color",std::format("hdrInput={} hdrOutput={} forceSdrPreview={}",gd.hdrInput,gd.hdrOutput,options.settings.forceSdrPreview));veyra::log::info("settings",std::format("Applied revision={} sourcePtsMs={} fgBackend={} flowBackend={} multiplier={} (source kept open)",options.settings.revision,pts,frameGenerationBackendName(options.settings.frameGenerationBackend),opticalFlowBackendName(options.settings.opticalFlowBackend),options.snapshot().multiplier));}if(veyra::log::verboseFrameLogs())veyra::log::info("source-identity",std::format("source={} totalRead={} graphProcessed={} cached={} revision={} nvofStandalone={}",pkt.sequence,sourceFrames,frames+1,rereadCached,options.settings.revision,gd.enableNvofStandalone));reset=false;hasOutput=true;const auto processDone=Clock::now();diff --git a/src/engine/PresetStore.cpp b/src/engine/PresetStore.cppindex f4659250..fc01f761 100644--- a/src/engine/PresetStore.cpp+++ b/src/engine/PresetStore.cpp@@ -13,12 +13,12 @@ bool nameOk(const std::wstring& s){return !s.empty()&&s.size()<=48&&s.front()!=Lstd::wstring trim(std::wstring s){auto a=s.find_first_not_of(L" \t\r\n");if(a==s.npos)return {};auto b=s.find_last_not_of(L" \t\r\n");return s.substr(a,b-a+1);}}std::string PresetStore::serialize()const{- std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 11\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';- for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<' '<<s.videoSrQuality<<' '<<int(s.frameGenerationBackend)<<' '<<int(s.srTarget)<<' '<<int(s.opticalFlowBackend)<<' '<<s.amdFlowHalfResolution<<' '<<int(s.audioSync)<<' '<<s.audioOffsetMs<<' '<<int(s.nrRuntime)<<' '<<s.captureCompatible<<' '<<s.lowLatency<<'\n';}return o.str();+ std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 12\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';+ for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<' '<<s.videoSrQuality<<' '<<int(s.frameGenerationBackend)<<' '<<int(s.srTarget)<<' '<<int(s.opticalFlowBackend)<<' '<<s.amdFlowHalfResolution<<' '<<int(s.audioSync)<<' '<<s.audioOffsetMs<<' '<<int(s.nrRuntime)<<' '<<s.captureCompatible<<' '<<s.lowLatency<<' '<<s.forceSdrPreview<<'\n';}return o.str();}bool PresetStore::parse(const std::string& data,std::vector<UserPreset>& out,std::wstring& def){if(data.size()>65536)return false;std::istringstream in(data);in.imbue(std::locale::classic());std::string magic,d;int version=0;size_t count=0;- if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version<1||version>11)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;+ if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version<1||version>12)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;for(size_t i=0;i<count;++i){UserPreset p;std::string n;int policy,flow,content,nr,sr;auto& s=p.settings;auto& m=s.model;auto& r=s.residual;if(!(in>>std::quoted(n)>>m.intensity>>m.tone>>m.structure>>m.skin>>m.style>>m.autoMask>>m.uiCorrection>>r.total>>r.darken>>r.brighten>>r.color>>r.luminance>>nr>>sr>>s.multiplier>>policy>>flow>>content))return false;if(version>=2){int enabled;if(!(in>>enabled>>s.protection.featherPixels)||enabled<0||enabled>1)return false;s.protection.enabled=enabled!=0;@@ -35,6 +35,7 @@ bool PresetStore::parse(const std::string& data,std::vector<UserPreset>& out,stdif(version>=9){int runtime;if(!(in>>runtime))return false;s.nrRuntime=static_cast<NrRuntime>(runtime);}if(version>=10){int capture;if(!(in>>capture)||capture<0||capture>1)return false;s.captureCompatible=capture!=0;}if(version>=11){int low;if(!(in>>low)||low<0||low>1)return false;s.lowLatency=low!=0;}+ if(version>=12){int sdr;if(!(in>>sdr)||sdr<0||sdr>1)return false;s.forceSdrPreview=sdr!=0;}p.name=wide(n);if(!nameOk(p.name)||std::any_of(out.begin(),out.end(),[&](auto& a){return a.name==p.name;})||nr<0||nr>1||sr<0||sr>1)return false;s.nr=nr;s.sr=sr;s.nrPolicy=static_cast<pipeline::NrSizePolicy>(policy);s.flow=static_cast<FlowQuality>(flow);s.content=static_cast<ContentRate>(content);if(!s.validate().empty())return false;out.push_back(std::move(p));diff --git a/tests/unit/RepairPresetTests.cpp b/tests/unit/RepairPresetTests.cppindex 26f29b32..b6774c1d 100644--- a/tests/unit/RepairPresetTests.cpp+++ b/tests/unit/RepairPresetTests.cpp@@ -7,7 +7,7 @@ namespace {bool legacyBackends(const std::filesystem::path& path) {using namespace veyra::engine;unsigned checks=0;- for(int version=4;version<=10;++version)for(int backend=0;backend<=2;++backend)for(int multiplier:{2,4}){+ for(int version=4;version<=11;++version)for(int backend=0;backend<=2;++backend)for(int multiplier:{2,4}){std::ostringstream fixture;fixture<<"VEYRA_PRESETS "<<version<<"\n\"legacy\" 1\n\"legacy\" 1 1 1 -1 0 0 0 1 1 1 1 1 1 0 "<<multiplier<<" 0 1 0";fixture<<" 0 0";@@ -18,6 +18,7 @@ bool legacyBackends(const std::filesystem::path& path) {if(version>=7)fixture<<" 1 137";if(version>=9)fixture<<" 1";if(version>=10)fixture<<" 1";+ if(version>=11)fixture<<" 0";fixture<<'\n';{std::ofstream file(path);file<<fixture.str();}const bool xess=version<8?backend==2:backend==1;@@ -27,14 +28,14 @@ bool legacyBackends(const std::filesystem::path& path) {if(store.load()!=expected)return false;if(expected){const auto value=store.defaultSettings();- if(value.lowLatency)return false;+ if(value.lowLatency||value.forceSdrPreview)return false;if(value.captureCompatible!=(version>=10))return false;if(value.nrRuntime!=(version>=9?NrRuntime::Community:NrRuntime::Original))return false;if(value.frameGenerationBackend!=(xess?FrameGenerationBackend::XeSS:FrameGenerationBackend::Dlss)||value.multiplier!=multiplier||value.videoSrQuality!=2)return false;if(version>=7&&(value.audioSync!=AudioSyncMode::Manual||value.audioOffsetMs!=137))return false;if(!store.put(L"legacy",value,true))return false;std::ifstream file(path);std::string magic;int savedVersion=0;file>>magic>>savedVersion;- if(magic!="VEYRA_PRESETS"||savedVersion!=11)return false;+ if(magic!="VEYRA_PRESETS"||savedVersion!=12)return false;PresetStore reloaded(path);if(!reloaded.load()||reloaded.defaultSettings()!=value)return false;}else{@@ -55,7 +56,7 @@ int main(int argc,char** argv){if(argc!=2)return 2;using namespace veyra::engine}s.srTarget=veyra::pipeline::SrTarget::Uhd8K;s.audioSync=AudioSyncMode::Manual;s.audioOffsetMs=137;- s.nrRuntime=NrRuntime::Community;s.captureCompatible=true;s.lowLatency=true;+ s.nrRuntime=NrRuntime::Community;s.captureCompatible=true;s.lowLatency=true;s.forceSdrPreview=true;ok=ok&&a.put(L"test",s)&&a.setDefault(0)&&!a.put(L"test",s);PresetStore b(p);ok=ok&&b.load()&&b.defaultSettings()==s&&b.rename(0,L"renamed")&&b.defaultSettings()==s;auto badTarget=s;badTarget.srTarget=static_cast<veyra::pipeline::SrTarget>(3);ok=ok&&!b.put(L"invalid target",badTarget);auto xess=s;xess.frameGenerationBackend=FrameGenerationBackend::XeSS;ok=ok&&!b.put(L"XeSS 4X rejected",xess);diff --git a/tests/unit/UiContractTests.cpp b/tests/unit/UiContractTests.cppindex f52b876d..24295a1d 100644--- a/tests/unit/UiContractTests.cpp+++ b/tests/unit/UiContractTests.cpp@@ -15,8 +15,9 @@ int wmain(int argc,wchar_t** argv){try{const float anchored=(800-500)/(1920.0f*(1000.0f/1920)*v.zoom)+v.centerX;require(std::abs(anchored-.8f)<.0001f,"pointer anchor fixed");v.wheel(-3,800,300,1000,600,1920,1080);require(std::abs(v.zoom-1)<.0001f&&std::abs(v.centerX-.5f)<.0001f,"inverse wheel returns same view");v.pan(100,0,1000,600,1920,1080);require(std::abs(v.centerX-.4f)<.0001f,"pan measured in displayed pixels");}- ui::UiSessionState state;require(!state.enhanced&&!state.configured.nr&&!state.configured.sr&&state.configured.multiplier==1,"fresh startup effects disabled");state.enhanced=true;state.configured.nr=true;state.configured.multiplier=4;state.configured.sr=true;state.configured.model.intensity=.37f;state.configured.residual.color=1.4f;- auto before=state.effective();require(state.mode==ui::Mode::Daily,"startup Daily");state.mode=ui::Mode::Professional;require(state.effective()==before,"mode cannot alter settings");state.enhanced=false;auto bypass=state.effective();require(!bypass.nr&&!bypass.sr&&bypass.multiplier==1,"true full bypass");state.enhanced=true;require(state.effective()==before,"restore all settings");+ ui::UiSessionState state;require(!state.enhanced&&!state.configured.nr&&!state.configured.sr&&state.configured.multiplier==1,"fresh startup effects disabled");state.configured.forceSdrPreview=true;state.enhanced=true;state.configured.nr=true;state.configured.multiplier=4;state.configured.sr=true;state.configured.model.intensity=.37f;state.configured.residual.color=1.4f;+ auto before=state.effective();require(state.mode==ui::Mode::Daily,"startup Daily");state.mode=ui::Mode::Professional;require(state.effective()==before,"mode cannot alter settings");state.enhanced=false;auto bypass=state.effective();require(!bypass.nr&&!bypass.sr&&bypass.multiplier==1,"true full bypass");require(bypass.forceSdrPreview,"master bypass retains SDR display choice");state.enhanced=true;require(state.effective()==before,"restore all settings");+ for(bool input:{false,true})for(bool display:{false,true})for(bool force:{false,true}){engine::EnhancementSettings s;s.forceSdrPreview=force;require(s.useHdrPreview(input,display)==(input&&display&&!force),"HDR output policy");}ui::ChromeLayout daily(1440,900,false,false);require(daily.left==0&&daily.top==0&&daily.viewWidth==1440&&daily.viewHeight==812&&daily.bottom==812,"daily video owns all space above transport");for(int width:{688,768,868,928,1008,1040,1148,1248,1888,2528}){ui::TransportLayout t(width,true);std::vector<ui::TransportSlot> slots={t.open,t.capture,t.recent,t.master,t.sr,t.stop,t.play,t.mute,t.volume,t.subtitle,t.fullscreen,t.mode,t.minimize,t.close};