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++
Fix field regressions after NR performance acceptance
Veyra Goal Agent6e9d8273c1d3
diff --git a/CMakeLists.txt b/CMakeLists.txtindex 0b36528d..2c99f73f 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -918,6 +918,23 @@ if(VEYRA_BUILD_QML_UI AND Qt6_FOUND)# VEYRA_DISPLAY_VERSION is the human-readable version the app reports; it is# the same value the resource file uses, so the UI cannot drift from it.target_compile_definitions(veyra_qml_bridge PRIVATE VEYRA_DISPLAY_VERSION="${VEYRA_DISPLAY_VERSION}")+ # libass (ISC) + FreeType/FriBidi/HarfBuzz, static, for full ASS/SSA effect+ # subtitles. Local prebuilt tree only (vcpkg x64-windows-static-md); never in+ # source Git. Without it ASS tracks fall back to the built-in styled renderer.+ set(VEYRA_LIBASS_ROOT "" CACHE PATH "libass static install prefix (include/ass/ass.h, lib/ass.lib)")+ if(VEYRA_LIBASS_ROOT AND EXISTS "${VEYRA_LIBASS_ROOT}/include/ass/ass.h")+ target_sources(veyra_qml_bridge PRIVATE apps/veyra/ui/AssSubtitleRenderer.cpp apps/veyra/ui/AssSubtitleRenderer.h)+ set_source_files_properties(apps/veyra/ui/AssSubtitleRenderer.cpp PROPERTIES COMPILE_OPTIONS /utf-8)+ target_include_directories(veyra_qml_bridge PRIVATE "${VEYRA_LIBASS_ROOT}/include")+ target_compile_definitions(veyra_qml_bridge PRIVATE VEYRA_HAS_LIBASS=1)+ foreach(lib ass harfbuzz fribidi freetype libpng16 zs bz2 brotlidec brotlicommon)+ target_link_libraries(veyra_qml_bridge PRIVATE "${VEYRA_LIBASS_ROOT}/lib/${lib}.lib")+ endforeach()+ target_link_libraries(veyra_qml_bridge PRIVATE gdi32 dwrite)+ message(STATUS "libass: ${VEYRA_LIBASS_ROOT}")+ else()+ message(STATUS "libass: not configured; ASS effects use the built-in styled renderer")+ endif()# The QML module is deployed as plain files next to the executable rather# than compiled into a resource: the qmldir-based module keeps the .qmldiff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 708ed2e6..9136d8f1 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -711,3 +711,18 @@ Hardware inference, image quality and stability remain unverified on RX 9000.# Performance experiments (2026-10-04)`tests/perf/DuplicateFrameCS.hlsl` adapts `src/Magpie.Core/shaders/DuplicateFrameCS.hlsl` from [SAOG0721/Magpie](https://github.com/SAOG0721/Magpie/tree/27c5df91177a29b33be612e98274169f3d2fca49), fixed commit `27c5df91177a29b33be612e98274169f3d2fca49` / `v0.6.9-experimental`, GPL-3.0. Original shader SHA256 `39fe0acfcf499083c1380aa4a5dc0ad8e0b6632537efda61342e068d9eac2275` matches the local research copy byte-for-byte. Adaptations retain group reduction and atomic publication, replace sampler Gather with four bounded texture loads for D3D12/odd extents, add typed textures and provenance. This is an isolated measurement fixture; no production duplicate-skip behavior is implied.++## libass ASS/SSA subtitle renderer (2026-10-05)++Full ASS/SSA effect subtitles (karaoke, `\move`, `\fad`, `\t`, `\clip`, blur,+vector drawings, Matroska font attachments) are rendered with+[libass](https://github.com/libass/libass) 0.17.5 (ISC), statically linked into+`veyra_qml_ui.exe` together with its dependencies, all built unmodified by vcpkg+(`C:/veyra-deps/vcpkg`, commit `30ef65cad9`, triplet `x64-windows-static`):+FreeType 2.14.3 (used under the FreeType License, FTL), FriBidi 1.0.16+(LGPL-2.1-or-later; Veyra's complete corresponding source is published, so the+library can be relinked), HarfBuzz 14.4.0 (MIT), libpng (libpng license), zlib+(zlib license), bzip2 (bzip2 license) and Brotli (MIT). The license texts are the+`share/<port>/copyright` files of that vcpkg install and must accompany every+package that contains this build. No source of these libraries is committed to+Veyra's Git. Builds without `VEYRA_LIBASS_ROOT` keep the built-in styled renderer.diff --git a/apps/veyra/ui/AssSubtitleRenderer.cpp b/apps/veyra/ui/AssSubtitleRenderer.cppnew file mode 100644index 00000000..7e343576--- /dev/null+++ b/apps/veyra/ui/AssSubtitleRenderer.cpp@@ -0,0 +1,164 @@+#include "AssSubtitleRenderer.h"++#include "veyra/Log.h"++#include <algorithm>+#include <chrono>+#include <cstdarg>+#include <cstdio>+#include <format>+#include <string>+#include <vector>++extern "C" {+#include <ass/ass.h>+}++namespace veyra::ui {+namespace {+// libass is chatty at verbose levels; keep errors/warnings, rate limited.+void onMessage(int level,const char* format,va_list args,void*){+ if(level>2)return;+ static auto nextLog=std::chrono::steady_clock::time_point{};+ static int suppressed=0;+ const auto now=std::chrono::steady_clock::now();+ if(now<nextLog){++suppressed;return;}+ nextLog=now+std::chrono::milliseconds(500);+ char text[512]{};+ std::vsnprintf(text,sizeof(text),format,args);+ log::warn("libass",std::format("level={} {}{}",level,text,suppressed?std::format(" (+{} suppressed)",suppressed):std::string{}));+ suppressed=0;+}+} // namespace++struct AssSubtitleRenderer::Impl {+ ASS_Library* library=nullptr;+ ASS_Renderer* renderer=nullptr;+ ASS_Track* track=nullptr;+ std::shared_ptr<const engine::SubtitleAssData> data;+ std::wstring source;+ std::string header;+ size_t fedEvents=0,fontsAdded=0;+ bool fontsReady=false;+ ASS_Image* images=nullptr;+ int frameW=0,frameH=0,storageW=0,storageH=0;+ double fontScale=1.0;++ Impl(){+ library=ass_library_init();+ if(!library){log::error("libass","ass_library_init failed");return;}+ ass_set_message_cb(library,onMessage,nullptr);+ ass_set_extract_fonts(library,1); // [Fonts] sections embedded in the script+ renderer=ass_renderer_init(library);+ if(!renderer)log::error("libass","ass_renderer_init failed");+ }+ ~Impl(){+ images=nullptr;+ if(track)ass_free_track(track);+ if(renderer)ass_renderer_done(renderer);+ if(library)ass_library_done(library);+ }+ void addFonts(const engine::SubtitleAssData& script){+ bool added=false;+ for(;fontsAdded<script.fonts.size();++fontsAdded){+ const auto& font=script.fonts[fontsAdded];+ if(font.data.empty()||font.data.size()>size_t(INT32_MAX))continue;+ ass_add_font(library,font.name.c_str(),font.data.data(),int(font.data.size()));+ added=true;+ }+ // Memory fonts reach a renderer at its next ass_set_fonts call. The+ // system provider (DirectWrite, GDI fallback) resolves everything else.+ if(added||!fontsReady){+ const auto start=std::chrono::steady_clock::now();+ ass_set_fonts(renderer,nullptr,"Microsoft YaHei",ASS_FONTPROVIDER_AUTODETECT,nullptr,1);+ log::info("libass",std::format("fonts configured container={} ms={:.1f}",fontsAdded,+ std::chrono::duration<double,std::milli>(std::chrono::steady_clock::now()-start).count()));+ fontsReady=true;+ }+ }+ void feed(const engine::SubtitleAssData& script){+ for(;fedEvents<script.events.size();++fedEvents){+ const auto& event=script.events[fedEvents];+ if(event.chunk.empty()||event.chunk.size()>size_t(INT32_MAX))continue;+ ass_process_chunk(track,event.chunk.data(),int(event.chunk.size()),event.startMs,event.durationMs);+ }+ }+ void rebuild(const engine::SubtitleAssData& script){+ images=nullptr;+ if(track){ass_free_track(track);track=nullptr;}+ fedEvents=0;fontsAdded=0;+ addFonts(script);+ if(!script.script.empty()){+ std::vector<char> copy(script.script.begin(),script.script.end()); // ass_read_memory parses in place+ track=ass_read_memory(library,copy.data(),copy.size(),nullptr);+ }else{+ track=ass_new_track(library);+ if(track&&!script.header.empty())ass_process_codec_private(track,script.header.data(),int(script.header.size()));+ }+ if(!track){log::error("libass",std::format("track creation failed source={}",std::string(script.source.begin(),script.source.end())));return;}+ source=script.source;header=script.header;+ if(script.script.empty())feed(script);+ log::info("libass",std::format("track ready events={} styles={} playRes={}x{} fonts={}",+ track->n_events,track->n_styles,track->PlayResX,track->PlayResY,fontsAdded));+ }+};++AssSubtitleRenderer::AssSubtitleRenderer():p_(std::make_unique<Impl>()){}+AssSubtitleRenderer::~AssSubtitleRenderer()=default;++bool AssSubtitleRenderer::prepare(const std::shared_ptr<const engine::SubtitleAssData>& data){+ auto& p=*p_;+ if(!p.library||!p.renderer||!data)return false;+ if(data==p.data)return p.track!=nullptr;+ const bool grownEmbedded=p.track&&data->script.empty()&&data->source==p.source&&data->header==p.header&&+ data->events.size()>=p.fedEvents&&data->fonts.size()>=p.fontsAdded;+ if(grownEmbedded){p.addFonts(*data);p.feed(*data);}+ else p.rebuild(*data);+ p.data=data;+ return p.track!=nullptr;+}++int AssSubtitleRenderer::render(int64_t timeMs,int frameW,int frameH,int storageW,int storageH,double fontScale){+ auto& p=*p_;+ p.images=nullptr;+ if(!p.track||frameW<1||frameH<1)return -1;+ frameW=std::min(frameW,16384);frameH=std::min(frameH,16384);+ bool resized=false;+ if(frameW!=p.frameW||frameH!=p.frameH){ass_set_frame_size(p.renderer,frameW,frameH);p.frameW=frameW;p.frameH=frameH;resized=true;}+ storageW=std::max(storageW,1);storageH=std::max(storageH,1);+ if(storageW!=p.storageW||storageH!=p.storageH){ass_set_storage_size(p.renderer,storageW,storageH);p.storageW=storageW;p.storageH=storageH;resized=true;}+ if(fontScale!=p.fontScale){ass_set_font_scale(p.renderer,fontScale);p.fontScale=fontScale;resized=true;}+ int change=0;+ p.images=ass_render_frame(p.renderer,p.track,timeMs,&change);+ return resized?2:change;+}++bool AssSubtitleRenderer::hasImages()const{return p_->images!=nullptr;}++void AssSubtitleRenderer::composite(uint32_t* canvas,int canvasW,int canvasH,int offsetX,int offsetY)const{+ if(!canvas)return;+ for(const ASS_Image* image=p_->images;image;image=image->next){+ if(image->w<=0||image->h<=0)continue;+ const uint32_t color=image->color;+ const uint32_t r=(color>>24)&0xFF,g=(color>>16)&0xFF,b=(color>>8)&0xFF,opacity=255-(color&0xFF);+ if(!opacity)continue;+ const int x0=std::max(0,offsetX+image->dst_x),y0=std::max(0,offsetY+image->dst_y);+ const int x1=std::min(canvasW,offsetX+image->dst_x+image->w),y1=std::min(canvasH,offsetY+image->dst_y+image->h);+ for(int y=y0;y<y1;++y){+ const unsigned char* mask=image->bitmap+size_t(y-offsetY-image->dst_y)*image->stride;+ uint32_t* row=canvas+size_t(y)*canvasW;+ for(int x=x0;x<x1;++x){+ const uint32_t coverage=mask[x-offsetX-image->dst_x];+ if(!coverage)continue;+ const uint32_t k=(coverage*opacity+127)/255,inverse=255-k;+ const uint32_t d=row[x];+ const uint32_t da=d>>24,dr=(d>>16)&0xFF,dg=(d>>8)&0xFF,db=d&0xFF;+ // Premultiplied "over": source colour scaled by its coverage.+ const uint32_t oa=k+(da*inverse+127)/255;+ const uint32_t orr=(r*k+dr*inverse+127)/255,og=(g*k+dg*inverse+127)/255,ob=(b*k+db*inverse+127)/255;+ row[x]=(oa<<24)|(orr<<16)|(og<<8)|ob;+ }+ }+ }+}+} // namespace veyra::uidiff --git a/apps/veyra/ui/AssSubtitleRenderer.h b/apps/veyra/ui/AssSubtitleRenderer.hnew file mode 100644index 00000000..fccb4739--- /dev/null+++ b/apps/veyra/ui/AssSubtitleRenderer.h@@ -0,0 +1,37 @@+#pragma once++// Full ASS/SSA rendering through libass (ISC): animation (\move, \fad, \t),+// karaoke, \clip, \blur, vector drawings, per-span styles and the fonts a+// Matroska file carries. One renderer holds one libass track; the overlay+// keeps one per subtitle slot (primary / secondary).+#include <cstdint>+#include <memory>++#include "veyra/engine/Subtitles.h"++namespace veyra::ui {+class AssSubtitleRenderer {+public:+ AssSubtitleRenderer();+ ~AssSubtitleRenderer();+ AssSubtitleRenderer(const AssSubtitleRenderer&) = delete;+ AssSubtitleRenderer& operator=(const AssSubtitleRenderer&) = delete;++ // Adopts a (possibly grown) script snapshot. Events appended to the same+ // embedded source are fed incrementally; a different source rebuilds.+ bool prepare(const std::shared_ptr<const engine::SubtitleAssData>& data);+ // Renders the frame at `timeMs` for a video area of frameW x frameH device+ // pixels. storage = the video's own pixel size (aspect correction).+ // Returns libass' change code: 0 unchanged, 1 moved, 2 new content; -1 when+ // nothing can be rendered.+ int render(int64_t timeMs, int frameW, int frameH, int storageW, int storageH, double fontScale);+ // Blends the images of the last render() into a premultiplied BGRA canvas,+ // with the video area's top-left corner at (offsetX, offsetY).+ void composite(uint32_t* canvas, int canvasW, int canvasH, int offsetX, int offsetY) const;+ bool hasImages() const;++private:+ struct Impl;+ std::unique_ptr<Impl> p_;+};+} // namespace veyra::uidiff --git a/apps/veyra/ui/SubtitleOverlay.cpp b/apps/veyra/ui/SubtitleOverlay.cppindex e25f3104..b49919fa 100644--- a/apps/veyra/ui/SubtitleOverlay.cpp+++ b/apps/veyra/ui/SubtitleOverlay.cpp@@ -3,6 +3,11 @@#include "Theme.h"#include "veyra/Log.h"+#ifdef VEYRA_HAS_LIBASS+#include "AssSubtitleRenderer.h"+#include <array>+#endif+#include <algorithm>#include <cmath>#include <format>@@ -34,7 +39,7 @@ std::wstring signatureOf(const std::vector<SubtitleLine>& lines,const SubtitleVifor(const auto& line:lines){signature+=std::format(L"{}:{}|{:08X}|{:08X}|{}:{}|{}|{}|{}|{}|",line.text.size(),line.text,line.style.primary,line.style.outline,line.style.font.size(),line.style.font,line.style.size,line.style.alignment,line.alignOverride,line.secondary?1:0);- signature+=std::format(L"{}:{}:{}|",reinterpret_cast<uintptr_t>(line.bitmap.get()),line.posX,line.posY);+ signature+=std::format(L"{}:{}:{}:{}|",reinterpret_cast<uintptr_t>(line.bitmap.get()),reinterpret_cast<uintptr_t>(line.ass.get()),line.posX,line.posY);const auto& s=line.style;signature+=std::format(L"{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|",s.back,s.outlineWidth,s.shadow,s.marginL,s.marginR,s.marginV,s.bold,s.italic,s.background,s.font.size());}@@ -65,9 +70,31 @@ void updateSubtitleOverlay(HWND h,const std::vector<SubtitleLine>& lines,const Sstatic thread_local std::vector<std::shared_ptr<const engine::SubtitleBitmapFrame>> lastBitmaps;if(h!=lastWindow){lastSignature.clear();lastBitmaps.clear();lastWindow=h;}if(lines.empty()||rect.right<1||rect.bottom<1){lastSignature.clear();lastBitmaps.clear();ShowWindow(h,SW_HIDE);SetWindowTextW(h,L"");return;}- const auto signature=signatureOf(lines,view,rect)+std::format(L"/dpi{}",GetDpiForWindow(h));- if(lastSignature==signature){ShowWindow(h,SW_SHOWNOACTIVATE);return;}const int width=rect.right,height=rect.bottom;+ auto signature=signatureOf(lines,view,rect)+std::format(L"/dpi{}",GetDpiForWindow(h));+#ifdef VEYRA_HAS_LIBASS+ // libass decides whether its frame changed (animation, karaoke, new+ // events); the rest of the signature covers geometry and other lines.+ static thread_local std::array<std::unique_ptr<AssSubtitleRenderer>,2> assRenderers;+ static thread_local uint64_t assGeneration=0;+ struct AssPlacement {AssSubtitleRenderer* renderer=nullptr;int x=0,y=0;};+ std::vector<AssPlacement> assPlaced;+ for(const auto& line:lines){+ if(!line.ass)continue;+ auto& renderer=assRenderers[line.secondary?1:0];+ if(!renderer)renderer=std::make_unique<AssSubtitleRenderer>();+ if(!renderer->prepare(line.ass))continue;+ const double vw=view.videoWidth>0?view.videoWidth:width,vh=view.videoHeight>0?view.videoHeight:height;+ const double fit=std::min(width/vw,height/vh)*view.preview.zoom;+ const int frameW=int(std::lround(vw*fit)),frameH=int(std::lround(vh*fit));+ const int ox=int(std::lround(width*.5-view.preview.centerX*vw*fit)),oy=int(std::lround(height*.5-view.preview.centerY*vh*fit));+ const int change=renderer->render(int64_t(std::llround(line.assTimeMs)),frameW,frameH,int(vw),int(vh),view.scale);+ if(change>0)++assGeneration;+ signature+=std::format(L"/ass{}:{}:{}x{}@{},{}#{}",line.secondary?1:0,change>=0,frameW,frameH,ox,oy,assGeneration);+ if(change>=0)assPlaced.push_back({renderer.get(),ox,oy});+ }+#endif+ if(lastSignature==signature){ShowWindow(h,SW_SHOWNOACTIVATE);return;}// The DIB is reused while the overlay size is unchanged; zoom/drag only// re-renders into it (a 4K DIB is ~33 MB, re-allocating it per tick stalled// middle-button drags).@@ -96,6 +123,7 @@ void updateSubtitleOverlay(HWND h,const std::vector<SubtitleLine>& lines,const Sstd::vector<Line> laid;laid.reserve(lines.size());for(const auto& line:lines){+ if(line.ass)continue; // drawn by libass below (or skipped in builds without it)if(line.bitmap){const auto& frame=*line.bitmap;const double vw=view.videoWidth>0?view.videoWidth:frame.width,vh=view.videoHeight>0?view.videoHeight:frame.height;@@ -221,11 +249,16 @@ void updateSubtitleOverlay(HWND h,const std::vector<SubtitleLine>& lines,const SSolidBrush fill(primary);graphics.FillPath(&fill,entry.path.get());}+ graphics.Flush(FlushIntentionSync);lastSignature=signature;// Retain the identities used by the cache until its signature changes.lastBitmaps.clear();for(const auto& line:lines)if(line.bitmap)lastBitmaps.push_back(line.bitmap);}+#ifdef VEYRA_HAS_LIBASS+ // After GDI+ released the DIB: other subtitle lines are composed already.+ for(const auto& placed:assPlaced)placed.renderer->composite(static_cast<uint32_t*>(bits),width,height,placed.x,placed.y);+#endifSIZE dimensions{width,height};POINT origin{};BLENDFUNCTION blend{AC_SRC_OVER,0,255,AC_SRC_ALPHA};if(UpdateLayeredWindow(h,screen,nullptr,&dimensions,memory,&origin,0,&blend,ULW_ALPHA)){SetWindowTextW(h,L"subtitle");diff --git a/apps/veyra/ui/SubtitleOverlay.h b/apps/veyra/ui/SubtitleOverlay.hindex eda6e2d7..01f7cd3b 100644--- a/apps/veyra/ui/SubtitleOverlay.h+++ b/apps/veyra/ui/SubtitleOverlay.h@@ -20,6 +20,10 @@ struct SubtitleLine {double posX=-1,posY=-1; // {\pos(x,y)} normalised to 0..1 (or -1)bool secondary=false;std::shared_ptr<const engine::SubtitleBitmapFrame> bitmap;+ // ASS/SSA track drawn by libass (builds that link it): the whole script is+ // rendered at assTimeMs inside the video area; `text` is only diagnostics.+ std::shared_ptr<const engine::SubtitleAssData> ass;+ double assTimeMs=0;};struct SubtitleView {double scale=1.0; // viewer size multiplierdiff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.mdindex 9ff7acbf..083aebe0 100644--- a/docs/CURRENT_STATUS.md+++ b/docs/CURRENT_STATUS.md@@ -1,5 +1,13 @@# 当前项目状态 / Current Status+## 2026-10-05 Claude 现场修复已接管;第二版本地包复核通过++当前接管工作树 `E:/项目/Veyra/worktrees/field-fixes-20261005`,分支 `claude/field-fixes-20261005`,基于 NR 性能分支 `2dbf26c`,修复仍未提交。包含预热默认关闭/设置分类、采集跳帧节奏反馈修复、电源节流处理、AMD NR 非 NVIDIA 规范化修复、libass ASS 字幕,以及播放中重建后 GPU 耗时“未测量”的修复。AMD 实卡推理和受影响用户后台卡顿效果未验,不称已彻底解决。++第二版包已完成:`E:/项目/Veyra/test-packages/field-fixes-20261005/Veyra-2.0.3-field-20261005b-NVIDIA-win64-portable.zip`。Codex 核对全部 1578 载荷、1605 对应源码、123 运行组件,并重新运行五个相关测试和真实播放七阶段效果切换通过;开启的 NR/SR/FG 及多层计时均 measured、有样本,正常退出。仅包修订号为 `...05b`,编译显示标签仍为 `...05`。详细身份、命令、日志与剩余项见 [现场修复与接管记录](FIELD_FIXES_2026-10-05.md)。既有构建与包保持,本轮没有新编译或源码改动,没有合并/推送/发布。++Claude 原性能验收为“有条件通过”;下一项是暂停后才接入 OBS 游戏采集的本机验证。周期卡顿复测消失仅说明该组未复现,具体外部负载根因未确认。以下 NR 性能候选记录属于接管前版本,不能当作这批现场修复的全量验收。+## 2026-10-05 NR优化节点全部完成处置;本地候选交付审核完成`codex/perf-nr-20261004`从8cdc612独立施工,本机全部优化节点已有实际实验、存档和保留/拒绝决定,详`PERF_EXECUTION_NR_2026-10-04.md`。保留核心复用、单NR实例缓存、首页空闲预热、暂停NR残差/呈现空闲、普通默认的进程优先级、限定组合COMPUTE及无FG NVENC两帧/事件;自动首层尺寸与既有先粗后细提示只作可选,未获主观画质确认。重复帧整链跳过/盲预测/依赖其预算、后台Create、SR缓存扩大、低尺寸多层整链、黑边检测填黑及NVOF预取均拒绝或明确回退,不放无效开关。diff --git a/docs/FIELD_FIXES_2026-10-05.md b/docs/FIELD_FIXES_2026-10-05.mdnew file mode 100644index 00000000..a2a228ff--- /dev/null+++ b/docs/FIELD_FIXES_2026-10-05.md@@ -0,0 +1,82 @@+# 2026-10-05 现场问题修复(Claude)++用户要求:预热默认关闭、设置页重新分类;排查软件不在前台时画面卡顿(`logs(4).7z`,用户本机不能复现);AMD NR 开启无效(`veyra-qml(26).log`);特效字幕支持(用户选择引入 libass)。++- 工作树 `E:/项目/Veyra/worktrees/field-fixes-20261005`,分支 `claude/field-fixes-20261005`,基于 Codex 性能分支 `2dbf26c`(未合并、未推送)。+- 构建 `E:/项目/Veyra/build/field-fixes-20261005/B`(`tmp/field-fixes-20261005/build.py`,沿用 2.0.3 依赖缓存),日志 `logs/field-fixes-20261005/`,测试 `tests/field-fixes-20261005/`。++## 1. 预热默认关闭 + 设置页分类++- `prewarmEnhancement` 默认 false(bridge 三处、`EngineController::prewarmEnabled_` 初值),开关提示写明约 0.8–1.8 GB 显存常驻;RTX 30/40(Ada/Ampere 补丁会话)上 `enhancementPrewarmAvailable` 为 false,开关置灰,不再显示可用却不生效。+- 设置页从 6 类改为 10 类:外观、启动与窗口、播放、音频、性能、兼容、PS5 串流、快捷键、组件与许可、关于。原“通用与外观”和“播放”里的行原样搬迁,objectName 不变;`scripts/ui-check/slider-typed.qml` 音量改到“音频”分类。三语新增 12 条,`extract.py --check` missing=0。++## 2. 后台卡顿(采集 + 补帧)++用户日志(RTX 5080 + AMD 核显,2560×1440@60 RGB24 采集,NR+SR+DLSS 3X)05:37:43 起:一次 50–100 ms 断档后,每约 100 ms 就出现 `scene history boundary cadenceBreak=true` + `reset-lifecycle`,`gpuCompletedFps` 60→22,持续到窗口重新获得前台。两个自我放大的环节:++1. 场景检测把“引擎自己跳帧/采集信箱丢帧”造成的 PTS 断档当成源节奏中断(3× 上一间隔 + 5 ms),每次都重置 NR/FG 历史;而引擎的有界跳帧策略本意是 ≤250 ms 保留历史。改为按源帧序号步长换算每帧间隔(`SceneCadenceAnalyzer::analyze(..., sourceStep)`,`EnhanceGraph` 传入 `sourceFrameId` 差),真实源断档仍会触发;顺带修正“重复帧后下一帧被误判为中断”。+2. 采集补帧的呈现相位间隔沿用 A/B 实际 PTS 跨度(≤100 ms 都接受),跨越丢帧时 100 ms 的跨度被当成节奏,下一对帧被拉长展示,信箱又丢帧,稳定在约 10 对/秒。现在跳帧/丢帧时用标称源间隔(`capturePairInterval100ns(..., historyReset||gapCandidate)`)。+3. 触发源推测为 Windows 对非前台进程的电源节流(EcoQoS 执行速度、计时器精度)。播放期间通过 `SetProcessInformation(ProcessPowerThrottling)` 退出这两项节流,停止播放即交还系统策略(`PlaybackPowerGuard`),日志 `[playback-power] process power throttling ...`。++验证:`veyra_scene_tests` 18/18(新增跳帧不算中断、真实 400 ms 断档仍中断、重复帧后不误判)、`veyra_live_timing_tests` 通过。本机无法复现用户现象,真实采集卡 + 用户系统版本上的效果**未验证**,需要用户实测;若仍卡,可在设置→性能试“GPU 优先级:高”。++## 3. AMD NR 开启无效++日志:`normalized requested NVIDIA effects ... nr=false`、`ui-nr-rollback`。`disableUnsupportedNvidiaEffects` 和 `describeStages`(`enableNr` 要求 NVIDIA 适配器)在非 NVIDIA 显卡上把 NR 关掉,所查用户会话中的 AMD NR 因此未生效;此前在 5070 上的宿主合同测试不能证明 AMD 实卡执行。修复:AMD 适配器保留 NR(图层已有 lmxxf 路径,不走 NGX),NR 光流若为 NVOF 改用 AMD FidelityFX;状态提示不再声称 NR 被关;导出在 lmxxf 预算内(≤1920×1080 像素、高 ≤1080)同样启用,超出时明确提示。合同测试新增 2 项。RX 9000 实卡推理/画质**未验证**(本机仅 RTX 5070)。++## 4. 特效字幕(libass)++1.4.4 实际只有“样式类”ASS(其文档写明 `\move`/`\t`/`\clip`/卡拉OK 未实现)。现引入 libass 0.17.5(vcpkg 静态 `x64-windows-static`,DirectWrite/GDI 字体提供者):++- `SubtitleTrack::ass` 保存外挂 .ass/.ssa 全文,或内嵌轨的编解码器头 + 原始事件块;读取 Matroska 字体附件(≤64 MB/个,合计 ≤256 MB)。+- `apps/veyra/ui/AssSubtitleRenderer` 按视频显示区域(含缩放/平移)渲染并合成到原有分层字幕窗口;只在 libass 报告变化或几何变化时刷新。SRT/VTT 等仍走原样式渲染(字号/描边/背景偏好不变)。+- 实测(`logs/field-fixes-20261005/sub-ext-v1`、`sub-mkv-v1`、`sub-srt-v1`):外挂与 MKV 内嵌 ASS 的卡拉OK、`\move`、`\t` 变色缩放、`\clip`、矢量绘图、淡入淡出均正确;SRT 逗号/两行回归正常。++构建注意:vcpkg/MSVC/meson 在含中文的路径下失败(D8050、跨盘 relpath、ninja 链接路径编码),libass 构建树与安装目录放在纯 ASCII 的 `E:/veyra-ascii-20261005/`(`installed/x64-windows-static` 供链接),另有一份 `x64-windows-static-md` 失败尝试的产物留在 `E:/项目/Veyra/deps/libass-20261005/`;vcpkg 默认二进制缓存写入了 `%LOCALAPPDATA%/vcpkg/archives`。打包需随附 `share/*/copyright` 许可文本(见 THIRD_PARTY_NOTICES)。++## 回归++最终包副本 + 新 EXE 实际运行:设置页 6 个新分类截图、预热默认关、字幕三组截图,均无 ERROR。早期 S4 普通播放 B/C 交错各 2 轮:两版都出现每 7–8 秒一次 0.5–2 s 的 CPU 侧卡顿(同时段验收版 B 也有,此前同配置为 0),当时推测为机器外部负载;两版均无节奏中断重置。后续复测见第 5 节,不能用卡顿消失证明具体根因。++## 5. 播放中改效果后 GPU 耗时全部显示“未测量”(用户实测发现)++用户用第一版测试包(4K 片源,播放中多次开关 NR、加层、开 2X 补帧)发现界面耗时全是“未测量”,日志 `enhancementProcessingMs=-1`,但 `player-timing` 里各阶段 GPU 时间正常。原因是性能分支(2a/2c/2d)把处理图改成每次重建都新建对象,而“记录 GPU 计时”只在开播时对最初的对象打开一次;之后任何重建、缓存复用或预热接管得到的新图都不再记录。优化前图对象全程复用,所以没有这个问题;Claude 验收时的测试都是先设效果再开播,也没覆盖到。修复:每次收集计时前对当前图重新打开记录(`EngineController.cpp` collectTimings)。验证 `logs/field-fixes-20261005/timing-toggle-v1`:播放 3 秒后开 NR,重建后增强耗时约 8.5 ms 持续有值。++用户这轮的“停顿”记录:0.2–2.4 s 的都对应效果切换时的重建(首次 NR 约 2.4 s、开补帧约 1.8 s、再次开关/加层 0.2–0.8 s);330 条约 50 ms 的记录都在暂停期间,是暂停循环 50 ms 轮询被停顿记录器记下,不是卡顿。播放期间跳帧 0、补帧过期 3。++此前 S4 对比里“每 7–8 秒卡 0.5–2 s”的现象复测已消失:B/C 交错各两轮,>200 ms 停顿 0、跳帧 0、出帧间隔 P99 约 17.2 ms。本组未观察到明显版本差异;没有查明具体外部进程或因果链,不能据此确认当时是外部负载。++## 6. Codex 接管复核(2026-10-05)++用户明确要求读取 Claude 最新聊天并接手。已读取 `C:/Users/123/.claude/projects/E-----Veyra/b667394c-e878-4628-ae05-663760b1a66b.jsonl` 中今天的真实用户指令、验收、现场修复和最后打包调用;Claude 的最后消息是额度耗尽,但打包进程已经完成,不需要重打同一包。++继续使用本工作树 `claude/field-fixes-20261005`,HEAD `2dbf26cfe5d5dfe4491d68415064a8a0588b459b`;继承全部未提交修复。Codex 本轮没有改产品源码、重新构建、提交、合并、推送或发布,没有修改桌面旧工作树和用户配置。Claude 原验收报告的总判定仍为“有条件通过”,后来发现的 GPU 耗时 P1 已在本分支修复,不能把原报告理解成零剩余问题。++### 已完成的第二版 NVIDIA 本地包++- 包:`E:/项目/Veyra/test-packages/field-fixes-20261005/Veyra-2.0.3-field-20261005b-NVIDIA-win64-portable.zip`,714196456 bytes,SHA256 `85c8da0203abe79d07715a3afe08f1f377f278f5743aceaf16148235c84b75c6`。+- 对应源码:同目录 `Veyra-2.0.3-field-20261005b-veyra-source.zip`,SHA256 `93c773d6216caa908921869e5d43f30dd2ed35ca000797f3fec64f463198262d`;1605 个源码文件与接管时工作树原字节一致。本节及后续交接文档不在该历史源码 ZIP 中,生产源码没有变化。+- 主程序 SHA256 `09b439d8faf4df121a0749b6eaaccf71de0b8c344d144feb1ea743cc7d973a14`,包、既有解压副本与 `build/field-fixes-20261005/B` 一致;Claude `build-6.log` 记录实际构建完成。本轮没有冒称新构建。+- 独立审核 ZIP CRC/全部 1578 个载荷 SHA、源码 ZIP 和 123 个运行组件原字节通过;继承的两次基础/内嵌 ASS 启动记录在 `DELIVERY-2.0.3-field-20261005b.json`。`b` 是包修订号,程序编译时显示标签仍为 `2.0.3-field-20261005`,manifest 显示标签记录为 `...05b`,这项身份差异明确保留,不能用界面标签判断是否拿到最新 EXE。++### 本轮实际验证++Run:`takeover-20261005T061823Z-1ad4ac`。以下路径均在 `E:/项目/Veyra/`:++- 日志:`logs/claude-handoff-20261005/takeover-20261005T061823Z-1ad4ac/`;+- 独立测试副本及配置:`tests/claude-handoff-20261005/takeover-20261005T061823Z-1ad4ac/`;+- 夹具及子进程 TEMP/TMP:`tmp/claude-handoff-20261005/takeover-20261005T061823Z-1ad4ac/`;+- 开始状态、逐文件 hash 和接管前原文:`archives/claude-handoff-20261005/takeover-20261005T061823Z-1ad4ac/`。++命令为 `py -3.11 -B <本轮tmp>/handoff-check.py <run> audit|units|timing`,分别保存 `package-audit.json`、`unit-results.json`、`timing-results.json` 与原始日志。五个相关测试程序全部 exit 0:scene 18/18,live timing、effect chain、repair contract 246/246、UI i18n。`git diff --check` 通过。++使用第二版包的独立副本,仅在副本注入测试 QML,真实播放约 45 秒,串行执行七阶段:效果全关 → 播放中开 NR → 关 NR → 再开 NR(日志确认 feature-cache 命中)→ DLSS SR → DLSS 2X → 第二层 NR。所有已开启阶段的 UI GPU 计时均 measured、有真实样本;增强合计约 7.22 / 7.07 / 8.18 / 10.43 / 16.85 ms。关闭效果时零增强耗时正确,不要求禁用阶段有数值。exit 0,无 ERROR/FATAL/QML 错误;这组证明计时显示恢复,不是匹配 A/B 性能收益测量,不外推为物理延迟或全部组合通过。测试进程已退出,未跑压力或竞争负载。++### 剩余事项与下一步++1. **下一项本机工作:** 独立 OBS 兼容模式下,先暂停再开始游戏采集,核验实际录像。Claude 的 P2-1 仍只有静态推断,不能先记修复或通过;若真实复现,再最小修复并做暂停/恢复回归。+2. RX9000 用户实际 NR 推理/画质及超预算导出回退、受影响用户后台采集卡卡顿,需要实机日志,当前 NVIDIA 包无法证明;不恢复被拒绝的压力测试。+3. 其他 RTX 上 NGX 核心/最近图缓存生命周期未验;Auto 档与先粗后细的主观画质未获批准。公开发布前须处理,不能把 5070 证据外推。+4. libass 既有 ASCII 构建路径和 vcpkg 缓存越出约定产物根,仍为 Claude 历史残留;后续重建先处理路径与依赖来源,不能继续默认向外写,也不为整理而移动/删除原件。++当前交付是本地测试包。合并 main、push、Release、删除旧 UI 和新的功能优化不由本轮接管自动授权。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 30fc8def..7992a37f 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -8398,3 +8398,17 @@ R0-obs-compat-final-v3六实际视频场景/resize退出通过,MKV在OBS停止全部本机优化节点已存档处置:有效实现保留、负优化与无效OBS候选明确撤回;外部C/真实主机实卡/其他GPU/物理显示/主观画质缺口、约110ms/旧2.8s长尾及GPU UI OBS限制均在R0及DELIVERY列明。最终按guard、全分支diff-check、源码二进制隔离和主线/桌面/修复工作区保持检查收尾,再commit与R0-delivery accepted增量bundle/patch/receipt。没有新增压力/竞争程序,没有merge/push/Release/关机。本轮为本地候选交付,不能说原草案全部性能目标或所有硬件验收已达成。`R0-final-scope-v2/summary.json`最终检查通过:guard177路径、全分支diff-check、源代码自最终构建无变化、114既有节点checkpoint、GPU测试已退出;main354b1c6、桌面原状态、field-upgrade干净8cdc612保持。首版手工check把历史公开推广视频REAMDE MP4.mp4及assets/veyra-2.0.0-promo.mp4也视为违规,范围误用;两者Git blob与开工点完全相同,不删除用户既有资源。校正为严格禁止全部tracked proprietary运行库/SDK/模型,以及本轮任何新增或改动测试媒体,均无违规;该记录不隐藏原断言失败,不放开运行组件规则。++## 2026-10-05 Claude 现场修复(claude/field-fixes-20261005,基于 2dbf26c,未提交)++预热默认关闭并按显卡置灰;设置页拆为 10 类;后台卡顿的“跳帧→节奏中断重置→补帧相位拉长→再丢帧”自我放大链路修复,并在播放期间退出 Windows 电源节流;AMD NR 被非 NVIDIA 规范化/图描述关掉的问题修复(预览与 1080p 内导出);引入 libass 0.17.5 静态库支持 ASS 特效字幕与 MKV 内嵌字体。详见 `docs/FIELD_FIXES_2026-10-05.md`。构建 `build/field-fixes-20261005/B`,日志与截图 `logs/field-fixes-20261005/`。单元/合同测试与本机实际运行截图通过;用户系统的后台卡顿、RX 9000 实卡 AMD NR 未验证。++## 2026-10-05 Codex 接管 Claude 最新验收及现场修复++读取 Claude 最新原始会话 `C:/Users/123/.claude/projects/E-----Veyra/b667394c-e878-4628-ae05-663760b1a66b.jsonl`、独立 ACCEPTANCE_REPORT 与现场记录,确认最后的计时修复、build-6 和第二版打包均已完成,仅交接消息因额度中断未发。继续 E:/项目/Veyra/worktrees/field-fixes-20261005 / claude/field-fixes-20261005,HEAD 2dbf26c;保全全部未提交源码,本轮只更新 FIELD_FIXES/CURRENT_STATUS/WORKLOG。原性能验收仍为有条件通过,未验 AMD/用户后台卡顿/暂停后新接 OBS/其他 RTX 不能写通过。++Run takeover-20261005T061823Z-1ad4ac;logs/tests/tmp/archives 全在 E:/项目/Veyra 对应 claude-handoff-20261005 子目录。开始状态和1605文件 SHA 保存在 archives/.../takeover-before.json,原现场文档另存 inherited-field-fixes.md。`py -3.11 -B E:/项目/Veyra/tmp/claude-handoff-20261005/takeover-20261005T061823Z-1ad4ac/handoff-check.py takeover-20261005T061823Z-1ad4ac audit` 通过 ZIP CRC/1578载荷 SHA/1605源码原字节/123不变运行组件;第二版ZIP SHA85c8da0203abe79d07715a3afe08f1f377f278f5743aceaf16148235c84b75c6,EXE09b439d8faf4df121a0749b6eaaccf71de0b8c344d144feb1ea743cc7d973a14与原build-6一致。包修订号05b,编译显示标签仍05,明确记录而不重打历史包。++同夹具 `units` 五测试全exit0(scene18/18、repair246/246、live timing/effect chain/i18n通过);`timing` 独立包副本约45秒真实播放七阶段通过:关效果→开NR→关NR→缓存恢复NR→DLSS SR→DLSS2X→第二NR层。feature-cache真实命中,当前GPU阶段与节点均measured且samples>0,合计约7.22/7.07/8.18/10.43/16.85ms;退出0,无产品/QML错误。不是A/B收益或物理延迟测量,不外推未测组合。测试QML仅在本轮副本,所有测试进程已退出。++更正文档中“卡顿消失确认外部负载”过强归因为未确认根因,保留原日志;AMD所查会话无效不泛化成所有历史会话从未执行。本轮未新构建、未改产品/运行库、未commit/merge/push/Release/关机、无压力/竞争程序。下一项本机工作为隔离OBS兼容模式先暂停后新挂钩实录;用户采集卡后台和RX9000实卡仍待真实反馈。详FIELD_FIXES第6节和本轮JSON。diff --git a/i18n/catalog.json b/i18n/catalog.jsonindex 26449e67..b3ad2925 100644--- a/i18n/catalog.json+++ b/i18n/catalog.json@@ -462,6 +462,13 @@"en": "AMD FSR frame generation is limited to 2X; request not applied","ja": "AMD FSR のフレーム生成は最大 2X です。要求は適用されていません"},+ {+ "zh": "AMD NR 导出只支持 1080p 以内的片源,本次导出关闭 NR",+ "src": "src/engine/VideoExportJob.cpp",+ "zh-TW": "AMD NR 匯出只支援 1080p 以內的片源,本次匯出關閉 NR",+ "en": "AMD NR export supports sources up to 1080p only; NR is off for this export",+ "ja": "AMD NR の書き出しは 1080p 以下のソースのみ対応のため、今回の書き出しでは NR をオフにします"+ },{"zh": "AMD NR 最高 1080p 像素预算","src": "qml/NrLayerEditor.qml",@@ -1911,6 +1918,13 @@"en": "No reprojection and no optical flow, so moving areas do not smear. Runs after the last NR layer, before super resolution and frame generation.","ja": "再投影もオプティカルフローも使わないため、動く部分に残像が出ません。最後の NR 層の後、超解像とフレーム生成の前に実行します。"},+ {+ "zh": "与 OBS、监控软件(小飞机 / RTSS)同时使用时的设置;修改后需要重启。",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "與 OBS、監控軟體(小飛機 / RTSS)同時使用時的設定;修改後需要重新啟動。",+ "en": "Settings for running alongside OBS and monitoring tools (Afterburner / RTSS); changes need a restart.",+ "ja": "OBS や監視ソフト(Afterburner / RTSS)と同時に使うときの設定です。変更後は再起動が必要です。"+ },{"zh": "与主机的加密连接失败,主机的证书可能已改变,请重新配对。","src": "src/source/MoonlightSessionSource.cpp",@@ -3823,6 +3837,13 @@"en": "No","ja": "いいえ"},+ {+ "zh": "启动与窗口",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "啟動與視窗",+ "en": "Startup & window",+ "ja": "起動とウィンドウ"+ },{"zh": "启动后自动继续上次内容","src": "qml/SettingsPage.qml",@@ -4292,6 +4313,13 @@"en": "Audio sync","ja": "音声の同期"},+ {+ "zh": "声音同步、音量与输出设备。",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "聲音同步、音量與輸出裝置。",+ "en": "Audio sync, volume and output device.",+ "ja": "音声同期、音量、出力デバイス。"+ },{"zh": "处理 CPU P95: %1 ms","src": "src/ui/QmlPlayerBridge.cpp",@@ -4453,6 +4481,13 @@"en": "External subtitles","ja": "外部字幕"},+ {+ "zh": "外观",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "外觀",+ "en": "Appearance",+ "ja": "外観"+ },{"zh": "多声道片源混成双声道再输出(耳机);关闭时按设备声道布局映射","src": "qml/DialogHost.qml",@@ -6021,6 +6056,13 @@"en": "This GPU does not support NVIDIA enhancements; NR, super resolution and DLSS are off, the XeSS choice is kept","ja": "この GPU は NVIDIA の補正機能に非対応です。NR、超解像、DLSS をオフにしました。XeSS の選択は保持します"},+ {+ "zh": "当前 GPU 不支持 NVIDIA 增强;超分及 DLSS 已关闭,NR 使用 AMD 运行库,XeSS选择保留",+ "src": "src/engine/EngineController.cpp",+ "zh-TW": "目前 GPU 不支援 NVIDIA 增強;超解析及 DLSS 已關閉,NR 使用 AMD 執行庫,XeSS 選擇保留",+ "en": "This GPU does not support NVIDIA enhancements; upscaling and DLSS are off, NR uses the AMD runtime, and the XeSS choice is kept",+ "ja": "この GPU は NVIDIA 拡張に対応していません。超解像と DLSS はオフ、NR は AMD ランタイムを使用し、XeSS の選択は維持します"+ },{"zh": "当前 GPU 不支持所选 NVIDIA 增强","src": "src/engine/EngineController.cpp",@@ -6049,13 +6091,6 @@"en": "SDR preview at the moment; HDR conversion is not running","ja": "現在は SDR プレビューで、HDR 変換は動作していません"},- {- "zh": "当前仅支持 NVIDIA 显卡",- "src": "qml/SettingsPage.qml",- "zh-TW": "目前僅支援 NVIDIA 顯示卡",- "en": "Currently available on NVIDIA GPUs",- "ja": "現在は NVIDIA GPU のみ対応"- },{"zh": "当前修改尚未保存:","src": "src/ui/QmlPlayerBridge.cpp",@@ -6105,6 +6140,13 @@"en": "Current playback settings","ja": "現在の再生設定"},+ {+ "zh": "当前显卡不支持预热",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "目前顯示卡不支援預熱",+ "en": "Prewarming is not available on this GPU",+ "ja": "この GPU ではプリウォームを使用できません"+ },{"zh": "当前显卡不能使用 DLSS NR,本次导出自动关闭 NR","src": "src/engine/VideoExportJob.cpp",@@ -6933,11 +6975,11 @@"ja": "ファイルがもう存在しません"},{- "zh": "文件播放与字幕的默认行为。",+ "zh": "文件播放、字幕与截图的默认行为。","src": "qml/SettingsPage.qml",- "zh-TW": "檔案播放與字幕的預設行為。",- "en": "Default behavior for file playback and subtitles.",- "ja": "ファイル再生と字幕の既定の動作。"+ "zh-TW": "檔案播放、字幕與截圖的預設行為。",+ "en": "Defaults for file playback, subtitles and screenshots.",+ "ja": "ファイル再生、字幕、スクリーンショットの既定動作。"},{"zh": "断开",@@ -7310,6 +7352,13 @@"en": "The GPU was reset at frame {}; the first {:.1f} s are saved, exporting the rest","ja": "{} フレーム目で GPU がリセットされました。最初の {:.1f} 秒は保存済みで、残りを書き出します"},+ {+ "zh": "显卡调度、预热与资源监控。默认设置适合大多数机器。",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "顯示卡排程、預熱與資源監控。預設值適合大多數電腦。",+ "en": "GPU scheduling, prewarming and resource monitoring. The defaults suit most PCs.",+ "ja": "GPU スケジューリング、プリウォーム、リソース監視。既定値でほとんどの PC に適しています。"+ },{"zh": "显卡重置前后两段的编码参数不一致,无法无损拼接","src": "src/engine/VideoExportJob.cpp",@@ -9319,6 +9368,13 @@"en": "Offline","ja": "オフライン"},+ {+ "zh": "程序启动时的页面、窗口和恢复行为。",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "程式啟動時的頁面、視窗與恢復行為。",+ "en": "Page, window and resume behaviour at startup.",+ "ja": "起動時のページ、ウィンドウ、再開の動作。"+ },{"zh": "稍后","src": "qml/Main.qml",@@ -12021,13 +12077,6 @@"en": "Options","ja": "オプション"},- {- "zh": "通用与外观",- "src": "qml/SettingsPage.qml",- "zh-TW": "通用與外觀",- "en": "General and appearance",- "ja": "全般と外観"- },{"zh": "部分轨道当前封装装不下,未保留(详见队列说明)","src": "src/engine/VideoExportJob.cpp",@@ -13407,13 +13456,6 @@"en": "Home = the page for choosing a source (clicking the logo at the top also returns here)","ja": "ホーム = ソースを選ぶ画面(上部のロゴをクリックしても戻れます)"},- {- "zh": "首页空闲时准备已启用的单层 NR 或超分,首次打开更快",- "src": "qml/SettingsPage.qml",- "zh-TW": "首頁閒置時準備已啟用的單層 NR 或超解析,首次開啟更快",- "en": "Prepare enabled single-layer NR or upscaling while the home page is idle for a faster first open",- "ja": "ホーム画面の待機中に有効な単層 NR またはアップスケーリングを準備し、最初の起動を高速化"- },{"zh": "驱动默认","src": "qml/DialogHost.qml",@@ -13519,6 +13561,13 @@"en": "Off by default · only steadies parts of the picture that do not change; moving parts do not smear","ja": "既定はオフ · 変化していない部分だけを安定させ、動く部分に残像は出ません"},+ {+ "zh": "默认关闭。开启后首页空闲时预先准备已启用的单层 NR 或超分,首次打开约快 2 秒;准备好后会一直占用约 0.8–1.8 GB 显存,直到打开视频",+ "src": "qml/SettingsPage.qml",+ "zh-TW": "預設關閉。開啟後首頁閒置時預先準備已啟用的單層 NR 或超解析,首次開啟約快 2 秒;準備好後會一直佔用約 0.8–1.8 GB 顯示記憶體,直到開啟影片",+ "en": "Off by default. When on, the enabled single NR layer or upscaler is prepared while the home page is idle, so the first open is about 2 s faster; once ready it keeps about 0.8–1.8 GB of video memory until a video opens",+ "ja": "既定ではオフ。オンにするとホーム画面の待機中に有効な単層 NR または超解像を準備し、最初のオープンが約 2 秒速くなります。準備後は動画を開くまで約 0.8~1.8 GB の VRAM を使用し続けます"+ },{"zh": "默认只在本机出声","src": "qml/DialogHost.qml",@@ -13680,6 +13729,13 @@"en": "; temporary file kept: ","ja": ";一時ファイルを保持しました:"},+ {+ "zh": ";切到后台卡顿时可试“高”,“实时”可能拖慢其他程序",+ "src": "qml/SettingsPage.qml",+ "zh-TW": ";切到背景卡頓時可試「高」,「即時」可能拖慢其他程式",+ "en": "; if playback stutters in the background try \"High\"; \"Realtime\" can slow other apps",+ "ja": ";バックグラウンドでカクつく場合は「高」を試してください。「リアルタイム」は他のアプリを遅くすることがあります"+ },{"zh": ";各段文件已保留:","src": "src/engine/VideoExportJob.cpp",@@ -13694,13 +13750,6 @@"en": "; the exported parts are kept at: ","ja": "。書き出し済みの部分は次の場所にあります:"},- {- "zh": ";当前显卡不能使用 DLSS NR,本次导出自动关闭 NR",- "src": "src/engine/VideoExportJob.cpp",- "zh-TW": ";當前顯示卡不能使用 DLSS NR,本次匯出自動關閉 NR",- "en": "; this GPU cannot use DLSS NR, NR is turned off for this export",- "ja": ";この GPU では DLSS NR を使えないため、今回の書き出しでは NR をオフにします"- },{"zh": ";当前显卡不能使用所选超分,本次导出关闭超分","src": "src/engine/VideoExportJob.cpp",diff --git a/include/veyra/core/SceneCadenceAnalyzer.h b/include/veyra/core/SceneCadenceAnalyzer.hindex 6adcc866..a28ccc98 100644--- a/include/veyra/core/SceneCadenceAnalyzer.h+++ b/include/veyra/core/SceneCadenceAnalyzer.h@@ -44,13 +44,18 @@ public:// `histogram` is a 256-bin luma histogram (normalized to [0,1]).// `sad` is the normalized SAD score in [0,1].// `ptsUs` is this frame's PTS.+ // `sourceStep` is how many source frames advanced since the previous+ // analysed frame (>1 when the player skipped or the capture mailbox+ // dropped frames). The cadence check uses the per-source-frame interval,+ // so a gap the player created itself is not reported as a source break.SceneAnalysisResult analyze(uint64_t frameId,const std::vector<double>& histogram,double sad,- uint64_t ptsUs);+ uint64_t ptsUs,+ uint64_t sourceStep = 1);// Reset baseline (called on seek/source switch/etc).- void reset() { hasBaseline_ = false; prevHistogram_.clear(); }+ void reset() { hasBaseline_ = false; prevHistogram_.clear(); lastCadenceDeltaUs_ = 0; }const SceneAnalysisResult& lastResult() const { return lastResult_; }uint64_t sceneCutCount() const { return sceneCutCount_; }@@ -66,6 +71,7 @@ private:uint64_t flashCount_ = 0;uint64_t duplicateCount_ = 0;SceneAnalysisResult lastResult_;+ double lastCadenceDeltaUs_ = 0; // per-source-frame PTS interval of the previous framedouble histogramDistance(const std::vector<double>& a, const std::vector<double>& b) const;};diff --git a/include/veyra/engine/BackendRecovery.h b/include/veyra/engine/BackendRecovery.hindex 4b8267c1..1fca4965 100644--- a/include/veyra/engine/BackendRecovery.h+++ b/include/veyra/engine/BackendRecovery.h@@ -12,10 +12,16 @@ constexpr const wchar_t* ngxFailureHint(uint64_t result) {default:return L"初始化失败;详细原因见诊断日志";}}-inline bool disableUnsupportedNvidiaEffects(EnhancementSettings& settings,bool nvidia){+// amdNr: the adapter is AMD, where NR runs on the lmxxf runtime (the graph+// selects it for every NR layer; an unsupported RX model fails in its own+// open/admits and is reported like any other NR backend failure).+inline bool disableUnsupportedNvidiaEffects(EnhancementSettings& settings,bool nvidia,bool amdNr=false){if(nvidia)return false;const auto before=settings;- settings.nr=false;+ if(!amdNr)settings.nr=false;+ // NVOF does not exist on these adapters; NR motion uses AMD FidelityFX flow.+ if(amdNr&&settings.nr&&settings.opticalFlowBackend==OpticalFlowBackend::Nvidia)+ settings.opticalFlowBackend=OpticalFlowBackend::AmdFidelityFx;settings.videoHdr.enabled=false;// AMD FSR upscaling is vendor neutral and must survive the NVIDIA-only// normalization; every other SR backend is NGX-only.diff --git a/include/veyra/engine/EngineController.h b/include/veyra/engine/EngineController.hindex a66953ba..df742b37 100644--- a/include/veyra/engine/EngineController.h+++ b/include/veyra/engine/EngineController.h@@ -205,7 +205,7 @@ private:std::wstring savePath_;std::thread worker_;std::unique_ptr<PreviewGpuSession> prewarmed_; // engine dispatcher only- std::atomic<bool> prewarmEnabled_{true};+ std::atomic<bool> prewarmEnabled_{false}; // off until the saved preference enables it (default off since 2026-10-05)std::condition_variable wake_;std::function<void()> pending_;bool shutdown_=false,busy_=false;EnhancementSettings desired_;uint64_t nextRevision_=1;std::optional<ChainRuntimeOrder> desiredNodeOrder_; // protected by mutex_, paired with desired_diff --git a/include/veyra/engine/GraphDescription.h b/include/veyra/engine/GraphDescription.hindex 06412aac..05ca7cd3 100644--- a/include/veyra/engine/GraphDescription.h+++ b/include/veyra/engine/GraphDescription.h@@ -36,6 +36,7 @@ struct StageRequest {bool stillImage=false; // image preview/processing: no NR-first orderbool exportJob=false; // offline export: native NR size, no present-sink FG, no NR-first orderbool nvidiaAdapter=true;+ bool amdNr=false; // AMD adapter: NR runs on the lmxxf runtime (no NGX)const ChainRuntimeOrder* nodeOrder=nullptr; // paired with this settings transaction};@@ -80,7 +81,7 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,constdesc.nrWidth=plan.nr.width;desc.nrHeight=plan.nr.height;desc.flowWidth=plan.flow.width;desc.flowHeight=plan.flow.height;desc.enableSr=plan.srApplied&&(request.nvidiaAdapter||settings.videoSrQuality==kVideoSrFsr);- desc.enableNr=request.nr&&request.nvidiaAdapter&&(!settings.nrLayerCount||settings.activeNrLayerCount()>0);+ desc.enableNr=request.nr&&(request.nvidiaAdapter||request.amdNr)&&(!settings.nrLayerCount||settings.activeNrLayerCount()>0);desc.nrBeforeSr=!request.stillImage&&!request.exportJob&&lowLatency&&desc.enableNr&&desc.enableSr;desc.enableNvofStandalone=desc.enableNr;const bool temporalMotion=settings.nrTemporal||std::any_of(settings.nrLayers.begin(),settings.nrLayers.begin()+settings.nrLayerCount,[](const auto& n){return n.enabled&&n.temporal;});diff --git a/include/veyra/engine/Subtitles.h b/include/veyra/engine/Subtitles.hindex 61ce54fa..d2a65b47 100644--- a/include/veyra/engine/Subtitles.h+++ b/include/veyra/engine/Subtitles.h@@ -47,8 +47,23 @@ struct SubtitleCue {std::shared_ptr<const SubtitleBitmapFrame> bitmap;};+// Original ASS/SSA script for full-fidelity rendering (libass): animation,+// karaoke, \move/ /\clip/lur, drawings and container fonts. The parsed+// cues below stay as the plain-text fallback and for diagnostics.+struct SubtitleAssData {+ std::string script; // complete external .ass/.ssa (UTF-8)+ std::string header; // embedded track: codec private ASS header (UTF-8)+ struct Event { int64_t startMs=0,durationMs=0; std::string chunk; }; // "ReadOrder,Layer,Style,...,Text"+ std::vector<Event> events; // embedded track: decoded in file order+ struct Font { std::string name; std::vector<char> data; };+ std::vector<Font> fonts; // container attachments (Matroska fonts)+ std::wstring source; // identity of the script source (path + stream)+};+struct SubtitleTrack {std::wstring name,language,codec,note;+ // Set for ASS/SSA tracks; snapshots are immutable once published.+ std::shared_ptr<const SubtitleAssData> ass;bool embedded=false;int streamIndex=-1;std::vector<SubtitleStyle> styles;diff --git a/include/veyra/pipeline/EnhanceGraph.h b/include/veyra/pipeline/EnhanceGraph.hindex ded91eb4..9cda9fc2 100644--- a/include/veyra/pipeline/EnhanceGraph.h+++ b/include/veyra/pipeline/EnhanceGraph.h@@ -798,6 +798,7 @@ private:// Per-run state.uint64_t realFrameIndex_ = 0;+ uint64_t sceneLastSourceId_ = 0; // source id of the last scene-analysed frame// Only a successful explicit paused/still-frame reset may seed this.// Ordinary playback, source changes, failures and non-residual edits// invalidate it. No cross-frame/duplicate-source reuse is performed.diff --git a/include/veyra/ui/PlaybackPowerGuard.h b/include/veyra/ui/PlaybackPowerGuard.hindex 5b605a9c..e50bc4cf 100644--- a/include/veyra/ui/PlaybackPowerGuard.h+++ b/include/veyra/ui/PlaybackPowerGuard.h@@ -18,6 +18,28 @@ public:}active_=playing;log::info("playback-power",playing?"playback display/system request acquired":"playback display/system request released");+ throttle(playing);+ }+private:+ // While media plays, opt the process out of Windows power throttling+ // (EcoQoS execution speed and timer-resolution throttling). Windows 11+ // applies both to processes it considers background once their window is+ // not in the foreground or is occluded; on affected builds the 1 ms waits+ // of the presentation/capture loops then stretch and live capture with+ // frame generation falls behind after switching to another window (field+ // log 2026-10-04: 60 -> ~22 fps until refocus). Released with playback so+ // an idle player is still throttled normally. Documented opt-out:+ // SetProcessInformation(ProcessPowerThrottling).+ static void throttle(bool playing){+#ifndef PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION+ constexpr ULONG PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION=0x4;+#endif+ PROCESS_POWER_THROTTLING_STATE state{};+ state.Version=PROCESS_POWER_THROTTLING_CURRENT_VERSION;+ state.ControlMask=playing?(PROCESS_POWER_THROTTLING_EXECUTION_SPEED|PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION):0;+ state.StateMask=0; // controlled bits off = never throttle; ControlMask 0 = system default+ const bool ok=SetProcessInformation(GetCurrentProcess(),ProcessPowerThrottling,&state,sizeof(state))!=FALSE;+ log::info("playback-power",std::format("process power throttling {} ok={} win32={}",playing?"disabled for playback":"returned to system policy",ok,ok?0ul:GetLastError()));}};}diff --git a/qml/Veyra/SettingsPage.qml b/qml/Veyra/SettingsPage.qmlindex 106f68db..4b14170e 100644--- a/qml/Veyra/SettingsPage.qml+++ b/qml/Veyra/SettingsPage.qml@@ -1,7 +1,8 @@// 设置, rebuilt from the design (pages-b.js PAGES.set + pages.css .set).//-// Design: a 220px nav column with six sections (通用与外观 / 播放 / PS5 串流 /-// 快捷键 / 组件与许可 / 关于) and a large body. The design deliberately has NO+// Design: a 220px nav column (外观 / 启动与窗口 / 播放 / 音频 / 性能 / 兼容 /+// PS5 串流 / 快捷键 / 组件与许可 / 关于; split 2026-10-05 because one page held+// almost every setting) and a large body. The design deliberately has NO// capture-card section here: capture settings live in the capture dialog.//// Rows that would need engine support this build does not have say so, rather than@@ -24,7 +25,7 @@ VPage {// render(true): 480 ms, i*40 ms, y 12).Qt.callLater(() => stagger(sectionColumns[section] || null))}- readonly property var sectionColumns: ({ look: secLook, play: secPlay, ps5: secPs5, keys: secKeys, comp: secComp, about: secAbout })+ readonly property var sectionColumns: ({ look: secLook, window: secWindow, play: secPlay, audio: secAudio, perf: secPerf, compat: secCompat, ps5: secPs5, keys: secKeys, comp: secComp, about: secAbout })Component { id: staggerComp; VRise.Stagger {} }function stagger(col) {if (Theme.reduced || !col) return@@ -38,8 +39,12 @@ VPage {}readonly property var sections: [- { id: "look", label: qsTr("通用与外观"), icon: "home" },- { id: "play", label: qsTr("播放", "section"), icon: "play" },+ { id: "look", label: qsTr("外观"), icon: "palette" },+ { id: "window", label: qsTr("启动与窗口"), icon: "appwin" },+ { id: "play", label: qsTr("播放", "section"), icon: "play" },+ { id: "audio", label: qsTr("音频"), icon: "vol" },+ { id: "perf", label: qsTr("性能"), icon: "gauge" },+ { id: "compat", label: qsTr("兼容"), icon: "monitor" },{ id: "ps5", label: qsTr("PS5 串流"), icon: "gamepad" },{ id: "keys", label: qsTr("快捷键"), icon: "zap" },{ id: "comp", label: qsTr("组件与许可"), icon: "box" },@@ -138,18 +143,20 @@ VPage {width: Math.min(parent.width - 52, 720)spacing: 12- // --- 通用与外观 ------------------------------------------+ // --- 外观 ---ColumnLayout {id: secLookLayout.fillWidth: truespacing: 12visible: root.section === "look"- VH1 { text: qsTr("通用与外观") }+ VH1 { text: qsTr("外观") }Text {text: qsTr("界面随时可调,不影响播放和增强设置。")color: Theme.t2font.family: Theme.fontUifont.pixelSize: Theme.fsBody+ Layout.fillWidth: true+ wrapMode: Text.WordWrap}VGroup {VRow {@@ -228,73 +235,57 @@ VPage {}}VRow {- label: qsTr("OBS 游戏采集兼容")- hint: (!!veyra.preferences.obsGameCapture !== veyra.obsGameCaptureActive)- ? qsTr("重启后生效")- : qsTr("仅采集视频;界面软件绘制,部分阴影与模糊简化")- VSwitch {- objectName: "set-obs-game-capture"- checked: !!veyra.preferences.obsGameCapture- onToggled: v => {- if (veyra.setPreference("obsGameCapture", v)- && v !== veyra.obsGameCaptureActive)- obsRestart.open()- }- }- }- VRow {- // RivaTuner (MSI Afterburner's OSD): see main.cpp. Auto draws the interface in- // software when RTSS runs at start, so its OSD only sits on the video.- readonly property bool automatic: (veyra.preferences.overlayCompat || "auto") === "auto"- label: qsTr("监控软件兼容")- hint: veyra.obsGameCaptureActive- ? qsTr("OBS 游戏采集兼容已让界面软件绘制,小飞机 OSD 只显示在视频上")- : (automatic !== veyra.overlayCompatActive && (veyra.overlayCompatActive || veyra.rivaTunerRunning()))- ? qsTr("重启后生效")- : veyra.overlayCompatActive- ? qsTr("监控兼容绘制已启用:OSD 只显示在视频上;部分阴影与模糊简化")- : automatic- ? qsTr("启动时检测到小飞机(RTSS)就改用软件绘制界面,OSD 只显示在视频上")- : qsTr("界面始终用显卡绘制;为避免冲突,小飞机 OSD 不在 Veyra 里显示")- VSeg {- objectName: "set-overlay-compat"- options: [{ id: "auto", label: qsTr("自动") }, { id: "off", label: qsTr("关闭") }]- current: veyra.preferences.overlayCompat || "auto"- onPicked: id => {- if (veyra.setPreference("overlayCompat", id) && !veyra.obsGameCaptureActive- && (id === "auto") !== veyra.overlayCompatActive- && (veyra.overlayCompatActive || veyra.rivaTunerRunning()))- obsRestart.open()- }+ label: qsTr("界面语言")+ hint: qsTr("立即生效;日志保持中文,方便反馈问题")+ VSelect {+ objectName: "set-language"+ implicitWidth: 170+ // Each language is named in itself, so it can be found from any of them.+ options: [+ { id: "auto", label: qsTr("跟随系统") },+ { id: "zh-CN", label: qsTr("简体中文") },+ { id: "zh-TW", label: qsTr("繁體中文") },+ { id: "en", label: "English" },+ { id: "ja", label: qsTr("日本語") }+ ]+ value: (options.find(o => o.id === (veyra.preferences.language || "auto")) || options[0]).label+ onPicked: id => veyra.setPreference("language", id)}}}- VH2 { text: qsTr("性能"); Layout.topMargin: 10 }+ }++ // --- 启动与窗口 ---+ ColumnLayout {+ id: secWindow+ Layout.fillWidth: true+ spacing: 12+ visible: root.section === "window"+ VH1 { text: qsTr("启动与窗口") }+ Text {+ text: qsTr("程序启动时的页面、窗口和恢复行为。")+ color: Theme.t2+ font.family: Theme.fontUi+ font.pixelSize: Theme.fsBody+ Layout.fillWidth: true+ wrapMode: Text.WordWrap+ }VGroup {VRow {- label: qsTr("GPU 优先级")- hint: veyra.gpuPriorityStatus+ label: qsTr("打开时的默认页面")+ hint: qsTr("首页 = 选择片源的页面(点顶部 Logo 也能回到这里)")VSeg {- objectName: "set-gpu-priority"- options: [{ id: "normal", label: qsTr("普通") }, { id: "high", label: qsTr("高") }, { id: "realtime", label: qsTr("实时") }]- current: veyra.preferences.gpuPriority || "normal"- onPicked: id => veyra.setPreference("gpuPriority", id)- }- }- VRow {- label: qsTr("启动时预热增强组件")- hint: veyra.enhancementPrewarmAvailable- ? qsTr("首页空闲时准备已启用的单层 NR 或超分,首次打开更快")- : qsTr("当前仅支持 NVIDIA 显卡")- VSwitch {- objectName: "set-prewarm-enhancement"- enabled: veyra.enhancementPrewarmAvailable- checked: veyra.preferences.prewarmEnhancement !== false- onToggled: v => veyra.setPreference("prewarmEnhancement", v)+ objectName: "set-default-page"+ options: [+ { id: "home", label: qsTr("首页") },+ { id: "min", label: qsTr("极简模式") },+ { id: "pro", label: qsTr("专业模式") },+ { id: "last", label: qsTr("上次") }+ ]+ current: veyra.defaultPage+ onPicked: id => veyra.defaultPage = id}}- }- VGroup {VRow {label: qsTr("启动窗口大小")hint: qsTr("下次启动生效;超过屏幕时按屏幕缩小并居中")@@ -311,19 +302,6 @@ VPage {onPicked: id => veyra.setPreference("windowSize", id)}}- VRow {- label: qsTr("GPU 占用监控")- hint: qsTr("专业页「GPU 占用」只统计这一块显卡") + (veyra.gpuMonitorName ? qsTr(";当前:") + veyra.gpuMonitorName : "")- VSelect {- objectName: "set-monitor-gpu"- implicitWidth: 230- options: veyra.gpuMonitorChoices- value: (options.find(o => o.id === (veyra.preferences.monitorGpu || "")) || options[0] || { label: "—" }).label- onPicked: id => veyra.setPreference("monitorGpu", id)- }- }- }- VGroup {VRow {label: qsTr("启动后自动继续上次内容")hint: qsTr("视频恢复上次进度;采集卡沿用上次设备与设置")@@ -334,51 +312,18 @@ VPage {}}VRow {- label: qsTr("全屏显存增长保护")- hint: qsTr("检测异常增长时自动退出全屏;默认关闭")+ label: qsTr("记住播放位置")+ hint: qsTr("重新打开同一个文件时从上次位置继续")VSwitch {- objectName: "set-fullscreen-memory-protection"- checked: !!veyra.preferences.fullscreenMemoryProtection- onToggled: v => veyra.setPreference("fullscreenMemoryProtection", v)- }- }- VRow {- label: qsTr("打开时的默认页面")- hint: qsTr("首页 = 选择片源的页面(点顶部 Logo 也能回到这里)")- VSeg {- objectName: "set-default-page"- options: [- { id: "home", label: qsTr("首页") },- { id: "min", label: qsTr("极简模式") },- { id: "pro", label: qsTr("专业模式") },- { id: "last", label: qsTr("上次") }- ]- current: veyra.defaultPage- onPicked: id => veyra.defaultPage = id- }- }- VRow {- label: qsTr("界面语言")- hint: qsTr("立即生效;日志保持中文,方便反馈问题")- VSelect {- objectName: "set-language"- implicitWidth: 170- // Each language is named in itself, so it can be found from any of them.- options: [- { id: "auto", label: qsTr("跟随系统") },- { id: "zh-CN", label: qsTr("简体中文") },- { id: "zh-TW", label: qsTr("繁體中文") },- { id: "en", label: "English" },- { id: "ja", label: qsTr("日本語") }- ]- value: (options.find(o => o.id === (veyra.preferences.language || "auto")) || options[0]).label- onPicked: id => veyra.setPreference("language", id)+ objectName: "set-resume"+ checked: veyra.preferences.rememberPosition !== false+ onToggled: checked => veyra.setPreference("rememberPosition", checked)}}}}- // --- 播放 ------------------------------------------------+ // --- 播放 ---ColumnLayout {id: secPlayLayout.fillWidth: true@@ -386,10 +331,12 @@ VPage {visible: root.section === "play"VH1 { text: qsTr("播放", "section") }Text {- text: qsTr("文件播放与字幕的默认行为。")+ text: qsTr("文件播放、字幕与截图的默认行为。")color: Theme.t2font.family: Theme.fontUifont.pixelSize: Theme.fsBody+ Layout.fillWidth: true+ wrapMode: Text.WordWrap}VGroup {VRow {@@ -409,15 +356,6 @@ VPage {hint: qsTr("HDR10 默认;补帧固定 HDR10,需要 Windows HDR 开启")VSeg { options: [{id:"0",label:"HDR10"},{id:"1",label:qsTr("scRGB 浮点")}]; current: String(veyra.hdrOutputMode); onPicked: id => veyra.hdrOutputMode = Number(id) }}- VRow {- label: qsTr("记住播放位置")- hint: qsTr("重新打开同一个文件时从上次位置继续")- VSwitch {- objectName: "set-resume"- checked: veyra.preferences.rememberPosition !== false- onToggled: checked => veyra.setPreference("rememberPosition", checked)- }- }VRow {label: qsTr("字幕默认字号")hint: qsTr("双行不自动缩小;更多样式在字幕设置里")@@ -439,7 +377,6 @@ VPage {}}}- // 补帧说明 (moved here from the 补帧 page, user decision 2026-09-29).VGroup {objectName: "set-smooth-motion"VRow {@@ -466,6 +403,23 @@ VPage {lineHeight: 1.3}}+ }++ // --- 音频 ---+ ColumnLayout {+ id: secAudio+ Layout.fillWidth: true+ spacing: 12+ visible: root.section === "audio"+ VH1 { text: qsTr("音频") }+ Text {+ text: qsTr("声音同步、音量与输出设备。")+ color: Theme.t2+ font.family: Theme.fontUi+ font.pixelSize: Theme.fsBody+ Layout.fillWidth: true+ wrapMode: Text.WordWrap+ }VGroup {VRow {label: qsTr("声音同步")@@ -508,6 +462,127 @@ VPage {}}+ // --- 性能 ---+ ColumnLayout {+ id: secPerf+ Layout.fillWidth: true+ spacing: 12+ visible: root.section === "perf"+ VH1 { text: qsTr("性能") }+ Text {+ text: qsTr("显卡调度、预热与资源监控。默认设置适合大多数机器。")+ color: Theme.t2+ font.family: Theme.fontUi+ font.pixelSize: Theme.fsBody+ Layout.fillWidth: true+ wrapMode: Text.WordWrap+ }+ VGroup {+ VRow {+ label: qsTr("GPU 优先级")+ hint: veyra.gpuPriorityStatus + qsTr(";切到后台卡顿时可试“高”,“实时”可能拖慢其他程序")+ VSeg {+ objectName: "set-gpu-priority"+ options: [{ id: "normal", label: qsTr("普通") }, { id: "high", label: qsTr("高") }, { id: "realtime", label: qsTr("实时") }]+ current: veyra.preferences.gpuPriority || "normal"+ onPicked: id => veyra.setPreference("gpuPriority", id)+ }+ }+ VRow {+ label: qsTr("启动时预热增强组件")+ hint: !veyra.enhancementPrewarmAvailable+ ? qsTr("当前显卡不支持预热")+ : qsTr("默认关闭。开启后首页空闲时预先准备已启用的单层 NR 或超分,首次打开约快 2 秒;准备好后会一直占用约 0.8–1.8 GB 显存,直到打开视频")+ VSwitch {+ objectName: "set-prewarm-enhancement"+ enabled: veyra.enhancementPrewarmAvailable+ checked: veyra.preferences.prewarmEnhancement === true+ onToggled: v => veyra.setPreference("prewarmEnhancement", v)+ }+ }+ VRow {+ label: qsTr("GPU 占用监控")+ hint: qsTr("专业页「GPU 占用」只统计这一块显卡") + (veyra.gpuMonitorName ? qsTr(";当前:") + veyra.gpuMonitorName : "")+ VSelect {+ objectName: "set-monitor-gpu"+ implicitWidth: 230+ options: veyra.gpuMonitorChoices+ value: (options.find(o => o.id === (veyra.preferences.monitorGpu || "")) || options[0] || { label: "—" }).label+ onPicked: id => veyra.setPreference("monitorGpu", id)+ }+ }+ VRow {+ label: qsTr("全屏显存增长保护")+ hint: qsTr("检测异常增长时自动退出全屏;默认关闭")+ VSwitch {+ objectName: "set-fullscreen-memory-protection"+ checked: !!veyra.preferences.fullscreenMemoryProtection+ onToggled: v => veyra.setPreference("fullscreenMemoryProtection", v)+ }+ }+ }+ }++ // --- 兼容 ---+ ColumnLayout {+ id: secCompat+ Layout.fillWidth: true+ spacing: 12+ visible: root.section === "compat"+ VH1 { text: qsTr("兼容") }+ Text {+ text: qsTr("与 OBS、监控软件(小飞机 / RTSS)同时使用时的设置;修改后需要重启。")+ color: Theme.t2+ font.family: Theme.fontUi+ font.pixelSize: Theme.fsBody+ Layout.fillWidth: true+ wrapMode: Text.WordWrap+ }+ VGroup {+ VRow {+ label: qsTr("OBS 游戏采集兼容")+ hint: (!!veyra.preferences.obsGameCapture !== veyra.obsGameCaptureActive)+ ? qsTr("重启后生效")+ : qsTr("仅采集视频;界面软件绘制,部分阴影与模糊简化")+ VSwitch {+ objectName: "set-obs-game-capture"+ checked: !!veyra.preferences.obsGameCapture+ onToggled: v => {+ if (veyra.setPreference("obsGameCapture", v)+ && v !== veyra.obsGameCaptureActive)+ obsRestart.open()+ }+ }+ }+ VRow {+ // RivaTuner (MSI Afterburner's OSD): see main.cpp. Auto draws the interface in+ // software when RTSS runs at start, so its OSD only sits on the video.+ readonly property bool automatic: (veyra.preferences.overlayCompat || "auto") === "auto"+ label: qsTr("监控软件兼容")+ hint: veyra.obsGameCaptureActive+ ? qsTr("OBS 游戏采集兼容已让界面软件绘制,小飞机 OSD 只显示在视频上")+ : (automatic !== veyra.overlayCompatActive && (veyra.overlayCompatActive || veyra.rivaTunerRunning()))+ ? qsTr("重启后生效")+ : veyra.overlayCompatActive+ ? qsTr("监控兼容绘制已启用:OSD 只显示在视频上;部分阴影与模糊简化")+ : automatic+ ? qsTr("启动时检测到小飞机(RTSS)就改用软件绘制界面,OSD 只显示在视频上")+ : qsTr("界面始终用显卡绘制;为避免冲突,小飞机 OSD 不在 Veyra 里显示")+ VSeg {+ objectName: "set-overlay-compat"+ options: [{ id: "auto", label: qsTr("自动") }, { id: "off", label: qsTr("关闭") }]+ current: veyra.preferences.overlayCompat || "auto"+ onPicked: id => {+ if (veyra.setPreference("overlayCompat", id) && !veyra.obsGameCaptureActive+ && (id === "auto") !== veyra.overlayCompatActive+ && (veyra.overlayCompatActive || veyra.rivaTunerRunning()))+ obsRestart.open()+ }+ }+ }+ }+ }+// --- PS5 串流 --------------------------------------------ColumnLayout {id: secPs5diff --git a/scripts/ui-check/slider-typed.qml b/scripts/ui-check/slider-typed.qmlindex 525d9215..6bf45bbb 100644--- a/scripts/ui-check/slider-typed.qml+++ b/scripts/ui-check/slider-typed.qml@@ -14,7 +14,7 @@property var s: nullonTriggered: {++ticks- if (ticks === 2) { veyra.volume = 0.8; root.goPage("set"); settingsPage.section = "play" }+ if (ticks === 2) { veyra.volume = 0.8; root.goPage("set"); settingsPage.section = "audio" }if (ticks === 4) {s = uitestFind(root.contentItem, "settings-volume")if (!s) { veyra.logUi("uitest", "UITEST_FAIL no slider"); running = false; return }diff --git a/src/core/SceneCadenceAnalyzer.cpp b/src/core/SceneCadenceAnalyzer.cppindex 7b094dbe..97e593a5 100644--- a/src/core/SceneCadenceAnalyzer.cpp+++ b/src/core/SceneCadenceAnalyzer.cpp@@ -18,7 +18,8 @@ double SceneCadenceAnalyzer::histogramDistance(const std::vector<double>& a,SceneAnalysisResult SceneCadenceAnalyzer::analyze(uint64_t frameId,const std::vector<double>& histogram,double sad,- uint64_t ptsUs) {+ uint64_t ptsUs,+ uint64_t sourceStep) {SceneAnalysisResult result;result.frameId = frameId;result.sadScore = sad;@@ -63,12 +64,15 @@ SceneAnalysisResult SceneCadenceAnalyzer::analyze(uint64_t frameId,++sceneCutCount_;}- // Cadence break: PTS irregularity (beyond expected jitter).+ // Cadence break: PTS irregularity (beyond expected jitter), measured per+ // source frame so that skipped/dropped frames do not count as a break.+ double cadenceDeltaUs = 0;if (result.ptsDeltaUs > 0 && result.ptsDeltaUs < 1e15) {+ cadenceDeltaUs = result.ptsDeltaUs / double(sourceStep ? sourceStep : 1);// Check against expected cadence (simplified: if delta is 3x the// previous delta, consider it a break)- if (lastResult_.ptsDeltaUs > 0 &&- result.ptsDeltaUs > lastResult_.ptsDeltaUs * 3.0 + config_.cadenceBreakPtsJitterUs) {+ if (lastCadenceDeltaUs_ > 0 &&+ cadenceDeltaUs > lastCadenceDeltaUs_ * 3.0 + config_.cadenceBreakPtsJitterUs) {result.isCadenceBreak = true;}}@@ -79,6 +83,7 @@ SceneAnalysisResult SceneCadenceAnalyzer::analyze(uint64_t frameId,prevPtsUs_ = ptsUs;}+ if (cadenceDeltaUs > 0 && !result.isDuplicate) lastCadenceDeltaUs_ = cadenceDeltaUs;lastResult_ = result;return result;}diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cppindex df2eea55..40102b10 100644--- a/src/engine/EngineController.cpp+++ b/src/engine/EngineController.cpp@@ -547,9 +547,14 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sgd.yuy2Input=isCapture&&activeSource->info().color.pixelFormat==pipeline::SourcePixelFormat::Yuy2;gd.stillImage=isImage;gd.packedInput=isCapture?pipeline::packedInputCode(activeSource->info().color.pixelFormat):0;const bool nvidiaAdapter=ctx.adapter().isNvidia;+ // AMD adapters run NR on the lmxxf runtime. Both the normalization+ // and the stage description used to drop NR on every non-NVIDIA+ // adapter, so AMD NR never ran in the product (field log 2026-10-05,+ // RX 9070 XT: "normalized ... nr=false").+ const bool amdNrAdapter=ctx.adapter().vendorId==0x1002;auto stageRequest=[&](const PlayerOptions& o){StageRequest r;r.nr=o.nr;r.sr=o.sr;r.fg=o.fg;r.fgMultiplier=o.fgMultiplier;- r.width=width;r.height=height;r.stillImage=isImage;r.nvidiaAdapter=nvidiaAdapter;+ r.width=width;r.height=height;r.stillImage=isImage;r.nvidiaAdapter=nvidiaAdapter;r.amdNr=amdNrAdapter;r.nodeOrder=o.nodeOrder?&*o.nodeOrder:nullptr;return r;};describeStages(stageRequest(options),options.snapshot(),gd);@@ -571,12 +576,13 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sauto initializePreview=[&](pipeline::EnhanceGraphDesc& desc,PlayerOptions& selected,bool preserveWorkingFg=false,bool preserveWorkingNr=false){backendRecoveryWarning.clear();auto supported=selected.snapshot();- if(disableUnsupportedNvidiaEffects(supported,nvidiaAdapter)){+ if(disableUnsupportedNvidiaEffects(supported,nvidiaAdapter,amdNrAdapter)){selected=PlayerOptions::from(supported,selected.nodeOrder);// Same stage rules as every other build: AMD FSR upscaling// survives the normalization, it used to be dropped here.describeStages(stageRequest(selected),selected.snapshot(),desc);- backendRecoveryWarning=L"当前 GPU 不支持 NVIDIA 增强;NR、超分及 DLSS 已关闭,XeSS选择保留";+ backendRecoveryWarning=amdNrAdapter?L"当前 GPU 不支持 NVIDIA 增强;超分及 DLSS 已关闭,NR 使用 AMD 运行库,XeSS选择保留":+ L"当前 GPU 不支持 NVIDIA 增强;NR、超分及 DLSS 已关闭,XeSS选择保留";veyra::log::warn("capability","normalized requested NVIDIA effects before graph creation; applied settings reflect actual disabled stages");}for(unsigned attempt=0;attempt<6;++attempt){@@ -719,7 +725,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sif(!backendRecoveryWarning.empty()){std::lock_guard lock(mutex_);desired_.rejectVideoRequest(initialRequested,options.snapshot());snapshot_.desired=desired_;snapshot_.rejectedRevision=initialRequested.revision;snapshot_.backendWarning=backendRecoveryWarning;}- if(!nvidiaAdapter&&(options.nr||options.sr||(options.fg&&!xessFg))){+ if(!nvidiaAdapter&&((options.nr&&!amdNrAdapter)||options.sr||(options.fg&&!xessFg))){veyra::log::warn("capability",std::format("non-NVIDIA adapter disabled requested features: nr={} sr={} fgBackend={} flowBackend={}",options.nr,options.sr,frameGenerationBackendName(options.settings.frameGenerationBackend),opticalFlowBackendName(options.settings.opticalFlowBackend)));status(L"当前非 NVIDIA 适配器:NR、NVIDIA 超分与 DLSS 已禁用;可使用 XeSS 预览和 AMD 光流",false);}@@ -727,7 +733,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sif(graph->xessEnabled()&&!presenter.xessActive())status(L"XeSS 未启用:运行时或设备不兼容;当前为普通呈现",false);{std::lock_guard lock(mutex_);- if(!nvidiaAdapter&&(options.nr||options.sr||(options.fg&&!xessFg)))snapshot_.backendWarning=L"当前 GPU 不支持所选 NVIDIA 增强";+ if(!nvidiaAdapter&&((options.nr&&!amdNrAdapter)||options.sr||(options.fg&&!xessFg)))snapshot_.backendWarning=L"当前 GPU 不支持所选 NVIDIA 增强";if(graph->xessEnabled()&&!presenter.xessActive())snapshot_.backendWarning=L"XeSS 初始化失败;当前为普通呈现";}captureSource.setAudioSync(unsigned(options.settings.audioSync),options.settings.audioOffsetMs);@@ -974,6 +980,11 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s}}};+ // The graph object is replaced on rebuilds (core reuse, recent-graph+ // cache, prewarm adoption). Re-arm recording on whichever graph is+ // current; arming only the first one left every later graph+ // unmeasured ("未测量" after any effect change, 2026-10-05).+ graph->recordGpuTimings();for(const auto& sample:graph->takeGpuTimings())record(sample);for(const auto& sample:presenter.takeGpuTimings(ctx.fence()))record(sample);};@@ -1267,7 +1278,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s// settings record.bool rebuild=engine::requiresGraphRebuild(previous,requested)||previousOrder!=requestedOrder;if(gd.hdrOutput!=nextDesc.hdrOutput||- (!nvidiaAdapter&&(next.nr||next.sr||(next.fg&&!xessFg)))||+ (!nvidiaAdapter&&((next.nr&&!amdNrAdapter)||next.sr||(next.fg&&!xessFg)))||gd.enableNr!=nextDesc.enableNr||gd.enableFg!=nextDesc.enableFg||gd.nrBeforeSr!=nextDesc.nrBeforeSr||gd.workWidth!=nextDesc.workWidth||gd.workHeight!=nextDesc.workHeight||@@ -1319,7 +1330,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s}options=next;gd=nextDesc;transaction=true;reset=true;resetRecord->epoch=0;- if(!nvidiaAdapter&&(next.nr||next.sr||(next.fg&&!xessFg)))veyra::log::warn("capability",std::format("non-NVIDIA adapter disabled requested settings revision={} nr={} sr={} fgBackend={} flowBackend={}",requested.revision,next.nr,next.sr,frameGenerationBackendName(requested.frameGenerationBackend),opticalFlowBackendName(requested.opticalFlowBackend)));+ if(!nvidiaAdapter&&((next.nr&&!amdNrAdapter)||next.sr||(next.fg&&!xessFg)))veyra::log::warn("capability",std::format("non-NVIDIA adapter disabled requested settings revision={} nr={} sr={} fgBackend={} flowBackend={}",requested.revision,next.nr,next.sr,frameGenerationBackendName(requested.frameGenerationBackend),opticalFlowBackendName(requested.opticalFlowBackend)));}else {finishReset(diagnostics::ResetOutcome::RolledBack);@@ -1739,7 +1750,11 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s}{std::lock_guard lock(mutex_);snapshot_.previewFgMultiplier=previewFgMultiplier;}const auto liveInterval=physicalCapture?- capturePairInterval100ns(pkt.duration,activeSource->info().averageFps,lastProcessedPtsMs,pts,historyReset):+ // A span across frames WE skipped is not the source cadence. Using it+ // stretched the next pair's presentation over the gap, which made+ // the mailbox drop again: one background hiccup locked live capture+ // at ~10 pairs/s (field log 2026-10-04, 60 -> 22 fps until refocus).+ capturePairInterval100ns(pkt.duration,activeSource->info().averageFps,lastProcessedPtsMs,pts,historyReset||gapCandidate):livePhaseInterval100ns(pkt.duration,activeSource->info().averageFps/(isScreen&&halfRate?2:1),isScreen);const auto processingAllowance=isCapture&&options.fg&&!presentSinkFrameGeneration(options.settings.frameGenerationBackend)?fgBudget.processingAllowance(host100ns(),liveInterval):0;diff --git a/src/engine/Subtitles.cpp b/src/engine/Subtitles.cppindex eae50978..99ede0d6 100644--- a/src/engine/Subtitles.cpp+++ b/src/engine/Subtitles.cpp@@ -5,6 +5,7 @@#include <algorithm>#include <cmath>+#include <cctype>#include <cstring>#include <filesystem>#include <format>@@ -335,6 +336,11 @@ SubtitleTrack loadSubtitleFile(const std::wstring& path){else if(extension==L".vtt"||headLower.find(L"webvtt")!=std::wstring::npos)track=parseVtt(data,name);else if(headLower.find(L"[script info]")!=std::wstring::npos||headLower.find(L"dialogue:")!=std::wstring::npos)track=parseAss(data,name,false);else track=parseSrt(data,name);+ if(extension==L".ass"||extension==L".ssa"||headLower.find(L"[script info]")!=std::wstring::npos){+ auto ass=std::make_shared<SubtitleAssData>();+ ass->script=utf8(data);ass->source=L"file:"+path;+ track.ass=std::move(ass);+ }track.rebuildIndex(); // cue lookup is binary searched, so it needs the indexreturn track;}@@ -411,6 +417,24 @@ std::vector<SubtitleTrack> loadEmbeddedSubtitleTracks(const std::wstring& path,sstruct DecoderCleanup {void operator()(AVCodecContext* context)const{avcodec_free_context(&context);}};std::vector<std::unique_ptr<AVCodecContext,DecoderCleanup>> decoders;std::vector<int> streamToTrack(input->nb_streams,-1);+ // Matroska font attachments: ASS effect subtitles usually depend on them.+ std::vector<SubtitleAssData::Font> attachedFonts;size_t attachedFontBytes=0;+ for(unsigned streamIndex=0;streamIndex<input->nb_streams;++streamIndex){+ const AVStream* stream=input->streams[streamIndex];+ if(stream->codecpar->codec_type!=AVMEDIA_TYPE_ATTACHMENT||!stream->codecpar->extradata||stream->codecpar->extradata_size<=0)continue;+ const AVDictionaryEntry* mime=stream->metadata?av_dict_get(stream->metadata,"mimetype",nullptr,0):nullptr;+ const AVDictionaryEntry* file=stream->metadata?av_dict_get(stream->metadata,"filename",nullptr,0):nullptr;+ const std::string mimeType=mime&&mime->value?mime->value:"";std::string fileName=file&&file->value?file->value:"";+ std::string lowerName=fileName;for(auto& c:lowerName)c=char(std::tolower(static_cast<unsigned char>(c)));+ const bool font=mimeType.find("font")!=std::string::npos||mimeType=="application/x-truetype-font"||mimeType=="application/vnd.ms-opentype"||+ lowerName.ends_with(".ttf")||lowerName.ends_with(".otf")||lowerName.ends_with(".ttc");+ const size_t size=size_t(stream->codecpar->extradata_size);+ if(!font||size>64u*1024u*1024u||attachedFontBytes+size>256u*1024u*1024u)continue;+ attachedFontBytes+=size;+ attachedFonts.push_back({fileName,std::vector<char>(reinterpret_cast<const char*>(stream->codecpar->extradata),reinterpret_cast<const char*>(stream->codecpar->extradata)+size)});+ }+ if(!attachedFonts.empty())log::info("subtitle",std::format("container fonts attached={} bytes={}",attachedFonts.size(),attachedFontBytes));+ std::vector<std::shared_ptr<SubtitleAssData>> assWork;for(unsigned streamIndex=0;streamIndex<input->nb_streams;++streamIndex){if(stop.stop_requested())return {};AVStream* stream=input->streams[streamIndex];@@ -445,8 +469,19 @@ std::vector<SubtitleTrack> loadEmbeddedSubtitleTracks(const std::wstring& path,scontinue;}decoders.back().reset(context);+ if((codec==AV_CODEC_ID_ASS||codec==AV_CODEC_ID_SSA)&&context->subtitle_header&&context->subtitle_header_size>0){+ auto ass=std::make_shared<SubtitleAssData>();+ ass->header.assign(reinterpret_cast<const char*>(context->subtitle_header),size_t(context->subtitle_header_size));+ ass->fonts=attachedFonts;ass->source=std::format(L"embedded:{}#{}",path,streamIndex);+ if(assWork.size()<=tracks.size())assWork.resize(tracks.size()+1);+ assWork[tracks.size()]=ass;track.ass=ass;+ }tracks.push_back(std::move(track));}+ assWork.resize(tracks.size());+ // Published copies must never alias the vectors this loop still appends to.+ auto snapshotAss=[&]{for(size_t i=0;i<tracks.size();++i)if(assWork[i])tracks[i].ass=std::make_shared<const SubtitleAssData>(*assWork[i]);};+ snapshotAss();if(metadata&&!stop.stop_requested())metadata(tracks);if(std::none_of(decoders.begin(),decoders.end(),[](const auto& decoder){return bool(decoder);}))return tracks;AVPacket* packet=av_packet_alloc();@@ -517,6 +552,14 @@ std::vector<SubtitleTrack> loadEmbeddedSubtitleTracks(const std::wstring& path,sif(!entry)continue;std::wstring text;int alignOverride=0;double posX=-1,posY=-1;+ if(assWork[index]&&entry->ass&&*entry->ass&&subtitle.end_display_time>subtitle.start_display_time){+ const size_t bytes=std::strlen(entry->ass);+ if(bytes<=maxCacheBytes-cacheBytes){+ cacheBytes+=bytes;+ assWork[index]->events.push_back({int64_t(std::llround(packetSeconds*1000.0))+int64_t(subtitle.start_display_time),+ int64_t(subtitle.end_display_time-subtitle.start_display_time),std::string(entry->ass,bytes)});+ }+ }const std::wstring raw=entry->ass&&*entry->ass?wide(entry->ass):(entry->text&&*entry->text?wide(entry->text):std::wstring{});if(!raw.empty())text=cleanAssText(entry->ass&&*entry->ass?stripDialoguePrefix(raw):raw,alignOverride,posX,posY);if(text.empty())continue;@@ -535,11 +578,13 @@ std::vector<SubtitleTrack> loadEmbeddedSubtitleTracks(const std::wstring& path,sav_packet_unref(packet);if(metadata&&std::chrono::steady_clock::now()>=nextPublish){for(auto& t:tracks)t.rebuildIndex();+ snapshotAss();metadata(tracks);nextPublish=std::chrono::steady_clock::now()+std::chrono::seconds(1);}}if(stop.stop_requested())return {};+ snapshotAss();for(auto& track:tracks){track.rebuildIndex();log::info("subtitle",std::format("embedded track {} codec={} cues={}",track.streamIndex,utf8(track.codec),track.cues.size()));diff --git a/src/engine/VideoExportJob.cpp b/src/engine/VideoExportJob.cppindex c75c9e79..7c567ec8 100644--- a/src/engine/VideoExportJob.cpp+++ b/src/engine/VideoExportJob.cpp@@ -105,14 +105,22 @@ bool exportVideo(const std::wstring& input,const std::wstring& output,PlayerOpti// upscaling is the only vendor-neutral video SR we ship. Requesting an// unavailable feature must degrade the export, never fail it.const bool nvidiaFeatures=nvidiaAdapter;+ // AMD adapters run NR on the lmxxf runtime. Export keeps native size,+ // and that runtime only admits <=1920x1080 pixels (height <=1080).+ const bool amdAdapter=ctx.adapter().vendorId==0x1002;+ const bool amdNrExport=amdAdapter&&info.width<=2560&&info.height<=1080&&uint64_t(info.width)*info.height<=1920ull*1080ull;// One description for the whole job: the stage rules (which SR runs,// whether NR/FG are available) come from the same place the preview uses.StageRequest stages;stages.nr=options.nr;stages.sr=options.sr;stages.fg=options.fg;stages.fgMultiplier=options.fgMultiplier;- stages.width=info.width;stages.height=info.height;stages.exportJob=true;stages.nvidiaAdapter=nvidiaAdapter;+ stages.width=info.width;stages.height=info.height;stages.exportJob=true;stages.nvidiaAdapter=nvidiaAdapter;stages.amdNr=amdNrExport;const auto plan=describeStages(stages,options.snapshot(),gd);+ if(amdNrExport&&gd.enableNr&&gd.opticalFlowBackend==OpticalFlowBackend::Nvidia)gd.opticalFlowBackend=OpticalFlowBackend::AmdFidelityFx;const auto resolution=plan;const bool srAvailable=plan.srApplied&&(nvidiaFeatures||options.settings.videoSrQuality==kVideoSrFsr);- if(options.nr&&!nvidiaFeatures)fgNote+=fgNote.empty()?L"当前显卡不能使用 DLSS NR,本次导出自动关闭 NR":L";当前显卡不能使用 DLSS NR,本次导出自动关闭 NR";+ if(options.nr&&!nvidiaFeatures&&!amdNrExport){+ const wchar_t* note=amdAdapter?L"AMD NR 导出只支持 1080p 以内的片源,本次导出关闭 NR":L"当前显卡不能使用 DLSS NR,本次导出自动关闭 NR";+ fgNote+=fgNote.empty()?std::wstring(note):std::wstring(L";")+note;+ }if(options.sr&&!srAvailable)fgNote+=fgNote.empty()?L"当前显卡不能使用所选超分,本次导出关闭超分":L";当前显卡不能使用所选超分,本次导出关闭超分";if(!nvidiaFeatures&&srAvailable)fgNote+=fgNote.empty()?L"本次导出使用 AMD FSR 超分":L";本次导出使用 AMD FSR 超分";gd.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cppindex 9f4c24a1..ee517c1d 100644--- a/src/pipeline/EnhanceGraph.cpp+++ b/src/pipeline/EnhanceGraph.cpp@@ -405,7 +405,7 @@ bool EnhanceGraph::initialize(const EnhanceGraphDesc& desc)}veyra::log::info("graph","diagnostic SR motion override active; no product entry point enables this");}- desc_ = desc;tracker_={};prevValid_=false;fgHistorySkipped_=false;cadence_.reset();scene_.reset();previousLuma_.clear();+ desc_ = desc;tracker_={};prevValid_=false;fgHistorySkipped_=false;cadence_.reset();scene_.reset();sceneLastSourceId_=0;previousLuma_.clear();if(desc.videoSrQuality>engine::kVideoSrFsr){veyra::log::error("graph",std::format("invalid video SR quality value={}",desc.videoSrQuality));return false;}srcW_ = desc.sourceWidth;srcH_ = desc.sourceHeight;@@ -1919,7 +1919,7 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frameout.detectedReset=ResetReason::PtsDiscontinuity;reset=true;veyra::log::info("timeline","non-monotonic or discontinuous PTS; atomic history reset");}- if (reset) { prevValid_ = false; scene_.reset(); previousLuma_.clear();cadence_.reset(); }+ if (reset) { prevValid_ = false; scene_.reset(); sceneLastSourceId_=0; previousLuma_.clear();cadence_.reset(); }const uint32_t parity = static_cast<uint32_t>(realFrameIndex_ % 2);if(!realLeases_[parity].expired()||!generatedLeases_[parity].expired()){@@ -1971,7 +1971,11 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frameout.measuredContentRate=cadence_.confirmedRate(desc_.contentRate);if(cadence_.conflicts(desc_.contentRate)&&realFrameIndex_%60==0)veyra::log::warn("cadence","requested content-rate identification conflicts with observed motion; preserving source timestamps");out.contentDuplicate=desc_.contentRate!=engine::ContentRate::Transport&&previousLuma_.size()==sample.size()&&sad<0.0001;- const auto analysis=scene_.analyze(realFrameIndex_,hist,sad,static_cast<uint64_t>(std::max(0.0,ptsMs)*1000));+ // Source ids advance per received/decoded frame, including frames the+ // engine skipped or the capture mailbox replaced; normalise by that step.+ const uint64_t sourceStep=sceneLastSourceId_&&sourceFrameId>sceneLastSourceId_?sourceFrameId-sceneLastSourceId_:1;+ sceneLastSourceId_=sourceFrameId;+ const auto analysis=scene_.analyze(realFrameIndex_,hist,sad,static_cast<uint64_t>(std::max(0.0,ptsMs)*1000),sourceStep);if(analysis.isSceneCut||analysis.isCadenceBreak){if(out.detectedReset==ResetReason::None)out.detectedReset=analysis.isSceneCut?ResetReason::SceneCut:ResetReason::CadenceBreak;reset=true;prevValid_=false;if(analysis.isSceneCut)++metrics_.sceneCutCount;diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cppindex 55b1a7eb..2476fa0e 100644--- a/src/ui/QmlPlayerBridge.cpp+++ b/src/ui/QmlPlayerBridge.cpp@@ -106,6 +106,7 @@ namespace Gdiplus { using std::min; using std::max; }#include <dxgi1_6.h>#include <wrl/client.h>#include "veyra/ngx/NrArchitecturePolicy.h"+#include "veyra/ngx/FgCompatibilitySession.h"#include "veyra/source/CaptureCardSource.h"#include "veyra/source/ScreenCaptureSource.h"@@ -3505,6 +3506,17 @@ void QmlPlayerBridge::tickSubtitles() {const auto& track = i.subTracks[size_t(index)];if (!track.usable()) return;const double at = s.position + double(track.offsetMs) / 1000.0;+#ifdef VEYRA_HAS_LIBASS+ if (track.ass) {+ // ASS/SSA: libass draws the whole script (effects, karaoke,+ // container fonts). The parsed text only feeds diagnostics.+ SubtitleLine line;+ line.ass = track.ass; line.assTimeMs = at * 1000.0; line.secondary = secondary;+ line.text = engine::textAt(track, at);+ draw.push_back(std::move(line));+ return;+ }+#endiffor (const auto* cue : engine::cuesAt(track, at, 3)) {SubtitleLine line;line.text = cue->text; line.bitmap = cue->bitmap;@@ -3540,7 +3552,7 @@ void QmlPlayerBridge::tickSubtitles() {view.videoHeight = s.metrics.resolution.output.height;updateSubtitleOverlay(i.subOverlay, draw, view);QString joined;- for (const auto& line : draw) { if (!joined.isEmpty()) joined += QStringLiteral(" | "); joined += QString::fromStdWString(line.text); }+ for (const auto& line : draw) { if (line.text.empty()) continue; if (!joined.isEmpty()) joined += QStringLiteral(" | "); joined += QString::fromStdWString(line.text); }if (joined != i.subText) {i.subText = joined;if (!joined.isEmpty()) veyra::log::info("subtitle-overlay", "text=" + joined.toStdString());@@ -4685,10 +4697,15 @@ QString QmlPlayerBridge::gpuPriorityStatus() const {if(status.state==gfx::GpuPriorityState::Rejected)return tr("系统未接受设置,当前:%1").arg(status.actual<0?tr("未知"):name(status.actual));return tr("已生效:%1").arg(name(status.actual));}-bool QmlPlayerBridge::enhancementPrewarmAvailable() const {return effectGpu().vendor==0x10DE;}+bool QmlPlayerBridge::enhancementPrewarmAvailable() const {+ // PreviewGpuSession::prepare refuses RTX 30/40 (patched FG sessions keep the+ // full NGX lifetime), so the switch must not look usable there either.+ const auto gpu=effectGpu();+ return gpu.vendor==0x10DE&&!ngx::FgCompatibilitySession::requested(gpu.vendor,gpu.deviceId);+}void QmlPlayerBridge::scheduleEnhancementPrewarm(){QTimer::singleShot(2000,this,[this]{- if(!impl_->prefBool("prewarmEnhancement",true)||!enhancementPrewarmAvailable()||impl_->openingSource||impl_->snapshot.running||!impl_->engine.idle())return;+ if(!impl_->prefBool("prewarmEnhancement",false)||!enhancementPrewarmAvailable()||impl_->openingSource||impl_->snapshot.running||!impl_->engine.idle())return;if(engine::runtimeOrder(impl_->activeRuntime()))return;const auto saved=impl_->prefs.value(QStringLiteral("lastSourceExtent")).toMap();const auto width=saved.value("width",1920).toUInt(),height=saved.value("height",1080).toUInt();@@ -4799,8 +4816,8 @@ bool QmlPlayerBridge::setPreference(const QString& key, const QVariant& value) {}void QmlPlayerBridge::applyPreference(const QString& key) {if(key==QLatin1String("prewarmEnhancement")){- impl_->engine.setEnhancementPrewarmEnabled(impl_->prefBool("prewarmEnhancement",true));- if(impl_->prefBool("prewarmEnhancement",true))scheduleEnhancementPrewarm();+ impl_->engine.setEnhancementPrewarmEnabled(impl_->prefBool("prewarmEnhancement",false));+ if(impl_->prefBool("prewarmEnhancement",false))scheduleEnhancementPrewarm();}if(key==QLatin1String("gpuPriority")){const auto value=impl_->prefString("gpuPriority");diff --git a/tests/unit/EffectChainTests.cpp b/tests/unit/EffectChainTests.cppindex 891b6ff2..6c4ec525 100644--- a/tests/unit/EffectChainTests.cpp+++ b/tests/unit/EffectChainTests.cpp@@ -630,6 +630,12 @@ void testProductionFixedPlanDescription() {desc.fixedExecutionPlan&&desc.fixedExecutionPlan->resourceCounts[size_t(EffectType::NrEnhance)]==0&&desc.fixedExecutionPlan->output==Extent{3840,2160},"non-NVIDIA fallback retains ordinary resize extent without NR resources");+ // As the engine sends it after AMD normalization: DLSS SR removed, NR kept.+ request.amdNr=true;request.sr=false;describeStages(request,s,desc);+ check(desc.validateFixedExecutionPlan().empty()&&desc.enableNr&&!desc.enableSr&&desc.fixedExecutionPlan&&+ desc.fixedExecutionPlan->resourceCounts[size_t(EffectType::NrEnhance)]==2,+ "AMD adapter description keeps NR layers for the lmxxf runtime");+ request.amdNr=false;request.sr=true;request.nvidiaAdapter=true;request.nr=false;describeStages(request,s,desc);check(desc.validateFixedExecutionPlan().empty()&&!desc.enableNr&&desc.fixedExecutionPlan&&desc.fixedExecutionPlan->resourceCounts[size_t(EffectType::NrEnhance)]==0,diff --git a/tests/unit/LivePresentationTimingTests.cpp b/tests/unit/LivePresentationTimingTests.cppindex dd2736f6..8d228c14 100644--- a/tests/unit/LivePresentationTimingTests.cpp+++ b/tests/unit/LivePresentationTimingTests.cpp@@ -101,6 +101,9 @@ int main(){check(driverFlag.observe(true,true,true,true,.02,.09,120),"VRR does not hide source/arrival disagreement");check(veyra::source::captureClockBreak(1,.9,120),"VRR preserves backward-clock reset");check(veyra::engine::capturePairInterval100ns({83333,10000000},120,0,20,true)==83333,"reset does not reuse stale A/B interval");+ // Caller passes reset||skipped: a span across frames the player dropped is+ // not the source cadence (60 Hz capture, 100 ms gap -> keep 16.7 ms phase).+ check(veyra::engine::capturePairInterval100ns({166667,10000000},60,1000,1100,true)==166667,"skip gap does not stretch the presentation phase");constexpr auto drop=static_cast<veyra::pipeline::FrameFlags>(veyra::pipeline::FrameFlagBits::Drop);constexpr auto resize=static_cast<veyra::pipeline::FrameFlags>(veyra::pipeline::FrameFlagBits::Resize);check(veyra::pipeline::breaksHistory(drop),"mailbox overwrite resets temporal history");diff --git a/tests/unit/RepairContractTests.cpp b/tests/unit/RepairContractTests.cppindex 870c2e7b..2be797fa 100644--- a/tests/unit/RepairContractTests.cpp+++ b/tests/unit/RepairContractTests.cpp@@ -76,6 +76,12 @@ int main(){s.nr=s.sr=true;s.multiplier=2;s.frameGenerationBackend=engine::FrameGenerationBackend::XeSS;check(engine::disableUnsupportedNvidiaEffects(s,false)&&!s.nr&&!s.sr&&s.multiplier==2,"non-NVIDIA normalization retains independently selected XeSS");s.nr=true;check(!engine::disableUnsupportedNvidiaEffects(s,true)&&s.nr,"NVIDIA capability normalization retains supported effects");+ // AMD adapters keep NR (lmxxf runtime) and move NR motion to AMD flow;+ // DLSS SR/FG are still removed. Field log 2026-10-05 (RX 9070 XT): NR+ // was silently normalized off and AMD NR never ran.+ s=engine::EnhancementSettings{};s.nr=s.sr=true;s.multiplier=2;s.nrRuntime=engine::NrRuntime::LmxxfAmd;+ check(engine::disableUnsupportedNvidiaEffects(s,false,true)&&s.nr&&!s.sr&&s.multiplier==1&&+ s.opticalFlowBackend==engine::OpticalFlowBackend::AmdFidelityFx,"AMD normalization keeps NR on the AMD runtime with AMD flow");}{engine::EnhancementSettings requested;requested.nr=requested.sr=true;requested.multiplier=2;requested.audioOffsetMs=37;diff --git a/tests/unit/SceneCadenceTests.cpp b/tests/unit/SceneCadenceTests.cppindex 2399940a..57b57dbc 100644--- a/tests/unit/SceneCadenceTests.cpp+++ b/tests/unit/SceneCadenceTests.cpp@@ -113,6 +113,32 @@ int main() {check("scene:cadence-break", r.isCadenceBreak, "large PTS gap = cadence break");}+ // Frames the player skipped (capture mailbox drop / preview skip) are not a+ // source cadence break: a 100 ms gap over 6 source frames is 16.7 ms each.+ // Field log 2026-10-04: treating it as a break reset every ~100 ms and held+ // live capture at ~22 fps after the window lost focus.+ {+ SceneCadenceAnalyzer a;+ (void)a.analyze(1, makeHistogram(0.5), 0.0, 0, 1);+ (void)a.analyze(2, makeHistogram(0.5), 0.01, 16667, 1);+ auto skipped = a.analyze(3, makeHistogram(0.5), 0.01, 16667 + 100000, 6);+ check("scene:skip-not-break", !skipped.isCadenceBreak, "100 ms over 6 source frames keeps cadence");+ auto next = a.analyze(4, makeHistogram(0.5), 0.01, 16667 + 100000 + 16667, 1);+ check("scene:after-skip-normal", !next.isCadenceBreak, "normal frame after a skip keeps cadence");+ auto jump = a.analyze(5, makeHistogram(0.5), 0.01, 16667 + 100000 + 16667 + 400000, 1);+ check("scene:real-gap-still-breaks", jump.isCadenceBreak, "a real 400 ms source gap still breaks cadence");+ }+ // A duplicate (sub-millisecond PTS delta) must not make the next normal+ // interval look like a 3x jump.+ {+ SceneCadenceAnalyzer a;+ (void)a.analyze(1, makeHistogram(0.5), 0.0, 0);+ (void)a.analyze(2, makeHistogram(0.5), 0.01, 16667);+ (void)a.analyze(3, makeHistogram(0.5), 0.0001, 16667 + 500);+ auto r = a.analyze(4, makeHistogram(0.5), 0.01, 33334);+ check("scene:duplicate-no-false-break", !r.isCadenceBreak, "interval after a duplicate compares with the last real interval");+ }+// Reset clears baseline.{SceneCadenceAnalyzer a;