DLSS 5 Neural Rendering for Images & Video with Frame Generation, RTX Video Super Resolution, HDR, and Color Grading
TypeScript ai-upscalingdlssdlss-5dlss5dlssgframe-generationframe-interpolationimage-enhancementimage-upscalingneural-renderingnvidianvidia-dlss-5nvidia-rtxrtx-videortx-video-super-resolutionvideo-enhancementvideo-upscaling
Add files via upload
Merserkb002d1cac917
diff --git a/CMakeLists.txt b/CMakeLists.txtindex df9e690..836dc5e 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -1,5 +1,5 @@cmake_minimum_required(VERSION 3.28)-project(VisualEnhancer VERSION 17.0.0 LANGUAGES C CXX RC)+project(VisualEnhancer VERSION 18.0.0 LANGUAGES C CXX RC)if(NOT WIN32 OR NOT MSVC OR NOT CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64")message(FATAL_ERROR "Visual Enhancer requires a Windows MSVC x64 toolchain.")@@ -69,10 +69,22 @@ add_library(ve_core STATICsrc/media/image_alpha.cppsrc/media/packet_stream.cppsrc/media/cuda_video.cpp+ src/media/d3d_video.cpp+ src/media/d3d11_video.cpp+ src/media/d3d_nvenc.cpp+ src/media/d3d_amf.cppsrc/media/host_video.cppsrc/media/video_delivery.cppsrc/media/frame_batch.cppsrc/processing/native_engines.cpp+ src/processing/fsr_native.cpp+ src/processing/fsr_temporal.cpp+ src/processing/fsr_video.cpp+ src/processing/fsr_worker.cpp+ src/processing/reshade_native.cpp+ src/processing/reshade_cuda_adapter.cpp+ src/processing/reshade_video.cpp+ src/processing/reshade_worker.cppsrc/processing/vfx_native.cppsrc/processing/vfx_video.cppsrc/processing/vfx_worker.cpp@@ -87,9 +99,10 @@ add_library(ve_core STATICtarget_include_directories(ve_core PUBLIC src "${VE_NATIVE_ROOT}/modules" PRIVATE third_party/libheif/include third_party/ffmpeg)target_include_directories(ve_core PRIVATE third_party/libjpeg-turbo-3.1.3/src "${VE_JPEG_BINARY}")target_include_directories(ve_core SYSTEM PRIVATE third_party)+target_include_directories(ve_core SYSTEM PRIVATE "${VE_NATIVE_ROOT}/external/VideoCodecHeaders-12.2")target_include_directories(ve_core SYSTEM PRIVATE "${VE_NATIVE_ROOT}/external/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include")target_link_libraries(ve_core PUBLIC Qt6::Core Qt6::Gui Qt6::Network Qt6::Concurrent Qt6::Svg ve_libraw)-target_link_libraries(ve_core PRIVATE zlibstatic ve_jpeg)+target_link_libraries(ve_core PRIVATE zlibstatic ve_jpeg d3d12 d3d11 dxgi dxguid)target_compile_definitions(ve_core PUBLIC NOMINMAX WIN32_LEAN_AND_MEAN UNICODE _UNICODEVE_APP_VERSION="${PROJECT_VERSION}")@@ -152,9 +165,42 @@ option(BUILD_TESTING "Build the permanent unit and contract tests" OFF)include(CTest)if(BUILD_TESTING)find_package(Qt6 6.12...<6.13 REQUIRED COMPONENTS Test)+ add_executable(ve_fsr_directx_export_smoke "${VE_TEST_ROOT}/fsr_directx_export_smoke.cpp")+ target_link_libraries(ve_fsr_directx_export_smoke PRIVATE ve_core)+ add_executable(ve_temporal_cadence_tests "${VE_TEST_ROOT}/temporal_cadence_tests.cpp")+ add_executable(ve_fsr_settings_tests "${VE_TEST_ROOT}/fsr_settings_tests.cpp")+ add_executable(ve_frame_generation_settings_tests "${VE_TEST_ROOT}/frame_generation_settings_tests.cpp")+ target_link_libraries(ve_frame_generation_settings_tests PRIVATE ve_core Qt6::Test)+ add_test(NAME frame_generation_settings_contracts COMMAND $<TARGET_FILE:ve_frame_generation_settings_tests> -o -,txt)+ add_executable(ve_fsr_application_smoke "${VE_TEST_ROOT}/fsr_application_smoke.cpp")+ add_executable(ve_fsr_startup_smoke "${VE_TEST_ROOT}/fsr_startup_smoke.cpp")+ target_link_libraries(ve_fsr_startup_smoke PRIVATE ve_core)+ add_executable(ve_frame_generation_preview_smoke "${VE_TEST_ROOT}/frame_generation_preview_smoke.cpp")+ target_link_libraries(ve_frame_generation_preview_smoke PRIVATE ve_core)+ target_link_libraries(ve_fsr_application_smoke PRIVATE ve_core)+ add_executable(ve_fsr_lifecycle_smoke "${VE_TEST_ROOT}/fsr_lifecycle_smoke.cpp")+ target_link_libraries(ve_fsr_lifecycle_smoke PRIVATE ve_core)+ add_executable(ve_fsr_adaptive_smoke "${VE_TEST_ROOT}/fsr_adaptive_smoke.cpp")+ target_link_libraries(ve_fsr_adaptive_smoke PRIVATE ve_core)+ add_library(ve_fsr_bad_abi SHARED "${VE_TEST_ROOT}/fsr_bad_abi.cpp")+ add_executable(ve_fsr_loader_smoke "${VE_TEST_ROOT}/fsr_loader_smoke.cpp")+ target_link_libraries(ve_fsr_loader_smoke PRIVATE ve_core)+ add_dependencies(ve_fsr_loader_smoke ve_fsr_bad_abi)+ target_link_libraries(ve_fsr_settings_tests PRIVATE ve_core Qt6::Test)+ add_test(NAME fsr_settings_contracts COMMAND $<TARGET_FILE:ve_fsr_settings_tests> -o -,txt)+ target_link_libraries(ve_temporal_cadence_tests PRIVATE ve_core Qt6::Test)+ add_test(NAME temporal_cadence_contracts COMMAND $<TARGET_FILE:ve_temporal_cadence_tests> -o -,txt)get_filename_component(VE_QT_RUNTIME_ROOT "${Qt6_DIR}/../../.." ABSOLUTE)add_executable(ve_storage_tests "${VE_TEST_ROOT}/storage_tests.cpp")add_executable(ve_dlss_rr_settings_tests "${VE_TEST_ROOT}/dlss_rr_settings_tests.cpp")+ add_executable(ve_reshade_settings_tests "${VE_TEST_ROOT}/reshade_settings_tests.cpp")+ target_link_libraries(ve_reshade_settings_tests PRIVATE ve_core Qt6::Test)+ add_test(NAME reshade_settings_contracts COMMAND $<TARGET_FILE:ve_reshade_settings_tests> -o -,txt)+ set_tests_properties(reshade_settings_contracts PROPERTIES+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"+ ENVIRONMENT "VE_APP_ROOT=${VE_WORKSPACE_ROOT}/Visual Enhancer"+ ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${VE_QT_RUNTIME_ROOT}/bin"+ TIMEOUT 45)add_executable(ve_dlss_rr_delivery_smoke "${VE_TEST_ROOT}/dlss_rr_delivery_smoke.cpp")target_link_libraries(ve_dlss_rr_delivery_smoke PRIVATE ve_core Qt6::Test)add_executable(ve_dlss_rr_initialization_smoke "${VE_TEST_ROOT}/dlss_rr_initialization_smoke.cpp")@@ -197,6 +243,14 @@ if(BUILD_TESTING)set_tests_properties(process_stream_contracts PROPERTIESENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${VE_QT_RUNTIME_ROOT}/bin"TIMEOUT 45)+ add_executable(ve_video_metadata_tests "${VE_TEST_ROOT}/video_metadata_tests.cpp")+ target_link_libraries(ve_video_metadata_tests PRIVATE ve_core Qt6::Test)+ target_compile_options(ve_video_metadata_tests PRIVATE /utf-8)+ add_test(NAME video_metadata_contracts COMMAND $<TARGET_FILE:ve_video_metadata_tests> -o -,txt)+ set_tests_properties(video_metadata_contracts PROPERTIES+ ENVIRONMENT "VE_APP_ROOT=${VE_WORKSPACE_ROOT}/Visual Enhancer"+ ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${VE_QT_RUNTIME_ROOT}/bin"+ TIMEOUT 60)add_executable(ve_cli_cancel_probe "${VE_TEST_ROOT}/cli_cancel_probe.cpp")set_target_properties(ve_cli_cancel_probe PROPERTIES AUTOMOC OFF AUTORCC OFF)target_compile_definitions(ve_cli_cancel_probe PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN UNICODE _UNICODE)@@ -205,7 +259,7 @@ if(BUILD_TESTING)add_test(NAME processing_cache_contracts COMMAND $<TARGET_FILE:ve_processing_cache_tests> -o -,txt)add_test(NAME resolution_contracts COMMAND $<TARGET_FILE:ve_resolution_tests> -o -,txt)add_test(NAME translation_contracts COMMAND $<TARGET_FILE:ve_translation_tests> -o -,txt)- set_tests_properties(storage_contracts processing_cache_contracts translation_contracts resolution_contracts PROPERTIES+ set_tests_properties(storage_contracts processing_cache_contracts translation_contracts resolution_contracts temporal_cadence_contracts fsr_settings_contracts frame_generation_settings_contracts PROPERTIESWORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"ENVIRONMENT "QT_QPA_PLATFORM=offscreen;QT_PLUGIN_PATH=${VE_QT_RUNTIME_ROOT}/plugins"ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${VE_QT_RUNTIME_ROOT}/bin"diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICESindex 5dd3e39..f8e898c 100644--- a/THIRD-PARTY-NOTICES+++ b/THIRD-PARTY-NOTICES@@ -9,7 +9,7 @@ copyright, license, redistribution requirements, and notices.SCOPE-This file describes the current Visual Enhancer 17.0.0.0 C++ application,+This file describes the current Visual Enhancer C++ application,its third-party source and headers, and the runtimes used in its Windowsrelease packages. The application no longer uses the previous embeddedPython/PySide package, mpv, yt-dlp, or Python package wrappers.@@ -24,15 +24,12 @@ Native SDKs and engine development files are maintained separately andare not included in the application source upload.This file names each component, its known licensing, where it is shipped,-and where to read its version and available license text. Re-audit this-notice when a component or runtime version changes; bundled dependencies-and their terms can change between builds.+and where to read its license text and attribution records. Re-audit this+notice when bundled components change; their terms can differ between builds.-"Version:" lines identify the checked source/build version or the-authoritative version record: source headers, DLL version resources,-runtime-manifest.json, Qt SPDX inventories, or a tool's -version output.-Headers, command-line tools, Qt media libraries, and other media DLLs may-come from different upstream releases.+Software release numbers are omitted. License identifiers, copyright dates,+and identifying parts of product names and original filenames are retained.+An asterisk in a path matches a build-specific directory or filename suffix.Source trees, license texts, attribution inventories, and upstream URLsare not by themselves a declaration that every corresponding-source or@@ -71,18 +68,10 @@ Full texts in release packages:bin/runtime/dlssnr/LICENSE-NVIDIA-DLSS.txtbin/runtime/rtx_video/NVIDIA_RTX_Video_SDK_License.pdf-Version: checked shipped DLL version resources:- nvngx_dlss.dll (Super Resolution): 310.9.16.0- nvngx_dlssd.dll (Ray Reconstruction): 310.9.16.0- nvngx_dlssg.dll (Frame Generation): 310.9.16.0- nvngx_dlssnr.dll (Neural Rendering): 310.8.SF.0- nvngx_vsr.dll: 1.8.3.0; nvngx_truehdr.dll: 1.2.3.0--The SR, RR and FG release DLLs match NVIDIA's DLSS 310.9.16 SDK release:-https://github.com/NVIDIA/DLSS/commit/9981c6350dc58c0ce21f024fd65e31e851c31689-Matching NGX VSR and TrueHDR plugins are selected from the VFX 1.3 SDK-when packaging the current runtime. Governing SDK license records remain-applicable independently of the DLL version numbers.+Upstream DLSS SDK: https://github.com/NVIDIA/DLSS.+Matching NGX VSR and TrueHDR plugins are selected from the Video Effects SDK+when packaging the runtime. The governing SDK license records remain+applicable to each distributed component.Used through src/processing/native_engines.cpp and the native engineinterfaces. Ray Reconstruction uses nvngx_dlssd.dll at native resolution@@ -91,12 +80,12 @@ and is listed in section 8, separately from NVIDIA's runtime.RTX Video HDR still uses nvngx_truehdr.dll; removing theseparate VFX TrueHDR effect does not remove this RTX Video dependency.-NVIDIA Optical Flow SDK 5.0.7 headers are used by the native SR, RR,+NVIDIA Optical Flow SDK headers are used by the native SR, RR,Neural Rendering and Frame Generation video paths. The Optical Flow APIis loaded from the installed NVIDIA driver's nvofapi64.dll in WindowsSystem32; that driver DLL is not redistributed in this package.The SDK retains its NVIDIA license; the development copy's agreement is-native (dev)/external/Optical_Flow_SDK_5.0.7/LicenseAgreement.pdf.+native (dev)/external/Optical_Flow_SDK_*/LicenseAgreement.pdf.NVIDIA, GeForce, RTX, DLSS, and related marks are trademarks of NVIDIACorporation. No sponsorship or endorsement is implied.@@ -117,19 +106,21 @@ Source headers:License: FFmpeg licensing depends on the build. Its baseline isLGPL-2.1-or-later; optional GPL components change the applicable terms.-The command-line build checked for this release is FFmpeg 9.0.2 and-enables GPL/version-3 components, including x264/x265. The separately-loaded AV runtime also includes codec DLLs with their own GPL and-permissive terms. Do not treat every FFmpeg binary as LGPL-only.+The command-line build enables GPLv3 components, including x264/x265.+The separately loaded AV runtime is Gyan's full shared build, with GPL-enabled+codec components. Its source version, archive URL and checksums are recorded in+bin/runtime/av/source-manifest.json. Do not treat every FFmpeg binary as LGPL-only.-The Qt-supplied FFmpeg libraries are a separate build. The Qt 6.12.0-Multimedia SPDX inventory identifies its FFmpeg component as 9.0.1 and-records LGPL-2.1-or-later together with its additional component licenses.+The Qt-supplied FFmpeg libraries are a separate build. The Qt Multimedia+SPDX inventory records LGPL-2.1-or-later together with the licenses of its+incorporated components.Full texts / attribution records:bin/ffmpeg/LICENSE+ bin/licenses/FFMPEG-SHARED-LICENSE.txt+ bin/licenses/FFMPEG-SHARED-BUILD.txtbin/licenses/- bin/licenses/qt/qtmultimedia-6.12.0.spdx.json+ bin/licenses/qt/qtmultimedia-*.spdx.jsonthird_party/ffmpeg/COPYING.LGPLv2.1 (source/header license)The static command-line tools also incorporate external components.@@ -137,8 +128,6 @@ For example, the GPU filter path uses libplacebo (LGPL-2.1-or-later).Their individual notices and the exact build configuration remainapplicable in addition to the FFmpeg license.-Version: run bin/ffmpeg/bin/ffmpeg.exe -version and -buildconf;-inspect the separate media DLL versions and Qt SPDX inventory.The FFmpeg headers in this repository are not a complete correspondingsource distribution for every shipped FFmpeg binary.@@ -154,7 +143,7 @@ Copyright (c) NVIDIA Corporation and affiliates.Shipped as:bin/runtime/vfx/bin/NVVideoEffects.dllbin/runtime/vfx/bin/NVCVImage.dll- bin/runtime/vfx/bin/cudart64_12.dll+ bin/runtime/vfx/bin/cudart64_*.dllbin/runtime/vfx/bin/nvngxruntime.dllbin/runtime/vfx/features/nvvfxvideosuperres/bin/nvVFXVideoSuperRes.dllbin/runtime/vfx/features/nvvfxvideosuperres/bin/nvngx_vsr.dll@@ -162,19 +151,18 @@ Shipped as:bin/runtime/vfx/features/nvvfxupscale/bin/nvVFXUpscale.dllLicense: the NVIDIA software license and product-specific terms supplied-with Video Effects SDK 1.3.0.0, together with applicable third-party+with the Video Effects SDK, together with applicable third-partynotices. The CUDA runtime retains its NVIDIA license terms.Full texts / notices in release packages:bin/runtime/vfx/bin/ThirdPartyLicenses.txt- bin/runtime/vfx/license/NVIDIA-Software-License-Agreement-2025.05.05.pdf- bin/runtime/vfx/license/product-specific-terms-for-nvidia-ai-products-2025.05.05.pdf- bin/runtime/vfx/license/NVIDIA-Open-Model-License-Agreements-24-10-2025.pdf+ bin/runtime/vfx/license/NVIDIA-Software-License-Agreement-*.pdf+ bin/runtime/vfx/license/product-specific-terms-for-nvidia-ai-products-*.pdf+ bin/runtime/vfx/license/NVIDIA-Open-Model-License-Agreements-*.pdfThe SDK's license directory is retained with the runtime. Its inclusiondoes not mean every optional SDK component or model is distributed.-Version: VFX SDK 1.3.0.0; CUDA runtime DLL family 12.See bin/runtime/vfx/runtime-manifest.json for the selected featurelibraries, ABI, file sizes and hashes.@@ -191,7 +179,7 @@ Copyright (C) 2008-2025 LibRaw LLC and the contributors identified inits COPYRIGHT file and individual sources.Source:- third_party/LibRaw-0.22.2/+ third_party/LibRaw-*/Shipped as:a statically linked library in Visual Enhancer.exe@@ -204,12 +192,11 @@ static-library build. LibRaw's dual licensing does not relicense theMerserk-owned application code.Full texts / notices:- third_party/LibRaw-0.22.2/LICENSE.LGPL- third_party/LibRaw-0.22.2/LICENSE.CDDL- third_party/LibRaw-0.22.2/COPYRIGHT+ third_party/LibRaw-*/LICENSE.LGPL+ third_party/LibRaw-*/LICENSE.CDDL+ third_party/LibRaw-*/COPYRIGHTbin/licenses/ (release attribution/license collection)-Version: 0.22.2; see libraw/libraw_version.h.Used by src/media/image_codecs.cpp for RAW image decoding.The previous rawpy Python wrapper is not a runtime dependency.@@ -221,7 +208,7 @@ See https://www.libraw.org/about.a) libjpeg-turbo- Source: third_party/libjpeg-turbo-3.1.3/+ Source: third_party/libjpeg-turbo-*/Shipped as: the statically linked jpeg-static library used by theapplication and LibRaw; no TurboJPEG API library is built.@@ -230,21 +217,20 @@ a) libjpeg-turbosource files retain their notices.Full texts:- third_party/libjpeg-turbo-3.1.3/LICENSE.md- third_party/libjpeg-turbo-3.1.3/README.ijg+ third_party/libjpeg-turbo-*/LICENSE.md+ third_party/libjpeg-turbo-*/README.ijg- Version: 3.1.3; the application build disables SIMD and TurboJPEG.+ The application build disables SIMD and TurboJPEG.Used for JPEG image processing and LibRaw's JPEG support.b) zlibCopyright (C) 1995-2026 Jean-loup Gailly and Mark Adler.- Source: third_party/zlib-1.3.2/+ Source: third_party/zlib-*/Shipped as: the statically linked zlibstatic library.License: zlib license. Preserve its copyright and license notices.- Full text: third_party/zlib-1.3.2/LICENSE.- Version: 1.3.2; see zlib.h.+ Full text: third_party/zlib-*/LICENSE.Used for compression, PNG output and LibRaw's compressed data.Release packages retain the applicable texts in bin/licenses/.@@ -258,7 +244,7 @@ Copyright The Qt Company Ltd. and the contributors identified by theindividual module licenses and Qt SPDX attribution inventories.Shipped as:- Qt6*.dll+ Qt*.dllqml/ (runtime QML imports and plugins)platforms/, imageformats/, iconengines/, multimedia/networkinformation/, tls/, generic/, translations/@@ -278,12 +264,12 @@ Full open-source license texts / attribution records:bin/licenses/GPL-3.0.txtbin/licenses/GPL-2.0.txtbin/licenses/qt/- qtbase-6.12.0.spdx.json- qtdeclarative-6.12.0.spdx.json- qtimageformats-6.12.0.spdx.json- qtmultimedia-6.12.0.spdx.json- qtshadertools-6.12.0.spdx.json- qtsvg-6.12.0.spdx.json+ qtbase-*.spdx.json+ qtdeclarative-*.spdx.json+ qtimageformats-*.spdx.json+ qtmultimedia-*.spdx.json+ qtshadertools-*.spdx.json+ qtsvg-*.spdx.jsonFor LGPL distributions, users may replace the dynamically loaded Qtlibraries with compatible modified versions and debug those modifications.@@ -291,14 +277,13 @@ The Merserk Source License does not restrict those third-party rights.A compatible Qt kit can be selected with -QtRoot when rebuilding anddeploying; see build.ps1, tools/deploy.ps1, and CMakeLists.txt.-Version: Qt 6.12.0 in the checked release; the build accepts Qt 6.12.x-MSVC x64 kits. DLL resources and the kit's SPDX files identify the exact-versions and licenses. PySide6 and shiboken6 are no longer used.+The application uses an MSVC x64 Qt kit. The Qt SPDX files retain the+module copyright and licensing records. PySide and shiboken are no longer used.Used by the C++ desktop and CLI services and src/desktop/qml/, includingQtQuick, Controls, Layouts, Dialogs, QtMultimedia and SVG image support.-See https://doc.qt.io/qt-6/licensing.html and+See https://doc.qt.io/qt/licensing.html andhttps://doc.qt.io/qt-6/licenses-used-in-qt.html.===============================================================================@@ -325,9 +310,8 @@ a) libheif, libde265 and x265Texts: bin/licenses/ and the original codec-library license texts.The libheif source headers retain their LGPL notices.- Version: the checked libheif headers identify 1.19.7; runtime DLL- versions must be read separately. Used by src/media/image_codecs.cpp- for HEIF/HEIC decoding. The pillow-heif wrapper is not shipped.+ Used by src/media/image_codecs.cpp for HEIF/HEIC decoding.+ The pillow-heif wrapper is not shipped.See https://github.com/strukturag/libheif,https://github.com/strukturag/libde265, and https://www.videolan.org/developers/x265.html.@@ -335,12 +319,14 @@ a) libheif, libde265 and x265b) MinGW runtime and additional AV codec librariesShipped as dependent DLLs in:- bin/runtime/av/bin/runtime/image-codecs/- These include libgcc_s_seh, libstdc++, libwinpthread and AV codec- dependencies such as dav1d, LAME, Opus, SVT-AV1, libvpx, libwebp,- x264 and x265. Their original licenses remain applicable.+ These include libgcc_s_seh, libstdc++ and libwinpthread. The shared+ FFmpeg media libraries in bin/runtime/av/ and the command-line tools+ also incorporate codec dependencies such as dav1d, LAME, Opus,+ SVT-AV1, libvpx, libwebp, x264 and x265. These are not separate DLLs+ in the current AV runtime directory. Their original licenses remain+ applicable; the exact build configuration is recorded in section 2.libgcc/libstdc++ use their GPL terms with the applicable GCC RuntimeLibrary Exception; libwinpthread and other dependencies retain the@@ -348,7 +334,6 @@ b) MinGW runtime and additional AV codec librariesThe exception does not relicense other GPL codec libraries.Texts: bin/licenses/ and the originating runtime license records.- Version: inspect the individual DLL/build records.The C++ application does not import PyAV, Pillow, NumPy, OpenCV,rawpy, pillow-heif, resvg_py, tifffile or pip.@@ -361,7 +346,6 @@ c) Khronos Vulkan and Vulkan Video headersCopyright The Khronos Group Inc. and contributors.License: Apache-2.0 and/or MIT, as specified by each file.Full text: third_party/vulkan/LICENSE.md and individual header notices.- Version: see the generated header version macros.Used to describe Vulkan APIs and codec structures; graphics driversare provided by the system.@@ -373,25 +357,23 @@ d) Qt-supplied helpers and incorporated third-party codeConsult the Qt SPDX inventories and bin/licenses/qt/ forattribution; the Qt license does not replace those upstream terms.-e) libavif command-line decoder+e) libavif command-line toolsCopyright 2019 Joe Drago and the contributors identified in LICENSE.- Shipped as: bin/avif/avifdec.exe.+ Shipped as: bin/avif/avifdec.exe and bin/avif/avifenc.exe.License: BSD-2-Clause for libavif, with the incorporated-source noticesretained in bin/avif/LICENSE. Codec dependencies retain their own terms.This product includes software developed by the Independent JPEG Group.- Version: libavif 1.4.2; the checked decoder reports dav1d 1.5.3,- aom 3.14.1 and libyuv 1924. Run bin/avif/avifdec.exe --version for- the exact linked codec build identifiers.- Used for AVIF image decoding and conversion.+ The decoder incorporates dav1d, aom and libyuv; their original notices+ and license terms remain applicable.+ Used for AVIF image decoding, encoding and conversion.f) Exiv2 metadata toolsShipped as: bin/exiv2/exiv2.exe and bin/exiv2/exiv2.dll.License: GPL-2.0-or-later, as stated by the tool's -V output.Full text: bin/exiv2/COPYING; retain the original Exiv2 notices.- Version: Exiv2 0.28.9; run bin/exiv2/exiv2.exe -V.Used by src/media/image_metadata.cpp for image metadata handling.===============================================================================@@ -404,11 +386,16 @@ for their terms in third-party license texts:Visual Enhancer.exe and VE_CLI.exe (desktop and CLI applications)neuroframe_engine_frame_interpolation.dll+ neuroframe_engine_fsr_frame_generation.dllneuroframe_engine_neural_rendering.dllneuroframe_engine_ray_reconstruction.dll+ neuroframe_engine_reshade.dllneuroframe_engine_super_resolution.dllneuroframe_engine_upscaling.dllneuroframe_engine_video_effects.dll+ ve_reshade_runtime.dll (Merserk headless runtime wrapper around+ third-party ReShade and its incorporated helpers; their original+ licenses remain applicable as described in section 11)Merserk-owned application code and resources under src/Merserk-owned build and packaging scripts under tools/@@ -429,7 +416,7 @@ replaced, or relicensed merely because it sits inside this package.9. AMD FIDELITYFX CONTRAST ADAPTIVE SHARPENING===============================================================================-The CAS sharpen-only algorithm is adapted from FidelityFX SDK 1.1.4,+The CAS sharpen-only algorithm is adapted from the FidelityFX SDK,Copyright (C) 2024 Advanced Micro Devices, Inc.License: MIT-style FidelityFX SDK license. The complete permission and@@ -447,7 +434,7 @@ used by the image and video Sharpening stage.===============================================================================The sharpening-only NVSharpen algorithm is adapted from NVIDIA Image-Scaling SDK 1.0.3, Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.+Scaling SDK, Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.The NIS scaling algorithm is not used by this adaptation.License: MIT. The complete text is in src/desktop/NVIDIA-NIS-LICENSE.txt,@@ -460,7 +447,141 @@ replaces the earlier Python/CPU adaptation and is used by the image andvideo Sharpening stage.===============================================================================-11. SYSTEM COMPONENTS, TRADEMARKS, NO ENDORSEMENT+11. RESHADE RUNTIME, AMD FIDELITYFX OPTICAL FLOW, ONNX RUNTIME & DEPTH MODEL+===============================================================================++a) ReShade (D3D12 effect runtime and ReShadeFX compiler)++ Copyright (C) 2014 Patrick Mours. All rights reserved.+ Shipped as: source-built headless D3D12 runtime in+ bin/runtime/reshade/ve_reshade_runtime.dll+ License: BSD-3-Clause.+ Full text: bin/runtime/reshade/license/ReShade-LICENSE.md.+ See https://github.com/crosire/reshade.++ The native runtime also incorporates fpng, JPEG XL simple_lossless, stb,+ utfcpp and SPIR-V headers from the ReShade source tree. Their individual+ license files and source-header notices retain their own terms. The source+ repositories are identified in:+ native (dev)/modules/reshade/dependencies.lock.json++b) AMD FidelityFX Optical Flow++ Copyright (C) 2024 Advanced Micro Devices, Inc.+ Shipped as: compiled DXIL shaders and static D3D12 optical-flow backend in+ bin/runtime/reshade/neuroframe_engine_reshade.dll+ License: MIT-style FidelityFX SDK license.+ Full text: bin/runtime/reshade/license/AMD-FidelityFX-OpticalFlow-LICENSE.txt.+ ReShade uses this AMD backend for video motion estimation and temporal+ depth stabilization across supported GPUs. The separate FSR Frame+ Generation backend is described in section 12.++c) Microsoft ONNX Runtime, DirectML and graphics helpers++ Copyright (c) Microsoft Corporation.+ Shipped as:+ bin/runtime/reshade/onnxruntime.dll+ bin/runtime/reshade/onnxruntime_providers_shared.dll+ bin/runtime/reshade/DirectML.dll+ bin/runtime/reshade/WinPixEventRuntime.dll+ bin/runtime/reshade/dxcompiler.dll+ bin/runtime/reshade/dxil.dll+ License: MIT (ONNX Runtime) and Microsoft DirectML redistributable terms.+ The DirectX Shader Compiler and DXIL validator retain their Microsoft,+ MIT and LLVM/University of Illinois license records. WinPixEventRuntime+ retains the Microsoft PIX distribution terms applicable to its build.+ Full texts / attribution records:+ bin/runtime/reshade/license/ONNXRuntime-LICENSE.txt+ bin/runtime/reshade/license/DirectML-LICENSE.txt+ native (dev)/external/ReShadeDependencies/onnxruntime-directml/ThirdPartyNotices.txt (build inputs)+ native (dev)/external/FidelityFX-SDK-*/sdk/tools/ffx_shader_compiler/libs/dxc/LICENSE-MS.txt+ native (dev)/external/FidelityFX-SDK-*/sdk/tools/ffx_shader_compiler/libs/dxc/LICENSE-MIT.txt+ native (dev)/external/FidelityFX-SDK-*/sdk/tools/ffx_shader_compiler/libs/dxc/LICENSE-LLVM.txt+ See https://github.com/microsoft/onnxruntime,+ https://github.com/microsoft/DirectXShaderCompiler and+ https://github.com/microsoft/PixEvents.++d) MoGe-2 ViT-S ONNX Model++ Source: https://huggingface.co/Ruicheng/moge-2-vits-normal-onnx.+ Copyright (c) Microsoft Corporation.+ Shipped as:+ bin/runtime/reshade/models/moge-2-vits/model.onnx+ License: MIT for MoGe and its ViT-S model weights. Incorporated DINOv2+ code retains its Apache-2.0 notices.+ Full texts / attribution records:+ bin/runtime/reshade/license/MoGe-LICENSE.txt+ bin/runtime/reshade/license/MoGe-NOTICE.txt+ See https://github.com/microsoft/MoGe and+ https://huggingface.co/Ruicheng/moge-2-vits-normal.+ The adapted graph removes unused normals and metric-scale branches,+ derives the token count from the input patch grid, and extracts relative+ depth and the original validity mask. Retained learned weights are+ unchanged. The validity mask is not calibrated uncertainty.+ The installed depth inference path uses native C++ ONNX Runtime and DirectML;+ Python and PyTorch are not runtime dependencies for this path.++e) Bundled ReShade Shaders and Presets++ Shipped in:+ bin/runtime/reshade/reshade-shaders/+ bin/runtime/reshade/presets/FDVanilla/+ Includes the FDVanilla preset (Krzysztof-Bogunia/FDVanilla_Reshade) and its+ shaders, shared ReShade include files, textures and LUT. Optional user+ shader folders retain the notices of their respective authors.+ License: MIT for the bundled FDVanilla preset; each shader, include file+ and asset retains its original header notices and repository terms.+ Full texts:+ bin/runtime/reshade/license/FDVanilla-LICENSE.txt+ bin/runtime/reshade/license/SweetFX-LICENSE.txt+ See https://github.com/Krzysztof-Bogunia/FDVanilla_Reshade and+ https://github.com/crosire/reshade-shaders. RTGI shaders are not included.++===============================================================================+12. AMD FSR FRAME GENERATION AND DIRECTX VIDEO ENCODING+===============================================================================++AMD FSR Frame Generation uses the AMD FidelityFX DirectX 12 effect runtime.+The engine also incorporates AMD FidelityFX Optical Flow source. Pure FSR+workflows use DirectX resources and AMD optical flow; they do not require+CUDA or NVIDIA Optical Flow.++Shipped as:+ bin/runtime/fsrfg/amd_fidelityfx_framegeneration_dx12.dll+ bin/runtime/fsrfg/WinPixEventRuntime.dll++Copyright (C) Advanced Micro Devices, Inc.+Copyright (c) Microsoft Corporation.++License: the AMD effect runtime is subject to the redistribution terms in+LICENSE-AMD-FSR.md, including binary-only redistribution and restrictions on+reverse engineering, decompilation and disassembly. The AMD API source files+identified as exceptions in that license, the incorporated AMD FidelityFX+Optical Flow source and the Microsoft PIX event runtime retain their+respective MIT license terms.++The vendor runtime is distributed unchanged. Provider selection, source+inventories and binary checksums are recorded in:+ bin/runtime/fsrfg/runtime-manifest.json+ bin/runtime/fsrfg/sdk-api-source-manifest.json++Full texts:+ bin/runtime/fsrfg/LICENSE-AMD-FSR.md+ bin/runtime/fsrfg/LICENSE-AMD-OPTICAL-FLOW.txt+ bin/runtime/fsrfg/LICENSE-PIX.txt++Source: https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK and+https://www.nuget.org/packages/WinPixEventRuntime.++NVIDIA's DirectX video encoder is called through nvEncodeAPI64.dll from the+installed Windows driver. That driver is not redistributed. The API header+retains its NVIDIA MIT license in bin/licenses/NVENC-HEADERS-LICENSE.txt.+AMD AMF encoding uses the installed AMD driver through FFmpeg's AMF interface.+See https://docs.nvidia.com/video-technologies/video-codec-sdk/ and+https://github.com/GPUOpen-LibrariesAndSDKs/AMF.++===============================================================================+13. SYSTEM COMPONENTS, TRADEMARKS, NO ENDORSEMENT===============================================================================The app calls Microsoft Windows, Direct3D, Vulkan and NVIDIA CUDA driver@@ -482,11 +603,11 @@ Redistribution information:https://learn.microsoft.com/cpp/windows/redistributing-visual-cpp-filesThird-party names and marks (including AMD, FidelityFX, NVIDIA, DLSS, RTX,-GeForce, FFmpeg, Qt, LibRaw, and others) are the property of their respective-owners and are used only to identify compatible or incorporated technology.-Inclusion does not imply sponsorship, endorsement, certification, or-partnership unless expressly stated by that party. Visual Enhancer is-developed independently by Merserk.+GeForce, ReShade, ONNX Runtime, DirectML, FFmpeg, Qt, LibRaw, and others)+are the property of their respective owners and are used only to identify+compatible or incorporated technology. Inclusion does not imply sponsorship,+endorsement, certification, or partnership unless expressly stated by that+party. Visual Enhancer is developed independently by Merserk.===============================================================================END OF THIRD-PARTY NOTICESdiff --git a/build.ps1 b/build.ps1index 0a277e6..e60d60c 100644--- a/build.ps1+++ b/build.ps1@@ -8,6 +8,7 @@ param([string]$Destination,[string]$NativeBuildRoot,[string]$RuntimeSource,+ [string]$MediaRuntimeSource,[switch]$RebuildNative,[string]$CertificateThumbprint,[string]$TimestampServer = 'http://timestamp.digicert.com',@@ -22,10 +23,11 @@ $ErrorActionPreference = 'Stop'$resolvedQt = Resolve-VeQtRoot $QtRoot$resolvedBuild = Resolve-VePath $BuildDir $PSScriptRoot$generator = Get-VeVisualStudioGenerator+Invoke-VeCommand 'python' @((Join-Path $PSScriptRoot 'tools/prepare-nvenc-headers.py'))if ($RebuildNative) {$nativeRoot = Join-Path (Split-Path -Parent $PSScriptRoot) 'native (dev)'$nativeShell = (Get-Process -Id $PID).Path- foreach ($feature in @('neural_rendering', 'super_resolution', 'ray_reconstruction', 'frame_interpolation', 'rtx_video', 'video_effects')) {+ foreach ($feature in @('neural_rendering', 'super_resolution', 'ray_reconstruction', 'frame_interpolation', 'fsr_frame_generation', 'rtx_video', 'video_effects', 'reshade')) {Invoke-VeCommand $nativeShell @('-NoProfile', '-File', (Join-Path $nativeRoot "modules/$feature/build_bridge.ps1"), '-NoDeploy')}$NativeBuildRoot = Join-Path $nativeRoot 'modules'@@ -45,7 +47,7 @@ if ($Test) {if ($Deploy) {& (Join-Path $PSScriptRoot 'tools/deploy.ps1') -BuildDir $resolvedBuild -QtRoot $resolvedQt `-Configuration $Configuration -Destination $Destination -NativeBuildRoot $NativeBuildRoot `- -RuntimeSource $RuntimeSource `+ -RuntimeSource $RuntimeSource -MediaRuntimeSource $MediaRuntimeSource `-CertificateThumbprint $CertificateThumbprint `-TimestampServer $TimestampServer -MachineCertificateStore:$MachineCertificateStore `-RequireSignatures:$RequireSignatures -ScanDefender:$ScanDefender -OutputDirectory $OutputDirectory -StageOnly:$StageOnlydiff --git a/src/application/choices.hpp b/src/application/choices.hppindex 3cbdce9..e42b613 100644--- a/src/application/choices.hpp+++ b/src/application/choices.hpp@@ -42,9 +42,9 @@ inline std::optional<QVariant> staticChoices(Property property) {case Property::dlssPresetChoices:return QJsonDocument::fromJson(R"json(["Default","J","K","L","M"])json").array().toVariantList();case Property::upscaleEngineChoices:- return QJsonDocument::fromJson(R"json(["RTX Video Super Resolution","DLSS"])json")- .array()- .toVariantList();+ return QVariantList{QVariantMap{{"label", QCoreApplication::translate("App", "RTX Video Super Resolution")},+ {"value", "RTX Video Super Resolution"}},+ QVariantMap{{"label", "DLSS"}, {"value", "DLSS"}}};case Property::imageFormatChoices:return QJsonDocument::fromJson(R"json(["PNG","JPEG","WebP","AVIF","TIFF"])json").array()@@ -64,15 +64,18 @@ inline std::optional<QVariant> staticChoices(Property property) {.toVariantList();case Property::renameModeChoices:return QJsonDocument::fromJson(R"json(["Auto","Copy","Custom"])json").array().toVariantList();- case Property::fiFpsChoices:- return QJsonDocument::fromJson(- R"json([{"label":"23.976 FPS","value":"23.976"},{"label":"25 FPS","value":"25"},{"label":"29.97 FPS","value":"29.97"},{"label":"30 FPS","value":"30"},{"label":"50 FPS","value":"50"},{"label":"59.94 FPS","value":"59.94"},{"label":"60 FPS","value":"60"},{"label":"90 FPS","value":"90"},{"label":"119.88 FPS","value":"119.88"},{"label":"120 FPS","value":"120"},{"label":"144 FPS","value":"144"},{"label":"165 FPS","value":"165"},{"label":"180 FPS","value":"180"},{"label":"240 FPS","value":"240"},{"label":"360 FPS","value":"360"},{"label":"480 FPS","value":"480"}])json")- .array()- .toVariantList();- case Property::fiEngineChoices:- return QJsonDocument::fromJson(R"json(["Auto","Native DLSSG","Cascade"])json")- .array()- .toVariantList();+ case Property::fiFpsChoices: {+ QVariantList choices;+ for (const auto* fps : {"23.976", "25", "29.97", "30", "50", "59.94", "60", "90",+ "119.88", "120", "144", "165", "180", "240", "360", "480"}) {+ const auto value = QString::fromLatin1(fps);+ choices.append(QVariantMap{{"label", QCoreApplication::translate("App", "%1 FPS").arg(value)},+ {"value", value}});+ }+ return choices;+ }+ case Property::fiProviderChoices:+ return QVariantList{QVariantMap{{"label","DLSS"},{"value","DLSS"}},QVariantMap{{"label","AMD FSR 3"},{"value","FSR 3"}}};case Property::fiPreviewLengthChoices:case Property::upscalePreviewLengthChoices:case Property::nrPreviewLengthChoices: {diff --git a/src/application/controller.cpp b/src/application/controller.cppindex 97ff94c..fd9b707 100644--- a/src/application/controller.cpp+++ b/src/application/controller.cpp@@ -3,8 +3,12 @@#include "infrastructure/log.hpp"#include "infrastructure/paths.hpp"#include "infrastructure/vulkan_device.hpp"+#include "processing/reshade_native.hpp"+#include "processing/reshade_dependencies.hpp"+#include "processing/reshade_worker.hpp"#include "processing/vfx_native.hpp"#include "processing/vfx_worker.hpp"+#include "processing/fsr_worker.hpp"#include <QClipboard>#include <QCoreApplication>#include <QDateTime>@@ -15,10 +19,12 @@#include <QFileInfo>#include <QFont>#include <QGuiApplication>+#include <QFutureWatcher>#include <QLibraryInfo>#include <QLocale>#include <QtConcurrent/QtConcurrentRun>#include <algorithm>+#include <mutex>#include <ranges>namespace ve {@@ -35,7 +41,87 @@ QVariantList labeled(const QStringList& values, const QString& suffix = {}) {result.append(QVariantMap{{"label", value + suffix}, {"value", value}});return result;}+struct CachedReShadePreset {+ std::mutex mutex;+ QString key;+ QVariantMap raw;+};+CachedReShadePreset& reshadePresetCache() {+ static CachedReShadePreset cache;+ return cache;+}+QVariantMap inspectCachedReShadePreset(const Settings& raw, bool video) {+ const auto rs = reshadeSettingsForMode(raw, video);+ if (rs.reshade_preset_path.trimmed().isEmpty()) {+ return ReShadeEngine::inspectPreset(raw, video);+ }+ const QString cacheKey = QString::fromLatin1(reshadeDependencyIdentity(raw, video, Paths::instance().root).toHex()) + '|' ++ rs.reshade_shader_search_paths + '|' + rs.reshade_texture_search_paths + '|' ++ rs.reshade_parameter_overrides + '|' + rs.ai_gpu_uuid;+ auto& cache = reshadePresetCache();+ {+ std::lock_guard lock(cache.mutex);+ if (cache.key == cacheKey)+ return cache.raw;+ }+ auto inspected = ReShadeEngine::inspectPreset(raw, video);+ {+ std::lock_guard lock(cache.mutex);+ cache.key = cacheKey;+ cache.raw = inspected;+ }+ return inspected;+}} // namespace+void invalidateReShadePresetCache() {+ auto& cache = reshadePresetCache();+ std::lock_guard lock(cache.mutex);+ cache.key.clear();+}+void AppController::requestReShadeInspection() {+ if (shuttingDown_) return;+ auto snapshot = reshadeSettingsForMode(settings_, nrMode_ == "Video");+ snapshot.reshade_parameter_overrides = reshadeGraphOverrides(snapshot.reshade_parameter_overrides);+ const QFileInfo preset(snapshot.reshade_preset_path);+ const QString key = nrMode_ + '|' + preset.absoluteFilePath() + '|' ++ QString::number(preset.lastModified().toMSecsSinceEpoch()) + '|' ++ snapshot.reshade_shader_search_paths + '|' + snapshot.reshade_texture_search_paths + '|' ++ snapshot.reshade_parameter_overrides + '|' + snapshot.ai_gpu_uuid + '|' + QString::number(reshadeReloadGeneration_);+ reshadeRequestedKey_ = key;+ if (reshadeLoadedKey_ == key || reshadeInspectionBusy_) return;+ reshadeInspectionBusy_ = true;+ auto* watcher = new QFutureWatcher<QVariantMap>(this);+ connect(watcher, &QFutureWatcher<QVariantMap>::finished, this, [this, watcher, key] {+ const auto result = watcher->result();+ watcher->deleteLater();+ reshadeInspectionBusy_ = false;+ if (shuttingDown_) return;+ if (key == reshadeRequestedKey_) {+ reshadeInspection_ = result;+ reshadeLoadedKey_ = key;+ }+ requestReShadeInspection(); // Coalesce changes made while the worker was compiling.+ emit reshadePresetInfoChanged();+ emit reshadeStatusChanged();+ });+ watcher->setFuture(QtConcurrent::run(&reshadeInspectionPool_, [snapshot] {+ try {+ // Uniform overrides are overlaid by the editors. Only graph changes+ // require recompilation, preserving the imported preset baseline.+ return inspectCachedReShadePreset(snapshot, true);+ } catch (const std::exception& e) {+ return QVariantMap{{"valid", false}, {"error", QString::fromUtf8(e.what())}};+ }+ }));+ // Getters can start inspection too. Notify on the next event turn to avoid+ // changing a QML binding while it is being evaluated.+ QMetaObject::invokeMethod(this, [this] {+ if (!shuttingDown_) {+ emit reshadePresetInfoChanged();+ emit reshadeStatusChanged();+ }+ }, Qt::QueuedConnection);+}AppController::AppController(PreviewProvider* previews, QObject* parent): QmlFacade(parent), previews_(previews),settings_(Settings::load(Paths::instance().configurationFile())),@@ -45,6 +131,7 @@ AppController::AppController(PreviewProvider* previews, QObject* parent)pool_.setMaxThreadCount(3);previewPool_.setMaxThreadCount(1);cachePool_.setMaxThreadCount(1);+ reshadeInspectionPool_.setMaxThreadCount(1);cacheTrimTimer_.setSingleShot(true);cacheTrimTimer_.setInterval(100);connect(&cacheTrimTimer_, &QTimer::timeout, this, &AppController::cleanupCaches);@@ -112,6 +199,7 @@ AppController::~AppController() {release.waitForFinished();previewPool_.waitForDone();pool_.waitForDone();+ reshadeInspectionPool_.waitForDone();info("shutdown", QString("Processing workers stopped in %1 ms.").arg(elapsed.elapsed()));}void AppController::attachWindow(QQuickWindow* window) {@@ -142,6 +230,11 @@ QString AppController::translate(const QString& text) const {return QCoreApplication::translate("App", text.toUtf8().constData());}QVariant AppController::read(Property property) const {+ const bool fsrVideo=nrMode_=="Video"&&settings_.stages(true).contains("fsr_frame_generation");+ if(fsrVideo&&property==Property::codecChoices){+ return labeled(QStringList{"H.264","H.265","AV1"});+ }+ if(fsrVideo&&property==Property::videoCodec){auto codec=settings_.codec;codec.remove(" (NVIDIA NVENC)");return codec;}if (const auto key = binding(property))return settings_.value(QStringView(QString::fromLatin1(key)));if (auto choices = staticChoices(property))@@ -170,6 +263,77 @@ QVariant AppController::read(Property property) const {for(auto it=values.begin();it!=values.end();++it)if(it.key().startsWith("rr_"))result.insert(it.key(),it.value());return result;}+ case Property::reshadeSettings: {+ QVariantMap result;+ const auto values = settings_.values();+ for (auto it = values.begin(); it != values.end(); ++it)+ if (it.key().startsWith("reshade_"))+ result.insert(it.key(), it.value());+ const auto rs = reshadeSettingsForMode(settings_, nrMode_ == "Video");+ result.insert("active_preset_path", rs.reshade_preset_path);+ result.insert("active_shader_search_paths", rs.reshade_shader_search_paths);+ result.insert("active_texture_search_paths", rs.reshade_texture_search_paths);+ result.insert("active_mix", rs.reshade_mix);+ result.insert("active_depth_mode", rs.reshade_depth_mode);+ result.insert("active_depth_resolution", rs.reshade_depth_resolution);+ result.insert("active_temporal_stability", rs.reshade_temporal_stability);+ result.insert("active_temporal_strength", rs.reshade_temporal_strength);+ result.insert("active_precision_policy", rs.reshade_precision_policy);+ result.insert("active_hdr_policy", rs.reshade_hdr_policy);+ result.insert("active_preserve_alpha", rs.reshade_preserve_alpha);+ result.insert("active_deterministic_seed", rs.reshade_deterministic_seed);+ result.insert("active_parameter_overrides", rs.reshade_parameter_overrides);+ return result;+ }+ case Property::reshadePresetInfo: {+ const_cast<AppController*>(this)->requestReShadeInspection();+ auto map = reshadeInspection_;+ map.insert("loading", reshadeInspectionBusy_ || reshadeLoadedKey_ != reshadeRequestedKey_);+ QVariantList parameters;+ for (const auto& item : map.value("parameters").toList()) {+ auto p = item.toMap();+ const auto vals = p.value("values").toList();+ QVariant currentVal;+ if (vals.size() == 1)+ currentVal = vals.front();+ else if (!vals.isEmpty()) {+ QStringList parts;+ for (const auto& v : vals)+ parts.append(v.toString());+ currentVal = parts.join(',');+ }+ p.insert("effect_file", p.value("effect").toString());+ p.insert("min", p.value("ui_min").toDouble());+ p.insert("max", p.value("ui_max").toDouble());+ p.insert("step", p.value("ui_step").toDouble());+ p.insert("default_value", currentVal);+ p.insert("current_value", currentVal);+ parameters.append(p);+ }+ map.insert("parameters", parameters);+ QVariantList techniques;+ for (const auto& item : map.value("techniques").toList()) {+ auto t = item.toMap();+ t.insert("effect_file", t.value("effect").toString());+ techniques.append(t);+ }+ map.insert("techniques", techniques);+ return map;+ }+ case Property::reshadeStatus: {+ const_cast<AppController*>(this)->requestReShadeInspection();+ if (reshadeInspectionBusy_) return QString{};+ const auto rs = reshadeSettingsForMode(settings_, nrMode_ == "Video");+ if (rs.reshade_preset_path.isEmpty()) return QCoreApplication::translate("App", "Choose a preset to begin.");+ if (!reshadeInspection_.value("valid").toBool()) return reshadeInspection_.value("error").toString();+ int enabled = 0;+ for (const auto& t : reshadeInspection_.value("techniques").toList()) if (t.toMap().value("enabled").toBool()) ++enabled;+ const bool depth = rs.reshade_depth_mode != "Off" &&+ (rs.reshade_depth_mode == "AI Depth" || reshadeInspection_.value("requires_depth").toBool());+ return QCoreApplication::translate("App", "%1 technique(s) enabled · %2").arg(enabled).arg(depth+ ? QCoreApplication::translate("App", "AI depth enabled")+ : QCoreApplication::translate("App", "Depth not required or disabled"));+ }case Property::vfxSettings: {QVariantMap result;const auto values=settings_.values();for(auto it=values.begin();it!=values.end();++it)if(it.key().startsWith("vfx_"))result.insert(it.key(),it.value());@@ -240,7 +404,7 @@ QVariant AppController::read(Property property) const {case Property::statusMessage:return translate(status_);case Property::previewError:- return c.error;+ return translate(c.error);case Property::splitPosition:return split_;case Property::hasOutputPreview:@@ -266,10 +430,12 @@ QVariant AppController::read(Property property) const {case Property::processingCacheBytes: return cacheSnapshot_.bytes;case Property::processingCacheReclaimableBytes: return cacheSnapshot_.reclaimableBytes;case Property::processingCacheBusy: return cacheBusy_;- case Property::processingCacheCleaning: return cacheCleaning_;+ case Property::processingCacheCleaning: return cacheCleaning_ || cacheCleanPending_;case Property::processingCacheReady: return cacheReady_;case Property::canCleanProcessingCache:- return cacheReady_ && !cacheBusy_ && cacheSnapshot_.reclaimableBytes > 0 && cacheMaintenanceSafe();+ // Read-only size refreshes keep the last snapshot usable. Only cleanup+ // or active processing should disable the action.+ return cacheReady_ && !cacheCleaning_ && cacheSnapshot_.reclaimableBytes > 0 && cacheMaintenanceSafe();case Property::processingCacheSizeText:return cacheSnapshot_.bytes > 0 && cacheSnapshot_.bytes < 10000000? QString("<%1 GB").arg(QLocale().toString(.01, 'f', 2))@@ -303,7 +469,7 @@ QVariant AppController::read(Property property) const {case Property::runtimeState:return runtime_;case Property::runtimeError:- return runtimeError_;+ return translate(runtimeError_);case Property::startupWarnings:return warnings_.join('\n');case Property::sourceWidth:@@ -335,9 +501,17 @@ QVariant AppController::read(Property property) const {case Property::language:return language_;case Property::gpuName:- return gpus_.empty() ? QString("NVIDIA GPU") : gpus_.front().name;- case Property::gpuVram:- return gpus_.empty() ? QString{} : QString::number(gpus_.front().memoryMiB / 1024) + " GB";+ case Property::gpuVram:{+ if(gpus_.empty()||(nrMode_=="Video"&&settings_.stages(true).contains("fsr_frame_generation"))){+ const FsrAdapter* selected=nullptr;+ for(const auto& gpu:fsrAdapters_){+ if(settings_.fsr_adapter_id==gpu.id||settings_.fsr_adapter_id==QString::number(gpu.index)){selected=&gpu;break;}+ if(settings_.fsr_adapter_id=="auto"&&gpu.available&&(!selected||gpu.memoryBytes>selected->memoryBytes))selected=&gpu;+ }+ if(selected)return property==Property::gpuName?selected->name:selected->memoryBytes?QString::number(selected->memoryBytes/(1024.*1024*1024),'f',1)+" GB":translate("Shared GPU memory");+ }+ return property==Property::gpuName?(gpus_.empty()?QString("GPU"):gpus_.front().name):(gpus_.empty()?QString{}:QString::number(gpus_.front().memoryMiB/1024)+" GB");+ }case Property::gpuCount:return int(gpus_.size());case Property::nrImageQueue:@@ -367,8 +541,18 @@ QVariant AppController::read(Property property) const {case Property::appVersion:return "v" VE_APP_VERSION;case Property::diagnosticsText:- return NativeEngines::instance().diagnostics() + "\nQt " + qVersion() + " | C++23\n" ++ return NativeEngines::instance().diagnostics() + "\nFSR: "+fsrWorkerDiagnostics()+"\nQt " + qVersion() + " | C++23\n" +Paths::instance().root;+ case Property::fsrAdapterChoices:{+ QVariantList values{QVariantMap{{"label",QCoreApplication::translate("App","Auto")},{"value","auto"}}};+ for(const auto& adapter:fsrAdapters_)values.append(QVariantMap{{"label",adapter.name+(adapter.available?QString{}:QString(" — ")+adapter.unavailableReason)},{"value",adapter.id},{"available",adapter.available}});+ return values;+ }+ case Property::fsrStatus:{+ for(const auto& adapter:fsrAdapters_)if(settings_.fsr_adapter_id=="auto"?adapter.available:settings_.fsr_adapter_id==adapter.id||settings_.fsr_adapter_id==QString::number(adapter.index))+ return adapter.available?translate("Frame generation available"):adapter.unavailableReason;+ return settings_.fsr_adapter_id=="auto"?translate("No compatible FSR adapter detected"):translate("Selected FSR adapter is unavailable");+ }case Property::containerChoices:return settings_.codec.isEmpty() ? QVariantList{} : labeled(containersForCodec(settings_.codec));case Property::upscaleContainerChoices:@@ -405,19 +589,20 @@ QVariant AppController::read(Property property) const {case Property::renderValidationMessage: {try {if (auto valid = settings_.validate(); !valid)- return valid.error();+ return translate(valid.error());if (c.source.width > 0) {const auto estimate = estimatePipeline(c.source, settings_, workflow());(void)estimate;}return QString{};} catch (const std::exception& e) {- return QString::fromUtf8(e.what());+ return translate(QString::fromUtf8(e.what()));}}case Property::frameGenerationEstimate:- return c.source.fps > 0 ? QString::number(c.source.fps, 'g', 5) + " FPS → " +- settings_.frame_interpolation_target_fps + " FPS"+ return c.source.fps > 0 ? translate("%1 FPS").arg(QString::number(c.source.fps, 'g', 5)) + " → " ++ translate("%1 FPS").arg(QString::number(frameGenerationFrameRate(c.source.fps, settings_,+ tab_ == "frame-interpolation" && settings_.frame_interpolation_provider == "FSR 3"), 'g', 7)): QString{};case Property::rtxSuperResolutionEstimate:case Property::outputEstimate: {@@ -427,9 +612,9 @@ QVariant AppController::read(Property property) const {const auto estimate = estimatePipeline(c.source, settings_, workflow());return QString::number(c.source.width) + QChar(0xD7) + QString::number(c.source.height) + " → " +QString::number(estimate.width) + QChar(0xD7) + QString::number(estimate.height) +- (c.source.video ? " | " + QString::number(estimate.fps, 'g', 5) + " FPS" : QString{});+ (c.source.video ? " | " + translate("%1 FPS").arg(QString::number(estimate.fps, 'g', 5)) : QString{});} catch (const std::exception& e) {- return QString::fromUtf8(e.what());+ return translate(QString::fromUtf8(e.what()));}}case Property::currentLogPath:@@ -482,7 +667,11 @@ void AppController::write(Property property, const QVariant& value) {if (value.toString() == "Image" || value.toString() == "Video") {nrMode_ = value.toString();emit nrModeChanged();+ if (!reshadeRequestedKey_.isEmpty()) requestReShadeInspection();+ emit reshadePresetInfoChanged();+ emit reshadeStatusChanged();emit workflowStagesChanged();+ emit settingsUpdated();notifyContext();}break;@@ -554,6 +743,13 @@ QVariant AppController::execute(Action action, const QVariantList& args) {case Action::cleanProcessingCache: updateProcessingCache(true); return {};case Action::setVfxSetting:case Action::setRrSetting:+ case Action::setReShadeSetting:+ case Action::reloadReShadePreset:+ case Action::saveReShadePresetCopy:+ case Action::setReShadeParameter:+ case Action::resetReShadeParameters:+ case Action::setReShadeTechniqueEnabled:+ case Action::moveReShadeTechnique:case Action::setLutFile:case Action::setLutAdjustment:case Action::resetLutAdjustments:@@ -626,6 +822,8 @@ void AppController::saveSettings() {log(result.error(), "settings");}void AppController::settingsChanged() {+ if (!reshadeRequestedKey_.isEmpty()) requestReShadeInspection();+ emit reshadeStatusChanged();emit vfxStatusChanged();if (prefetchJob_) prefetchJob_->cancel();saveTimer_.start();diff --git a/src/application/controller.hpp b/src/application/controller.hppindex 02bbac1..351ab5d 100644--- a/src/application/controller.hpp+++ b/src/application/controller.hpp@@ -3,6 +3,7 @@#include "presentation/batch_model.hpp"#include "presentation/image_providers.hpp"#include "processing/native_engines.hpp"+#include "processing/fsr_native.hpp"#include "processing/pipeline.hpp"#include "processing/preview_cache.hpp"#include "media/video_preview.hpp"@@ -57,12 +58,16 @@ class AppController : public QmlFacade {[[nodiscard]] PreviewContext& context();[[nodiscard]] const PreviewContext& context() const;[[nodiscard]] int previewDelay() const { return context().source.video ? 35 : 80; }- [[nodiscard]] bool idle() const { return operation_ == "Idle" && !shuttingDown_ && !cacheCleaning_; }+ [[nodiscard]] bool idle() const {+ return operation_ == "Idle" && !shuttingDown_ && !cacheCleaning_ && !cacheCleanPending_;+ }void notifyContext();void setOperation(const QString& operation, const QString& status = {});void log(const QString& message, const QString& tag = "desktop");void saveSettings();void settingsChanged();+ void requestReShadeInspection();+ void initializeReShadeImageSettings();void setLanguage(const QString& code);void addInputs(const QVariantList& paths, QImage clipboardImage = {}, QByteArray clipboardData = {});void scanMetadata(int contextIndex, const QStringList& paths);@@ -94,15 +99,21 @@ class AppController : public QmlFacade {int inspectorWidth_ = 400, queueHeight_ = 330, logHeight_ = 220;std::array<PreviewContext, 5> contexts_;std::vector<Gpu> gpus_;+ std::vector<FsrAdapter> fsrAdapters_;QStringList logs_, warnings_;std::vector<std::unique_ptr<QTranslator>> translators_;QTimer saveTimer_, autoTimer_, scrubTimer_, cleanupTimer_;QElapsedTimer lastCacheCleanup_;QTemporaryDir transientFiles_;ProcessingTemporaryDirectory previewClips_{ProcessingCacheKind::PreviewClips};- QThreadPool pool_, previewPool_, cachePool_;+ QThreadPool pool_, previewPool_, cachePool_, reshadeInspectionPool_;+ QVariantMap reshadeInspection_;+ QString reshadeRequestedKey_, reshadeLoadedKey_;+ bool reshadeInspectionBusy_ = false;+ quint64 reshadeReloadGeneration_ = 0;ProcessingCacheSnapshot cacheSnapshot_;bool cacheBusy_ = false, cacheCleaning_ = false, cacheReady_ = false;+ bool cacheCleanPending_ = false;QString cacheStatus_;QTimer cacheRefreshTimer_, cacheTrimTimer_;VideoFrameReader videoFrames_;diff --git a/src/application/controller_cache.cpp b/src/application/controller_cache.cppindex 256f700..a534bb6 100644--- a/src/application/controller_cache.cpp+++ b/src/application/controller_cache.cpp@@ -39,7 +39,8 @@ QSet<QString> AppController::protectedProcessingFiles() const {return result;}void AppController::updateProcessingCache(bool clean, bool automatic) {- if (shuttingDown_ || cacheBusy_) return;+ if (shuttingDown_) return;+ if (cacheBusy_ && (!clean || automatic || cacheCleaning_ || cacheCleanPending_)) return;if (clean && !cacheMaintenanceSafe()) {if (!automatic) {cacheStatus_ = QCoreApplication::translate("App", "Processing is active. Try again when it finishes.");@@ -47,6 +48,16 @@ void AppController::updateProcessingCache(bool clean, bool automatic) {}return;}+ if (cacheBusy_) {+ // A manual click during a read-only scan must not be lost. Reserve the+ // cleanup until that scan finishes; idle() blocks new processing while+ // the request is pending, just as it does during the cleanup itself.+ cacheCleanPending_ = true;+ cacheStatus_.clear();+ emit processingCacheChanged();+ emit operationStateChanged();+ return;+ }const auto protectedPaths = protectedProcessingFiles();previewClips_.cacheRoot()->protect(protectedPaths);if (clean && !automatic) {@@ -136,6 +147,10 @@ void AppController::updateProcessingCache(bool clean, bool automatic) {log(QString("Removed %1 processing cache files (%2 bytes); %3 bytes remain; %4 skipped.").arg(removed.removedFiles).arg(removed.removedBytes).arg(snapshot.bytes).arg(removed.skipped), "cache");}+ if (cacheCleanPending_) {+ cacheCleanPending_ = false;+ updateProcessingCache(true); // Recheck safety and fresh protected paths.+ }emit processingCacheChanged();emit operationStateChanged();}, Qt::QueuedConnection);diff --git a/src/application/controller_settings.cpp b/src/application/controller_settings.cppindex 2b6218a..8c1300c 100644--- a/src/application/controller_settings.cpp+++ b/src/application/controller_settings.cpp@@ -3,6 +3,8 @@#include "media/image_codecs.hpp"#include "processing/color_analysis.hpp"#include "processing/effects.hpp"+#include "processing/reshade_native.hpp"+#include "processing/reshade_dependencies.hpp"#include <QDateTime>#include <QCoreApplication>#include <QDir>@@ -14,6 +16,71 @@#include <cmath>namespace ve {+void invalidateReShadePresetCache();+namespace {+QString resolveReShadeSettingKey(const QString& rawKey, bool imageMode) {+ QString base = rawKey;+ if (base.startsWith("reshade_image_"))+ return base;+ if (base.startsWith("reshade_"))+ base = base.mid(8);+ if (base == "effect_search_paths")+ base = "shader_search_paths";+ if (base == "temporal_stability" || base == "temporal_strength")+ return "reshade_" + base;+ return (imageMode ? QStringLiteral("reshade_image_") : QStringLiteral("reshade_")) + base;+}+QString normalizePathString(const QVariant& value) {+ QStringList rawList;+ if (value.typeId() == QMetaType::QStringList || value.typeId() == QMetaType::QVariantList)+ rawList = value.toStringList();+ else+ rawList = value.toString().split(';', Qt::SkipEmptyParts);+ QStringList cleaned;+ for (const auto& entry : rawList) {+ const auto p = localPath(entry.trimmed());+ if (!p.isEmpty() && !cleaned.contains(p, Qt::CaseInsensitive))+ cleaned.append(p);+ }+ return cleaned.join(';');+}+void upsertReShadeOverrideLine(QString& overridesText, const QString& key, const QString& value) {+ QJsonObject obj;+ const auto trimmed = overridesText.trimmed();+ if (trimmed.startsWith('{')) {+ QJsonParseError err{};+ const auto doc = QJsonDocument::fromJson(trimmed.toUtf8(), &err);+ if (err.error == QJsonParseError::NoError && doc.isObject())+ obj = doc.object();+ } else if (!trimmed.isEmpty()) {+ for (const auto& rawLine : trimmed.split('\n', Qt::SkipEmptyParts)) {+ const auto line = rawLine.trimmed();+ const int eq = line.indexOf('=');+ if (eq > 0)+ obj.insert(line.left(eq).trimmed(), line.mid(eq + 1).trimmed());+ }+ }+ obj.insert(key, value);+ overridesText = QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact));+}+} // namespace+void AppController::initializeReShadeImageSettings() {+ if (nrMode_ == "Image" && !settings_.reshade_image_configured) {+ const auto active = reshadeSettingsForMode(settings_, false);+ settings_.reshade_image_preset_path = active.reshade_preset_path;+ settings_.reshade_image_shader_search_paths = active.reshade_shader_search_paths;+ settings_.reshade_image_texture_search_paths = active.reshade_texture_search_paths;+ settings_.reshade_image_parameter_overrides = active.reshade_parameter_overrides;+ settings_.reshade_image_mix = active.reshade_mix;+ settings_.reshade_image_depth_mode = active.reshade_depth_mode;+ settings_.reshade_image_depth_resolution = active.reshade_depth_resolution;+ settings_.reshade_image_precision_policy = active.reshade_precision_policy;+ settings_.reshade_image_hdr_policy = active.reshade_hdr_policy;+ settings_.reshade_image_preserve_alpha = active.reshade_preserve_alpha;+ settings_.reshade_image_deterministic_seed = active.reshade_deterministic_seed;+ settings_.reshade_image_configured = true;+ }+}QVariant AppController::handleSettings(Action action, const QVariantList& args) {auto setPath = [&](const QString& key, const QString& path) {auto result = settings_.set(key, localPath(path));@@ -28,6 +95,153 @@ QVariant AppController::handleSettings(Action action, const QVariantList& args)auto result=settings_.set(key,args.value(1));if(!result)throw std::runtime_error(result.error().toStdString());settingsChanged();return {};}+ case Action::setReShadeSetting: {+ const bool imageMode = nrMode_ == "Image";+ initializeReShadeImageSettings();+ const auto key = resolveReShadeSettingKey(args.value(0).toString(), imageMode);+ if (!key.startsWith("reshade_") || !settings_.values().contains(key))+ throw std::runtime_error("Unknown ReShade setting.");+ auto value = args.value(1);+ if (key.endsWith("_preset_path")) {+ auto cleaned = localPath(value.toString());+ const QFileInfo fi(cleaned);+ if (fi.isFile() && fi.fileName().compare("ReShade.ini", Qt::CaseInsensitive) == 0) {+ QSettings ini(cleaned, QSettings::IniFormat);+ const auto target = ini.value("GENERAL/PresetFiles").toString();+ if (!target.isEmpty()) {+ const auto candidate = QDir(fi.absolutePath()).filePath(target.split(',').front().trimmed());+ if (QFileInfo::exists(candidate)) {+ cleaned = QDir::cleanPath(candidate);+ }+ }+ }+ const auto previous = settings_.value(key).toString();+ value = cleaned;+ if (cleaned.compare(previous, Qt::CaseInsensitive) != 0) {+ if (key.startsWith("reshade_image_")) {+ settings_.reshade_image_parameter_overrides.clear();+ } else {+ settings_.reshade_parameter_overrides.clear();+ }+ }+ } else if (key.endsWith("_search_paths")) {+ value = normalizePathString(value);+ }+ auto result = settings_.set(key, value);+ if (!result)+ throw std::runtime_error(result.error().toStdString());+ settingsChanged();+ return {};+ }+ case Action::reloadReShadePreset: {+ invalidateReShadePresetCache();+ ++reshadeReloadGeneration_;+ reshadeLoadedKey_.clear();+ previewStages_.clear();+ settingsChanged();+ status_ = QT_TRANSLATE_NOOP("App", "Reloaded ReShade preset.");+ emit statusMessageChanged();+ return {};+ }+ case Action::saveReShadePresetCopy: {+ auto path = localPath(args.value(0).toString());+ if (path.isEmpty())+ throw std::runtime_error("Choose a destination path for the ReShade preset.");+ if (QFileInfo(path).suffix().compare("ini", Qt::CaseInsensitive) != 0)+ path += ".ini";+ ReShadeEngine::exportPresetCopy(settings_, nrMode_ == "Video", path);+ status_ = QCoreApplication::translate("App", "Saved ReShade preset to %1").arg(QFileInfo(path).fileName());+ emit statusMessageChanged();+ return path;+ }+ case Action::setReShadeParameter: {+ initializeReShadeImageSettings();+ const auto paramKey = args.value(0).toString().trimmed();+ if (paramKey.isEmpty())+ return {};+ const auto rawVal = args.value(1);+ QString formatted;+ if (rawVal.typeId() == QMetaType::Bool)+ formatted = rawVal.toBool() ? QStringLiteral("1") : QStringLiteral("0");+ else if (rawVal.typeId() == QMetaType::QVariantList || rawVal.typeId() == QMetaType::QStringList)+ formatted = rawVal.toStringList().join(',');+ else+ formatted = rawVal.toString().trimmed();+ auto& overrides =+ nrMode_ == "Image" ? settings_.reshade_image_parameter_overrides : settings_.reshade_parameter_overrides;+ upsertReShadeOverrideLine(overrides, paramKey, formatted);+ settingsChanged();+ return {};+ }+ case Action::resetReShadeParameters: {+ const auto active = reshadeSettingsForMode(settings_, nrMode_ == "Video");+ const auto defaults = ReShadeEngine::presetResetOverrides(active.reshade_preset_path);+ initializeReShadeImageSettings();+ auto& text = nrMode_ == "Image" ? settings_.reshade_image_parameter_overrides : settings_.reshade_parameter_overrides;+ text = defaults;+ invalidateReShadePresetCache();+ ++reshadeReloadGeneration_;+ reshadeLoadedKey_.clear();+ previewStages_.clear();+ settingsChanged();+ emit reshadeParametersReset();+ return {};+ }+ case Action::setReShadeTechniqueEnabled: {+ initializeReShadeImageSettings();+ const auto name = args.value(0).toString().trimmed();+ const bool enabled = args.value(1).toBool();+ if (name.isEmpty())+ return {};+ const auto techniques = read(Property::reshadePresetInfo).toMap().value("techniques").toList();+ QStringList enabledQualified;+ for (const auto& item : techniques) {+ const auto t = item.toMap();+ const auto tName = t.value("name").toString();+ const auto qualified = t.value("qualified").toString().isEmpty()+ ? tName+ : t.value("qualified").toString();+ const bool isTarget = name.contains('@') ? qualified.compare(name, Qt::CaseInsensitive) == 0+ : tName.compare(name, Qt::CaseInsensitive) == 0;+ const bool techEnabled = isTarget ? enabled : t.value("enabled").toBool();+ if (techEnabled)+ enabledQualified.append(qualified);+ }+ auto& overrides =+ nrMode_ == "Image" ? settings_.reshade_image_parameter_overrides : settings_.reshade_parameter_overrides;+ upsertReShadeOverrideLine(overrides, QStringLiteral("Techniques"), enabledQualified.join(','));+ settingsChanged();+ return {};+ }+ case Action::moveReShadeTechnique: {+ initializeReShadeImageSettings();+ const int from = args.value(0).toInt();+ const int to = args.value(1).toInt();+ auto techniques = read(Property::reshadePresetInfo).toMap().value("techniques").toList();+ if (from >= 0 && from < techniques.size()) {+ const int clampedTo = std::clamp(to, 0, int(techniques.size()) - 1);+ if (from != clampedTo) {+ techniques.move(from, clampedTo);+ QStringList sortingQualified;+ QStringList enabledQualified;+ for (const auto& item : techniques) {+ const auto t = item.toMap();+ const auto qualified = t.value("qualified").toString().isEmpty()+ ? t.value("name").toString()+ : t.value("qualified").toString();+ sortingQualified.append(qualified);+ if (t.value("enabled").toBool())+ enabledQualified.append(qualified);+ }+ auto& overrides = nrMode_ == "Image" ? settings_.reshade_image_parameter_overrides+ : settings_.reshade_parameter_overrides;+ upsertReShadeOverrideLine(overrides, QStringLiteral("TechniqueSorting"), sortingQualified.join(','));+ upsertReShadeOverrideLine(overrides, QStringLiteral("Techniques"), enabledQualified.join(','));+ settingsChanged();+ }+ }+ return {};+ }case Action::setVfxSetting: {const auto key=args.value(0).toString();if(!key.startsWith("vfx_")||!settings_.values().contains(key))throw std::runtime_error("Unknown NVIDIA VFX setting.");@@ -122,6 +336,8 @@ QVariant AppController::handleSettings(Action action, const QVariantList& args)if (!order.contains(stage))throw std::runtime_error("Unknown processing card.");if (args[1].toBool()) {+ if(QStringList{"frame_generation","fsr_frame_generation","vfx_frame_generation"}.contains(stage))+ for(const auto& engine:QStringList{"frame_generation","fsr_frame_generation","vfx_frame_generation"})if(engine!=stage)active.removeAll(engine);if(stage=="dlss_ray_reconstruction")active.removeAll("dlss_super_resolution");else if(stage=="dlss_super_resolution")active.removeAll("dlss_ray_reconstruction");if (!active.contains(stage))@@ -132,6 +348,7 @@ QVariant AppController::handleSettings(Action action, const QVariantList& args)if(stage=="vfx_vsr")settings_.vfx_vsr_enabled=enabled;else if(stage=="vfx_frame_generation")settings_.vfx_frame_generation_enabled=enabled;else if(stage=="vfx_upscale")settings_.vfx_upscale_enabled=enabled;+ if(QStringList{"frame_generation","fsr_frame_generation","vfx_frame_generation"}.contains(stage))settings_.vfx_frame_generation_enabled=active.contains("vfx_frame_generation");settingsChanged();return {};}@@ -187,8 +404,9 @@ QVariant AppController::handleSettings(Action action, const QVariantList& args)return {};const auto applies = [&](const QString& key) {return !prefix.isEmpty()- ? key.startsWith(prefix)+ ? key.startsWith(prefix) || (tab == "frame-interpolation" && key.startsWith("fsr_frame_generation_")): !QStringList{"ai_gpu_uuid",+ "fsr_adapter_id","video_gpu_uuid","ffmpeg_device","container",@@ -222,7 +440,10 @@ QVariant AppController::handleSettings(Action action, const QVariantList& args)settingsChanged();saveSettings();emit upscaleModeChanged();- presetStatus_ = tab + " settings were reset to defaults.";+ const auto tabName = tab == "upscale" ? translate("Upscale")+ : tab == "frame-interpolation" ? translate("Frame Interpolation")+ : translate("Neural Rendering");+ presetStatus_ = QCoreApplication::translate("App", "%1 settings were reset to defaults.").arg(tabName);emit presetStatusChanged();return {};}diff --git a/src/application/controller_workflows.cpp b/src/application/controller_workflows.cppindex 7b9ecec..4a6bd21 100644--- a/src/application/controller_workflows.cpp+++ b/src/application/controller_workflows.cpp@@ -4,6 +4,7 @@#include "processing/effects.hpp"#include "processing/vfx_native.hpp"#include "processing/vfx_worker.hpp"+#include "processing/fsr_worker.hpp"#include "media/timeline.hpp"#include "media/video_preview.hpp"#include <QClipboard>@@ -75,21 +76,26 @@ QVariant AppController::handleWorkflow(Action action, const QVariantList& args)const auto warmStages = settings_.image_enabled_stages.contains("neural_model") ? QStringList{"neural_model"} : QStringList{};auto future = QtConcurrent::run(&pool_, [this, selection, control, warmStages] {std::vector<Gpu> devices;+ std::vector<FsrAdapter> fsrDevices;QString error;try {devices = detectGpus(control.get());+ fsrDevices = detectFsrAdapters(control.get());control->checkpoint();- if (devices.empty()) throw std::runtime_error("No compatible NVIDIA GPU was detected.");+ const bool nvidia=std::any_of(devices.begin(),devices.end(),[](const Gpu& gpu){return gpu.compatible;});+ const bool fsr=std::any_of(fsrDevices.begin(),fsrDevices.end(),[](const FsrAdapter& gpu){return gpu.available;});+ if (!nvidia&&!fsr) throw std::runtime_error(QT_TRANSLATE_NOOP("App", "No compatible NVIDIA or FSR DirectX 12 GPU was detected."));// Initialize selected image NR asynchronously before the first// preview; dimensions and inference still belong to the job.- NativeEngines::instance().prepare(gpuOrdinal(selection), warmStages);+ if(nvidia&&!warmStages.isEmpty())NativeEngines::instance().prepare(gpuOrdinal(selection), warmStages);control->checkpoint();} catch (const std::exception& e) { error = QString::fromUtf8(e.what()); }- QMetaObject::invokeMethod(this, [this, devices, error] {+ QMetaObject::invokeMethod(this, [this, devices, fsrDevices, error] {if (shuttingDown_) return;runtimeInitializationStarted_ = false;runtimeJob_.reset();gpus_ = devices;+ fsrAdapters_=fsrDevices;runtime_ = error.isEmpty() ? "Ready" : "Failed";runtimeError_ = error;status_ = error.isEmpty() ? QT_TRANSLATE_NOOP("App", "Ready. Add files to begin.") : error;@@ -349,12 +355,12 @@ QVariant AppController::handleWorkflow(Action action, const QVariantList& args)});connect(reply, &QNetworkReply::finished, this, [this, reply, manager] {if (reply->error() != QNetworkReply::NoError) {- status_ = "Clipboard download failed: " + reply->errorString();+ status_ = QCoreApplication::translate("App", "Clipboard download failed: %1").arg(reply->errorString());emit statusMessageChanged();} else {const auto bytes=reply->readAll();if (bytes.isEmpty()) {- status_="The clipboard URL did not contain a readable image.";+ status_=QT_TRANSLATE_NOOP("App", "The clipboard URL did not contain a readable image.");emit statusMessageChanged();} else addInputs({}, {},bytes);}@@ -387,7 +393,7 @@ void AppController::addInputs(const QVariantList& urls, QImage clipboardImage, Qconst int original = contextIndex();const auto tab = tab_;const auto id = ++operationId_;- setOperation("ScanningInputs", "Scanning input files…");+ setOperation("ScanningInputs", QT_TRANSLATE_NOOP("App", "Scanning input files…"));job_ = std::make_shared<JobControl>();const auto control = job_;auto future = QtConcurrent::run(&pool_, [this, paths, original, tab, id, control,@@ -445,7 +451,7 @@ void AppController::addInputs(const QVariantList& urls, QImage clipboardImage, Q}}setOperation("Idle", error.isEmpty()- ? QString("Added %1 file(s).").arg(images.size() + videos.size())+ ? QCoreApplication::translate("App", "Files added: %1.").arg(images.size() + videos.size()): error);loadSelected();},@@ -606,9 +612,10 @@ void AppController::preview(double positionMs, bool still) {const auto info = current.source;const auto settings = info.video ? videoPreviewSettings(settings_) : settings_;const bool vfxGenerated=info.video&&settings.stages(true).contains("vfx_frame_generation");+ const bool fsrGenerated=info.video&&settings.stages(true).contains("fsr_frame_generation");const bool nativeRrAfterFi=info.video&&rrNeedsGeneratedHistory(settings.stages(true));const auto requestedPosition=quantizePlayhead(positionMs>=0?positionMs:current.playheadSeconds*1000,- vfxGenerated?vfxFrameRate(info.fps,vfxSettingsForStages(settings,settings.stages(true))):info.fps,info.duration);+ fsrGenerated?frameGenerationFrameRate(info.fps,settings,true):vfxGenerated?vfxFrameRate(info.fps,vfxSettingsForStages(settings,settings.stages(true))):info.fps,info.duration);const auto position=quantizePlayhead(requestedPosition.seconds*1000,info.fps,info.duration);const double seconds = position.seconds;if (workflowType == Workflow::FrameInterpolation)@@ -628,13 +635,13 @@ void AppController::preview(double positionMs, bool still) {progress_ = 0;emit overallProgressChanged();fastPreview_ = fastColor;- setOperation("PreviewRunning", "Rendering preview…");+ setOperation("PreviewRunning", QT_TRANSLATE_NOOP("App", "Rendering preview…"));QElapsedTimer previewElapsed;previewElapsed.start();auto future = QtConcurrent::run(&previewPool_, [this, index, path, settings, info, seconds, still,workflowType, id, generation, settingsRevision,previewRevision, posterGeneration, position, control,- fastColor, previewElapsed, vfxGenerated, nativeRrAfterFi, requestedPosition] {+ fastColor, previewElapsed, vfxGenerated, fsrGenerated, nativeRrAfterFi, requestedPosition] {QJsonObject profile{{"queue_ms", double(previewElapsed.nsecsElapsed()) / 1e6},{"frame", qint64(position.number)}};QElapsedTimer phase;@@ -677,7 +684,7 @@ void AppController::preview(double positionMs, bool still) {(void)sourceDirectory.filePath("source-preview.mkv");if (!sourceDirectory.isValid())throw std::runtime_error("Cannot create the preview source directory.");- const bool rrHistory=stages.contains("dlss_ray_reconstruction");+ const bool rrHistory=stages.contains("dlss_ray_reconstruction")||stages.contains("fsr_frame_generation");const auto previewSource = rrHistory?path:extractVideoPreviewSource(path, info, sourceDirectory.path(), seconds, clipSeconds,false, *control, settings.ffmpeg_device);@@ -714,7 +721,9 @@ void AppController::preview(double positionMs, bool still) {(!stages.contains("neural_model") ||effective.nr_mask.value("path").toString().isEmpty()) &&(!stages.contains("coloring") ||- (effective.lut_path.isEmpty() && effective.lut_reference_image.isEmpty()));+ (effective.lut_path.isEmpty() && effective.lut_reference_image.isEmpty())) &&+ (!stages.contains("reshade") ||+ reshadeSettingsForMode(effective, info.video).reshade_preset_path.isEmpty());int rotation = info.metadata.value("tags").toObject().value("rotate").toString().toInt();for (const auto &side : info.metadata.value("side_data_list").toArray())if (side.toObject().contains("rotation"))@@ -725,8 +734,16 @@ void AppController::preview(double positionMs, bool still) {(!info.hdr || info.transfer == "smpte2084") &&(stages == QStringList{"neural_model"} || stages == QStringList{"rtx_video_hdr"});const bool directVideoStill =- stages.size() == 1 && !stages.contains("dlss_ray_reconstruction") && rotation % 360 == 0 && (!hdrPreview || fastHdr);- if(info.video&&hasVfxStages(stages)){+ stages.size() == 1 && !stages.contains("dlss_ray_reconstruction") &&+ !stages.contains("reshade") && rotation % 360 == 0 && (!hdrPreview || fastHdr);+ if(fsrGenerated){+ auto source=videoFrames_.frame(path,info,position,*control,false,0,false);input=source.pixels;prefetchSource=true;+ const auto identity=source.identity+QByteArray::number(requestedPosition.seconds,'g',17)+"/isolated-fsr/v1";+ const auto keys=previewStageKeys(identity,effective,info,stages,true,Paths::instance().root);+ if(auto cached=previewStages_.find(keys.back()))output=std::move(cached->pixels);+ else{output=previewIsolatedFsr(path,effective,info,requestedPosition.seconds,*control);previewStages_.store(keys.back(),{output,false,false});}+ if(immutableOutput)outputIdentity="video-output/isolated-fsr/v1"+keys.back();+ } else if(info.video&&hasVfxStages(stages)){auto source=videoFrames_.frame(path,info,position,*control,false,gpuOrdinal(settings.ai_gpu_uuid),settings.ffmpeg_device!="cpu");input=source.pixels;prefetchSource=true;const auto identity=source.identity+QByteArray::number(requestedPosition.seconds,'g',17)+"/isolated-vfx/v1";const auto keys=previewStageKeys(identity,effective,info,stages,true,Paths::instance().root);@@ -770,7 +787,8 @@ void AppController::preview(double positionMs, bool still) {previewStages_.store(keys.back(), {output, false, false});}} else if (info.video && !directVideoStill) {- if (!hdrPreview || hasVfxStages(stages) || stages.contains("dlss_ray_reconstruction")) {+ if (!hdrPreview || hasVfxStages(stages) || stages.contains("dlss_ray_reconstruction") ||+ stages.contains("reshade")) {auto source = videoFrames_.frame(path, info, position, *control, false,gpuOrdinal(settings.ai_gpu_uuid),settings.ffmpeg_device == "auto");@@ -784,13 +802,13 @@ void AppController::preview(double positionMs, bool still) {if (!videoStill_)videoStill_ = std::make_unique<VideoStillPreview>();std::vector<TimedImage> temporal;- if(!stages.contains("dlss_ray_reconstruction")&&(stages.contains("dlss_super_resolution")||vfxGenerated)) {+ if(!stages.contains("dlss_ray_reconstruction")&&(stages.contains("dlss_super_resolution")||stages.contains("reshade")||vfxGenerated)) {const int count=reconstructionHistoryFrames(effective,stages);temporal=videoFrames_.temporalContext(path,info,position,source.absoluteSeconds,count,*control,gpuOrdinal(settings.ai_gpu_uuid),settings.ffmpeg_device=="auto",vfxGenerated||nativeRrAfterFi);}output = videoStill_->process(input, effective, info, stages, previewStages_,- source.identity, *control,temporal,vfxGenerated?requestedPosition.seconds+info.presentationStartSeconds():stages.contains("dlss_ray_reconstruction")?source.absoluteSeconds:-1,path);+ source.identity, *control,temporal,(vfxGenerated||nativeRrAfterFi)?requestedPosition.seconds+info.presentationStartSeconds():stages.contains("dlss_ray_reconstruction")?source.absoluteSeconds:-1,path);if(hdrPreview){auto colors=info;colors.hdr=true;if(stages.contains("rtx_video_hdr")){colors.primaries="bt2020";colors.transfer="smpte2084";}output=toneMapVideoPreview(output,colors,*control,settings.ffmpeg_device);}profile["processing_ms"] = double(phase.nsecsElapsed()) / 1e6;const auto keys = previewStageKeys(source.identity, effective, info, stages, true,@@ -947,8 +965,8 @@ void AppController::preview(double positionMs, bool still) {fastPreview_ = false;emit vfxStatusChanged();emit overallProgressChanged();- setOperation("Idle", currentResult ? error.isEmpty() ? "Preview ready." : error- : "Preview updated; waiting for the latest request.");+ setOperation("Idle", currentResult ? error.isEmpty() ? QT_TRANSLATE_NOOP("App", "Preview ready.") : error+ : QT_TRANSLATE_NOOP("App", "Preview updated; waiting for the latest request."));cleanupCaches();if (contextIndex() == index)notifyContext();@@ -1043,7 +1061,7 @@ void AppController::batch(const QString& destinationMode, const QString& folder)scrubTimer_.stop();progress_ = 0;emit overallProgressChanged();- setOperation("BatchRunning", "Processing batch…");+ setOperation("BatchRunning", QT_TRANSLATE_NOOP("App", "Processing batch…"));auto future = QtConcurrent::run(&pool_, [this, index, paths, settings, workflowType, destinationMode,folder, id, control] {auto release = QtConcurrent::run(&previewPool_, [this] {@@ -1137,10 +1155,10 @@ void AppController::batch(const QString& destinationMode, const QString& folder)emit overallProgressChanged();emit exportPhaseChanged();emit vfxStatusChanged();- setOperation("Idle", QString("%1 complete, %2 failed%3.")+ setOperation("Idle", QCoreApplication::translate("App", "%1 complete, %2 failed.").arg(successes).arg(failures)- .arg(cancelled ? ", cancelled" : ""));+ + (cancelled ? ' ' + QCoreApplication::translate("App", "Batch stopped by user.") : QString{}));if (contextIndex() == index && successes > 0)loadSelected();},diff --git a/src/application/qml_facade.hpp b/src/application/qml_facade.hppindex 574cd32..b5ca98e 100644--- a/src/application/qml_facade.hpp+++ b/src/application/qml_facade.hpp@@ -20,6 +20,9 @@ enum class Property {workflowStages,vfxSettings,rrSettings,+ reshadeSettings,+ reshadeStatus,+ reshadePresetInfo,vfxStatus,sharpeningMethodChoices,ffmpegDeviceChoices,@@ -124,7 +127,8 @@ enum class Property {encodingQualityChoices,renameModeChoices,fiFpsChoices,- fiEngineChoices,+ fiProviderChoices,+ fsrAdapterChoices,fiPreviewLengthChoices,upscalePreviewLengthChoices,nrPreviewLengthChoices,@@ -198,8 +202,15 @@ enum class Property {upscaleImageCustomSuffix,upscaleRenameMode,upscaleCustomSuffix,+ fiFrameRateMode,+ fiMultiplier,fiTargetFps,- fiEngine,+ fiProvider,+ fsrFrameRateMode,+ fsrMultiplier,+ fsrTargetFps,+ fsrAdapterId,+ fsrStatus,fiOpticalFlowQuality,fiCodec,fiContainer,@@ -225,6 +236,13 @@ enum class Action {cleanProcessingCache,setVfxSetting,setRrSetting,+ setReShadeSetting,+ reloadReShadePreset,+ saveReShadePresetCopy,+ setReShadeParameter,+ resetReShadeParameters,+ setReShadeTechniqueEnabled,+ moveReShadeTechnique,setLutFile,setLutAdjustment,resetLutAdjustments,@@ -286,6 +304,9 @@ class QmlFacade : public QObject {Q_PROPERTY(QString processingCacheDetails READ processingCacheDetails NOTIFY processingCacheChanged)Q_PROPERTY(QVariantMap vfxSettings READ vfxSettings NOTIFY settingsUpdated)Q_PROPERTY(QVariantMap rrSettings READ rrSettings NOTIFY settingsUpdated)+ Q_PROPERTY(QVariantMap reshadeSettings READ reshadeSettings NOTIFY settingsUpdated)+ Q_PROPERTY(QString reshadeStatus READ reshadeStatus NOTIFY reshadeStatusChanged)+ Q_PROPERTY(QVariantMap reshadePresetInfo READ reshadePresetInfo NOTIFY reshadePresetInfoChanged)Q_PROPERTY(QString vfxStatus READ vfxStatus NOTIFY vfxStatusChanged)Q_PROPERTY(QString activeTab READ activeTab WRITE write_activeTab NOTIFY activeTabChanged)Q_PROPERTY(QString nrMode READ nrMode WRITE write_nrMode NOTIFY nrModeChanged)@@ -398,7 +419,8 @@ class QmlFacade : public QObject {Q_PROPERTY(QVariantList encodingQualityChoices READ encodingQualityChoices NOTIFY settingsUpdated)Q_PROPERTY(QVariantList renameModeChoices READ renameModeChoices NOTIFY settingsUpdated)Q_PROPERTY(QVariantList fiFpsChoices READ fiFpsChoices NOTIFY settingsUpdated)- Q_PROPERTY(QVariantList fiEngineChoices READ fiEngineChoices NOTIFY settingsUpdated)+ Q_PROPERTY(QVariantList fiProviderChoices READ fiProviderChoices NOTIFY settingsUpdated)+ Q_PROPERTY(QVariantList fsrAdapterChoices READ fsrAdapterChoices NOTIFY gpuChoicesChanged)Q_PROPERTY(QVariantList fiPreviewLengthChoices READ fiPreviewLengthChoices NOTIFY languageChanged)Q_PROPERTY(QVariantList upscalePreviewLengthChoices READ upscalePreviewLengthChoices NOTIFY languageChanged)@@ -513,8 +535,15 @@ class QmlFacade : public QObject {QString upscaleRenameMode READ upscaleRenameMode WRITE write_upscaleRenameMode NOTIFY settingsUpdated)Q_PROPERTY(QString upscaleCustomSuffix READ upscaleCustomSuffix WRITE write_upscaleCustomSuffix NOTIFYsettingsUpdated)+ Q_PROPERTY(QString fiFrameRateMode READ fiFrameRateMode WRITE write_fiFrameRateMode NOTIFY settingsUpdated)+ Q_PROPERTY(int fiMultiplier READ fiMultiplier WRITE write_fiMultiplier NOTIFY settingsUpdated)Q_PROPERTY(QString fiTargetFps READ fiTargetFps WRITE write_fiTargetFps NOTIFY settingsUpdated)- Q_PROPERTY(QString fiEngine READ fiEngine WRITE write_fiEngine NOTIFY settingsUpdated)+ Q_PROPERTY(QString fiProvider READ fiProvider WRITE write_fiProvider NOTIFY settingsUpdated)+ Q_PROPERTY(QString fsrFrameRateMode READ fsrFrameRateMode WRITE write_fsrFrameRateMode NOTIFY settingsUpdated)+ Q_PROPERTY(int fsrMultiplier READ fsrMultiplier WRITE write_fsrMultiplier NOTIFY settingsUpdated)+ Q_PROPERTY(QString fsrTargetFps READ fsrTargetFps WRITE write_fsrTargetFps NOTIFY settingsUpdated)+ Q_PROPERTY(QString fsrAdapterId READ fsrAdapterId WRITE write_fsrAdapterId NOTIFY settingsUpdated)+ Q_PROPERTY(QString fsrStatus READ fsrStatus NOTIFY runtimeStateChanged)Q_PROPERTY(QString fiOpticalFlowQuality READ fiOpticalFlowQuality WRITE write_fiOpticalFlowQuality NOTIFYsettingsUpdated)Q_PROPERTY(QString fiCodec READ fiCodec WRITE write_fiCodec NOTIFY settingsUpdated)@@ -682,7 +711,8 @@ class QmlFacade : public QObject {QVariantList encodingQualityChoices() const { return read(Property::encodingQualityChoices).toList(); }QVariantList renameModeChoices() const { return read(Property::renameModeChoices).toList(); }QVariantList fiFpsChoices() const { return read(Property::fiFpsChoices).toList(); }- QVariantList fiEngineChoices() const { return read(Property::fiEngineChoices).toList(); }+ QVariantList fiProviderChoices() const { return read(Property::fiProviderChoices).toList(); }+ QVariantList fsrAdapterChoices() const { return read(Property::fsrAdapterChoices).toList(); }QVariantList fiPreviewLengthChoices() const { return read(Property::fiPreviewLengthChoices).toList(); }QVariantList upscalePreviewLengthChoices() const {return read(Property::upscalePreviewLengthChoices).toList();@@ -900,10 +930,23 @@ class QmlFacade : public QObject {void write_upscaleCustomSuffix(QString value) {write(Property::upscaleCustomSuffix, QVariant::fromValue(value));}+ QString fiFrameRateMode() const { return read(Property::fiFrameRateMode).toString(); }+ void write_fiFrameRateMode(QString value) { write(Property::fiFrameRateMode, QVariant::fromValue(value)); }+ int fiMultiplier() const { return read(Property::fiMultiplier).toInt(); }+ void write_fiMultiplier(int value) { write(Property::fiMultiplier, QVariant::fromValue(value)); }QString fiTargetFps() const { return read(Property::fiTargetFps).toString(); }void write_fiTargetFps(QString value) { write(Property::fiTargetFps, QVariant::fromValue(value)); }- QString fiEngine() const { return read(Property::fiEngine).toString(); }- void write_fiEngine(QString value) { write(Property::fiEngine, QVariant::fromValue(value)); }+ QString fiProvider() const { return read(Property::fiProvider).toString(); }+ void write_fiProvider(QString value) { write(Property::fiProvider, QVariant::fromValue(value)); }+ QString fsrFrameRateMode() const { return read(Property::fsrFrameRateMode).toString(); }+ void write_fsrFrameRateMode(QString value) { write(Property::fsrFrameRateMode, QVariant::fromValue(value)); }+ int fsrMultiplier() const { return read(Property::fsrMultiplier).toInt(); }+ void write_fsrMultiplier(int value) { write(Property::fsrMultiplier, QVariant::fromValue(value)); }+ QString fsrTargetFps() const { return read(Property::fsrTargetFps).toString(); }+ void write_fsrTargetFps(QString value) { write(Property::fsrTargetFps, QVariant::fromValue(value)); }+ QString fsrAdapterId() const { return read(Property::fsrAdapterId).toString(); }+ void write_fsrAdapterId(QString value) { write(Property::fsrAdapterId, QVariant::fromValue(value)); }+ QString fsrStatus() const { return read(Property::fsrStatus).toString(); }QString fiOpticalFlowQuality() const { return read(Property::fiOpticalFlowQuality).toString(); }void write_fiOpticalFlowQuality(QString value) {write(Property::fiOpticalFlowQuality, QVariant::fromValue(value));@@ -941,7 +984,25 @@ class QmlFacade : public QObject {QString fullLog() const { return read(Property::fullLog).toString(); }QVariantMap vfxSettings() const { return read(Property::vfxSettings).toMap(); }QVariantMap rrSettings() const { return read(Property::rrSettings).toMap(); }+ QVariantMap reshadeSettings() const { return read(Property::reshadeSettings).toMap(); }+ QString reshadeStatus() const { return read(Property::reshadeStatus).toString(); }+ QVariantMap reshadePresetInfo() const { return read(Property::reshadePresetInfo).toMap(); }Q_INVOKABLE void setRrSetting(QString key, QVariant value) { execute(Action::setRrSetting, {key,value}); }+ Q_INVOKABLE void setReShadeSetting(QString key, QVariant value) { execute(Action::setReShadeSetting, {key, value}); }+ Q_INVOKABLE void reloadReShadePreset() { execute(Action::reloadReShadePreset, {}); }+ Q_INVOKABLE QString saveReShadePresetCopy(QString targetPath) {+ return execute(Action::saveReShadePresetCopy, {targetPath}).toString();+ }+ Q_INVOKABLE void setReShadeParameter(QString key, QVariant value) {+ execute(Action::setReShadeParameter, {key, value});+ }+ Q_INVOKABLE void resetReShadeParameters() { execute(Action::resetReShadeParameters, {}); }+ Q_INVOKABLE void setReShadeTechniqueEnabled(QString name, bool enabled) {+ execute(Action::setReShadeTechniqueEnabled, {name, enabled});+ }+ Q_INVOKABLE void moveReShadeTechnique(int fromIndex, int toIndex) {+ execute(Action::moveReShadeTechnique, {fromIndex, toIndex});+ }QString vfxStatus() const { return read(Property::vfxStatus).toString(); }Q_INVOKABLE void setVfxSetting(QString key, QVariant value) { execute(Action::setVfxSetting, {key,value}); }Q_INVOKABLE void setLutFile(QString a0) { execute(Action::setLutFile, {QVariant::fromValue(a0)}); }@@ -1046,6 +1107,9 @@ class QmlFacade : public QObject {Q_INVOKABLE void refreshProcessingCache() { execute(Action::refreshProcessingCache, {}); }Q_INVOKABLE void cleanProcessingCache() { execute(Action::cleanProcessingCache, {}); }signals:+ void reshadeStatusChanged();+ void reshadePresetInfoChanged();+ void reshadeParametersReset();void processingCacheChanged();void activeTabChanged();void nrModeChanged();@@ -1101,6 +1165,11 @@ class QmlFacade : public QObject {case Property::workflowStages:emit workflowStagesChanged();break;+ case Property::reshadeSettings:+ case Property::reshadeStatus:+ case Property::reshadePresetInfo:+ emit settingsUpdated();+ break;case Property::sharpeningMethodChoices:emit settingsUpdated();break;@@ -1410,9 +1479,12 @@ class QmlFacade : public QObject {case Property::fiFpsChoices:emit settingsUpdated();break;- case Property::fiEngineChoices:+ case Property::fiProviderChoices:emit settingsUpdated();break;+ case Property::fsrAdapterChoices:+ emit gpuChoicesChanged();+ break;case Property::fiPreviewLengthChoices:emit languageChanged();break;@@ -1632,12 +1704,25 @@ class QmlFacade : public QObject {case Property::upscaleCustomSuffix:emit settingsUpdated();break;+ case Property::fiFrameRateMode:+ case Property::fiMultiplier:case Property::fiTargetFps:emit settingsUpdated();break;- case Property::fiEngine:+ case Property::fiProvider:+ emit settingsUpdated();+ break;+ case Property::fsrFrameRateMode:+ case Property::fsrMultiplier:+ case Property::fsrTargetFps:emit settingsUpdated();break;+ case Property::fsrAdapterId:+ emit settingsUpdated();+ break;+ case Property::fsrStatus:+ emit runtimeStateChanged();+ break;case Property::fiOpticalFlowQuality:emit settingsUpdated();break;@@ -1773,8 +1858,14 @@ inline constexpr SettingBinding settingBindings[] = {{Property::upscaleImageCustomSuffix, "upscale_image_custom_suffix"},{Property::upscaleRenameMode, "upscale_rename_mode"},{Property::upscaleCustomSuffix, "upscale_custom_suffix"},+ {Property::fiFrameRateMode, "frame_interpolation_frame_rate_mode"},+ {Property::fiMultiplier, "frame_interpolation_multiplier"},{Property::fiTargetFps, "frame_interpolation_target_fps"},- {Property::fiEngine, "frame_interpolation_engine"},+ {Property::fiProvider, "frame_interpolation_provider"},+ {Property::fsrFrameRateMode, "fsr_frame_generation_frame_rate_mode"},+ {Property::fsrMultiplier, "fsr_frame_generation_multiplier"},+ {Property::fsrTargetFps, "fsr_frame_generation_target_fps"},+ {Property::fsrAdapterId, "fsr_adapter_id"},{Property::fiOpticalFlowQuality, "frame_interpolation_optical_flow_quality"},{Property::fiCodec, "frame_interpolation_codec"},{Property::fiQuality, "frame_interpolation_quality"},diff --git a/src/configuration/settings.cpp b/src/configuration/settings.cppindex 096f5f6..7d41aa1 100644--- a/src/configuration/settings.cpp+++ b/src/configuration/settings.cpp@@ -43,6 +43,44 @@ QStringList vfxStageGroup(const QStringList& stages,qsizetype begin,const Settingroup.append(id);rank=next;}return group;}+Settings reshadeSettingsForMode(const Settings& settings, bool video) {+ if (video)+ return settings;+ const Settings defaults;+ const bool hasImageSpecific =+ settings.reshade_image_configured ||+ !settings.reshade_image_preset_path.isEmpty() ||+ !settings.reshade_image_shader_search_paths.isEmpty() ||+ !settings.reshade_image_texture_search_paths.isEmpty() ||+ !settings.reshade_image_parameter_overrides.isEmpty() ||+ settings.reshade_image_mix != defaults.reshade_image_mix ||+ settings.reshade_image_depth_mode != defaults.reshade_image_depth_mode ||+ // The old default alone must not turn an untouched legacy image+ // configuration into an override of the shared preset.+ (settings.reshade_image_depth_resolution != defaults.reshade_image_depth_resolution &&+ settings.reshade_image_depth_resolution != 504) ||+ settings.reshade_image_precision_policy != defaults.reshade_image_precision_policy ||+ settings.reshade_image_hdr_policy != defaults.reshade_image_hdr_policy ||+ settings.reshade_image_preserve_alpha != defaults.reshade_image_preserve_alpha ||+ settings.reshade_image_deterministic_seed != defaults.reshade_image_deterministic_seed;+ Settings active = settings;+ active.reshade_temporal_stability = QStringLiteral("Spatial Only (Off)");+ active.reshade_temporal_strength = 0;+ if (!hasImageSpecific && !settings.reshade_preset_path.isEmpty())+ return active;+ active.reshade_preset_path = settings.reshade_image_preset_path;+ active.reshade_shader_search_paths = settings.reshade_image_shader_search_paths;+ active.reshade_texture_search_paths = settings.reshade_image_texture_search_paths;+ active.reshade_parameter_overrides = settings.reshade_image_parameter_overrides;+ active.reshade_mix = settings.reshade_image_mix;+ active.reshade_depth_mode = settings.reshade_image_depth_mode;+ active.reshade_depth_resolution = settings.reshade_image_depth_resolution;+ active.reshade_precision_policy = settings.reshade_image_precision_policy;+ active.reshade_hdr_policy = settings.reshade_image_hdr_policy;+ active.reshade_preserve_alpha = settings.reshade_image_preserve_alpha;+ active.reshade_deterministic_seed = settings.reshade_image_deterministic_seed;+ return active;+}namespace {template <class T> T convert(const QVariant& value) {return value.value<T>();@@ -81,6 +119,7 @@ void migrateStages(Settings& settings, bool video) {++it;}order.removeDuplicates();+ if(video&&!order.contains("fsr_frame_generation"))order.insert(std::max<qsizetype>(0,order.indexOf("frame_generation")+1),"fsr_frame_generation");if (legacyDlss) {const auto origin =scaleDlss && (!upscaleDlss || order.indexOf("scale_method") < order.indexOf("super_resolution"))@@ -109,18 +148,34 @@ void migrateStages(Settings& settings, bool video) {order.insert(order.indexOf("dlss_super_resolution") + 1, stage);else if (stage == "rtx_video_hdr")order.insert(order.indexOf("super_resolution") + 1, stage);- else+ else if (stage == "reshade") {+ const auto coloring = order.indexOf("coloring");+ if (coloring >= 0)+ order.insert(coloring, stage);+ else+ order.append(stage);+ } elseorder.append(stage);}enabled.removeDuplicates();enabled.removeIf([&allowed](const QString& stage) { return !allowed.contains(stage); });}+void migrateRetiredReShadeDepth(Settings& settings) {+ for (auto* mode : {&settings.reshade_depth_mode, &settings.reshade_image_depth_mode})+ if (mode->startsWith("AI Depth (")) *mode = "AI Depth";+}+void migrateRetiredReShadeMotion(Settings& settings) {+ migrateRetiredReShadeDepth(settings);+ if (settings.reshade_temporal_stability == "Balanced")+ settings.reshade_temporal_stability = "Auto";+}void applyValues(Settings& settings, const QVariantMap& changes) {#define VE_SETTING(type, name, initial) \if (changes.contains(QStringLiteral(#name))) \settings.name = convert<type>(changes.value(QStringLiteral(#name)));#include "settings_fields.inc"#undef VE_SETTING+ migrateRetiredReShadeMotion(settings);}std::expected<Settings, QString> migratePreset(const Settings& current, QVariantMap changes, int version,const QVariantMap& imported) {@@ -162,6 +217,11 @@ std::expected<Settings, QString> migratePreset(const Settings& current, QVariantreset({"upscale_optical_flow_quality"});if (version < 34)reset({"frame_interpolation_optical_flow_quality"});+ if (version < 40)+ reset({"frame_interpolation_provider","fsr_frame_generation_target_fps","fsr_adapter_id"});+ if (version < 41)+ reset({"frame_interpolation_frame_rate_mode", "frame_interpolation_multiplier",+ "fsr_frame_generation_frame_rate_mode", "fsr_frame_generation_multiplier"});if (version < 8)reset({"nr_scale_method", "nr_dlss_mode", "nr_dlss_preset", "upscale_image_engine","upscale_image_dlss_mode", "upscale_image_dlss_preset", "upscale_engine", "upscale_dlss_mode",@@ -286,6 +346,7 @@ std::expected<void, QString> Settings::set(QStringView key, const QVariant& inpu#undef VE_SETTINGif (!found)return std::unexpected("Unknown setting: " + key.toString());+ migrateRetiredReShadeDepth(candidate);if (key.endsWith(u"codec")) {if (key == u"codec")candidate.container = containersForCodec(candidate.codec).contains(candidate.container)@@ -467,8 +528,13 @@ std::expected<void, QString> Settings::validate() const {return std::unexpected("Unknown Upscale mode.");if (upscale_hdr_precision != "Packed 10-bit" && upscale_hdr_precision != "FP16")return std::unexpected("Unknown HDR precision.");- if (!QStringList{"Auto", "Native DLSSG", "Cascade"}.contains(frame_interpolation_engine))- return std::unexpected("Unknown Frame Interpolation engine.");+ for (const auto& mode : {frame_interpolation_frame_rate_mode, fsr_frame_generation_frame_rate_mode})+ if (mode != "Multiplier" && mode != "Target FPS") return std::unexpected("Unknown frame-rate mode.");+ for (const auto multiplier : {frame_interpolation_multiplier, fsr_frame_generation_multiplier})+ if (multiplier < 2 || multiplier > 8) return std::unexpected("Frame generation multiplier must be from 2 to 8.");+ if(!QStringList{"DLSS","FSR 3"}.contains(frame_interpolation_provider))return std::unexpected("Unknown frame interpolation provider.");+ if(fsr_adapter_id!="auto"&&!QRegularExpression("^(?:[0-9]+|dxgi:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{8}:[0-9a-fA-F]{2}:[0-9]+)$").match(fsr_adapter_id).hasMatch())+ return std::unexpected("Invalid FSR DirectX adapter selection.");if (!QStringList{"Lanczos4", "Area", "Bicubic", "Bilinear", "Nearest"}.contains(image_scaling_filter) ||!QStringList{"Spline36", "Lanczos", "Bicubic", "Area", "Bilinear"}.contains(video_scaling_filter))return std::unexpected("Unknown scaling filter.");@@ -491,12 +557,74 @@ std::expected<void, QString> Settings::validate() const {"180", "240", "360", "480"}.contains(frame_interpolation_target_fps))return std::unexpected("Unsupported output FPS.");+ if(!QStringList{"23.976","25","29.97","30","50","59.94","60","90","119.88","120","144","165","180","240","360","480"}.contains(fsr_frame_generation_target_fps))+ return std::unexpected("Unsupported FSR output FPS.");if (ffmpeg_device != "auto" && ffmpeg_device != "cpu" &&(!ffmpeg_device.startsWith("vulkan:") || QUuid(ffmpeg_device.mid(7)).isNull()))return std::unexpected("Invalid FFmpeg/Vulkan device selection.");for (const auto& uuid : {ai_gpu_uuid, video_gpu_uuid})if (uuid != "auto" && (!uuid.startsWith("GPU-") || QUuid(uuid.mid(4)).isNull()))return std::unexpected("Invalid NVIDIA GPU selection.");+ const auto validateReShadePaths = [](const QString& value, const char* label) -> std::expected<void, QString> {+ if (value.size() > 4096)+ return std::unexpected(QString::fromLatin1(label) + " is too long.");+ const QRegularExpression binaryPattern(R"(\.(dll|addon|addon32|addon64)\s*([;,]|$))",+ QRegularExpression::CaseInsensitiveOption);+ if (binaryPattern.match(value).hasMatch())+ return std::unexpected("ReShade DLLs and binary add-ons cannot be loaded as presets or shader packages.");+ return {};+ };+ for (const auto& [path, label] : {+ std::pair{reshade_preset_path, "ReShade preset path"},+ std::pair{reshade_shader_search_paths, "ReShade shader search paths"},+ std::pair{reshade_texture_search_paths, "ReShade texture search paths"},+ std::pair{reshade_image_preset_path, "ReShade image preset path"},+ std::pair{reshade_image_shader_search_paths, "ReShade image shader search paths"},+ std::pair{reshade_image_texture_search_paths, "ReShade image texture search paths"}}) {+ if (auto ok = validateReShadePaths(path, label); !ok)+ return ok;+ }+ for (const auto& overrides : {reshade_parameter_overrides, reshade_image_parameter_overrides}) {+ if (overrides.size() > 65536)+ return std::unexpected("ReShade parameter overrides are too large.");+ const auto trimmed = overrides.trimmed();+ if (!trimmed.isEmpty()) {+ if (trimmed.startsWith('{')) {+ QJsonParseError err;+ const auto doc = QJsonDocument::fromJson(trimmed.toUtf8(), &err);+ if (err.error != QJsonParseError::NoError || !doc.isObject())+ return std::unexpected("ReShade parameter overrides must be a valid JSON object.");+ } else {+ for (const auto& rawLine : trimmed.split('\n', Qt::SkipEmptyParts)) {+ const auto line = rawLine.trimmed();+ if (!line.isEmpty() && !line.startsWith('#') && !line.contains('='))+ return std::unexpected("ReShade parameter override entries must have the form KEY=VALUE.");+ }+ }+ }+ }+ for (int mix : {reshade_mix, reshade_image_mix})+ if (mix < 0 || mix > 100)+ return std::unexpected("ReShade mix must be between 0 and 100.");+ if (reshade_temporal_strength < 0 || reshade_temporal_strength > 100)+ return std::unexpected("ReShade temporal strength must be between 0 and 100.");+ for (const auto& depthMode : {reshade_depth_mode, reshade_image_depth_mode})+ if (!QStringList{"Auto", "Off", "AI Depth"}.contains(depthMode))+ return std::unexpected("Unknown ReShade depth mode.");+ for (int depthRes : {reshade_depth_resolution, reshade_image_depth_resolution})+ if (depthRes < 196 || depthRes > 1008 || (depthRes % 14) != 0)+ return std::unexpected("ReShade depth resolution must be a multiple of 14 between 196 and 1008.");+ if (!QStringList{"Auto", "Quality", "Spatial Only (Off)"}.contains(reshade_temporal_stability))+ return std::unexpected("Unknown ReShade temporal stability policy.");+ for (const auto& precision : {reshade_precision_policy, reshade_image_precision_policy})+ if (!QStringList{"Auto", "FP16", "8-bit sRGB Compatibility"}.contains(precision))+ return std::unexpected("Unknown ReShade precision policy.");+ for (const auto& hdrPolicy : {reshade_hdr_policy, reshade_image_hdr_policy})+ if (!QStringList{"Auto", "HDR Aware", "SDR Adapter", "Reject Unsupported"}.contains(hdrPolicy))+ return std::unexpected("Unknown ReShade HDR policy.");+ for (int seed : {reshade_deterministic_seed, reshade_image_deterministic_seed})+ if (seed < 0 || seed > 65535)+ return std::unexpected("ReShade deterministic seed must be between 0 and 65535.");return {};}QStringList Settings::stages(bool video) const {@@ -570,6 +698,7 @@ Settings Settings::load(const QString& path) {result.name = convert<type>(loaded.value(QStringLiteral(#name)));#include "settings_fields.inc"#undef VE_SETTING+ migrateRetiredReShadeMotion(result);migrateStages(result, false);migrateStages(result, true);// Repair individual invalid saved values without discarding the rest of the user's settings.@@ -618,7 +747,7 @@ QJsonObject Settings::preset(const QString& name) const {auto migrated=*this;migrateStages(migrated,false);migrateStages(migrated,true);auto map = migrated.values();map.remove("nr_mask");return {{"format", "dlss5-visual-enhancer-settings-preset"},- {"schema_version", 38},+ {"schema_version", 41},{"name", name.trimmed()},{"settings", QJsonObject::fromVariantMap(map)}};}@@ -652,7 +781,7 @@ std::expected<QString, QString> Settings::importPreset(const QString& path) {std::floor(object.value("schema_version").toDouble()) != object.value("schema_version").toDouble())return std::unexpected(QT_TRANSLATE_NOOP("App", "Preset schema_version must be an integer."));const int version = object.value("schema_version").toInt();- if (version < 1 || version > 38)+ if (version < 1 || version > 41)return std::unexpected(QT_TRANSLATE_NOOP("App", "Unsupported preset schema version."));const auto name = object.value("name").toString().trimmed();if (!object.value("settings").isObject() || name.isEmpty() || name.size() > 120 ||@@ -748,6 +877,32 @@ std::expected<QString, QString> Settings::importPreset(const QString& path) {migrateStages(candidate,video);}}+ if (version < 39) {+ // Pre-39 presets never enabled ReShade. Preserve all previous relative ordering.+ for (bool video : {false, true}) {+ auto& order = video ? candidate.video_stage_order : candidate.image_stage_order;+ auto& enabled = video ? candidate.video_enabled_stages : candidate.image_enabled_stages;+ const QSet<QString> seen(order.begin(), order.end()), active(enabled.begin(), enabled.end());+ if (seen.size() != order.size() || active.size() != enabled.size())+ return std::unexpected("Pipeline contains duplicate processing cards.");+ for (const auto& stage : order)+ if (!canonicalStages(video).contains(stage))+ return std::unexpected("Pipeline contains an unavailable processing card.");+ for (const auto& stage : enabled)+ if (!order.contains(stage))+ return std::unexpected("Pipeline enables an unavailable processing card.");+ enabled.removeAll("reshade");+ migrateStages(candidate, video);+ }+ }+ if(version<40){+ const auto& order=candidate.video_stage_order;const auto& enabled=candidate.video_enabled_stages;+ const QSet<QString> seen(order.begin(),order.end()),active(enabled.begin(),enabled.end());+ if(seen.size()!=order.size()||active.size()!=enabled.size())return std::unexpected("Pipeline contains duplicate processing cards.");+ for(const auto& stage:order)if(!canonicalStages(true).contains(stage))return std::unexpected("Pipeline contains an unavailable processing card.");+ for(const auto& stage:enabled)if(!order.contains(stage))return std::unexpected("Pipeline enables an unavailable processing card.");+ candidate.video_enabled_stages.removeAll("fsr_frame_generation");migrateStages(candidate,true);+ }if (auto valid = candidate.validate(); !valid)return std::unexpected(valid.error());*this = std::move(candidate);diff --git a/src/configuration/settings.hpp b/src/configuration/settings.hppindex 47473d9..528f323 100644--- a/src/configuration/settings.hpp+++ b/src/configuration/settings.hpp@@ -27,6 +27,7 @@ struct Settings {[[nodiscard]] QStringList normalizeVfxStages(const QStringList& stages,const Settings& settings);[[nodiscard]] Settings vfxSettingsForStages(const Settings& settings,const QStringList& stages);[[nodiscard]] QStringList vfxStageGroup(const QStringList& stages,qsizetype begin,const Settings& settings);+[[nodiscard]] Settings reshadeSettingsForMode(const Settings& settings, bool video);[[nodiscard]] QStringList codecChoices();[[nodiscard]] QStringList containersForCodec(const QString& codec);[[nodiscard]] QString defaultContainer(const QString& codec);diff --git a/src/configuration/settings_fields.inc b/src/configuration/settings_fields.incindex 9f5abf0..c221186 100644--- a/src/configuration/settings_fields.inc+++ b/src/configuration/settings_fields.inc@@ -2,12 +2,15 @@VE_SETTING(QStringList, image_stage_order,(QStringList{QStringLiteral("neural_model"), QStringLiteral("scale_method"),QStringLiteral("dlss_super_resolution"), QStringLiteral("dlss_ray_reconstruction"), QStringLiteral("super_resolution"),+ QStringLiteral("reshade"),QStringLiteral("coloring"), QStringLiteral("cas_sharpening"),QStringLiteral("grain")}))VE_SETTING(QStringList, video_stage_order,(QStringList{QStringLiteral("neural_model"), QStringLiteral("scale_method"),QStringLiteral("dlss_super_resolution"), QStringLiteral("dlss_ray_reconstruction"), QStringLiteral("super_resolution"),QStringLiteral("rtx_video_hdr"), QStringLiteral("frame_generation"),+ QStringLiteral("fsr_frame_generation"),+ QStringLiteral("reshade"),QStringLiteral("coloring"), QStringLiteral("cas_sharpening"),QStringLiteral("grain"), QStringLiteral("vfx_vsr"),QStringLiteral("vfx_upscale"), QStringLiteral("vfx_frame_generation")}))@@ -69,7 +72,13 @@ VE_SETTING(QString, image_custom_suffix, (QStringLiteral("_Neural_Rendering")))VE_SETTING(QString, video_rename_mode, (QStringLiteral("Auto")))VE_SETTING(QString, video_custom_suffix, (QStringLiteral("_Neural_Rendering")))VE_SETTING(QString, frame_interpolation_target_fps, (QStringLiteral("60")))-VE_SETTING(QString, frame_interpolation_engine, (QStringLiteral("Auto")))+VE_SETTING(QString, frame_interpolation_frame_rate_mode, (QStringLiteral("Target FPS")))+VE_SETTING(int, frame_interpolation_multiplier, (2))+VE_SETTING(QString, frame_interpolation_provider, (QStringLiteral("DLSS")))+VE_SETTING(QString, fsr_frame_generation_target_fps, (QStringLiteral("60")))+VE_SETTING(QString, fsr_frame_generation_frame_rate_mode, (QStringLiteral("Target FPS")))+VE_SETTING(int, fsr_frame_generation_multiplier, (2))+VE_SETTING(QString, fsr_adapter_id, (QStringLiteral("auto")))VE_SETTING(QString, frame_interpolation_optical_flow_quality, (QStringLiteral("High")))VE_SETTING(QString, frame_interpolation_codec, (QStringLiteral("H.264")))VE_SETTING(QString, frame_interpolation_container, (QStringLiteral("MP4")))@@ -133,3 +142,30 @@ VE_SETTING(bool, vfx_automatic_shot_detection, (true))VE_SETTING(bool, vfx_upscale_enabled, (false))VE_SETTING(double, vfx_upscale_scale, (2.0))VE_SETTING(double, vfx_upscale_strength, (0.4))+// ReShade post-processing stage (image and video, disabled by default).+// Motion estimation uses AMD FidelityFX Optical Flow 1.1.2 exclusively.+VE_SETTING(QString, reshade_preset_path, (QStringLiteral("")))+VE_SETTING(QString, reshade_shader_search_paths, (QStringLiteral("")))+VE_SETTING(QString, reshade_texture_search_paths, (QStringLiteral("")))+VE_SETTING(QString, reshade_parameter_overrides, (QStringLiteral("")))+VE_SETTING(int, reshade_mix, (100))+VE_SETTING(QString, reshade_depth_mode, (QStringLiteral("Auto")))+VE_SETTING(int, reshade_depth_resolution, (1008))+VE_SETTING(QString, reshade_temporal_stability, (QStringLiteral("Auto")))+VE_SETTING(int, reshade_temporal_strength, (75))+VE_SETTING(QString, reshade_precision_policy, (QStringLiteral("Auto")))+VE_SETTING(QString, reshade_hdr_policy, (QStringLiteral("Auto")))+VE_SETTING(bool, reshade_preserve_alpha, (true))+VE_SETTING(int, reshade_deterministic_seed, (0))+VE_SETTING(QString, reshade_image_preset_path, (QStringLiteral("")))+VE_SETTING(bool, reshade_image_configured, (false))+VE_SETTING(QString, reshade_image_shader_search_paths, (QStringLiteral("")))+VE_SETTING(QString, reshade_image_texture_search_paths, (QStringLiteral("")))+VE_SETTING(QString, reshade_image_parameter_overrides, (QStringLiteral("")))+VE_SETTING(int, reshade_image_mix, (100))+VE_SETTING(QString, reshade_image_depth_mode, (QStringLiteral("Auto")))+VE_SETTING(int, reshade_image_depth_resolution, (1008))+VE_SETTING(QString, reshade_image_precision_policy, (QStringLiteral("Auto")))+VE_SETTING(QString, reshade_image_hdr_policy, (QStringLiteral("Auto")))+VE_SETTING(bool, reshade_image_preserve_alpha, (true))+VE_SETTING(int, reshade_image_deterministic_seed, (0))diff --git a/src/console/cli.cpp b/src/console/cli.cppindex ac1e7cb..b7963e7 100644--- a/src/console/cli.cpp+++ b/src/console/cli.cpp@@ -5,6 +5,10 @@#include "media/media.hpp"#include "processing/native_engines.hpp"#include "processing/pipeline.hpp"+#include "processing/fsr_native.hpp"+#include "processing/fsr_worker.hpp"+#include "processing/reshade_native.hpp"+#include "processing/reshade_worker.hpp"#include "processing/vfx_worker.hpp"#include <QDir>#include <QCoreApplication>@@ -37,7 +41,7 @@ void json(const QJsonObject& value) {void help(const QString& command = {}) {output << "Visual Enhancer for images and videos, from your terminal.\n\n""Usage: VE_CLI.exe COMMAND [INPUT ...] [OPTIONS]\n\n"- "Commands: render, reconstruct, upscale, interpolate, devices\n";+ "Commands: render, reconstruct, reshade, upscale, interpolate, devices\n";if (command == "devices")output << " --json Write GPU information as JSON\n";else if (!command.isEmpty()) {@@ -56,6 +60,13 @@ void help(const QString& command = {}) {output << " --format png|jpeg|webp|avif|tiff\n";if (command == "render")output << " --style 0|1|2\n --strength 0..2\n";+ if (command == "render" || command == "reshade")+ output << " --reshade-preset PATH ReShade .ini preset file\n"+ " --reshade-shaders PATH Shader (.fx/.fxh) search folder(s), separated by ';'\n"+ " --reshade-textures PATH Texture/LUT search folder(s), separated by ';'\n"+ " --reshade-mix 0..1 Blend factor between source and ReShade output\n"+ " --reshade-depth none|auto|moge-2-vits\n"+ " --reshade-temporal auto|quality|off\n";if (command == "reconstruct")output << " Native-resolution (1x) Ray Reconstruction\n"" --flow-quality high|medium|low Video NVOFA quality\n";@@ -64,7 +75,10 @@ void help(const QString& command = {}) {"--size WIDTHxHEIGHT Exact RTX dimensions\n --mode ""dlaa|quality|balanced|performance|ultra-performance\n";if (command == "interpolate")- output << " --fps FPS Target frame rate (default: 60)\n";+ output << " --fps FPS Target frame rate (default: 60)\n"+ " --multiplier 2..8 Multiply the source frame rate (instead of --fps)\n"+ " --interpolator dlss|fsr3 Frame generation provider (default: dlss)\n"+ " --fsr-gpu ID auto, DXGI adapter index, or saved DXGI ID\n";} elseoutput << "\nRun VE_CLI.exe COMMAND --help for options. Advanced settings: export a JSON preset from ""the app.\n";@@ -79,7 +93,8 @@ struct Arguments {Arguments parse(QStringList values) {Arguments result;result.command = values.takeFirst();- if (!QStringList{"render", "reconstruct", "upscale", "interpolate", "devices"}.contains(result.command))+ if (!QStringList{"render", "reconstruct", "reshade", "upscale", "interpolate", "devices"}.contains(+ result.command))throw UsageError("Unknown command: " + result.command);const QSet<QString> switches{"--json", "--quiet", "--dry-run", "--recursive"};QSet<QString> options{"--output", "--preset", "--gpu", "--codec", "--container", "--quality"};@@ -87,12 +102,15 @@ Arguments parse(QStringList values) {options.insert("--format");if (result.command == "render")options.unite({"--style", "--strength"});+ if (result.command == "render" || result.command == "reshade")+ options.unite({"--reshade-preset", "--reshade-shaders", "--reshade-textures", "--reshade-mix",+ "--reshade-depth", "--reshade-temporal"});if (result.command == "reconstruct")options.insert("--flow-quality");if (result.command == "upscale")options.unite({"--engine", "--scale", "--size", "--mode"});if (result.command == "interpolate")- options.insert("--fps");+ options.unite({"--fps","--multiplier","--interpolator","--fsr-gpu"});bool positional = false;for (qsizetype i = 0; i < values.size(); ++i) {auto value = values[i];@@ -139,6 +157,48 @@ double number(const QString& value, const QString& name) {throw UsageError(name + " requires a finite number.");return result;}+QStringList splitSearchPaths(const QString& raw) {+ QStringList out;+ for (const auto& part : raw.split(';', Qt::SkipEmptyParts)) {+ const auto cleaned = localPath(part.trimmed());+ if (!cleaned.isEmpty() && !out.contains(cleaned, Qt::CaseInsensitive))+ out.append(cleaned);+ }+ return out;+}+void applyReShadeOptions(const Arguments& args, Settings& settings) {+ if (args.options.contains("--reshade-preset"))+ settings.reshade_image_preset_path = settings.reshade_preset_path =+ localPath(args.options.value("--reshade-preset"));+ if (args.options.contains("--reshade-shaders"))+ settings.reshade_image_shader_search_paths = settings.reshade_shader_search_paths =+ splitSearchPaths(args.options.value("--reshade-shaders")).join(';');+ if (args.options.contains("--reshade-textures"))+ settings.reshade_image_texture_search_paths = settings.reshade_texture_search_paths =+ splitSearchPaths(args.options.value("--reshade-textures")).join(';');+ if (args.options.contains("--reshade-mix")) {+ const auto raw = args.options.value("--reshade-mix");+ const double v = number(raw, "--reshade-mix");+ const int pct =+ (v >= 0.0 && v <= 1.0 && raw.contains('.')) ? int(std::llround(v * 100.0)) : int(std::llround(v));+ settings.reshade_image_mix = settings.reshade_mix = pct;+ }+ if (args.options.contains("--reshade-depth"))+ settings.reshade_image_depth_mode = settings.reshade_depth_mode =+ choice(args, "--reshade-depth",+ {{"none", "Off"},+ {"off", "Off"},+ {"auto", "Auto"},+ {"moge-2-vits", "AI Depth"},+ {"ai", "AI Depth"}});+ if (args.options.contains("--reshade-temporal"))+ settings.reshade_temporal_stability =+ choice(args, "--reshade-temporal",+ {{"auto", "Auto"},+ {"off", "Spatial Only (Off)"},+ {"quality", "Quality"},+ {"amd-optical-flow", "Quality"}});+}Settings settingsFor(const Arguments& args, const QStringList& paths) {Settings settings;settings.image_rename_mode = settings.video_rename_mode = settings.upscale_image_rename_mode =@@ -148,20 +208,40 @@ Settings settingsFor(const Arguments& args, const QStringList& paths) {throw UsageError(result.error());}const bool images = std::ranges::any_of(paths, isImage), videos = std::ranges::any_of(paths, isVideo);+ const bool hasReShadeOption =+ args.options.contains("--reshade-preset") || args.options.contains("--reshade-shaders") ||+ args.options.contains("--reshade-textures") || args.options.contains("--reshade-mix") ||+ args.options.contains("--reshade-depth") || args.options.contains("--reshade-temporal");if (args.command == "render") {- if (!args.options.contains("--preset"))- settings.image_enabled_stages = settings.video_enabled_stages = {"neural_model"};+ if (!args.options.contains("--preset")) {+ if (hasReShadeOption && !args.options.contains("--style") && !args.options.contains("--strength"))+ settings.image_enabled_stages = settings.video_enabled_stages = {"reshade"};+ else if (hasReShadeOption)+ settings.image_enabled_stages = settings.video_enabled_stages = {"neural_model", "reshade"};+ else+ settings.image_enabled_stages = settings.video_enabled_stages = {"neural_model"};+ }if (args.options.contains("--style") || args.options.contains("--strength")) {if ((images && !settings.image_enabled_stages.contains("neural_model")) ||(videos && !settings.video_enabled_stages.contains("neural_model")))throw UsageError("The preset disables Neural Rendering. Enable it before using --style or --strength.");}+ if (hasReShadeOption) {+ if ((images && !settings.image_enabled_stages.contains("reshade")) ||+ (videos && !settings.video_enabled_stages.contains("reshade")))+ throw UsageError("The preset disables ReShade. Enable it before using --reshade-* options.");+ }if (args.options.contains("--style"))settings.nr_style =choice(args, "--style", {{"0", "Style 0"}, {"1", "Style 1"}, {"2", "Style 2"}});if (args.options.contains("--strength"))settings.nr_intensity = number(args.options.value("--strength"), "--strength");+ applyReShadeOptions(args, settings);+ } else if (args.command == "reshade") {+ if (!args.options.contains("--preset"))+ settings.image_enabled_stages = settings.video_enabled_stages = {"reshade"};+ applyReShadeOptions(args, settings);} else if (args.command == "reconstruct") {settings.image_enabled_stages=settings.video_enabled_stages={"dlss_ray_reconstruction"};if(args.options.contains("--flow-quality"))@@ -220,9 +300,25 @@ Settings settingsFor(const Arguments& args, const QStringList& paths) {} else {if (images)throw UsageError("interpolate accepts videos only. Use render or upscale for images.");- settings.video_enabled_stages = {"frame_generation"};- if (args.options.contains("--fps"))- settings.frame_interpolation_target_fps = args.options.value("--fps");+ if(args.options.contains("--interpolator"))settings.frame_interpolation_provider=choice(args,"--interpolator",{{"dlss","DLSS"},{"fsr3","FSR 3"}});+ const bool fsr=settings.frame_interpolation_provider=="FSR 3";+ settings.video_enabled_stages = {fsr?"fsr_frame_generation":"frame_generation"};+ if (args.options.contains("--fps") && args.options.contains("--multiplier"))+ throw UsageError("Choose either --fps or --multiplier.");+ if (args.options.contains("--fps")){+ (fsr ? settings.fsr_frame_generation_frame_rate_mode : settings.frame_interpolation_frame_rate_mode) = "Target FPS";+ if(fsr)settings.fsr_frame_generation_target_fps=args.options.value("--fps");+ else settings.frame_interpolation_target_fps = args.options.value("--fps");+ }+ if (args.options.contains("--multiplier")) {+ bool valid = false;+ const auto multiplier = args.options.value("--multiplier").toInt(&valid);+ if (!valid || multiplier < 2 || multiplier > 8) throw UsageError("--multiplier must be an integer from 2 to 8.");+ (fsr ? settings.fsr_frame_generation_frame_rate_mode : settings.frame_interpolation_frame_rate_mode) = "Multiplier";+ (fsr ? settings.fsr_frame_generation_multiplier : settings.frame_interpolation_multiplier) = multiplier;+ }+ if(args.options.contains("--fsr-gpu"))settings.fsr_adapter_id=args.options.value("--fsr-gpu");+ if(!fsr&&args.options.contains("--fsr-gpu"))throw UsageError("--fsr-* options require --interpolator fsr3");settings.codec = settings.frame_interpolation_codec;settings.container = settings.frame_interpolation_container;settings.quality = settings.frame_interpolation_quality;@@ -300,7 +396,9 @@ struct ConsoleCancellation {};} // namespaceint runCli(const QStringList& arguments) {+ if(arguments.size()==2&&arguments.front()=="--internal-fsr-worker")return runFsrWorker(arguments.back());if(arguments.size()==2&&arguments.front()=="--internal-vfx-worker")return runVfxWorker(arguments.back());+ if(arguments.size()==2&&arguments.front()=="--internal-reshade-worker")return runReShadeWorker(arguments.back());const bool jsonOutput = arguments.contains("--json");try {if (arguments.isEmpty() || arguments.contains("--help") || arguments.contains("-h")) {@@ -318,6 +416,21 @@ int runCli(const QStringList& arguments) {if (args.command == "devices") {QJsonArray devices;for (const auto& gpu : detectGpus()) {+ bool reshadeAvailable = false;+ QString reshadeMotion = ReShadeEngine::opticalFlowBackend();+ QString reshadeDepth = QStringLiteral("MoGe-2 ViT-S (ONNX Runtime DirectML)");+ QString reshadeError;+ try {+ ReShadeEngine::initialize(gpu.index);+ const auto caps = ReShadeEngine::capabilities(gpu.index);+ reshadeAvailable = caps.available != 0;+ if (!caps.depth_available)+ reshadeDepth = QStringLiteral("unavailable");+ if (!caps.amd_optical_flow_available)+ reshadeMotion = QStringLiteral("unavailable");+ } catch (const std::exception& e) {+ reshadeError = QString::fromUtf8(e.what());+ }devices.append(QJsonObject{{"index", gpu.index},{"name", gpu.name},@@ -327,15 +440,26 @@ int runCli(const QStringList& arguments) {{"ai_compatible", gpu.compatible},{"compatibility_error",gpu.compatible ? ""- : "Requires an NVIDIA RTX GPU with compute capability 7.5 or newer."}});+ : "Requires an NVIDIA RTX GPU with compute capability 7.5 or newer."},+ {"reshade_available", reshadeAvailable},+ {"reshade_motion_backend", reshadeMotion},+ {"reshade_depth_backend", reshadeDepth},+ {"reshade_error", reshadeError}});if (!jsonOutput)output << gpu.index << " " << gpu.name << " ("<< QString::number(gpu.memoryMiB / 1024., 'f', 1) << " GB VRAM)\n " << gpu.uuid<< " | Driver " << gpu.driver- << " | RTX processing: " << (gpu.compatible ? "yes" : "unavailable") << '\n';+ << " | RTX processing: " << (gpu.compatible ? "yes" : "unavailable")+ << " | ReShade: " << (reshadeAvailable ? "yes (" + reshadeMotion + ")" : "unavailable")+ << '\n';+ }+ QJsonArray fsrDevices;+ for(const auto& gpu:detectFsrAdapters()){+ fsrDevices.append(QJsonObject{{"dxgi_index",int(gpu.index)},{"id",gpu.id},{"name",gpu.name},{"available",gpu.available},{"error",gpu.unavailableReason},{"dedicated_memory_bytes",qint64(gpu.memoryBytes)}});+ if(!jsonOutput)output<<"DXGI "<<gpu.index<<" "<<gpu.name<<" | FSR 3: "<<(gpu.available?QString("available"):gpu.unavailableReason)<<"\n "<<gpu.id<<'\n';}if (jsonOutput)- json({{"schema_version", 1}, {"ok", true}, {"devices", devices}});+ json({{"schema_version", 1}, {"ok", true}, {"devices", devices},{"fsr_adapters",fsrDevices}});elseoutput.flush();return 0;diff --git a/src/desktop/qml/components/BatchQueueDrawer.qml b/src/desktop/qml/components/BatchQueueDrawer.qmlindex 7c86fa1..82fa319 100644--- a/src/desktop/qml/components/BatchQueueDrawer.qml+++ b/src/desktop/qml/components/BatchQueueDrawer.qml@@ -219,7 +219,7 @@ Rectangle {ColumnHeading { width: drawer.numberWidth; text: "#"; horizontalAlignment: Text.AlignHCenter }ColumnHeading { width: drawer.fileWidth; text: qsTranslate("App", "Thumbnail / File") }ColumnHeading { width: drawer.progressWidth; text: qsTranslate("App", "Job progress") }- ColumnHeading { width: drawer.fpsWidth; text: "FPS"; visible: drawer.showFps; horizontalAlignment: Text.AlignHCenter }+ ColumnHeading { width: drawer.fpsWidth; text: qsTranslate("App", "FPS"); visible: drawer.showFps; horizontalAlignment: Text.AlignHCenter }ColumnHeading { width: drawer.remainingWidth; text: qsTranslate("App", "Remaining"); visible: drawer.showRemaining; horizontalAlignment: Text.AlignHCenter }ColumnHeading { width: drawer.completedWidth; text: qsTranslate("App", "Completed in"); visible: drawer.showCompleted; horizontalAlignment: Text.AlignHCenter }ColumnHeading { width: drawer.statusWidth; text: qsTranslate("App", "Status"); horizontalAlignment: Text.AlignHCenter }@@ -455,7 +455,7 @@ Rectangle {QueueToolTip {visible: progressHover.hovered && queueRow.detail !== ""text: {- var lines = [queueRow.detail]+ var lines = [qsTranslate("App", queueRow.detail)]if (queueRow.running && queueRow.processingFps > 0)lines.push(queueRow.processingFps.toFixed(1) + qsTranslate("App", " processing FPS"))if (queueRow.running && queueRow.remainingSeconds >= 0)@@ -471,7 +471,7 @@ Rectangle {Column {anchors.centerIn: parent; spacing: 4MetricText { objectName: "batchQueueFps"; text: queueRow.running && queueRow.processingFps > 0 ? queueRow.processingFps.toFixed(1) : "—" }- MetricCaption { text: "FPS" }+ MetricCaption { text: qsTranslate("App", "FPS") }}HoverHandler { id: fpsHover }QueueToolTip { visible: fpsHover.hovered; text: qsTranslate("App", "Measured frames per second during video processing") }@@ -506,7 +506,7 @@ Rectangle {font.weight: Font.Medium; color: queueRow.stateColor}HoverHandler { id: statusHover }- QueueToolTip { visible: statusHover.hovered && queueRow.detail !== ""; text: queueRow.detail }+ QueueToolTip { visible: statusHover.hovered && queueRow.detail !== ""; text: qsTranslate("App", queueRow.detail) }}Item {width: drawer.actionsWidth; height: parent.heightdiff --git a/src/desktop/qml/components/FrameGenerationControls.qml b/src/desktop/qml/components/FrameGenerationControls.qmlindex 2ff1755..b92445c 100644--- a/src/desktop/qml/components/FrameGenerationControls.qml+++ b/src/desktop/qml/components/FrameGenerationControls.qml@@ -9,26 +9,9 @@ Column {readonly property bool isImage: appBridge ? appBridge.nrMode === "Image" : truewidth: parent ? parent.width : 320spacing: 12- AppComboBox {- width: parent.width- label: qsTranslate("App", "Target Output Frame Rate")- model: appBridge ? appBridge.fiFpsChoices : []- currentValue: appBridge ? appBridge.fiTargetFps : "60"- onActivated: v => {- if (appBridge)- appBridge.fiTargetFps = v;- }- }-- AppSegmentedControl {+ FrameRateControls {width: parent.width- label: qsTranslate("App", "DLSS-G Engine")- model: appBridge ? appBridge.fiEngineChoices : []- currentValue: appBridge ? appBridge.fiEngine : "Auto"- onActivated: v => {- if (appBridge)- appBridge.fiEngine = v;- }+ appBridge: root.appBridge}AppComboBox {diff --git a/src/desktop/qml/components/FrameRateControls.qml b/src/desktop/qml/components/FrameRateControls.qmlnew file mode 100644index 0000000..3cc8578--- /dev/null+++ b/src/desktop/qml/components/FrameRateControls.qml@@ -0,0 +1,53 @@+import QtQuick+import ".."+import "../controls"++Column {+ id: root+ property var appBridge: null+ property bool fsr: false+ readonly property string mode: appBridge ? (fsr ? appBridge.fsrFrameRateMode : appBridge.fiFrameRateMode) : "Target FPS"+ width: parent ? parent.width : 320+ spacing: 12++ AppSegmentedControl {+ objectName: root.fsr ? "fsrFrameRateMode" : "dlssFrameRateMode"+ width: parent.width+ label: qsTranslate("App", "Frame-rate mode")+ model: [{label: qsTranslate("App", "Multiplier"), value: "Multiplier"},+ {label: qsTranslate("App", "Target FPS"), value: "Target FPS"}]+ currentValue: root.mode+ onActivated: value => {+ if (!root.appBridge) return+ if (root.fsr) root.appBridge.fsrFrameRateMode = value+ else root.appBridge.fiFrameRateMode = value+ }+ }+ AppComboBox {+ objectName: root.fsr ? "fsrMultiplier" : "dlssMultiplier"+ width: parent.width+ visible: root.mode === "Multiplier"+ label: qsTranslate("App", "Multiplier")+ model: [{label:"2x",value:2},{label:"3x",value:3},{label:"4x",value:4},+ {label:"5x",value:5},{label:"6x",value:6},{label:"7x",value:7},{label:"8x",value:8}]+ currentValue: root.appBridge ? (root.fsr ? root.appBridge.fsrMultiplier : root.appBridge.fiMultiplier) : 2+ onActivated: value => {+ if (!root.appBridge) return+ if (root.fsr) root.appBridge.fsrMultiplier = value+ else root.appBridge.fiMultiplier = value+ }+ }+ AppComboBox {+ objectName: root.fsr ? "fsrTargetFrameRate" : "dlssTargetFrameRate"+ width: parent.width+ visible: root.mode === "Target FPS"+ label: qsTranslate("App", "Target Output Frame Rate")+ model: root.appBridge ? root.appBridge.fiFpsChoices : []+ currentValue: root.appBridge ? (root.fsr ? root.appBridge.fsrTargetFps : root.appBridge.fiTargetFps) : "60"+ onActivated: value => {+ if (!root.appBridge) return+ if (root.fsr) root.appBridge.fsrTargetFps = value+ else root.appBridge.fiTargetFps = value+ }+ }+}diff --git a/src/desktop/qml/components/FsrFrameGenerationControls.qml b/src/desktop/qml/components/FsrFrameGenerationControls.qmlnew file mode 100644index 0000000..9dedc72--- /dev/null+++ b/src/desktop/qml/components/FsrFrameGenerationControls.qml@@ -0,0 +1,16 @@+import QtQuick+import ".."+import "../controls"++Column {+ id: root+ property var appBridge: null+ width: parent ? parent.width : 320+ spacing: 12++ FrameRateControls {+ width: parent.width+ appBridge: root.appBridge+ fsr: true+ }+}diff --git a/src/desktop/qml/components/ReShadeControls.qml b/src/desktop/qml/components/ReShadeControls.qmlnew file mode 100644index 0000000..ea7dae7--- /dev/null+++ b/src/desktop/qml/components/ReShadeControls.qml@@ -0,0 +1,414 @@+pragma ComponentBehavior: Bound+import QtQuick+import QtQuick.Dialogs+import ".."+import "../controls"++Column {+ id: root+ objectName: "reshade-controls"+ property var appBridge: null+ readonly property bool isImage: appBridge ? appBridge.nrMode === "Image" : true+ readonly property var values: appBridge ? appBridge.reshadeSettings : ({})+ readonly property var presetInfo: appBridge ? appBridge.reshadePresetInfo : ({})+ readonly property var techniques: presetInfo.techniques || []+ readonly property var parameters: presetInfo.parameters || []+ readonly property bool checking: !!presetInfo.loading+ readonly property bool hasDepthActive: (values.active_depth_mode || "Auto") !== "Off"+ && ((values.active_depth_mode || "Auto") === "AI Depth" || !!presetInfo.requires_depth)+ readonly property var overrides: parseOverrides(values.active_parameter_overrides || "")+ readonly property var groups: effectGroups()+ property var expandedEffects: ({})+ property var savedEffectTechniques: ({})+ readonly property string effectSelectionContext: (isImage ? "image:" : "video:") + (values.active_preset_path || "")+ onEffectSelectionContextChanged: savedEffectTechniques = ({})+ property bool advanced: false+ property bool showInternal: false+ property string search: ""+ width: parent ? parent.width : 320+ spacing: 12++ Connections {+ target: root.appBridge+ function onReshadeParametersReset() { root.savedEffectTechniques = ({}) }+ }++ function resetToPreset() {+ if (!appBridge || checking) return+ // Finish any pending field edit before the controller discards overrides.+ root.forceActiveFocus(Qt.MouseFocusReason)+ appBridge.resetReShadeParameters()+ }++ function setSetting(key, value) { if (appBridge) appBridge.setReShadeSetting(key, value) }+ function parseOverrides(raw) {+ try { if (raw.trim().charAt(0) === "{") return JSON.parse(raw) } catch (e) {}+ var values = {}+ raw.split("\n").forEach(function(line) {+ var eq = line.indexOf("=")+ if (eq > 0) values[line.slice(0, eq).trim()] = line.slice(eq + 1).trim()+ })+ return values+ }+ function currentValue(parameter) { return overrides[parameter.key] === undefined ? parameter.current_value : overrides[parameter.key] }+ function effectGroups() {+ var result = [], indices = {}+ techniques.forEach(function(technique, index) {+ var effect = technique.effect_file || technique.effect || technique.name+ if (indices[effect] === undefined) {+ indices[effect] = result.length+ result.push({effect: effect, techniques: [], parameters: [], enabled: 0})+ }+ var group = result[indices[effect]]+ group.techniques.push({technique: technique, index: index})+ if (technique.enabled) group.enabled+++ })+ parameters.forEach(function(parameter) {+ var index = indices[parameter.effect_file || parameter.effect]+ if (index !== undefined) result[index].parameters.push(parameter)+ })+ return result+ }+ function matches(parameter) {+ if (parameter.hidden && !showInternal) return false+ var query = search.toLowerCase().trim()+ return !query || (parameter.ui_label + " " + parameter.name + " " + parameter.effect_file).toLowerCase().indexOf(query) >= 0+ }+ function groupMatches(group) {+ var query = search.toLowerCase().trim()+ return !query || group.effect.toLowerCase().indexOf(query) >= 0 || group.parameters.some(matches)+ || group.techniques.some(function(t) { return t.technique.name.toLowerCase().indexOf(query) >= 0 })+ }+ function toggleEffect(effect) {+ var next = Object.assign({}, expandedEffects)+ next[effect] = !next[effect]+ expandedEffects = next+ }+ function techniqueName(technique) { return technique.qualified || technique.name }+ function setEffectEnabled(group, enabled) {+ if (!appBridge || checking) return+ var names = group.techniques.map(function(t) { return techniqueName(t.technique) })+ var selected = (savedEffectTechniques[group.effect] || []).filter(function(name) { return names.indexOf(name) >= 0 })+ if (!enabled) {+ let saved = Object.assign({}, savedEffectTechniques)+ saved[group.effect] = group.techniques.filter(function(t) { return t.technique.enabled })+ .map(function(t) { return techniqueName(t.technique) })+ savedEffectTechniques = saved+ } else if (!selected.length && names.length) {+ // Start one technique for an unused effect; variants such as DOF+ // should not all be stacked by a single master switch.+ selected = [names[0]]+ }+ var next = Object.assign({}, overrides)+ next.Techniques = techniques.filter(function(t) {+ return (t.effect_file || t.effect || t.name) === group.effect+ ? enabled && selected.indexOf(techniqueName(t)) >= 0 : !!t.enabled+ }).map(techniqueName).join(",")+ setSetting("parameter_overrides", JSON.stringify(next))+ }+ AppFilePicker {+ objectName: "reshadePresetPath"+ width: parent.width+ label: qsTranslate("App", "ReShade Preset (.ini)")+ placeholderText: qsTranslate("App", "Choose a ReShade .ini preset")+ selectedPath: root.values.active_preset_path || ""+ nameFilters: [qsTranslate("App", "ReShade Presets (*.ini)"), qsTranslate("App", "All Files (*.*)")]+ onPathChanged: path => root.setSetting("preset_path", path)+ }+ Row {+ width: parent.width+ spacing: 8+ AppButton {+ objectName: "reshadeReloadPreset"+ width: (parent.width - 8) / 2+ buttonHeight: 28+ text: qsTranslate("App", "Reload Preset")+ iconName: "reset"+ enabled: !!root.values.active_preset_path && !root.checking+ onClicked: if (root.appBridge) root.appBridge.reloadReShadePreset()+ }+ AppButton {+ objectName: "reshadeSavePresetCopy"+ width: (parent.width - 8) / 2+ buttonHeight: 28+ text: qsTranslate("App", "Save Preset Copy")+ iconName: "export"+ enabled: !!root.values.active_preset_path && !root.checking && root.presetInfo.valid !== false+ onClicked: savePresetDialog.open()+ }+ }+ FileDialog {+ id: savePresetDialog+ title: qsTranslate("App", "Save ReShade Preset Copy")+ fileMode: FileDialog.SaveFile+ nameFilters: [qsTranslate("App", "ReShade Presets (*.ini)")]+ onAccepted: if (root.appBridge) root.appBridge.saveReShadePresetCopy(selectedFile.toString())+ }+ Rectangle {+ width: parent.width+ visible: !root.checking && root.presetInfo.valid === false && !!root.presetInfo.error+ height: statusText.implicitHeight + 18+ radius: Theme.radiusMedium+ color: Theme.dangerBg+ Text {+ id: statusText+ objectName: "reshadePresetErrorText"+ x: 9; y: 9; width: parent.width - 18+ wrapMode: Text.WordWrap+ text: root.checking ? "" : root.presetInfo.error || ""+ font.family: Theme.fontFamily; font.pixelSize: Theme.fontSizeSmall+ color: Theme.danger+ }+ }+ AppSlider {+ objectName: "reshadeMixSlider"+ width: parent.width+ label: qsTranslate("App", "Effect Mix")+ from: 0; to: 100; stepSize: 1; precision: 0; defaultValue: 100+ value: root.values.active_mix === undefined ? 100 : root.values.active_mix+ onValueModified: value => root.setSetting("mix", Math.round(value))+ }+ AppComboBox {+ objectName: "reshadeDepthMode"+ width: parent.width+ label: qsTranslate("App", "Depth Input") + (root.checking ? "" : " ("+ + (root.hasDepthActive ? qsTranslate("App", "Enabled") : qsTranslate("App", "Disabled")) + ")")+ model: [{label: qsTranslate("App", "Auto"), value: "Auto"},+ {label: qsTranslate("App", "Always Generate AI Depth"), value: "AI Depth"},+ {label: qsTranslate("App", "Disabled"), value: "Off"}]+ currentValue: root.values.active_depth_mode || "Auto"+ onActivated: value => root.setSetting("depth_mode", value)+ }+ AppComboBox {+ objectName: "reshadeMotionMode"+ width: parent.width+ visible: !root.isImage+ label: qsTranslate("App", "Video Motion & Depth Stabilization")+ model: [{label: qsTranslate("App", "Auto"), value: "Auto"},+ {label: qsTranslate("App", "Optical Flow"), value: "Quality"},+ {label: qsTranslate("App", "Off (Per-Frame Depth)"), value: "Spatial Only (Off)"}]+ currentValue: root.values.active_temporal_stability || "Auto"+ onActivated: value => root.setSetting("temporal_stability", value)+ }+ Text {+ width: parent.width; wrapMode: Text.WordWrap+ visible: !root.checking && !!root.presetInfo.requires_depth && root.values.active_depth_mode === "Off"+ text: qsTranslate("App", "This preset requires depth. Select Auto or Always to process it.")+ font.family: Theme.fontFamily; font.pixelSize: Theme.fontSizeSmall; color: Theme.textMuted+ }+ Row {+ width: parent.width; visible: !!root.values.active_preset_path+ Text {+ width: parent.width - resetButton.width+ anchors.verticalCenter: parent.verticalCenter+ text: qsTranslate("App", "Techniques & Settings")+ font.family: Theme.fontFamily; font.pixelSize: Theme.fontSizeLabel; font.weight: Font.DemiBold; color: Theme.textPrimary+ }+ AppButton {+ id: resetButton+ objectName: "reshadeResetParameters"+ width: Math.min(implicitWidth, parent.width * 0.45); buttonHeight: 25+ text: qsTranslate("App", "Reset Values")+ enabled: !root.checking+ onClicked: root.resetToPreset()+ }+ }+ AppTextField {+ objectName: "reshadeParameterSearch"+ width: parent.width; visible: root.techniques.length > 0+ placeholderText: qsTranslate("App", "Search effects and parameters…")+ text: root.search+ onTextEdited: value => root.search = value+ }+ Repeater {+ model: root.groups+ delegate: Rectangle {+ id: effectCard+ required property var modelData+ readonly property var group: modelData+ objectName: "reshade-effect-" + group.effect+ readonly property bool expanded: !!root.expandedEffects[group.effect] || root.search.trim().length > 0+ width: root.width+ visible: root.groupMatches(group)+ height: visible ? groupContents.height + (expanded ? 12 : 0) : 0+ radius: Theme.radiusMedium; color: Theme.bgInput; border.width: 1+ border.color: expanded || headerMouse.containsMouse || effectHeader.activeFocus ? Theme.borderActive : Theme.borderSubtle+ Column {+ id: groupContents+ width: parent.width; spacing: 12+ Item {+ id: effectHeader+ objectName: "reshade-effect-header-" + effectCard.group.effect+ width: parent.width; height: 44+ activeFocusOnTab: true+ Accessible.role: Accessible.Button+ Accessible.name: effectCard.group.effect.replace(/\.fx$/i, "")+ Keys.onPressed: event => {+ if (event.key === Qt.Key_Space || event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {+ root.toggleEffect(effectCard.group.effect)+ event.accepted = true+ }+ }+ Rectangle {+ x: 1; y: 1; width: parent.width - 2; height: parent.height - 2+ radius: Theme.radiusMedium - 1+ color: headerMouse.pressed ? Theme.bgPressed : headerMouse.containsMouse ? Theme.bgInputHover : "transparent"+ }+ MouseArea {+ id: headerMouse+ anchors.fill: parent; hoverEnabled: true+ cursorShape: Qt.PointingHandCursor+ onClicked: {+ effectHeader.forceActiveFocus()+ root.toggleEffect(effectCard.group.effect)+ }+ }+ AppIcon {+ x: 12; anchors.verticalCenter: parent.verticalCenter+ iconName: effectCard.expanded ? "chevron_down" : "chevron_right"+ iconSize: 14; color: Theme.textSecondary+ }+ Text {+ x: 36; width: effectSwitch.x - x - 12+ anchors.verticalCenter: parent.verticalCenter+ text: effectCard.group.effect.replace(/\.fx$/i, "")+ elide: Text.ElideRight+ font.family: Theme.fontFamily; font.pixelSize: Theme.fontSizeLabel+ color: Theme.textPrimary+ }+ AppSwitch {+ id: effectSwitch+ objectName: "reshade-effect-switch-" + effectCard.group.effect+ x: parent.width - width - 12; width: 38; height: parent.height+ checked: effectCard.group.enabled > 0+ enabled: !root.checking+ Accessible.role: Accessible.CheckBox+ Accessible.name: effectCard.group.effect.replace(/\.fx$/i, "")+ Accessible.checked: checked+ onToggled: value => root.setEffectEnabled(effectCard.group, value)+ }+ }+ Loader {+ x: 12; width: parent.width - 24; active: effectCard.expanded+ height: active && item ? (item as Item).implicitHeight : 0+ sourceComponent: Column {+ width: groupContents.width - 24; spacing: 12+ Repeater {+ model: effectCard.group.techniques+ delegate: Row {+ id: techniqueRow+ required property var modelData+ width: parent.width; spacing: 4+ AppSwitch {+ width: parent.width - 56+ label: techniqueRow.modelData.technique.name+ checked: !!techniqueRow.modelData.technique.enabled+ enabled: !root.checking+ onToggled: value => { if (root.appBridge) root.appBridge.setReShadeTechniqueEnabled(techniqueRow.modelData.technique.qualified || techniqueRow.modelData.technique.name, value) }+ }+ AppIconButton {+ iconName: "chevron_up"; buttonSize: 24+ enabled: !root.checking && techniqueRow.modelData.index > 0+ onClicked: if (root.appBridge) root.appBridge.moveReShadeTechnique(techniqueRow.modelData.index, techniqueRow.modelData.index - 1)+ }+ AppIconButton {+ iconName: "chevron_down"; buttonSize: 24+ enabled: !root.checking && techniqueRow.modelData.index + 1 < root.techniques.length+ onClicked: if (root.appBridge) root.appBridge.moveReShadeTechnique(techniqueRow.modelData.index, techniqueRow.modelData.index + 1)+ }+ }+ }+ Text {+ width: parent.width; visible: effectCard.group.enabled === 0+ text: /fish.?eye/i.test(effectCard.group.effect)+ ? qsTranslate("App", "Fisheye distortion is off by default. Enable the technique to apply it.")+ : qsTranslate("App", "Enable a technique above to apply this effect.")+ wrapMode: Text.WordWrap; font.family: Theme.fontFamily; font.pixelSize: Theme.fontSizeSmall; color: Theme.textMuted+ }+ Repeater {+ model: effectCard.group.parameters.filter(root.matches)+ delegate: ReShadeParameter {+ required property var modelData+ width: parent.width; parameter: modelData+ currentValue: root.currentValue(modelData)+ enabled: !root.checking+ onValueEdited: value => { if (root.appBridge) root.appBridge.setReShadeParameter(modelData.key, value) }+ }+ }+ }+ }+ }+ }+ }+ AppButton {+ objectName: "reshadeAdvancedToggle"+ width: parent.width; buttonHeight: 28; variant: "ghost"+ text: qsTranslate("App", "Advanced")+ iconName: root.advanced ? "chevron_down" : "chevron_right"+ onClicked: root.advanced = !root.advanced+ }+ Loader {+ width: parent.width; active: root.advanced+ height: active && item ? (item as Item).implicitHeight : 0+ sourceComponent: Column {+ width: root.width; spacing: 12+ AppFilePicker {+ objectName: "reshadeShadersPicker"+ width: parent.width; selectFolder: true+ label: qsTranslate("App", "Shader Search Folder (.fx / .fxh)")+ placeholderText: qsTranslate("App", "Automatic (Preset & Runtime Shaders)")+ selectedPath: root.values.active_shader_search_paths || ""+ onPathChanged: path => root.setSetting("shader_search_paths", path)+ }+ AppFilePicker {+ objectName: "reshadeTexturesPicker"+ width: parent.width; selectFolder: true+ label: qsTranslate("App", "Texture & LUT Search Folder")+ placeholderText: qsTranslate("App", "Automatic (Preset & Runtime Textures)")+ selectedPath: root.values.active_texture_search_paths || ""+ onPathChanged: path => root.setSetting("texture_search_paths", path)+ }+ AppSlider {+ objectName: "reshadeTemporalBlend"+ width: parent.width+ visible: !root.isImage && root.hasDepthActive && root.values.active_temporal_stability !== "Spatial Only (Off)"+ label: qsTranslate("App", "Temporal Depth Blend")+ from: 0; to: 100; stepSize: 1; precision: 0; defaultValue: 75+ value: root.values.active_temporal_strength === undefined ? 75 : root.values.active_temporal_strength+ onValueModified: value => root.setSetting("temporal_strength", Math.round(value))+ }+ AppComboBox {+ objectName: "reshadeDepthDetail"+ width: parent.width; label: qsTranslate("App", "Depth Detail")+ model: [{label: qsTranslate("App", "Fast (280)"), value: 280}, {label: qsTranslate("App", "Standard (504)"), value: 504}, {label: qsTranslate("App", "High (756)"), value: 756}, {label: qsTranslate("App", "Maximum (1008)"), value: 1008}]+ currentValue: root.values.active_depth_resolution || 1008+ onActivated: value => root.setSetting("depth_resolution", value)+ }+ AppComboBox {+ objectName: "reshadeEffectPrecision"+ width: parent.width; label: qsTranslate("App", "Effect Precision")+ model: [{label: qsTranslate("App", "Auto"), value: "Auto"}, {label: "FP16", value: "FP16"},+ {label: qsTranslate("App", "8-bit sRGB Compatibility"), value: "8-bit sRGB Compatibility"}]+ currentValue: root.values.active_precision_policy || "Auto"+ onActivated: value => root.setSetting("precision_policy", value)+ }+ AppComboBox {+ objectName: "reshadeHdrHandling"+ width: parent.width; label: qsTranslate("App", "HDR Handling")+ model: [{label: qsTranslate("App", "Auto (SDR Preset Adapter)"), value: "Auto"}, {label: qsTranslate("App", "HDR-Aware Preset"), value: "HDR Aware"}, {label: qsTranslate("App", "SDR Adapter"), value: "SDR Adapter"}, {label: qsTranslate("App", "Reject Unsupported"), value: "Reject Unsupported"}]+ currentValue: root.values.active_hdr_policy || "Auto"+ onActivated: value => root.setSetting("hdr_policy", value)+ }+ AppSwitch {+ width: parent.width; label: qsTranslate("App", "Preserve Source Transparency")+ checked: root.values.active_preserve_alpha !== false+ onToggled: value => root.setSetting("preserve_alpha", value)+ }+ AppSwitch {+ width: parent.width; label: qsTranslate("App", "Show Internal Shader Parameters")+ checked: root.showInternal+ onToggled: value => root.showInternal = value+ }+ }+ }+}diff --git a/src/desktop/qml/components/ReShadeParameter.qml b/src/desktop/qml/components/ReShadeParameter.qmlnew file mode 100644index 0000000..3003d89--- /dev/null+++ b/src/desktop/qml/components/ReShadeParameter.qml@@ -0,0 +1,107 @@+pragma ComponentBehavior: Bound+import QtQuick+import QtQuick.Dialogs+import QtQuick.Controls as QQC2+import "../controls"++Column {+ id: root+ objectName: "reshade-parameter-editor"+ required property var parameter+ property var currentValue+ readonly property var shownValue: currentValue+ readonly property string title: parameter.ui_label || parameter.name+ readonly property bool scalar: (parameter.components || 1) === 1+ readonly property bool integer: parameter.type === "int" || parameter.type === "uint"+ readonly property bool booleanValue: parameter.type === "bool" && scalar+ readonly property bool choiceValue: scalar && (parameter.choices || []).length > 0+ readonly property bool sliderValue: scalar && (parameter.ui_type === "slider" || parameter.ui_type === "drag") && parameter.max > parameter.min+ signal valueEdited(var value)+ spacing: 4++ function valueText(value) {+ if (Array.isArray(value)) return value.join(",")+ if (typeof value === "boolean") return value ? "1" : "0"+ return value === undefined ? "" : String(value)+ }+ // The controller already debounces preview rendering and saving. Commit+ // edits immediately so collapsing an editor cannot discard its last value.+ function commit(value) { valueEdited(value) }+ HoverHandler { id: hover }+ QQC2.ToolTip.visible: hover.hovered && !!parameter.ui_tooltip+ QQC2.ToolTip.text: parameter.ui_tooltip || ""+ QQC2.ToolTip.delay: 650+ Loader {+ width: parent.width+ sourceComponent: root.booleanValue ? booleanEditor : root.choiceValue ? choiceEditor+ : root.sliderValue ? sliderEditor : textEditor+ }+ Component {+ id: booleanEditor+ AppSwitch {+ width: root.width+ label: root.title+ checked: root.shownValue === true || root.shownValue === "true" || Number(root.shownValue) !== 0 && isFinite(Number(root.shownValue))+ onToggled: value => root.commit(value ? 1 : 0)+ }+ }+ Component {+ id: choiceEditor+ AppComboBox {+ width: root.width+ label: root.title+ model: (root.parameter.choices || []).map(function(label, index) { return {label: label, value: index} })+ currentValue: Number(root.shownValue)+ onActivated: value => root.commit(value)+ }+ }+ Component {+ id: sliderEditor+ AppSlider {+ width: root.width+ label: root.title+ from: root.parameter.min; to: root.parameter.max+ precision: root.integer ? 0 : 4+ stepSize: root.integer ? Math.max(1, root.parameter.step || 1) : root.parameter.step || 0.001+ defaultValue: Number(root.parameter.default_value) || 0+ value: Number(root.shownValue) || 0+ onValueModified: value => root.commit(root.integer ? Math.round(value) : value)+ }+ }+ Component {+ id: textEditor+ Row {+ width: root.width+ spacing: 6+ AppTextField {+ width: parent.width - (colorButton.visible ? colorButton.width + 6 : 0)+ label: root.title+ commitOnEveryEdit: false+ text: root.valueText(root.shownValue)+ onTextEdited: value => root.commit(value)+ }+ AppButton {+ id: colorButton+ visible: root.parameter.ui_type === "color" && (root.parameter.components || 1) >= 3+ width: 48+ anchors.bottom: parent.bottom+ text: qsTranslate("App", "Color")+ onClicked: {+ var v = root.valueText(root.shownValue).split(",").map(Number)+ colorDialog.selectedColor = Qt.rgba(v[0] || 0, v[1] || 0, v[2] || 0, v.length > 3 ? v[3] : 1)+ colorDialog.open()+ }+ }+ }+ }+ ColorDialog {+ id: colorDialog+ title: root.title+ options: (root.parameter.components || 1) === 4 ? ColorDialog.ShowAlphaChannel : 0+ onAccepted: {+ var values = [selectedColor.r, selectedColor.g, selectedColor.b]+ if ((root.parameter.components || 1) === 4) values.push(selectedColor.a)+ root.commit(values.join(","))+ }+ }+}diff --git a/src/desktop/qml/controls/InspectorScrollArea.qml b/src/desktop/qml/controls/InspectorScrollArea.qmlnew file mode 100644index 0000000..804ac3e--- /dev/null+++ b/src/desktop/qml/controls/InspectorScrollArea.qml@@ -0,0 +1,124 @@+import QtQuick+import QtQuick.Window++Flickable {+ id: root++ readonly property bool autoScrolling: scrollTimer.running+ property real anchorY: 0+ property real pointerY: 0+ property bool movedWhileHeld: false+ property double previousTick: 0++ function clearControlFocus() {+ var window = root.Window.window+ var item = window ? window.activeFocusItem : null+ var input = item as TextInput+ var edit = item as TextEdit+ if (input) input.deselect()+ else if (edit) edit.deselect()+ // Losing focus commits editable values through their editingFinished handler.+ root.forceActiveFocus(Qt.MouseFocusReason)+ }++ function stopScrolling() { scrollTimer.stop() }++ function startScrolling(y) {+ clearControlFocus()+ if (!interactive || contentHeight <= height) return+ cancelFlick()+ anchorY = y+ pointerY = y+ movedWhileHeld = false+ previousTick = Date.now()+ scrollTimer.start()+ }++ function movePointer(x, y, held) {+ if (x < 0 || x >= width || y < 0 || y >= height) {+ stopScrolling()+ return+ }+ pointerY = y+ if (held && Math.abs(y - anchorY) > 10) movedWhileHeld = true+ }++ onActiveFocusChanged: { if (!activeFocus) stopScrolling() }+ onVisibleChanged: { if (!visible) stopScrolling() }+ onEnabledChanged: { if (!enabled) stopScrolling() }+ onInteractiveChanged: { if (!interactive) stopScrolling() }+ Keys.onEscapePressed: event => {+ event.accepted = root.autoScrolling+ root.stopScrolling()+ }++ Connections {+ target: root.Window.window+ function onActiveChanged() {+ if (!root.Window.window.active) root.stopScrolling()+ }+ }++ Timer {+ id: scrollTimer+ interval: 16+ repeat: true+ onTriggered: {+ var now = Date.now()+ var elapsed = Math.min(0.05, (now - root.previousTick) / 1000)+ root.previousTick = now+ var distance = root.pointerY - root.anchorY+ var offset = Math.max(0, Math.abs(distance) - 10)+ var speed = Math.min(1800, offset * 4 + offset * offset * 0.025)+ var next = root.contentY + (distance < 0 ? -speed : speed) * elapsed+ root.contentY = Math.max(root.originY,+ Math.min(root.originY + Math.max(0, root.contentHeight - root.height), next))+ }+ }++ // Stay behind the controls inside contentItem, whose blank space does not+ // consume presses. Compensate for scrolling to cover the whole viewport.+ MouseArea {+ objectName: "inspectorBlankSpace"+ parent: root.contentItem+ x: 0+ y: root.contentY+ width: root.width+ height: root.height+ z: -1+ acceptedButtons: Qt.LeftButton | Qt.MiddleButton+ preventStealing: (pressedButtons & Qt.MiddleButton) !== 0+ onPressed: mouse => {+ if (mouse.button === Qt.MiddleButton) root.startScrolling(mouse.y)+ else root.clearControlFocus()+ }+ onPositionChanged: mouse => {+ if (root.autoScrolling) root.movePointer(mouse.x, mouse.y, true)+ }+ onReleased: mouse => {+ if (mouse.button === Qt.MiddleButton && root.movedWhileHeld) root.stopScrolling()+ }+ onCanceled: root.stopScrolling()+ }++ MouseArea {+ objectName: "inspectorAutoScrollOverlay"+ parent: root+ anchors.fill: parent+ z: 1000+ visible: root.autoScrolling+ enabled: visible+ hoverEnabled: true+ acceptedButtons: Qt.AllButtons+ preventStealing: true+ cursorShape: Qt.SizeVerCursor+ onPositionChanged: mouse => root.movePointer(mouse.x, mouse.y, false)+ onPressed: root.stopScrolling()+ onExited: root.stopScrolling()+ onWheel: wheel => {+ root.stopScrolling()+ wheel.accepted = false+ }++ }+}diff --git a/src/desktop/qml/views/FrameInterpolationView.qml b/src/desktop/qml/views/FrameInterpolationView.qmlindex 7b7b184..9f3a363 100644--- a/src/desktop/qml/views/FrameInterpolationView.qml+++ b/src/desktop/qml/views/FrameInterpolationView.qml@@ -5,6 +5,7 @@ import "../components"Item {id: root+ objectName: "frameInterpolationView"property var appBridge: nullreadonly property int adaptiveInspectorWidth: width >= 2560 ? 520 : (width >= 1920 ? 460 : (width >= 1600 ? 420 : (width >= 1280 ? 380 : 340)))@@ -66,7 +67,7 @@ Item {Column {anchors.fill: parent- Flickable {+ InspectorScrollArea {width: parent.widthheight: parent.height - actionBar.heightcontentWidth: width@@ -85,7 +86,7 @@ Item {// Card 1: Frame Generation ConfigurationAppCard {width: parent.width- title: qsTranslate("App", "DLSS Frame Generation")+ title: appBridge && appBridge.fiProvider === "FSR 3" ? qsTranslate("App", "FSR Frame Generation") : qsTranslate("App", "DLSS Frame Generation")Column {width: parent.width@@ -93,37 +94,23 @@ Item {AppComboBox {width: parent.width- label: qsTranslate("App", "Target Output Frame Rate")- model: appBridge ? appBridge.fiFpsChoices : []- currentValue: appBridge ? appBridge.fiTargetFps : "60"- onActivated: (v) => { if (appBridge) appBridge.fiTargetFps = v }+ label: qsTranslate("App", "Frame generation provider")+ model: appBridge ? appBridge.fiProviderChoices : []+ currentValue: appBridge ? appBridge.fiProvider : "DLSS"+ onActivated: value => { if (appBridge) appBridge.fiProvider = value }}-- AppSegmentedControl {+ FsrFrameGenerationControls {width: parent.width- label: qsTranslate("App", "DLSS-G Engine")- model: appBridge ? appBridge.fiEngineChoices : []- currentValue: appBridge ? appBridge.fiEngine : "Auto"- onActivated: (v) => { if (appBridge) appBridge.fiEngine = v }+ visible: appBridge && appBridge.fiProvider === "FSR 3"+ appBridge: root.appBridge}- AppComboBox {- objectName: "fgOpticalFlowQuality"+ FrameGenerationControls {width: parent.width- label: qsTranslate("App", "Optical Flow Quality")- model: appBridge ? appBridge.opticalFlowQualityChoices : ["High", "Medium", "Low"]- currentValue: appBridge ? appBridge.fiOpticalFlowQuality : "High"- onActivated: v => { if (appBridge) appBridge.fiOpticalFlowQuality = v; }+ visible: !appBridge || appBridge.fiProvider !== "FSR 3"+ appBridge: root.appBridge}- Text {- width: parent.width- text: appBridge ? appBridge.frameGenerationEstimate : ""- wrapMode: Text.Wrap- font.family: Theme.monoFontFamily- font.pixelSize: Theme.fontSizeSmall- color: Theme.textMuted- }}}diff --git a/src/desktop/qml/views/NeuralRenderingView.qml b/src/desktop/qml/views/NeuralRenderingView.qmlindex a354fba..477561d 100644--- a/src/desktop/qml/views/NeuralRenderingView.qml+++ b/src/desktop/qml/views/NeuralRenderingView.qml@@ -69,6 +69,8 @@ Item {if (id === "scale_method") return qsTranslate("App", "Scaling")if (id === "dlss_super_resolution") return qsTranslate("App", "DLSS Super Resolution")if (id === "dlss_ray_reconstruction") return qsTranslate("App", "DLSS Ray Reconstruction")+ if (id === "fsr_frame_generation") return qsTranslate("App", "FSR Frame Generation")+ if (id === "reshade") return qsTranslate("App", "ReShade")if (id === "super_resolution") return qsTranslate("App", "RTX Super Resolution")if (id === "rtx_video_hdr") return qsTranslate("App", "RTX Video HDR")if (id === "vfx_vsr") return qsTranslate("App", "Video Super Resolution")@@ -84,6 +86,7 @@ Item {Component { id: scaleControls; ScaleMethodControls { appBridge: root.appBridge } }Component { id: dlssControls; DlssSuperResolutionControls { appBridge: root.appBridge } }Component { id: rrControls; RayReconstructionControls { appBridge: root.appBridge } }+ Component { id: reshadeControls; ReShadeControls { appBridge: root.appBridge } }Component { id: superControls; SuperResolutionControls { appBridge: root.appBridge } }Component { id: hdrControls; RtxVideoHdrControls { appBridge: root.appBridge } }Component { id: vfxControls; VfxControls { appBridge: root.appBridge; stageId: parent ? parent.effectStage : "" } }@@ -91,6 +94,7 @@ Item {Component { id: sharpeningControls; SharpeningControls { appBridge: root.appBridge } }Component { id: grainControls; GrainControls { appBridge: root.appBridge } }Component { id: frameControls; FrameGenerationControls { appBridge: root.appBridge } }+ Component { id: fsrControls; FsrFrameGenerationControls { appBridge: root.appBridge } }Row {anchors.fill: parent@@ -173,7 +177,7 @@ Item {}// Scrollable Cards Area- Flickable {+ InspectorScrollArea {id: flickobjectName: "workflowCardsScroll"width: parent.width@@ -250,6 +254,8 @@ Item {: stageId === "scale_method" ? scaleControls: stageId === "dlss_super_resolution" ? dlssControls: stageId === "dlss_ray_reconstruction" ? rrControls+ : stageId === "fsr_frame_generation" ? fsrControls+ : stageId === "reshade" ? reshadeControls: stageId === "super_resolution" ? superControls: stageId === "rtx_video_hdr" ? hdrControls: stageId.indexOf("vfx_") === 0 ? vfxControlsdiff --git a/src/desktop/qml/views/SettingsView.qml b/src/desktop/qml/views/SettingsView.qmlindex eed6fb5..ddb114f 100644--- a/src/desktop/qml/views/SettingsView.qml+++ b/src/desktop/qml/views/SettingsView.qml@@ -56,6 +56,13 @@ Rectangle {currentValue: appBridge ? appBridge.aiGpuUuid : "auto"onActivated: (v) => { if (appBridge) appBridge.aiGpuUuid = v }}+ AppComboBox {+ objectName: "fsr-processing-device"+ width: parent.width; label: qsTranslate("App", "AI Processing GPU (DirectX 12 / FidelityFX)")+ model: appBridge ? appBridge.fsrAdapterChoices : []+ currentValue: appBridge ? appBridge.fsrAdapterId : "auto"+ onActivated: (value) => { if (appBridge) appBridge.fsrAdapterId = value }+ }AppComboBox {objectName: "ffmpeg-vulkan-device"width: parent.width; label: qsTranslate("App", "Decoding / Encoding Device")diff --git a/src/desktop/qml/views/UpscaleView.qml b/src/desktop/qml/views/UpscaleView.qmlindex 3730f8e..b2cab7a 100644--- a/src/desktop/qml/views/UpscaleView.qml+++ b/src/desktop/qml/views/UpscaleView.qml@@ -93,7 +93,7 @@ Item {}// Scrollable Cards Area- Flickable {+ InspectorScrollArea {width: parent.widthheight: parent.height - 48 - actionBar.heightcontentWidth: widthdiff --git a/src/desktop/translations/app_ar.qm b/src/desktop/translations/app_ar.qmindex b4cb360..5d51cff 100644Binary files a/src/desktop/translations/app_ar.qm and b/src/desktop/translations/app_ar.qm differdiff --git a/src/desktop/translations/app_ar.ts b/src/desktop/translations/app_ar.tsindex b562d77..fd6cbbc 100644--- a/src/desktop/translations/app_ar.ts+++ b/src/desktop/translations/app_ar.ts@@ -496,10 +496,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>Cannot start batch: %1</source><translation>تعذر بدء الدفعة: %1</translation></message>- <message>- <source>Cascade</source>- <translation>تسلسل</translation>- </message><message><source>Changes apply immediately.</source><translation>تُطبّق التغييرات فورًا.</translation>@@ -735,7 +731,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>توليد الإطارات باستخدام DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -746,7 +742,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>التصيير العصبي باستخدام DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -758,18 +754,12 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>الدقة الفائقة باستخدام DLSS</translation></message><message><source>DLSS effects: %1</source><translation>تأثيرات DLSS: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>محرك DLSS-G</translation>- </message><message><source>Deblur Modes</source><translation>أوضاع إزالة الضبابية</translation>@@ -1429,10 +1419,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>NR Style</source><translation>نمط NR</translation></message>- <message>- <source>Native DLSSG</source>- <translation>DLSSG الأصلي</translation>- </message><message><source>Natural</source><translation>طبيعي</translation>@@ -1847,13 +1833,13 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>الدقة الفائقة باستخدام RTX</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>فيديو HDR باستخدام RTX</translation></message><message><source>Ready</source>@@ -2656,11 +2642,461 @@ Poster frame shown. Scrub with < > or open the file externally.</source></message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>إعادة بناء الأشعة باستخدام DLSS</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>تستخدم الصور ومقاطع الفيديو المستوردة بيانات تقديرية للمواد. تعتمد النتائج على المصدر.</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>التدفق البصري باستخدام AMD FidelityFX</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>التقنيات النشطة</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>دائماً (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>تلقائي (MoGe-2 ViT-S عند الحاجة)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>تلقائي (مظللات الإعداد المسبق ووقت التشغيل)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>تلقائي (أنسجة الإعداد المسبق ووقت التشغيل)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>اختر ملف إعداد مسبق .ini لـ ReShade</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>إدخال العمق</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>معطل</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>حساسية كشف الخلفية</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>مزج التأثير</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>قلب العمق عمودياً</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>مخزن العمق اللوغاريتمي</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>إيقاف (مكاني لكل إطار)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>جارٍ معالجة فيديو ReShade</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>إعداد ReShade المسبق (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>إعدادات ReShade المسبقة (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>بيئة تشغيل ReShade غير متوفرة.</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>إعادة تحميل الإعداد المسبق</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>تمت إعادة تحميل الإعداد المسبق لـ ReShade.</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>مخزن العمق المعكوس</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>حفظ نسخة من الإعداد المسبق</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>حفظ نسخة من إعداد ReShade المسبق</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>تم حفظ إعداد ReShade المسبق في %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>معلمات المظلل</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>مجلد البحث عن المظللات (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>مزج العمق الزمني</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>مجلد البحث عن الأنسجة و LUT</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>تثبيت حركة الفيديو والعمق</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>إنشاء عمق بالذكاء الاصطناعي دائمًا</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>التدفق البصري</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>إيقاف (عمق لكل إطار)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>يتطلب هذا الإعداد عمقًا. اختر تلقائي أو دائمًا.</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>يوفر عمق الذكاء الاصطناعي البيانات للتأثيرات التي تحتاج إلى عمق المشهد. يثبته الوضع التلقائي في الفيديو باستخدام AMD Optical Flow.</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>لا يحتاج هذا الإعداد إلى عمق الذكاء الاصطناعي أو معالجة الحركة. يتجاوز الوضع التلقائي هذا العمل.</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>التقنيات والإعدادات</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>إعادة ضبط القيم</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>البحث عن التأثيرات والمعلمات…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>تم تفعيل %1</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>إيقاف</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>تشوه عين السمكة معطل افتراضيًا. فعّل التقنية لتطبيقه.</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>فعّل تقنية أعلاه لتطبيق هذا التأثير.</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>تفاصيل العمق</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>دقة التأثيرات</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>معالجة HDR</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>الحفاظ على شفافية المصدر</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>إظهار معلمات المظلل الداخلية</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+محاذاة عمق الفيديو · التدفق البصري باستخدام AMD FidelityFX</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>اختر إعدادًا مسبقًا للبدء.</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>تم تفعيل %1 تقنية · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>عمق الذكاء الاصطناعي مفعّل</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>العمق غير مطلوب أو معطل</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>مفعّل</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>متقدم</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>توليد الإطارات FSR</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>معالج الرسومات للمعالجة</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>توليد الإطارات متاح</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>محوّل FSR المحدد غير متاح</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>لم يُكتشف محوّل FSR متوافق</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>تقنية توليد الإطارات</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>ذاكرة رسومات مشتركة</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>معالج الرسوميات لمعالجة الذكاء الاصطناعي (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>الدقة الفائقة للفيديو باستخدام RTX</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>سريع (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>قياسي (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>عالٍ (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>أقصى (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>التوافق مع sRGB بعمق 8 بت</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>تلقائي (محوّل الإعدادات المسبقة لـ SDR)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>إعداد مسبق يدعم HDR</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>محوّل SDR</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>رفض غير المدعوم</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 إطار/ث</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>إطار/ث</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>لم يتم اكتشاف وحدة معالجة رسومات NVIDIA أو FSR متوافقة مع DirectX 12.</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>فشل التنزيل من الحافظة: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>لم يحتوِ رابط الحافظة على صورة قابلة للقراءة.</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>جارٍ فحص ملفات الإدخال…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>الملفات المضافة: %1.</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>جارٍ تصيير المعاينة…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>المعاينة جاهزة.</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>تم تحديث المعاينة؛ في انتظار أحدث طلب.</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>جارٍ معالجة الدفعة…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>اكتمل: %1، فشل: %2.</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>جارٍ استيفاء إطارات الفيديو</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>استخدم محركًا واحدًا لتوليد الإطارات لكل سير عمل. اختر DLSS أو AMD FSR أو VFX لتوليد الإطارات.</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>يتطلب التصيير العصبي باستخدام DLSS إدخالًا بأبعاد 64 × 64 على الأقل.</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>لا يمكن للتحجيم معالجة فيديو HDR في هذا الموضع. انقله قبل التحويل إلى HDR.</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>أبعاد الإخراج المطلوبة أقل من الحد الأدنى المدعوم البالغ 64 × 64.</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>لا يمكن للدقة الفائقة باستخدام DLSS معالجة فيديو HDR في هذا الموضع. انقلها قبل التحويل إلى HDR.</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>تتطلب إعادة بناء الأشعة تحديد PQ أو HLG صراحةً لفيديو HDR.</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>لا يمكن للدقة الفائقة باستخدام RTX معالجة فيديو HDR في هذا الموضع. انقلها قبل التحويل إلى HDR.</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>تعمل مؤثرات الفيديو من NVIDIA مع الفيديو فقط.</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>لا يحتوي إعداد NVIDIA VFX المسبق القديم على أي مؤثر مفعّل.</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>يتطلب مؤثر الفيديو هذا SDR في هذا الموضع. انقل بطاقته قبل التحويل إلى HDR.</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>يتطلب فيديو HDR باستخدام RTX إدخال SDR في هذا الموضع.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>يتطلب توليد الإطارات باستخدام FSR أبعادًا لا تقل عن 64 × 64 بكسل.</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>يدعم توليد الإطارات باستخدام FSR ما يصل إلى 16384 بكسل لكل ضلع.</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>يجب أن يتجاوز معدل الإطارات المستهدف لتوليد الإطارات معدل الإدخال إلى هذه البطاقة. اختر معدلًا مستهدفًا أعلى.</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>يتطلب تحسين الحدة فيديو SDR في هذا الموضع. انقله قبل التحويل إلى HDR.</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>ملف LUT بصيغة .cube المحدد غير متاح.</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>إعداد ReShade المسبق بصيغة .ini المحدد غير متاح.</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>يتطلب ReShade إدخالًا بأبعاد 16 × 16 على الأقل.</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>لا يدعم الترميز المحدد هذه الحاوية.</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>يتطلب تصدير الفيديو أبعاد إخراج ذات أعداد زوجية.</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>يتطلب إخراج HDR تفعيل وضع HDR بعمق 10 بت في إعدادات التصدير.</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>يتطلب HDR ترميز فيديو بعمق 10 بت أو أكثر.</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>اللاحقة المخصصة فارغة أو تحتوي على أحرف غير صالحة لأسماء الملفات.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>يتطلب توليد الإطارات باستخدام FSR ترميز GPU باستخدام H.264 أو HEVC أو AV1. اختر ترميزًا مدعومًا.</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>ترميز GPU غير متاح لمحوّل DirectX المحدد لـ FSR</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>يتطلب إدخال HDR في FSR وضع HDR وترميز إخراج بعمق 10 بت</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_de.qm b/src/desktop/translations/app_de.qmindex eb3c538..8f64a51 100644Binary files a/src/desktop/translations/app_de.qm and b/src/desktop/translations/app_de.qm differdiff --git a/src/desktop/translations/app_de.ts b/src/desktop/translations/app_de.tsindex 1a441e5..9d25996 100644--- a/src/desktop/translations/app_de.ts+++ b/src/desktop/translations/app_de.ts@@ -480,10 +480,6 @@ Standbild angezeigt. Mit < > navigieren oder Datei extern öffnen.</transl<source>Cannot start batch: %1</source><translation>Stapel kann nicht gestartet werden: %1</translation></message>- <message>- <source>Cascade</source>- <translation>Kaskade</translation>- </message><message><source>Changes apply immediately.</source><translation>Änderungen werden sofort übernommen.</translation>@@ -719,7 +715,7 @@ Standbild angezeigt. Mit < > navigieren oder Datei extern öffnen.</transl<location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>DLSS-Framegenerierung</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -730,7 +726,7 @@ Standbild angezeigt. Mit < > navigieren oder Datei extern öffnen.</transl<message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>Neuronales Rendering mit DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -742,18 +738,12 @@ Standbild angezeigt. Mit < > navigieren oder Datei extern öffnen.</transl<location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>DLSS-Superauflösung</translation></message><message><source>DLSS effects: %1</source><translation>DLSS-Effekte: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>DLSS-G-Engine</translation>- </message><message><source>Deblur Modes</source><translation>Modi zur Unschärfereduzierung</translation>@@ -1413,10 +1403,6 @@ Standbild angezeigt. Mit < > navigieren oder Datei extern öffnen.</transl<source>NR Style</source><translation>NR-Stil</translation></message>- <message>- <source>Native DLSSG</source>- <translation>Nativer DLSSG</translation>- </message><message><source>Natural</source><translation>Natürlich</translation>@@ -1831,13 +1817,13 @@ Standbild angezeigt. Mit < > navigieren oder Datei extern öffnen.</transl<message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>RTX-Superauflösung</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>RTX-HDR-Video</translation></message><message><source>Ready</source>@@ -2640,11 +2626,461 @@ Standbild angezeigt. Mit < > navigieren oder Datei extern öffnen.</transl</message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>DLSS-Strahlenrekonstruktion</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>Importierte Bilder und Videos verwenden geschätzte Materialdaten. Die Ergebnisse hängen von der Quelle ab.</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>Optischer Fluss mit AMD FidelityFX</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>Aktive Techniken</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>Immer (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>Automatisch (MoGe-2 ViT-S bei Bedarf)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>Automatisch (Preset- & Laufzeit-Shader)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>Automatisch (Preset- & Laufzeit-Texturen)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>ReShade-.ini-Preset auswählen</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>Tiefeneingabe</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>Deaktiviert</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>Disokklusions-Empfindlichkeit</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>Effekt-Mix</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>Tiefe vertikal spiegeln</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>Logarithmischer Tiefenpuffer</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>Aus (Räumlich pro Bild)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>ReShade-Video wird verarbeitet</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>ReShade-Preset (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>ReShade-Presets (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>ReShade-Laufzeit nicht verfügbar.</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>Preset neu laden</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>ReShade-Preset neu geladen.</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>Umgekehrter Tiefenpuffer</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>Preset-Kopie speichern</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>ReShade-Preset-Kopie speichern</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>ReShade-Preset gespeichert unter %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>Shader-Parameter</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>Shader-Suchordner (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>Zeitliche Tiefenüberblendung</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>Textur- & LUT-Suchordner</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>Videobewegung & Tiefenstabilisierung</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>KI-Tiefe immer erzeugen</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>Optischer Fluss</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>Aus (Tiefe pro Einzelbild)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>Diese Voreinstellung benötigt Tiefe. Wählen Sie Automatisch oder Immer.</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>KI-Tiefe versorgt Effekte mit Szenentiefe. Automatisch stabilisiert sie in Videos mit AMD Optical Flow.</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>Diese Voreinstellung benötigt weder KI-Tiefe noch Bewegungsverarbeitung. Automatisch überspringt diese Arbeit.</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>Techniken und Einstellungen</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>Werte zurücksetzen</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>Effekte und Parameter suchen…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>%1 aktiviert</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>Aus</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>Die Fischaugenverzerrung ist standardmäßig aus. Aktivieren Sie die Technik zum Anwenden.</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>Aktivieren Sie oben eine Technik, um diesen Effekt anzuwenden.</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>Tiefendetails</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>Effektpräzision</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>HDR-Verarbeitung</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>Quelltransparenz erhalten</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>Interne Shader-Parameter anzeigen</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+Tiefenausrichtung im Video · Optischer Fluss mit AMD FidelityFX</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>Wählen Sie eine Voreinstellung, um zu beginnen.</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>%1 Technik(en) aktiviert · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>KI-Tiefe aktiviert</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>Tiefe nicht erforderlich oder deaktiviert</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>Aktiviert</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>Erweitert</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>FSR-Frame-Generierung</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>GPU für die Verarbeitung</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>Frame-Generierung verfügbar</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>Der ausgewählte FSR-Adapter ist nicht verfügbar</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>Kein kompatibler FSR-Adapter erkannt</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>Technologie für Frame-Generierung</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>Gemeinsam genutzter GPU-Speicher</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>KI-Verarbeitungs-GPU (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>RTX-Video-Superauflösung</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>Schnell (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>Standard (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>Hoch (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>Maximum (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>8-Bit-sRGB-Kompatibilität</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>Auto (SDR-Preset-Adapter)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>HDR-fähiges Preset</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>SDR-Adapter</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>Nicht unterstützte ablehnen</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 Bilder/s</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>Bilder/s</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>Es wurde keine kompatible NVIDIA- oder FSR-DirectX-12-GPU erkannt.</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>Download aus der Zwischenablage fehlgeschlagen: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>Die URL in der Zwischenablage enthielt kein lesbares Bild.</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>Eingabedateien werden durchsucht…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>Hinzugefügte Dateien: %1.</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>Vorschau wird gerendert…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>Vorschau bereit.</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>Vorschau aktualisiert; die neueste Anfrage wird erwartet.</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>Stapel wird verarbeitet…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>Abgeschlossen: %1, fehlgeschlagen: %2.</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>Videobilder werden interpoliert</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>Verwenden Sie pro Workflow nur eine Framegenerierungs-Engine. Wählen Sie DLSS, AMD FSR oder VFX-Framegenerierung.</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>Neuronales Rendering mit DLSS erfordert eine Eingabe von mindestens 64 × 64 Pixeln.</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>Die Skalierung kann HDR-Video an dieser Position nicht verarbeiten. Verschieben Sie sie vor die HDR-Konvertierung.</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>Die angeforderte Ausgabe liegt unter dem unterstützten Minimum von 64 × 64 Pixeln.</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>DLSS-Superauflösung kann HDR-Video an dieser Position nicht verarbeiten. Verschieben Sie sie vor die HDR-Konvertierung.</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>Die Strahlenrekonstruktion erfordert für HDR-Video eine ausdrückliche PQ- oder HLG-Kennzeichnung.</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>RTX-Superauflösung kann HDR-Video an dieser Position nicht verarbeiten. Verschieben Sie sie vor die HDR-Konvertierung.</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects ist nur für Videos verfügbar.</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>Im älteren NVIDIA-VFX-Preset ist kein Effekt aktiviert.</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>Dieser Videoeffekt erfordert an dieser Position SDR. Verschieben Sie seine Karte vor die HDR-Konvertierung.</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>RTX-HDR-Video erfordert an dieser Position SDR.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>FSR-Framegenerierung erfordert mindestens 64 × 64 Pixel.</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>FSR-Framegenerierung unterstützt bis zu 16384 Pixel pro Seite.</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>Die Zielbildrate der Framegenerierung muss höher als die Eingangsbildrate dieser Karte sein. Wählen Sie eine höhere Zielbildrate.</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>Das Schärfen erfordert an dieser Position SDR-Video. Verschieben Sie es vor die HDR-Konvertierung.</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>Die ausgewählte .cube-LUT ist nicht verfügbar.</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>Das ausgewählte ReShade-.ini-Preset ist nicht verfügbar.</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade erfordert eine Eingabe von mindestens 16 × 16 Pixeln.</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>Der ausgewählte Codec unterstützt diesen Container nicht.</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>Der Videoexport erfordert gerade Ausgabemaße.</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>HDR-Ausgabe erfordert den 10-Bit-HDR-Modus in den Exporteinstellungen.</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR erfordert einen Videocodec mit mindestens 10 Bit.</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>Das benutzerdefinierte Suffix ist leer oder enthält ungültige Dateinamenzeichen.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>FSR-Framegenerierung erfordert GPU-Codierung mit H.264, HEVC oder AV1. Wählen Sie einen unterstützten Codec.</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>GPU-Codierung ist für den ausgewählten FSR-DirectX-Adapter nicht verfügbar</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>HDR-Eingabe für FSR erfordert den HDR-Modus und einen 10-Bit-Ausgabecodec</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_es.qm b/src/desktop/translations/app_es.qmindex 83f76bb..9b5fc08 100644Binary files a/src/desktop/translations/app_es.qm and b/src/desktop/translations/app_es.qm differdiff --git a/src/desktop/translations/app_es.ts b/src/desktop/translations/app_es.tsindex caa838e..500bb32 100644--- a/src/desktop/translations/app_es.ts+++ b/src/desktop/translations/app_es.ts@@ -480,10 +480,6 @@ Se muestra un fotograma. Navega con < > o abre el archivo externamente.</t<source>Cannot start batch: %1</source><translation>No se puede iniciar el lote: %1</translation></message>- <message>- <source>Cascade</source>- <translation>Cascada</translation>- </message><message><source>Changes apply immediately.</source><translation>Los cambios se aplican de inmediato.</translation>@@ -719,7 +715,7 @@ Se muestra un fotograma. Navega con < > o abre el archivo externamente.</t<location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>Generación de fotogramas DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -730,7 +726,7 @@ Se muestra un fotograma. Navega con < > o abre el archivo externamente.</t<message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>Renderizado neuronal DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -742,18 +738,12 @@ Se muestra un fotograma. Navega con < > o abre el archivo externamente.</t<location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>Superresolución DLSS</translation></message><message><source>DLSS effects: %1</source><translation>Efectos DLSS: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>Motor DLSS-G</translation>- </message><message><source>Deblur Modes</source><translation>Modos de eliminación de desenfoque</translation>@@ -1413,10 +1403,6 @@ Se muestra un fotograma. Navega con < > o abre el archivo externamente.</t<source>NR Style</source><translation>Estilo NR</translation></message>- <message>- <source>Native DLSSG</source>- <translation>DLSSG nativo</translation>- </message><message><source>Natural</source><translation>Natural</translation>@@ -1831,13 +1817,13 @@ Se muestra un fotograma. Navega con < > o abre el archivo externamente.</t<message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>Superresolución RTX</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>Vídeo HDR RTX</translation></message><message><source>Ready</source>@@ -2640,11 +2626,461 @@ Se muestra un fotograma. Navega con < > o abre el archivo externamente.</t</message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>Reconstrucción de rayos DLSS</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>Las imágenes y los vídeos importados usan datos de materiales estimados. Los resultados dependen de la fuente.</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>Flujo óptico AMD FidelityFX</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>Técnicas activas</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>Siempre (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>Automático (MoGe-2 ViT-S cuando sea necesario)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>Automático (shaders del preajuste y del entorno)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>Automático (texturas del preajuste y del entorno)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>Elegir un preajuste .ini de ReShade</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>Entrada de profundidad</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>Desactivado</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>Sensibilidad de desoclusión</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>Mezcla del efecto</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>Invertir profundidad verticalmente</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>Búfer de profundidad logarítmico</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>Desactivado (espacial por fotograma)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>Procesando video con ReShade</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>Preajuste de ReShade (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>Preajustes de ReShade (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>Entorno de ejecución de ReShade no disponible.</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>Recargar preajuste</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>Preajuste de ReShade recargado.</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>Búfer de profundidad invertido</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>Guardar copia del preajuste</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>Guardar copia del preajuste de ReShade</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>Preajuste de ReShade guardado en %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>Parámetros de shader</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>Carpeta de búsqueda de shaders (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>Mezcla temporal de profundidad</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>Carpeta de búsqueda de texturas y LUT</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>Movimiento de video y estabilización de profundidad</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>Generar siempre profundidad con IA</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>Flujo óptico</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>Desactivado (profundidad por fotograma)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>Este preajuste necesita profundidad. Selecciona Automático o Siempre.</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>La profundidad IA alimenta los efectos que necesitan profundidad de escena. Automático la estabiliza en vídeo con AMD Optical Flow.</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>Este preajuste no necesita profundidad IA ni procesamiento de movimiento. Automático omite ese trabajo.</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>Técnicas y ajustes</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>Restablecer valores</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>Buscar efectos y parámetros…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>%1 activadas</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>Desactivado</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>La distorsión de ojo de pez está desactivada por defecto. Activa la técnica para aplicarla.</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>Activa una técnica arriba para aplicar este efecto.</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>Detalle de profundidad</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>Precisión de efectos</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>Procesamiento HDR</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>Conservar transparencia original</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>Mostrar parámetros internos del shader</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+Alineación de profundidad del vídeo · Flujo óptico AMD FidelityFX</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>Selecciona un preajuste para empezar.</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>%1 técnica(s) activada(s) · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>Profundidad IA activada</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>Profundidad innecesaria o desactivada</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>Activado</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>Avanzado</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>Generación de fotogramas FSR</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>GPU de procesamiento</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>Generación de fotogramas disponible</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>El adaptador FSR seleccionado no está disponible</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>No se detectó ningún adaptador FSR compatible</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>Tecnología de generación de fotogramas</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>Memoria GPU compartida</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>GPU de procesamiento de IA (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>Superresolución de vídeo RTX</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>Rápido (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>Estándar (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>Alto (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>Máximo (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>Compatibilidad con sRGB de 8 bits</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>Auto (adaptador de preajustes SDR)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>Preajuste compatible con HDR</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>Adaptador SDR</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>Rechazar los no compatibles</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 FPS</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>FPS</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>No se ha detectado ninguna GPU NVIDIA o FSR compatible con DirectX 12.</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>Error al descargar desde el portapapeles: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>La URL del portapapeles no contenía una imagen legible.</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>Examinando archivos de entrada…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>Archivos añadidos: %1.</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>Renderizando vista previa…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>Vista previa lista.</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>Vista previa actualizada; esperando la última solicitud.</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>Procesando lote…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>Completados: %1; fallidos: %2.</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>Interpolando fotogramas de vídeo</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>Utilice un solo motor de generación de fotogramas por flujo de trabajo. Seleccione DLSS, AMD FSR o VFX.</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>El renderizado neuronal DLSS requiere una entrada de al menos 64 × 64 píxeles.</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>El escalado no puede procesar vídeo HDR en esta posición. Muévalo antes de la conversión a HDR.</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>La salida solicitada es inferior al mínimo admitido de 64 × 64 píxeles.</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>La superresolución DLSS no puede procesar vídeo HDR en esta posición. Muévala antes de la conversión a HDR.</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>La reconstrucción de rayos requiere una señalización explícita PQ o HLG para vídeo HDR.</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>La superresolución RTX no puede procesar vídeo HDR en esta posición. Muévala antes de la conversión a HDR.</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects solo está disponible para vídeo.</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>El preajuste antiguo de NVIDIA VFX no tiene ningún efecto activado.</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>Este efecto de vídeo requiere SDR en esta posición. Mueva su tarjeta antes de la conversión a HDR.</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>El vídeo HDR RTX requiere SDR en esta posición.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>La generación de fotogramas FSR requiere al menos 64 × 64 píxeles.</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>La generación de fotogramas FSR admite hasta 16384 píxeles por lado.</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>La tasa de fotogramas objetivo debe superar la tasa de entrada de esta tarjeta. Elija una tasa objetivo superior.</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>El enfoque requiere vídeo SDR en esta posición. Muévalo antes de la conversión a HDR.</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>La LUT .cube seleccionada no está disponible.</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>El preajuste .ini de ReShade seleccionado no está disponible.</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade requiere una entrada de al menos 16 × 16 píxeles.</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>El códec seleccionado no admite este contenedor.</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>La exportación de vídeo requiere dimensiones de salida pares.</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>La salida HDR requiere el modo HDR de 10 bits en los ajustes de exportación.</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR requiere un códec de vídeo de 10 bits o más.</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>El sufijo personalizado está vacío o contiene caracteres no válidos para nombres de archivo.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>La generación de fotogramas FSR requiere codificación GPU con H.264, HEVC o AV1. Seleccione un códec compatible.</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>La codificación GPU no está disponible para el adaptador DirectX de FSR seleccionado</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>La entrada HDR de FSR requiere el modo HDR y un códec de salida de 10 bits</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_fr.qm b/src/desktop/translations/app_fr.qmindex 24c7092..0ad4ff5 100644Binary files a/src/desktop/translations/app_fr.qm and b/src/desktop/translations/app_fr.qm differdiff --git a/src/desktop/translations/app_fr.ts b/src/desktop/translations/app_fr.tsindex d1198b9..668f545 100644--- a/src/desktop/translations/app_fr.ts+++ b/src/desktop/translations/app_fr.ts@@ -480,10 +480,6 @@ Image fixe affichée. Parcourez avec < > ou ouvrez le fichier dans une app<source>Cannot start batch: %1</source><translation>Impossible de démarrer le lot : %1</translation></message>- <message>- <source>Cascade</source>- <translation>Cascade</translation>- </message><message><source>Changes apply immediately.</source><translation>Les modifications s’appliquent immédiatement.</translation>@@ -719,7 +715,7 @@ Image fixe affichée. Parcourez avec < > ou ouvrez le fichier dans une app<location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>Génération d’images DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -730,7 +726,7 @@ Image fixe affichée. Parcourez avec < > ou ouvrez le fichier dans une app<message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>Rendu neuronal DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -742,18 +738,12 @@ Image fixe affichée. Parcourez avec < > ou ouvrez le fichier dans une app<location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>Super-résolution DLSS</translation></message><message><source>DLSS effects: %1</source><translation>Effets DLSS : %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>Moteur DLSS-G</translation>- </message><message><source>Deblur Modes</source><translation>Modes de réduction du flou</translation>@@ -1413,10 +1403,6 @@ Image fixe affichée. Parcourez avec < > ou ouvrez le fichier dans une app<source>NR Style</source><translation>Style NR</translation></message>- <message>- <source>Native DLSSG</source>- <translation>DLSSG natif</translation>- </message><message><source>Natural</source><translation>Naturel</translation>@@ -1831,13 +1817,13 @@ Image fixe affichée. Parcourez avec < > ou ouvrez le fichier dans une app<message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>Super-résolution RTX</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>Vidéo HDR RTX</translation></message><message><source>Ready</source>@@ -2640,11 +2626,461 @@ Image fixe affichée. Parcourez avec < > ou ouvrez le fichier dans une app</message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>Reconstruction de rayons DLSS</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>Les images et vidéos importées utilisent des données de matériaux estimées. Les résultats dépendent de la source.</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>Flux optique AMD FidelityFX</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>Techniques actives</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>Toujours (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>Auto (MoGe-2 ViT-S si requis)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>Automatique (shaders du préréglage et du runtime)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>Automatique (textures du préréglage et du runtime)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>Choisir un préréglage .ini ReShade</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>Entrée de profondeur</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>Désactivé</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>Sensibilité de désocclusion</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>Mixage de l'effet</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>Inverser la profondeur verticalement</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>Tampon de profondeur logarithmique</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>Désactivé (spatial par image)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>Traitement de la vidéo ReShade</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>Préréglage ReShade (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>Préréglages ReShade (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>Runtime ReShade indisponible.</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>Recharger le préréglage</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>Préréglage ReShade rechargé.</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>Tampon de profondeur inversé</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>Enregistrer une copie du préréglage</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>Enregistrer une copie du préréglage ReShade</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>Préréglage ReShade enregistré dans %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>Paramètres des shaders</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>Dossier de recherche des shaders (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>Fusion temporelle de profondeur</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>Dossier de recherche des textures et LUT</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>Mouvement vidéo et stabilisation de profondeur</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>Toujours générer la profondeur IA</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>Flux optique</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>Désactivé (profondeur par image)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>Ce préréglage nécessite la profondeur. Choisissez Automatique ou Toujours.</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>La profondeur IA alimente les effets nécessitant la profondeur de scène. Automatique la stabilise dans les vidéos avec AMD Optical Flow.</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>Ce préréglage ne nécessite ni profondeur IA ni traitement du mouvement. Automatique ignore ce travail.</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>Techniques et réglages</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>Réinitialiser les valeurs</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>Rechercher des effets et paramètres…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>%1 activées</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>Désactivé</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>La distorsion fisheye est désactivée par défaut. Activez la technique pour l’appliquer.</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>Activez une technique ci-dessus pour appliquer cet effet.</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>Détail de profondeur</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>Précision des effets</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>Traitement HDR</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>Conserver la transparence source</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>Afficher les paramètres internes des shaders</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+Alignement de la profondeur vidéo · Flux optique AMD FidelityFX</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>Choisissez un préréglage pour commencer.</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>%1 technique(s) activée(s) · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>Profondeur IA activée</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>Profondeur inutile ou désactivée</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>Activé</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>Avancé</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>Génération d’images FSR</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>GPU de traitement</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>Génération d’images disponible</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>L’adaptateur FSR sélectionné est indisponible</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>Aucun adaptateur FSR compatible détecté</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>Technologie de génération d’images</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>Mémoire GPU partagée</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>GPU de traitement IA (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>Super-résolution vidéo RTX</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>Rapide (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>Standard (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>Élevé (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>Maximum (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>Compatibilité sRGB 8 bits</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>Auto (adaptateur de préréglages SDR)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>Préréglage compatible HDR</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>Adaptateur SDR</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>Refuser les éléments non pris en charge</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 i/s</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>i/s</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>Aucun GPU NVIDIA ou FSR compatible DirectX 12 n’a été détecté.</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>Échec du téléchargement depuis le presse-papiers : %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>L’URL du presse-papiers ne contenait pas d’image lisible.</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>Analyse des fichiers d’entrée…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>Fichiers ajoutés : %1.</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>Rendu de l’aperçu…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>Aperçu prêt.</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>Aperçu mis à jour ; en attente de la dernière demande.</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>Traitement du lot…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>Terminés : %1 ; échecs : %2.</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>Interpolation des images vidéo</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>Utilisez un seul moteur de génération d’images par flux de travail. Choisissez DLSS, AMD FSR ou VFX.</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>Le rendu neuronal DLSS exige une entrée d’au moins 64 × 64 pixels.</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>La mise à l’échelle ne peut pas traiter de vidéo HDR à cet emplacement. Déplacez-la avant la conversion HDR.</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>La sortie demandée est inférieure au minimum pris en charge de 64 × 64 pixels.</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>La super-résolution DLSS ne peut pas traiter de vidéo HDR à cet emplacement. Déplacez-la avant la conversion HDR.</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>La reconstruction de rayons exige une signalisation explicite PQ ou HLG pour les vidéos HDR.</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>La super-résolution RTX ne peut pas traiter de vidéo HDR à cet emplacement. Déplacez-la avant la conversion HDR.</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects est réservé aux vidéos.</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>L’ancien préréglage NVIDIA VFX ne contient aucun effet activé.</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>Cet effet vidéo exige du SDR à cet emplacement. Déplacez sa carte avant la conversion HDR.</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>La vidéo HDR RTX exige du SDR à cet emplacement.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>La génération d’images FSR exige au moins 64 × 64 pixels.</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>La génération d’images FSR prend en charge jusqu’à 16384 pixels par côté.</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>La fréquence d’images cible doit dépasser celle à l’entrée de cette carte. Choisissez une fréquence cible plus élevée.</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>L’accentuation exige une vidéo SDR à cet emplacement. Déplacez-la avant la conversion HDR.</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>La LUT .cube sélectionnée est indisponible.</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>Le préréglage ReShade .ini sélectionné est indisponible.</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade exige une entrée d’au moins 16 × 16 pixels.</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>Le codec sélectionné ne prend pas en charge ce conteneur.</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>L’exportation vidéo exige des dimensions de sortie paires.</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>La sortie HDR exige le mode HDR 10 bits dans les paramètres d’exportation.</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>Le HDR exige un codec vidéo de 10 bits ou plus.</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>Le suffixe personnalisé est vide ou contient des caractères non valides pour un nom de fichier.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>La génération d’images FSR exige un encodage GPU en H.264, HEVC ou AV1. Choisissez un codec pris en charge.</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>L’encodage GPU est indisponible pour l’adaptateur DirectX FSR sélectionné</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>L’entrée HDR de FSR exige le mode HDR et un codec de sortie 10 bits</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_hi.qm b/src/desktop/translations/app_hi.qmindex 9731b0c..bd91ba2 100644Binary files a/src/desktop/translations/app_hi.qm and b/src/desktop/translations/app_hi.qm differdiff --git a/src/desktop/translations/app_hi.ts b/src/desktop/translations/app_hi.tsindex ce3530b..f703cfb 100644--- a/src/desktop/translations/app_hi.ts+++ b/src/desktop/translations/app_hi.ts@@ -480,10 +480,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>Cannot start batch: %1</source><translation>बैच शुरू नहीं हो सकता: %1</translation></message>- <message>- <source>Cascade</source>- <translation>कैस्केड</translation>- </message><message><source>Changes apply immediately.</source><translation>बदलाव तुरंत लागू होते हैं।</translation>@@ -719,7 +715,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>DLSS फ़्रेम जनरेशन</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -730,7 +726,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>DLSS न्यूरल रेंडरिंग</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -742,18 +738,12 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>DLSS सुपर रिज़ॉल्यूशन</translation></message><message><source>DLSS effects: %1</source><translation>DLSS प्रभाव: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>DLSS-G इंजन</translation>- </message><message><source>Deblur Modes</source><translation>धुंधलापन हटाने के मोड</translation>@@ -1413,10 +1403,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>NR Style</source><translation>NR शैली</translation></message>- <message>- <source>Native DLSSG</source>- <translation>नेटिव DLSSG</translation>- </message><message><source>Natural</source><translation>प्राकृतिक</translation>@@ -1831,13 +1817,13 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>RTX सुपर रिज़ॉल्यूशन</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>RTX HDR वीडियो</translation></message><message><source>Ready</source>@@ -2640,11 +2626,461 @@ Poster frame shown. Scrub with < > or open the file externally.</source></message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>DLSS रे रिकंस्ट्रक्शन</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>आयातित छवियों और वीडियो में सामग्री के अनुमानित संकेतों का उपयोग होता है। परिणाम स्रोत पर निर्भर करते हैं।</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>AMD FidelityFX ऑप्टिकल फ़्लो</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>सक्रिय तकनीकें</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>हमेशा (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>स्वचालित (आवश्यकता पड़ने पर MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>स्वचालित (प्रीसेट और रनटाइम शेडर्स)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>स्वचालित (प्रीसेट और रनटाइम टेक्सचर)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>ReShade .ini प्रीसेट चुनें</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>गहराई इनपुट</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>अक्षम</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>डिसऑक्लूज़न संवेदनशीलता</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>प्रभाव मिश्रण</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>गहराई को लंबवत पलटें</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>लघुगणकीय गहराई बफर</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>बंद (प्रति-फ़्रेम स्थानिक)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>ReShade वीडियो प्रोसेस हो रहा है</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>ReShade प्रीसेट (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>ReShade प्रीसेट (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>ReShade रनटाइम अनुपलब्ध है।</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>प्रीसेट रीलोड करें</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>ReShade प्रीसेट रीलोड किया गया।</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>उलटा गहराई बफर</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>प्रीसेट की प्रति सहेजें</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>ReShade प्रीसेट की प्रति सहेजें</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>ReShade प्रीसेट को %1 में सहेजा गया</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>शेडर पैरामीटर</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>शेडर खोज फ़ोल्डर (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>टेम्पोरल गहराई मिश्रण</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>टेक्सचर और LUT खोज फ़ोल्डर</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>वीडियो गति और गहराई स्थिरीकरण</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>हमेशा AI गहराई बनाएँ</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>ऑप्टिकल फ़्लो</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>बंद (हर फ़्रेम की गहराई)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>इस प्रीसेट को गहराई चाहिए। स्वचालित या हमेशा चुनें।</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>AI गहराई दृश्य की गहराई वाले प्रभावों के लिए है। स्वचालित मोड AMD Optical Flow से वीडियो की गहराई स्थिर करता है।</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>इस प्रीसेट को AI गहराई या गति प्रसंस्करण की आवश्यकता नहीं है। स्वचालित मोड यह काम छोड़ देता है।</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>तकनीकें और सेटिंग्स</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>मान रीसेट करें</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>प्रभाव और पैरामीटर खोजें…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>%1 सक्षम</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>बंद</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>फ़िशआई विकृति डिफ़ॉल्ट रूप से बंद है। लागू करने के लिए तकनीक सक्षम करें।</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>यह प्रभाव लागू करने के लिए ऊपर कोई तकनीक सक्षम करें।</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>गहराई का विवरण</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>प्रभाव की परिशुद्धता</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>HDR प्रसंस्करण</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>स्रोत की पारदर्शिता बनाए रखें</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>आंतरिक शेडर पैरामीटर दिखाएँ</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+वीडियो की गहराई का संरेखण · AMD FidelityFX ऑप्टिकल फ़्लो</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>शुरू करने के लिए प्रीसेट चुनें।</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>%1 तकनीकें सक्षम · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>AI गहराई सक्षम</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>गहराई अनावश्यक या बंद</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>सक्षम</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>उन्नत</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>FSR फ़्रेम जनरेशन</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>प्रोसेसिंग GPU</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>फ़्रेम जनरेशन उपलब्ध है</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>चुना गया FSR एडाप्टर उपलब्ध नहीं है</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>कोई संगत FSR एडाप्टर नहीं मिला</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>फ़्रेम जनरेशन तकनीक</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>साझा GPU मेमोरी</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>AI प्रोसेसिंग GPU (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>RTX वीडियो सुपर रिज़ॉल्यूशन</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>तेज़ (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>मानक (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>उच्च (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>अधिकतम (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>8-बिट sRGB संगतता</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>स्वचालित (SDR प्रीसेट अडैप्टर)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>HDR समर्थित प्रीसेट</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>SDR अडैप्टर</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>असमर्थित को अस्वीकार करें</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 फ़्रेम/सेकंड</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>फ़्रेम/सेकंड</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>DirectX 12 के साथ संगत कोई NVIDIA या FSR GPU नहीं मिला।</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>क्लिपबोर्ड से डाउनलोड विफल: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>क्लिपबोर्ड के URL में पढ़ने योग्य छवि नहीं थी।</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>इनपुट फ़ाइलें स्कैन की जा रही हैं…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>जोड़ी गई फ़ाइलें: %1।</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>प्रीव्यू रेंडर किया जा रहा है…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>प्रीव्यू तैयार है।</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>प्रीव्यू अपडेट हुआ; नवीनतम अनुरोध की प्रतीक्षा है।</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>बैच प्रोसेस किया जा रहा है…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>पूर्ण: %1, विफल: %2।</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>वीडियो फ़्रेमों का इंटरपोलेशन किया जा रहा है</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>हर वर्कफ़्लो में केवल एक फ़्रेम जनरेशन इंजन उपयोग करें। DLSS, AMD FSR या VFX फ़्रेम जनरेशन चुनें।</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>DLSS न्यूरल रेंडरिंग के लिए कम से कम 64 × 64 पिक्सेल का इनपुट आवश्यक है।</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>स्केलिंग इस स्थान पर HDR वीडियो प्रोसेस नहीं कर सकती। इसे HDR रूपांतरण से पहले रखें।</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>माँगा गया आउटपुट समर्थित न्यूनतम 64 × 64 पिक्सेल से छोटा है।</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>DLSS सुपर रिज़ॉल्यूशन इस स्थान पर HDR वीडियो प्रोसेस नहीं कर सकता। इसे HDR रूपांतरण से पहले रखें।</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>रे रिकंस्ट्रक्शन के लिए HDR वीडियो में स्पष्ट PQ या HLG संकेत आवश्यक है।</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>RTX सुपर रिज़ॉल्यूशन इस स्थान पर HDR वीडियो प्रोसेस नहीं कर सकता। इसे HDR रूपांतरण से पहले रखें।</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects केवल वीडियो के लिए है।</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>पुराने NVIDIA VFX प्रीसेट में कोई इफ़ेक्ट सक्षम नहीं है।</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>इस वीडियो इफ़ेक्ट को इस स्थान पर SDR चाहिए। इसका कार्ड HDR रूपांतरण से पहले रखें।</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>RTX HDR वीडियो के लिए इस स्थान पर SDR आवश्यक है।</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>FSR फ़्रेम जनरेशन के लिए कम से कम 64 × 64 पिक्सेल आवश्यक हैं।</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>FSR फ़्रेम जनरेशन हर किनारे पर अधिकतम 16384 पिक्सेल का समर्थन करता है।</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>फ़्रेम जनरेशन की लक्षित फ़्रेम दर इस कार्ड की इनपुट फ़्रेम दर से अधिक होनी चाहिए। अधिक लक्षित फ़्रेम दर चुनें।</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>शार्पनिंग के लिए इस स्थान पर SDR वीडियो आवश्यक है। इसे HDR रूपांतरण से पहले रखें।</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>चुनी गई .cube LUT उपलब्ध नहीं है।</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>चुना गया ReShade .ini प्रीसेट उपलब्ध नहीं है।</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade के लिए कम से कम 16 × 16 पिक्सेल का इनपुट आवश्यक है।</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>चुना गया कोडेक इस कंटेनर का समर्थन नहीं करता।</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>वीडियो निर्यात के लिए आउटपुट की चौड़ाई और ऊँचाई सम संख्याएँ होनी चाहिए।</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>HDR आउटपुट के लिए निर्यात सेटिंग में 10-बिट HDR मोड आवश्यक है।</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR के लिए 10-बिट या अधिक का वीडियो कोडेक आवश्यक है।</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>कस्टम सफ़िक्स खाली है या उसमें फ़ाइल नाम के लिए अमान्य वर्ण हैं।</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>FSR फ़्रेम जनरेशन के लिए H.264, HEVC या AV1 के साथ GPU एन्कोडिंग आवश्यक है। समर्थित कोडेक चुनें।</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>चुने गए FSR DirectX अडैप्टर के लिए GPU एन्कोडिंग उपलब्ध नहीं है</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>HDR FSR इनपुट के लिए HDR मोड और 10-बिट आउटपुट कोडेक आवश्यक है</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_ja.qm b/src/desktop/translations/app_ja.qmindex 897b2cc..31ef7f6 100644Binary files a/src/desktop/translations/app_ja.qm and b/src/desktop/translations/app_ja.qm differdiff --git a/src/desktop/translations/app_ja.ts b/src/desktop/translations/app_ja.tsindex eb17138..1ca2955 100644--- a/src/desktop/translations/app_ja.ts+++ b/src/desktop/translations/app_ja.ts@@ -476,10 +476,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>Cannot start batch: %1</source><translation>バッチを開始できません: %1</translation></message>- <message>- <source>Cascade</source>- <translation>カスケード</translation>- </message><message><source>Changes apply immediately.</source><translation>変更はすぐに適用されます。</translation>@@ -715,7 +711,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>DLSS フレーム生成</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -726,7 +722,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>DLSS ニューラルレンダリング</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -738,18 +734,12 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>DLSS 超解像</translation></message><message><source>DLSS effects: %1</source><translation>DLSSエフェクト: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>DLSS-G エンジン</translation>- </message><message><source>Deblur Modes</source><translation>ぼけ除去モード</translation>@@ -1409,10 +1399,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>NR Style</source><translation>NR スタイル</translation></message>- <message>- <source>Native DLSSG</source>- <translation>ネイティブDLSSG</translation>- </message><message><source>Natural</source><translation>ナチュラル</translation>@@ -1827,13 +1813,13 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>RTX 超解像</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>RTX HDR 動画</translation></message><message><source>Ready</source>@@ -2636,11 +2622,461 @@ Poster frame shown. Scrub with < > or open the file externally.</source></message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>DLSS レイ再構成</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>読み込んだ画像と動画には、推定したマテリアル情報を使用します。結果はソースによって異なります。</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>AMD FidelityFX オプティカルフロー</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>有効なテクニック</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>常時 (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>自動 (必要時に MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>自動 (プリセットとランタイムのシェーダー)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>自動 (プリセットとランタイムのテクスチャ)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>ReShade .ini プリセットを選択</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>深度入力</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>無効</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>ディスオクルージョン感度</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>エフェクトミックス</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>深度を上下反転</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>対数深度バッファ</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>オフ (フレーム単位の空間処理)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>ReShade 動画を処理中</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>ReShade プリセット (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>ReShade プリセット (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>ReShade ランタイムが利用できません。</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>プリセットを再読み込み</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>ReShade プリセットを再読み込みしました。</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>反転深度バッファ</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>プリセットのコピーを保存</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>ReShade プリセットのコピーを保存</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>ReShade プリセットを %1 に保存しました</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>シェーダーパラメーター</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>シェーダー検索フォルダー (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>時間的深度ブレンド</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>テクスチャ & LUT 検索フォルダー</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>動画モーションと深度安定化</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>AI深度を常に生成</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>オプティカルフロー</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>オフ(フレームごとの深度)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>このプリセットには深度が必要です。「自動」または「常に」を選択してください。</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>AI深度は奥行きが必要なエフェクトに使用されます。自動モードではAMD Optical Flowで動画の深度を安定化します。</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>このプリセットにはAI深度や動きの処理は不要です。自動モードでは処理を省略します。</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>テクニックと設定</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>値をリセット</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>エフェクトとパラメーターを検索…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>%1件有効</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>オフ</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>魚眼歪曲は初期状態ではオフです。適用するにはテクニックを有効にしてください。</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>このエフェクトを適用するには上のテクニックを有効にしてください。</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>深度の詳細度</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>エフェクトの精度</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>HDRの処理</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>元の透明度を保持</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>内部シェーダーパラメーターを表示</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+動画の深度位置合わせ · AMD FidelityFX オプティカルフロー</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>プリセットを選択して開始してください。</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>%1件のテクニックが有効 · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>AI深度が有効</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>深度は不要または無効</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>有効</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>詳細設定</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>FSR フレーム生成</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>処理用 GPU</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>フレーム生成を利用できます</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>選択した FSR アダプターは利用できません</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>対応する FSR アダプターが見つかりません</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>フレーム生成技術</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>共有 GPU メモリ</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>AI 処理 GPU(DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>RTX 動画超解像</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>高速 (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>標準 (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>高 (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>最高 (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>8 ビット sRGB 互換</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>自動 (SDR プリセットアダプター)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>HDR 対応プリセット</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>SDR アダプター</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>未対応の設定を拒否</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 フレーム/秒</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>フレーム/秒</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>DirectX 12 に対応する NVIDIA または FSR GPU が検出されませんでした。</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>クリップボードからのダウンロードに失敗しました: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>クリップボードの URL に読み取り可能な画像がありませんでした。</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>入力ファイルをスキャン中…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>追加されたファイル: %1。</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>プレビューをレンダリング中…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>プレビューの準備ができました。</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>プレビューを更新しました。最新のリクエストを待機中です。</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>バッチ処理中…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>完了: %1、失敗: %2。</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>動画フレームを補間中</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>ワークフローごとにフレーム生成エンジンを 1 つだけ使用してください。DLSS、AMD FSR、VFX フレーム生成から選択してください。</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>DLSS ニューラルレンダリングには 64 × 64 ピクセル以上の入力が必要です。</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>この位置ではスケーリングで HDR 動画を処理できません。HDR 変換の前に移動してください。</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>指定した出力は、対応する最小サイズの 64 × 64 ピクセルを下回っています。</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>この位置では DLSS 超解像で HDR 動画を処理できません。HDR 変換の前に移動してください。</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>レイ再構成で HDR 動画を処理するには、PQ または HLG の明示的な指定が必要です。</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>この位置では RTX 超解像で HDR 動画を処理できません。HDR 変換の前に移動してください。</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects は動画専用です。</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>旧形式の NVIDIA VFX プリセットには有効なエフェクトがありません。</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>この動画エフェクトには、この位置で SDR が必要です。カードを HDR 変換の前に移動してください。</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>この位置で RTX HDR 動画を使用するには SDR が必要です。</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>FSR フレーム生成には 64 × 64 ピクセル以上が必要です。</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>FSR フレーム生成は一辺あたり最大 16384 ピクセルに対応しています。</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>フレーム生成の目標フレームレートは、このカードへの入力フレームレートより高くする必要があります。より高い目標値を選択してください。</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>この位置でシャープ化を使用するには SDR 動画が必要です。HDR 変換の前に移動してください。</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>選択した .cube LUT は利用できません。</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>選択した ReShade .ini プリセットは利用できません。</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade には 16 × 16 ピクセル以上の入力が必要です。</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>選択したコーデックはこのコンテナに対応していません。</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>動画の書き出しには、幅と高さが偶数の出力サイズが必要です。</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>HDR 出力には、書き出し設定で 10 ビット HDR モードを有効にする必要があります。</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR には 10 ビット以上の動画コーデックが必要です。</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>カスタム接尾辞が空か、ファイル名に使用できない文字が含まれています。</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>FSR フレーム生成には H.264、HEVC、AV1 による GPU エンコードが必要です。対応するコーデックを選択してください。</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>選択した FSR DirectX アダプターでは GPU エンコードを利用できません</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>HDR FSR 入力には HDR モードと 10 ビットの出力コーデックが必要です</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_ko.qm b/src/desktop/translations/app_ko.qmindex 36ac9c5..b0fc78a 100644Binary files a/src/desktop/translations/app_ko.qm and b/src/desktop/translations/app_ko.qm differdiff --git a/src/desktop/translations/app_ko.ts b/src/desktop/translations/app_ko.tsindex f1a55d6..49b832b 100644--- a/src/desktop/translations/app_ko.ts+++ b/src/desktop/translations/app_ko.ts@@ -476,10 +476,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>Cannot start batch: %1</source><translation>일괄 처리를 시작할 수 없음: %1</translation></message>- <message>- <source>Cascade</source>- <translation>캐스케이드</translation>- </message><message><source>Changes apply immediately.</source><translation>변경 사항이 즉시 적용됩니다.</translation>@@ -715,7 +711,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>DLSS 프레임 생성</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -726,7 +722,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>DLSS 뉴럴 렌더링</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -738,18 +734,12 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>DLSS 초해상도</translation></message><message><source>DLSS effects: %1</source><translation>DLSS 효과: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>DLSS-G 엔진</translation>- </message><message><source>Deblur Modes</source><translation>흐림 제거 모드</translation>@@ -1409,10 +1399,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>NR Style</source><translation>NR 스타일</translation></message>- <message>- <source>Native DLSSG</source>- <translation>네이티브 DLSSG</translation>- </message><message><source>Natural</source><translation>자연스러움</translation>@@ -1827,13 +1813,13 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>RTX 초해상도</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>RTX HDR 동영상</translation></message><message><source>Ready</source>@@ -2636,11 +2622,461 @@ Poster frame shown. Scrub with < > or open the file externally.</source></message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>DLSS 레이 재구성</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>가져온 이미지와 동영상에는 추정된 재질 정보를 사용합니다. 결과는 원본에 따라 달라집니다.</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>AMD FidelityFX 광학 흐름</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>활성 기법</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>항상 (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>자동 (필요 시 MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>자동 (프리셋 및 런타임 셰이더)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>자동 (프리셋 및 런타임 텍스처)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>ReShade .ini 프리셋 선택</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>깊이 입력</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>비활성화됨</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>디스오클루전 민감도</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>효과 믹스</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>깊이 상하 반전</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>로그 깊이 버퍼</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>끔 (프레임별 공간 처리)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>ReShade 비디오 처리 중</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>ReShade 프리셋 (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>ReShade 프리셋 (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>ReShade 런타임을 사용할 수 없습니다.</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>프리셋 다시 로드</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>ReShade 프리셋을 다시 로드했습니다.</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>반전된 깊이 버퍼</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>프리셋 사본 저장</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>ReShade 프리셋 사본 저장</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>ReShade 프리셋을 %1에 저장했습니다</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>셰이더 매개변수</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>셰이더 검색 폴더 (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>시간적 깊이 블렌드</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>텍스처 및 LUT 검색 폴더</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>비디오 모션 및 깊이 안정화</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>항상 AI 깊이 생성</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>광학 흐름</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>끄기 (프레임별 깊이)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>이 프리셋에는 깊이가 필요합니다. 자동 또는 항상을 선택하세요.</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>AI 깊이는 장면 깊이가 필요한 효과에 사용됩니다. 자동 모드는 AMD Optical Flow로 동영상 깊이를 안정화합니다.</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>이 프리셋에는 AI 깊이나 모션 처리가 필요하지 않습니다. 자동 모드에서는 해당 작업을 건너뜁니다.</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>기법 및 설정</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>값 초기화</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>효과 및 매개변수 검색…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>%1개 활성화됨</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>끄기</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>어안 왜곡은 기본적으로 꺼져 있습니다. 적용하려면 기법을 활성화하세요.</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>이 효과를 적용하려면 위의 기법을 활성화하세요.</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>깊이 세부 수준</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>효과 정밀도</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>HDR 처리</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>원본 투명도 유지</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>내부 셰이더 매개변수 표시</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+동영상 깊이 정렬 · AMD FidelityFX 광학 흐름</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>시작하려면 프리셋을 선택하세요.</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>%1개 기법 활성화됨 · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>AI 깊이 활성화됨</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>깊이가 불필요하거나 비활성화됨</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>활성화</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>고급</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>FSR 프레임 생성</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>처리용 GPU</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>프레임 생성 사용 가능</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>선택한 FSR 어댑터를 사용할 수 없습니다</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>호환되는 FSR 어댑터를 찾을 수 없습니다</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>프레임 생성 기술</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>공유 GPU 메모리</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>AI 처리 GPU (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>RTX 동영상 초해상도</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>빠름 (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>표준 (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>높음 (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>최대 (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>8비트 sRGB 호환</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>자동 (SDR 프리셋 어댑터)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>HDR 지원 프리셋</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>SDR 어댑터</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>지원되지 않는 설정 거부</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 프레임/초</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>프레임/초</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>DirectX 12와 호환되는 NVIDIA 또는 FSR GPU가 감지되지 않았습니다.</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>클립보드에서 다운로드하지 못했습니다: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>클립보드 URL에 읽을 수 있는 이미지가 없습니다.</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>입력 파일을 검색하는 중…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>추가된 파일: %1.</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>미리보기를 렌더링하는 중…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>미리보기가 준비되었습니다.</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>미리보기가 업데이트되었습니다. 최신 요청을 기다리는 중입니다.</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>일괄 처리 중…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>완료: %1, 실패: %2.</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>동영상 프레임을 보간하는 중</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>워크플로마다 프레임 생성 엔진을 하나만 사용하세요. DLSS, AMD FSR 또는 VFX 프레임 생성을 선택하세요.</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>DLSS 뉴럴 렌더링에는 최소 64 × 64픽셀의 입력이 필요합니다.</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>이 위치에서는 크기 조정으로 HDR 동영상을 처리할 수 없습니다. HDR 변환 앞으로 이동하세요.</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>요청한 출력이 지원되는 최소 크기인 64 × 64픽셀보다 작습니다.</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>이 위치에서는 DLSS 초해상도로 HDR 동영상을 처리할 수 없습니다. HDR 변환 앞으로 이동하세요.</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>레이 재구성으로 HDR 동영상을 처리하려면 PQ 또는 HLG가 명시되어 있어야 합니다.</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>이 위치에서는 RTX 초해상도로 HDR 동영상을 처리할 수 없습니다. HDR 변환 앞으로 이동하세요.</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects는 동영상 전용입니다.</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>이전 형식의 NVIDIA VFX 프리셋에 활성화된 효과가 없습니다.</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>이 동영상 효과는 현재 위치에서 SDR 입력이 필요합니다. 효과 카드를 HDR 변환 앞으로 이동하세요.</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>이 위치에서 RTX HDR 동영상을 사용하려면 SDR 입력이 필요합니다.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>FSR 프레임 생성에는 최소 64 × 64픽셀이 필요합니다.</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>FSR 프레임 생성은 각 변에서 최대 16384픽셀을 지원합니다.</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>프레임 생성의 목표 프레임 속도는 이 카드의 입력 프레임 속도보다 높아야 합니다. 더 높은 목표값을 선택하세요.</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>이 위치에서 선명하게 하기를 사용하려면 SDR 동영상이 필요합니다. HDR 변환 앞으로 이동하세요.</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>선택한 .cube LUT를 사용할 수 없습니다.</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>선택한 ReShade .ini 프리셋을 사용할 수 없습니다.</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade에는 최소 16 × 16픽셀의 입력이 필요합니다.</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>선택한 코덱은 이 컨테이너를 지원하지 않습니다.</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>동영상 내보내기의 출력 너비와 높이는 짝수여야 합니다.</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>HDR 출력에는 내보내기 설정의 10비트 HDR 모드가 필요합니다.</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR에는 10비트 이상의 동영상 코덱이 필요합니다.</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>사용자 지정 접미사가 비어 있거나 파일 이름에 사용할 수 없는 문자가 포함되어 있습니다.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>FSR 프레임 생성에는 H.264, HEVC 또는 AV1 GPU 인코딩이 필요합니다. 지원되는 코덱을 선택하세요.</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>선택한 FSR DirectX 어댑터에서 GPU 인코딩을 사용할 수 없습니다</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>HDR FSR 입력에는 HDR 모드와 10비트 출력 코덱이 필요합니다</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_pl.qm b/src/desktop/translations/app_pl.qmindex 4a5a867..b78d5ed 100644Binary files a/src/desktop/translations/app_pl.qm and b/src/desktop/translations/app_pl.qm differdiff --git a/src/desktop/translations/app_pl.ts b/src/desktop/translations/app_pl.tsindex 7f52b19..b4766e3 100644--- a/src/desktop/translations/app_pl.ts+++ b/src/desktop/translations/app_pl.ts@@ -484,10 +484,6 @@ Wyświetlono klatkę. Użyj < > lub otwórz plik zewnętrznie.</translatio<source>Cannot start batch: %1</source><translation>Nie można uruchomić zadania: %1</translation></message>- <message>- <source>Cascade</source>- <translation>Kaskada</translation>- </message><message><source>Changes apply immediately.</source><translation>Zmiany są stosowane natychmiast.</translation>@@ -723,7 +719,7 @@ Wyświetlono klatkę. Użyj < > lub otwórz plik zewnętrznie.</translatio<location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>Generowanie klatek DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -734,7 +730,7 @@ Wyświetlono klatkę. Użyj < > lub otwórz plik zewnętrznie.</translatio<message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>Renderowanie neuronowe DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -746,18 +742,12 @@ Wyświetlono klatkę. Użyj < > lub otwórz plik zewnętrznie.</translatio<location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>Superrozdzielczość DLSS</translation></message><message><source>DLSS effects: %1</source><translation>Efekty DLSS: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>Silnik DLSS-G</translation>- </message><message><source>Deblur Modes</source><translation>Tryby usuwania rozmycia</translation>@@ -1417,10 +1407,6 @@ Wyświetlono klatkę. Użyj < > lub otwórz plik zewnętrznie.</translatio<source>NR Style</source><translation>Styl NR</translation></message>- <message>- <source>Native DLSSG</source>- <translation>Natywny DLSSG</translation>- </message><message><source>Natural</source><translation>Naturalny</translation>@@ -1835,13 +1821,13 @@ Wyświetlono klatkę. Użyj < > lub otwórz plik zewnętrznie.</translatio<message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>Superrozdzielczość RTX</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>Wideo HDR RTX</translation></message><message><source>Ready</source>@@ -2644,11 +2630,461 @@ Wyświetlono klatkę. Użyj < > lub otwórz plik zewnętrznie.</translatio</message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>Rekonstrukcja promieni DLSS</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>Importowane obrazy i filmy korzystają z szacowanych danych materiałów. Wyniki zależą od źródła.</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>Przepływ optyczny AMD FidelityFX</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>Aktywne techniki</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>Zawsze (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>Automatycznie (MoGe-2 ViT-S w razie potrzeby)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>Automatycznie (shadery presetu i środowiska)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>Automatycznie (tekstury presetu i środowiska)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>Wybierz preset .ini ReShade</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>Wejście głębi</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>Wyłączone</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>Czułość dezokluzji</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>Miks efektu</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>Odwróć głębię w pionie</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>Logarytmiczny bufor głębi</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>Wył. (przestrzennie na klatkę)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>Przetwarzanie wideo ReShade</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>Preset ReShade (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>Presety ReShade (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>Środowisko wykonawcze ReShade jest niedostępne.</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>Przeładuj preset</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>Przeładowano preset ReShade.</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>Odwrócony bufor głębi</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>Zapisz kopię presetu</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>Zapisz kopię presetu ReShade</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>Zapisano preset ReShade w %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>Parametry shaderów</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>Folder wyszukiwania shaderów (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>Czasowe mieszanie głębi</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>Folder wyszukiwania tekstur i LUT</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>Ruch wideo i stabilizacja głębi</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>Zawsze generuj głębię AI</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>Przepływ optyczny</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>Wyłączone (głębia każdej klatki)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>Ten preset wymaga głębi. Wybierz Automatycznie lub Zawsze.</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>Głębia AI zasila efekty wymagające głębi sceny. Tryb automatyczny stabilizuje ją w filmach przez AMD Optical Flow.</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>Ten preset nie wymaga głębi AI ani analizy ruchu. Tryb automatyczny pomija tę pracę.</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>Techniki i ustawienia</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>Przywróć wartości</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>Szukaj efektów i parametrów…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>Włączone: %1</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>Wyłączone</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>Zniekształcenie rybiego oka jest domyślnie wyłączone. Włącz technikę, aby je zastosować.</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>Włącz technikę powyżej, aby zastosować ten efekt.</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>Szczegółowość głębi</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>Precyzja efektów</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>Obsługa HDR</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>Zachowaj przezroczystość źródła</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>Pokaż wewnętrzne parametry shaderów</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+Wyrównanie głębi wideo · Przepływ optyczny AMD FidelityFX</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>Wybierz preset, aby rozpocząć.</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>Włączone techniki: %1 · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>Głębia AI włączona</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>Głębia zbędna lub wyłączona</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>Włączone</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>Zaawansowane</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>Generowanie klatek FSR</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>GPU do przetwarzania</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>Generowanie klatek jest dostępne</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>Wybrana karta FSR jest niedostępna</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>Nie wykryto zgodnej karty FSR</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>Technologia generowania klatek</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>Współdzielona pamięć GPU</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>GPU przetwarzania AI (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>Superrozdzielczość wideo RTX</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>Szybko (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>Standardowo (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>Wysoko (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>Maksymalnie (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>Zgodność z 8-bitowym sRGB</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>Auto (adapter ustawień SDR)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>Ustawienie obsługujące HDR</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>Adapter SDR</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>Odrzuć nieobsługiwane</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 kl./s</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>kl./s</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>Nie wykryto zgodnego z DirectX 12 procesora graficznego NVIDIA lub FSR.</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>Pobieranie ze schowka nie powiodło się: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>Adres URL w schowku nie zawierał czytelnego obrazu.</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>Skanowanie plików wejściowych…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>Dodane pliki: %1.</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>Renderowanie podglądu…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>Podgląd gotowy.</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>Podgląd zaktualizowany; oczekiwanie na najnowsze żądanie.</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>Przetwarzanie wsadowe…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>Ukończone: %1, nieudane: %2.</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>Interpolowanie klatek wideo</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>Używaj tylko jednego silnika generowania klatek w każdym przepływie pracy. Wybierz DLSS, AMD FSR lub VFX.</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>Renderowanie neuronowe DLSS wymaga wejścia co najmniej 64 × 64 piksele.</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>Skalowanie nie może przetwarzać wideo HDR w tym miejscu. Przenieś je przed konwersję do HDR.</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>Żądane wyjście jest mniejsze niż obsługiwane minimum 64 × 64 piksele.</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>Superrozdzielczość DLSS nie może przetwarzać wideo HDR w tym miejscu. Przenieś ją przed konwersję do HDR.</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>Rekonstrukcja promieni wymaga jawnego oznaczenia PQ lub HLG dla wideo HDR.</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>Superrozdzielczość RTX nie może przetwarzać wideo HDR w tym miejscu. Przenieś ją przed konwersję do HDR.</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects działa tylko z wideo.</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>Starsze ustawienie NVIDIA VFX nie ma włączonego żadnego efektu.</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>Ten efekt wideo wymaga w tym miejscu SDR. Przenieś jego kartę przed konwersję do HDR.</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>Wideo HDR RTX wymaga w tym miejscu wejścia SDR.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>Generowanie klatek FSR wymaga co najmniej 64 × 64 piksele.</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>Generowanie klatek FSR obsługuje do 16384 pikseli na bok.</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>Docelowa liczba klatek musi być większa niż na wejściu tej karty. Wybierz wyższą wartość docelową.</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>Wyostrzanie wymaga w tym miejscu wideo SDR. Przenieś je przed konwersję do HDR.</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>Wybrana tablica LUT .cube jest niedostępna.</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>Wybrane ustawienie ReShade .ini jest niedostępne.</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade wymaga wejścia co najmniej 16 × 16 pikseli.</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>Wybrany kodek nie obsługuje tego kontenera.</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>Eksport wideo wymaga parzystych wymiarów wyjściowych.</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>Wyjście HDR wymaga 10-bitowego trybu HDR w ustawieniach eksportu.</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR wymaga kodeka wideo o głębi co najmniej 10 bitów.</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>Własny przyrostek jest pusty lub zawiera znaki niedozwolone w nazwach plików.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>Generowanie klatek FSR wymaga kodowania GPU w H.264, HEVC lub AV1. Wybierz obsługiwany kodek.</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>Kodowanie GPU jest niedostępne dla wybranego adaptera DirectX FSR</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>Wejście HDR FSR wymaga trybu HDR i 10-bitowego kodeka wyjściowego</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_uk.qm b/src/desktop/translations/app_uk.qmindex 0ccc18d..6e115f6 100644Binary files a/src/desktop/translations/app_uk.qm and b/src/desktop/translations/app_uk.qm differdiff --git a/src/desktop/translations/app_uk.ts b/src/desktop/translations/app_uk.tsindex 87d7cb5..27fee98 100644--- a/src/desktop/translations/app_uk.ts+++ b/src/desktop/translations/app_uk.ts@@ -484,10 +484,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>Cannot start batch: %1</source><translation>Не вдалося почати обробку: %1</translation></message>- <message>- <source>Cascade</source>- <translation>Каскад</translation>- </message><message><source>Changes apply immediately.</source><translation>Зміни застосовуються одразу.</translation>@@ -723,7 +719,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>Генерація кадрів DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -734,7 +730,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>Нейронний рендеринг DLSS</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -746,18 +742,12 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>Надвисока роздільність DLSS</translation></message><message><source>DLSS effects: %1</source><translation>Ефекти DLSS: %1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>Рушій DLSS-G</translation>- </message><message><source>Deblur Modes</source><translation>Режими усунення розмиття</translation>@@ -1417,10 +1407,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>NR Style</source><translation>Стиль NR</translation></message>- <message>- <source>Native DLSSG</source>- <translation>Нативний DLSSG</translation>- </message><message><source>Natural</source><translation>Природний</translation>@@ -1835,13 +1821,13 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>Надвисока роздільність RTX</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>HDR-відео RTX</translation></message><message><source>Ready</source>@@ -2644,11 +2630,461 @@ Poster frame shown. Scrub with < > or open the file externally.</source></message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>Реконструкція променів DLSS</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>Для імпортованих зображень і відео використовуються оцінені дані матеріалів. Результати залежать від джерела.</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>Оптичний потік AMD FidelityFX</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>Активні техніки</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>Завжди (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>Авто (MoGe-2 ViT-S за потреби)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>Автоматично (шейдери пресету та середовища)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>Автоматично (текстури пресету та середовища)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>Виберіть пресет .ini ReShade</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>Вхід глибини</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>Вимкнено</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>Чутливість дезокклюзії</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>Змішування ефекту</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>Перевернути глибину вертикально</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>Логарифмічний буфер глибини</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>Вимк. (просторово на кадр)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>Обробка відео ReShade</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>Пресет ReShade (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>Пресети ReShade (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>Середовище виконання ReShade недоступне.</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>Перезавантажити пресет</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>Пресет ReShade перезавантажено.</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>Зворотний буфер глибини</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>Зберегти копію пресету</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>Зберегти копію пресету ReShade</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>Пресет ReShade збережено у %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>Параметри шейдерів</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>Папка пошуку шейдерів (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>Часове змішування глибини</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>Папка пошуку текстур і LUT</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>Рух відео та стабілізація глибини</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>Завжди генерувати ШІ-глибину</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>Оптичний потік</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>Вимкнено (глибина кожного кадру)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>Цей пресет потребує глибини. Виберіть «Авто» або «Завжди».</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>ШІ-глибина забезпечує ефекти глибиною сцени. Авто стабілізує її у відео через AMD Optical Flow.</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>Цьому пресету не потрібні ШІ-глибина та обробка руху. Авто пропускає цю роботу.</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>Техніки й налаштування</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>Скинути значення</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>Пошук ефектів і параметрів…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>Увімкнено: %1</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>Вимкнено</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>Спотворення «риб’яче око» типово вимкнено. Увімкніть техніку для застосування.</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>Увімкніть техніку вище, щоб застосувати цей ефект.</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>Деталізація глибини</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>Точність ефектів</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>Обробка HDR</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>Зберігати прозорість джерела</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>Показувати внутрішні параметри шейдера</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+Вирівнювання глибини відео · Оптичний потік AMD FidelityFX</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>Виберіть пресет для початку.</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>Увімкнено технік: %1 · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>ШІ-глибину ввімкнено</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>Глибина не потрібна або вимкнена</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>Увімкнено</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>Додатково</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>Генерація кадрів FSR</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>Графічний процесор для обробки</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>Генерація кадрів доступна</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>Вибраний адаптер FSR недоступний</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>Сумісного адаптера FSR не знайдено</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>Технологія генерації кадрів</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>Спільна пам’ять GPU</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>GPU обробки ШІ (DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>Надвисока роздільність відео RTX</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>Швидко (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>Стандартно (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>Високо (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>Максимум (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>Сумісність із 8-бітним sRGB</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>Авто (адаптер пресетів SDR)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>Пресет із підтримкою HDR</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>Адаптер SDR</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>Відхиляти непідтримувані</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 кадр/с</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>кадр/с</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>Не виявлено сумісного з DirectX 12 графічного процесора NVIDIA або FSR.</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>Не вдалося завантажити з буфера обміну: %1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>URL-адреса в буфері обміну не містила придатного для читання зображення.</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>Сканування вхідних файлів…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>Додано файлів: %1.</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>Рендеринг попереднього перегляду…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>Попередній перегляд готовий.</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>Попередній перегляд оновлено; очікування останнього запиту.</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>Пакетна обробка…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>Завершено: %1, невдало: %2.</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>Інтерполяція кадрів відео</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>Використовуйте лише один рушій генерації кадрів у кожному робочому процесі. Виберіть DLSS, AMD FSR або VFX.</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>Для нейронного рендерингу DLSS потрібне вхідне зображення не менше 64 × 64 пікселів.</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>Масштабування не може обробляти HDR-відео в цій позиції. Перемістіть його перед перетворенням на HDR.</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>Запитаний вихідний розмір менший за підтримуваний мінімум 64 × 64 пікселі.</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>Надвисока роздільність DLSS не може обробляти HDR-відео в цій позиції. Перемістіть її перед перетворенням на HDR.</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>Для реконструкції променів HDR-відео має явно містити позначення PQ або HLG.</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>Надвисока роздільність RTX не може обробляти HDR-відео в цій позиції. Перемістіть її перед перетворенням на HDR.</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects працює лише з відео.</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>У застарілому пресеті NVIDIA VFX немає ввімкнених ефектів.</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>Цьому відеоефекту в цій позиції потрібне SDR-відео. Перемістіть його картку перед перетворенням на HDR.</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>Для HDR-відео RTX у цій позиції потрібне SDR-відео.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>Для генерації кадрів FSR потрібен розмір не менше 64 × 64 пікселів.</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>Генерація кадрів FSR підтримує до 16384 пікселів з кожного боку.</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>Цільова частота генерації кадрів має перевищувати частоту на вході цієї картки. Виберіть вищу цільову частоту.</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>Для підвищення різкості в цій позиції потрібне SDR-відео. Перемістіть його перед перетворенням на HDR.</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>Вибрана LUT-таблиця .cube недоступна.</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>Вибраний пресет ReShade .ini недоступний.</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>Для ReShade потрібне вхідне зображення не менше 16 × 16 пікселів.</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>Вибраний кодек не підтримує цей контейнер.</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>Для експорту відео ширина й висота вихідного зображення мають бути парними.</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>Для HDR-виводу потрібен 10-бітний режим HDR у налаштуваннях експорту.</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>Для HDR потрібен відеокодек із глибиною 10 біт або більше.</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>Власний суфікс порожній або містить неприпустимі символи для імені файлу.</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>Для генерації кадрів FSR потрібне GPU-кодування H.264, HEVC або AV1. Виберіть підтримуваний кодек.</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>GPU-кодування недоступне для вибраного адаптера DirectX FSR</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>Для HDR-входу FSR потрібні режим HDR і 10-бітний вихідний кодек</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_zh_CN.qm b/src/desktop/translations/app_zh_CN.qmindex a7f53ff..9ecff55 100644Binary files a/src/desktop/translations/app_zh_CN.qm and b/src/desktop/translations/app_zh_CN.qm differdiff --git a/src/desktop/translations/app_zh_CN.ts b/src/desktop/translations/app_zh_CN.tsindex 3b69afd..2de2584 100644--- a/src/desktop/translations/app_zh_CN.ts+++ b/src/desktop/translations/app_zh_CN.ts@@ -476,10 +476,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>Cannot start batch: %1</source><translation>无法开始批处理:%1</translation></message>- <message>- <source>Cascade</source>- <translation>级联</translation>- </message><message><source>Changes apply immediately.</source><translation>更改立即生效。</translation>@@ -715,7 +711,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>DLSS 帧生成</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -726,7 +722,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>DLSS 神经渲染</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -738,18 +734,12 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>DLSS 超分辨率</translation></message><message><source>DLSS effects: %1</source><translation>DLSS 效果:%1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>DLSS-G 引擎</translation>- </message><message><source>Deblur Modes</source><translation>去模糊模式</translation>@@ -1409,10 +1399,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>NR Style</source><translation>NR 风格</translation></message>- <message>- <source>Native DLSSG</source>- <translation>原生 DLSSG</translation>- </message><message><source>Natural</source><translation>自然</translation>@@ -1827,13 +1813,13 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>RTX 超分辨率</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>RTX HDR 视频</translation></message><message><source>Ready</source>@@ -2636,11 +2622,461 @@ Poster frame shown. Scrub with < > or open the file externally.</source></message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>DLSS 光线重建</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>导入的图像和视频使用估算的材质信息。效果取决于源素材。</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>AMD FidelityFX 光流</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>活动技术</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>始终 (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>自动 (需要时使用 MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>自动 (预设与运行时着色器)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>自动 (预设与运行时纹理)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>选择 ReShade .ini 预设</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>深度输入</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>已禁用</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>遮挡解除灵敏度</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>效果混合</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>垂直翻转深度</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>对数深度缓冲</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>关闭 (逐帧空间)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>正在处理 ReShade 视频</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>ReShade 预设 (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>ReShade 预设 (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>ReShade 运行时不可用。</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>重新加载预设</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>已重新加载 ReShade 预设。</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>反转深度缓冲</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>保存预设副本</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>保存 ReShade 预设副本</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>已将 ReShade 预设保存到 %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>着色器参数</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>着色器搜索文件夹 (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>时间深度混合</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>纹理与 LUT 搜索文件夹</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>视频运动与深度稳定</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>始终生成 AI 深度</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>光流</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>关闭(逐帧深度)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>此预设需要深度。请选择“自动”或“始终”。</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>AI 深度供需要场景深度的效果使用。自动模式通过 AMD Optical Flow 稳定视频深度。</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>此预设不需要 AI 深度或运动处理。自动模式会跳过这些工作。</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>技术与设置</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>重置数值</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>搜索效果和参数…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>已启用 %1 项</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>关闭</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>鱼眼畸变默认关闭。启用该技术即可应用。</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>启用上方的技术以应用此效果。</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>深度细节</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>效果精度</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>HDR 处理</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>保留源透明度</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>显示内部着色器参数</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+视频深度对齐 · AMD FidelityFX 光流</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>请选择预设以开始。</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>已启用 %1 项技术 · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>AI 深度已启用</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>不需要深度或深度已关闭</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>已启用</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>高级</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>FSR 帧生成</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>处理 GPU</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>帧生成可用</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>所选 FSR 适配器不可用</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>未检测到兼容的 FSR 适配器</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>帧生成技术</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>共享 GPU 内存</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>AI 处理 GPU(DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>RTX 视频超分辨率</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>快速 (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>标准 (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>高 (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>最高 (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>8 位 sRGB 兼容模式</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>自动(SDR 预设适配器)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>支持 HDR 的预设</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>SDR 适配器</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>拒绝不支持的设置</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 帧/秒</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>帧/秒</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>未检测到兼容 DirectX 12 的 NVIDIA 或 FSR GPU。</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>从剪贴板下载失败:%1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>剪贴板中的 URL 未包含可读取的图像。</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>正在扫描输入文件…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>已添加文件:%1。</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>正在渲染预览…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>预览已就绪。</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>预览已更新;正在等待最新请求。</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>正在批量处理…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>已完成:%1,失败:%2。</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>正在对视频进行插帧</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>每个工作流只能使用一个帧生成引擎。请选择 DLSS、AMD FSR 或 VFX 帧生成。</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>DLSS 神经渲染要求输入至少为 64 × 64 像素。</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>缩放无法在此位置处理 HDR 视频。请将其移至 HDR 转换之前。</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>请求的输出尺寸小于支持的最小尺寸 64 × 64 像素。</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>DLSS 超分辨率无法在此位置处理 HDR 视频。请将其移至 HDR 转换之前。</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>光线重建要求 HDR 视频明确标记为 PQ 或 HLG。</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>RTX 超分辨率无法在此位置处理 HDR 视频。请将其移至 HDR 转换之前。</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects 仅支持视频。</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>旧版 NVIDIA VFX 预设中没有启用的效果。</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>此视频效果在当前位置要求 SDR 输入。请将其卡片移至 HDR 转换之前。</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>RTX HDR 视频在此位置要求 SDR 输入。</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>FSR 帧生成要求至少为 64 × 64 像素。</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>FSR 帧生成支持每边最多 16384 像素。</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>帧生成的目标帧率必须高于此卡片的输入帧率。请选择更高的目标帧率。</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>锐化在此位置要求 SDR 视频。请将其移至 HDR 转换之前。</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>所选 .cube LUT 不可用。</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>所选 ReShade .ini 预设不可用。</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade 要求输入至少为 16 × 16 像素。</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>所选编码器不支持此封装格式。</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>视频导出的输出宽度和高度必须为偶数。</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>HDR 输出要求在导出设置中启用 10 位 HDR 模式。</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR 要求使用 10 位或更高位深的视频编码器。</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>自定义后缀为空或包含文件名不允许的字符。</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>FSR 帧生成要求使用 H.264、HEVC 或 AV1 GPU 编码。请选择支持的编码器。</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>所选 FSR DirectX 适配器不支持 GPU 编码</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>HDR FSR 输入要求启用 HDR 模式并使用 10 位输出编码器</translation>+ </message>+ </context></TS>diff --git a/src/desktop/translations/app_zh_TW.qm b/src/desktop/translations/app_zh_TW.qmindex fe23ada..3260ebf 100644Binary files a/src/desktop/translations/app_zh_TW.qm and b/src/desktop/translations/app_zh_TW.qm differdiff --git a/src/desktop/translations/app_zh_TW.ts b/src/desktop/translations/app_zh_TW.tsindex 78fd45d..bb24324 100644--- a/src/desktop/translations/app_zh_TW.ts+++ b/src/desktop/translations/app_zh_TW.ts@@ -476,10 +476,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>Cannot start batch: %1</source><translation>無法開始批次處理:%1</translation></message>- <message>- <source>Cascade</source>- <translation>串接</translation>- </message><message><source>Changes apply immediately.</source><translation>變更立即生效。</translation>@@ -715,7 +711,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/FrameInterpolationView.qml" line="88" /><location filename="../qml/views/NeuralRenderingView.qml" line="49" /><source>DLSS Frame Generation</source>- <translation>DLSS Frame Generation</translation>+ <translation>DLSS 畫格生成</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="14" />@@ -726,7 +722,7 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="41" /><source>DLSS Neural Rendering</source>- <translation>DLSS Neural Rendering</translation>+ <translation>DLSS 神經渲染</translation></message><message><location filename="../qml/components/DlssSuperResolutionControls.qml" line="30" />@@ -738,18 +734,12 @@ Poster frame shown. Scrub with < > or open the file externally.</source><location filename="../qml/views/NeuralRenderingView.qml" line="43" /><location filename="../qml/views/UpscaleView.qml" line="115" /><source>DLSS Super Resolution</source>- <translation>DLSS Super Resolution</translation>+ <translation>DLSS 超解析度</translation></message><message><source>DLSS effects: %1</source><translation>DLSS 效果:%1</translation></message>- <message>- <location filename="../qml/components/FrameGenerationControls.qml" line="25" />- <location filename="../qml/views/FrameInterpolationView.qml" line="104" />- <source>DLSS-G Engine</source>- <translation>DLSS-G 引擎</translation>- </message><message><source>Deblur Modes</source><translation>去模糊模式</translation>@@ -1409,10 +1399,6 @@ Poster frame shown. Scrub with < > or open the file externally.</source><source>NR Style</source><translation>NR 風格</translation></message>- <message>- <source>Native DLSSG</source>- <translation>原生 DLSSG</translation>- </message><message><source>Natural</source><translation>自然</translation>@@ -1827,13 +1813,13 @@ Poster frame shown. Scrub with < > or open the file externally.</source><message><location filename="../qml/views/NeuralRenderingView.qml" line="44" /><source>RTX Super Resolution</source>- <translation>RTX Super Resolution</translation>+ <translation>RTX 超解析度</translation></message><message><location filename="../qml/views/NeuralRenderingView.qml" line="45" /><location filename="../qml/views/UpscaleView.qml" line="275" /><source>RTX Video HDR</source>- <translation>RTX Video HDR</translation>+ <translation>RTX HDR 影片</translation></message><message><source>Ready</source>@@ -2636,11 +2622,461 @@ Poster frame shown. Scrub with < > or open the file externally.</source></message><message><source>DLSS Ray Reconstruction</source>- <translation>DLSS Ray Reconstruction</translation>+ <translation>DLSS 光線重建</translation></message><message><source>Imported images and videos use estimated material guides. Results depend on the source.</source><translation>匯入的影像和影片使用估算的材質資訊。效果取決於來源素材。</translation></message>-</context>+ <message>+ <source>AMD FidelityFX Optical Flow</source>+ <translation>AMD FidelityFX 光流</translation>+ </message>+ <message>+ <source>Active Techniques</source>+ <translation>啟用技術</translation>+ </message>+ <message>+ <source>Always (MoGe-2 ViT-S)</source>+ <translation>總是 (MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Auto (MoGe-2 ViT-S When Required)</source>+ <translation>自動 (需要時使用 MoGe-2 ViT-S)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Shaders)</source>+ <translation>自動 (預設集與執行階段著色器)</translation>+ </message>+ <message>+ <source>Automatic (Preset & Runtime Textures)</source>+ <translation>自動 (預設集與執行階段紋理)</translation>+ </message>+ <message>+ <source>Choose a ReShade .ini preset</source>+ <translation>選擇 ReShade .ini 預設集</translation>+ </message>+ <message>+ <source>Depth Input</source>+ <translation>深度輸入</translation>+ </message>+ <message>+ <source>Disabled</source>+ <translation>已停用</translation>+ </message>+ <message>+ <source>Disocclusion Sensitivity</source>+ <translation>遮擋解除靈敏度</translation>+ </message>+ <message>+ <source>Effect Mix</source>+ <translation>效果混合</translation>+ </message>+ <message>+ <source>Flip Depth Vertically</source>+ <translation>垂直翻轉深度</translation>+ </message>+ <message>+ <source>Logarithmic Depth Buffer</source>+ <translation>對數深度緩衝</translation>+ </message>+ <message>+ <source>Off (Per-Frame Spatial)</source>+ <translation>關閉 (逐影格空間)</translation>+ </message>+ <message>+ <source>Processing ReShade video</source>+ <translation>正在處理 ReShade 影片</translation>+ </message>+ <message>+ <source>ReShade</source>+ <translation>ReShade</translation>+ </message>+ <message>+ <source>ReShade Preset (.ini)</source>+ <translation>ReShade 預設集 (.ini)</translation>+ </message>+ <message>+ <source>ReShade Presets (*.ini)</source>+ <translation>ReShade 預設集 (*.ini)</translation>+ </message>+ <message>+ <source>ReShade runtime unavailable.</source>+ <translation>ReShade 執行階段無法使用。</translation>+ </message>+ <message>+ <source>Reload Preset</source>+ <translation>重新載入預設集</translation>+ </message>+ <message>+ <source>Reloaded ReShade preset.</source>+ <translation>已重新載入 ReShade 預設集。</translation>+ </message>+ <message>+ <source>Reversed Depth Buffer</source>+ <translation>反轉深度緩衝</translation>+ </message>+ <message>+ <source>Save Preset Copy</source>+ <translation>儲存預設集副本</translation>+ </message>+ <message>+ <source>Save ReShade Preset Copy</source>+ <translation>儲存 ReShade 預設集副本</translation>+ </message>+ <message>+ <source>Saved ReShade preset to %1</source>+ <translation>已將 ReShade 預設集儲存至 %1</translation>+ </message>+ <message>+ <source>Shader Parameters</source>+ <translation>著色器參數</translation>+ </message>+ <message>+ <source>Shader Search Folder (.fx / .fxh)</source>+ <translation>著色器搜尋資料夾 (.fx / .fxh)</translation>+ </message>+ <message>+ <source>Temporal Depth Blend</source>+ <translation>時間深度混合</translation>+ </message>+ <message>+ <source>Texture & LUT Search Folder</source>+ <translation>紋理與 LUT 搜尋資料夾</translation>+ </message>+ <message>+ <source>Video Motion & Depth Stabilization</source>+ <translation>影片動態與深度穩定</translation>+ </message>+ <message>+ <source>Always Generate AI Depth</source>+ <translation>一律產生 AI 深度</translation>+ </message>+ <message>+ <source>Optical Flow</source>+ <translation>光流</translation>+ </message>+ <message>+ <source>Off (Per-Frame Depth)</source>+ <translation>關閉(逐幀深度)</translation>+ </message>+ <message>+ <source>This preset requires depth. Select Auto or Always to process it.</source>+ <translation>此預設需要深度。請選擇「自動」或「一律」。</translation>+ </message>+ <message>+ <source>AI depth supplies effects that need scene depth. Auto stabilizes it in video using AMD Optical Flow.</source>+ <translation>AI 深度供需要場景深度的效果使用。自動模式透過 AMD Optical Flow 穩定影片深度。</translation>+ </message>+ <message>+ <source>This preset does not need AI depth or motion processing. Auto skips that work.</source>+ <translation>此預設不需要 AI 深度或動作處理。自動模式會略過這些工作。</translation>+ </message>+ <message>+ <source>Techniques & Settings</source>+ <translation>技術與設定</translation>+ </message>+ <message>+ <source>Reset Values</source>+ <translation>重設數值</translation>+ </message>+ <message>+ <source>Search effects and parameters…</source>+ <translation>搜尋效果與參數…</translation>+ </message>+ <message>+ <source>%1 enabled</source>+ <translation>已啟用 %1 項</translation>+ </message>+ <message>+ <source>Off</source>+ <translation>關閉</translation>+ </message>+ <message>+ <source>Fisheye distortion is off by default. Enable the technique to apply it.</source>+ <translation>魚眼畸變預設關閉。啟用該技術即可套用。</translation>+ </message>+ <message>+ <source>Enable a technique above to apply this effect.</source>+ <translation>啟用上方技術以套用此效果。</translation>+ </message>+ <message>+ <source>Depth Detail</source>+ <translation>深度細節</translation>+ </message>+ <message>+ <source>Effect Precision</source>+ <translation>效果精度</translation>+ </message>+ <message>+ <source>HDR Handling</source>+ <translation>HDR 處理</translation>+ </message>+ <message>+ <source>Preserve Source Transparency</source>+ <translation>保留來源透明度</translation>+ </message>+ <message>+ <source>Show Internal Shader Parameters</source>+ <translation>顯示內部著色器參數</translation>+ </message>+ <message>+ <source>MoGe-2 ViT-S · ONNX Runtime DirectML+Video depth alignment · AMD FidelityFX Optical Flow</source>+ <translation>MoGe-2 ViT-S · ONNX Runtime DirectML+影片深度對齊 · AMD FidelityFX 光流</translation>+ </message>+ <message>+ <source>Choose a preset to begin.</source>+ <translation>請選擇預設以開始。</translation>+ </message>+ <message>+ <source>%1 technique(s) enabled · %2</source>+ <translation>已啟用 %1 項技術 · %2</translation>+ </message>+ <message>+ <source>AI depth enabled</source>+ <translation>AI 深度已啟用</translation>+ </message>+ <message>+ <source>Depth not required or disabled</source>+ <translation>不需要深度或深度已關閉</translation>+ </message>+ <message>+ <source>Enabled</source>+ <translation>已啟用</translation>+ </message>+ <message>+ <source>Advanced</source>+ <translation>進階</translation>+ </message>+ <message>+ <source>FSR Frame Generation</source>+ <translation>FSR 影格生成</translation>+ </message>+ <message>+ <source>Processing GPU</source>+ <translation>處理 GPU</translation>+ </message>+ <message>+ <source>Frame generation available</source>+ <translation>影格生成可用</translation>+ </message>+ <message>+ <source>Selected FSR adapter is unavailable</source>+ <translation>所選的 FSR 配接器無法使用</translation>+ </message>+ <message>+ <source>No compatible FSR adapter detected</source>+ <translation>未偵測到相容的 FSR 配接器</translation>+ </message>+ <message>+ <source>Frame generation provider</source>+ <translation>影格生成技術</translation>+ </message>+ <message>+ <source>Shared GPU memory</source>+ <translation>共用 GPU 記憶體</translation>+ </message>+ <message>+ <source>AI Processing GPU (DirectX 12 / FidelityFX)</source>+ <translation>AI 處理 GPU(DirectX 12 / FidelityFX)</translation>+ </message>+ <message>+ <source>RTX Video Super Resolution</source>+ <translation>RTX 影片超解析度</translation>+ </message>+ <message>+ <source>Fast (280)</source>+ <translation>快速 (280)</translation>+ </message>+ <message>+ <source>Standard (504)</source>+ <translation>標準 (504)</translation>+ </message>+ <message>+ <source>High (756)</source>+ <translation>高 (756)</translation>+ </message>+ <message>+ <source>Maximum (1008)</source>+ <translation>最高 (1008)</translation>+ </message>+ <message>+ <source>8-bit sRGB Compatibility</source>+ <translation>8 位元 sRGB 相容模式</translation>+ </message>+ <message>+ <source>Auto (SDR Preset Adapter)</source>+ <translation>自動(SDR 預設集調整器)</translation>+ </message>+ <message>+ <source>HDR-Aware Preset</source>+ <translation>支援 HDR 的預設集</translation>+ </message>+ <message>+ <source>SDR Adapter</source>+ <translation>SDR 調整器</translation>+ </message>+ <message>+ <source>Reject Unsupported</source>+ <translation>拒絕不支援的設定</translation>+ </message>+ <message>+ <source>%1 FPS</source>+ <translation>%1 畫格/秒</translation>+ </message>+ <message>+ <source>FPS</source>+ <translation>畫格/秒</translation>+ </message>+ <message>+ <source>No compatible NVIDIA or FSR DirectX 12 GPU was detected.</source>+ <translation>未偵測到相容 DirectX 12 的 NVIDIA 或 FSR GPU。</translation>+ </message>+ <message>+ <source>Clipboard download failed: %1</source>+ <translation>從剪貼簿下載失敗:%1</translation>+ </message>+ <message>+ <source>The clipboard URL did not contain a readable image.</source>+ <translation>剪貼簿中的 URL 未包含可讀取的影像。</translation>+ </message>+ <message>+ <source>Scanning input files…</source>+ <translation>正在掃描輸入檔案…</translation>+ </message>+ <message>+ <source>Files added: %1.</source>+ <translation>已新增檔案:%1。</translation>+ </message>+ <message>+ <source>Rendering preview…</source>+ <translation>正在渲染預覽…</translation>+ </message>+ <message>+ <source>Preview ready.</source>+ <translation>預覽已就緒。</translation>+ </message>+ <message>+ <source>Preview updated; waiting for the latest request.</source>+ <translation>預覽已更新;正在等待最新要求。</translation>+ </message>+ <message>+ <source>Processing batch…</source>+ <translation>正在批次處理…</translation>+ </message>+ <message>+ <source>%1 complete, %2 failed.</source>+ <translation>已完成:%1,失敗:%2。</translation>+ </message>+ <message>+ <source>Interpolating video</source>+ <translation>正在進行影片畫格插補</translation>+ </message>+ <message>+ <source>Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation.</source>+ <translation>每個工作流程只能使用一個畫格生成引擎。請選擇 DLSS、AMD FSR 或 VFX 畫格生成。</translation>+ </message>+ <message>+ <source>DLSS Neural Rendering requires at least 64 by 64 input.</source>+ <translation>DLSS 神經渲染要求輸入至少為 64 × 64 像素。</translation>+ </message>+ <message>+ <source>Scaling cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>縮放無法在此位置處理 HDR 影片。請將其移至 HDR 轉換之前。</translation>+ </message>+ <message>+ <source>The requested output is below the supported 64 by 64 minimum.</source>+ <translation>要求的輸出尺寸小於支援的最小尺寸 64 × 64 像素。</translation>+ </message>+ <message>+ <source>DLSS Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>DLSS 超解析度無法在此位置處理 HDR 影片。請將其移至 HDR 轉換之前。</translation>+ </message>+ <message>+ <source>Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.</source>+ <translation>光線重建要求 HDR 影片明確標示為 PQ 或 HLG。</translation>+ </message>+ <message>+ <source>RTX Super Resolution cannot process HDR video at this position. Move it before HDR conversion.</source>+ <translation>RTX 超解析度無法在此位置處理 HDR 影片。請將其移至 HDR 轉換之前。</translation>+ </message>+ <message>+ <source>NVIDIA Video Effects is video-only.</source>+ <translation>NVIDIA Video Effects 僅支援影片。</translation>+ </message>+ <message>+ <source>The legacy NVIDIA VFX preset has no enabled effect.</source>+ <translation>舊版 NVIDIA VFX 預設集中沒有啟用的效果。</translation>+ </message>+ <message>+ <source>This video effect requires SDR at this position. Move its card before HDR conversion.</source>+ <translation>此影片效果在目前位置要求 SDR 輸入。請將其卡片移至 HDR 轉換之前。</translation>+ </message>+ <message>+ <source>RTX Video HDR requires SDR at this position.</source>+ <translation>RTX HDR 影片在此位置要求 SDR 輸入。</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires at least 64 by 64 pixels.</source>+ <translation>FSR 畫格生成要求至少為 64 × 64 像素。</translation>+ </message>+ <message>+ <source>FSR Frame Generation supports up to 16384 pixels per side.</source>+ <translation>FSR 畫格生成支援每邊最多 16384 像素。</translation>+ </message>+ <message>+ <source>Frame Generation target FPS must exceed the frame rate entering this card. Choose a higher target FPS.</source>+ <translation>畫格生成的目標畫格率必須高於此卡片的輸入畫格率。請選擇更高的目標畫格率。</translation>+ </message>+ <message>+ <source>Sharpening requires SDR video at this position. Move it before HDR conversion.</source>+ <translation>銳化在此位置要求 SDR 影片。請將其移至 HDR 轉換之前。</translation>+ </message>+ <message>+ <source>The selected .cube LUT is unavailable.</source>+ <translation>所選 .cube LUT 無法使用。</translation>+ </message>+ <message>+ <source>The selected ReShade .ini preset is unavailable.</source>+ <translation>所選 ReShade .ini 預設集無法使用。</translation>+ </message>+ <message>+ <source>ReShade requires at least 16 by 16 input.</source>+ <translation>ReShade 要求輸入至少為 16 × 16 像素。</translation>+ </message>+ <message>+ <source>The selected codec does not support this container.</source>+ <translation>所選編解碼器不支援此封裝格式。</translation>+ </message>+ <message>+ <source>Video export requires even output dimensions.</source>+ <translation>影片匯出的輸出寬度和高度必須為偶數。</translation>+ </message>+ <message>+ <source>HDR output requires 10-bit HDR Mode in Export Settings.</source>+ <translation>HDR 輸出要求在匯出設定中啟用 10 位元 HDR 模式。</translation>+ </message>+ <message>+ <source>HDR requires a 10-bit or higher video codec.</source>+ <translation>HDR 要求使用 10 位元或更高位元深度的影片編解碼器。</translation>+ </message>+ <message>+ <source>Custom suffix is empty or contains invalid filename characters.</source>+ <translation>自訂後綴為空白或包含檔名不允許的字元。</translation>+ </message>+ <message>+ <source>FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec.</source>+ <translation>FSR 畫格生成要求使用 H.264、HEVC 或 AV1 GPU 編碼。請選擇支援的編解碼器。</translation>+ </message>+ <message>+ <source>GPU encoding is unavailable for the selected FSR DirectX adapter</source>+ <translation>所選 FSR DirectX 配接器不支援 GPU 編碼</translation>+ </message>+ <message>+ <source>HDR FSR input requires HDR Mode and a 10-bit output codec</source>+ <translation>HDR FSR 輸入要求啟用 HDR 模式並使用 10 位元輸出編解碼器</translation>+ </message>+ </context></TS>diff --git a/src/media/av_api.hpp b/src/media/av_api.hppindex ecf62d9..064acf8 100644--- a/src/media/av_api.hpp+++ b/src/media/av_api.hpp@@ -21,6 +21,7 @@ struct Api {AV_FN(av_find_input_format); AV_FN(av_malloc); AV_FN(av_free);AV_FN(avio_alloc_context); AV_FN(avio_context_free);AV_FN(avcodec_find_decoder); AV_FN(avcodec_find_encoder_by_name); AV_FN(avcodec_get_hw_config);+ AV_FN(avcodec_get_hw_frames_parameters);AV_FN(avcodec_alloc_context3); AV_FN(avcodec_parameters_to_context); AV_FN(avcodec_parameters_from_context);AV_FN(avcodec_open2); AV_FN(avcodec_free_context); AV_FN(avcodec_send_packet); AV_FN(avcodec_receive_frame);AV_FN(avcodec_flush_buffers); AV_FN(avformat_flush);@@ -34,6 +35,8 @@ struct Api {AV_FN(av_new_packet);AV_FN(av_packet_side_data_new);AV_FN(av_buffer_ref); AV_FN(av_buffer_unref); AV_FN(av_hwdevice_ctx_create);+ AV_FN(av_hwdevice_ctx_alloc); AV_FN(av_hwdevice_ctx_init);+ AV_FN(av_hwdevice_ctx_create_derived); AV_FN(av_hwframe_ctx_create_derived); AV_FN(av_hwframe_map);AV_FN(av_hwframe_ctx_alloc); AV_FN(av_hwframe_ctx_init); AV_FN(av_hwframe_get_buffer);AV_FN(av_hwframe_transfer_data);AV_FN(avformat_alloc_output_context2); AV_FN(avformat_new_stream); AV_FN(avformat_write_header);@@ -41,7 +44,7 @@ struct Api {AV_FN(avio_open); AV_FN(avio_closep); AV_FN(av_dict_set); AV_FN(av_dict_free);AV_FN(avio_flush);AV_FN(av_strerror); AV_FN(av_d2q); AV_FN(av_rescale_q); AV_FN(av_pix_fmt_desc_get);- AV_FN(av_get_pix_fmt);+ AV_FN(av_get_pix_fmt); AV_FN(av_rescale_q_rnd);AV_FN(av_color_space_from_name); AV_FN(av_color_primaries_from_name); AV_FN(av_color_transfer_from_name);AV_FN(sws_alloc_context); AV_FN(sws_free_context); AV_FN(sws_scale_frame);#undef AV_FNdiff --git a/src/media/av_library.hpp b/src/media/av_library.hppindex 7806ccd..c6f842f 100644--- a/src/media/av_library.hpp+++ b/src/media/av_library.hpp@@ -23,7 +23,8 @@ class AvLibrary {private:AvLibrary() {- QDir directory(Paths::instance().at("bin/runtime/av"));+ const auto override=qEnvironmentVariable("VE_MEDIA_RUNTIME_DIRECTORY");+ QDir directory(override.isEmpty()?Paths::instance().at("bin/runtime/av"):override);for (const auto* name : {"avutil", "avcodec", "avformat", "swscale"}) {const auto files = directory.entryList({QString::fromLatin1(name) + "-*.dll"}, QDir::Files);if (files.size() != 1)diff --git a/src/media/d3d11_video.cpp b/src/media/d3d11_video.cppnew file mode 100644index 0000000..af8c480--- /dev/null+++ b/src/media/d3d11_video.cpp@@ -0,0 +1,126 @@+#include "d3d_video.hpp"+#include "av_api.hpp"+#include "fsr_frame_generation/fsr_bridge.h"+#include <d3d11_4.h>+#include <d3d12.h>+#include <dxgi1_6.h>+#include <wrl/client.h>+extern "C" {+#include <libavutil/hwcontext_d3d11va.h>+}+#include <algorithm>+#include <array>+#include <chrono>+#include <vector>++namespace ve {+namespace {+using Microsoft::WRL::ComPtr;+void checkDx(HRESULT status,const char* operation){if(FAILED(status))throw D3dVideoUnavailable(std::string(operation)+" (HRESULT "+std::to_string(uint32_t(status))+")");}+}+struct D3d11VideoDecoder::Impl {+ av::Api& api=av::Api::get();JobControl& control;AVFormatContext* format=nullptr;AVCodecContext* codec=nullptr;+ AVBufferRef* hardware=nullptr;AVPacket* packet=nullptr;int stream=-1;bool draining=false,unsafe=false;+ double start=0,timestampOffset=0;qint64 origin=AV_NOPTS_VALUE;std::string poolError;+ ComPtr<ID3D12Device> device;ComPtr<ID3D12CommandQueue> queue;ComPtr<ID3D12Fence> ready;+ ComPtr<ID3D11Device> device11;ComPtr<ID3D11DeviceContext> context11;ComPtr<ID3D11DeviceContext4> context4;ComPtr<ID3D11Fence> decodeFence;+ uint64_t sequence=0;+ struct Output {ComPtr<ID3D12Resource> texture;ComPtr<ID3D11Texture2D> shared11;ComPtr<ID3D12Fence> fence;av::Frame decoded;uint64_t value=0;};+ std::vector<std::shared_ptr<Output>> buffers;+ static AVPixelFormat select(AVCodecContext* codec,const AVPixelFormat* formats) noexcept {+ auto& self=*static_cast<Impl*>(codec->opaque);+ try{+ for(auto* current=formats;*current!=AV_PIX_FMT_NONE;++current)if(*current==AV_PIX_FMT_D3D11){+ AVBufferRef* pool=nullptr;av::check(self.api.avcodec_get_hw_frames_parameters(codec,codec->hw_device_ctx,*current,&pool),"Describe shared D3D11 decoder pool");+ try{auto* frames=reinterpret_cast<AVHWFramesContext*>(pool->data);auto* dx=reinterpret_cast<AVD3D11VAFramesContext*>(frames->hwctx);+ dx->MiscFlags=0;+ frames->initial_pool_size=std::max(frames->initial_pool_size,16)+4;+ av::check(self.api.av_hwframe_ctx_init(pool),"Allocate shared D3D11 decoding textures");+ }catch(...){self.api.av_buffer_unref(&pool);throw;}+ self.api.av_buffer_unref(&codec->hw_frames_ctx);codec->hw_frames_ctx=pool;return *current;+ }+ self.poolError="The source codec has no DirectX 11 hardware decoder";+ }catch(const std::exception& error){self.poolError=error.what();}catch(...){self.poolError="Cannot allocate shared D3D11 decoder surfaces";}+ return AV_PIX_FMT_NONE;+ }+ Impl(const QString& path,void* d3dDevice,void* d3dQueue,double seconds,JobControl& job)+ :control(job),start(seconds),device(static_cast<ID3D12Device*>(d3dDevice)),queue(static_cast<ID3D12CommandQueue*>(d3dQueue)){+ try{+ if(!device||!queue)throw D3dVideoUnavailable("DirectX decoding requires a device and queue");+ ComPtr<IDXGIFactory4> factory;ComPtr<IDXGIAdapter1> adapter;+ checkDx(CreateDXGIFactory2(0,IID_PPV_ARGS(&factory)),"Create DirectX decoding factory");checkDx(factory->EnumAdapterByLuid(device->GetAdapterLuid(),IID_PPV_ARGS(&adapter)),"Select DirectX decoding adapter");+ checkDx(D3D11CreateDevice(adapter.Get(),D3D_DRIVER_TYPE_UNKNOWN,nullptr,D3D11_CREATE_DEVICE_VIDEO_SUPPORT,nullptr,0,D3D11_SDK_VERSION,&device11,nullptr,&context11),"Create shared DirectX decoding device");+ ComPtr<ID3D11Multithread> multithread;checkDx(context11.As(&multithread),"Protect DirectX decoder context");multithread->SetMultithreadProtected(TRUE);+ ComPtr<ID3D11Device5> device5;checkDx(device11.As(&device5),"Open DirectX decoder fence API");checkDx(context11.As(&context4),"Open DirectX decoder queue API");+ checkDx(device5->CreateFence(0,D3D11_FENCE_FLAG_SHARED,IID_PPV_ARGS(&decodeFence)),"Create shared decode fence");HANDLE handle=nullptr;+ checkDx(decodeFence->CreateSharedHandle(nullptr,GENERIC_ALL,nullptr,&handle),"Share decoder completion fence");+ const auto opened=device->OpenSharedHandle(handle,IID_PPV_ARGS(&ready));CloseHandle(handle);checkDx(opened,"Open decoder fence in DirectX 12");+ hardware=api.av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_D3D11VA);if(!hardware)throw std::bad_alloc{};+ auto* dx=reinterpret_cast<AVD3D11VADeviceContext*>(reinterpret_cast<AVHWDeviceContext*>(hardware->data)->hwctx);dx->device=device11.Get();dx->device->AddRef();+ av::check(api.av_hwdevice_ctx_init(hardware),"Initialize shared DirectX decoder device");+ format=api.avformat_alloc_context();if(!format)throw std::bad_alloc{};format->interrupt_callback={[](void* context){return static_cast<JobControl*>(context)->cancelled()?1:0;},&control};+ av::check(api.avformat_open_input(&format,path.toUtf8().constData(),nullptr,nullptr),"Open DirectX decoder source");av::check(api.avformat_find_stream_info(format,nullptr),"Probe DirectX decoder source");+ stream=api.av_find_best_stream(format,AVMEDIA_TYPE_VIDEO,-1,-1,nullptr,0);av::check(stream,"Find DirectX decoder video stream");+ const auto* decoder=api.avcodec_find_decoder(format->streams[stream]->codecpar->codec_id);if(!decoder)throw D3dVideoUnavailable("Source video decoder is unavailable");+ bool supported=false;for(int i=0;;++i){const auto* config=api.avcodec_get_hw_config(decoder,i);if(!config)break;if(config->device_type==AV_HWDEVICE_TYPE_D3D11VA&&config->pix_fmt==AV_PIX_FMT_D3D11)supported=true;}+ if(!supported)throw D3dVideoUnavailable("Source codec has no DirectX hardware decoder");+ codec=api.avcodec_alloc_context3(decoder);if(!codec)throw std::bad_alloc{};av::check(api.avcodec_parameters_to_context(codec,format->streams[stream]->codecpar),"Describe shared DirectX decoder");+ codec->pkt_timebase=format->streams[stream]->time_base;codec->hw_device_ctx=api.av_buffer_ref(hardware);if(!codec->hw_device_ctx)throw std::bad_alloc{};+ codec->opaque=this;codec->get_format=select;codec->thread_count=1;av::check(api.avcodec_open2(codec,decoder,nullptr),"Open shared DirectX hardware decoder");+ packet=api.av_packet_alloc();if(!packet)throw std::bad_alloc{};const auto* track=format->streams[stream];+ if(track->start_time!=AV_NOPTS_VALUE)timestampOffset=track->start_time*av_q2d(track->time_base);else if(format->start_time!=AV_NOPTS_VALUE)timestampOffset=double(format->start_time)/AV_TIME_BASE;+ if(start>0)av::check(api.avformat_seek_file(format,-1,INT64_MIN,qint64((timestampOffset+std::max(0.,start-.002))*AV_TIME_BASE),INT64_MAX,0),"Seek shared DirectX decoder");+ }catch(...){release();throw;}+ }+ void wait(uint64_t value,bool cancellable){+ if(!value)return;if(ready->GetCompletedValue()==UINT64_MAX){unsafe=true;throw std::runtime_error("DirectX decoder device was removed");}if(ready->GetCompletedValue()>=value)return;+ HANDLE event=CreateEventW(nullptr,FALSE,FALSE,nullptr);if(!event){unsafe=true;throw std::runtime_error("Cannot wait for decoder GPU copy");}+ const auto status=ready->SetEventOnCompletion(value,event);if(FAILED(status)){CloseHandle(event);unsafe=true;checkDx(status,"Wait for decoder copy fence");}+ const auto deadline=std::chrono::steady_clock::now()+std::chrono::seconds(30);+ try{for(;;){if(cancellable)control.checkpoint();const auto result=WaitForSingleObject(event,50);if(result==WAIT_OBJECT_0)break;+ if(result!=WAIT_TIMEOUT||FAILED(device->GetDeviceRemovedReason())||std::chrono::steady_clock::now()>deadline){unsafe=true;throw std::runtime_error("Decoder GPU copy did not finish");}}}+ catch(...){CloseHandle(event);throw;}CloseHandle(event);+ }+ void release(){api.av_packet_free(&packet);api.avcodec_free_context(&codec);api.av_buffer_unref(&hardware);if(format)api.avformat_close_input(&format);}+ ~Impl(){release();}+ TimeBase base()const{const auto value=format->streams[stream]->time_base;return{value.num,value.den};}+ std::shared_ptr<Output> copy(av::Frame frame){+ wait(sequence,true);for(auto& buffer:buffers)if(buffer->value<=ready->GetCompletedValue())buffer->decoded.reset();+ std::shared_ptr<Output> target;for(auto& buffer:buffers)if(buffer.use_count()==1){target=buffer;break;}+ if(!target){if(buffers.size()>=4)throw std::runtime_error("Shared DirectX decoder exhausted its bounded output pool");target=std::make_shared<Output>();buffers.push_back(target);}+ auto* texture=reinterpret_cast<ID3D11Texture2D*>(frame->data[0]);const auto slice=uint32_t(reinterpret_cast<uintptr_t>(frame->data[1]));+ D3D11_TEXTURE2D_DESC source{};texture->GetDesc(&source);if(source.Format!=DXGI_FORMAT_NV12&&source.Format!=DXGI_FORMAT_P010)throw D3dVideoUnavailable("Shared DirectX decoder requires NV12 or P010");+ if(slice>=source.ArraySize)throw std::runtime_error("Decoded DirectX slice is outside the texture array");+ if(target->texture){const auto desc=target->texture->GetDesc();if(desc.Width!=source.Width||desc.Height!=source.Height||desc.Format!=source.Format){target->texture.Reset();target->shared11.Reset();}}+ if(!target->texture){auto desc=source;desc.ArraySize=1;desc.MipLevels=1;desc.BindFlags=D3D11_BIND_SHADER_RESOURCE;desc.MiscFlags=D3D11_RESOURCE_MISC_SHARED|D3D11_RESOURCE_MISC_SHARED_NTHANDLE;+ checkDx(device11->CreateTexture2D(&desc,nullptr,&target->shared11),"Allocate shared decoded video texture");+ ComPtr<IDXGIResource1> shared;checkDx(target->shared11.As(&shared),"Open decoded texture sharing");HANDLE handle=nullptr;+ checkDx(shared->CreateSharedHandle(nullptr,DXGI_SHARED_RESOURCE_READ|DXGI_SHARED_RESOURCE_WRITE,nullptr,&handle),"Share decoded GPU texture");+ const auto opened=device->OpenSharedHandle(handle,IID_PPV_ARGS(&target->texture));CloseHandle(handle);checkDx(opened,"Open decoded texture in DirectX 12");}+ // Decoder array allocations have driver-specific restrictions. Copy the+ // selected slice into a normal shared texture before crossing APIs.+ context11->CopySubresourceRegion(target->shared11.Get(),0,0,0,0,texture,slice,nullptr);+ const auto value=sequence+1;target->decoded=std::move(frame);target->fence=ready;target->value=value;sequence=value;+ const auto signaled=context4->Signal(decodeFence.Get(),value);if(FAILED(signaled))unsafe=true;checkDx(signaled,"Signal copied DirectX decode");context11->Flush();return target;+ }+};+D3d11VideoDecoder::D3d11VideoDecoder(const QString& path,void* device,void* queue,double start,JobControl& control):impl_(std::make_unique<Impl>(path,device,queue,start,control)){}+D3d11VideoDecoder::~D3d11VideoDecoder(){if(impl_){try{impl_->wait(impl_->sequence,false);}catch(...){impl_->unsafe=true;}if(impl_->unsafe)(void)impl_.release();}}+double D3d11VideoDecoder::timeOrigin()const{if(impl_->origin==AV_NOPTS_VALUE)throw std::logic_error("Read a decoded frame before its time origin");const auto base=impl_->base();return impl_->origin*double(base.numerator)/base.denominator;}+std::optional<D3dVideoFrame> D3d11VideoDecoder::read(){+ auto& s=*impl_;for(;;){s.control.checkpoint();auto frame=av::frame();const auto status=s.api.avcodec_receive_frame(s.codec,frame.get());+ if(status>=0){if(frame->format!=AV_PIX_FMT_D3D11||!frame->data[0])throw D3dVideoUnavailable("Decoder did not return DirectX 11 GPU video");+ const auto pts=frame->best_effort_timestamp!=AV_NOPTS_VALUE?frame->best_effort_timestamp:frame->pts;if(pts==AV_NOPTS_VALUE)throw std::runtime_error("DirectX decoded frame has no presentation timestamp");+ const auto base=s.base();if(pts*double(base.numerator)/base.denominator+.002<s.start+s.timestampOffset)continue;if(s.origin==AV_NOPTS_VALUE)s.origin=pts;+ D3dVideoFrame result;result.size={frame->width,frame->height};result.pts=pts-s.origin;result.duration=frame->duration;result.timeBase=base;+ result.colorMatrix=frame->colorspace==AVCOL_SPC_BT2020_NCL?2u:frame->colorspace==AVCOL_SPC_FCC?3u:frame->colorspace==AVCOL_SPC_SMPTE240M?4u:frame->colorspace==AVCOL_SPC_SMPTE170M||frame->colorspace==AVCOL_SPC_BT470BG?0u:1u;+ result.colorRange=frame->color_range==AVCOL_RANGE_JPEG?1u:0u;result.chromaLocation=frame->chroma_location==AVCHROMA_LOC_UNSPECIFIED?1u:uint32_t(frame->chroma_location);+ auto target=s.copy(std::move(frame));result.texture=target->texture.Get();result.readyFence=target->fence.Get();result.readyValue=target->value;+ result.pixelFormat=target->texture->GetDesc().Format==DXGI_FORMAT_P010?VE_FSR_P010:VE_FSR_NV12;result.owner=std::move(target);return result;+ }+ if(status==AVERROR_EOF)return{};if(status!=AVERROR(EAGAIN))av::check(status,"Receive shared DirectX frame");if(s.draining)throw std::runtime_error("Shared DirectX decoder did not finish draining");+ for(;;){s.api.av_packet_unref(s.packet);const auto read=s.api.av_read_frame(s.format,s.packet);if(read==AVERROR_EOF){av::check(s.api.avcodec_send_packet(s.codec,nullptr),"Drain shared DirectX decoder");s.draining=true;break;}+ av::check(read,"Read shared DirectX packet");if(s.packet->stream_index==s.stream){const auto sent=s.api.avcodec_send_packet(s.codec,s.packet);if(sent<0&&!s.poolError.empty())throw D3dVideoUnavailable(s.poolError);av::check(sent,"Submit shared DirectX decoding packet");break;}}+ }+}+}diff --git a/src/media/d3d_amf.cpp b/src/media/d3d_amf.cppnew file mode 100644index 0000000..b26d6db--- /dev/null+++ b/src/media/d3d_amf.cpp@@ -0,0 +1,134 @@+#include "d3d_amf.hpp"+#include "d3d_video.hpp"+#include "av_api.hpp"+#include "host_video.hpp"+#include "configuration/settings.hpp"+#include "processing/fsr_native.hpp"+#include <d3d11_4.h>+#include <d3d12.h>+#include <dxgi1_6.h>+#include <wrl/client.h>+extern "C" {+#include <libavutil/hwcontext_d3d11va.h>+}+#include <cmath>+#include <map>++namespace ve {+namespace {+using Microsoft::WRL::ComPtr;+void requireDx(HRESULT status,const char* operation){if(FAILED(status))throw D3dVideoUnavailable(std::string(operation)+" (HRESULT "+std::to_string(uint32_t(status))+")");}+}+struct D3dSharedEncoder::Impl {+ av::Api& api=av::Api::get();JobControl& control;MediaInfo info;+ ComPtr<ID3D12Device> device;ComPtr<ID3D11Device> device11;ComPtr<ID3D11DeviceContext> context11;+ AVFormatContext* format=nullptr;AVCodecContext* codec=nullptr;AVStream* stream=nullptr;AVPacket* packet=nullptr;+ AVBufferRef* hardware=nullptr;AVBufferRef* pool=nullptr;AVBufferRef* qsvDevice=nullptr;AVBufferRef* qsvPool=nullptr;+ bool ten=false,finished=false,intel=false;quint64 sent=0,received=0;+ std::map<qint64,qint64> durations;+ struct Shared {ComPtr<ID3D11Texture2D> texture;ComPtr<ID3D12Resource> resource;};+ std::map<ID3D11Texture2D*,Shared> shared;+ Impl(const QString& path,const QString& name,const Settings& settings,const MediaInfo& output,void* d3dDevice,JobControl& job,bool allIntra)+ :control(job),info(output),device(static_cast<ID3D12Device*>(d3dDevice)){+ AVDictionary* options=nullptr;+ try{+ if(!device||(info.width&1)||(info.height&1)||info.width<2||info.height<2)throw D3dVideoUnavailable("AMF requires a DirectX device and even video dimensions");+ const bool h264=name.startsWith("h264",Qt::CaseInsensitive)||name.startsWith("H.264");const bool av1=name.startsWith("av1",Qt::CaseInsensitive);+ if(h264&&info.hdr)throw D3dVideoUnavailable("HDR AMD output requires HEVC or AV1");+ ComPtr<IDXGIFactory4> factory;requireDx(CreateDXGIFactory2(0,IID_PPV_ARGS(&factory)),"Create AMF adapter factory");+ ComPtr<IDXGIAdapter1> adapter;requireDx(factory->EnumAdapterByLuid(device->GetAdapterLuid(),IID_PPV_ARGS(&adapter)),"Select AMD encoder adapter");+ DXGI_ADAPTER_DESC1 desc{};requireDx(adapter->GetDesc1(&desc),"Describe shared DirectX encoder adapter");+ if(desc.VendorId!=0x1002&&desc.VendorId!=0x8086)throw D3dVideoUnavailable("Shared DirectX encoding requires an AMD or Intel graphics adapter");+ intel=desc.VendorId==0x8086;+ const auto encoderName=intel?(h264?"h264_qsv":av1?"av1_qsv":"hevc_qsv"):(h264?"h264_amf":av1?"av1_amf":"hevc_amf");+ const auto* encoder=api.avcodec_find_encoder_by_name(encoderName);if(!encoder)throw D3dVideoUnavailable("Bundled shared DirectX hardware encoder is unavailable");+ requireDx(D3D11CreateDevice(adapter.Get(),D3D_DRIVER_TYPE_UNKNOWN,nullptr,D3D11_CREATE_DEVICE_VIDEO_SUPPORT|D3D11_CREATE_DEVICE_BGRA_SUPPORT,nullptr,0,D3D11_SDK_VERSION,&device11,nullptr,&context11),"Create DirectX AMF device");+ ComPtr<ID3D11Multithread> multithread;requireDx(context11.As(&multithread),"Protect AMD video context");multithread->SetMultithreadProtected(TRUE);+ hardware=api.av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_D3D11VA);if(!hardware)throw std::bad_alloc{};+ auto* dx=reinterpret_cast<AVD3D11VADeviceContext*>(reinterpret_cast<AVHWDeviceContext*>(hardware->data)->hwctx);dx->device=device11.Get();dx->device->AddRef();+ av::check(api.av_hwdevice_ctx_init(hardware),"Initialize AMF DirectX device");+ ten=!h264&&(info.hdr||settings.hdr_mode||info.precisionBits()>8);+ pool=api.av_hwframe_ctx_alloc(hardware);if(!pool)throw std::bad_alloc{};auto* frames=reinterpret_cast<AVHWFramesContext*>(pool->data);+ frames->format=AV_PIX_FMT_D3D11;frames->sw_format=ten?AV_PIX_FMT_P010LE:AV_PIX_FMT_NV12;frames->width=info.width;frames->height=info.height;frames->initial_pool_size=0;+ auto* frameContext=reinterpret_cast<AVD3D11VAFramesContext*>(frames->hwctx);frameContext->BindFlags=D3D11_BIND_SHADER_RESOURCE;+ frameContext->MiscFlags=D3D11_RESOURCE_MISC_SHARED|D3D11_RESOURCE_MISC_SHARED_NTHANDLE;+ av::check(api.av_hwframe_ctx_init(pool),"Initialize shared DirectX AMF frame pool");+ if(intel){+ // FFmpeg 8.1 dynamic QSV mappings retain the individual D3D11+ // texture; DIRECT rejects any route requiring host image copies.+ av::check(api.av_hwdevice_ctx_create_derived(&qsvDevice,AV_HWDEVICE_TYPE_QSV,hardware,0),"Derive Intel QSV from selected DirectX adapter");+ av::check(api.av_hwframe_ctx_create_derived(&qsvPool,AV_PIX_FMT_QSV,qsvDevice,pool,AV_HWFRAME_MAP_READ|AV_HWFRAME_MAP_DIRECT),"Derive direct Intel hardware frame pool");+ auto probe=av::frame();av::check(api.av_hwframe_get_buffer(pool,probe.get(),0),"Probe Intel shared surface");+ if(reinterpret_cast<intptr_t>(probe->data[1])!=0)throw D3dVideoUnavailable("Intel DirectX pool requires unsupported array slices");+ target(reinterpret_cast<ID3D11Texture2D*>(probe->data[0]));(void)mapQsv(probe.get());+ }+ codec=api.avcodec_alloc_context3(encoder);if(!codec)throw std::bad_alloc{};codec->width=info.width;codec->height=info.height;+ codec->pix_fmt=intel?AV_PIX_FMT_QSV:AV_PIX_FMT_D3D11;codec->time_base={1,60000000};codec->framerate=api.av_d2q(info.fps,1000000);+ codec->gop_size=int(std::llround(info.fps*10));codec->max_b_frames=-1;codec->qmin=-1;codec->qmax=-1;+ codec->hw_frames_ctx=api.av_buffer_ref(intel?qsvPool:pool);if(!codec->hw_frames_ctx)throw std::bad_alloc{};+ const auto aspect=info.outputSampleAspectRatio();codec->sample_aspect_ratio={aspect.width(),aspect.height()};codec->color_range=AVCOL_RANGE_MPEG;codec->colorspace=info.hdr?AVCOL_SPC_BT2020_NCL:AVCOL_SPC_BT709;+ const auto primaries=api.av_color_primaries_from_name(info.primaries.toUtf8().constData()),transfer=api.av_color_transfer_from_name(info.transfer.toUtf8().constData());+ codec->color_primaries=AVColorPrimaries(primaries<0?(info.hdr?9:1):primaries);codec->color_trc=AVColorTransferCharacteristic(transfer<0?(info.hdr?16:1):transfer);codec->chroma_sample_location=AVCHROMA_LOC_LEFT;+ const int quality=settings.quality=="Max"?1:settings.quality=="Best"?20:settings.quality=="Good"?24:28;+ if(intel){+ api.av_dict_set(&options,"preset","veryslow",0);codec->global_quality=quality;codec->max_b_frames=3;+ if(h264)api.av_dict_set(&options,"look_ahead","1",0);+ }else{+ api.av_dict_set(&options,"usage","transcoding",0);api.av_dict_set(&options,"quality","quality",0);api.av_dict_set(&options,"rc","cqp",0);+ api.av_dict_set(&options,"qp_i",QByteArray::number(quality).constData(),0);api.av_dict_set(&options,"qp_p",QByteArray::number(quality).constData(),0);+ if(h264)api.av_dict_set(&options,"qp_b",QByteArray::number(quality).constData(),0);+ }+ if(allIntra){codec->gop_size=1;codec->max_b_frames=0;}+ api.av_dict_set(&options,"async_depth","4",0);+ av::check(api.avformat_alloc_output_context2(&format,nullptr,"mp4",path.toUtf8().constData()),"Create AMD video muxer");format->avoid_negative_ts=AVFMT_AVOID_NEG_TS_DISABLED;+ if(format->oformat->flags&AVFMT_GLOBALHEADER)codec->flags|=AV_CODEC_FLAG_GLOBAL_HEADER;+ av::check(api.avcodec_open2(codec,encoder,&options),"Open AMD DirectX hardware encoder");api.av_dict_free(&options);+ stream=api.avformat_new_stream(format,nullptr);if(!stream)throw std::bad_alloc{};stream->time_base=codec->time_base;stream->avg_frame_rate=codec->framerate;+ av::check(api.avcodec_parameters_from_context(stream->codecpar,codec),"Describe AMD encoded stream");retainStaticHdrMetadata(stream->codecpar,info);+ av::check(api.avio_open(&format->pb,path.toUtf8().constData(),AVIO_FLAG_WRITE),"Open AMD video destination");api.av_dict_set(&options,"video_track_timescale","60000000",0);+ av::check(api.avformat_write_header(format,&options),"Write AMD video header");api.av_dict_free(&options);packet=api.av_packet_alloc();if(!packet)throw std::bad_alloc{};+ }catch(...){api.av_dict_free(&options);release();throw;}+ }+ void release(){api.av_packet_free(&packet);api.avcodec_free_context(&codec);shared.clear();api.av_buffer_unref(&qsvPool);api.av_buffer_unref(&qsvDevice);api.av_buffer_unref(&pool);api.av_buffer_unref(&hardware);+ if(format){if(format->pb)api.avio_closep(&format->pb);api.avformat_free_context(format);format=nullptr;}}+ ~Impl(){release();}+ av::Frame mapQsv(const AVFrame* source){+ auto mapped=av::frame();mapped->format=AV_PIX_FMT_QSV;mapped->hw_frames_ctx=api.av_buffer_ref(qsvPool);if(!mapped->hw_frames_ctx)throw std::bad_alloc{};+ av::check(api.av_hwframe_map(mapped.get(),source,AV_HWFRAME_MAP_READ|AV_HWFRAME_MAP_DIRECT),"Map shared DirectX texture directly to Intel QSV");+ av::check(api.av_frame_copy_props(mapped.get(),source),"Retain Intel mapped frame properties");return mapped;+ }+ ID3D12Resource* target(ID3D11Texture2D* texture){+ if(const auto found=shared.find(texture);found!=shared.end())return found->second.resource.Get();+ if(shared.size()>=64)throw std::runtime_error("AMD hardware encoder exceeded its bounded shared surface pool");+ ComPtr<IDXGIResource1> dxgi;requireDx(texture->QueryInterface(IID_PPV_ARGS(&dxgi)),"Share AMD encoder texture");HANDLE handle=nullptr;+ requireDx(dxgi->CreateSharedHandle(nullptr,DXGI_SHARED_RESOURCE_READ|DXGI_SHARED_RESOURCE_WRITE,nullptr,&handle),"Create AMD encoder shared handle");+ Shared entry;entry.texture=texture;const auto status=device->OpenSharedHandle(handle,IID_PPV_ARGS(&entry.resource));CloseHandle(handle);requireDx(status,"Open AMD encoder texture in DirectX 12");+ auto* resource=entry.resource.Get();shared.emplace(texture,std::move(entry));return resource;+ }+ void packets(){for(;;){control.checkpoint();const auto status=api.avcodec_receive_packet(codec,packet);if(status==AVERROR(EAGAIN)||status==AVERROR_EOF)return;+ av::check(status,"Receive AMD video packet");const auto found=durations.find(packet->pts);if(found==durations.end())throw std::runtime_error("AMD encoded timestamp does not match submitted input");+ packet->duration=found->second;durations.erase(found);api.av_packet_rescale_ts(packet,codec->time_base,stream->time_base);packet->stream_index=stream->index;+ av::check(api.av_interleaved_write_frame(format,packet),"Mux AMD video packet");api.av_packet_unref(packet);++received;}}+};+D3dSharedEncoder::D3dSharedEncoder(const QString& path,const QString& codec,const Settings& settings,const MediaInfo& info,void* device,JobControl& control,bool allIntra):impl_(std::make_unique<Impl>(path,codec,settings,info,device,control,allIntra)){}+D3dSharedEncoder::~D3dSharedEncoder()=default;+QString D3dSharedEncoder::diagnostics()const{return QString("%1; shared DirectX 12/11; quality; %2-bit; %3 shared GPU surfaces").arg(impl_->intel?"Intel QSV direct hardware mapping":"AMD AMF").arg(impl_->ten?10:8).arg(impl_->shared.size());}+void D3dSharedEncoder::write(const FsrSurface& surface,qint64 pts,qint64 duration,TimeBase base,bool forceIntra){+ auto& s=*impl_;s.control.checkpoint();if(s.finished)throw std::logic_error("Cannot write after AMD encoding finishes");+ auto frame=av::frame();av::check(s.api.av_hwframe_get_buffer(s.pool,frame.get(),0),"Allocate AMD hardware video surface");+ if(reinterpret_cast<intptr_t>(frame->data[1])!=0)throw std::runtime_error("AMD encoder pool returned an unsupported array slice");+ VeFsrVideoOutput output{};output.size=sizeof(output);output.abi=VE_FSR_ABI_VERSION;output.width=uint32_t(s.info.width);output.height=uint32_t(s.info.height);+ output.texture=s.target(reinterpret_cast<ID3D11Texture2D*>(frame->data[0]));output.resource_state=D3D12_RESOURCE_STATE_COMMON;output.pixel_format=s.ten?VE_FSR_P010:VE_FSR_NV12;+ output.transfer=fsrTransfer(s.info.transfer);output.primaries=fsrPrimaries(s.info.primaries);output.color_matrix=s.info.hdr?2u:1u;output.color_range=0;output.chroma_location=1;surface.writeVideo(output);+ frame->pts=s.api.av_rescale_q(pts,{base.numerator,base.denominator},s.codec->time_base);frame->duration=s.api.av_rescale_q(duration,{base.numerator,base.denominator},s.codec->time_base);+ if(frame->duration<=0)throw std::runtime_error("AMD video frame duration must be positive");+ frame->color_range=s.codec->color_range;frame->colorspace=s.codec->colorspace;frame->color_primaries=s.codec->color_primaries;frame->color_trc=s.codec->color_trc;frame->chroma_location=AVCHROMA_LOC_LEFT;+ if(forceIntra)frame->pict_type=AV_PICTURE_TYPE_I;copyStaticHdrMetadata(frame.get(),s.stream->codecpar);+ if(!s.durations.emplace(frame->pts,frame->duration).second)throw std::runtime_error("AMD video timestamps must be unique");+ auto mapped=s.intel?s.mapQsv(frame.get()):av::Frame{};+ av::check(s.api.avcodec_send_frame(s.codec,s.intel?mapped.get():frame.get()),"Submit shared DirectX hardware video surface");++s.sent;s.packets();+ if(s.sent-s.received>64)throw std::runtime_error("AMD encoder exceeded its bounded pending frame count");+}+void D3dSharedEncoder::finish(){auto& s=*impl_;if(s.finished)return;s.control.checkpoint();av::check(s.api.avcodec_send_frame(s.codec,nullptr),"Drain AMD hardware encoder");s.packets();+ if(s.sent!=s.received||!s.durations.empty())throw std::runtime_error("AMD encoder lost submitted frames");av::check(s.api.av_write_trailer(s.format),"Finish AMD video");s.finished=true;}+}diff --git a/src/media/d3d_amf.hpp b/src/media/d3d_amf.hppnew file mode 100644index 0000000..8997189--- /dev/null+++ b/src/media/d3d_amf.hpp@@ -0,0 +1,21 @@+#pragma once+#include "media.hpp"+#include "packet_stream.hpp"+#include <memory>+namespace ve {+struct Settings;+class FsrSurface;+// AMD AMF or Intel QSV, selected by the supplied DirectX device's adapter.+// QSV is derived from this exact D3D11 device and requires a direct GPU map.+class D3dSharedEncoder {+ public:+ D3dSharedEncoder(const QString& path,const QString& codec,const Settings& settings,+ const MediaInfo& output,void* device,JobControl& control,bool allIntra=false);+ ~D3dSharedEncoder();+ void write(const FsrSurface& surface,qint64 pts,qint64 duration,TimeBase timeBase,bool forceIntra=false);+ void finish();+ [[nodiscard]] QString diagnostics() const;+ private:+ struct Impl;std::unique_ptr<Impl> impl_;+};+}diff --git a/src/media/d3d_nvenc.cpp b/src/media/d3d_nvenc.cppnew file mode 100644index 0000000..3630a0d--- /dev/null+++ b/src/media/d3d_nvenc.cpp@@ -0,0 +1,290 @@+#include "d3d_nvenc.hpp"+#include "d3d_video.hpp"+#include "av_api.hpp"+#include "host_video.hpp"+#include "configuration/settings.hpp"+#include "processing/fsr_native.hpp"+#include <nvEncodeAPI.h>+#include <d3d12.h>+#include <wrl/client.h>+#include <algorithm>+#include <array>+#include <chrono>+#include <cmath>+#include <cstring>+#include <deque>+#include <limits>+#include <map>++namespace ve {+namespace {+using Microsoft::WRL::ComPtr;+void dxCheck(HRESULT status,const char* operation){if(FAILED(status))throw std::runtime_error(std::string(operation)+" (HRESULT "+std::to_string(uint32_t(status))+")");}+struct Event {+ HANDLE handle=CreateEventW(nullptr,FALSE,FALSE,nullptr);+ Event(){if(!handle)throw std::runtime_error("Cannot allocate NVENC completion event");}+ ~Event(){CloseHandle(handle);}+};+constexpr AVRational clockBase{1,60000000};+}+struct D3dNvEncoder::Impl {+ av::Api& av=av::Api::get();JobControl& control;MediaInfo info;+ ComPtr<ID3D12Device> device;ComPtr<ID3D12CommandQueue> queue;ComPtr<ID3D12Fence> inputFence,outputFence;+ HMODULE library=nullptr;NV_ENCODE_API_FUNCTION_LIST nv{};void* encoder=nullptr;+ NV_ENC_CONFIG config{};NV_ENC_INITIALIZE_PARAMS init{};GUID codec{};+ bool ten=false,finished=false,eos=false,quarantined=false,initialized=false;+ uint64_t sent=0,received=0,fenceValue=0;size_t capacity=0;+ AVFormatContext* format=nullptr;AVStream* stream=nullptr;AVPacket* packet=nullptr;+ std::map<qint64,qint64> durations;+ std::array<std::vector<uint8_t>,2> hdrBytes;+ std::vector<NV_ENC_SEI_PAYLOAD> hdrPayloads;+ struct Slot {+ ComPtr<ID3D12Resource> input,output;+ NV_ENC_REGISTERED_PTR inputRegistration=nullptr,outputRegistration=nullptr;+ NV_ENC_INPUT_PTR mappedInput=nullptr,mappedOutput=nullptr;+ NV_ENC_INPUT_RESOURCE_D3D12 in{};NV_ENC_OUTPUT_RESOURCE_D3D12 out{};+ Event event;bool eventRegistered=false,locked=false,completed=false;+ };+ std::vector<std::unique_ptr<Slot>> pool_;+ std::deque<Slot*> pending,free;+ void check(NVENCSTATUS status,const char* operation) const {+ if(status==NV_ENC_SUCCESS)return;+ const char* detail=encoder&&nv.nvEncGetLastErrorString?nv.nvEncGetLastErrorString(encoder):nullptr;+ throw D3dVideoUnavailable(std::string(operation)+" (NVENC "+std::to_string(status)+")"+(detail?std::string(": ")+detail:""));+ }+ int cap(NV_ENC_CAPS id){NV_ENC_CAPS_PARAM query{};query.version=NV_ENC_CAPS_PARAM_VER;query.capsToQuery=id;int result=0;check(nv.nvEncGetEncodeCaps(encoder,codec,&query,&result),"Query DirectX NVENC capability");return result;}+ Impl(const QString& path,const QString& name,const Settings& settings,const MediaInfo& output,+ void* d3dDevice,void* d3dQueue,JobControl& job,bool allIntra):control(job),info(output),device(static_cast<ID3D12Device*>(d3dDevice)),queue(static_cast<ID3D12CommandQueue*>(d3dQueue)) {+ AVDictionary* options=nullptr;+ try {+ if(!device||!queue||info.width<2||info.height<2||(info.width&1)||(info.height&1)||!(info.fps>0))throw D3dVideoUnavailable("DirectX NVENC requires a device, queue and even video dimensions");+ library=LoadLibraryExW(L"nvEncodeAPI64.dll",nullptr,LOAD_LIBRARY_SEARCH_SYSTEM32);+ if(!library)throw D3dVideoUnavailable("NVIDIA's DirectX encoder driver is unavailable");+ const auto create=reinterpret_cast<NVENCSTATUS(NVENCAPI*)(NV_ENCODE_API_FUNCTION_LIST*)>(GetProcAddress(library,"NvEncodeAPICreateInstance"));+ const auto maximum=reinterpret_cast<NVENCSTATUS(NVENCAPI*)(uint32_t*)>(GetProcAddress(library,"NvEncodeAPIGetMaxSupportedVersion"));+ if(!create||!maximum)throw D3dVideoUnavailable("NVIDIA encoder driver exports are incomplete");+ uint32_t driver=0;check(maximum(&driver),"Query NVENC driver API");+ if(driver<((NVENCAPI_MAJOR_VERSION<<4)|NVENCAPI_MINOR_VERSION))throw D3dVideoUnavailable("DirectX encoding requires NVIDIA Video Codec API 12.2 or newer");+ nv.version=NV_ENCODE_API_FUNCTION_LIST_VER;check(create(&nv),"Load DirectX NVENC API");+ NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS open{};open.version=NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER;+ open.device=device.Get();open.deviceType=NV_ENC_DEVICE_TYPE_DIRECTX;open.apiVersion=NVENCAPI_VERSION;+ check(nv.nvEncOpenEncodeSessionEx(&open,&encoder),"Open DirectX 12 NVENC session");+ const bool h264=name.startsWith("h264",Qt::CaseInsensitive)||name.startsWith("H.264");+ const bool av1=name.startsWith("av1",Qt::CaseInsensitive);+ codec=h264?NV_ENC_CODEC_H264_GUID:av1?NV_ENC_CODEC_AV1_GUID:NV_ENC_CODEC_HEVC_GUID;+ uint32_t count=0;check(nv.nvEncGetEncodeGUIDCount(encoder,&count),"Count NVENC codecs");+ std::vector<GUID> guids(count);check(nv.nvEncGetEncodeGUIDs(encoder,guids.data(),count,&count),"Enumerate NVENC codecs");+ if(std::none_of(guids.begin(),guids.end(),[&](const GUID& value){return value==codec;}))throw D3dVideoUnavailable("The selected NVIDIA GPU cannot encode this codec");+ if(info.width>cap(NV_ENC_CAPS_WIDTH_MAX)||info.height>cap(NV_ENC_CAPS_HEIGHT_MAX))throw D3dVideoUnavailable("Output exceeds this NVIDIA encoder's dimensions");+ ten=!h264&&(info.hdr||settings.hdr_mode||info.precisionBits()>8);+ if(ten&&!cap(NV_ENC_CAPS_SUPPORT_10BIT_ENCODE))throw D3dVideoUnavailable("The selected NVIDIA encoder cannot preserve 10-bit video");+ if(h264&&info.hdr)throw D3dVideoUnavailable("HDR DirectX output requires HEVC or AV1");+ const auto pixel=ten?NV_ENC_BUFFER_FORMAT_YUV420_10BIT:NV_ENC_BUFFER_FORMAT_NV12;+ check(nv.nvEncGetInputFormatCount(encoder,codec,&count),"Count NVENC surface formats");+ std::vector<NV_ENC_BUFFER_FORMAT> formats(count);check(nv.nvEncGetInputFormats(encoder,codec,formats.data(),count,&count),"Enumerate NVENC surface formats");+ if(std::find(formats.begin(),formats.end(),pixel)==formats.end())throw D3dVideoUnavailable("The selected NVIDIA encoder cannot accept the required DirectX surface");+ NV_ENC_PRESET_CONFIG preset{};preset.version=NV_ENC_PRESET_CONFIG_VER;preset.presetCfg.version=NV_ENC_CONFIG_VER;+ check(nv.nvEncGetEncodePresetConfigEx(encoder,codec,NV_ENC_PRESET_P7_GUID,NV_ENC_TUNING_INFO_HIGH_QUALITY,&preset),"Select NVENC P7 high-quality preset");+ config=preset.presetCfg;config.version=NV_ENC_CONFIG_VER;+ config.profileGUID=h264?NV_ENC_H264_PROFILE_HIGH_GUID:av1?NV_ENC_AV1_PROFILE_MAIN_GUID:ten?NV_ENC_HEVC_PROFILE_MAIN10_GUID:NV_ENC_HEVC_PROFILE_MAIN_GUID;+ config.gopLength=std::max(1u,uint32_t(std::llround(info.fps*10)));+ config.frameIntervalP=std::min(3,cap(NV_ENC_CAPS_NUM_MAX_BFRAMES))+1;+ auto& rc=config.rcParams;rc.version=NV_ENC_RC_PARAMS_VER;rc.rateControlMode=NV_ENC_PARAMS_RC_VBR;+ rc.averageBitRate=0;rc.maxBitRate=0;rc.multiPass=NV_ENC_MULTI_PASS_DISABLED;+ const int quality=settings.quality=="Best"?2:settings.quality=="Good"?1:0;+ const int targets[3][3]={{26,22,18},{28,24,20},{34,29,24}};+ rc.targetQuality=uint8_t(settings.quality=="Max"?1:targets[h264?0:av1?2:1][quality]);rc.targetQualityLSB=0;+ if(allIntra){+ config.gopLength=1;config.frameIntervalP=1;+ rc.rateControlMode=NV_ENC_PARAMS_RC_CONSTQP;rc.constQP={1,1,1};rc.targetQuality=0;+ }+ // NVIDIA documents all AQ modes, lookahead and multipass as CUDA+ // preprocessing. Use high-quality core NVENC tools and unrestricted+ // quality-based VBR while keeping this route entirely DirectX.+ rc.enableAQ=0;rc.aqStrength=0;rc.enableTemporalAQ=0;+ rc.enableLookahead=0;rc.lookaheadDepth=0;+ const auto primaries=av.av_color_primaries_from_name(info.primaries.toUtf8().constData());+ const auto transfer=av.av_color_transfer_from_name(info.transfer.toUtf8().constData());+ NV_ENC_CONFIG_H264_VUI_PARAMETERS vui{};vui.videoSignalTypePresentFlag=1;vui.videoFormat=NV_ENC_VUI_VIDEO_FORMAT(5);vui.colourDescriptionPresentFlag=1;+ vui.colourPrimaries=NV_ENC_VUI_COLOR_PRIMARIES(primaries<0?(info.hdr?9:1):primaries);+ vui.transferCharacteristics=NV_ENC_VUI_TRANSFER_CHARACTERISTIC(transfer<0?(info.hdr?16:1):transfer);+ vui.colourMatrix=NV_ENC_VUI_MATRIX_COEFFS(info.hdr?9:1);vui.chromaSampleLocationFlag=1;vui.chromaSampleLocationTop=0;vui.chromaSampleLocationBot=0;+ const auto depth=ten?NV_ENC_BIT_DEPTH_10:NV_ENC_BIT_DEPTH_8;+ if(h264){auto& c=config.encodeCodecConfig.h264Config;c.idrPeriod=config.gopLength;c.chromaFormatIDC=1;c.h264VUIParameters=vui;c.outputBitDepth=depth;c.inputBitDepth=depth;c.repeatSPSPPS=1;}+ else if(av1){auto& c=config.encodeCodecConfig.av1Config;c.idrPeriod=config.gopLength;c.chromaFormatIDC=1;c.colorPrimaries=vui.colourPrimaries;c.transferCharacteristics=vui.transferCharacteristics;c.matrixCoefficients=vui.colourMatrix;c.colorRange=0;c.chromaSamplePosition=1;c.outputBitDepth=depth;c.inputBitDepth=depth;c.repeatSeqHdr=1;}+ else{auto& c=config.encodeCodecConfig.hevcConfig;c.idrPeriod=config.gopLength;c.chromaFormatIDC=1;c.hevcVUIParameters=vui;c.outputBitDepth=depth;c.inputBitDepth=depth;c.repeatSPSPPS=1;c.tfLevel=NV_ENC_TEMPORAL_FILTER_LEVEL_0;}+ init.version=NV_ENC_INITIALIZE_PARAMS_VER;init.encodeGUID=codec;init.presetGUID=NV_ENC_PRESET_P7_GUID;init.tuningInfo=NV_ENC_TUNING_INFO_HIGH_QUALITY;+ init.encodeWidth=uint32_t(info.width);init.encodeHeight=uint32_t(info.height);init.maxEncodeWidth=init.encodeWidth;init.maxEncodeHeight=init.encodeHeight;+ const auto aspect=info.outputSampleAspectRatio();init.darWidth=uint32_t(info.width*aspect.width());init.darHeight=uint32_t(info.height*aspect.height());+ const auto rate=av.av_d2q(info.fps,1000000);init.frameRateNum=uint32_t(rate.num);init.frameRateDen=uint32_t(rate.den);+ init.enablePTD=1;init.enableEncodeAsync=1;init.encodeConfig=&config;init.bufferFormat=pixel;+ check(nv.nvEncInitializeEncoder(encoder,&init),"Initialize DirectX 12 NVENC");initialized=true;+ capacity=size_t(rc.lookaheadDepth+config.frameIntervalP+4);+ dxCheck(device->CreateFence(0,D3D12_FENCE_FLAG_NONE,IID_PPV_ARGS(&inputFence)),"Create NVENC input fence");+ dxCheck(device->CreateFence(0,D3D12_FENCE_FLAG_NONE,IID_PPV_ARGS(&outputFence)),"Create NVENC output fence");+ av::check(av.avformat_alloc_output_context2(&format,nullptr,"mp4",path.toUtf8().constData()),"Create DirectX video muxer");format->avoid_negative_ts=AVFMT_AVOID_NEG_TS_DISABLED;+ stream=av.avformat_new_stream(format,nullptr);if(!stream)throw std::bad_alloc{};stream->time_base=clockBase;stream->avg_frame_rate=rate;+ auto* parameters=stream->codecpar;parameters->codec_type=AVMEDIA_TYPE_VIDEO;parameters->codec_id=h264?AV_CODEC_ID_H264:av1?AV_CODEC_ID_AV1:AV_CODEC_ID_HEVC;+ parameters->width=info.width;parameters->height=info.height;parameters->format=ten?AV_PIX_FMT_YUV420P10LE:AV_PIX_FMT_YUV420P;+ parameters->sample_aspect_ratio={aspect.width(),aspect.height()};parameters->color_range=AVCOL_RANGE_MPEG;+ parameters->color_space=info.hdr?AVCOL_SPC_BT2020_NCL:AVCOL_SPC_BT709;parameters->color_primaries=AVColorPrimaries(vui.colourPrimaries);parameters->color_trc=AVColorTransferCharacteristic(vui.transferCharacteristics);+ parameters->chroma_location=AVCHROMA_LOC_LEFT;parameters->video_delay=config.frameIntervalP>1?2:0;+ std::array<uint8_t,65536> sequence{};uint32_t bytes=0;NV_ENC_SEQUENCE_PARAM_PAYLOAD payload{};payload.version=NV_ENC_SEQUENCE_PARAM_PAYLOAD_VER;+ payload.spsppsBuffer=sequence.data();payload.inBufferSize=uint32_t(sequence.size());payload.outSPSPPSPayloadSize=&bytes;+ check(nv.nvEncGetSequenceParams(encoder,&payload),"Read DirectX NVENC sequence header");+ if(!bytes||bytes>sequence.size())throw D3dVideoUnavailable("NVIDIA returned an invalid sequence header");+ parameters->extradata=static_cast<uint8_t*>(av.av_malloc(bytes+AV_INPUT_BUFFER_PADDING_SIZE));if(!parameters->extradata)throw std::bad_alloc{};+ std::memcpy(parameters->extradata,sequence.data(),bytes);std::memset(parameters->extradata+bytes,0,AV_INPUT_BUFFER_PADDING_SIZE);parameters->extradata_size=int(bytes);+ retainStaticHdrMetadata(parameters,info);+ prepareHdr(parameters,av1);+ av::check(av.avio_open(&format->pb,path.toUtf8().constData(),AVIO_FLAG_WRITE),"Open DirectX video destination");+ av.av_dict_set(&options,"video_track_timescale","60000000",0);av::check(av.avformat_write_header(format,&options),"Write DirectX video header");av.av_dict_free(&options);+ packet=av.av_packet_alloc();if(!packet)throw std::bad_alloc{};+ }catch(...){av.av_dict_free(&options);release();throw;}+ }+ void prepareHdr(const AVCodecParameters* parameters,bool av1){+ const auto value=[](AVRational input,uint64_t scale,uint64_t limit){+ if(input.den<=0||input.num<0)throw std::runtime_error("Invalid static HDR rational");+ return uint32_t(std::min(limit,uint64_t(std::llround(double(input.num)*double(scale)/input.den))));+ };+ const auto append=[](std::vector<uint8_t>& bytes,uint32_t number,int count){for(int shift=(count-1)*8;shift>=0;shift-=8)bytes.push_back(uint8_t(number>>shift));};+ for(int i=0;i<parameters->nb_coded_side_data;++i){const auto& side=parameters->coded_side_data[i];+ if(side.type==AV_PKT_DATA_MASTERING_DISPLAY_METADATA){+ if(side.size<sizeof(AVMasteringDisplayMetadata))throw std::runtime_error("Truncated HDR mastering metadata");+ const auto& md=*reinterpret_cast<const AVMasteringDisplayMetadata*>(side.data);+ if(!md.has_primaries||!md.has_luminance)continue;auto& bytes=hdrBytes[0];bytes.clear();+ const auto scale=av1?65536u:50000u;const std::array<int,3> order=av1?std::array{0,1,2}:std::array{1,2,0};+ for(int color:order)for(int axis=0;axis<2;++axis)append(bytes,value(md.display_primaries[color][axis],scale,65535),2);+ for(int axis=0;axis<2;++axis)append(bytes,value(md.white_point[axis],scale,65535),2);+ append(bytes,value(md.max_luminance,av1?256:10000,UINT32_MAX),4);append(bytes,value(md.min_luminance,av1?16384:10000,UINT32_MAX),4);+ hdrPayloads.push_back({uint32_t(bytes.size()),av1?2u:137u,bytes.data()});+ }else if(side.type==AV_PKT_DATA_CONTENT_LIGHT_LEVEL){+ if(side.size<sizeof(AVContentLightMetadata))throw std::runtime_error("Truncated HDR light-level metadata");+ const auto& light=*reinterpret_cast<const AVContentLightMetadata*>(side.data);auto& bytes=hdrBytes[1];bytes.clear();+ append(bytes,std::min(light.MaxCLL,65535u),2);append(bytes,std::min(light.MaxFALL,65535u),2);+ hdrPayloads.push_back({uint32_t(bytes.size()),av1?1u:144u,bytes.data()});+ }+ }+ }+ void destroySlot(Slot& slot){+ if(slot.locked)nv.nvEncUnlockBitstream(encoder,&slot.out);+ if(slot.mappedInput)nv.nvEncUnmapInputResource(encoder,slot.mappedInput);+ if(slot.mappedOutput)nv.nvEncUnmapInputResource(encoder,slot.mappedOutput);+ if(slot.inputRegistration)nv.nvEncUnregisterResource(encoder,slot.inputRegistration);+ if(slot.outputRegistration)nv.nvEncUnregisterResource(encoder,slot.outputRegistration);+ if(slot.eventRegistered){NV_ENC_EVENT_PARAMS event{};event.version=NV_ENC_EVENT_PARAMS_VER;event.completionEvent=slot.event.handle;nv.nvEncUnregisterAsyncEvent(encoder,&event);}+ }+ void release(){+ // Destroying the session synchronizes accepted work. Keep its resources+ // alive until destruction completes, including exceptional/cancel paths.+ if(encoder){+ if(initialized&&!eos){NV_ENC_PIC_PARAMS end{};end.version=NV_ENC_PIC_PARAMS_VER;end.encodePicFlags=NV_ENC_PIC_FLAG_EOS;nv.nvEncEncodePicture(encoder,&end);eos=true;}+ for(auto& slot:pool_)destroySlot(*slot);+ nv.nvEncDestroyEncoder(encoder);encoder=nullptr;+ }+ pool_.clear();av.av_packet_free(&packet);+ if(format){if(format->pb)av.avio_closep(&format->pb);av.avformat_free_context(format);format=nullptr;}+ if(library){FreeLibrary(library);library=nullptr;}+ }+ void quiesce() noexcept {+ if(!encoder||pending.empty()||quarantined)return;+ if(!eos){NV_ENC_PIC_PARAMS end{};end.version=NV_ENC_PIC_PARAMS_VER;end.encodePicFlags=NV_ENC_PIC_FLAG_EOS;+ if(nv.nvEncEncodePicture(encoder,&end)!=NV_ENC_SUCCESS){quarantined=true;return;}eos=true;}+ const auto deadline=std::chrono::steady_clock::now()+std::chrono::seconds(30);+ for(auto* slot:pending)while(!slot->completed){const auto status=WaitForSingleObject(slot->event.handle,50);+ if(status==WAIT_OBJECT_0){slot->completed=true;break;}+ if(status!=WAIT_TIMEOUT||FAILED(device->GetDeviceRemovedReason())||std::chrono::steady_clock::now()>deadline){quarantined=true;return;}}+ }+ ~Impl(){release();}+ Slot& allocate(){+ if(free.empty()&&pool_.size()>=capacity)receive();+ if(!free.empty()){auto* result=free.front();free.pop_front();return *result;}+ if(pool_.size()>=capacity)throw std::runtime_error("DirectX encoder exceeded its bounded frame pool");+ auto owned=std::make_unique<Slot>();auto& slot=*owned;pool_.push_back(std::move(owned));+ D3D12_HEAP_PROPERTIES heap{};heap.Type=D3D12_HEAP_TYPE_DEFAULT;+ D3D12_RESOURCE_DESC description{};description.Dimension=D3D12_RESOURCE_DIMENSION_TEXTURE2D;description.Width=uint64_t(info.width);description.Height=uint32_t(info.height);+ description.DepthOrArraySize=1;description.MipLevels=1;description.Format=ten?DXGI_FORMAT_P010:DXGI_FORMAT_NV12;description.SampleDesc.Count=1;+ dxCheck(device->CreateCommittedResource(&heap,D3D12_HEAP_FLAG_NONE,&description,D3D12_RESOURCE_STATE_COMMON,nullptr,IID_PPV_ARGS(&slot.input)),"Allocate DirectX NVENC input");+ const uint64_t outputBytes=std::max(uint64_t(1<<20),uint64_t(info.width)*uint64_t(info.height)*(ten?6:3));+ description={};description.Dimension=D3D12_RESOURCE_DIMENSION_BUFFER;description.Width=(outputBytes+255)&~uint64_t(255);description.Height=1;description.DepthOrArraySize=1;description.MipLevels=1;description.SampleDesc.Count=1;description.Layout=D3D12_TEXTURE_LAYOUT_ROW_MAJOR;+ heap.Type=D3D12_HEAP_TYPE_READBACK;dxCheck(device->CreateCommittedResource(&heap,D3D12_HEAP_FLAG_NONE,&description,D3D12_RESOURCE_STATE_COPY_DEST,nullptr,IID_PPV_ARGS(&slot.output)),"Allocate NVENC compressed output");+ const auto registration=[&](ID3D12Resource* resource,NV_ENC_BUFFER_USAGE usage,NV_ENC_BUFFER_FORMAT pixel,uint32_t width,uint32_t height,NV_ENC_REGISTERED_PTR& target){+ NV_ENC_REGISTER_RESOURCE request{};request.version=NV_ENC_REGISTER_RESOURCE_VER;request.resourceType=NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX;request.resourceToRegister=resource;request.width=width;request.height=height;request.bufferUsage=usage;request.bufferFormat=pixel;+ check(nv.nvEncRegisterResource(encoder,&request),"Register DirectX NVENC resource");target=request.registeredResource;+ };+ registration(slot.input.Get(),NV_ENC_INPUT_IMAGE,ten?NV_ENC_BUFFER_FORMAT_YUV420_10BIT:NV_ENC_BUFFER_FORMAT_NV12,uint32_t(info.width),uint32_t(info.height),slot.inputRegistration);+ registration(slot.output.Get(),NV_ENC_OUTPUT_BITSTREAM,NV_ENC_BUFFER_FORMAT_U8,uint32_t(description.Width),1,slot.outputRegistration);+ NV_ENC_EVENT_PARAMS event{};event.version=NV_ENC_EVENT_PARAMS_VER;event.completionEvent=slot.event.handle;check(nv.nvEncRegisterAsyncEvent(encoder,&event),"Register NVENC completion event");slot.eventRegistered=true;+ return slot;+ }+ NV_ENC_INPUT_PTR map(NV_ENC_REGISTERED_PTR resource){NV_ENC_MAP_INPUT_RESOURCE request{};request.version=NV_ENC_MAP_INPUT_RESOURCE_VER;request.registeredResource=resource;check(nv.nvEncMapInputResource(encoder,&request),"Map DirectX NVENC resource");return request.mappedResource;}+ void receive(){+ if(pending.empty())throw std::logic_error("DirectX NVENC output has no pending input");auto& slot=*pending.front();+ const auto deadline=std::chrono::steady_clock::now()+std::chrono::seconds(60);+ while(!slot.completed){control.checkpoint();const auto status=WaitForSingleObject(slot.event.handle,50);if(status==WAIT_OBJECT_0)break;+ if(status!=WAIT_TIMEOUT||FAILED(device->GetDeviceRemovedReason())||std::chrono::steady_clock::now()>deadline){quarantined=true;throw std::runtime_error("DirectX NVENC did not complete its submitted frame");}}+ slot.completed=true;+ NV_ENC_LOCK_BITSTREAM lock{};lock.version=NV_ENC_LOCK_BITSTREAM_VER;lock.outputBitstream=&slot.out;lock.doNotWait=1;+ check(nv.nvEncLockBitstream(encoder,&lock),"Read DirectX NVENC compressed output");slot.locked=true;+ if(lock.bitstreamSizeInBytes>uint32_t(std::numeric_limits<int>::max()))throw std::runtime_error("NVENC bitstream packet is too large");+ av::check(av.av_new_packet(packet,int(lock.bitstreamSizeInBytes)),"Allocate DirectX video packet");std::memcpy(packet->data,lock.bitstreamBufferPtr,lock.bitstreamSizeInBytes);+ packet->pts=qint64(lock.outputTimeStamp);+ const auto found=durations.find(packet->pts);if(found==durations.end())throw std::runtime_error("NVENC output timestamp does not match a submitted frame");packet->duration=found->second;durations.erase(found);+ // B frames are emitted in decoding order. Match the two-frame reorder+ // delay advertised by H.264/HEVC/AV1 with B frames, without shifting PTS.+ const qint64 delay=config.frameIntervalP>1?2:0;+ packet->dts=av.av_rescale_q(qint64(received)-delay,{int(init.frameRateDen),int(init.frameRateNum)},clockBase);+ packet->flags=(lock.pictureType==NV_ENC_PIC_TYPE_IDR||lock.pictureType==NV_ENC_PIC_TYPE_I)?AV_PKT_FLAG_KEY:0;+ check(nv.nvEncUnlockBitstream(encoder,&slot.out),"Unlock DirectX video packet");slot.locked=false;+ check(nv.nvEncUnmapInputResource(encoder,slot.mappedInput),"Release DirectX NVENC input mapping");slot.mappedInput=nullptr;+ check(nv.nvEncUnmapInputResource(encoder,slot.mappedOutput),"Release DirectX NVENC output mapping");slot.mappedOutput=nullptr;+ av.av_packet_rescale_ts(packet,clockBase,stream->time_base);packet->stream_index=stream->index;+ av::check(av.av_interleaved_write_frame(format,packet),"Mux DirectX NVENC packet");av.av_packet_unref(packet);+ pending.pop_front();free.push_back(&slot);++received;+ }+};+D3dNvEncoder::D3dNvEncoder(const QString& path,const QString& codec,const Settings& settings,const MediaInfo& output,void* device,void* queue,JobControl& control,bool allIntra)+ :impl_(std::make_unique<Impl>(path,codec,settings,output,device,queue,control,allIntra)){}+D3dNvEncoder::~D3dNvEncoder(){if(impl_)impl_->quiesce();if(impl_&&impl_->quarantined){+ // A failed fence cannot establish resource safety. Worker termination reclaims+ // the driver session; do not release resources still referenced by GPU work.+ (void)impl_.release();+}}+bool D3dNvEncoder::tenBit()const{return impl_->ten;}+QString D3dNvEncoder::diagnostics()const{return QString("NVENC DirectX 12; P7 HQ; %1-bit; %2 B frames; lookahead %3; GPU frame pool %4/%5").arg(impl_->ten?10:8).arg(impl_->config.frameIntervalP-1).arg(impl_->config.rcParams.lookaheadDepth).arg(impl_->pool_.size()).arg(impl_->capacity);}+void D3dNvEncoder::write(const FsrSurface& surface,qint64 pts,qint64 duration,TimeBase timeBase,bool forceIntra){+ auto& s=*impl_;s.control.checkpoint();if(s.eos)throw std::logic_error("Cannot write after DirectX NVENC drain");auto& slot=s.allocate();+ VeFsrVideoOutput output{};output.size=sizeof(output);output.abi=VE_FSR_ABI_VERSION;output.width=uint32_t(s.info.width);output.height=uint32_t(s.info.height);+ output.texture=slot.input.Get();output.resource_state=D3D12_RESOURCE_STATE_COMMON;output.pixel_format=s.ten?VE_FSR_P010:VE_FSR_NV12;+ output.transfer=fsrTransfer(s.info.transfer);output.primaries=fsrPrimaries(s.info.primaries);output.color_matrix=s.info.hdr?2u:1u;output.color_range=0;output.chroma_location=1;+ surface.writeVideo(output);const auto value=++s.fenceValue;dxCheck(s.queue->Signal(s.inputFence.Get(),value),"Signal DirectX encoder input readiness");+ slot.mappedInput=s.map(slot.inputRegistration);slot.mappedOutput=s.map(slot.outputRegistration);+ slot.in={};slot.in.version=NV_ENC_INPUT_RESOURCE_D3D12_VER;slot.in.pInputBuffer=slot.mappedInput;slot.in.inputFencePoint.version=NV_ENC_FENCE_POINT_D3D12_VER;+ slot.in.inputFencePoint.pFence=s.inputFence.Get();slot.in.inputFencePoint.waitValue=value;slot.in.inputFencePoint.bWait=1;+ slot.out={};slot.out.version=NV_ENC_OUTPUT_RESOURCE_D3D12_VER;slot.out.pOutputBuffer=slot.mappedOutput;slot.out.outputFencePoint.version=NV_ENC_FENCE_POINT_D3D12_VER;+ slot.out.outputFencePoint.pFence=s.outputFence.Get();slot.out.outputFencePoint.signalValue=value;slot.out.outputFencePoint.bSignal=1;+ NV_ENC_PIC_PARAMS picture{};picture.version=NV_ENC_PIC_PARAMS_VER;picture.inputWidth=uint32_t(s.info.width);picture.inputHeight=uint32_t(s.info.height);picture.frameIdx=uint32_t(s.sent);+ picture.inputBuffer=&slot.in;picture.outputBitstream=&slot.out;picture.bufferFmt=s.ten?NV_ENC_BUFFER_FORMAT_YUV420_10BIT:NV_ENC_BUFFER_FORMAT_NV12;picture.pictureStruct=NV_ENC_PIC_STRUCT_FRAME;picture.completionEvent=slot.event.handle;+ picture.inputTimeStamp=uint64_t(s.av.av_rescale_q(pts,{timeBase.numerator,timeBase.denominator},clockBase));picture.inputDuration=uint64_t(s.av.av_rescale_q(duration,{timeBase.numerator,timeBase.denominator},clockBase));+ if(!picture.inputDuration)throw std::runtime_error("DirectX encoder frame duration must be positive");+ if(forceIntra)picture.encodePicFlags=NV_ENC_PIC_FLAG_FORCEIDR;+ if(!s.hdrPayloads.empty()&&(s.sent%s.config.gopLength==0||forceIntra)){+ if(s.codec==NV_ENC_CODEC_AV1_GUID){picture.codecPicParams.av1PicParams.obuPayloadArray=s.hdrPayloads.data();picture.codecPicParams.av1PicParams.obuPayloadArrayCnt=uint32_t(s.hdrPayloads.size());}+ else if(s.codec==NV_ENC_CODEC_HEVC_GUID){picture.codecPicParams.hevcPicParams.seiPayloadArray=s.hdrPayloads.data();picture.codecPicParams.hevcPicParams.seiPayloadArrayCnt=uint32_t(s.hdrPayloads.size());}+ }+ if(!s.durations.emplace(qint64(picture.inputTimeStamp),qint64(picture.inputDuration)).second)throw std::runtime_error("DirectX encoder timestamps must be unique");+ slot.completed=false;s.pending.push_back(&slot);+ const auto status=s.nv.nvEncEncodePicture(s.encoder,&picture);if(status!=NV_ENC_SUCCESS&&status!=NV_ENC_ERR_NEED_MORE_INPUT){s.quarantined=true;const auto operation=std::string("Submit DirectX NVENC frame ")+std::to_string(s.sent)+" (HDR messages "+std::to_string(s.hdrPayloads.size())+")";s.check(status,operation.c_str());}+ ++s.sent;+ // With B frames one successful submission can make several earlier output+ // buffers available. Drain every completed buffer, in encoding order.+ while(!s.pending.empty()){+ auto* front=s.pending.front();const auto ready=WaitForSingleObject(front->event.handle,0);+ if(ready==WAIT_TIMEOUT)break;if(ready!=WAIT_OBJECT_0)throw std::runtime_error("Cannot inspect DirectX encoder completion");front->completed=true;s.receive();+ }+}+void D3dNvEncoder::finish(){auto& s=*impl_;if(s.finished)return;s.control.checkpoint();NV_ENC_PIC_PARAMS end{};end.version=NV_ENC_PIC_PARAMS_VER;end.encodePicFlags=NV_ENC_PIC_FLAG_EOS;+ s.check(s.nv.nvEncEncodePicture(s.encoder,&end),"Drain DirectX NVENC");s.eos=true;while(!s.pending.empty())s.receive();+ if(s.sent!=s.received||!s.durations.empty())throw std::runtime_error("DirectX encoder lost submitted frames");av::check(s.av.av_write_trailer(s.format),"Finish DirectX video");s.finished=true;+}+}diff --git a/src/media/d3d_nvenc.hpp b/src/media/d3d_nvenc.hppnew file mode 100644index 0000000..39ea77c--- /dev/null+++ b/src/media/d3d_nvenc.hpp@@ -0,0 +1,22 @@+#pragma once+#include "media.hpp"+#include "packet_stream.hpp"+#include <memory>++namespace ve {+struct Settings;+class FsrSurface;+// Uses the driver's DirectX interface. Does not load or initialize CUDA.+class D3dNvEncoder {+ public:+ D3dNvEncoder(const QString& path,const QString& codec,const Settings& settings,+ const MediaInfo& output,void* device,void* queue,JobControl& control,bool allIntra=false);+ ~D3dNvEncoder();+ void write(const FsrSurface& surface,qint64 pts,qint64 duration,TimeBase timeBase,bool forceIntra=false);+ void finish();+ [[nodiscard]] bool tenBit() const;+ [[nodiscard]] QString diagnostics() const;+ private:+ struct Impl;std::unique_ptr<Impl> impl_;+};+}diff --git a/src/media/d3d_video.cpp b/src/media/d3d_video.cppnew file mode 100644index 0000000..9a8b6ab--- /dev/null+++ b/src/media/d3d_video.cpp@@ -0,0 +1,72 @@+#include "d3d_video.hpp"+#include "av_api.hpp"+#include "fsr_frame_generation/fsr_bridge.h"+extern "C" {+#include <libavutil/hwcontext_d3d12va.h>+}+#include <algorithm>+#include <cmath>++namespace ve {+namespace {+AVPixelFormat selectD3d12(AVCodecContext*,const AVPixelFormat* formats){for(auto* format=formats;*format!=AV_PIX_FMT_NONE;++format)if(*format==AV_PIX_FMT_D3D12)return *format;return AV_PIX_FMT_NONE;}+}+struct D3dVideoDecoder::Impl {+ av::Api& api=av::Api::get();JobControl& control;AVFormatContext* format=nullptr;AVCodecContext* codec=nullptr;+ AVBufferRef* hardware=nullptr;AVPacket* packet=nullptr;int stream=-1;bool draining=false;+ double start=0,timestampOffset=0;qint64 origin=AV_NOPTS_VALUE;+ Impl(const QString& path,void* device,double seconds,JobControl& job):control(job),start(seconds){+ try{+ // The public D3D12 frame descriptor gained an array-slice member in+ // FFmpeg 8.1. Require the packaged ABI rather than reading old data+ // at the new synchronization offsets.+ if(api.avutil_version()<AV_VERSION_INT(60,26,100))throw D3dVideoUnavailable("DirectX 12 video decoding requires the updated FFmpeg 8.1 media runtime");+ if(!device)throw D3dVideoUnavailable("A DirectX 12 decoding device is required");format=api.avformat_alloc_context();if(!format)throw std::bad_alloc{};+ format->interrupt_callback={[](void* context){return static_cast<JobControl*>(context)->cancelled()?1:0;},&control};+ av::check(api.avformat_open_input(&format,path.toUtf8().constData(),nullptr,nullptr),"Open DirectX video source");+ av::check(api.avformat_find_stream_info(format,nullptr),"Probe DirectX video source");stream=api.av_find_best_stream(format,AVMEDIA_TYPE_VIDEO,-1,-1,nullptr,0);av::check(stream,"Find DirectX video stream");+ const auto* decoder=api.avcodec_find_decoder(format->streams[stream]->codecpar->codec_id);bool compatible=false;+ for(int i=0;decoder;++i){const auto* config=api.avcodec_get_hw_config(decoder,i);if(!config)break;if(config->device_type==AV_HWDEVICE_TYPE_D3D12VA&&config->pix_fmt==AV_PIX_FMT_D3D12)compatible=true;}+ if(!compatible)throw D3dVideoUnavailable("The source codec has no DirectX 12 hardware decoder");+ hardware=api.av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_D3D12VA);if(!hardware)throw std::bad_alloc{};+ auto* context=reinterpret_cast<AVHWDeviceContext*>(hardware->data);auto* dx=reinterpret_cast<AVD3D12VADeviceContext*>(context->hwctx);+ dx->device=static_cast<ID3D12Device*>(device);dx->device->AddRef();av::check(api.av_hwdevice_ctx_init(hardware),"Initialize DirectX video decoding device");+ codec=api.avcodec_alloc_context3(decoder);if(!codec)throw std::bad_alloc{};av::check(api.avcodec_parameters_to_context(codec,format->streams[stream]->codecpar),"Describe DirectX video decoder");+ codec->pkt_timebase=format->streams[stream]->time_base;codec->hw_device_ctx=api.av_buffer_ref(hardware);if(!codec->hw_device_ctx)throw std::bad_alloc{};+ codec->get_format=selectD3d12;codec->thread_count=1;av::check(api.avcodec_open2(codec,decoder,nullptr),"Open DirectX 12 hardware decoder");+ packet=api.av_packet_alloc();if(!packet)throw std::bad_alloc{};const auto* track=format->streams[stream];+ if(track->start_time!=AV_NOPTS_VALUE)timestampOffset=track->start_time*av_q2d(track->time_base);else if(format->start_time!=AV_NOPTS_VALUE)timestampOffset=double(format->start_time)/AV_TIME_BASE;+ if(start>0)av::check(api.avformat_seek_file(format,-1,INT64_MIN,qint64((timestampOffset+std::max(0.,start-.002))*AV_TIME_BASE),INT64_MAX,0),"Seek DirectX video source");+ }catch(const Cancelled&){release();throw;}catch(const std::exception& error){release();throw D3dVideoUnavailable(error.what());}+ }+ void release(){api.av_packet_free(&packet);api.avcodec_free_context(&codec);api.av_buffer_unref(&hardware);if(format)api.avformat_close_input(&format);}+ ~Impl(){release();}+ TimeBase base()const{const auto value=format->streams[stream]->time_base;return{value.num,value.den};}+};+D3dVideoDecoder::D3dVideoDecoder(const QString& path,void* device,double start,JobControl& control):impl_(std::make_unique<Impl>(path,device,start,control)){}+D3dVideoDecoder::~D3dVideoDecoder()=default;+double D3dVideoDecoder::timeOrigin()const{if(impl_->origin==AV_NOPTS_VALUE)throw std::logic_error("Read a DirectX frame before querying its time origin");const auto base=impl_->base();return impl_->origin*double(base.numerator)/base.denominator;}+std::optional<D3dVideoFrame> D3dVideoDecoder::read(){+ auto& s=*impl_;for(;;){s.control.checkpoint();auto frame=av::frame();const int status=s.api.avcodec_receive_frame(s.codec,frame.get());+ if(status>=0){+ if(frame->format!=AV_PIX_FMT_D3D12||!frame->data[0]||!frame->hw_frames_ctx)throw D3dVideoUnavailable("DirectX decoder did not return GPU video surfaces");+ const auto* pool=reinterpret_cast<const AVHWFramesContext*>(frame->hw_frames_ctx->data);+ if(pool->sw_format!=AV_PIX_FMT_NV12&&pool->sw_format!=AV_PIX_FMT_P010LE)throw D3dVideoUnavailable("DirectX FSR input requires NV12 or P010 video surfaces");+ auto* dx=reinterpret_cast<AVD3D12VAFrame*>(frame->data[0]);if(!dx->texture||!dx->sync_ctx.fence)throw std::runtime_error("DirectX decoder returned incomplete surface synchronization");+ if(dx->subresource_index!=0||(dx->flags&AV_D3D12VA_FRAME_FLAG_TEXTURE_ARRAY))throw D3dVideoUnavailable("DirectX decoder texture arrays require an explicit video slice copy");+ const auto pts=frame->best_effort_timestamp!=AV_NOPTS_VALUE?frame->best_effort_timestamp:frame->pts;if(pts==AV_NOPTS_VALUE)throw std::runtime_error("Decoded DirectX frame has no presentation timestamp");+ const auto base=s.base();if(pts*double(base.numerator)/base.denominator+.002<s.start+s.timestampOffset)continue;if(s.origin==AV_NOPTS_VALUE)s.origin=pts;+ D3dVideoFrame result;result.size={frame->width,frame->height};result.pixelFormat=pool->sw_format==AV_PIX_FMT_P010LE?VE_FSR_P010:VE_FSR_NV12;+ result.texture=dx->texture;result.readyFence=dx->sync_ctx.fence;result.readyValue=dx->sync_ctx.fence_value;result.pts=pts-s.origin;result.duration=frame->duration;result.timeBase=base;+ result.colorMatrix=frame->colorspace==AVCOL_SPC_BT2020_NCL?2u:frame->colorspace==AVCOL_SPC_FCC?3u:frame->colorspace==AVCOL_SPC_SMPTE240M?4u:+ frame->colorspace==AVCOL_SPC_SMPTE170M||frame->colorspace==AVCOL_SPC_BT470BG?0u:1u;+ result.colorRange=frame->color_range==AVCOL_RANGE_JPEG?1u:0u;result.chromaLocation=frame->chroma_location==AVCHROMA_LOC_UNSPECIFIED?1u:uint32_t(frame->chroma_location);+ result.owner=std::shared_ptr<void>(frame.release(),[](void* pointer){auto* owned=static_cast<AVFrame*>(pointer);av::Api::get().av_frame_free(&owned);});return result;+ }+ if(status==AVERROR_EOF)return{};if(status!=AVERROR(EAGAIN))av::check(status,"Receive DirectX decoded frame");if(s.draining)throw std::runtime_error("DirectX video decoder did not finish draining");+ for(;;){s.api.av_packet_unref(s.packet);const int read=s.api.av_read_frame(s.format,s.packet);+ if(read==AVERROR_EOF){av::check(s.api.avcodec_send_packet(s.codec,nullptr),"Drain DirectX decoder");s.draining=true;break;}+ av::check(read,"Read DirectX video packet");if(s.packet->stream_index==s.stream){av::check(s.api.avcodec_send_packet(s.codec,s.packet),"Submit DirectX video packet");break;}}+ }+}+}diff --git a/src/media/d3d_video.hpp b/src/media/d3d_video.hppnew file mode 100644index 0000000..2806de5--- /dev/null+++ b/src/media/d3d_video.hpp@@ -0,0 +1,37 @@+#pragma once+#include "media.hpp"+#include "packet_stream.hpp"+#include <memory>+#include <optional>++namespace ve {+struct D3dVideoFrame {+ std::shared_ptr<void> owner;+ QSize size;+ void* texture=nullptr;void* readyFence=nullptr;quint64 readyValue=0;+ uint32_t pixelFormat=0,colorMatrix=1,colorRange=0,chromaLocation=1;+ qint64 pts=0,duration=0;TimeBase timeBase;+};+struct D3dVideoUnavailable:std::runtime_error{using std::runtime_error::runtime_error;};+class D3dVideoDecoder {+ public:+ D3dVideoDecoder(const QString& path,void* device,double startSeconds,JobControl& control);+ ~D3dVideoDecoder();+ [[nodiscard]] std::optional<D3dVideoFrame> read();+ [[nodiscard]] double timeOrigin() const;+ private:+ struct Impl;std::unique_ptr<Impl> impl_;+};+// Some drivers require reference-only D3D12 decode allocations which older+// FFmpeg builds cannot recycle correctly. This fallback shares native D3D11+// decode textures and copies their selected planes on the GPU into D3D12.+class D3d11VideoDecoder {+ public:+ D3d11VideoDecoder(const QString& path,void* device,void* queue,double startSeconds,JobControl& control);+ ~D3d11VideoDecoder();+ [[nodiscard]] std::optional<D3dVideoFrame> read();+ [[nodiscard]] double timeOrigin() const;+ private:+ struct Impl;std::unique_ptr<Impl> impl_;+};+}diff --git a/src/media/frame_generation_rate.hpp b/src/media/frame_generation_rate.hppnew file mode 100644index 0000000..03435d3--- /dev/null+++ b/src/media/frame_generation_rate.hpp@@ -0,0 +1,8 @@+#pragma once+#include "configuration/settings.hpp"+#include "packet_stream.hpp"++namespace ve {+[[nodiscard]] TimeBase frameGenerationTimeBase(double sourceFps, const Settings& settings, bool fsr = false);+[[nodiscard]] double frameGenerationFrameRate(double sourceFps, const Settings& settings, bool fsr = false);+} // namespace vediff --git a/src/media/frame_time.hpp b/src/media/frame_time.hppindex 341caea..7c16b23 100644--- a/src/media/frame_time.hpp+++ b/src/media/frame_time.hpp@@ -17,6 +17,13 @@ class FrameTime {numerator_ = numerator / common; denominator_ = denominator / common;}[[nodiscard]] double seconds() const { return double(numerator_) / double(denominator_); }+ [[nodiscard]] FrameTime roundedTo(const FrameTime& interval) const {+ return interval.fraction(ticks(interval.numerator_,interval.denominator_),1);+ }+ [[nodiscard]] std::int64_t ceilTicks(std::int64_t clockNumerator,std::int64_t clockDenominator) const {+ const auto value=fraction(clockDenominator,clockNumerator);auto result=value.numerator_/value.denominator_;+ if(value.numerator_%value.denominator_&&qAddOverflow(result,std::int64_t(1),&result))fail();return result;+ }[[nodiscard]] std::int64_t ticks(std::int64_t clockNumerator,std::int64_t clockDenominator) const {const auto value=fraction(clockDenominator,clockNumerator);const auto whole=value.numerator_/value.denominator_,remainder=value.numerator_%value.denominator_;@@ -67,16 +74,21 @@ class FrameTime {template<class Frame, class Emit> class NearestFrameWriter {public:- NearestFrameWriter(std::int64_t count, FrameTime interval, Emit write)- : count_(count), interval_(interval), emit_(std::move(write)) {}+ NearestFrameWriter(std::int64_t count, FrameTime interval, Emit write,FrameTime offset={})+ : count_(count), interval_(interval), offset_(offset), emit_(std::move(write)) {}void push(Frame frame) {if (previous_) {- const auto midpoint = (previous_->time + frame.time).fraction(1, 2);+ bool discontinuity=false;+ if constexpr(requires {frame.segment;})discontinuity=previous_->segment!=frame.segment;+ // A cut belongs at its source presentation time. Nearest-neighbour+ // selection across segments would otherwise move it half a source+ // interval early, despite correctly suppressing synthesized pixels.+ const auto midpoint = discontinuity?frame.time:(previous_->time + frame.time).fraction(1, 2);while (index_ < count_) {- const auto target = interval_.fraction(index_, 1);+ const auto target = offset_+interval_.fraction(index_, 1);if (target > midpoint) break;- emit_(target == midpoint && tieLate_ ? frame : *previous_, index_++);- if (target == midpoint) tieLate_ = !tieLate_;+ emit_(target == midpoint && (discontinuity||tieLate_) ? frame : *previous_, index_++);+ if (target == midpoint&&!discontinuity) tieLate_ = !tieLate_;}}previous_ = std::move(frame);@@ -93,6 +105,7 @@ template<class Frame, class Emit> class NearestFrameWriter {private:std::int64_t count_, index_ = 0;FrameTime interval_;+ FrameTime offset_;Emit emit_;std::optional<Frame> previous_;bool tieLate_ = false;diff --git a/src/media/media.cpp b/src/media/media.cppindex 2aeb3bd..6363e5e 100644--- a/src/media/media.cpp+++ b/src/media/media.cpp@@ -1,4 +1,5 @@#include "media.hpp"+#include "frame_generation_rate.hpp"#include "av_api.hpp"#include "image_codecs.hpp"#include "image_metadata.hpp"@@ -19,6 +20,8 @@#include <array>#include <cmath>#include <cstring>+#include <limits>+#include <numeric>namespace ve {QSize MediaInfo::outputSampleAspectRatio() const {@@ -429,6 +432,37 @@ QStringList videoEncoderArguments(const QString& codec, const QString& quality,result << "-preset" << "6";return result;}+// One rational delivery clock for estimates, previews and every export route.+// Multipliers preserve fractional source rates instead of rounding to integer FPS.+TimeBase frameGenerationTimeBase(double sourceFps, const Settings& settings, bool fsr) {+ const auto& mode = fsr ? settings.fsr_frame_generation_frame_rate_mode : settings.frame_interpolation_frame_rate_mode;+ if (mode == "Multiplier") {+ const int multiplier = fsr ? settings.fsr_frame_generation_multiplier : settings.frame_interpolation_multiplier;+ if (!std::isfinite(sourceFps) || sourceFps <= 0 || multiplier < 2 || multiplier > 8)+ throw std::runtime_error("Frame generation requires a positive source frame rate and a multiplier from 2 to 8.");+ const auto source = av::Api::get().av_d2q(sourceFps, 1000000);+ const auto common = std::gcd(source.den, multiplier);+ const auto numerator = std::int64_t(source.num) * (multiplier / common);+ if (source.num <= 0 || source.den <= 0 || numerator > std::numeric_limits<int>::max())+ throw std::runtime_error("The multiplied frame rate exceeds the supported rational clock range.");+ return {source.den / common, int(numerator)};+ }+ if (mode != "Target FPS") throw std::runtime_error("Unknown frame-rate mode.");+ const auto& target = fsr ? settings.fsr_frame_generation_target_fps : settings.frame_interpolation_target_fps;+ if (target == "23.976") return {1001, 24000};+ if (target == "29.97") return {1001, 30000};+ if (target == "59.94") return {1001, 60000};+ if (target == "119.88") return {1001, 120000};+ bool valid = false;+ const auto integer = target.toInt(&valid);+ if (!valid || integer <= 0) throw std::runtime_error("Invalid target frame rate.");+ return {1, integer};+}+double frameGenerationFrameRate(double sourceFps, const Settings& settings, bool fsr) {+ const auto interval = frameGenerationTimeBase(sourceFps, settings, fsr);+ return double(interval.denominator) / interval.numerator;+}+double targetFrameRate(const QString& choice) {static const QMap<QString, double> fractional{{"23.976", 24000. / 1001},{"29.97", 30000. / 1001},diff --git a/src/media/temporal_cadence.hpp b/src/media/temporal_cadence.hppnew file mode 100644index 0000000..5da4bf4--- /dev/null+++ b/src/media/temporal_cadence.hpp@@ -0,0 +1,55 @@+#pragma once+#include "frame_time.hpp"+#include "packet_stream.hpp"+#include <numeric>++namespace ve {+struct TemporalClockAlignment {FrameTime phase,relativeStart;std::int64_t firstIndex=0;};+inline TemporalClockAlignment alignTemporalClock(std::int64_t originTicks,TimeBase source,TimeBase target){+ if(source.numerator<=0||source.denominator<=0||target.numerator<=0||target.denominator<=0||originTicks==INT64_MIN)throw std::invalid_argument("Invalid temporal clock alignment");+ const auto origin=FrameTime(originTicks<0?-originTicks:originTicks).fraction(source.numerator,source.denominator);+ const auto first=originTicks>=0?origin.ceilTicks(target.numerator,target.denominator):0;+ const auto aligned=FrameTime(target.numerator,target.denominator).fraction(first,1);+ return{originTicks>=0?aligned-origin:aligned+origin,aligned,first};+}+// A midpoint SDK can only synthesize a dyadic time grid. Pick the smallest+// depth that covers the requested rate and bounds selection error to 1/16 of+// an output interval. Exact dyadic rates need no unnecessary extra cascades.+// Variable-rate intervals can be up to twice nominal before a discontinuity+// reset, and can have arbitrary phase relative to the delivery clock.+inline int midpointCascadeDepth(TimeBase sourceInterval,TimeBase targetInterval,bool variableRate=false) {+ if(sourceInterval.numerator<=0||sourceInterval.denominator<=0||targetInterval.numerator<=0||targetInterval.denominator<=0)+ throw std::invalid_argument("Frame-rate conversion requires positive rational intervals");+ const FrameTime source(sourceInterval.numerator,sourceInterval.denominator),target(targetInterval.numerator,targetInterval.denominator);+ if(target>=source&&!variableRate)return 0;+ std::int64_t numerator=std::int64_t(sourceInterval.numerator)*targetInterval.denominator;+ std::int64_t denominator=std::int64_t(sourceInterval.denominator)*targetInterval.numerator;+ const auto common=std::gcd(numerator,denominator);numerator/=common;denominator/=common;+ for(int depth=0;depth<=10;++depth){+ const std::int64_t samples=std::int64_t(1)<<depth;+ if(source.fraction(1,samples)>target)continue;+ const auto phases=numerator/std::gcd(numerator,samples);+ const auto error=variableRate?source.fraction(1,samples):source.fraction(phases/2,phases).fraction(1,samples);+ if(error<=target.fraction(1,16))return depth;+ }+ throw std::runtime_error("Requested frame rate exceeds the supported temporal cascade depth");+}+// Inspect the actual output clock over an observed source interval. Header+// averages can report CFR even when presentation timestamps later vary.+inline int midpointIntervalDepth(FrameTime previous,FrameTime current,TimeBase targetInterval,FrameTime offset,int minimum){+ if(current<=previous||targetInterval.numerator<=0||targetInterval.denominator<=0||minimum<0||minimum>10)+ throw std::invalid_argument("Invalid observed interpolation interval");+ const auto duration=current-previous,target=FrameTime(targetInterval.numerator,targetInterval.denominator),tolerance=target.fraction(1,16);+ const auto first=previous>=offset?(previous-offset).ceilTicks(targetInterval.numerator,targetInterval.denominator):0;+ for(int depth=minimum;depth<=10;++depth){+ const auto grid=duration.fraction(1,std::int64_t(1)<<depth);if(grid>target)continue;bool fits=true;+ for(auto index=first;;++index){+ const auto point=offset+target.fraction(index,1);if(point>current)break;+ const auto relative=point-previous,rounded=relative.roundedTo(grid);const auto error=relative>=rounded?relative-rounded:rounded-relative;+ if(error>tolerance){fits=false;break;}+ }+ if(fits)return depth;+ }+ throw std::runtime_error("Observed frame timing exceeds the supported temporal cascade depth");+}+}diff --git a/src/media/temporal_stream.hpp b/src/media/temporal_stream.hppnew file mode 100644index 0000000..d805e77--- /dev/null+++ b/src/media/temporal_stream.hpp@@ -0,0 +1,25 @@+#pragma once+#include "frame_time.hpp"+#include <algorithm>+#include <vector>++namespace ve {+template<class Surface> struct TemporalSample {Surface pixels;FrameTime time;int segment=0;};+// Common temporal publication contract for native DLSS and FSR results.+// Each call owns just one SDK result; consumers stream it into the next level.+template<class Surface,class Result>+std::vector<TemporalSample<Surface>> publishTemporalResult(std::optional<TemporalSample<Surface>>& previous,+ Result result,FrameTime time,int segment,int generated) {+ if(previous){+ segment=std::max(segment,previous->segment);+ if(result.sceneCut||result.reset)segment=std::max(segment,previous->segment+1);+ }+ std::vector<TemporalSample<Surface>> frames;+ if(previous&&!result.reset&&!result.sceneCut){+ if(generated<0||result.generated.size()!=size_t(generated))throw std::runtime_error("Native interpolator returned an incomplete temporal grid");+ const auto interval=time-previous->time;int index=0;+ for(auto& surface:result.generated)frames.push_back({std::move(surface),previous->time+interval.fraction(++index,generated+1),segment});+ }+ previous=TemporalSample<Surface>{std::move(result.source),time,segment};frames.push_back(*previous);return frames;+}+}diff --git a/src/media/video_delivery.cpp b/src/media/video_delivery.cppindex c2bc58f..3930b1d 100644--- a/src/media/video_delivery.cpp+++ b/src/media/video_delivery.cpp@@ -1,8 +1,10 @@#include "video_delivery.hpp"#include "infrastructure/paths.hpp"#include "infrastructure/process.hpp"+#include "infrastructure/scratch.hpp"#include "media/image_metadata.hpp"#include "processing/vfx_native.hpp"+#include <QFile>namespace ve {QStringList vfxSubtitleArguments(const MediaInfo& source,const Settings& settings){@@ -68,9 +70,21 @@ void muxDelivery(const QString& video, const QString& destination, const RenderRif (!transfer.isEmpty() && transfer!="unknown") mux << "-color_trc" << transfer;}if (!request.preview && settings.container == "MP4") mux << "-movflags" << "+faststart";- if (!request.preview && settings.container != "MOV" && settings.stages(true).contains("neural_model"))- mux << "-metadata" << "comment=" + mergeRenderDescription(- source.metadata.value("source_format").toObject().value("tags").toObject().value("comment").toString(), neuralRenderNote(settings));+ std::unique_ptr<ScratchDirectory> metadataDirectory;+ if (!request.preview && settings.container != "MOV" && settings.stages(true).contains("neural_model")) {+ // Inherited comments can exceed Windows' process command-line limit.+ // FFmpeg's file-loaded option preserves the complete UTF-8 argument.+ metadataDirectory = std::make_unique<ScratchDirectory>("delivery-metadata-XXXXXX");+ if (!metadataDirectory->isValid())+ throw std::runtime_error("Cannot create the delivery metadata directory.");+ QFile metadataFile(metadataDirectory->filePath("comment.txt"));+ const auto argument = ("comment=" + mergeRenderDescription(+ source.metadata.value("source_format").toObject().value("tags").toObject().value("comment").toString(), neuralRenderNote(settings))).toUtf8();+ if (!metadataFile.open(QIODevice::WriteOnly) || metadataFile.write(argument) != argument.size() || !metadataFile.flush())+ throw std::runtime_error(("Cannot write delivery metadata: " + metadataFile.errorString()).toStdString());+ metadataFile.close();+ mux << "-/metadata" << metadataFile.fileName();+ }mux << "-fps_mode" << "passthrough" << "-avoid_negative_ts" << "disabled"<< "-metadata:s:v:0" << "rotate=0" << destination;const auto result = runProcess(Paths::instance().ffmpeg(), mux, &control, 0);diff --git a/src/processing/frame_stream.cpp b/src/processing/frame_stream.cppindex c6daa0d..f135093 100644--- a/src/processing/frame_stream.cpp+++ b/src/processing/frame_stream.cpp@@ -81,9 +81,9 @@ struct Stage {return filter->read();}const double seconds=frame->seconds();- if(name=="dlss_ray_reconstruction"&&(!std::isfinite(seconds)||+ if((name=="dlss_ray_reconstruction"||name=="reshade")&&(!std::isfinite(seconds)||(previousSeconds&&seconds<=*previousSeconds)))- throw std::runtime_error("Ray Reconstruction requires finite, increasing presentation timestamps.");+ throw std::runtime_error("Ray Reconstruction/ReShade requires finite, increasing presentation timestamps.");if (!native) {native = std::make_unique<FramePipeline>(settings, info, QStringList{name}, finalOutput,bool(normalizer));@@ -93,9 +93,10 @@ struct Stage {const double interval=previousSeconds && seconds>*previousSeconds ? seconds-*previousSeconds: frame->duration>0 ? frame->duration*double(frame->timeBase.numerator)/frame->timeBase.denominator: info.fps>0 ? 1./info.fps : 1./60;- const bool gap=name=="dlss_ray_reconstruction"&&previousSeconds&&+ const bool gap=(name=="dlss_ray_reconstruction"||name=="reshade")&&previousSeconds&&interval>std::max(.25,info.fps>0?4./info.fps:.25);- frame->image = native->process(frame->image, control, index, index == 0 || gap, float(std::clamp(interval*1000.,.01,1000.)));+ frame->image = native->process(frame->image, control, index, index == 0 || gap,+ float(std::clamp(interval*1000.,.01,1000.)), seconds);previousSeconds=seconds;++index;return frame;@@ -157,7 +158,7 @@ FrameStreamPipeline::FrameStreamPipeline(Settings settings, MediaInfo info, cons.contains(name) ||name == "dlss_super_resolution" && !final)info.pixelFormat = "gbrp10le";- else if(name=="dlss_ray_reconstruction"){+ else if(name=="dlss_ray_reconstruction"||name=="reshade"){info.pixelFormat="rgba64le";info.sourceBitDepth=16;}else if (name == "neural_model" || name == "dlss_super_resolution")info.pixelFormat =diff --git a/src/processing/fsr_native.cpp b/src/processing/fsr_native.cppnew file mode 100644index 0000000..22f8397--- /dev/null+++ b/src/processing/fsr_native.cpp@@ -0,0 +1,187 @@+#include "fsr_native.hpp"+#include "infrastructure/paths.hpp"+#include <QDir>+#include <QFileInfo>+#include <QMap>+#include <QJsonArray>+#include <array>+#include <algorithm>+#include <cmath>+#include <dxgi1_6.h>+#include <wrl/client.h>+#include <stdexcept>++namespace ve {+namespace {+template<class T> using ComPtr=Microsoft::WRL::ComPtr<T>;+QString runtimeDirectory(){const auto override=qEnvironmentVariable("VE_FSR_RUNTIME_DIRECTORY");return override.isEmpty()?Paths::instance().at("bin/runtime/fsrfg"):QFileInfo(override).absoluteFilePath();}+class Api {+ public:+ template<class T> T load(const char* name){auto* function=GetProcAddress(module_,name);if(!function)throw std::runtime_error("FSR engine is missing export "+std::string(name));return reinterpret_cast<T>(function);}+ Api(){+ const auto path=QDir::toNativeSeparators(runtimeDirectory()+"/neuroframe_engine_fsr_frame_generation.dll").toStdWString();+ module_=LoadLibraryExW(path.c_str(),nullptr,LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR|LOAD_LIBRARY_SEARCH_SYSTEM32);+ if(!module_)throw std::runtime_error("Cannot load AMD FSR Frame Generation engine: Windows error "+std::to_string(GetLastError()));+ try{+ abi=load<decltype(abi)>("fsrfg_abi_version");if(abi()!=VE_FSR_ABI_VERSION)throw std::runtime_error("The AMD FSR engine uses an incompatible ABI");+#define VE_FSR_BIND(member,symbol) member=load<decltype(member)>(symbol)+ VE_FSR_BIND(createDevice,"fsrfg_device_create");VE_FSR_BIND(releaseDevice,"fsrfg_device_release");VE_FSR_BIND(capabilities,"fsrfg_device_capabilities");+ VE_FSR_BIND(nativeDevice,"fsrfg_device_d3d12");VE_FSR_BIND(nativeQueue,"fsrfg_device_queue");VE_FSR_BIND(createSession,"fsrfg_session_create");+ VE_FSR_BIND(releaseSession,"fsrfg_session_release");VE_FSR_BIND(process,"fsrfg_process");VE_FSR_BIND(describe,"fsrfg_surface_describe");+ VE_FSR_BIND(releaseSurface,"fsrfg_surface_release");VE_FSR_BIND(read,"fsrfg_surface_read");VE_FSR_BIND(writeVideo,"fsrfg_surface_to_video");+ VE_FSR_BIND(upload,"fsrfg_surface_upload");+#undef VE_FSR_BIND+ }catch(...){FreeLibrary(module_);module_=nullptr;throw;}+ }+ static Api& get(){static Api api;return api;}+ decltype(&fsrfg_abi_version) abi=nullptr;+ decltype(&fsrfg_device_create) createDevice=nullptr;decltype(&fsrfg_device_release) releaseDevice=nullptr;+ decltype(&fsrfg_device_capabilities) capabilities=nullptr;decltype(&fsrfg_device_d3d12) nativeDevice=nullptr;decltype(&fsrfg_device_queue) nativeQueue=nullptr;+ decltype(&fsrfg_session_create) createSession=nullptr;decltype(&fsrfg_session_release) releaseSession=nullptr;decltype(&fsrfg_process) process=nullptr;+ decltype(&fsrfg_surface_describe) describe=nullptr;decltype(&fsrfg_surface_release) releaseSurface=nullptr;+ decltype(&fsrfg_surface_read) read=nullptr;decltype(&fsrfg_surface_to_video) writeVideo=nullptr;+ decltype(&fsrfg_surface_upload) upload=nullptr;+ private:+ HMODULE module_=nullptr; // Keep code resident through worker/global teardown.+};+template<class T> T record(){T value{};value.size=sizeof(T);value.abi=VE_FSR_ABI_VERSION;return value;}+void require(bool okay,const std::array<char,4096>& error){if(!okay)throw std::runtime_error(error[0]?error.data():"AMD FSR operation failed");}+QString adapterKey(const DXGI_ADAPTER_DESC1& desc,uint32_t occurrence){+ return QString("dxgi:%1:%2:%3:%4:%5").arg(desc.VendorId,4,16,QLatin1Char('0')).arg(desc.DeviceId,4,16,QLatin1Char('0'))+ .arg(desc.SubSysId,8,16,QLatin1Char('0')).arg(desc.Revision,2,16,QLatin1Char('0')).arg(occurrence);+}+}+std::vector<FsrAdapter> detectFsrAdapters(JobControl* control){+ ComPtr<IDXGIFactory6> factory;if(FAILED(CreateDXGIFactory2(0,IID_PPV_ARGS(&factory))))throw std::runtime_error("Cannot enumerate DirectX graphics adapters");+ std::vector<FsrAdapter> result;QMap<QString,uint32_t> seen;+ for(uint32_t index=0;;++index){+ if(control)control->checkpoint();ComPtr<IDXGIAdapter1> adapter;const auto status=factory->EnumAdapters1(index,&adapter);if(status==DXGI_ERROR_NOT_FOUND)break;+ if(FAILED(status))throw std::runtime_error("Cannot read a DirectX graphics adapter");DXGI_ADAPTER_DESC1 desc{};+ if(FAILED(adapter->GetDesc1(&desc))||(desc.Flags&DXGI_ADAPTER_FLAG_SOFTWARE))continue;+ const auto hardware=adapterKey(desc,0);const auto id=adapterKey(desc,seen[hardware]++);+ FsrAdapter item{index,desc.VendorId,desc.DeviceId,desc.AdapterLuid.LowPart,desc.AdapterLuid.HighPart,desc.DedicatedVideoMemory,id,QString::fromWCharArray(desc.Description),{},false};+ try{+ auto& api=Api::get();auto create=record<VeFsrDeviceDesc>();create.adapter_index=index;const auto directory=QDir::toNativeSeparators(runtimeDirectory()).toStdWString();create.runtime_directory=directory.c_str();+ std::array<char,4096> error{};auto* device=api.createDevice(&create,error.data(),uint32_t(error.size()));+ if(!device)item.unavailableReason=QString::fromUtf8(error.data());+ else{auto caps=record<VeFsrCapabilities>();item.available=api.capabilities(device,&caps)!=0;item.unavailableReason=QString::fromUtf8(caps.unavailable_reason);api.releaseDevice(device);}+ }catch(const std::exception& e){item.unavailableReason=QString::fromUtf8(e.what());}+ result.push_back(std::move(item));+ }+ return result;+}+uint32_t fsrAdapterIndex(const QString& selection){+ if(selection=="auto")return UINT32_MAX;+ bool number=false;const auto index=selection.toUInt(&number);if(number)return index;+ for(const auto& adapter:detectFsrAdapters())if(adapter.id.compare(selection,Qt::CaseInsensitive)==0)return adapter.index;+ throw std::runtime_error("Selected FSR DirectX adapter is unavailable");+}+uint32_t fsrTransfer(const QString& transfer){+ if(transfer=="iec61966-2-1")return VE_FSR_SRGB;if(transfer=="bt709"||transfer=="smpte170m"||transfer=="bt2020-10"||transfer=="bt2020-12")return VE_FSR_BT709;+ if(transfer=="linear")return VE_FSR_LINEAR;if(transfer=="gamma22"||transfer=="bt470m")return VE_FSR_GAMMA22;if(transfer=="gamma28"||transfer=="bt470bg")return VE_FSR_GAMMA28;+ if(transfer=="smpte2084")return VE_FSR_PQ;if(transfer=="arib-std-b67")return VE_FSR_HLG;throw std::runtime_error("FSR video transfer function is unsupported or unspecified");+}+uint32_t fsrPrimaries(const QString& primaries){+ if(primaries=="bt2020")return VE_FSR_BT2020;if(primaries=="bt709")return VE_FSR_PRIMARIES_BT709;+ if(primaries=="smpte170m"||primaries=="smpte240m")return VE_FSR_SMPTE_C;+ if(primaries=="bt470bg")return VE_FSR_BT470BG;if(primaries=="bt470m")return VE_FSR_BT470M;+ throw std::runtime_error("FSR video color primaries are unsupported or unspecified");+}+float fsrMaximumLuminance(const MediaInfo& colors){+ if(!colors.hdr)return 100;+ double maximum=0;+ const auto luminance=[](const QJsonValue& value){+ const auto parts=value.toVariant().toString().split('/');+ if(parts.size()==2){const auto denominator=parts[1].toDouble();return denominator>0?parts[0].toDouble()/denominator:0.;}+ return value.toVariant().toDouble();+ };+ for(const auto& value:colors.metadata.value("side_data_list").toArray()){+ const auto side=value.toObject();const auto type=side.value("side_data_type").toString();+ const auto nits=type=="Mastering display metadata"?luminance(side.value("max_luminance")):+ type=="Content light level metadata"?luminance(side.value("max_content")):0.;+ if(std::isfinite(nits)&&nits>0&&nits<=10000)maximum=std::max(maximum,nits);+ }+ return float(maximum>0?std::clamp(maximum,100.,10000.):colors.transfer=="arib-std-b67"?1000.:10000.);+}+MediaInfo fsrVideoColors(MediaInfo colors){+ const auto missing=[](const QString& value){return value.isEmpty()||value=="unknown"||value=="unspecified";};+ QJsonArray assumptions;+ if(missing(colors.transfer)){+ if(colors.hdr||colors.primaries=="bt2020"||colors.colorSpace.startsWith("bt2020"))+ throw std::runtime_error("FSR requires an explicit transfer function for HDR or BT.2020 input");+ colors.transfer="bt709";assumptions.append("Unspecified SDR transfer: BT.709 assumed");+ }+ if(missing(colors.primaries)){+ colors.primaries=colors.hdr||colors.colorSpace.startsWith("bt2020")?"bt2020":+ colors.colorSpace=="smpte170m"?"smpte170m":colors.colorSpace=="bt470bg"?"bt470bg":"bt709";+ assumptions.append("Unspecified color primaries: "+colors.primaries+" assumed");+ }+ if(missing(colors.colorSpace)){colors.colorSpace=colors.hdr?"bt2020nc":"bt709";assumptions.append("Unspecified video matrix: "+colors.colorSpace+" assumed");}+ if(missing(colors.range)){colors.range="tv";assumptions.append("Unspecified video range: limited assumed; decoder frame tags take precedence");}+ (void)fsrTransfer(colors.transfer);(void)fsrPrimaries(colors.primaries);+ if(!colors.metadata.contains("output_sample_aspect_ratio")){+ const auto parts=colors.metadata.value("sample_aspect_ratio").toString().split(':');+ int numerator=parts.value(0).toInt(),denominator=parts.value(1).toInt();+ if(numerator<=0||denominator<=0)numerator=denominator=1;+ if(colors.clockwiseRotation()%180)std::swap(numerator,denominator);+ colors.metadata.insert("output_sample_aspect_ratio",QString::number(numerator)+':'+QString::number(denominator));+ }+ if(!assumptions.isEmpty())colors.metadata.insert("ve_fsr_color_assumptions",assumptions);+ return colors;+}+QByteArray fsrAdapterCacheIdentity(){+ static const QByteArray identity=[](){+ QByteArray bytes("fsr-dxgi-hardware/v1");ComPtr<IDXGIFactory6> factory;if(FAILED(CreateDXGIFactory2(0,IID_PPV_ARGS(&factory))))return bytes;+ for(uint32_t index=0;;++index){ComPtr<IDXGIAdapter1> adapter;if(factory->EnumAdapters1(index,&adapter)==DXGI_ERROR_NOT_FOUND)break;if(!adapter)continue;+ DXGI_ADAPTER_DESC1 desc{};if(FAILED(adapter->GetDesc1(&desc))||(desc.Flags&DXGI_ADAPTER_FLAG_SOFTWARE))continue;LARGE_INTEGER driver{};adapter->CheckInterfaceSupport(__uuidof(IDXGIDevice),&driver);+ bytes+=adapterKey(desc,0).toUtf8()+'|'+QByteArray::number(desc.AdapterLuid.HighPart)+':'+QByteArray::number(desc.AdapterLuid.LowPart)+':'+QByteArray::number(driver.QuadPart)+';';+ }return bytes;+ }();return identity;+}+FsrDevice::FsrDevice(const QString& selection){+ auto& api=Api::get();auto desc=record<VeFsrDeviceDesc>();desc.adapter_index=fsrAdapterIndex(selection);const auto directory=QDir::toNativeSeparators(runtimeDirectory()).toStdWString();desc.runtime_directory=directory.c_str();+ std::array<char,4096> error{};handle_=api.createDevice(&desc,error.data(),uint32_t(error.size()));require(handle_!=nullptr,error);+ capabilities_=record<VeFsrCapabilities>();if(!api.capabilities(handle_,&capabilities_)){api.releaseDevice(handle_);handle_=nullptr;throw std::runtime_error(capabilities_.unavailable_reason);}+}+FsrDevice::~FsrDevice(){if(handle_)Api::get().releaseDevice(handle_);}+void* FsrDevice::nativeDevice()const{return Api::get().nativeDevice(handle_);}+void* FsrDevice::nativeQueue()const{return Api::get().nativeQueue(handle_);}+struct FsrSurface::Storage{VeFsrSurface* handle=nullptr;VeFsrSurfaceDesc description{};~Storage(){if(handle)Api::get().releaseSurface(handle);}};+FsrSurface::FsrSurface(VeFsrSurface* handle){+ if(!handle)throw std::runtime_error("FSR returned an empty surface");auto release=Api::get().releaseSurface;+ std::unique_ptr<VeFsrSurface,decltype(release)> guard(handle,release);state_=std::make_shared<Storage>();state_->handle=guard.release();state_->description=record<VeFsrSurfaceDesc>();+ if(!Api::get().describe(handle,&state_->description))throw std::runtime_error("FSR returned an invalid surface descriptor");+}+FsrSurface FsrDevice::uploadImage(const QImage& image,const MediaInfo& colors)const{+ const auto pixels=image.convertToFormat(QImage::Format_RGBA64);if(pixels.isNull())throw std::invalid_argument("FSR post-processing image is empty");+ auto frame=record<VeFsrFrame>();frame.memory_type=VE_FSR_MEMORY_HOST;frame.pixel_format=VE_FSR_RGBA16;+ frame.width=uint32_t(pixels.width());frame.height=uint32_t(pixels.height());frame.row_bytes=uint32_t(pixels.bytesPerLine());frame.pixels=pixels.constBits();+ frame.transfer=fsrTransfer(colors.transfer);frame.primaries=fsrPrimaries(colors.primaries);+ std::array<char,4096> error{};auto* surface=Api::get().upload(handle_,&frame,error.data(),uint32_t(error.size()));require(surface!=nullptr,error);return FsrSurface(surface);+}+const VeFsrSurfaceDesc& FsrSurface::description()const{if(!state_)throw std::runtime_error("FSR surface is empty");return state_->description;}+QImage FsrSurface::toHost(const MediaInfo& colors)const{+ const auto& desc=description();QImage image(int(desc.width),int(desc.height),QImage::Format_RGBA64);if(image.isNull())throw std::bad_alloc{};+ std::array<char,4096> error{};require(Api::get().read(state_->handle,VE_FSR_RGBA16,fsrTransfer(colors.transfer),fsrPrimaries(colors.primaries),image.bits(),uint32_t(image.bytesPerLine()),error.data(),uint32_t(error.size()))!=0,error);return image;+}+void FsrSurface::writeVideo(const VeFsrVideoOutput& output)const{(void)description();std::array<char,4096> error{};require(Api::get().writeVideo(state_->handle,&output,error.data(),uint32_t(error.size()))!=0,error);}+FsrInterpolation::FsrInterpolation(std::shared_ptr<FsrDevice> device,QSize size,bool hdr,int poolSize,float maximumNits):device_(std::move(device)){+ if(!device_)throw std::invalid_argument("FSR requires an owned GPU device");auto desc=record<VeFsrSessionDesc>();desc.width=uint32_t(size.width());desc.height=uint32_t(size.height());desc.hdr=hdr;desc.surface_pool_size=uint32_t(poolSize);desc.maximum_luminance_nits=hdr?maximumNits:100.f;+ std::array<char,4096> error{};handle_=Api::get().createSession(device_->handle_,&desc,error.data(),uint32_t(error.size()));require(handle_!=nullptr,error);+}+FsrInterpolation::~FsrInterpolation(){if(handle_)Api::get().releaseSession(handle_);}+FsrInterpolation::Result FsrInterpolation::evaluate(const VeFsrFrame& input,bool reset){+ auto native=record<VeFsrResult>();std::array<char,4096> error{};require(Api::get().process(handle_,&input,uint32_t(reset),&native,error.data(),uint32_t(error.size()))!=0,error);+ Result result;result.reset=native.reset!=0;result.sceneCut=native.scene_cut!=0;result.duplicate=native.duplicate!=0;result.uploadBytes=native.upload_bytes;result.downloadBytes=native.download_bytes;result.milliseconds=native.total_milliseconds;+ auto release=Api::get().releaseSurface;std::unique_ptr<VeFsrSurface,decltype(release)> source(native.source,release),generated(native.generated,release);+ result.source=FsrSurface(source.release());if(native.generated_count){if(native.generated_count!=1)throw std::runtime_error("FSR returned an invalid intermediate frame count");result.generated.push_back(FsrSurface(generated.release()));}return result;+}+FsrInterpolation::Result FsrInterpolation::evaluate(const QImage& image,const MediaInfo& colors,qint64 pts,qint64 duration,TimeBase base,bool reset){+ const auto pixels=image.convertToFormat(QImage::Format_RGBA64);auto frame=record<VeFsrFrame>();frame.memory_type=VE_FSR_MEMORY_HOST;frame.pixel_format=VE_FSR_RGBA16;frame.width=uint32_t(pixels.width());frame.height=uint32_t(pixels.height());frame.row_bytes=uint32_t(pixels.bytesPerLine());frame.pixels=pixels.constBits();+ frame.transfer=fsrTransfer(colors.transfer);frame.primaries=fsrPrimaries(colors.primaries);frame.pts=pts;frame.duration=duration;frame.timebase_numerator=base.numerator;frame.timebase_denominator=base.denominator;return evaluate(frame,reset);+}+FsrInterpolation::Result FsrInterpolation::evaluate(const FsrSurface& input,qint64 pts,qint64 duration,TimeBase base,bool reset){+ const auto& desc=input.description();auto frame=record<VeFsrFrame>();frame.memory_type=VE_FSR_MEMORY_D3D12;frame.pixel_format=desc.pixel_format;frame.width=desc.width;frame.height=desc.height;frame.texture=desc.texture;frame.resource_state=desc.resource_state;+ frame.transfer=desc.transfer;frame.primaries=desc.primaries;frame.pts=pts;frame.duration=duration;frame.timebase_numerator=base.numerator;frame.timebase_denominator=base.denominator;return evaluate(frame,reset);+}+}diff --git a/src/processing/fsr_native.hpp b/src/processing/fsr_native.hppnew file mode 100644index 0000000..e756e3d--- /dev/null+++ b/src/processing/fsr_native.hpp@@ -0,0 +1,70 @@+#pragma once+#include "fsr_frame_generation/fsr_bridge.h"+#include "media/media.hpp"+#include "media/packet_stream.hpp"+#include <QImage>+#include <QString>+#include <memory>+#include <vector>++namespace ve {+struct D3dVideoFrame;+struct FsrAdapter {+ uint32_t index=0,vendor=0,device=0,luidLow=0;int32_t luidHigh=0;+ quint64 memoryBytes=0;+ QString id,name,unavailableReason;+ bool available=false;+};+[[nodiscard]] std::vector<FsrAdapter> detectFsrAdapters(JobControl* control=nullptr);+[[nodiscard]] uint32_t fsrAdapterIndex(const QString& selection);+[[nodiscard]] uint32_t fsrTransfer(const QString& transfer);+[[nodiscard]] uint32_t fsrPrimaries(const QString& primaries);+[[nodiscard]] float fsrMaximumLuminance(const MediaInfo& colors);+// Make missing SDR/HDR color tags explicit before passing images to the SDK.+// Assumptions are recorded in metadata for diagnostics and delivery reports.+[[nodiscard]] MediaInfo fsrVideoColors(MediaInfo colors);+[[nodiscard]] QByteArray fsrAdapterCacheIdentity();+class FsrSurface;+class FsrDevice {+ public:+ explicit FsrDevice(const QString& selection="auto");+ ~FsrDevice();+ FsrDevice(const FsrDevice&)=delete;FsrDevice& operator=(const FsrDevice&)=delete;+ [[nodiscard]] void* nativeDevice() const;+ [[nodiscard]] void* nativeQueue() const;+ [[nodiscard]] FsrSurface uploadImage(const QImage& image,const MediaInfo& colors) const;+ [[nodiscard]] const VeFsrCapabilities& capabilities() const {return capabilities_;}+ private:+ VeFsrDevice* handle_=nullptr;VeFsrCapabilities capabilities_{};+ friend class FsrInterpolation;+};+class FsrSurface {+ public:+ FsrSurface()=default;+ [[nodiscard]] explicit operator bool() const{return bool(state_);}+ [[nodiscard]] const VeFsrSurfaceDesc& description() const;+ [[nodiscard]] QImage toHost(const MediaInfo& colors) const;+ void writeVideo(const VeFsrVideoOutput& output) const;+ private:+ struct Storage;std::shared_ptr<Storage> state_;+ explicit FsrSurface(VeFsrSurface* handle);+ friend class FsrInterpolation;+ friend class FsrDevice;+};+class FsrInterpolation {+ public:+ struct Result {+ FsrSurface source;std::vector<FsrSurface> generated;+ bool reset=false,sceneCut=false,duplicate=false;+ quint64 uploadBytes=0,downloadBytes=0;double milliseconds=0;+ };+ FsrInterpolation(std::shared_ptr<FsrDevice> device,QSize size,bool hdr,int poolSize=16,float maximumNits=1000);+ ~FsrInterpolation();+ FsrInterpolation(const FsrInterpolation&)=delete;FsrInterpolation& operator=(const FsrInterpolation&)=delete;+ [[nodiscard]] Result evaluate(const VeFsrFrame& input,bool reset=false);+ [[nodiscard]] Result evaluate(const QImage& input,const MediaInfo& colors,qint64 pts,qint64 duration,TimeBase base,bool reset=false);+ [[nodiscard]] Result evaluate(const FsrSurface& input,qint64 pts,qint64 duration,TimeBase base,bool reset=false);+ private:+ std::shared_ptr<FsrDevice> device_;VeFsrSession* handle_=nullptr;+};+}diff --git a/src/processing/fsr_temporal.cpp b/src/processing/fsr_temporal.cppnew file mode 100644index 0000000..2aac76a--- /dev/null+++ b/src/processing/fsr_temporal.cpp@@ -0,0 +1,61 @@+#include "fsr_temporal.hpp"+#include "media/temporal_cadence.hpp"++namespace ve {+struct FsrTemporalCascade::Impl {+ struct Stage {std::unique_ptr<FsrInterpolation> session;std::optional<Sample> previous;std::optional<int> inputSegment;};+ std::vector<Stage> stages;Statistics stats;FrameTime nominal,clockOffset;TimeBase targetInterval;+ std::shared_ptr<FsrDevice> device;QSize size;bool hdr;float nits;+ Impl(std::shared_ptr<FsrDevice> selectedDevice,QSize selectedSize,bool selectedHdr,TimeBase source,TimeBase target,bool variable,float selectedNits,FrameTime offset)+ :nominal(source.numerator,source.denominator),clockOffset(offset),targetInterval(target),device(std::move(selectedDevice)),size(selectedSize),hdr(selectedHdr),nits(selectedNits){+ stats.levels=midpointCascadeDepth(source,target,variable);+ for(int i=0;i<std::max(1,stats.levels);++i)stages.push_back({std::make_unique<FsrInterpolation>(device,size,hdr,16,nits),{}});+ }+ void adapt(FrameTime time){+ if(!stages.front().previous)return;const auto depth=midpointIntervalDepth(stages.front().previous->time,time,targetInterval,clockOffset,stats.levels);+ if(depth<=stats.levels)return;+ const auto oldCount=stages.size();const auto tail=stages.back().previous;+ while(stages.size()<size_t(std::max(1,depth)))stages.push_back({std::make_unique<FsrInterpolation>(device,size,hdr,16,nits),{}});+ stats.levels=depth;++stats.cadencePromotions;+ // Seed only the added contexts from the preceding anchor. Avoid+ // publishing a duplicate timestamp to the delivery sampler.+ if(tail)feed(oldCount,*tail,[](Sample){});+ }+ void account(const FsrInterpolation::Result& result,bool source){+ stats.generated+=result.generated.size();stats.uploadBytes+=result.uploadBytes;stats.downloadBytes+=result.downloadBytes;stats.milliseconds+=result.milliseconds;+ if(source){++stats.sourceFrames;stats.sceneCuts+=result.sceneCut;stats.duplicates+=result.duplicate;}+ }+ std::pair<bool,int> discontinuity(FrameTime time,bool reset)const{+ const auto& previous=stages.front().previous;if(!previous)return{true,0};+ if(time<=previous->time)throw std::runtime_error("FSR source presentation timestamps must increase");+ const bool discontinuity=reset||time-previous->time>nominal.fraction(2,1);+ return{discontinuity,previous->segment+(discontinuity?1:0)};+ }+ void feed(size_t level,Sample sample,const Consumer& consume){+ if(level==stages.size()){consume(std::move(sample));return;}+ auto& stage=stages[level];const auto interval=stage.previous?sample.time-stage.previous->time:nominal.fraction(1,std::int64_t(1)<<level);+ const auto pts=sample.time.ticks(1,60000000),duration=std::max(std::int64_t(1),interval.ticks(1,60000000));+ auto result=stage.session->evaluate(sample.pixels,pts,duration,{1,60000000},!stage.inputSegment||sample.segment!=*stage.inputSegment);stage.inputSegment=sample.segment;account(result,false);+ for(auto& frame:publishTemporalResult(stage.previous,std::move(result),sample.time,sample.segment,1))feed(level+1,std::move(frame),consume);+ }+ void publish(FsrInterpolation::Result result,FrameTime time,int segment,const Consumer& consume){+ if(!result.reset&&!result.sceneCut)adapt(time);+ account(result,true);if(stats.levels==0)result.generated.clear();+ for(auto& sample:publishTemporalResult(stages.front().previous,std::move(result),time,segment,stats.levels==0?0:1))feed(1,std::move(sample),consume);+ }+};+FsrTemporalCascade::FsrTemporalCascade(std::shared_ptr<FsrDevice> device,QSize size,bool hdr,TimeBase source,TimeBase target,bool variable,float nits,FrameTime offset)+ :impl_(std::make_unique<Impl>(std::move(device),size,hdr,source,target,variable,nits,offset)){}+FsrTemporalCascade::~FsrTemporalCascade()=default;+FsrTemporalCascade::Statistics FsrTemporalCascade::statistics()const{return impl_->stats;}+void FsrTemporalCascade::push(const VeFsrFrame& frame,const Consumer& consume,bool reset){+ if(frame.pts<0||frame.timebase_numerator<=0||frame.timebase_denominator<=0)throw std::runtime_error("Invalid FSR frame presentation time");+ const FrameTime time=FrameTime(frame.pts).fraction(frame.timebase_numerator,frame.timebase_denominator);+ const auto [discontinuity,segment]=impl_->discontinuity(time,reset);impl_->publish(impl_->stages.front().session->evaluate(frame,discontinuity),time,segment,consume);+}+void FsrTemporalCascade::push(const QImage& image,const MediaInfo& colors,qint64 pts,qint64 duration,TimeBase base,const Consumer& consume,bool reset){+ if(pts<0||base.numerator<=0||base.denominator<=0)throw std::runtime_error("Invalid FSR host frame presentation time");+ const FrameTime time=FrameTime(pts).fraction(base.numerator,base.denominator);const auto [discontinuity,segment]=impl_->discontinuity(time,reset);+ impl_->publish(impl_->stages.front().session->evaluate(image,colors,pts,duration,base,discontinuity),time,segment,consume);+}+}diff --git a/src/processing/fsr_temporal.hpp b/src/processing/fsr_temporal.hppnew file mode 100644index 0000000..a37256f--- /dev/null+++ b/src/processing/fsr_temporal.hpp@@ -0,0 +1,21 @@+#pragma once+#include "fsr_native.hpp"+#include "media/temporal_stream.hpp"+#include <functional>++namespace ve {+class FsrTemporalCascade {+ public:+ using Sample=TemporalSample<FsrSurface>;+ using Consumer=std::function<void(Sample)>;+ struct Statistics {quint64 sourceFrames=0,generated=0,sceneCuts=0,duplicates=0,uploadBytes=0,downloadBytes=0;double milliseconds=0;int levels=0,cadencePromotions=0;};+ FsrTemporalCascade(std::shared_ptr<FsrDevice> device,QSize size,bool hdr,TimeBase sourceInterval,+ TimeBase targetInterval,bool variableRate=false,float maximumNits=1000,FrameTime clockOffset={});+ ~FsrTemporalCascade();+ void push(const VeFsrFrame& frame,const Consumer& consume,bool reset=false);+ void push(const QImage& image,const MediaInfo& colors,qint64 pts,qint64 duration,TimeBase base,const Consumer& consume,bool reset=false);+ [[nodiscard]] Statistics statistics() const;+ private:+ struct Impl;std::unique_ptr<Impl> impl_;+};+}diff --git a/src/processing/fsr_video.cpp b/src/processing/fsr_video.cppnew file mode 100644index 0000000..dbfe3d1--- /dev/null+++ b/src/processing/fsr_video.cpp@@ -0,0 +1,169 @@+#include "fsr_video.hpp"+#include "fsr_temporal.hpp"+#include "fsr_worker.hpp"+#include "media/temporal_cadence.hpp"+#include "native_engines.hpp"+#include "reshade_native.hpp"+#include "infrastructure/log.hpp"+#include "infrastructure/scratch.hpp"+#include "media/av_api.hpp"+#include "media/d3d_video.hpp"+#include "media/d3d_nvenc.hpp"+#include "media/d3d_amf.hpp"+#include "media/host_video.hpp"+#include "media/video_delivery.hpp"+#include <QElapsedTimer>+#include <QJsonDocument>+#include <QJsonArray>+#include <cmath>+#include <limits>+#include <mutex>++namespace ve {+namespace {+std::mutex diagnosticMutex;QString lastDiagnostic;+void prepareCards(const Settings& settings,const QStringList& stages){+ if(stages.contains("neural_model")||stages.contains("dlss_super_resolution")||stages.contains("dlss_ray_reconstruction")||stages.contains("super_resolution")||stages.contains("rtx_video_hdr"))+ NativeEngines::instance().prepare(gpuOrdinal(settings.ai_gpu_uuid),stages);+ if(stages.contains("reshade"))ReShadeEngine::initialize(gpuOrdinal(settings.ai_gpu_uuid));+}+class Input {+ public:+ Input(const RenderRequest& request,const MediaInfo& colors,const std::shared_ptr<FsrDevice>& device,bool host,JobControl& control):colors_(colors){+ const auto make11=[&]{eleven_=std::make_unique<D3d11VideoDecoder>(request.input,device->nativeDevice(),device->nativeQueue(),request.startSeconds,control);gpu_=eleven_->read();};+ if(!host){+ try{if(device->capabilities().vendor_id==0x1002)make11();else{twelve_=std::make_unique<D3dVideoDecoder>(request.input,device->nativeDevice(),request.startSeconds,control);gpu_=twelve_->read();}}+ catch(const Cancelled&){throw;}+ catch(const std::exception& first){+ const auto reason=QString::fromUtf8(first.what());twelve_.reset();eleven_.reset();+ try{make11();}+ catch(const Cancelled&){throw;}+ catch(const std::exception& fallback){eleven_.reset();info("fsr",reason+"; shared DirectX decode unavailable: "+QString::fromUtf8(fallback.what()));}+ }+ }+ if(!twelve_&&!eleven_){+ host_=std::make_unique<HostVideoDecoder>(request.input,colors,0,request.startSeconds,false,control,HostDecodePrecision::Unorm16);+ image_=host_->read();mode_=host?"Host boundary for preceding cards":"Software decode compatibility boundary";+ }else mode_=eleven_?"D3D11 decode, shared GPU textures to D3D12":"D3D12 hardware decode";+ if(!available())throw std::runtime_error("FSR source contains no decodable video frames");+ origin_=twelve_?twelve_->timeOrigin():eleven_?eleven_->timeOrigin():host_->timeOrigin();+ }+ bool available()const{return gpu_.has_value()||image_.has_value();}+ void next(){if(twelve_)gpu_=twelve_->read();else if(eleven_)gpu_=eleven_->read();else image_=host_->read();}+ qint64 pts()const{return gpu_?gpu_->pts:image_->pts;}+ qint64 duration()const{return gpu_?gpu_->duration:image_->duration;}+ TimeBase base()const{return gpu_?gpu_->timeBase:image_->timeBase;}+ double origin()const{return origin_;}+ QString mode()const{return mode_;}+ QImage hostImage()const{if(!image_)throw std::logic_error("FSR input has no host image");return image_->image;}+ bool hardware()const{return gpu_.has_value();}+ VeFsrFrame descriptor()const{+ if(!gpu_)throw std::logic_error("FSR input has no DirectX surface");const auto& input=*gpu_;+ VeFsrFrame frame{};frame.size=sizeof(frame);frame.abi=VE_FSR_ABI_VERSION;frame.memory_type=VE_FSR_MEMORY_D3D12;frame.pixel_format=input.pixelFormat;+ frame.width=uint32_t(input.size.width());frame.height=uint32_t(input.size.height());frame.texture=input.texture;frame.ready_fence=input.readyFence;frame.ready_value=input.readyValue;+ frame.transfer=fsrTransfer(colors_.transfer);frame.primaries=fsrPrimaries(colors_.primaries);frame.rotation=uint32_t(colors_.clockwiseRotation());+ frame.color_matrix=input.colorMatrix;frame.color_range=input.colorRange;frame.chroma_location=input.chromaLocation;+ frame.pts=input.pts;frame.duration=input.duration;frame.timebase_numerator=input.timeBase.numerator;frame.timebase_denominator=input.timeBase.denominator;return frame;+ }+ private:+ MediaInfo colors_;QString mode_;double origin_=0;+ std::unique_ptr<D3dVideoDecoder> twelve_;std::unique_ptr<D3d11VideoDecoder> eleven_;std::unique_ptr<HostVideoDecoder> host_;+ std::optional<D3dVideoFrame> gpu_;std::optional<TimedImage> image_;+};+}+QString fsrVideoDiagnostics(){std::lock_guard lock(diagnosticMutex);return lastDiagnostic;}+bool renderFsrVideo(const RenderRequest& request,const MediaInfo& input,const Settings& configured,const PipelineEstimate& estimate,+ const QString& destination,JobControl& control,const ProgressCallback& progress){+ const auto position=estimate.stages.indexOf("fsr_frame_generation");if(position<0)return false;+ QElapsedTimer startup;startup.start();+ if(!input.video||input.fps<=0)throw std::runtime_error("FSR Frame Generation requires video with a valid frame rate");+ auto settings=configured;const auto before=estimate.stages.mid(0,position),after=estimate.stages.mid(position+1);+ if(request.preview){settings.codec="H.265";settings.quality="Max";settings.container="MKV";}+ auto colors=fsrVideoColors(input);if(colors.hdr&&!settings.hdr_mode)throw std::runtime_error(QT_TRANSLATE_NOOP("App", "HDR FSR input requires HDR Mode and a 10-bit output codec"));+ auto device=std::make_shared<FsrDevice>(settings.fsr_adapter_id);+ const auto deviceReadyMs=startup.elapsed();+ auto beforeSettings=settings;beforeSettings.video_enabled_stages=before;+ const auto preceding=estimatePipeline(colors,beforeSettings,Workflow::NeuralRendering);+ auto pixels=colors;pixels.width=preceding.width;pixels.height=preceding.height;pixels.hdr=preceding.hdr;+ if(before.contains("rtx_video_hdr")){pixels.primaries="bt2020";pixels.transfer="smpte2084";pixels.sourceBitDepth=16;}+ pixels.colorSpace="gbr";pixels.range="pc";pixels.sourceBitDepth=16;pixels.pixelFormat="rgba64le";+ const auto target=frameGenerationFrameRate(preceding.fps,settings,true);const auto rate=av::Api::get().av_d2q(input.fps,1000000);+ const TimeBase sourceInterval{rate.den,rate.num},targetInterval=frameGenerationTimeBase(preceding.fps,settings,true);+ const FrameTime step(targetInterval.numerator,targetInterval.denominator),nominal(sourceInterval.numerator,sourceInterval.denominator);+ Input decoder(request,colors,device,!before.isEmpty(),control);+ const auto decoderReadyMs=startup.elapsed();+ const auto sourceBase=decoder.base();+ const auto sourceOrigin=qint64(std::llround(decoder.origin()*sourceBase.denominator/sourceBase.numerator));+ const auto sourceStart=input.metadata.contains("start_pts")?input.metadata.value("start_pts").toVariant().toLongLong():qint64(std::llround(input.presentationStartSeconds()*sourceBase.denominator/sourceBase.numerator));+ const auto relativeOrigin=sourceOrigin-sourceStart;+ const auto alignment=alignTemporalClock(relativeOrigin,sourceBase,targetInterval);const auto firstOutputIndex=alignment.firstIndex;+ const auto alignedTime=alignment.relativeStart,phase=alignment.phase;+ const double outputOrigin=input.presentationStartSeconds()+alignedTime.seconds();+ prepareCards(settings,before+after);+ std::unique_ptr<FramePipeline> pre,post;+ if(!before.isEmpty())pre=std::make_unique<FramePipeline>(settings,colors,before,false);+ auto temporalColors=pixels;temporalColors.fps=target;+ if(!after.isEmpty())post=std::make_unique<FramePipeline>(settings,temporalColors,after,true);+ auto output=temporalColors;output.width=estimate.width;output.height=estimate.height;output.hdr=estimate.hdr;output.sourceBitDepth=16;output.pixelFormat="rgba64le";+ if(after.contains("rtx_video_hdr")){output.primaries="bt2020";output.transfer="smpte2084";}+ ScratchDirectory directory(QStringLiteral("fsr-video-XXXXXX"));if(!directory.isValid())throw std::runtime_error("Cannot create FSR processing directory");+ const auto video=directory.filePath("video.mp4");+ std::unique_ptr<D3dNvEncoder> nvidia;std::unique_ptr<D3dSharedEncoder> amd;+ QString encoderMode;const bool compressed=settings.codec.startsWith("H.264")||settings.codec.startsWith("H.265")||settings.codec.startsWith("AV1");+ if(!compressed)throw std::runtime_error(QT_TRANSLATE_NOOP("App", "FSR Frame Generation requires GPU encoding with H.264, HEVC or AV1. Select a supported codec."));+ // Independently encoded preview frames permit accurate trimming and parked+ // comparisons without a second encode or a preceding GOP's reference state.+ if(device->capabilities().vendor_id==0x10de)nvidia=std::make_unique<D3dNvEncoder>(video,settings.codec,settings,output,device->nativeDevice(),device->nativeQueue(),control,request.preview);+ else if(device->capabilities().vendor_id==0x1002||device->capabilities().vendor_id==0x8086)amd=std::make_unique<D3dSharedEncoder>(video,settings.codec,settings,output,device->nativeDevice(),control,request.preview);+ else throw D3dVideoUnavailable("GPU encoding is unavailable for the selected FSR DirectX adapter");+ const auto encoderReadyMs=startup.elapsed();+ const auto maximumNits=fsrMaximumLuminance(pixels);+ FsrTemporalCascade cascade(device,{pixels.width,pixels.height},pixels.hdr,sourceInterval,targetInterval,input.variableFrameRate,maximumNits,phase);+ const auto temporalReadyMs=startup.elapsed();qint64 firstOutputMs=-1;+ QElapsedTimer elapsed;elapsed.start();qint64 decoded=0;FrameTime actualDuration;quint64 readback=0,postUpload=0;std::optional<int> outputSegment;+ const double decodedOriginSeconds=double(relativeOrigin)*sourceBase.numerator/sourceBase.denominator;+ const auto requestedEnd=request.seconds>0?std::min(input.duration,request.startSeconds+request.seconds):input.duration;+ const auto requestedDuration=std::max(0.,requestedEnd-decodedOriginSeconds);+ const auto expected=std::max(qint64(0),qint64(std::ceil((requestedDuration-phase.seconds())*target-1e-9)));+ if(request.seconds>0&&expected==0)throw std::runtime_error("The requested interval contains no output frames at the selected frame rate");+ const auto write=[&](const FsrTemporalCascade::Sample& selected,qint64 index){+ control.checkpoint();const auto pts=step.fraction(index,1).ticks(1,60000000),end=step.fraction(index+1,1).ticks(1,60000000);+ const bool reset=!outputSegment||*outputSegment!=selected.segment;outputSegment=selected.segment;+ auto surface=selected.pixels;+ if(post){+ auto image=surface.toHost(pixels);readback+=quint64(image.sizeInBytes());+ image=post->process(image,control,index+firstOutputIndex,reset,float(step.seconds()*1000),step.fraction(index+firstOutputIndex,1).seconds());+ surface=device->uploadImage(image,output);postUpload+=quint64(image.width())*image.height()*8;+ }+ if(nvidia)nvidia->write(surface,pts,end-pts,{1,60000000},reset);+ else amd->write(surface,pts,end-pts,{1,60000000},reset);+ if(firstOutputMs<0)firstOutputMs=startup.elapsed();+ if(progress)progress({std::min(.98,double(index+1)/std::max(qint64(1),expected)),QT_TRANSLATE_NOOP("App","FSR Frame Generation"),index+1,expected,elapsed.elapsed()>0?(index+1)*1000./elapsed.elapsed():0});+ };+ NearestFrameWriter<FsrTemporalCascade::Sample,decltype(write)> writer(request.seconds>0?expected:std::numeric_limits<qint64>::max(),step,write,phase);+ const auto consume=[&](FsrTemporalCascade::Sample sample){control.checkpoint();writer.push(std::move(sample));};+ while(decoder.available()){+ control.checkpoint();const auto time=FrameTime(decoder.pts()).fraction(decoder.base().numerator,decoder.base().denominator);+ const bool trailingAnchor=request.seconds>0&&time.seconds()>=requestedDuration-1e-9;+ if(decoder.hardware())cascade.push(decoder.descriptor(),consume,decoded==0);+ else{auto image=decoder.hostImage();if(pre){const auto globalTime=std::max(0.,decodedOriginSeconds+time.seconds());image=pre->process(image,control,qint64(std::llround(globalTime*input.fps)),decoded==0,float(nominal.seconds()*1000),globalTime);}cascade.push(image,pixels,decoder.pts(),decoder.duration(),decoder.base(),consume,decoded==0);}+ const auto duration=decoder.duration()>0?FrameTime(decoder.duration()).fraction(decoder.base().numerator,decoder.base().denominator):nominal;+ actualDuration=std::max(actualDuration,time+duration);++decoded;if(trailingAnchor)break;decoder.next();+ }+ if(!decoded)throw std::runtime_error("No FSR input frames within the requested interval");+ const double duration=std::max(0.,(request.seconds>0?std::min(actualDuration.seconds(),requestedDuration):actualDuration.seconds())-phase.seconds());writer.finish(qint64(std::ceil(duration*target-1e-9)));+ if(nvidia){nvidia->finish();encoderMode=nvidia->diagnostics();}else{amd->finish();encoderMode=amd->diagnostics();}+ const auto stats=cascade.statistics();QJsonObject report{{"provider",QString::fromUtf8(device->capabilities().provider_name)},{"adapter",QString::fromUtf8(device->capabilities().adapter_name)},+ {"decoder",decoder.mode()},{"encoder",encoderMode},{"source_time_origin",outputOrigin},{"decoded_time_origin",decoder.origin()},{"output_phase_seconds",phase.seconds()},{"source_frames",decoded},{"output_frames",writer.written()},{"levels",stats.levels},+ {"generated",qint64(stats.generated)},{"cuts",qint64(stats.sceneCuts)},{"duplicates",qint64(stats.duplicates)},{"cadence_promotions",stats.cadencePromotions},+ {"startup_milliseconds",QJsonObject{{"device_ready",deviceReadyMs},{"decoder_ready",decoderReadyMs},+ {"encoder_ready",encoderReadyMs},{"temporal_ready",temporalReadyMs},{"first_output",firstOutputMs}}},+ {"image_upload_bytes",qint64(stats.uploadBytes+postUpload)},{"image_readback_bytes",qint64(stats.downloadBytes+readback)},+ {"maximum_luminance_nits",maximumNits},{"transfer",output.transfer},{"primaries",output.primaries},{"output_sample_aspect_ratio",output.metadata.value("output_sample_aspect_ratio")},+ {"color_assumptions",colors.metadata.value("ve_fsr_color_assumptions")}};+ const bool strictModules=std::none_of(estimate.stages.begin(),estimate.stages.end(),[](const QString& stage){return isVfxStage(stage)||QStringList{"neural_model","dlss_super_resolution","dlss_ray_reconstruction","super_resolution","rtx_video_hdr","reshade"}.contains(stage);});+ report.insert("modules",fsrAuditLoadedModules(strictModules));+ const auto text=QString::fromUtf8(QJsonDocument(report).toJson(QJsonDocument::Compact));{std::lock_guard lock(diagnosticMutex);lastDiagnostic=text;}info("fsr",text);+ muxDelivery(video,destination,request,colors,settings,duration,control,request.preview?std::nullopt:std::optional(outputOrigin));return true;+}+}diff --git a/src/processing/fsr_video.hpp b/src/processing/fsr_video.hppnew file mode 100644index 0000000..88f17b4--- /dev/null+++ b/src/processing/fsr_video.hpp@@ -0,0 +1,7 @@+#pragma once+#include "pipeline.hpp"+namespace ve {+[[nodiscard]] bool renderFsrVideo(const RenderRequest& request,const MediaInfo& input,const Settings& settings,+ const PipelineEstimate& estimate,const QString& destination,JobControl& control,const ProgressCallback& progress);+[[nodiscard]] QString fsrVideoDiagnostics();+}diff --git a/src/processing/fsr_worker.cpp b/src/processing/fsr_worker.cppnew file mode 100644index 0000000..5ad8bfc--- /dev/null+++ b/src/processing/fsr_worker.cpp@@ -0,0 +1,111 @@+#include "fsr_worker.hpp"+#include "fsr_video.hpp"+#include "media/host_video.hpp"+#include "media/video_preview.hpp"+#include "infrastructure/paths.hpp"+#include "infrastructure/log.hpp"+#include "infrastructure/process.hpp"+#include "infrastructure/scratch.hpp"+#include <QCoreApplication>+#include <QElapsedTimer>+#include <QFile>+#include <QFileInfo>+#include <QDir>+#include <QJsonDocument>+#include <QJsonArray>+#include <QSaveFile>+#include <QScopeGuard>+#include <QTemporaryFile>+#include <QTextStream>+#include <mutex>+#include <algorithm>+#include <atomic>+#include <cmath>+#include <limits>+#include <thread>+#include <windows.h>+#include <tlhelp32.h>++namespace ve {+namespace {+std::mutex diagnosticMutex;QString diagnostics;+void send(const QJsonObject& message){QTextStream stream(stdout);stream<<QJsonDocument(message).toJson(QJsonDocument::Compact)<<'\n';stream.flush();}+void save(const QString& path,const QByteArray& bytes){QSaveFile file(path);if(!file.open(QIODevice::WriteOnly)||file.write(bytes)!=bytes.size()||!file.commit())throw std::runtime_error("Cannot save FSR worker request");}+QJsonArray auditModules(bool strict){+ QJsonArray modules;const auto snapshot=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,GetCurrentProcessId());+ if(snapshot==INVALID_HANDLE_VALUE)throw std::runtime_error("Cannot audit FSR worker modules");const auto close=qScopeGuard([&]{CloseHandle(snapshot);});+ MODULEENTRY32W module{};module.dwSize=sizeof(module);if(!Module32FirstW(snapshot,&module))throw std::runtime_error("Cannot enumerate FSR worker modules");+ do{const auto name=QString::fromWCharArray(module.szModule).toLower();+ if(strict&&(name.startsWith("nvcuda")||name.startsWith("cudart")||name.startsWith("cublas")||name.startsWith("nvofapi")||name.startsWith("nvopticalflow")))+ throw std::runtime_error("FSR-only worker loaded an unexpected CUDA or NVIDIA Optical Flow module: "+name.toStdString());+ if(name.contains("fidelityfx")||name.startsWith("avcodec")||name.startsWith("avutil")||name.startsWith("nvencode")||name.contains("amfrt")||name.contains("fsr_frame")||name.startsWith("libvpl")||name.startsWith("libmfx"))modules.append(QString::fromWCharArray(module.szExePath));+ }while(Module32NextW(snapshot,&module));return modules;+}+bool strictAudit(const QStringList& stages){+ for(const auto& stage:stages)if(QStringList{"neural_model","dlss_super_resolution","dlss_ray_reconstruction","super_resolution","rtx_video_hdr","reshade"}.contains(stage)||isVfxStage(stage))return false;+ return true;+}+}+QString fsrWorkerDiagnostics(){std::lock_guard lock(diagnosticMutex);return diagnostics;}+QJsonArray fsrAuditLoadedModules(bool strict){return auditModules(strict);}+RenderResult renderIsolatedFsr(const RenderRequest& request,JobControl& control,const ProgressCallback& progress){+ QElapsedTimer elapsed;elapsed.start();if(QFileInfo::exists(request.output))throw std::runtime_error("Output already exists. Choose a different filename.");+ ProcessingTemporaryDirectory directory(ProcessingCacheKind::Scratch);if(!directory.isValid())throw std::runtime_error("Cannot create FSR worker directory");+ const auto rendered=directory.filePath("processed."+QFileInfo(request.output).suffix()),preset=directory.filePath("preset.json"),file=directory.filePath("job.json");+ if(const auto result=request.settings.exportPreset(preset,"FSR worker");!result)throw std::runtime_error(result.error().toStdString());+ save(file,QJsonDocument(QJsonObject{{"protocol",1},{"input",request.input},{"output",rendered},{"preset",preset},{"workflow",int(request.workflow)},+ {"preview",request.preview},{"start",request.startSeconds},{"seconds",request.seconds},{"temporal_context",request.temporalContextIncluded}}).toJson());+ directory.cacheRoot()->registerFile(file+".state");+ const auto stateError=std::make_shared<std::atomic<bool>>(false);+ const auto writeState=[state=file+".state",error=stateError](bool paused,bool cancelled){try{save(state,cancelled?"C":paused?"P":"R");}catch(...){*error=true;}};+ writeState(control.paused(),control.cancelled());if(*stateError)throw std::runtime_error("Cannot create FSR worker control channel");+ control.setStateChanged(writeState);const auto clear=qScopeGuard([&]{control.setStateChanged({});});QByteArray pending;+ auto executable=qEnvironmentVariable("VE_FSR_WORKER_EXECUTABLE");if(executable.isEmpty())executable=QFileInfo(QCoreApplication::applicationFilePath()).fileName().compare("VE_CLI.exe",Qt::CaseInsensitive)==0?QCoreApplication::applicationFilePath():Paths::instance().at("VE_CLI.exe");+ const auto result=runProcess(executable,{"--internal-fsr-worker",file},&control,0,{},[&](const QByteArray& bytes){+ if(*stateError)throw std::runtime_error("Cannot update FSR worker pause/cancel state");pending+=bytes;+ for(auto end=pending.indexOf('\n');end>=0;end=pending.indexOf('\n')){const auto message=QJsonDocument::fromJson(pending.left(end)).object();pending.remove(0,end+1);+ if(message.value("kind")=="progress"&&progress)progress({std::min(.98,message.value("fraction").toDouble()),message.value("message").toString(),message.value("frames").toInteger(),message.value("total").toInteger(),message.value("fps").toDouble()});+ if(message.value("kind")=="diagnostics"){const auto text=message.value("text").toString();{std::lock_guard lock(diagnosticMutex);diagnostics=text;}info("fsr-worker",text);}+ }+ });+ if(result.exitCode)throw std::runtime_error(result.error.isEmpty()?"FSR worker exited unexpectedly":result.error.toStdString());+ QDir().mkpath(QFileInfo(request.output).absolutePath());QFile source(rendered);QTemporaryFile target(QFileInfo(request.output).absolutePath()+"/.fsr-delivery-XXXXXX");+ if(!source.open(QIODevice::ReadOnly)||!target.open())throw std::runtime_error("Cannot save FSR worker delivery");+ while(!source.atEnd()){control.checkpoint();const auto bytes=source.read(8*1024*1024);if(bytes.isEmpty()&&source.error()!=QFileDevice::NoError)throw std::runtime_error("Cannot read FSR worker delivery");if(target.write(bytes)!=bytes.size())throw std::runtime_error("Cannot write FSR worker delivery");}+ control.checkpoint();target.close();if(!target.rename(request.output))throw std::runtime_error("Cannot commit FSR worker output; destination may already exist");target.setAutoRemove(false);+ auto output=probeMedia(request.output,&control);+ const auto report=QJsonDocument::fromJson(fsrWorkerDiagnostics().toUtf8()).object();if(report.contains("source_time_origin"))output.metadata.insert("ve_source_time_origin",report.value("source_time_origin"));+ if(progress)progress({1,"Video complete",output.frames,output.frames});+ return{request.input,request.output,Log::instance().sessionPath(),output,elapsed.elapsed()/1000.};+}+QImage previewIsolatedFsr(const QString& path,const Settings& settings,const MediaInfo& info,double seconds,JobControl& control){+ ProcessingTemporaryDirectory directory(ProcessingCacheKind::Scratch);if(!directory.isValid())throw std::runtime_error("Cannot create FSR still preview directory");+ const auto stages=settings.stages(true);const auto start=reconstructionContextStart(path,info,seconds,reconstructionHistoryFrames(settings,stages),control,0,false);+ const auto duration=std::max(.25,3./std::max(1.,info.fps));+ RenderRequest request{path,directory.filePath("preview.mkv"),videoPreviewSettings(settings),Workflow::NeuralRendering,true,start,seconds-start+duration};request.temporalContextIncluded=true;+ const auto rendered=renderIsolatedFsr(request,control,{});const auto origin=rendered.info.metadata.value("ve_source_time_origin").toDouble(info.presentationStartSeconds()+start);+ const double target=std::max(0.,info.presentationStartSeconds()+seconds-origin);HostVideoDecoder decoder(rendered.output,rendered.info,0,0,false,control);+ std::optional<TimedImage> selected;double distance=std::numeric_limits<double>::infinity();+ while(auto frame=decoder.read()){control.checkpoint();const auto candidate=std::abs(frame->seconds()-target);if(candidate<distance){distance=candidate;selected=std::move(frame);}else if(frame->seconds()>target)break;}+ if(!selected)throw std::runtime_error("FSR still preview returned no selected frame");return selected->image;+}+int runFsrWorker(const QString& path){+ try{+ ProcessingCacheActivity activity;QFile file(path);if(!file.open(QIODevice::ReadOnly))throw std::runtime_error("Cannot read FSR worker request");+ const auto job=QJsonDocument::fromJson(file.readAll()).object();if(job.value("protocol").toInt()!=1)throw std::runtime_error("Invalid FSR worker protocol");+ WorkerScratchScope scratch(QFileInfo(path).absolutePath());Settings settings;if(const auto imported=settings.importPreset(job.value("preset").toString());!imported)throw std::runtime_error(imported.error().toStdString());+ JobControl control;QElapsedTimer poll;poll.start();control.setExternalCheckpoint([&]{+ if(poll.elapsed()<20)return;const auto started=std::chrono::steady_clock::now();bool paused=false;+ for(;;){QFile state(path+".state");if(!state.open(QIODevice::ReadOnly))throw Cancelled{};const auto value=state.readAll();state.close();if(value=="C")throw Cancelled{};if(value!="P")break;paused=true;std::this_thread::sleep_for(std::chrono::milliseconds(20));}+ if(paused)control.accountExternalPause(std::chrono::steady_clock::now()-started);poll.restart();+ });+ const auto workflow=job.value("workflow").toInt();if(workflow<int(Workflow::NeuralRendering)||workflow>int(Workflow::FrameInterpolation))throw std::runtime_error("Invalid FSR worker workflow");+ RenderRequest request{job.value("input").toString(),job.value("output").toString(),settings,Workflow(workflow),job.value("preview").toBool(),job.value("start").toDouble(),job.value("seconds").toDouble()};+ request.isolatedFsrWorker=true;request.temporalContextIncluded=job.value("temporal_context").toBool();+ const auto active=workflowSettings(settings,request.workflow,true).stages(true);if(!active.contains("fsr_frame_generation"))throw std::runtime_error("Worker request has no FSR Frame Generation stage");+ const auto rendered=Pipeline{}.render(request,control,[](const Progress& p){send({{"kind","progress"},{"fraction",p.fraction},{"message",p.message},{"frames",p.frames},{"total",p.totalFrames},{"fps",p.fps}});});(void)rendered;+ auto report=QJsonDocument::fromJson(fsrVideoDiagnostics().toUtf8()).object();const auto strict=strictAudit(active);report.insert("remaining_modules",auditModules(strict));report.insert("cuda_free_worker",strict);+ send({{"kind","diagnostics"},{"text",QString::fromUtf8(QJsonDocument(report).toJson(QJsonDocument::Compact))}});return 0;+ }catch(const std::exception& error){send({{"kind","diagnostics"},{"text",fsrVideoDiagnostics()}});QTextStream(stderr)<<error.what()<<'\n';return 1;}+}+}diff --git a/src/processing/fsr_worker.hpp b/src/processing/fsr_worker.hppnew file mode 100644index 0000000..5879eb5--- /dev/null+++ b/src/processing/fsr_worker.hpp@@ -0,0 +1,10 @@+#pragma once+#include "pipeline.hpp"+#include <QJsonArray>+namespace ve {+[[nodiscard]] RenderResult renderIsolatedFsr(const RenderRequest& request,JobControl& control,const ProgressCallback& progress);+int runFsrWorker(const QString& path);+[[nodiscard]] QString fsrWorkerDiagnostics();+[[nodiscard]] QJsonArray fsrAuditLoadedModules(bool strict);+[[nodiscard]] QImage previewIsolatedFsr(const QString& path,const Settings& settings,const MediaInfo& info,double seconds,JobControl& control);+}diff --git a/src/processing/interpolation_video.cpp b/src/processing/interpolation_video.cppindex 0df3248..7c4ca65 100644--- a/src/processing/interpolation_video.cpp+++ b/src/processing/interpolation_video.cpp@@ -1,11 +1,14 @@#include "interpolation_video.hpp"#include "neural_video_delivery.hpp"#include "native_engines.hpp"+#include "reshade_native.hpp"#include "vfx_native.hpp"#include "media/av_api.hpp"#include "media/cuda_video.hpp"#include "media/native_rgb.hpp"#include "media/frame_time.hpp"+#include "media/temporal_cadence.hpp"+#include "media/temporal_stream.hpp"#include "media/host_video.hpp"#include "media/video_delivery.hpp"#include "media/frame_batch.hpp"@@ -20,30 +23,17 @@namespace ve {namespace {using Surface = NativeEngines::Interpolation::Surface;-struct TimedSurface { Surface pixels; FrameTime time; int segment = 0; };+using TimedSurface=TemporalSample<Surface>;struct InterpolationStage {std::unique_ptr<NativeEngines::Interpolation> session;std::optional<TimedSurface> previous;int generated = 1;+ std::optional<int> inputSegment;std::vector<TimedSurface> push(NativeEngines::Interpolation::Result result, FrameTime time, int segment) {- if (previous && result.sceneCut) segment = previous->segment + 1;- std::vector<TimedSurface> frames;- if (previous && !result.reset) {- const auto interval = time - previous->time;- int index = 0;- for (auto& surface : result.generated)- frames.push_back({std::move(surface), previous->time + interval.fraction(++index, generated+1), segment});- }- previous = TimedSurface{std::move(result.source), time, segment};- frames.push_back(*previous);- return frames;+ inputSegment=segment;+ return publishTemporalResult(previous,std::move(result),time,segment,generated);}};-TimeBase outputTimeBase(const Settings& settings) {- const auto fps = targetFrameRate(settings.frame_interpolation_target_fps);- return settings.frame_interpolation_target_fps.contains('.') ? TimeBase{1001, int(std::lround(fps*1001))}- : TimeBase{1, int(std::lround(fps))};-}// Own delivery independently of the native feature. Downstream CPU cards use// detached, bounded batches; the GPU encoder retains only its selected surfaces.class InterpolationDelivery {@@ -66,9 +56,12 @@ class InterpolationDelivery {rr_=std::make_unique<NativeEngines::RayReconstruction>(QSize(pixels_.width,pixels_.height),settings_.rr_optical_flow_quality,false,true,nativeMediaTransfer(pixels_.transfer));after.clear();output_.pixelFormat="rgba64le";+ } else if(cudaEncoding_&&!preview_&&after==QStringList{"reshade"}){+ rs_=std::make_unique<ReShadeSession>(QSize(pixels_.width,pixels_.height),settings_,pixels_,false,true,true);+ after.clear();output_.pixelFormat="rgba64le";}if (!after.isEmpty()) {- output_.pixelFormat=after.back()=="dlss_super_resolution" || after.back()=="dlss_ray_reconstruction" || after.back()=="neural_model" ? "rgba64le" : "gbrp10le";+ output_.pixelFormat=after.back()=="dlss_super_resolution" || after.back()=="dlss_ray_reconstruction" || after.back()=="neural_model" || after.back()=="reshade" ? "rgba64le" : "gbrp10le";post_=std::make_unique<FramePipeline>(settings, pixels_, after, !neuralDelivery_);capacity_=videoBatchCapacity({std::max(pixels_.width, output_.width), std::max(pixels_.height, output_.height)});}@@ -93,8 +86,13 @@ class InterpolationDelivery {ensureEncoder();if (gpu_) {const bool reset=!rrSegment_||*rrSegment_!=selected.segment;+ const double frameMs = 1000.0 * base_.numerator / base_.denominator;+ const qint64 durNs = std::max<qint64>(1, qint64(std::llround(frameMs * 1000000.0)));+ const qint64 ptsNs = index * durNs;auto frame=rr_?rr_->process(selected.pixels.toRgb(),*pool_,gpu_->pixelFormat()==VideoPixelFormat::P010,- reset,quint32(index),float(1000.*base_.numerator/base_.denominator)):+ reset,quint32(index),float(frameMs)):+ rs_?rs_->process(selected.pixels.toRgb(),*pool_,gpu_->pixelFormat()==VideoPixelFormat::P010,+ reset,index,ptsNs,durNs):selected.pixels.toVideo(*pool_, gpu_->pixelFormat()==VideoPixelFormat::P010, pixels_.hdr ? 2u : 1u, 0);rrSegment_=selected.segment;frame.pts=index; frame.duration=1; frame.timeBase=base_;@@ -107,7 +105,7 @@ class InterpolationDelivery {} else if (neural_) neural_->write(image,index,1,base_);else host_->write(image,index,1,base_);}- if (progress_) progress_({std::min(.98,double(index+1)/std::max<qint64>(1,expected_)), "Interpolating video", index+1, expected_,+ if (progress_) progress_({std::min(.98,double(index+1)/std::max<qint64>(1,expected_)), QT_TRANSLATE_NOOP("App", "Interpolating video"), index+1, expected_,elapsed_.elapsed()>0 ? (index+1)*1000./elapsed_.elapsed() : 0});}void finish() {@@ -117,6 +115,7 @@ class InterpolationDelivery {else if (neural_) neural_->finish();else host_->finish();if(rr_)ve::info("dlssrr","FG -> RR FP16 RGB device counters: "+rr_->diagnostics());+ if(rs_)ve::info("reshade","FG -> ReShade FP16 RGB device counters: "+rs_->diagnostics());}private:void ensureEncoder() {@@ -158,6 +157,7 @@ class InterpolationDelivery {std::vector<qint64> indices_;std::unique_ptr<FramePipeline> post_;std::unique_ptr<NativeEngines::RayReconstruction> rr_;+ std::unique_ptr<ReShadeSession> rs_;std::optional<int> rrSegment_;std::unique_ptr<CudaFramePool> pool_;std::unique_ptr<HostVideoEncoder> host_;@@ -169,14 +169,18 @@ bool renderInterpolationVideo(const RenderRequest& request, const MediaInfo& inpconst PipelineEstimate& estimate, const QString& destination, JobControl& control, const ProgressCallback& progress) {const bool rrBefore=estimate.stages==QStringList{"dlss_ray_reconstruction","frame_generation"};const bool rrAfter=estimate.stages==QStringList{"frame_generation","dlss_ray_reconstruction"};+ const bool rsBefore=estimate.stages==QStringList{"reshade","frame_generation"};+ const bool rsAfter=estimate.stages==QStringList{"frame_generation","reshade"};const bool rrCombined=rrBefore||rrAfter;- if (estimate.stages.isEmpty() || (!rrBefore&&estimate.stages.front() != "frame_generation") || input.width%2 || input.height%2)+ const bool rsCombined=rsBefore||rsAfter;+ const bool rgbCombined=rrCombined||rsCombined;+ if (estimate.stages.isEmpty() || (!rrBefore&&!rsBefore&&estimate.stages.front() != "frame_generation") || input.width%2 || input.height%2)return false;auto settings=configured;if (request.preview) { settings.codec="FFV1 Lossless RGB 10-bit"; settings.container="MKV"; }const bool cudaEncoding = settings.codec.contains("NVIDIA NVENC") ||(settings.ffmpeg_device != "cpu" && QStringList{"H.264", "H.265", "AV1"}.contains(settings.codec));- if(rrCombined&&(request.preview||!cudaEncoding||+ if(rgbCombined&&(request.preview||!cudaEncoding||(input.hdr?input.primaries!="bt2020"||input.colorSpace!="bt2020nc"||!QStringList{"smpte2084","arib-std-b67"}.contains(input.transfer):input.primaries!="bt709"||input.colorSpace!="bt709"||@@ -186,8 +190,8 @@ bool renderInterpolationVideo(const RenderRequest& request, const MediaInfo& inpconst auto selected = std::ranges::find_if(devices, [ordinal](const Gpu& gpu) { return gpu.index == ordinal; });if (selected == devices.end() || (settings.video_gpu_uuid != "auto" && settings.video_gpu_uuid != selected->uuid)) return false;if (input.hdr && !settings.hdr_mode) throw std::runtime_error("HDR input requires Frame Interpolation HDR Mode with a 10-bit codec.");- const auto base = outputTimeBase(settings);- const auto fps = targetFrameRate(settings.frame_interpolation_target_fps);+ const auto base = frameGenerationTimeBase(input.fps, settings);+ const auto fps = frameGenerationFrameRate(input.fps, settings);const auto sourceRate = av::Api::get().av_d2q(input.fps, 1000000);const double sourceDuration = !input.variableFrameRate && input.frames > 0 ? input.frames/input.fps : input.duration;const double duration = request.seconds > 0 ? std::min(request.seconds, sourceDuration-request.startSeconds)@@ -198,8 +202,8 @@ bool renderInterpolationVideo(const RenderRequest& request, const MediaInfo& inpScratchDirectory directory(QStringLiteral("interpolation-XXXXXX"));if (!directory.isValid()) throw std::runtime_error("Cannot create the interpolation directory.");auto info = input; info.fps = fps; info.pixelFormat = info.hdr ? "gbrp10le" : "rgba";- if(rrBefore){info.width=estimate.width;info.height=estimate.height;}- if(rrCombined)info.pixelFormat="rgba64le";+ if(rrBefore||rsBefore){info.width=estimate.width;info.height=estimate.height;}+ if(rgbCombined)info.pixelFormat="rgba64le";info.colorSpace="gbr"; info.range="pc";const auto video = directory.filePath(settings.codec.startsWith("ProRes") ? "video.mov" : request.preview ? "video.mkv" : "video.nut");QElapsedTimer elapsed; elapsed.start();@@ -212,25 +216,26 @@ bool renderInterpolationVideo(const RenderRequest& request, const MediaInfo& inpif (!frame) throw std::runtime_error("The source contains no decodable video frames.");sourceTimeOrigin=decoder->timeOrigin();NativeEngines::instance().prepare(ordinal, rrCombined?estimate.stages:QStringList{"frame_generation"});+ if (rsCombined) ReShadeEngine::initialize(ordinal);std::unique_ptr<NativeEngines::RayReconstruction> rrSource;+ std::unique_ptr<ReShadeSession> rsSource;if(rrBefore)rrSource=std::make_unique<NativeEngines::RayReconstruction>(QSize(input.width,input.height),settings.rr_optical_flow_quality,false,true,nativeMediaTransfer(input.transfer));+ if(rsBefore)rsSource=std::make_unique<ReShadeSession>(QSize(input.width,input.height),+ settings,input,false,true,true);const auto maximum = NativeEngines::Interpolation::nativeMaximum();const bool native = !input.variableFrameRate && std::abs(ratio-multiple)<1e-7 && multiple>=2 && multiple<=maximum;- if (fps>input.fps && settings.frame_interpolation_engine == "Native DLSSG" && !native)- throw std::runtime_error("Target FPS is outside the native DLSSG grid. Choose Auto or Cascade.");- const int levels = fps <= input.fps ? 0 : native && settings.frame_interpolation_engine != "Cascade" ? 1- : std::abs(ratio-2)<1e-7 ? 1 : std::abs(ratio-4)<1e-7 ? 2- : !input.variableFrameRate && std::abs(ratio-2.5)<1e-7 ? 4 : 3;- const int generated = native && settings.frame_interpolation_engine != "Cascade" ? multiple-1 : 1;+ const int levels = fps <= input.fps ? 0 : native ? 1+ : midpointCascadeDepth({sourceRate.den,sourceRate.num},base,input.variableFrameRate);+ const int generated = native ? multiple-1 : 1;std::vector<InterpolationStage> stages;for (int level=0; level<levels; ++level) stages.push_back({std::make_unique<NativeEngines::Interpolation>(QSize(info.width, info.height), generated, info.hdr, settings.frame_interpolation_optical_flow_quality,- rrCombined, level == levels-1 ? 64 : 0), {}, generated});+ rgbCombined, level == levels-1 ? 64 : 0), {}, generated});// Source resampling still needs the native RGB conversion, but generates no frames.if (stages.empty()) stages.push_back({std::make_unique<NativeEngines::Interpolation>(- QSize(info.width, info.height), 1, info.hdr, settings.frame_interpolation_optical_flow_quality, rrCombined, 64), {}, 0});- auto deliveryEstimate=estimate;if(rrBefore)deliveryEstimate.stages={"frame_generation"};+ QSize(info.width, info.height), 1, info.hdr, settings.frame_interpolation_optical_flow_quality, rgbCombined, 64), {}, 0});+ auto deliveryEstimate=estimate;if(rrBefore||rsBefore)deliveryEstimate.stages={"frame_generation"};InterpolationDelivery delivery(video, settings, info, deliveryEstimate, decoder->device(), cudaEncoding, ordinal, base, count, control, progress, request.preview);auto writeSelected = [&](const TimedSurface& selected, qint64 index) {delivery.write(selected,index);@@ -248,7 +253,7 @@ bool renderInterpolationVideo(const RenderRequest& request, const MediaInfo& inpif (level == stages.size()) { writer.push(std::move(item)); return; }auto& stage = stages[level];auto result = stage.session->evaluate(item.pixels,- stage.previous && item.segment != stage.previous->segment, false);+ stage.inputSegment && item.segment != *stage.inputSegment, false);auto produced = stage.push(std::move(result), item.time, item.segment);for (auto& output : produced) self(self, level+1, std::move(output));};@@ -264,6 +269,9 @@ bool renderInterpolationVideo(const RenderRequest& request, const MediaInfo& inpconst auto interval=lastTime?(time-*lastTime).seconds():nominal.seconds();auto rgb=rrSource->processRgb(*frame,!decoded||discontinuity,quint32(decoded),float(std::clamp(interval*1000.,.01,1000.)));result=stages.front().session->evaluate(rgb,discontinuity,true);+ }else if(rsSource){+ auto rgb=rsSource->processRgb(*frame,!decoded||discontinuity,decoded);+ result=stages.front().session->evaluate(rgb,discontinuity,true);}else result=stages.front().session->evaluate(*frame,input,discontinuity,true);if (levels == 0) result.generated.clear();auto items = stages.front().push(std::move(result), time, segment);@@ -277,6 +285,7 @@ bool renderInterpolationVideo(const RenderRequest& request, const MediaInfo& inpwriter.finish(qint64(std::ceil(actualDuration*fps-1e-9)));delivery.finish();if(rrSource)ve::info("dlssrr","RR -> FG FP16 RGB device counters: "+rrSource->diagnostics());+ if(rsSource)ve::info("reshade","ReShade -> FG FP16 RGB device counters: "+rsSource->diagnostics());ve::info("video", "Interpolation streamed through temporal stages directly to the selected encoder.");} catch (const CudaUnavailable& error) {if (decoded) throw;diff --git a/src/processing/pipeline.cpp b/src/processing/pipeline.cppindex 6668e25..fcfc6ef 100644--- a/src/processing/pipeline.cpp+++ b/src/processing/pipeline.cpp@@ -8,6 +8,8 @@#include "media/frame_batch.hpp"#include "media/resolution.hpp"#include "media/frame_time.hpp"+#include "media/temporal_cadence.hpp"+#include "media/temporal_stream.hpp"#include "media/av_api.hpp"#include "media/native_frame.hpp"#include "media/cuda_video.hpp"@@ -16,6 +18,8 @@#include "media/host_video.hpp"#include "media/video_delivery.hpp"#include "interpolation_video.hpp"+#include "fsr_video.hpp"+#include "fsr_worker.hpp"#include "media/image_metadata.hpp"#include "media/image_alpha.hpp"#include "media/packet_stream.hpp"@@ -24,6 +28,9 @@#include "neural_video_delivery.hpp"#include "temporal_guide.hpp"#include "preview_cache.hpp"+#include "reshade_native.hpp"+#include "reshade_video.hpp"+#include "reshade_worker.hpp"#include "vfx_native.hpp"#include "vfx_worker.hpp"#include <QCoreApplication>@@ -269,24 +276,16 @@ QImage pqFromScRgb(const QImage& input) {}struct InterpolationGrid {using Surface=NativeEngines::Interpolation::Surface;- struct Frame { Surface pixels; FrameTime time; int segment=0; };- struct Output { QImage pixels; Surface surface; FrameTime time; };+ using Frame=TemporalSample<Surface>;+ struct Output { QImage pixels; Surface surface; FrameTime time;int segment=0; };struct Stage {std::unique_ptr<NativeEngines::Interpolation> session;std::optional<Frame> previous;int generated=1;+ std::optional<int> inputSegment;std::vector<Frame> push(NativeEngines::Interpolation::Result result, FrameTime time, int segment) {- if (previous && result.sceneCut) segment=previous->segment+1;- std::vector<Frame> frames;- if (previous && !result.reset) {- const auto interval=time-previous->time;- int index=0;- for (auto& surface : result.generated)- frames.push_back({std::move(surface),previous->time+interval.fraction(++index,generated+1),segment});- }- previous=Frame{std::move(result.source),time,segment};- frames.push_back(*previous);- return frames;+ inputSegment=segment;+ return publishTemporalResult(previous,std::move(result),time,segment,generated);}};std::vector<Stage> stages;@@ -319,16 +318,12 @@ struct InterpolationGrid {const int integer = int(std::lround(ratio));const bool exact = !source.variableFrameRate && std::abs(ratio - integer) < 1e-7 && integer >= 2 &&integer <= nativeMax;- if (settings.frame_interpolation_engine == "Native DLSSG" && !exact)- throw std::runtime_error("Target FPS is outside the native DLSSG grid. Choose Auto or Cascade.");- if (exact && settings.frame_interpolation_engine != "Cascade") {+ if (exact) {stages.push_back({std::make_unique<NativeEngines::Interpolation>(size, integer-1, source.hdr,settings.frame_interpolation_optical_flow_quality,highPrecision,64),{},integer-1});} else {- const int levels = std::abs(ratio - 2) < 1e-7 ? 1- : std::abs(ratio - 4) < 1e-7 ? 2- : !source.variableFrameRate && std::abs(ratio - 2.5) < 1e-7 ? 4- : 3;+ const auto outputRate=av::Api::get().av_d2q(target,1000000);+ const int levels=midpointCascadeDepth({rate.den,rate.num},{outputRate.den,outputRate.num},source.variableFrameRate);for (int level = 0; level < levels; ++level)stages.push_back({std::make_unique<NativeEngines::Interpolation>(size,1,source.hdr,settings.frame_interpolation_optical_flow_quality,highPrecision,level==levels-1 ? 64 : 0),{},1});@@ -340,9 +335,9 @@ struct InterpolationGrid {auto converted=hdrInput->processP010(pixels,control,rgb10);for (auto& frame : converted) preparedHdr.push_back(std::move(frame));}- std::vector<Output> push(const QImage& pixels, FrameTime time, JobControl& control) {+ template<class Deliver> void push(const QImage& pixels, FrameTime time, JobControl& control,Deliver&& deliver) {const auto input=rgbBoundary ? highPrecision?decodedRgb10Rgba(pixels):rgbBoundary->decodeRgba8(pixels,control) : pixels;- if (stages.empty()) return {{input.convertToFormat(hdr||highPrecision ? QImage::Format_RGBA64 : QImage::Format_RGBA8888),{},time}};+ if (stages.empty()){deliver(Output{input.convertToFormat(hdr||highPrecision ? QImage::Format_RGBA64 : QImage::Format_RGBA8888),{},time});return;}auto& first=stages.front();int segment=first.previous ? first.previous->segment : 0;if (first.previous && (time<=first.previous->time || time-first.previous->time>nominal.fraction(2,1))) ++segment;@@ -351,23 +346,15 @@ struct InterpolationGrid {auto result=hdrInput ? first.session->evaluate(preparedHdr.front(),hdrColors,reset,true): first.session->evaluate(input,reset,true,mediaTransfer);if (hdrInput) preparedHdr.pop_front();- auto frames=first.push(std::move(result),time,segment);- for (size_t level=1; level<stages.size(); ++level) {- auto& stage=stages[level];- std::vector<Frame> expanded;- for (auto& frame : frames) {- control.checkpoint();- auto produced=stage.push(stage.session->evaluate(frame.pixels,- stage.previous && frame.segment!=stage.previous->segment,false),frame.time,frame.segment);- expanded.insert(expanded.end(),std::make_move_iterator(produced.begin()),std::make_move_iterator(produced.end()));- }- frames=std::move(expanded);- }- std::vector<Output> output;- // Retain surfaces until cadence selection. Only the selected frames- // cross a host boundary when a downstream stage needs CPU pixels.- for (auto& frame : frames) output.push_back({{},std::move(frame.pixels),frame.time});- return output;+ const auto feed=[&](auto&& self,size_t level,Frame frame)->void{+ control.checkpoint();if(level==stages.size()){deliver(Output{{},std::move(frame.pixels),frame.time,frame.segment});return;}+ auto& stage=stages[level];auto produced=stage.push(stage.session->evaluate(frame.pixels,+ stage.inputSegment&&frame.segment!=*stage.inputSegment,false),frame.time,frame.segment);+ for(auto& item:produced)self(self,level+1,std::move(item));+ };+ // Stream each result through all levels before requesting another one.+ // High multipliers never accumulate a whole expanded source interval.+ for(auto& frame:first.push(std::move(result),time,segment))feed(feed,1,std::move(frame));}};} // namespace@@ -411,7 +398,7 @@ Settings workflowSettings(Settings s, Workflow workflow, bool video) {if (workflow == Workflow::NeuralRendering)return s;if (workflow == Workflow::FrameInterpolation) {- s.video_enabled_stages = {"frame_generation"};+ s.video_enabled_stages = {s.frame_interpolation_provider=="FSR 3"?"fsr_frame_generation":"frame_generation"};s.codec = s.frame_interpolation_codec;s.container = s.frame_interpolation_container;s.quality = s.frame_interpolation_quality;@@ -459,78 +446,84 @@ PipelineEstimate estimatePipeline(const MediaInfo& info, const Settings& raw, Wothrow std::runtime_error(valid.error().toStdString());const auto settings = workflowSettings(raw, workflow, info.video);PipelineEstimate result{info.width, info.height, info.fps, info.hdr, settings.stages(info.video)};- if(result.stages.contains("vfx_frame_generation")&&result.stages.contains("frame_generation"))- throw std::runtime_error("Use one frame-generation engine per workflow. Disable DLSS Frame Generation or VFX Video Frame Generation.");+ if(int(result.stages.contains("vfx_frame_generation"))+int(result.stages.contains("frame_generation"))+int(result.stages.contains("fsr_frame_generation"))>1)+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "Use one frame-generation engine per workflow. Select DLSS, AMD FSR or VFX Frame Generation."));for (const auto& stage : result.stages) {QSize size(result.width, result.height);if (stage == "neural_model" || stage == "frame_generation")requireResolution(size, stage == "neural_model" ? "DLSS Neural Rendering texture" : "DLSS Frame Generation texture",maximumDlssTextureDimension);if (stage == "neural_model" && std::min(size.width(), size.height()) < 64)- throw std::runtime_error("DLSS Neural Rendering requires at least 64 by 64 input.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "DLSS Neural Rendering requires at least 64 by 64 input."));else if (stage == "scale_method") {if (info.video && result.hdr)- throw std::runtime_error(- "Scaling cannot process HDR video at this position. Move it before HDR conversion.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "Scaling cannot process HDR video at this position. Move it before HDR conversion."));size = {even(size.width() * settings.upscaling_factor),even(size.height() * settings.upscaling_factor)};if (std::min(size.width(), size.height()) < 64)- throw std::runtime_error("The requested output is below the supported 64 by 64 minimum.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "The requested output is below the supported 64 by 64 minimum."));} else if (stage == "dlss_super_resolution") {if (info.video && result.hdr)- throw std::runtime_error("DLSS Super Resolution cannot process HDR video at this position. "- "Move it before HDR conversion.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "DLSS Super Resolution cannot process HDR video at this position. "+ "Move it before HDR conversion."));size = dlssOutputSize(size, info.video ? settings.upscale_dlss_mode : settings.upscale_image_dlss_mode, info.video);} else if (stage == "dlss_ray_reconstruction") {if(info.video && result.hdr && !QStringList{"smpte2084","arib-std-b67"}.contains(info.transfer) && !result.stages.contains("rtx_video_hdr"))- throw std::runtime_error("Ray Reconstruction requires explicit PQ or HLG signaling for HDR video.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "Ray Reconstruction requires explicit PQ or HLG signaling for HDR video."));} else if (stage == "super_resolution") {if (info.video && result.hdr)- throw std::runtime_error("RTX Super Resolution cannot process HDR video at this position. "- "Move it before HDR conversion.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "RTX Super Resolution cannot process HDR video at this position. "+ "Move it before HDR conversion."));size = rtxOutputSize(size, settings, info.video);} else if(isVfxStage(stage)){- if(!info.video)throw std::runtime_error("NVIDIA Video Effects is video-only.");+ if(!info.video)throw std::runtime_error(QT_TRANSLATE_NOOP("App", "NVIDIA Video Effects is video-only."));(void)vfxSubtitleArguments(info,settings);const auto selected=vfxSettingsForStages(settings,{stage});if(!selected.vfx_vsr_enabled&&!selected.vfx_upscale_enabled&&!selected.vfx_frame_generation_enabled)- throw std::runtime_error("The legacy NVIDIA VFX preset has no enabled effect.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "The legacy NVIDIA VFX preset has no enabled effect."));if(result.hdr&&selected.vfx_upscale_enabled)- throw std::runtime_error("This video effect requires SDR at this position. Move its card before HDR conversion.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "This video effect requires SDR at this position. Move its card before HDR conversion."));size=vfxSpatialSize(size,selected);result.fps=vfxFrameRate(result.fps,selected);} else if (stage == "rtx_video_hdr") {if (result.hdr)- throw std::runtime_error("RTX Video HDR requires SDR at this position.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "RTX Video HDR requires SDR at this position."));result.hdr = true;- } else if (stage == "frame_generation") {- const auto target = targetFrameRate(settings.frame_interpolation_target_fps);+ } else if (stage == "frame_generation"||stage=="fsr_frame_generation") {+ if(stage=="fsr_frame_generation"&&std::min(size.width(),size.height())<64)throw std::runtime_error(QT_TRANSLATE_NOOP("App", "FSR Frame Generation requires at least 64 by 64 pixels."));+ if(stage=="fsr_frame_generation"&&std::max(size.width(),size.height())>16384)throw std::runtime_error(QT_TRANSLATE_NOOP("App", "FSR Frame Generation supports up to 16384 pixels per side."));+ const auto target = frameGenerationFrameRate(result.fps, settings, stage == "fsr_frame_generation");if (!info.video || result.fps <= 0 ||(workflow == Workflow::NeuralRendering && target <= result.fps))- throw std::runtime_error("Frame Generation target FPS must exceed the frame rate entering "- "this card. Choose a higher target FPS.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "Frame Generation target FPS must exceed the frame rate entering "+ "this card. Choose a higher target FPS."));result.fps = target;} else if (stage == "cas_sharpening" && result.hdr && settings.cas_sharpness > 0)- throw std::runtime_error(- "Sharpening requires SDR video at this position. Move it before HDR conversion.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "Sharpening requires SDR video at this position. Move it before HDR conversion."));else if (stage == "coloring") {if (!settings.lut_path.isEmpty() && !QFileInfo(settings.lut_path).isFile())- throw std::runtime_error("The selected .cube LUT is unavailable.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "The selected .cube LUT is unavailable."));+ } else if (stage == "reshade") {+ const auto rs = reshadeSettingsForMode(settings, info.video);+ if (!rs.reshade_preset_path.trimmed().isEmpty() && !QFileInfo(rs.reshade_preset_path.trimmed()).isFile())+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "The selected ReShade .ini preset is unavailable."));+ if (std::min(size.width(), size.height()) < 16)+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "ReShade requires at least 16 by 16 input."));}requireResolution(size, "Processing stage output");result.width = size.width();result.height = size.height();}if (info.video && !containersForCodec(settings.codec).contains(settings.container))- throw std::runtime_error("The selected codec does not support this container.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "The selected codec does not support this container."));if (!info.video && settings.image_format == "WebP")requireResolution({result.width, result.height}, "WebP format", 16383);if (info.video && (result.width % 2 || result.height % 2) && !settings.codec.startsWith("FFV1"))- throw std::runtime_error("Video export requires even output dimensions.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "Video export requires even output dimensions."));if (info.video && result.hdr && !settings.hdr_mode)- throw std::runtime_error("HDR output requires 10-bit HDR Mode in Export Settings.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "HDR output requires 10-bit HDR Mode in Export Settings."));if (info.video && result.hdr && !hdrSupported(settings.codec))- throw std::runtime_error("HDR requires a 10-bit or higher video codec.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "HDR requires a 10-bit or higher video codec."));return result;}QString renderOutputPath(const QString& input, const QString& directory, const Settings& raw,@@ -544,7 +537,7 @@ QString renderOutputPath(const QString& input, const QString& directory, const Sif (rename == "Custom") {static const QRegularExpression invalid("[<>:\"/\\\\|?*\\x00-\\x1f]");if (suffix.isEmpty() || suffix.contains(invalid) || suffix.endsWith(' ') || suffix.endsWith('.'))- throw std::runtime_error("Custom suffix is empty or contains invalid filename characters.");+ throw std::runtime_error(QT_TRANSLATE_NOOP("App", "Custom suffix is empty or contains invalid filename characters."));stem += suffix;} else if (rename == "Auto")stem += '_' +@@ -585,6 +578,7 @@ struct FramePipeline::Impl {std::vector<std::unique_ptr<NativeEngines::RayReconstruction>> rr;std::vector<std::unique_ptr<NativeEngines::RtxVideo>> rtx;std::vector<std::unique_ptr<VideoEffects>> vfx;+ std::vector<std::unique_ptr<ReShadeSession>> reshade;std::vector<TemporalGuide> guides;std::vector<std::unique_ptr<VideoFilterStage>> filters;std::unique_ptr<HostRgb10Boundary> rgbBoundary;@@ -599,6 +593,7 @@ struct FramePipeline::Impl {rr.resize(size_t(stages.size()));rtx.resize(size_t(stages.size()));vfx.resize(size_t(stages.size()));+ reshade.resize(size_t(stages.size()));guides.resize(size_t(stages.size()));filters.resize(size_t(stages.size()));}@@ -613,11 +608,11 @@ void FramePipeline::configurePreviewCache(PreviewFrameCache& cache, QByteArray iimpl_->finalOutput,Paths::instance().root);}void FramePipeline::reuseResetPreviewResources() { impl_->resetPreviewReuse=true; }-QImage FramePipeline::process(const QImage& input, JobControl& control, qint64 frame, bool reset, float frameTimeMs) {- return processBatch({&input, 1}, control, frame, reset, frameTimeMs).front();+QImage FramePipeline::process(const QImage& input, JobControl& control, qint64 frame, bool reset, float frameTimeMs, double presentationSeconds) {+ return processBatch({&input, 1}, control, frame, reset, frameTimeMs, presentationSeconds).front();}std::vector<QImage> FramePipeline::processBatch(std::span<const QImage> input, JobControl& control,- qint64 firstFrame, bool reset, float frameTimeMs) {+ qint64 firstFrame, bool reset, float frameTimeMs, double presentationSeconds) {ProcessingCacheActivity cacheActivity;std::vector<QImage> images{input.begin(), input.end()};if (images.empty())@@ -698,7 +693,7 @@ std::vector<QImage> FramePipeline::processBatch(std::span<const QImage> input, Jfor (size_t frame = 0; frame < images.size(); ++frame) {control.checkpoint();auto& image = images[frame];- if (workingInfo.video && rgb10 && (stage == "neural_model" || stage == "dlss_super_resolution" || stage == "dlss_ray_reconstruction"))+ if (workingInfo.video && rgb10 && (stage == "neural_model" || stage == "dlss_super_resolution" || stage == "dlss_ray_reconstruction" || stage == "reshade"))image = decodedRgb10Rgba(image);const bool resetFrame = reset && frame == 0;if (stage == "neural_model") {@@ -775,6 +770,31 @@ std::vector<QImage> FramePipeline::processBatch(std::span<const QImage> input, J// A 16-bit source needs the separate mask to retain its depth.if (!workingInfo.video && alphaSource.depth()>32)restoreImageAlpha(image, alphaSource,control);+ } else if (stage == "reshade") {+ auto& session = state.reshade[size_t(index)];+ auto rsColors = workingInfo;+ if (hdr && !workingInfo.hdr) {+ rsColors.hdr = true;+ rsColors.primaries = "bt2020";+ rsColors.transfer = "smpte2084";+ }+ const bool wideOut = !workingInfo.video+ ? (s.image_bit_depth == 16 || index + 1 < state.stages.size() || !state.finalOutput)+ : true;+ const auto rsSettings = reshadeSettingsForMode(s, workingInfo.video);+ if (!session) {+ session = std::make_unique<ReShadeSession>(+ image.size(), s, rsColors, !workingInfo.video, wideOut,+ rsSettings.reshade_preserve_alpha);+ }+ const double deltaMs = frameTimeMs > 0 ? double(frameTimeMs)+ : (workingInfo.fps > 0 ? 1000.0 / workingInfo.fps : 33.333333);+ const qint64 durNs = std::max<qint64>(1, qint64(std::llround(deltaMs * 1000000.0)));+ const qint64 ord = std::max<qint64>(0, firstFrame + qint64(frame));+ const qint64 ptsNs = presentationSeconds >= 0 && std::isfinite(presentationSeconds)+ ? qint64(std::llround(presentationSeconds * 1000000000.0)) + qint64(frame) * durNs+ : ord * durNs;+ image = session->process(image, resetFrame, ord, ptsNs, durNs);} else if (stage == "coloring") {image = colorImage(image, s, control);}@@ -787,7 +807,7 @@ std::vector<QImage> FramePipeline::processBatch(std::span<const QImage> input, Jif (!state.rgbBoundary) state.rgbBoundary = std::make_unique<HostRgb10Boundary>();for (auto& image : images) image = state.rgbBoundary->convert(image, control);rgb10 = true;- } else if (stage == "neural_model" || stage == "dlss_super_resolution" || stage == "dlss_ray_reconstruction") rgb10 = false;+ } else if (stage == "neural_model" || stage == "dlss_super_resolution" || stage == "dlss_ray_reconstruction" || stage == "reshade") rgb10 = false;remember();}if (!workingInfo.video)@@ -823,11 +843,11 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,auto settings = workflowSettings(requestedSettings, request.workflow, input.video);const auto estimate = estimatePipeline(input, requestedSettings, request.workflow);if(request.preview&&input.video&&request.startSeconds>0&&!request.temporalContextIncluded&&- estimate.stages.contains("dlss_ray_reconstruction")) {+ (estimate.stages.contains("dlss_ray_reconstruction")||estimate.stages.contains("fsr_frame_generation"))) {ScratchDirectory context(QStringLiteral("rr-preview-context-XXXXXX"));if(!context.isValid())throw std::runtime_error("Cannot create Ray Reconstruction preview history.");const double start=reconstructionContextStart(request.input,input,request.startSeconds,- reconstructionHistoryFrames(settings,estimate.stages),control,gpuOrdinal(settings.ai_gpu_uuid),settings.ffmpeg_device=="auto");+ reconstructionHistoryFrames(settings,estimate.stages),control,estimate.stages.contains("fsr_frame_generation")?0:gpuOrdinal(settings.ai_gpu_uuid),!estimate.stages.contains("fsr_frame_generation")&&settings.ffmpeg_device=="auto");const double prefix=request.startSeconds-start;auto warmed=request;warmed.output=context.filePath("warmed.mkv");warmed.startSeconds=start;warmed.seconds=request.seconds>0?prefix+request.seconds:0;warmed.temporalContextIncluded=true;@@ -843,17 +863,24 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,if(trimmed.exitCode)throw std::runtime_error(trimmed.error.toStdString());control.checkpoint();output.commit();auto outputInfo=probeMedia(request.output,&control);- info("dlssrr",QString("Preview discarded %1 s of bounded RR context (maximum 32 source frames).").arg(discard,0,'g',12));+ info("temporal",QString("Preview discarded %1 s of temporal context (%2 source-frame history).").arg(discard,0,'g',12).arg(reconstructionHistoryFrames(settings,estimate.stages)));return {request.input,request.output,Log::instance().sessionPath(),outputInfo,activeElapsed()/1000.};}- if(input.video&&hasVfxStages(estimate.stages)&&!request.isolatedVfxWorker)return renderIsolatedVfx(request,control,progress);+ if(input.video&&estimate.stages.contains("fsr_frame_generation")&&!request.isolatedFsrWorker)return renderIsolatedFsr(request,control,progress);+ if(input.video&&hasVfxStages(estimate.stages)&&!request.isolatedVfxWorker&&!request.isolatedFsrWorker)return renderIsolatedVfx(request,control,progress);OutputTransaction output(request.output);- if (input.video && (renderVfxVideo(request,input,settings,estimate,output.path(),control,progress) ||+ if (input.video && (renderFsrVideo(request,input,settings,estimate,output.path(),control,progress) ||+ renderVfxVideo(request,input,settings,estimate,output.path(),control,progress) ||+ renderReShadeVideo(request,input,settings,estimate,output.path(),control,progress) ||renderRayReconstructionVideo(request,input,settings,estimate,output.path(),control,progress) ||renderCudaVideo(request, input, settings, estimate, output.path(), control, progress) ||renderInterpolationVideo(request, input, settings, estimate, output.path(), control, progress))) {output.commit();- const auto result = probeMedia(request.output, &control);+ auto result = probeMedia(request.output, &control);+ if(estimate.stages.contains("fsr_frame_generation")){+ const auto diagnostics=QJsonDocument::fromJson(fsrVideoDiagnostics().toUtf8()).object();+ if(diagnostics.contains("source_time_origin"))result.metadata.insert("ve_source_time_origin",diagnostics.value("source_time_origin"));+ }report(1, QT_TRANSLATE_NOOP("App", "Video complete"), result.frames, result.frames);info("render", request.input + " -> " + request.output);return {request.input, request.output, Log::instance().sessionPath(), result, activeElapsed() / 1000.};@@ -862,6 +889,8 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,estimate.stages.contains("super_resolution") || estimate.stages.contains("frame_generation") ||estimate.stages.contains("rtx_video_hdr"))NativeEngines::instance().prepare(gpuOrdinal(settings.ai_gpu_uuid), estimate.stages);+ if (estimate.stages.contains("reshade"))+ ReShadeEngine::initialize(gpuOrdinal(settings.ai_gpu_uuid));if (!input.video) {report(.05, QT_TRANSLATE_NOOP("App", "Decoding image"));const auto source = request.stillSources ? decodeStillPreviewSource(request.input, *request.stillSources, control).pixels@@ -892,10 +921,11 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,intermediate.hdr = beforeEstimate.hdr;if(before.contains("rtx_video_hdr")){intermediate.primaries="bt2020";intermediate.transfer="smpte2084";}const bool rrInterpolationPrecision=fiPosition>=0&&- ((!before.isEmpty()&&before.back()=="dlss_ray_reconstruction")||(!after.isEmpty()&&after.front()=="dlss_ray_reconstruction"));+ ((!before.isEmpty()&&(before.back()=="dlss_ray_reconstruction"||before.back()=="reshade"))||+ (!after.isEmpty()&&(after.front()=="dlss_ray_reconstruction"||after.front()=="reshade")));const double sourceFps = input.fps > 0 ? input.fps : 30.,targetFps =- fiPosition < 0 ? sourceFps : targetFrameRate(settings.frame_interpolation_target_fps);+ fiPosition < 0 ? sourceFps : frameGenerationFrameRate(sourceFps, settings);const double duration =request.seconds > 0 ? std::min(request.seconds, std::max(0., input.duration - request.startSeconds)): std::max(0., input.duration - request.startSeconds);@@ -903,13 +933,13 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,double actualDuration = 0;const bool nativeStages = std::ranges::any_of(estimate.stages, [](const QString& stage) {return QStringList{"neural_model", "dlss_super_resolution", "dlss_ray_reconstruction", "super_resolution", "rtx_video_hdr",- "frame_generation"}.contains(stage);+ "frame_generation", "reshade"}.contains(stage);});const auto codec = request.preview ? QString("FFV1 Lossless RGB 10-bit"): nativeStages ? nativeDeliveryCodec(settings) : settings.codec;const bool nativeNeuralDelivery = estimate.stages.size() > 1 && estimate.stages.back() == "neural_model" &&codec.contains("NVIDIA NVENC") && gpuOrdinal(settings.video_gpu_uuid) == gpuOrdinal(settings.ai_gpu_uuid);- const bool dlssMedia = before.contains("dlss_super_resolution")||before.contains("dlss_ray_reconstruction");+ const bool dlssMedia = before.contains("dlss_super_resolution")||before.contains("dlss_ray_reconstruction")||before.contains("reshade");const bool nativeDecoder = dlssMedia || !before.isEmpty() && QStringList{"neural_model", "super_resolution", "rtx_video_hdr"}.contains(before.front())|| (before.isEmpty() && fiPosition == 0);const bool sourceWide = input.precisionBits() > 8;@@ -1044,24 +1074,22 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,encodedInfo.primaries = primaries; encodedInfo.transfer = transfer;if(hasVfxStages(estimate.stages))retainVfxPixelAspect(encodedInfo,input);if (!estimate.stages.isEmpty() && estimate.stages.back() != "neural_model" && estimate.stages.back() != "frame_generation"- && estimate.stages.back() != "dlss_super_resolution" && estimate.stages.back() != "dlss_ray_reconstruction")+ && estimate.stages.back() != "dlss_super_resolution" && estimate.stages.back() != "dlss_ray_reconstruction"+ && estimate.stages.back() != "reshade")encodedInfo.pixelFormat = "gbrp10le";else if (encodedInfo.pixelFormat == "gbrp10le" && !estimate.stages.isEmpty() &&- QStringList{"neural_model","dlss_super_resolution","dlss_ray_reconstruction"}.contains(estimate.stages.back()))+ QStringList{"neural_model","dlss_super_resolution","dlss_ray_reconstruction","reshade"}.contains(estimate.stages.back()))// The input cache was planar RGB10; the native result is packed// RGBA16 and needs the encoder's genuine swscale packing boundary.encodedInfo.pixelFormat = "rgba64le";- if(!estimate.stages.isEmpty()&&estimate.stages.back()=="dlss_ray_reconstruction"){+ if(!estimate.stages.isEmpty()&&(estimate.stages.back()=="dlss_ray_reconstruction"||estimate.stages.back()=="reshade")){encodedInfo.pixelFormat="rgba64le";encodedInfo.sourceBitDepth=16;}if (fiPosition>=0 && after.isEmpty()) {encodedInfo.pixelFormat=rrInterpolationPrecision?"rgba64le":intermediate.hdr ? "gbrp10le" : "rgba";if(rrInterpolationPrecision)encodedInfo.sourceBitDepth=16;}- const auto timeBase = fiPosition < 0 ? decodedTimeBase- : settings.frame_interpolation_target_fps.contains('.')- ? TimeBase{1001, int(std::lround(targetFps * 1001))}- : TimeBase{1, int(std::lround(targetFps))};+ const auto timeBase = fiPosition < 0 ? decodedTimeBase : frameGenerationTimeBase(sourceFps, settings);std::unique_ptr<HostVideoEncoder> hostEncoder;std::unique_ptr<NeuralVideoDelivery> neuralDelivery;std::shared_ptr<void> interpolationDevice;@@ -1097,7 +1125,7 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,if (fiPosition >= 0)interpolation = std::make_unique<InterpolationGrid>(intermediate, settings, targetFps,QSize(intermediate.width, intermediate.height), !before.isEmpty()- && before.back() != "neural_model"&&before.back()!="dlss_ray_reconstruction",rrInterpolationPrecision);+ && before.back() != "neural_model"&&before.back()!="dlss_ray_reconstruction"&&before.back()!="reshade",rrInterpolationPrecision);const auto batchSize =videoBatchCapacity({std::max(input.width, estimate.width), std::max(input.height, estimate.height)});struct CachedPacket {@@ -1208,9 +1236,9 @@ RenderResult Pipeline::render(const RenderRequest& request, JobControl& control,previous = packet->image;continue;}- auto frames=interpolation->push(packet->image,- FrameTime(packet->pts*packet->timeBase.numerator,packet->timeBase.denominator),control);- for (auto& frame : frames) writer.push(std::move(frame));+ interpolation->push(packet->image,+ FrameTime(packet->pts*packet->timeBase.numerator,packet->timeBase.denominator),control,+ [&](InterpolationGrid::Output frame){writer.push(std::move(frame));});packet=nextProcessed();if (!packet) {writer.finish(qint64(std::ceil((request.seconds>0 ? std::min(actualDuration,request.seconds) : actualDuration)*targetFps-1e-9)));diff --git a/src/processing/pipeline.hpp b/src/processing/pipeline.hppindex 1a69295..fc9fe08 100644--- a/src/processing/pipeline.hpp+++ b/src/processing/pipeline.hpp@@ -2,6 +2,7 @@#include "configuration/settings.hpp"#include "infrastructure/job.hpp"#include "media/media.hpp"+#include "media/frame_generation_rate.hpp"#include <functional>#include <memory>#include <span>@@ -11,11 +12,18 @@ namespace ve {class PreviewFrameCache;inline int reconstructionHistoryFrames(const Settings& settings,const QStringList& stages) {if(stages.contains("dlss_ray_reconstruction"))return 32;- return stages.contains("dlss_super_resolution")?(settings.upscale_dlss_mode=="DLAA"?8:18):0;+ if(stages.contains("dlss_super_resolution"))return settings.upscale_dlss_mode=="DLAA"?8:18;+ if(stages.contains("reshade")){+ const auto rs=reshadeSettingsForMode(settings,true);+ if(rs.reshade_temporal_stability!="Spatial Only (Off)" && rs.reshade_depth_mode!="Off")+ return 8;+ }+ if(stages.contains("fsr_frame_generation"))return 8;+ return 0;}inline bool rrNeedsGeneratedHistory(const QStringList& stages) {- const auto fi=stages.indexOf("frame_generation"),rr=stages.indexOf("dlss_ray_reconstruction");- return fi>=0&&rr>fi;+ const auto fi=stages.contains("fsr_frame_generation")?stages.indexOf("fsr_frame_generation"):stages.indexOf("frame_generation"),rr=stages.indexOf("dlss_ray_reconstruction"),rs=stages.indexOf("reshade");+ return fi>=0&&((rr>fi)||(rs>fi));}enum class Workflow { NeuralRendering, Upscale, FrameInterpolation };struct PipelineEstimate {@@ -40,7 +48,9 @@ struct RenderRequest {double seconds = 0; // Zero exports the complete source.PreviewFrameCache* stillSources = nullptr; // Optional reuse of the original decoded preview image.bool isolatedVfxWorker = false; // Set only by the internal worker, independently of Qt's storage identity.+ bool isolatedReShadeWorker = false; // Set only by the internal ReShade worker.bool temporalContextIncluded = false; // Internal guard for bounded RR clip overlap.+ bool isolatedFsrWorker = false;};struct RenderResult {QString input, output, report;@@ -62,9 +72,11 @@ class FramePipeline {~FramePipeline();void configurePreviewCache(PreviewFrameCache& cache, QByteArray identity);void reuseResetPreviewResources();- [[nodiscard]] QImage process(const QImage& input, JobControl& control, qint64 frame, bool reset, float frameTimeMs = 0);+ [[nodiscard]] QImage process(const QImage& input, JobControl& control, qint64 frame, bool reset, float frameTimeMs = 0,+ double presentationSeconds = -1);[[nodiscard]] std::vector<QImage> processBatch(std::span<const QImage> input, JobControl& control,- qint64 firstFrame, bool reset, float frameTimeMs = 0);+ qint64 firstFrame, bool reset, float frameTimeMs = 0,+ double presentationSeconds = -1);private:struct Impl;diff --git a/src/processing/preview_cache.hpp b/src/processing/preview_cache.hppindex 74df2ee..fe75f59 100644--- a/src/processing/preview_cache.hpp+++ b/src/processing/preview_cache.hpp@@ -1,7 +1,9 @@#pragma once+#include "fsr_native.hpp"#include "configuration/settings.hpp"#include "infrastructure/job.hpp"#include "media/media.hpp"+#include "reshade_dependencies.hpp"#include <QCache>#include <QColorSpace>#include <QCryptographicHash>@@ -133,8 +135,9 @@ inline QList<QByteArray> previewStageKeys(QByteArray identity, const Settings& s{"rtx_video_hdr",{"upscale_hdr_contrast","upscale_hdr_saturation","upscale_hdr_middle_gray","upscale_hdr_peak_luminance","upscale_hdr_precision"}},{"cas_sharpening",{"sharpening_method","cas_sharpness"}},{"grain",{"grain_amount","grain_size","grain_color","grain_response","grain_seed","grain_animated"}},- {"frame_generation",{"frame_interpolation_engine","frame_interpolation_target_fps",- "frame_interpolation_optical_flow_quality"}}+ {"frame_generation",{"frame_interpolation_frame_rate_mode","frame_interpolation_multiplier","frame_interpolation_target_fps",+ "frame_interpolation_optical_flow_quality"}},+ {"fsr_frame_generation",{"fsr_frame_generation_frame_rate_mode","fsr_frame_generation_multiplier","fsr_frame_generation_target_fps","fsr_adapter_id"}}};identity+=QJsonDocument(QJsonObject{{"video",info.video},{"hdr",info.hdr},{"width",info.width},{"height",info.height},{"format",info.pixelFormat},{"matrix",info.colorSpace},{"range",info.range},{"primaries",info.primaries},{"transfer",info.transfer},@@ -143,8 +146,18 @@ inline QList<QByteArray> previewStageKeys(QByteArray identity, const Settings& sQList<QByteArray> keys;for (qsizetype index=0; index<stages.size(); ++index) {const auto& stage=stages[index];+ if(stage=="frame_generation")identity+="/temporal-grid-v2/monotonic-resets-v2/";QVariantMap relevant;if(stage=="dlss_ray_reconstruction")identity+="/rr-native-1x-abi2/rr-guides-v2/fixed-still-video/scene-v2/full-fingerprint/streamed-parked-32-v3/single-still/";+ if(stage=="fsr_frame_generation"){+ identity+="/fsr3-3.1.6/amd-of-video-guides-v1/precision16/scene-v1/cadence-adaptive-1over16-v2/history8-global-clock-v2/monotonic-resets-v2/gpu-encoding-required-v1/";+ identity+=fsrAdapterCacheIdentity();+ const auto engineOverride=qEnvironmentVariable("VE_FSR_RUNTIME_DIRECTORY"),mediaOverride=qEnvironmentVariable("VE_MEDIA_RUNTIME_DIRECTORY");+ const auto fsrRoot=engineOverride.isEmpty()?root+"/bin/runtime/fsrfg/":engineOverride+'/';+ for(const auto* file:{"neuroframe_engine_fsr_frame_generation.dll","amd_fidelityfx_framegeneration_dx12.dll","runtime-manifest.json"})identity+=previewFileIdentity(fsrRoot+file);+ QDir av(mediaOverride.isEmpty()?root+"/bin/runtime/av":mediaOverride);+ for(const auto& file:av.entryList({"avcodec-*.dll","avutil-*.dll","avformat-*.dll","swscale-*.dll"},QDir::Files,QDir::Name))identity+=previewFileIdentity(av.filePath(file));+ }for (const auto& field : fields.value(stage)) relevant.insert(field,settings.value(field));if(isVfxStage(stage)||(hasVfxStages(settings.stages(true))&&QStringList{"super_resolution","rtx_video_hdr"}.contains(stage))){identity+="/vfx-source-colors-v2/";@@ -163,6 +176,13 @@ inline QList<QByteArray> previewStageKeys(QByteArray identity, const Settings& sfor (auto it=values.begin(); it!=values.end(); ++it)if (it.key().startsWith("lut_")) relevant.insert(it.key(),it.value());}+ if (stage=="reshade") {+ identity += reshadeDependencyIdentity(settings, info.video, root);+ const auto rs=reshadeSettingsForMode(settings,info.video);+ const auto values=rs.values();+ for (auto it=values.begin(); it!=values.end(); ++it)+ if (it.key().startsWith("reshade_")) relevant.insert(it.key(),it.value());+ }identity+=stage.toUtf8()+QJsonDocument(QJsonObject::fromVariantMap(relevant)).toJson(QJsonDocument::Compact);if (stage=="coloring") {for (const auto& path : {settings.lut_path,settings.lut_reference_image})diff --git a/src/processing/reshade/reshade_bridge.h b/src/processing/reshade/reshade_bridge.hnew file mode 100644index 0000000..ee086b8--- /dev/null+++ b/src/processing/reshade/reshade_bridge.h@@ -0,0 +1,257 @@+#pragma once+// Independent Windows x64 ReShade ABI 2.+// Motion estimation and video depth stabilization use AMD FidelityFX Optical+// Flow 1.1.2 exclusively on all GPUs; NVIDIA Optical Flow is never used.+#include <stddef.h>+#include <stdint.h>++#if defined(VE_RS_BRIDGE_BUILD)+#define VE_RS_API __declspec(dllexport)+#else+#define VE_RS_API __declspec(dllimport)+#endif+#define VE_RS_CALL __cdecl++#ifdef __cplusplus+extern "C" {+#endif++enum {+ VE_RESHADE_ABI_VERSION = 2,+ VE_RESHADE_FORMAT_RGBA16F = 0,+ VE_RESHADE_FORMAT_RGBA8 = 1,+ VE_RESHADE_FORMAT_RGBA16_UNORM = 2,+ VE_RESHADE_FORMAT_NV12 = 3,+ VE_RESHADE_FORMAT_P010 = 4+};++enum {+ VE_RESHADE_PRECISION_AUTO = 0,+ VE_RESHADE_PRECISION_FP16 = 1,+ VE_RESHADE_PRECISION_UNORM8_SRGB = 2+};++enum {+ VE_RESHADE_TRANSFER_SRGB = 0,+ VE_RESHADE_TRANSFER_BT709 = 1,+ VE_RESHADE_TRANSFER_LINEAR = 2,+ VE_RESHADE_TRANSFER_GAMMA22 = 3,+ VE_RESHADE_TRANSFER_GAMMA28 = 4,+ VE_RESHADE_TRANSFER_PQ = 5,+ VE_RESHADE_TRANSFER_HLG = 6+};++enum {+ VE_RESHADE_HDR_AUTO = 0,+ VE_RESHADE_HDR_AWARE = 1,+ VE_RESHADE_HDR_SDR_ADAPTER = 2,+ VE_RESHADE_HDR_REJECT_UNSUPPORTED = 3+};++enum {+ VE_RESHADE_DEPTH_AUTO = 0,+ VE_RESHADE_DEPTH_OFF = 1,+ VE_RESHADE_DEPTH_AI = 2+};++enum {+ VE_RESHADE_TEMPORAL_QUALITY = 0,+ // Value 1 is retired and rejected; preserve the ABI 2 value of Off.+ VE_RESHADE_TEMPORAL_SPATIAL_OFF = 2+};++typedef struct VeReShadeCapabilities {+ uint32_t size;+ uint32_t abi;+ uint32_t available;+ uint32_t vendor_id;+ uint32_t device_id;+ uint32_t adapter_luid_low;+ int32_t adapter_luid_high;+ uint32_t shader_model;+ uint32_t max_texture_dimension;+ uint32_t host_format_mask;+ uint32_t cuda_interop_available;+ uint32_t d3d12_native_available;+ uint32_t depth_available;+ uint32_t amd_optical_flow_available;+ uint32_t dedicated_vram_mib;+ uint32_t reserved[1];+} VeReShadeCapabilities;++typedef struct VeReShadePresetDesc {+ uint32_t size;+ uint32_t abi;+ const char* preset_path_utf8;+ const char* shader_roots_utf8;+ const char* texture_roots_utf8;+ const char* overrides_json_utf8;+ uint32_t preview_width;+ uint32_t preview_height;+} VeReShadePresetDesc;++typedef struct VeReShadeSessionDesc {+ uint32_t size;+ uint32_t abi;+ uint32_t width;+ uint32_t height;+ uint32_t still_image;+ uint32_t precision_policy;+ uint32_t color_transfer;+ uint32_t hdr_policy;+ uint32_t depth_mode;+ uint32_t depth_resolution_bound;+ uint32_t temporal_policy;+ float temporal_strength;+ float mix;+ uint32_t preserve_alpha;+ uint32_t reserved_output; // Must be zero; retained for ABI 2 structure layout.+ uint32_t memory_budget_mib;+ uint64_t deterministic_seed;+ const char* preset_path_utf8;+ const char* shader_roots_utf8;+ const char* texture_roots_utf8;+ const char* overrides_json_utf8;+} VeReShadeSessionDesc;++typedef struct VeReShadeHostFrameDesc {+ uint32_t size;+ uint32_t abi;+ const void* input_pixels;+ uint32_t input_stride;+ uint32_t input_format;+ void* output_pixels;+ uint32_t output_stride;+ uint32_t output_format;+ uint32_t reset;+ uint32_t reserved;+ uint64_t frame_ordinal;+ int64_t pts_ns;+ int64_t duration_ns;+} VeReShadeHostFrameDesc;++typedef struct VeReShadeCudaYuvDesc {+ uint32_t size;+ uint32_t abi;+ uint32_t width;+ uint32_t height;+ uint32_t pixel_format; // VE_RESHADE_FORMAT_NV12 or VE_RESHADE_FORMAT_P010+ uint32_t output_format; // VE_RESHADE_FORMAT_NV12, VE_RESHADE_FORMAT_P010, or VE_RESHADE_FORMAT_RGBA16F+ uint64_t y_pointer;+ uint64_t uv_pointer;+ uint32_t y_stride;+ uint32_t uv_stride;+ uint32_t color_matrix; // 0=601, 1=709, 2=2020+ uint32_t color_range; // 0=limited, 1=full+ uint32_t chroma_location; // 0..6 libav chroma location+ uint32_t rotation; // 0, 90, 180, 270+ uint32_t reset;+ uint32_t reserved;+ uint64_t frame_ordinal;+ int64_t pts_ns;+ int64_t duration_ns;+ uint64_t reserved_tail;+} VeReShadeCudaYuvDesc;++typedef struct VeReShadeCudaRgbDesc {+ uint32_t size;+ uint32_t abi;+ uint32_t width;+ uint32_t height;+ uint64_t pointer;+ uint32_t stride;+ uint32_t output_format; // VE_RESHADE_FORMAT_RGBA16F, VE_RESHADE_FORMAT_NV12, or VE_RESHADE_FORMAT_P010+ uint32_t color_matrix;+ uint32_t color_range;+ uint32_t reset;+ uint32_t reserved;+ uint64_t frame_ordinal;+ int64_t pts_ns;+ int64_t duration_ns;+} VeReShadeCudaRgbDesc;++typedef struct VeReShadeCudaSurfaceDesc {+ uint32_t size;+ uint32_t abi;+ uint32_t width;+ uint32_t height;+ uint32_t pixel_format;+ uint32_t stride;+ uint64_t y_pointer;+ uint64_t uv_pointer;+} VeReShadeCudaSurfaceDesc;++typedef struct VeReShadeD3d12FrameDesc {+ uint32_t size;+ uint32_t abi;+ void* input_resource;+ uint32_t input_state;+ uint32_t output_state;+ void* output_resource;+ uint32_t reset;+ uint32_t reserved;+ uint64_t frame_ordinal;+ int64_t pts_ns;+ int64_t duration_ns;+} VeReShadeD3d12FrameDesc;++typedef struct VeReShadeFrameResult {+ uint32_t size;+ uint32_t abi;+ uint32_t render_width;+ uint32_t render_height;+ uint32_t selected_precision;+ uint32_t active_techniques;+ uint32_t depth_evaluated;+ uint32_t amd_flow_dispatched;+ uint32_t amd_flow_history_valid;+ uint32_t history_reset;+ uint64_t host_upload_bytes;+ uint64_t host_download_bytes;+ uint64_t gpu_copy_bytes;+ double input_ms;+ double depth_ms;+ double flow_ms;+ double effect_ms;+ double output_ms;+ double total_ms;+} VeReShadeFrameResult;++VE_RS_API uint32_t VE_RS_CALL reshade_abi_version(void);+VE_RS_API const char* VE_RS_CALL reshade_version(void);+VE_RS_API const char* VE_RS_CALL reshade_optical_flow_backend(void);+VE_RS_API int VE_RS_CALL reshade_init_v2(int gpu_ordinal, const wchar_t* runtime_dir,+ const wchar_t* app_data_dir, char* error, int capacity);+VE_RS_API int VE_RS_CALL reshade_capabilities(VeReShadeCapabilities* out, char* error, int capacity);+VE_RS_API int VE_RS_CALL reshade_status(char* json, int capacity);+VE_RS_API int VE_RS_CALL reshade_inspect_preset(const VeReShadePresetDesc* desc,+ char* json_out, int json_capacity,+ char* error, int error_capacity);+VE_RS_API int VE_RS_CALL reshade_export_preset_copy(const VeReShadePresetDesc* desc,+ const char* destination_path_utf8,+ char* error, int error_capacity);+VE_RS_API void* VE_RS_CALL reshade_session_create(const VeReShadeSessionDesc* desc,+ char* error, int capacity);+VE_RS_API int VE_RS_CALL reshade_session_reset(void* session, char* error, int capacity);+VE_RS_API int VE_RS_CALL reshade_session_status(void* session, char* json, int capacity);+VE_RS_API void VE_RS_CALL reshade_session_release(void* session);+VE_RS_API int VE_RS_CALL reshade_session_d3d12_device(void* session, void** out_device);+VE_RS_API int VE_RS_CALL reshade_session_d3d12_queue(void* session, void** out_queue);++VE_RS_API int VE_RS_CALL reshade_process_host(void* session, const VeReShadeHostFrameDesc* frame,+ VeReShadeFrameResult* result, char* error, int capacity);+VE_RS_API int VE_RS_CALL reshade_process_d3d12(void* session, const VeReShadeD3d12FrameDesc* frame,+ VeReShadeFrameResult* result, char* error, int capacity);++#ifdef __cplusplus+}+static_assert(sizeof(VeReShadeCapabilities) == 64, "Unexpected VeReShadeCapabilities layout");+static_assert(sizeof(VeReShadePresetDesc) == 48, "Unexpected VeReShadePresetDesc layout");+static_assert(sizeof(VeReShadeSessionDesc) == 104, "Unexpected VeReShadeSessionDesc layout");+static_assert(sizeof(VeReShadeHostFrameDesc) == 72, "Unexpected VeReShadeHostFrameDesc layout");+static_assert(sizeof(VeReShadeCudaYuvDesc) == 104, "Unexpected VeReShadeCudaYuvDesc layout");+static_assert(sizeof(VeReShadeCudaRgbDesc) == 72, "Unexpected VeReShadeCudaRgbDesc layout");+static_assert(sizeof(VeReShadeCudaSurfaceDesc) == 40, "Unexpected VeReShadeCudaSurfaceDesc layout");+static_assert(sizeof(VeReShadeD3d12FrameDesc) == 64, "Unexpected VeReShadeD3d12FrameDesc layout");+static_assert(sizeof(VeReShadeFrameResult) == 112, "Unexpected VeReShadeFrameResult layout");+#endifdiff --git a/src/processing/reshade_cuda_adapter.cpp b/src/processing/reshade_cuda_adapter.cppnew file mode 100644index 0000000..800b55e--- /dev/null+++ b/src/processing/reshade_cuda_adapter.cpp@@ -0,0 +1,694 @@+#ifndef _CRT_SECURE_NO_WARNINGS+#define _CRT_SECURE_NO_WARNINGS+#endif+#include "reshade_cuda_adapter.hpp"+#include "reshade_cuda_kernels_ptx.h"+#include <cuda.h>+#include <Windows.h>+#include <dxgi1_6.h>+#include <algorithm>+#include <array>+#include <atomic>+#include <cmath>+#include <cstdio>+#include <cstring>+#include <map>+#include <mutex>+#include <vector>++namespace ve {+namespace {++using CuExternalMemoryHandleDesc = CUDA_EXTERNAL_MEMORY_HANDLE_DESC;+using CuExternalMemoryBufferDesc = CUDA_EXTERNAL_MEMORY_BUFFER_DESC;+using CuPrimaryRetainFn = CUresult(__cdecl*)(CUcontext*, CUdevice);+using CuPrimaryReleaseFn = CUresult(__cdecl*)(CUdevice);+using CuPrimaryStateFn = CUresult(__cdecl*)(CUdevice, unsigned*, int*);+using CuPrimaryFlagsFn = CUresult(__cdecl*)(CUdevice, unsigned);+using CuCtxGetFn = CUresult(__cdecl*)(CUcontext*);+using CuCtxSetFn = CUresult(__cdecl*)(CUcontext);+using CuImportFn = CUresult(__cdecl*)(CUexternalMemory*, const CuExternalMemoryHandleDesc*);+using CuMapFn = CUresult(__cdecl*)(uint64_t*, CUexternalMemory, const CuExternalMemoryBufferDesc*);+using CuDestroyFn = CUresult(__cdecl*)(CUexternalMemory);+using CuModuleLoadFn = CUresult(__cdecl*)(CUmodule*, const void*);+using CuModuleFunctionFn = CUresult(__cdecl*)(CUfunction*, CUmodule, const char*);+using CuLaunchFn = CUresult(__cdecl*)(CUfunction, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, void*, void**, void**);+using CuSyncFn = CUresult(__cdecl*)(void*);+using CuAllocFn = CUresult(__cdecl*)(uint64_t*, size_t);+using CuFreeFn = CUresult(__cdecl*)(uint64_t);+using CuErrorFn = CUresult(__cdecl*)(CUresult, const char**);+using CuInitFn = int(__cdecl*)(unsigned);+using CuDeviceGetFn = int(__cdecl*)(int*, int);+using CuLuidFn = int(__cdecl*)(char*, unsigned*, int);++struct SharedBuffer {+ Microsoft::WRL::ComPtr<ID3D12Heap> heap;+ Microsoft::WRL::ComPtr<ID3D12Resource> resource;+ CUexternalMemory external = nullptr;+ uint64_t pointer = 0;+ uint64_t heap_bytes = 0;+};++struct SurfacePool;++struct CudaSurface {+ uint64_t pointer = 0;+ uint32_t width = 0;+ uint32_t height = 0;+ uint32_t stride = 0;+ uint32_t format = 0;+ std::atomic<uint32_t> references{1};+ SurfacePool* pool = nullptr;+};++struct SurfacePool {+ std::vector<CudaSurface*> slots;+ bool closed = false;+};++static constexpr size_t MAX_OUTPUT_SURFACES = 64;++struct SessionBuffers {+ ID3D12Device* device = nullptr;+ uint32_t width = 0;+ uint32_t height = 0;+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT cuda_fp{};+ uint64_t cuda_buffer_bytes = 0;++ SharedBuffer cuda_input;+ SharedBuffer cuda_output;++ uint64_t chroma_full = 0;+ uint64_t chroma_vertical = 0;++ SurfacePool surface_pool;+};++} // namespace++struct ReShadeCudaAdapter::Impl {+ std::mutex mutex;+ HMODULE cuda = nullptr;+ int ordinal = -1;+ CUdevice cuda_device = 0;+ CUcontext cuda_context = nullptr;+ CUmodule cuda_module = nullptr;++ CuCtxGetFn ctx_get = nullptr;+ CuCtxSetFn ctx_set = nullptr;+ CuImportFn import_mem = nullptr;+ CuMapFn map_mem = nullptr;+ CuDestroyFn destroy_mem = nullptr;+ CuModuleLoadFn module_load = nullptr;+ CuModuleFunctionFn module_function = nullptr;+ CuLaunchFn launch = nullptr;+ CuSyncFn sync = nullptr;+ CuAllocFn alloc = nullptr;+ CuFreeFn free_mem = nullptr;+ CuErrorFn error_string = nullptr;+ CuPrimaryReleaseFn primary_release = nullptr;++ CUfunction nv12_in = nullptr;+ CUfunction p010_in = nullptr;+ CUfunction yuv_prepare = nullptr;+ CUfunction yuv_vertical = nullptr;+ CUfunction nv12_out = nullptr;+ CUfunction p010_out = nullptr;+ CUfunction rgba16f_copy = nullptr;++ decltype(&reshade_process_d3d12) process_d3d12_fn = nullptr;+ decltype(&reshade_session_d3d12_device) session_device_fn = nullptr;++ std::map<void*, SessionBuffers> sessions;+ bool ready = false;++ template<class T>+ bool loadSymbol(T& out, const char* name) {+ out = reinterpret_cast<T>(GetProcAddress(cuda, name));+ return out != nullptr;+ }++ bool setError(const std::string& msg, char* error, int capacity) {+ if (error && capacity > 0) {+ strncpy_s(error, size_t(capacity), msg.c_str(), _TRUNCATE);+ }+ return false;+ }++ struct ContextGuard {+ CUcontext prev = nullptr;+ CuCtxSetFn set_fn = nullptr;+ bool active = false;++ ContextGuard(CUcontext target, CuCtxGetFn get_fn, CuCtxSetFn s_fn) : set_fn(s_fn) {+ if (target && get_fn && set_fn && get_fn(&prev) == CUDA_SUCCESS) {+ if (set_fn(target) == CUDA_SUCCESS) {+ active = true;+ }+ }+ }+ ~ContextGuard() {+ if (active && set_fn) {+ set_fn(prev);+ }+ }+ };++ bool createSharedBuffer(ID3D12Device* device, uint64_t bytes, D3D12_RESOURCE_STATES state, SharedBuffer& out, char* error, int capacity) {+ out.heap_bytes = (bytes + 0xffffull) & ~0xffffull;+ D3D12_HEAP_DESC heap_desc{};+ heap_desc.SizeInBytes = out.heap_bytes;+ heap_desc.Properties.Type = D3D12_HEAP_TYPE_DEFAULT;+ heap_desc.Flags = D3D12_HEAP_FLAG_SHARED;+ HRESULT hr = device->CreateHeap(&heap_desc, IID_PPV_ARGS(&out.heap));+ if (FAILED(hr)) {+ char buf[128];+ std::snprintf(buf, sizeof(buf), "CreateHeap failed with HRESULT 0x%08X", (unsigned)hr);+ return setError(buf, error, capacity);+ }+ D3D12_RESOURCE_DESC desc{};+ desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;+ desc.Width = bytes;+ desc.Height = 1;+ desc.DepthOrArraySize = 1;+ desc.MipLevels = 1;+ desc.SampleDesc.Count = 1;+ desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;+ hr = device->CreatePlacedResource(out.heap.Get(), 0, &desc, state, nullptr, IID_PPV_ARGS(&out.resource));+ if (FAILED(hr)) {+ char buf[128];+ std::snprintf(buf, sizeof(buf), "CreatePlacedResource failed with HRESULT 0x%08X", (unsigned)hr);+ return setError(buf, error, capacity);+ }+ HANDLE handle = nullptr;+ hr = device->CreateSharedHandle(out.heap.Get(), nullptr, GENERIC_ALL, nullptr, &handle);+ if (FAILED(hr)) {+ char buf[128];+ std::snprintf(buf, sizeof(buf), "CreateSharedHandle failed with HRESULT 0x%08X", (unsigned)hr);+ return setError(buf, error, capacity);+ }+ CuExternalMemoryHandleDesc mem{};+ mem.type = CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP;+ mem.handle.win32.handle = handle;+ mem.size = out.heap_bytes;+ mem.flags = 0;+ const CUresult res = import_mem(&out.external, &mem);+ CloseHandle(handle);+ if (res != CUDA_SUCCESS) {+ char buf[128];+ std::snprintf(buf, sizeof(buf), "cuImportExternalMemory failed with code %d", (int)res);+ return setError(buf, error, capacity);+ }+ CuExternalMemoryBufferDesc buf_desc{};+ buf_desc.offset = 0;+ buf_desc.size = bytes;+ buf_desc.flags = 0;+ const CUresult map_res = map_mem(&out.pointer, out.external, &buf_desc);+ if (map_res != CUDA_SUCCESS) {+ char buf[128];+ std::snprintf(buf, sizeof(buf), "cuExternalMemoryGetMappedBuffer failed with code %d", (int)map_res);+ return setError(buf, error, capacity);+ }+ return true;+ }++ bool ensureSessionBuffers(void* sessionHandle, SessionBuffers*& out_s, char* error, int capacity) {+ auto it = sessions.find(sessionHandle);+ if (it != sessions.end()) {+ out_s = &it->second;+ return true;+ }+ if (!session_device_fn) {+ return setError("ReShade D3D12 device query function is not set.", error, capacity);+ }+ ID3D12Device* dev = nullptr;+ if (session_device_fn(sessionHandle, reinterpret_cast<void**>(&dev)) != 1 || !dev) {+ return setError("Cannot query D3D12 device from ReShade session.", error, capacity);+ }++ SessionBuffers s{};+ s.device = dev;+ auto ins = sessions.emplace(sessionHandle, std::move(s));+ out_s = &ins.first->second;+ return true;+ }++ bool setupSessionDimensions(SessionBuffers& s, uint32_t width, uint32_t height, char* error, int capacity) {+ if (s.width == width && s.height == height && s.cuda_input.resource && s.cuda_output.resource) {+ return true;+ }+ s.width = width;+ s.height = height;++ D3D12_RESOURCE_DESC tex_desc{};+ tex_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;+ tex_desc.Width = width;+ tex_desc.Height = height;+ tex_desc.DepthOrArraySize = 1;+ tex_desc.MipLevels = 1;+ tex_desc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT;+ tex_desc.SampleDesc.Count = 1;+ s.device->GetCopyableFootprints(&tex_desc, 0, 1, 0, &s.cuda_fp, nullptr, nullptr, &s.cuda_buffer_bytes);++ if (!createSharedBuffer(s.device, s.cuda_buffer_bytes, D3D12_RESOURCE_STATE_COPY_SOURCE, s.cuda_input, error, capacity) ||+ !createSharedBuffer(s.device, s.cuda_buffer_bytes, D3D12_RESOURCE_STATE_COPY_DEST, s.cuda_output, error, capacity)) {+ return false;+ }+ return true;+ }++ CudaSurface* acquireSurface(SessionBuffers& s, uint32_t format) {+ for (auto* slot : s.surface_pool.slots) {+ if (slot->format == format && slot->references.load() == 0) {+ slot->references.store(1);+ return slot;+ }+ }+ if (s.surface_pool.slots.size() >= MAX_OUTPUT_SURFACES) {+ return nullptr;+ }+ auto* surface = new (std::nothrow) CudaSurface();+ if (!surface) return nullptr;+ surface->width = s.width;+ surface->height = s.height;+ surface->format = format;+ surface->pool = &s.surface_pool;+ const uint32_t elem_bytes = (format == VE_RESHADE_FORMAT_RGBA16F) ? 8u+ : (format == VE_RESHADE_FORMAT_P010) ? 2u : 1u;+ surface->stride = (s.width * elem_bytes + 255u) & ~255u;+ const uint64_t bytes = uint64_t(surface->stride) *+ (format == VE_RESHADE_FORMAT_RGBA16F ? s.height : (s.height + (s.height + 1) / 2));+ if (alloc(&surface->pointer, size_t(bytes)) != CUDA_SUCCESS) {+ delete surface;+ return nullptr;+ }+ s.surface_pool.slots.push_back(surface);+ return surface;+ }++ void freeSharedBuffer(SharedBuffer& buf) {+ if (buf.pointer && destroy_mem && buf.external) {+ destroy_mem(buf.external);+ buf.external = nullptr;+ buf.pointer = 0;+ }+ buf.resource.Reset();+ buf.heap.Reset();+ }++ void releaseSessionBuffersInternal(SessionBuffers& s) {+ ContextGuard guard(cuda_context, ctx_get, ctx_set);+ freeSharedBuffer(s.cuda_input);+ freeSharedBuffer(s.cuda_output);+ if (s.chroma_full && free_mem) {+ free_mem(s.chroma_full);+ s.chroma_full = 0;+ }+ if (s.chroma_vertical && free_mem) {+ free_mem(s.chroma_vertical);+ s.chroma_vertical = 0;+ }+ for (auto* surface : s.surface_pool.slots) {+ if (surface->pointer && free_mem) {+ free_mem(surface->pointer);+ }+ delete surface;+ }+ s.surface_pool.slots.clear();+ }+};++ReShadeCudaAdapter::ReShadeCudaAdapter() : impl_(std::make_unique<Impl>()) {}+ReShadeCudaAdapter::~ReShadeCudaAdapter() = default;++ReShadeCudaAdapter& ReShadeCudaAdapter::instance() {+ static ReShadeCudaAdapter s_instance;+ return s_instance;+}++bool ReShadeCudaAdapter::isAvailable() const {+ return impl_->ready;+}++bool ReShadeCudaAdapter::initialize(int ordinal) {+ std::lock_guard lock(impl_->mutex);+ if (impl_->ready && impl_->ordinal == ordinal) {+ return true;+ }++ if (!impl_->cuda) {+ impl_->cuda = LoadLibraryA("nvcuda.dll");+ if (!impl_->cuda) {+ return false;+ }+ }++ CuPrimaryRetainFn retain = nullptr;+ CuPrimaryStateFn primary_state = nullptr;+ CuPrimaryFlagsFn primary_flags = nullptr;+ CuInitFn cu_init = nullptr;+ CuDeviceGetFn cu_dev_get = nullptr;++ if (!impl_->loadSymbol(cu_init, "cuInit") ||+ !impl_->loadSymbol(cu_dev_get, "cuDeviceGet") ||+ !impl_->loadSymbol(retain, "cuDevicePrimaryCtxRetain") ||+ !impl_->loadSymbol(impl_->primary_release, "cuDevicePrimaryCtxRelease") ||+ !impl_->loadSymbol(primary_state, "cuDevicePrimaryCtxGetState") ||+ !impl_->loadSymbol(primary_flags, "cuDevicePrimaryCtxSetFlags_v2") ||+ !impl_->loadSymbol(impl_->ctx_get, "cuCtxGetCurrent") ||+ !impl_->loadSymbol(impl_->ctx_set, "cuCtxSetCurrent") ||+ !impl_->loadSymbol(impl_->import_mem, "cuImportExternalMemory") ||+ !impl_->loadSymbol(impl_->map_mem, "cuExternalMemoryGetMappedBuffer") ||+ !impl_->loadSymbol(impl_->destroy_mem, "cuDestroyExternalMemory") ||+ !impl_->loadSymbol(impl_->module_load, "cuModuleLoadData") ||+ !impl_->loadSymbol(impl_->module_function, "cuModuleGetFunction") ||+ !impl_->loadSymbol(impl_->launch, "cuLaunchKernel") ||+ !impl_->loadSymbol(impl_->sync, "cuStreamSynchronize") ||+ !impl_->loadSymbol(impl_->alloc, "cuMemAlloc_v2") ||+ !impl_->loadSymbol(impl_->free_mem, "cuMemFree_v2") ||+ !impl_->loadSymbol(impl_->error_string, "cuGetErrorString")) {+ return false;+ }++ if (cu_init(0) != 0 || cu_dev_get(&impl_->cuda_device, ordinal) != 0) {+ return false;+ }++ unsigned flags = 0;+ int active = 0;+ if (primary_state(impl_->cuda_device, &flags, &active) != CUDA_SUCCESS) {+ return false;+ }+ if (!active) {+ primary_flags(impl_->cuda_device, 0x04u); // CU_CTX_SCHED_BLOCKING_SYNC+ }+ if (retain(&impl_->cuda_context, impl_->cuda_device) != CUDA_SUCCESS) {+ return false;+ }++ Impl::ContextGuard guard(impl_->cuda_context, impl_->ctx_get, impl_->ctx_set);+ if (impl_->module_load(&impl_->cuda_module, kReShadeKernelPtx) != CUDA_SUCCESS ||+ impl_->module_function(&impl_->nv12_in, impl_->cuda_module, "rs_nv12_to_rgba16f") != CUDA_SUCCESS ||+ impl_->module_function(&impl_->p010_in, impl_->cuda_module, "rs_p010_to_rgba16f") != CUDA_SUCCESS ||+ impl_->module_function(&impl_->yuv_prepare, impl_->cuda_module, "rs_prepare_420") != CUDA_SUCCESS ||+ impl_->module_function(&impl_->yuv_vertical, impl_->cuda_module, "rs_filter_420_vertical") != CUDA_SUCCESS ||+ impl_->module_function(&impl_->nv12_out, impl_->cuda_module, "rs_420_uv_to_nv12") != CUDA_SUCCESS ||+ impl_->module_function(&impl_->p010_out, impl_->cuda_module, "rs_420_uv_to_p010") != CUDA_SUCCESS ||+ impl_->module_function(&impl_->rgba16f_copy, impl_->cuda_module, "rs_copy_rgba16f") != CUDA_SUCCESS) {+ return false;+ }++ // Dynamic bind of ReShade D3D12 bridge functions from neuroframe_engine_reshade.dll+ const HMODULE rs_dll = GetModuleHandleW(L"neuroframe_engine_reshade.dll");+ if (rs_dll) {+ impl_->process_d3d12_fn = reinterpret_cast<decltype(&reshade_process_d3d12)>(+ GetProcAddress(rs_dll, "reshade_process_d3d12"));+ impl_->session_device_fn = reinterpret_cast<decltype(&reshade_session_d3d12_device)>(+ GetProcAddress(rs_dll, "reshade_session_d3d12_device"));+ }++ impl_->ordinal = ordinal;+ impl_->ready = true;+ return true;+}++int ReShadeCudaAdapter::processCudaYuv(void* sessionHandle,+ const VeReShadeCudaYuvDesc* frame,+ void** outSurface,+ VeReShadeFrameResult* result,+ char* error,+ int capacity) {+ std::lock_guard lock(impl_->mutex);+ if (outSurface) *outSurface = nullptr;+ if (!impl_->ready) {+ return impl_->setError("ReShade CUDA adapter is not initialized.", error, capacity) ? 1 : 0;+ }+ if (!sessionHandle || !frame || !outSurface || !result ||+ frame->size < sizeof(VeReShadeCudaYuvDesc) || frame->abi != VE_RESHADE_ABI_VERSION ||+ result->size < sizeof(VeReShadeFrameResult) || result->abi != VE_RESHADE_ABI_VERSION ||+ !frame->y_pointer || !frame->uv_pointer ||+ (frame->pixel_format != VE_RESHADE_FORMAT_NV12 && frame->pixel_format != VE_RESHADE_FORMAT_P010) ||+ (frame->output_format != VE_RESHADE_FORMAT_NV12 &&+ frame->output_format != VE_RESHADE_FORMAT_P010 &&+ frame->output_format != VE_RESHADE_FORMAT_RGBA16F)) {+ return impl_->setError("Invalid VeReShadeCudaYuvDesc parameters.", error, capacity) ? 1 : 0;+ }++ Impl::ContextGuard guard(impl_->cuda_context, impl_->ctx_get, impl_->ctx_set);++ SessionBuffers* s = nullptr;+ if (!impl_->ensureSessionBuffers(sessionHandle, s, error, capacity) ||+ !impl_->setupSessionDimensions(*s, frame->width, frame->height, error, capacity)) {+ return 0;+ }++ // 1. Launch CUDA YUV -> RGBA16F into shared input staging buffer+ uint64_t y_ptr = frame->y_pointer;+ uint64_t uv_ptr = frame->uv_pointer;+ uint64_t dst_ptr = s->cuda_input.pointer;+ int ys = int(frame->y_stride);+ int uvs = int(frame->uv_stride);+ int sw = int(frame->width);+ int sh = int(frame->height);+ size_t pitch = s->cuda_fp.Footprint.RowPitch;+ int ow = int(s->width);+ int oh = int(s->height);+ int mat = int(frame->color_matrix);+ int rng = int(frame->color_range);+ int rot = int(frame->rotation);+ int chr = int(frame->chroma_location);+ void* args[] = {&y_ptr, &uv_ptr, &ys, &uvs, &sw, &sh, &dst_ptr, &pitch, &ow, &oh, &mat, &rng, &rot, &chr};++ const CUfunction in_kernel = (frame->pixel_format == VE_RESHADE_FORMAT_P010) ? impl_->p010_in : impl_->nv12_in;+ if (impl_->launch(in_kernel, (s->width + 15) / 16, (s->height + 15) / 16, 1, 16, 16, 1, 0, nullptr, args, nullptr) != CUDA_SUCCESS ||+ impl_->sync(nullptr) != CUDA_SUCCESS) {+ return impl_->setError("CUDA YUV input kernel conversion failed.", error, capacity) ? 1 : 0;+ }++ // 2. Process frame on D3D12 ReShade session+ if (!impl_->process_d3d12_fn) {+ const HMODULE rs_dll = GetModuleHandleW(L"neuroframe_engine_reshade.dll");+ if (rs_dll) {+ impl_->process_d3d12_fn = reinterpret_cast<decltype(&reshade_process_d3d12)>(+ GetProcAddress(rs_dll, "reshade_process_d3d12"));+ }+ }+ if (!impl_->process_d3d12_fn) {+ return impl_->setError("reshade_process_d3d12 function export unavailable.", error, capacity) ? 1 : 0;+ }++ VeReShadeD3d12FrameDesc d3d_frame{};+ d3d_frame.size = sizeof(d3d_frame);+ d3d_frame.abi = VE_RESHADE_ABI_VERSION;+ d3d_frame.input_resource = s->cuda_input.resource.Get();+ d3d_frame.output_resource = s->cuda_output.resource.Get();+ d3d_frame.input_state = D3D12_RESOURCE_STATE_COPY_SOURCE;+ d3d_frame.output_state = D3D12_RESOURCE_STATE_COPY_DEST;+ d3d_frame.frame_ordinal = frame->frame_ordinal;+ d3d_frame.pts_ns = frame->pts_ns;+ d3d_frame.duration_ns = frame->duration_ns;+ d3d_frame.reset = frame->reset;++ if (impl_->process_d3d12_fn(sessionHandle, &d3d_frame, result, error, capacity) != 1) {+ return 0;+ }++ // 3. Convert shared output buffer into requested format in pooled surface+ auto* surface = impl_->acquireSurface(*s, frame->output_format);+ if (!surface) {+ return impl_->setError("Failed to acquire ReShade CUDA surface.", error, capacity) ? 1 : 0;+ }++ uint64_t src = s->cuda_output.pointer;+ uint64_t dst = surface->pointer;+ size_t src_pitch = s->cuda_fp.Footprint.RowPitch;+ size_t dst_pitch = surface->stride;+ int w = int(s->width);+ int h = int(s->height);+ bool ok = false;++ if (frame->output_format == VE_RESHADE_FORMAT_RGBA16F) {+ void* copy_args[] = {&src, &src_pitch, &dst, &dst_pitch, &w, &h};+ ok = (impl_->launch(impl_->rgba16f_copy, (s->width + 15) / 16, (s->height + 15) / 16, 1, 16, 16, 1, 0, nullptr, copy_args, nullptr) == CUDA_SUCCESS);+ } else {+ uint64_t uv = dst + uint64_t(surface->stride) * s->height;+ int stride = int(surface->stride);+ int out_p010 = (frame->output_format == VE_RESHADE_FORMAT_P010) ? 1 : 0;+ size_t chroma_pitch = size_t(s->width) * 8;+ if ((!s->chroma_full && impl_->alloc(&s->chroma_full, chroma_pitch * s->height) != CUDA_SUCCESS) ||+ (!s->chroma_vertical && impl_->alloc(&s->chroma_vertical, chroma_pitch * ((s->height + 1) / 2)) != CUDA_SUCCESS)) {+ surface->references.store(0);+ return impl_->setError("Allocate ReShade chroma scratch buffer failed.", error, capacity) ? 1 : 0;+ }+ void* prep_args[] = {&src, &src_pitch, &dst, &stride, &w, &h, &mat, &rng, &s->chroma_full, &chroma_pitch, &out_p010};+ void* vert_args[] = {&s->chroma_full, &chroma_pitch, &s->chroma_vertical, &chroma_pitch, &w, &h};+ void* horiz_args[] = {&s->chroma_vertical, &chroma_pitch, &uv, &stride, &w, &h};+ ok = (impl_->launch(impl_->yuv_prepare, (s->width + 15) / 16, (s->height + 15) / 16, 1, 16, 16, 1, 0, nullptr, prep_args, nullptr) == CUDA_SUCCESS) &&+ (impl_->launch(impl_->yuv_vertical, (s->width + 15) / 16, ((s->height + 1) / 2 + 15) / 16, 1, 16, 16, 1, 0, nullptr, vert_args, nullptr) == CUDA_SUCCESS) &&+ (impl_->launch(out_p010 ? impl_->p010_out : impl_->nv12_out, ((s->width + 1) / 2 + 15) / 16, ((s->height + 1) / 2 + 15) / 16, 1, 16, 16, 1, 0, nullptr, horiz_args, nullptr) == CUDA_SUCCESS);+ }++ if (!ok || impl_->sync(nullptr) != CUDA_SUCCESS) {+ surface->references.store(0);+ return impl_->setError("ReShade CUDA output conversion failed.", error, capacity) ? 1 : 0;+ }++ *outSurface = surface;+ return 1;+}++int ReShadeCudaAdapter::processCudaRgb(void* sessionHandle,+ const VeReShadeCudaRgbDesc* frame,+ void** outSurface,+ VeReShadeFrameResult* result,+ char* error,+ int capacity) {+ std::lock_guard lock(impl_->mutex);+ if (outSurface) *outSurface = nullptr;+ if (!impl_->ready) {+ return impl_->setError("ReShade CUDA adapter is not initialized.", error, capacity) ? 1 : 0;+ }+ if (!sessionHandle || !frame || !outSurface || !result ||+ frame->size < sizeof(VeReShadeCudaRgbDesc) || frame->abi != VE_RESHADE_ABI_VERSION ||+ result->size < sizeof(VeReShadeFrameResult) || result->abi != VE_RESHADE_ABI_VERSION ||+ !frame->pointer ||+ (frame->output_format != VE_RESHADE_FORMAT_RGBA16F &&+ frame->output_format != VE_RESHADE_FORMAT_NV12 &&+ frame->output_format != VE_RESHADE_FORMAT_P010)) {+ return impl_->setError("Invalid VeReShadeCudaRgbDesc parameters.", error, capacity) ? 1 : 0;+ }++ Impl::ContextGuard guard(impl_->cuda_context, impl_->ctx_get, impl_->ctx_set);++ SessionBuffers* s = nullptr;+ if (!impl_->ensureSessionBuffers(sessionHandle, s, error, capacity) ||+ !impl_->setupSessionDimensions(*s, frame->width, frame->height, error, capacity)) {+ return 0;+ }++ // 1. Copy input CUDA RGBA16F into shared input staging buffer+ uint64_t src_ptr = frame->pointer;+ uint64_t dst_ptr = s->cuda_input.pointer;+ size_t src_pitch = frame->stride;+ size_t dst_pitch = s->cuda_fp.Footprint.RowPitch;+ int w = int(s->width);+ int h = int(s->height);+ void* copy_in_args[] = {&src_ptr, &src_pitch, &dst_ptr, &dst_pitch, &w, &h};++ if (impl_->launch(impl_->rgba16f_copy, (s->width + 15) / 16, (s->height + 15) / 16, 1, 16, 16, 1, 0, nullptr, copy_in_args, nullptr) != CUDA_SUCCESS ||+ impl_->sync(nullptr) != CUDA_SUCCESS) {+ return impl_->setError("CUDA RGBA16F input copy failed.", error, capacity) ? 1 : 0;+ }++ // 2. Process frame on D3D12 ReShade session+ if (!impl_->process_d3d12_fn) {+ const HMODULE rs_dll = GetModuleHandleW(L"neuroframe_engine_reshade.dll");+ if (rs_dll) {+ impl_->process_d3d12_fn = reinterpret_cast<decltype(&reshade_process_d3d12)>(+ GetProcAddress(rs_dll, "reshade_process_d3d12"));+ }+ }+ if (!impl_->process_d3d12_fn) {+ return impl_->setError("reshade_process_d3d12 function export unavailable.", error, capacity) ? 1 : 0;+ }++ VeReShadeD3d12FrameDesc d3d_frame{};+ d3d_frame.size = sizeof(d3d_frame);+ d3d_frame.abi = VE_RESHADE_ABI_VERSION;+ d3d_frame.input_resource = s->cuda_input.resource.Get();+ d3d_frame.output_resource = s->cuda_output.resource.Get();+ d3d_frame.input_state = D3D12_RESOURCE_STATE_COPY_SOURCE;+ d3d_frame.output_state = D3D12_RESOURCE_STATE_COPY_DEST;+ d3d_frame.frame_ordinal = frame->frame_ordinal;+ d3d_frame.pts_ns = frame->pts_ns;+ d3d_frame.duration_ns = frame->duration_ns;+ d3d_frame.reset = frame->reset;++ if (impl_->process_d3d12_fn(sessionHandle, &d3d_frame, result, error, capacity) != 1) {+ return 0;+ }++ // 3. Convert shared output buffer into requested format in pooled surface+ auto* surface = impl_->acquireSurface(*s, frame->output_format);+ if (!surface) {+ return impl_->setError("Failed to acquire ReShade CUDA surface.", error, capacity) ? 1 : 0;+ }++ uint64_t src = s->cuda_output.pointer;+ uint64_t dst = surface->pointer;+ bool ok = false;++ if (frame->output_format == VE_RESHADE_FORMAT_RGBA16F) {+ size_t out_dst_pitch = surface->stride;+ void* copy_out_args[] = {&src, &dst_pitch, &dst, &out_dst_pitch, &w, &h};+ ok = (impl_->launch(impl_->rgba16f_copy, (s->width + 15) / 16, (s->height + 15) / 16, 1, 16, 16, 1, 0, nullptr, copy_out_args, nullptr) == CUDA_SUCCESS);+ } else {+ uint64_t uv = dst + uint64_t(surface->stride) * s->height;+ int stride = int(surface->stride);+ int mat = int(frame->color_matrix);+ int rng = int(frame->color_range);+ int out_p010 = (frame->output_format == VE_RESHADE_FORMAT_P010) ? 1 : 0;+ size_t chroma_pitch = size_t(s->width) * 8;+ if ((!s->chroma_full && impl_->alloc(&s->chroma_full, chroma_pitch * s->height) != CUDA_SUCCESS) ||+ (!s->chroma_vertical && impl_->alloc(&s->chroma_vertical, chroma_pitch * ((s->height + 1) / 2)) != CUDA_SUCCESS)) {+ surface->references.store(0);+ return impl_->setError("Allocate ReShade chroma scratch buffer failed.", error, capacity) ? 1 : 0;+ }+ void* prep_args[] = {&src, &dst_pitch, &dst, &stride, &w, &h, &mat, &rng, &s->chroma_full, &chroma_pitch, &out_p010};+ void* vert_args[] = {&s->chroma_full, &chroma_pitch, &s->chroma_vertical, &chroma_pitch, &w, &h};+ void* horiz_args[] = {&s->chroma_vertical, &chroma_pitch, &uv, &stride, &w, &h};+ ok = (impl_->launch(impl_->yuv_prepare, (s->width + 15) / 16, (s->height + 15) / 16, 1, 16, 16, 1, 0, nullptr, prep_args, nullptr) == CUDA_SUCCESS) &&+ (impl_->launch(impl_->yuv_vertical, (s->width + 15) / 16, ((s->height + 1) / 2 + 15) / 16, 1, 16, 16, 1, 0, nullptr, vert_args, nullptr) == CUDA_SUCCESS) &&+ (impl_->launch(out_p010 ? impl_->p010_out : impl_->nv12_out, ((s->width + 1) / 2 + 15) / 16, ((s->height + 1) / 2 + 15) / 16, 1, 16, 16, 1, 0, nullptr, horiz_args, nullptr) == CUDA_SUCCESS);+ }++ if (!ok || impl_->sync(nullptr) != CUDA_SUCCESS) {+ surface->references.store(0);+ return impl_->setError("ReShade CUDA output conversion failed.", error, capacity) ? 1 : 0;+ }++ *outSurface = surface;+ return 1;+}++int ReShadeCudaAdapter::surfaceDesc(void* s, VeReShadeCudaSurfaceDesc* desc) {+ auto* surface = static_cast<CudaSurface*>(s);+ if (!surface || !desc) return 0;+ desc->size = sizeof(VeReShadeCudaSurfaceDesc);+ desc->abi = VE_RESHADE_ABI_VERSION;+ desc->width = surface->width;+ desc->height = surface->height;+ desc->pixel_format = surface->format;+ desc->stride = surface->stride;+ desc->y_pointer = surface->pointer;+ desc->uv_pointer = (surface->format == VE_RESHADE_FORMAT_RGBA16F)+ ? 0+ : (surface->pointer + uint64_t(surface->stride) * surface->height);+ return 1;+}++void ReShadeCudaAdapter::surfaceRetain(void* s) {+ auto* surface = static_cast<CudaSurface*>(s);+ if (surface) {+ surface->references.fetch_add(1);+ }+}++void ReShadeCudaAdapter::surfaceRelease(void* s) {+ auto* surface = static_cast<CudaSurface*>(s);+ if (!surface) return;+ if (surface->references.fetch_sub(1) <= 1) {+ surface->references.store(0);+ }+}++void ReShadeCudaAdapter::releaseSessionBuffers(void* sessionHandle) {+ std::lock_guard lock(impl_->mutex);+ auto it = impl_->sessions.find(sessionHandle);+ if (it != impl_->sessions.end()) {+ impl_->releaseSessionBuffersInternal(it->second);+ impl_->sessions.erase(it);+ }+}++} // namespace vediff --git a/src/processing/reshade_cuda_adapter.hpp b/src/processing/reshade_cuda_adapter.hppnew file mode 100644index 0000000..e77a88f--- /dev/null+++ b/src/processing/reshade_cuda_adapter.hpp@@ -0,0 +1,99 @@+#pragma once+#include <cstdint>+#include <memory>+#include <string>+#include <utility>+#include <d3d12.h>+#include <dxgi1_6.h>+#include <wrl/client.h>+#include "processing/reshade/reshade_bridge.h"++namespace ve {++typedef struct VeReShadeCudaYuvDesc {+ uint32_t size;+ uint32_t abi;+ uint32_t width;+ uint32_t height;+ uint32_t pixel_format; // VE_RESHADE_FORMAT_NV12 or VE_RESHADE_FORMAT_P010+ uint32_t output_format; // VE_RESHADE_FORMAT_NV12, VE_RESHADE_FORMAT_P010, or VE_RESHADE_FORMAT_RGBA16F+ uint64_t y_pointer;+ uint64_t uv_pointer;+ uint32_t y_stride;+ uint32_t uv_stride;+ uint32_t color_matrix; // 0=601, 1=709, 2=2020+ uint32_t color_range; // 0=limited, 1=full+ uint32_t chroma_location; // 0..6 libav chroma location+ uint32_t rotation; // 0, 90, 180, 270+ uint32_t reset;+ uint32_t reserved;+ uint64_t frame_ordinal;+ int64_t pts_ns;+ int64_t duration_ns;+ uint64_t reserved_tail;+} VeReShadeCudaYuvDesc;++typedef struct VeReShadeCudaRgbDesc {+ uint32_t size;+ uint32_t abi;+ uint32_t width;+ uint32_t height;+ uint64_t pointer;+ uint32_t stride;+ uint32_t output_format; // VE_RESHADE_FORMAT_RGBA16F, VE_RESHADE_FORMAT_NV12, or VE_RESHADE_FORMAT_P010+ uint32_t color_matrix;+ uint32_t color_range;+ uint32_t reset;+ uint32_t reserved;+ uint64_t frame_ordinal;+ int64_t pts_ns;+ int64_t duration_ns;+} VeReShadeCudaRgbDesc;++typedef struct VeReShadeCudaSurfaceDesc {+ uint32_t size;+ uint32_t abi;+ uint32_t width;+ uint32_t height;+ uint32_t pixel_format;+ uint32_t stride;+ uint64_t y_pointer;+ uint64_t uv_pointer;+} VeReShadeCudaSurfaceDesc;++class ReShadeCudaAdapter {+public:+ static ReShadeCudaAdapter& instance();++ bool isAvailable() const;+ bool initialize(int ordinal);++ int processCudaYuv(void* sessionHandle,+ const VeReShadeCudaYuvDesc* frame,+ void** outSurface,+ VeReShadeFrameResult* result,+ char* error,+ int capacity);++ int processCudaRgb(void* sessionHandle,+ const VeReShadeCudaRgbDesc* frame,+ void** outSurface,+ VeReShadeFrameResult* result,+ char* error,+ int capacity);++ int surfaceDesc(void* surface, VeReShadeCudaSurfaceDesc* desc);+ void surfaceRetain(void* surface);+ void surfaceRelease(void* surface);++ void releaseSessionBuffers(void* sessionHandle);++private:+ ReShadeCudaAdapter();+ ~ReShadeCudaAdapter();++ struct Impl;+ std::unique_ptr<Impl> impl_;+};++} // namespace vediff --git a/src/processing/reshade_cuda_interop.cu b/src/processing/reshade_cuda_interop.cunew file mode 100644index 0000000..df8f210--- /dev/null+++ b/src/processing/reshade_cuda_interop.cu@@ -0,0 +1,267 @@+// SPDX-License-Identifier: MIT+// Independent CUDA/D3D12 frame-boundary kernels for the ReShade native bridge.+// Compiled to this feature's embedded PTX via NVRTC.+// Note: These kernels perform only YUV/RGB memory transport; ReShade motion+// estimation uses AMD FidelityFX Optical Flow 1.1.2 on D3D12 exclusively.+#include <cuda_fp16.h>+#include <cstddef>++__device__ __forceinline__ void matrix_coefficients(int matrix, float& kr, float& kb) {+ if (matrix == 0) { kr = 0.2990f; kb = 0.1140f; }+ else if (matrix == 2) { kr = 0.2627f; kb = 0.0593f; }+ else if (matrix == 3) { kr = 0.3000f; kb = 0.1100f; }+ else if (matrix == 4) { kr = 0.2120f; kb = 0.0870f; }+ else { kr = 0.2126f; kb = 0.0722f; }+}++__device__ __forceinline__ void yuv_to_rgb(float yv, float uv, float vv, int bits,+ int matrix, int full, float& r, float& g, float& b) {+ float y, cb, cr;+ const float maximum = bits == 10 ? 1023.0f : 255.0f;+ if (full) {+ const float neutral = bits == 10 ? 512.0f : 128.0f;+ y = yv / maximum;+ cb = (uv - neutral) / maximum;+ cr = (vv - neutral) / maximum;+ } else if (bits == 10) {+ y = (yv - 64.0f) / 876.0f;+ cb = (uv - 512.0f) / 896.0f;+ cr = (vv - 512.0f) / 896.0f;+ } else {+ y = (yv - 16.0f) / 219.0f;+ cb = (uv - 128.0f) / 224.0f;+ cr = (vv - 128.0f) / 224.0f;+ }+ float kr, kb;+ matrix_coefficients(matrix, kr, kb);+ const float kg = 1.0f - kr - kb;+ r = y + 2.0f * (1.0f - kr) * cr;+ b = y + 2.0f * (1.0f - kb) * cb;+ g = (y - kr * r - kb * b) / kg;+ r = fminf(fmaxf(r, 0.0f), 1.0f);+ g = fminf(fmaxf(g, 0.0f), 1.0f);+ b = fminf(fmaxf(b, 0.0f), 1.0f);+}++__device__ __forceinline__ void rgb_to_yuv(float r, float g, float b, int bits,+ int matrix, int full, float& y, float& u, float& v) {+ r = fminf(fmaxf(r, 0.0f), 1.0f);+ g = fminf(fmaxf(g, 0.0f), 1.0f);+ b = fminf(fmaxf(b, 0.0f), 1.0f);+ float kr, kb;+ matrix_coefficients(matrix, kr, kb);+ const float kg = 1.0f - kr - kb;+ const float luma = kr * r + kg * g + kb * b;+ const float cb = (b - luma) / (2.0f * (1.0f - kb));+ const float cr = (r - luma) / (2.0f * (1.0f - kr));+ if (full) {+ const float m = bits == 10 ? 1023.0f : 255.0f;+ const float neutral = bits == 10 ? 512.0f : 128.0f;+ y = luma * m;+ u = cb * m + neutral;+ v = cr * m + neutral;+ } else if (bits == 10) {+ y = 64.0f + luma * 876.0f;+ u = 512.0f + cb * 896.0f;+ v = 512.0f + cr * 896.0f;+ } else {+ y = 16.0f + luma * 219.0f;+ u = 128.0f + cb * 224.0f;+ v = 128.0f + cr * 224.0f;+ }+}++__device__ __forceinline__ bool source_xy(int x, int y, int out_w, int out_h,+ int src_w, int src_h, int rotation, int& sx, int& sy) {+ int ox = x, oy = y;+ if (rotation == 90) { sx = oy; sy = src_h - 1 - ox; }+ else if (rotation == 180) { sx = src_w - 1 - ox; sy = src_h - 1 - oy; }+ else if (rotation == 270) { sx = src_w - 1 - oy; sy = ox; }+ else { sx = ox; sy = oy; }+ return sx >= 0 && sy >= 0 && sx < src_w && sy < src_h && x < out_w && y < out_h;+}++template<typename T>+__device__ __forceinline__ float sample_uv(+ const T* plane, int stride_bytes, int width, int height, float x, float y, int channel) {+ x = fminf(fmaxf(x, 0.0f), float(width - 1));+ y = fminf(fmaxf(y, 0.0f), float(height - 1));+ const int stride = stride_bytes / int(sizeof(T));+ const int x0 = int(floorf(x)), y0 = int(floorf(y));+ const int x1 = min(width - 1, x0 + 1), y1 = min(height - 1, y0 + 1);+ const float fx = x - floorf(x), fy = y - floorf(y);+ const float a = plane[size_t(y0) * stride + x0 * 2 + channel];+ const float b = plane[size_t(y0) * stride + x1 * 2 + channel];+ const float c = plane[size_t(y1) * stride + x0 * 2 + channel];+ const float d = plane[size_t(y1) * stride + x1 * 2 + channel];+ return (a + (b - a) * fx) + ((c + (d - c) * fx) - (a + (b - a) * fx)) * fy;+}++__device__ __forceinline__ void chroma_xy(int sx, int sy, int location, float& x, float& y) {+ const float cx = (location == 2 || location == 4 || location == 6) ? 0.5f : 0.0f;+ const float cy = (location == 3 || location == 4) ? 0.0f : (location == 5 || location == 6) ? 1.0f : 0.5f;+ x = (float(sx) - cx) * 0.5f;+ y = (float(sy) - cy) * 0.5f;+}++__device__ __forceinline__ void store_half4(unsigned short* dst, size_t pitch, int x, int y,+ float r, float g, float b, float a = 1.0f) {+ uint2 value;+ const unsigned hr = __half_as_ushort(__float2half_rn(r));+ const unsigned hg = __half_as_ushort(__float2half_rn(g));+ const unsigned hb = __half_as_ushort(__float2half_rn(b));+ const unsigned ha = __half_as_ushort(__float2half_rn(a));+ value.x = (hg << 16) | hr;+ value.y = (ha << 16) | hb;+ reinterpret_cast<uint2*>(reinterpret_cast<unsigned char*>(dst) + size_t(y) * pitch)[x] = value;+}++__device__ __forceinline__ void load_half4(const unsigned short* src, size_t pitch, int x, int y,+ float& r, float& g, float& b, float& a) {+ const uint2 value = reinterpret_cast<const uint2*>(+ reinterpret_cast<const unsigned char*>(src) + size_t(y) * pitch)[x];+ r = __half2float(__ushort_as_half(value.x & 0xffffu));+ g = __half2float(__ushort_as_half(value.x >> 16));+ b = __half2float(__ushort_as_half(value.y & 0xffffu));+ a = __half2float(__ushort_as_half(value.y >> 16));+}++extern "C" __global__ void rs_nv12_to_rgba16f(+ const unsigned char* yp, const unsigned char* uvp, int ys, int uvs,+ int sw, int sh, unsigned short* dst, size_t pitch, int ow, int oh,+ int matrix, int full, int rotation, int chroma) {+ const int x = blockIdx.x * blockDim.x + threadIdx.x;+ const int y = blockIdx.y * blockDim.y + threadIdx.y;+ if (x >= ow || y >= oh) return;+ int sx, sy;+ float r = 0.0f, g = 0.0f, b = 0.0f;+ if (source_xy(x, y, ow, oh, sw, sh, rotation, sx, sy)) {+ float ux, uy;+ chroma_xy(sx, sy, chroma, ux, uy);+ yuv_to_rgb(yp[size_t(sy) * ys + sx],+ sample_uv(uvp, uvs, (sw + 1) / 2, (sh + 1) / 2, ux, uy, 0),+ sample_uv(uvp, uvs, (sw + 1) / 2, (sh + 1) / 2, ux, uy, 1),+ 8, matrix, full, r, g, b);+ }+ store_half4(dst, pitch, x, y, r, g, b, 1.0f);+}++extern "C" __global__ void rs_p010_to_rgba16f(+ const unsigned short* yp, const unsigned short* uvp, int ys, int uvs,+ int sw, int sh, unsigned short* dst, size_t pitch, int ow, int oh,+ int matrix, int full, int rotation, int chroma) {+ const int x = blockIdx.x * blockDim.x + threadIdx.x;+ const int y = blockIdx.y * blockDim.y + threadIdx.y;+ if (x >= ow || y >= oh) return;+ int sx, sy;+ float r = 0.0f, g = 0.0f, b = 0.0f;+ if (source_xy(x, y, ow, oh, sw, sh, rotation, sx, sy)) {+ const int yi = ys / 2;+ float ux, uy;+ chroma_xy(sx, sy, chroma, ux, uy);+ yuv_to_rgb(float(yp[size_t(sy) * yi + sx] >> 6),+ sample_uv(uvp, uvs, (sw + 1) / 2, (sh + 1) / 2, ux, uy, 0) / 64.0f,+ sample_uv(uvp, uvs, (sw + 1) / 2, (sh + 1) / 2, ux, uy, 1) / 64.0f,+ 10, matrix, full, r, g, b);+ }+ store_half4(dst, pitch, x, y, r, g, b, 1.0f);+}++__device__ __forceinline__ float rs_mitchell(float x) {+ x = fabsf(x);+ if (x < 1.0f) return ((7.0f * x - 12.0f) * x * x + 16.0f / 3.0f) / 6.0f;+ if (x < 2.0f) return (((-7.0f / 3.0f * x + 12.0f) * x - 20.0f) * x + 32.0f / 3.0f) / 6.0f;+ return 0.0f;+}++extern "C" __global__ void rs_prepare_420(+ const unsigned short* src, size_t pitch,+ unsigned char* yp, int ys, int w, int h, int matrix, int full,+ float2* chroma, size_t chroma_pitch, int p010) {+ const int x = blockIdx.x * blockDim.x + threadIdx.x;+ const int y = blockIdx.y * blockDim.y + threadIdx.y;+ if (x >= w || y >= h) return;+ float r, g, b, a, yy, u, v;+ load_half4(src, pitch, x, y, r, g, b, a);+ rgb_to_yuv(r, g, b, p010 ? 10 : 8, matrix, full, yy, u, v);+ const float maximum = p010 ? 1023.0f : 255.0f;+ const unsigned q = (unsigned)(fminf(fmaxf(yy, 0.0f), maximum) + 0.5f);+ unsigned char* row = yp + size_t(y) * ys;+ if (p010) reinterpret_cast<unsigned short*>(row)[x] = (unsigned short)(q << 6);+ else row[x] = (unsigned char)q;+ reinterpret_cast<float2*>(reinterpret_cast<unsigned char*>(chroma) + size_t(y) * chroma_pitch)[x] = make_float2(u, v);+}++extern "C" __global__ void rs_filter_420_vertical(+ const float2* source, size_t pitch,+ float2* destination, size_t destination_pitch, int w, int h) {+ const int x = blockIdx.x * blockDim.x + threadIdx.x;+ const int cy = blockIdx.y * blockDim.y + threadIdx.y;+ if (x >= w || cy * 2 >= h) return;+ float u = 0.0f, v = 0.0f, norm = 0.0f;+ #pragma unroll+ for (int j = 0; j < 8; ++j) {+ const int y = max(0, min(h - 1, cy * 2 + j - 3));+ const float2 value = reinterpret_cast<const float2*>(+ reinterpret_cast<const unsigned char*>(source) + size_t(y) * pitch)[x];+ const float weight = rs_mitchell((j - 3.5f) * 0.5f);+ norm += weight;+ u += weight * value.x;+ v += weight * value.y;+ }+ reinterpret_cast<float2*>(+ reinterpret_cast<unsigned char*>(destination) + size_t(cy) * destination_pitch)[x] = make_float2(u / norm, v / norm);+}++template<typename T, int BITS>+__device__ void rs_filter_420_horizontal(+ const float2* source, size_t pitch,+ T* destination, int stride, int w, int h, int cx, int cy) {+ if (cx * 2 >= w || cy * 2 >= h) return;+ float u = 0.0f, v = 0.0f, norm = 0.0f;+ const float2* row = reinterpret_cast<const float2*>(+ reinterpret_cast<const unsigned char*>(source) + size_t(cy) * pitch);+ #pragma unroll+ for (int i = 0; i < 8; ++i) {+ const float2 value = row[max(0, min(w - 1, cx * 2 + i - 3))];+ const float weight = rs_mitchell((i - 3) * 0.5f);+ norm += weight;+ u += weight * value.x;+ v += weight * value.y;+ }+ const float maximum = BITS == 10 ? 1023.0f : 255.0f;+ unsigned uq = (unsigned)(fminf(fmaxf(u / norm, 0.0f), maximum) + 0.5f);+ unsigned vq = (unsigned)(fminf(fmaxf(v / norm, 0.0f), maximum) + 0.5f);+ if (BITS == 10) { uq <<= 6; vq <<= 6; }+ T* out = destination + size_t(cy) * (stride / int(sizeof(T))) + cx * 2;+ out[0] = (T)uq;+ out[1] = (T)vq;+}++extern "C" __global__ void rs_420_uv_to_nv12(+ const float2* source, size_t pitch,+ unsigned char* destination, int stride, int w, int h) {+ rs_filter_420_horizontal<unsigned char, 8>(+ source, pitch, destination, stride, w, h,+ blockIdx.x * blockDim.x + threadIdx.x, blockIdx.y * blockDim.y + threadIdx.y);+}++extern "C" __global__ void rs_420_uv_to_p010(+ const float2* source, size_t pitch,+ unsigned short* destination, int stride, int w, int h) {+ rs_filter_420_horizontal<unsigned short, 10>(+ source, pitch, destination, stride, w, h,+ blockIdx.x * blockDim.x + threadIdx.x, blockIdx.y * blockDim.y + threadIdx.y);+}++extern "C" __global__ void rs_copy_rgba16f(+ const unsigned short* src, size_t src_pitch,+ unsigned short* dst, size_t dst_pitch, int w, int h) {+ const int x = blockIdx.x * blockDim.x + threadIdx.x;+ const int y = blockIdx.y * blockDim.y + threadIdx.y;+ if (x >= w || y >= h) return;+ const uint2 value = reinterpret_cast<const uint2*>(+ reinterpret_cast<const unsigned char*>(src) + size_t(y) * src_pitch)[x];+ reinterpret_cast<uint2*>(+ reinterpret_cast<unsigned char*>(dst) + size_t(y) * dst_pitch)[x] = value;+}diff --git a/src/processing/reshade_cuda_kernels_ptx.h b/src/processing/reshade_cuda_kernels_ptx.hnew file mode 100644index 0000000..fbf0cc3--- /dev/null+++ b/src/processing/reshade_cuda_kernels_ptx.h@@ -0,0 +1,1251 @@+#pragma once+static constexpr const char kReShadeKernelPtx[] = R"VE_RS_PTX(+//+// Generated by NVIDIA NVVM Compiler+//+// Compiler Build ID: CL-36260728+// Cuda compilation tools, release 13.0, V13.0.48+// Based on NVVM 7.0.1+//++.version 9.0+.target sm_75+.address_size 64++ // .globl rs_nv12_to_rgba16f++.visible .entry rs_nv12_to_rgba16f(+ .param .u64 rs_nv12_to_rgba16f_param_0,+ .param .u64 rs_nv12_to_rgba16f_param_1,+ .param .u32 rs_nv12_to_rgba16f_param_2,+ .param .u32 rs_nv12_to_rgba16f_param_3,+ .param .u32 rs_nv12_to_rgba16f_param_4,+ .param .u32 rs_nv12_to_rgba16f_param_5,+ .param .u64 rs_nv12_to_rgba16f_param_6,+ .param .u64 rs_nv12_to_rgba16f_param_7,+ .param .u32 rs_nv12_to_rgba16f_param_8,+ .param .u32 rs_nv12_to_rgba16f_param_9,+ .param .u32 rs_nv12_to_rgba16f_param_10,+ .param .u32 rs_nv12_to_rgba16f_param_11,+ .param .u32 rs_nv12_to_rgba16f_param_12,+ .param .u32 rs_nv12_to_rgba16f_param_13+)+{+ .reg .pred %p<23>;+ .reg .b16 %rs<14>;+ .reg .f32 %f<102>;+ .reg .b32 %r<55>;+ .reg .b64 %rd<29>;+++ ld.param.u64 %rd1, [rs_nv12_to_rgba16f_param_0];+ ld.param.u64 %rd2, [rs_nv12_to_rgba16f_param_1];+ ld.param.u32 %r9, [rs_nv12_to_rgba16f_param_2];+ ld.param.u32 %r10, [rs_nv12_to_rgba16f_param_3];+ ld.param.u32 %r11, [rs_nv12_to_rgba16f_param_4];+ ld.param.u32 %r12, [rs_nv12_to_rgba16f_param_5];+ ld.param.u64 %rd3, [rs_nv12_to_rgba16f_param_6];+ ld.param.u64 %rd4, [rs_nv12_to_rgba16f_param_7];+ ld.param.u32 %r17, [rs_nv12_to_rgba16f_param_8];+ ld.param.u32 %r18, [rs_nv12_to_rgba16f_param_9];+ ld.param.u32 %r13, [rs_nv12_to_rgba16f_param_10];+ ld.param.u32 %r14, [rs_nv12_to_rgba16f_param_11];+ ld.param.u32 %r15, [rs_nv12_to_rgba16f_param_12];+ ld.param.u32 %r16, [rs_nv12_to_rgba16f_param_13];+ mov.u32 %r19, %ntid.x;+ mov.u32 %r20, %ctaid.x;+ mov.u32 %r21, %tid.x;+ mad.lo.s32 %r1, %r20, %r19, %r21;+ mov.u32 %r22, %ntid.y;+ mov.u32 %r23, %ctaid.y;+ mov.u32 %r24, %tid.y;+ mad.lo.s32 %r2, %r23, %r22, %r24;+ setp.ge.s32 %p1, %r1, %r17;+ setp.ge.s32 %p2, %r2, %r18;+ or.pred %p3, %p1, %p2;+ @%p3 bra $L__BB0_22;++ setp.eq.s32 %p4, %r15, 90;+ @%p4 bra $L__BB0_6;++ setp.eq.s32 %p5, %r15, 180;+ @%p5 bra $L__BB0_5;++ setp.ne.s32 %p6, %r15, 270;+ mov.u32 %r53, %r1;+ mov.u32 %r54, %r2;+ @%p6 bra $L__BB0_7;++ not.b32 %r25, %r2;+ add.s32 %r53, %r25, %r11;+ mov.u32 %r54, %r1;+ bra.uni $L__BB0_7;++$L__BB0_6:+ not.b32 %r28, %r1;+ add.s32 %r54, %r28, %r12;+ mov.u32 %r53, %r2;+ bra.uni $L__BB0_7;++$L__BB0_5:+ not.b32 %r26, %r1;+ add.s32 %r53, %r26, %r11;+ not.b32 %r27, %r2;+ add.s32 %r54, %r27, %r12;++$L__BB0_7:+ or.b32 %r29, %r54, %r53;+ setp.lt.s32 %p7, %r29, 0;+ setp.ge.s32 %p8, %r53, %r11;+ or.pred %p9, %p8, %p7;+ setp.ge.s32 %p10, %r54, %r12;+ mov.f32 %f99, 0f00000000;+ or.pred %p11, %p10, %p9;+ mov.f32 %f100, %f99;+ mov.f32 %f101, %f99;+ @%p11 bra $L__BB0_21;++ cvta.to.global.u64 %rd5, %rd2;+ setp.eq.s32 %p12, %r16, 4;+ or.b32 %r30, %r16, 4;+ setp.eq.s32 %p13, %r30, 6;+ or.pred %p14, %p12, %p13;+ selp.f32 %f24, 0f3F000000, 0f00000000, %p14;+ mov.f32 %f25, 0f00000000;+ add.s32 %r31, %r16, -3;+ setp.lt.u32 %p15, %r31, 2;+ add.s32 %r32, %r16, -5;+ setp.lt.u32 %p16, %r32, 2;+ selp.f32 %f26, 0f3F800000, 0f3F000000, %p16;+ selp.f32 %f27, 0f00000000, %f26, %p15;+ cvt.rn.f32.s32 %f28, %r53;+ sub.f32 %f29, %f28, %f24;+ mul.f32 %f30, %f29, 0f3F000000;+ cvt.rn.f32.s32 %f31, %r54;+ sub.f32 %f32, %f31, %f27;+ mul.f32 %f33, %f32, 0f3F000000;+ mul.wide.s32 %rd6, %r54, %r9;+ cvt.s64.s32 %rd7, %r53;+ add.s64 %rd8, %rd6, %rd7;+ cvta.to.global.u64 %rd9, %rd1;+ add.s64 %rd10, %rd9, %rd8;+ ld.global.u8 %rs1, [%rd10];+ cvt.rn.f32.u16 %f1, %rs1;+ add.s32 %r33, %r11, 1;+ shr.u32 %r34, %r33, 31;+ add.s32 %r35, %r33, %r34;+ shr.s32 %r36, %r35, 1;+ add.s32 %r37, %r12, 1;+ shr.u32 %r38, %r37, 31;+ add.s32 %r39, %r37, %r38;+ shr.s32 %r40, %r39, 1;+ max.f32 %f34, %f30, %f25;+ add.s32 %r41, %r36, -1;+ cvt.rn.f32.s32 %f35, %r41;+ min.f32 %f36, %f34, %f35;+ max.f32 %f37, %f33, %f25;+ add.s32 %r42, %r40, -1;+ cvt.rn.f32.s32 %f38, %r42;+ min.f32 %f39, %f37, %f38;+ cvt.rmi.f32.f32 %f40, %f36;+ cvt.rzi.s32.f32 %r43, %f40;+ cvt.rmi.f32.f32 %f41, %f39;+ cvt.rzi.s32.f32 %r44, %f41;+ add.s32 %r45, %r43, 1;+ min.s32 %r46, %r41, %r45;+ add.s32 %r47, %r44, 1;+ min.s32 %r48, %r42, %r47;+ sub.f32 %f42, %f36, %f40;+ sub.f32 %f43, %f39, %f41;+ mul.wide.s32 %rd11, %r44, %r10;+ shl.b32 %r49, %r43, 1;+ cvt.s64.s32 %rd12, %r49;+ add.s64 %rd13, %rd11, %rd12;+ add.s64 %rd14, %rd5, %rd13;+ ld.global.u8 %rs2, [%rd14];+ cvt.rn.f32.u16 %f44, %rs2;+ shl.b32 %r50, %r46, 1;+ cvt.s64.s32 %rd15, %r50;+ add.s64 %rd16, %rd11, %rd15;+ add.s64 %rd17, %rd5, %rd16;+ ld.global.u8 %rs3, [%rd17];+ cvt.rn.f32.u16 %f45, %rs3;+ mul.wide.s32 %rd18, %r48, %r10;+ add.s64 %rd19, %rd18, %rd12;+ add.s64 %rd20, %rd5, %rd19;+ ld.global.u8 %rs4, [%rd20];+ cvt.rn.f32.u16 %f46, %rs4;+ add.s64 %rd21, %rd18, %rd15;+ add.s64 %rd22, %rd5, %rd21;+ ld.global.u8 %rs5, [%rd22];+ cvt.rn.f32.u16 %f47, %rs5;+ sub.f32 %f48, %f45, %f44;+ fma.rn.f32 %f49, %f42, %f48, %f44;+ sub.f32 %f50, %f47, %f46;+ fma.rn.f32 %f51, %f42, %f50, %f46;+ sub.f32 %f52, %f51, %f49;+ fma.rn.f32 %f2, %f43, %f52, %f49;+ ld.global.u8 %rs6, [%rd14+1];+ cvt.rn.f32.u16 %f53, %rs6;+ ld.global.u8 %rs7, [%rd17+1];+ cvt.rn.f32.u16 %f54, %rs7;+ ld.global.u8 %rs8, [%rd20+1];+ cvt.rn.f32.u16 %f55, %rs8;+ ld.global.u8 %rs9, [%rd22+1];+ cvt.rn.f32.u16 %f56, %rs9;+ sub.f32 %f57, %f54, %f53;+ fma.rn.f32 %f58, %f42, %f57, %f53;+ sub.f32 %f59, %f56, %f55;+ fma.rn.f32 %f60, %f42, %f59, %f55;+ sub.f32 %f61, %f60, %f58;+ fma.rn.f32 %f3, %f43, %f61, %f58;+ setp.eq.s32 %p17, %r14, 0;+ @%p17 bra $L__BB0_10;++ div.rn.f32 %f94, %f1, 0f437F0000;+ add.f32 %f62, %f2, 0fC3000000;+ div.rn.f32 %f95, %f62, 0f437F0000;+ add.f32 %f63, %f3, 0fC3000000;+ div.rn.f32 %f96, %f63, 0f437F0000;+ bra.uni $L__BB0_11;++$L__BB0_10:+ add.f32 %f64, %f1, 0fC1800000;+ div.rn.f32 %f94, %f64, 0f435B0000;+ add.f32 %f65, %f2, 0fC3000000;+ div.rn.f32 %f95, %f65, 0f43600000;+ add.f32 %f66, %f3, 0fC3000000;+ div.rn.f32 %f96, %f66, 0f43600000;++$L__BB0_11:+ mov.f32 %f98, 0f3E991687;+ mov.f32 %f97, 0f3DE978D5;+ setp.gt.s32 %p18, %r13, 2;+ @%p18 bra $L__BB0_15;++ setp.eq.s32 %p21, %r13, 0;+ @%p21 bra $L__BB0_20;++ setp.eq.s32 %p22, %r13, 2;+ @%p22 bra $L__BB0_14;+ bra.uni $L__BB0_19;++$L__BB0_14:+ mov.f32 %f98, 0f3E86809D;+ mov.f32 %f97, 0f3D72E48F;+ bra.uni $L__BB0_20;++$L__BB0_15:+ setp.eq.s32 %p19, %r13, 3;+ @%p19 bra $L__BB0_18;++ setp.ne.s32 %p20, %r13, 4;+ @%p20 bra $L__BB0_19;++ mov.f32 %f98, 0f3E591687;+ mov.f32 %f97, 0f3DB22D0E;+ bra.uni $L__BB0_20;++$L__BB0_18:+ mov.f32 %f98, 0f3E99999A;+ mov.f32 %f97, 0f3DE147AE;+ bra.uni $L__BB0_20;++$L__BB0_19:+ mov.f32 %f98, 0f3E59B3D0;+ mov.f32 %f97, 0f3D93DD98;++$L__BB0_20:+ mov.f32 %f77, 0f3F800000;+ sub.f32 %f78, %f77, %f98;+ sub.f32 %f79, %f78, %f97;+ add.f32 %f80, %f78, %f78;+ fma.rn.f32 %f81, %f96, %f80, %f94;+ sub.f32 %f82, %f77, %f97;+ add.f32 %f83, %f82, %f82;+ fma.rn.f32 %f84, %f95, %f83, %f94;+ mul.f32 %f85, %f98, %f81;+ sub.f32 %f86, %f94, %f85;+ mul.f32 %f87, %f97, %f84;+ sub.f32 %f88, %f86, %f87;+ div.rn.f32 %f89, %f88, %f79;+ cvt.sat.f32.f32 %f99, %f81;+ cvt.sat.f32.f32 %f100, %f89;+ cvt.sat.f32.f32 %f101, %f84;++$L__BB0_21:+ // begin inline asm+ { cvt.rn.f16.f32 %rs10, %f99;}++ // end inline asm+ // begin inline asm+ { cvt.rn.f16.f32 %rs11, %f100;}++ // end inline asm+ // begin inline asm+ { cvt.rn.f16.f32 %rs12, %f101;}++ // end inline asm+ mov.f32 %f93, 0f3F800000;+ // begin inline asm+ { cvt.rn.f16.f32 %rs13, %f93;}++ // end inline asm+ cvt.s64.s32 %rd23, %r2;+ mul.lo.s64 %rd24, %rd23, %rd4;+ cvta.to.global.u64 %rd25, %rd3;+ add.s64 %rd26, %rd25, %rd24;+ mul.wide.s32 %rd27, %r1, 8;+ add.s64 %rd28, %rd26, %rd27;+ mov.b32 %r51, {%rs12, %rs13};+ mov.b32 %r52, {%rs10, %rs11};+ st.global.v2.u32 [%rd28], {%r52, %r51};++$L__BB0_22:+ ret;++}+ // .globl rs_p010_to_rgba16f+.visible .entry rs_p010_to_rgba16f(+ .param .u64 rs_p010_to_rgba16f_param_0,+ .param .u64 rs_p010_to_rgba16f_param_1,+ .param .u32 rs_p010_to_rgba16f_param_2,+ .param .u32 rs_p010_to_rgba16f_param_3,+ .param .u32 rs_p010_to_rgba16f_param_4,+ .param .u32 rs_p010_to_rgba16f_param_5,+ .param .u64 rs_p010_to_rgba16f_param_6,+ .param .u64 rs_p010_to_rgba16f_param_7,+ .param .u32 rs_p010_to_rgba16f_param_8,+ .param .u32 rs_p010_to_rgba16f_param_9,+ .param .u32 rs_p010_to_rgba16f_param_10,+ .param .u32 rs_p010_to_rgba16f_param_11,+ .param .u32 rs_p010_to_rgba16f_param_12,+ .param .u32 rs_p010_to_rgba16f_param_13+)+{+ .reg .pred %p<23>;+ .reg .b16 %rs<15>;+ .reg .f32 %f<104>;+ .reg .b32 %r<61>;+ .reg .b64 %rd<34>;+++ ld.param.u64 %rd1, [rs_p010_to_rgba16f_param_0];+ ld.param.u64 %rd2, [rs_p010_to_rgba16f_param_1];+ ld.param.u32 %r9, [rs_p010_to_rgba16f_param_2];+ ld.param.u32 %r10, [rs_p010_to_rgba16f_param_3];+ ld.param.u32 %r11, [rs_p010_to_rgba16f_param_4];+ ld.param.u32 %r12, [rs_p010_to_rgba16f_param_5];+ ld.param.u64 %rd3, [rs_p010_to_rgba16f_param_6];+ ld.param.u64 %rd4, [rs_p010_to_rgba16f_param_7];+ ld.param.u32 %r17, [rs_p010_to_rgba16f_param_8];+ ld.param.u32 %r18, [rs_p010_to_rgba16f_param_9];+ ld.param.u32 %r13, [rs_p010_to_rgba16f_param_10];+ ld.param.u32 %r14, [rs_p010_to_rgba16f_param_11];+ ld.param.u32 %r15, [rs_p010_to_rgba16f_param_12];+ ld.param.u32 %r16, [rs_p010_to_rgba16f_param_13];+ mov.u32 %r19, %ntid.x;+ mov.u32 %r20, %ctaid.x;+ mov.u32 %r21, %tid.x;+ mad.lo.s32 %r1, %r20, %r19, %r21;+ mov.u32 %r22, %ntid.y;+ mov.u32 %r23, %ctaid.y;+ mov.u32 %r24, %tid.y;+ mad.lo.s32 %r2, %r23, %r22, %r24;+ setp.ge.s32 %p1, %r1, %r17;+ setp.ge.s32 %p2, %r2, %r18;+ or.pred %p3, %p1, %p2;+ @%p3 bra $L__BB1_22;++ setp.eq.s32 %p4, %r15, 90;+ @%p4 bra $L__BB1_6;++ setp.eq.s32 %p5, %r15, 180;+ @%p5 bra $L__BB1_5;++ setp.ne.s32 %p6, %r15, 270;+ mov.u32 %r59, %r1;+ mov.u32 %r60, %r2;+ @%p6 bra $L__BB1_7;++ not.b32 %r25, %r2;+ add.s32 %r59, %r25, %r11;+ mov.u32 %r60, %r1;+ bra.uni $L__BB1_7;++$L__BB1_6:+ not.b32 %r28, %r1;+ add.s32 %r60, %r28, %r12;+ mov.u32 %r59, %r2;+ bra.uni $L__BB1_7;++$L__BB1_5:+ not.b32 %r26, %r1;+ add.s32 %r59, %r26, %r11;+ not.b32 %r27, %r2;+ add.s32 %r60, %r27, %r12;++$L__BB1_7:+ or.b32 %r29, %r60, %r59;+ setp.lt.s32 %p7, %r29, 0;+ setp.ge.s32 %p8, %r59, %r11;+ or.pred %p9, %p8, %p7;+ setp.ge.s32 %p10, %r60, %r12;+ mov.f32 %f101, 0f00000000;+ or.pred %p11, %p10, %p9;+ mov.f32 %f102, %f101;+ mov.f32 %f103, %f101;+ @%p11 bra $L__BB1_21;++ cvta.to.global.u64 %rd5, %rd2;+ shr.u32 %r30, %r9, 31;+ add.s32 %r31, %r9, %r30;+ shr.s32 %r32, %r31, 1;+ or.b32 %r33, %r16, 4;+ setp.eq.s32 %p12, %r33, 6;+ setp.eq.s32 %p13, %r16, 4;+ or.pred %p14, %p13, %p12;+ selp.f32 %f24, 0f3F000000, 0f00000000, %p14;+ mov.f32 %f25, 0f00000000;+ add.s32 %r34, %r16, -3;+ setp.lt.u32 %p15, %r34, 2;+ add.s32 %r35, %r16, -5;+ setp.lt.u32 %p16, %r35, 2;+ selp.f32 %f26, 0f3F800000, 0f3F000000, %p16;+ selp.f32 %f27, 0f00000000, %f26, %p15;+ cvt.rn.f32.s32 %f28, %r59;+ sub.f32 %f29, %f28, %f24;+ mul.f32 %f30, %f29, 0f3F000000;+ cvt.rn.f32.s32 %f31, %r60;+ sub.f32 %f32, %f31, %f27;+ mul.f32 %f33, %f32, 0f3F000000;+ mul.wide.s32 %rd6, %r60, %r32;+ cvt.s64.s32 %rd7, %r59;+ add.s64 %rd8, %rd6, %rd7;+ cvta.to.global.u64 %rd9, %rd1;+ shl.b64 %rd10, %rd8, 1;+ add.s64 %rd11, %rd9, %rd10;+ ld.global.u16 %rs1, [%rd11];+ shr.u16 %rs2, %rs1, 6;+ cvt.rn.f32.u16 %f1, %rs2;+ add.s32 %r36, %r11, 1;+ shr.u32 %r37, %r36, 31;+ add.s32 %r38, %r36, %r37;+ shr.s32 %r39, %r38, 1;+ add.s32 %r40, %r12, 1;+ shr.u32 %r41, %r40, 31;+ add.s32 %r42, %r40, %r41;+ shr.s32 %r43, %r42, 1;+ max.f32 %f34, %f30, %f25;+ add.s32 %r44, %r39, -1;+ cvt.rn.f32.s32 %f35, %r44;+ min.f32 %f36, %f34, %f35;+ max.f32 %f37, %f33, %f25;+ add.s32 %r45, %r43, -1;+ cvt.rn.f32.s32 %f38, %r45;+ min.f32 %f39, %f37, %f38;+ cvt.rmi.f32.f32 %f40, %f36;+ cvt.rzi.s32.f32 %r46, %f40;+ cvt.rmi.f32.f32 %f41, %f39;+ cvt.rzi.s32.f32 %r47, %f41;+ add.s32 %r48, %r46, 1;+ min.s32 %r49, %r44, %r48;+ add.s32 %r50, %r47, 1;+ min.s32 %r51, %r45, %r50;+ sub.f32 %f42, %f36, %f40;+ sub.f32 %f43, %f39, %f41;+ shr.u32 %r52, %r10, 31;+ add.s32 %r53, %r10, %r52;+ shr.s32 %r54, %r53, 1;+ mul.wide.s32 %rd12, %r47, %r54;+ shl.b32 %r55, %r46, 1;+ cvt.s64.s32 %rd13, %r55;+ add.s64 %rd14, %rd12, %rd13;+ shl.b64 %rd15, %rd14, 1;+ add.s64 %rd16, %rd5, %rd15;+ ld.global.u16 %rs3, [%rd16];+ cvt.rn.f32.u16 %f44, %rs3;+ shl.b32 %r56, %r49, 1;+ cvt.s64.s32 %rd17, %r56;+ add.s64 %rd18, %rd12, %rd17;+ shl.b64 %rd19, %rd18, 1;+ add.s64 %rd20, %rd5, %rd19;+ ld.global.u16 %rs4, [%rd20];+ cvt.rn.f32.u16 %f45, %rs4;+ mul.wide.s32 %rd21, %r51, %r54;+ add.s64 %rd22, %rd21, %rd13;+ shl.b64 %rd23, %rd22, 1;+ add.s64 %rd24, %rd5, %rd23;+ ld.global.u16 %rs5, [%rd24];+ cvt.rn.f32.u16 %f46, %rs5;+ add.s64 %rd25, %rd21, %rd17;+ shl.b64 %rd26, %rd25, 1;+ add.s64 %rd27, %rd5, %rd26;+ ld.global.u16 %rs6, [%rd27];+ cvt.rn.f32.u16 %f47, %rs6;+ sub.f32 %f48, %f45, %f44;+ fma.rn.f32 %f49, %f42, %f48, %f44;+ sub.f32 %f50, %f47, %f46;+ fma.rn.f32 %f51, %f42, %f50, %f46;+ sub.f32 %f52, %f51, %f49;+ fma.rn.f32 %f53, %f43, %f52, %f49;+ mul.f32 %f2, %f53, 0f3C800000;+ ld.global.u16 %rs7, [%rd16+2];+ cvt.rn.f32.u16 %f54, %rs7;+ ld.global.u16 %rs8, [%rd20+2];+ cvt.rn.f32.u16 %f55, %rs8;+ ld.global.u16 %rs9, [%rd24+2];+ cvt.rn.f32.u16 %f56, %rs9;+ ld.global.u16 %rs10, [%rd27+2];+ cvt.rn.f32.u16 %f57, %rs10;+ sub.f32 %f58, %f55, %f54;+ fma.rn.f32 %f59, %f42, %f58, %f54;+ sub.f32 %f60, %f57, %f56;+ fma.rn.f32 %f61, %f42, %f60, %f56;+ sub.f32 %f62, %f61, %f59;+ fma.rn.f32 %f63, %f43, %f62, %f59;+ mul.f32 %f3, %f63, 0f3C800000;+ setp.eq.s32 %p17, %r14, 0;+ @%p17 bra $L__BB1_10;++ div.rn.f32 %f96, %f1, 0f447FC000;+ add.f32 %f64, %f2, 0fC4000000;+ div.rn.f32 %f97, %f64, 0f447FC000;+ add.f32 %f65, %f3, 0fC4000000;+ div.rn.f32 %f98, %f65, 0f447FC000;+ bra.uni $L__BB1_11;++$L__BB1_10:+ add.f32 %f66, %f1, 0fC2800000;+ div.rn.f32 %f96, %f66, 0f445B0000;+ add.f32 %f67, %f2, 0fC4000000;+ div.rn.f32 %f97, %f67, 0f44600000;+ add.f32 %f68, %f3, 0fC4000000;+ div.rn.f32 %f98, %f68, 0f44600000;++$L__BB1_11:+ mov.f32 %f100, 0f3E991687;+ mov.f32 %f99, 0f3DE978D5;+ setp.gt.s32 %p18, %r13, 2;+ @%p18 bra $L__BB1_15;++ setp.eq.s32 %p21, %r13, 0;+ @%p21 bra $L__BB1_20;++ setp.eq.s32 %p22, %r13, 2;+ @%p22 bra $L__BB1_14;+ bra.uni $L__BB1_19;++$L__BB1_14:+ mov.f32 %f100, 0f3E86809D;+ mov.f32 %f99, 0f3D72E48F;+ bra.uni $L__BB1_20;++$L__BB1_15:+ setp.eq.s32 %p19, %r13, 3;+ @%p19 bra $L__BB1_18;++ setp.ne.s32 %p20, %r13, 4;+ @%p20 bra $L__BB1_19;++ mov.f32 %f100, 0f3E591687;+ mov.f32 %f99, 0f3DB22D0E;+ bra.uni $L__BB1_20;++$L__BB1_18:+ mov.f32 %f100, 0f3E99999A;+ mov.f32 %f99, 0f3DE147AE;+ bra.uni $L__BB1_20;++$L__BB1_19:+ mov.f32 %f100, 0f3E59B3D0;+ mov.f32 %f99, 0f3D93DD98;++$L__BB1_20:+ mov.f32 %f79, 0f3F800000;+ sub.f32 %f80, %f79, %f100;+ sub.f32 %f81, %f80, %f99;+ add.f32 %f82, %f80, %f80;+ fma.rn.f32 %f83, %f98, %f82, %f96;+ sub.f32 %f84, %f79, %f99;+ add.f32 %f85, %f84, %f84;+ fma.rn.f32 %f86, %f97, %f85, %f96;+ mul.f32 %f87, %f100, %f83;+ sub.f32 %f88, %f96, %f87;+ mul.f32 %f89, %f99, %f86;+ sub.f32 %f90, %f88, %f89;+ div.rn.f32 %f91, %f90, %f81;+ cvt.sat.f32.f32 %f101, %f83;+ cvt.sat.f32.f32 %f102, %f91;+ cvt.sat.f32.f32 %f103, %f86;++$L__BB1_21:+ // begin inline asm+ { cvt.rn.f16.f32 %rs11, %f101;}++ // end inline asm+ // begin inline asm+ { cvt.rn.f16.f32 %rs12, %f102;}++ // end inline asm+ // begin inline asm+ { cvt.rn.f16.f32 %rs13, %f103;}++ // end inline asm+ mov.f32 %f95, 0f3F800000;+ // begin inline asm+ { cvt.rn.f16.f32 %rs14, %f95;}++ // end inline asm+ cvt.s64.s32 %rd28, %r2;+ mul.lo.s64 %rd29, %rd28, %rd4;+ cvta.to.global.u64 %rd30, %rd3;+ add.s64 %rd31, %rd30, %rd29;+ mul.wide.s32 %rd32, %r1, 8;+ add.s64 %rd33, %rd31, %rd32;+ mov.b32 %r57, {%rs13, %rs14};+ mov.b32 %r58, {%rs11, %rs12};+ st.global.v2.u32 [%rd33], {%r58, %r57};++$L__BB1_22:+ ret;++}+ // .globl rs_prepare_420+.visible .entry rs_prepare_420(+ .param .u64 rs_prepare_420_param_0,+ .param .u64 rs_prepare_420_param_1,+ .param .u64 rs_prepare_420_param_2,+ .param .u32 rs_prepare_420_param_3,+ .param .u32 rs_prepare_420_param_4,+ .param .u32 rs_prepare_420_param_5,+ .param .u32 rs_prepare_420_param_6,+ .param .u32 rs_prepare_420_param_7,+ .param .u64 rs_prepare_420_param_8,+ .param .u64 rs_prepare_420_param_9,+ .param .u32 rs_prepare_420_param_10+)+{+ .reg .pred %p<13>;+ .reg .b16 %rs<6>;+ .reg .f32 %f<59>;+ .reg .b32 %r<21>;+ .reg .b64 %rd<25>;+++ ld.param.u64 %rd4, [rs_prepare_420_param_0];+ ld.param.u64 %rd5, [rs_prepare_420_param_1];+ ld.param.u64 %rd6, [rs_prepare_420_param_2];+ ld.param.u32 %r4, [rs_prepare_420_param_3];+ ld.param.u32 %r8, [rs_prepare_420_param_4];+ ld.param.u32 %r9, [rs_prepare_420_param_5];+ ld.param.u32 %r5, [rs_prepare_420_param_6];+ ld.param.u32 %r6, [rs_prepare_420_param_7];+ ld.param.u64 %rd7, [rs_prepare_420_param_8];+ ld.param.u64 %rd8, [rs_prepare_420_param_9];+ ld.param.u32 %r7, [rs_prepare_420_param_10];+ mov.u32 %r10, %ntid.x;+ mov.u32 %r11, %ctaid.x;+ mov.u32 %r12, %tid.x;+ mad.lo.s32 %r1, %r11, %r10, %r12;+ mov.u32 %r13, %ntid.y;+ mov.u32 %r14, %ctaid.y;+ mov.u32 %r15, %tid.y;+ mad.lo.s32 %r2, %r14, %r13, %r15;+ setp.ge.s32 %p1, %r1, %r8;+ setp.ge.s32 %p2, %r2, %r9;+ or.pred %p3, %p1, %p2;+ @%p3 bra $L__BB2_19;++ cvta.to.global.u64 %rd9, %rd4;+ cvt.s64.s32 %rd1, %r2;+ mul.lo.s64 %rd10, %rd1, %rd5;+ add.s64 %rd11, %rd9, %rd10;+ cvt.s64.s32 %rd2, %r1;+ mul.wide.s32 %rd12, %r1, 8;+ add.s64 %rd13, %rd11, %rd12;+ ld.global.v2.u32 {%r16, %r17}, [%rd13];+ cvt.u16.u32 %rs1, %r16;+ // begin inline asm+ { cvt.f32.f16 %f21, %rs1;}++ // end inline asm+ shr.u32 %r20, %r16, 16;+ cvt.u16.u32 %rs2, %r20;+ // begin inline asm+ { cvt.f32.f16 %f22, %rs2;}++ // end inline asm+ cvt.u16.u32 %rs3, %r17;+ // begin inline asm+ { cvt.f32.f16 %f23, %rs3;}++ // end inline asm+ mov.f32 %f55, 0f3E991687;+ mov.f32 %f54, 0f3DE978D5;+ setp.gt.s32 %p4, %r5, 2;+ @%p4 bra $L__BB2_5;++ setp.eq.s32 %p7, %r5, 0;+ @%p7 bra $L__BB2_10;++ setp.eq.s32 %p8, %r5, 2;+ @%p8 bra $L__BB2_4;+ bra.uni $L__BB2_9;++$L__BB2_4:+ mov.f32 %f55, 0f3E86809D;+ mov.f32 %f54, 0f3D72E48F;+ bra.uni $L__BB2_10;++$L__BB2_5:+ setp.eq.s32 %p5, %r5, 3;+ @%p5 bra $L__BB2_8;++ setp.ne.s32 %p6, %r5, 4;+ @%p6 bra $L__BB2_9;++ mov.f32 %f55, 0f3E591687;+ mov.f32 %f54, 0f3DB22D0E;+ bra.uni $L__BB2_10;++$L__BB2_8:+ mov.f32 %f55, 0f3E99999A;+ mov.f32 %f54, 0f3DE147AE;+ bra.uni $L__BB2_10;++$L__BB2_9:+ mov.f32 %f55, 0f3E59B3D0;+ mov.f32 %f54, 0f3D93DD98;++$L__BB2_10:+ cvt.sat.f32.f32 %f34, %f21;+ mov.f32 %f35, 0f3F800000;+ cvt.sat.f32.f32 %f36, %f23;+ sub.f32 %f37, %f35, %f55;+ sub.f32 %f38, %f37, %f54;+ cvt.sat.f32.f32 %f39, %f22;+ mul.f32 %f40, %f39, %f38;+ fma.rn.f32 %f41, %f34, %f55, %f40;+ fma.rn.f32 %f6, %f36, %f54, %f41;+ sub.f32 %f42, %f36, %f6;+ sub.f32 %f43, %f35, %f54;+ add.f32 %f44, %f43, %f43;+ div.rn.f32 %f7, %f42, %f44;+ sub.f32 %f45, %f34, %f6;+ add.f32 %f46, %f37, %f37;+ div.rn.f32 %f8, %f45, %f46;+ setp.eq.s32 %p9, %r6, 0;+ @%p9 bra $L__BB2_12;++ setp.eq.s32 %p10, %r7, 0;+ selp.f32 %f47, 0f437F0000, 0f447FC000, %p10;+ selp.f32 %f48, 0f43000000, 0f44000000, %p10;+ mul.f32 %f56, %f47, %f6;+ fma.rn.f32 %f57, %f47, %f7, %f48;+ fma.rn.f32 %f58, %f47, %f8, %f48;+ bra.uni $L__BB2_15;++$L__BB2_12:+ setp.eq.s32 %p11, %r7, 0;+ @%p11 bra $L__BB2_14;++ fma.rn.f32 %f56, %f6, 0f445B0000, 0f42800000;+ fma.rn.f32 %f57, %f7, 0f44600000, 0f44000000;+ fma.rn.f32 %f58, %f8, 0f44600000, 0f44000000;+ bra.uni $L__BB2_15;++$L__BB2_14:+ fma.rn.f32 %f56, %f6, 0f435B0000, 0f41800000;+ fma.rn.f32 %f57, %f7, 0f43600000, 0f43000000;+ fma.rn.f32 %f58, %f8, 0f43600000, 0f43000000;++$L__BB2_15:+ setp.eq.s32 %p12, %r7, 0;+ selp.f32 %f49, 0f437F0000, 0f447FC000, %p12;+ mov.f32 %f50, 0f00000000;+ max.f32 %f51, %f56, %f50;+ min.f32 %f52, %f51, %f49;+ add.f32 %f53, %f52, 0f3F000000;+ cvt.rzi.u32.f32 %r3, %f53;+ cvt.s64.s32 %rd14, %r4;+ mul.lo.s64 %rd15, %rd14, %rd1;+ cvta.to.global.u64 %rd16, %rd6;+ add.s64 %rd3, %rd16, %rd15;+ @%p12 bra $L__BB2_17;++ cvt.u16.u32 %rs4, %r3;+ shl.b16 %rs5, %rs4, 6;+ shl.b64 %rd17, %rd2, 1;+ add.s64 %rd18, %rd3, %rd17;+ st.global.u16 [%rd18], %rs5;+ bra.uni $L__BB2_18;++$L__BB2_17:+ add.s64 %rd19, %rd3, %rd2;+ st.global.u8 [%rd19], %r3;++$L__BB2_18:+ cvta.to.global.u64 %rd20, %rd7;+ mul.lo.s64 %rd21, %rd1, %rd8;+ add.s64 %rd22, %rd20, %rd21;+ shl.b64 %rd23, %rd2, 3;+ add.s64 %rd24, %rd22, %rd23;+ st.global.v2.f32 [%rd24], {%f57, %f58};++$L__BB2_19:+ ret;++}+ // .globl rs_filter_420_vertical+.visible .entry rs_filter_420_vertical(+ .param .u64 rs_filter_420_vertical_param_0,+ .param .u64 rs_filter_420_vertical_param_1,+ .param .u64 rs_filter_420_vertical_param_2,+ .param .u64 rs_filter_420_vertical_param_3,+ .param .u32 rs_filter_420_vertical_param_4,+ .param .u32 rs_filter_420_vertical_param_5+)+{+ .reg .pred %p<4>;+ .reg .f32 %f<51>;+ .reg .b32 %r<36>;+ .reg .b64 %rd<44>;+++ ld.param.u64 %rd1, [rs_filter_420_vertical_param_0];+ ld.param.u64 %rd2, [rs_filter_420_vertical_param_1];+ ld.param.u64 %rd3, [rs_filter_420_vertical_param_2];+ ld.param.u64 %rd4, [rs_filter_420_vertical_param_3];+ ld.param.u32 %r5, [rs_filter_420_vertical_param_4];+ ld.param.u32 %r4, [rs_filter_420_vertical_param_5];+ mov.u32 %r6, %ctaid.x;+ mov.u32 %r7, %ntid.x;+ mov.u32 %r8, %tid.x;+ mad.lo.s32 %r1, %r6, %r7, %r8;+ mov.u32 %r9, %ntid.y;+ mov.u32 %r10, %ctaid.y;+ mov.u32 %r11, %tid.y;+ mad.lo.s32 %r2, %r10, %r9, %r11;+ setp.ge.s32 %p1, %r1, %r5;+ shl.b32 %r3, %r2, 1;+ setp.ge.s32 %p2, %r3, %r4;+ or.pred %p3, %p1, %p2;+ @%p3 bra $L__BB3_2;++ cvta.to.global.u64 %rd5, %rd3;+ cvta.to.global.u64 %rd6, %rd1;+ add.s32 %r12, %r3, -3;+ add.s32 %r13, %r4, -1;+ min.s32 %r14, %r13, %r12;+ max.s32 %r15, %r14, 0;+ cvt.s64.s32 %rd7, %r15;+ mul.lo.s64 %rd8, %rd7, %rd2;+ add.s64 %rd9, %rd6, %rd8;+ mul.wide.s32 %rd10, %r1, 8;+ add.s64 %rd11, %rd9, %rd10;+ ld.global.v2.f32 {%f1, %f2}, [%rd11];+ fma.rn.f32 %f5, %f1, 0fBC71C6AB, 0f00000000;+ fma.rn.f32 %f6, %f2, 0fBC71C6AB, 0f00000000;+ add.s32 %r16, %r3, -2;+ min.s32 %r17, %r13, %r16;+ max.s32 %r18, %r17, 0;+ cvt.s64.s32 %rd12, %r18;+ mul.lo.s64 %rd13, %rd12, %rd2;+ add.s64 %rd14, %rd6, %rd13;+ add.s64 %rd15, %rd14, %rd10;+ ld.global.v2.f32 {%f7, %f8}, [%rd15];+ fma.rn.f32 %f11, %f7, 0fBCBFFF55, %f5;+ fma.rn.f32 %f12, %f8, 0fBCBFFF55, %f6;+ add.s32 %r19, %r3, -1;+ min.s32 %r20, %r13, %r19;+ max.s32 %r21, %r20, 0;+ cvt.s64.s32 %rd16, %r21;+ mul.lo.s64 %rd17, %rd16, %rd2;+ add.s64 %rd18, %rd6, %rd17;+ add.s64 %rd19, %rd18, %rd10;+ ld.global.v2.f32 {%f13, %f14}, [%rd19];+ fma.rn.f32 %f17, %f13, 0f3E831C73, %f11;+ fma.rn.f32 %f18, %f14, 0f3E831C73, %f12;+ min.s32 %r22, %r13, %r3;+ max.s32 %r23, %r22, 0;+ cvt.s64.s32 %rd20, %r23;+ mul.lo.s64 %rd21, %rd20, %rd2;+ add.s64 %rd22, %rd6, %rd21;+ add.s64 %rd23, %rd22, %rd10;+ ld.global.v2.f32 {%f19, %f20}, [%rd23];+ fma.rn.f32 %f23, %f19, 0f3F4838E4, %f17;+ fma.rn.f32 %f24, %f20, 0f3F4838E4, %f18;+ add.s32 %r24, %r3, 1;+ min.s32 %r25, %r13, %r24;+ max.s32 %r26, %r25, 0;+ cvt.s64.s32 %rd24, %r26;+ mul.lo.s64 %rd25, %rd24, %rd2;+ add.s64 %rd26, %rd6, %rd25;+ add.s64 %rd27, %rd26, %rd10;+ ld.global.v2.f32 {%f25, %f26}, [%rd27];+ fma.rn.f32 %f29, %f25, 0f3F4838E4, %f23;+ fma.rn.f32 %f30, %f26, 0f3F4838E4, %f24;+ add.s32 %r27, %r3, 2;+ min.s32 %r28, %r13, %r27;+ max.s32 %r29, %r28, 0;+ cvt.s64.s32 %rd28, %r29;+ mul.lo.s64 %rd29, %rd28, %rd2;+ add.s64 %rd30, %rd6, %rd29;+ add.s64 %rd31, %rd30, %rd10;+ ld.global.v2.f32 {%f31, %f32}, [%rd31];+ fma.rn.f32 %f35, %f31, 0f3E831C73, %f29;+ fma.rn.f32 %f36, %f32, 0f3E831C73, %f30;+ add.s32 %r30, %r3, 3;+ min.s32 %r31, %r13, %r30;+ max.s32 %r32, %r31, 0;+ cvt.s64.s32 %rd32, %r32;+ mul.lo.s64 %rd33, %rd32, %rd2;+ add.s64 %rd34, %rd6, %rd33;+ add.s64 %rd35, %rd34, %rd10;+ ld.global.v2.f32 {%f37, %f38}, [%rd35];+ fma.rn.f32 %f41, %f37, 0fBCBFFF55, %f35;+ fma.rn.f32 %f42, %f38, 0fBCBFFF55, %f36;+ add.s32 %r33, %r3, 4;+ min.s32 %r34, %r13, %r33;+ max.s32 %r35, %r34, 0;+ cvt.s64.s32 %rd36, %r35;+ mul.lo.s64 %rd37, %rd36, %rd2;+ add.s64 %rd38, %rd6, %rd37;+ add.s64 %rd39, %rd38, %rd10;+ ld.global.v2.f32 {%f43, %f44}, [%rd39];+ fma.rn.f32 %f47, %f43, 0fBC71C6AB, %f41;+ fma.rn.f32 %f48, %f44, 0fBC71C6AB, %f42;+ cvt.s64.s32 %rd40, %r2;+ mul.lo.s64 %rd41, %rd40, %rd4;+ add.s64 %rd42, %rd5, %rd41;+ add.s64 %rd43, %rd42, %rd10;+ div.rn.f32 %f49, %f48, 0f40000003;+ div.rn.f32 %f50, %f47, 0f40000003;+ st.global.v2.f32 [%rd43], {%f50, %f49};++$L__BB3_2:+ ret;++}+ // .globl rs_420_uv_to_nv12+.visible .entry rs_420_uv_to_nv12(+ .param .u64 rs_420_uv_to_nv12_param_0,+ .param .u64 rs_420_uv_to_nv12_param_1,+ .param .u64 rs_420_uv_to_nv12_param_2,+ .param .u32 rs_420_uv_to_nv12_param_3,+ .param .u32 rs_420_uv_to_nv12_param_4,+ .param .u32 rs_420_uv_to_nv12_param_5+)+{+ .reg .pred %p<4>;+ .reg .f32 %f<59>;+ .reg .b32 %r<40>;+ .reg .b64 %rd<29>;+++ ld.param.u64 %rd1, [rs_420_uv_to_nv12_param_0];+ ld.param.u64 %rd2, [rs_420_uv_to_nv12_param_1];+ ld.param.u64 %rd3, [rs_420_uv_to_nv12_param_2];+ ld.param.u32 %r3, [rs_420_uv_to_nv12_param_3];+ ld.param.u32 %r4, [rs_420_uv_to_nv12_param_4];+ ld.param.u32 %r5, [rs_420_uv_to_nv12_param_5];+ mov.u32 %r6, %ntid.x;+ mov.u32 %r7, %ctaid.x;+ mov.u32 %r8, %tid.x;+ mad.lo.s32 %r9, %r7, %r6, %r8;+ mov.u32 %r10, %ntid.y;+ mov.u32 %r11, %ctaid.y;+ mov.u32 %r12, %tid.y;+ mad.lo.s32 %r1, %r11, %r10, %r12;+ shl.b32 %r2, %r9, 1;+ setp.ge.s32 %p1, %r2, %r4;+ shl.b32 %r13, %r1, 1;+ setp.ge.s32 %p2, %r13, %r5;+ or.pred %p3, %p1, %p2;+ @%p3 bra $L__BB4_2;++ cvta.to.global.u64 %rd4, %rd1;+ cvt.s64.s32 %rd5, %r1;+ mul.lo.s64 %rd6, %rd5, %rd2;+ add.s64 %rd7, %rd4, %rd6;+ add.s32 %r14, %r2, -3;+ add.s32 %r15, %r4, -1;+ min.s32 %r16, %r15, %r14;+ max.s32 %r17, %r16, 0;+ mul.wide.s32 %rd8, %r17, 8;+ add.s64 %rd9, %rd7, %rd8;+ ld.global.v2.f32 {%f1, %f2}, [%rd9];+ fma.rn.f32 %f5, %f1, 0fBD0E38D5, 0f00000000;+ mov.f32 %f6, 0f00000000;+ fma.rn.f32 %f7, %f2, 0fBD0E38D5, 0f00000000;+ add.s32 %r18, %r2, -2;+ min.s32 %r19, %r15, %r18;+ max.s32 %r20, %r19, 0;+ mul.wide.s32 %rd10, %r20, 8;+ add.s64 %rd11, %rd7, %rd10;+ ld.global.v2.f32 {%f8, %f9}, [%rd11];+ fma.rn.f32 %f12, %f8, 0f3D638E55, %f5;+ fma.rn.f32 %f13, %f9, 0f3D638E55, %f7;+ add.s32 %r21, %r2, -1;+ min.s32 %r22, %r15, %r21;+ max.s32 %r23, %r22, 0;+ mul.wide.s32 %rd12, %r23, 8;+ add.s64 %rd13, %rd7, %rd12;+ ld.global.v2.f32 {%f14, %f15}, [%rd13];+ fma.rn.f32 %f18, %f14, 0f3F08E38F, %f12;+ fma.rn.f32 %f19, %f15, 0f3F08E38F, %f13;+ min.s32 %r24, %r15, %r2;+ max.s32 %r25, %r24, 0;+ mul.wide.s32 %rd14, %r25, 8;+ add.s64 %rd15, %rd7, %rd14;+ ld.global.v2.f32 {%f20, %f21}, [%rd15];+ fma.rn.f32 %f24, %f20, 0f3F638E39, %f18;+ fma.rn.f32 %f25, %f21, 0f3F638E39, %f19;+ add.s32 %r26, %r2, 1;+ min.s32 %r27, %r15, %r26;+ max.s32 %r28, %r27, 0;+ mul.wide.s32 %rd16, %r28, 8;+ add.s64 %rd17, %rd7, %rd16;+ ld.global.v2.f32 {%f26, %f27}, [%rd17];+ fma.rn.f32 %f30, %f26, 0f3F08E38F, %f24;+ fma.rn.f32 %f31, %f27, 0f3F08E38F, %f25;+ add.s32 %r29, %r2, 2;+ min.s32 %r30, %r15, %r29;+ max.s32 %r31, %r30, 0;+ mul.wide.s32 %rd18, %r31, 8;+ add.s64 %rd19, %rd7, %rd18;+ ld.global.v2.f32 {%f32, %f33}, [%rd19];+ fma.rn.f32 %f36, %f32, 0f3D638E55, %f30;+ fma.rn.f32 %f37, %f33, 0f3D638E55, %f31;+ add.s32 %r32, %r2, 3;+ min.s32 %r33, %r15, %r32;+ max.s32 %r34, %r33, 0;+ mul.wide.s32 %rd20, %r34, 8;+ add.s64 %rd21, %rd7, %rd20;+ ld.global.v2.f32 {%f38, %f39}, [%rd21];+ fma.rn.f32 %f42, %f38, 0fBD0E38D5, %f36;+ fma.rn.f32 %f43, %f39, 0fBD0E38D5, %f37;+ add.s32 %r35, %r2, 4;+ min.s32 %r36, %r15, %r35;+ max.s32 %r37, %r36, 0;+ mul.wide.s32 %rd22, %r37, 8;+ add.s64 %rd23, %rd7, %rd22;+ ld.global.v2.f32 {%f44, %f45}, [%rd23];+ fma.rn.f32 %f48, %f44, 0f00000000, %f42;+ fma.rn.f32 %f49, %f45, 0f00000000, %f43;+ div.rn.f32 %f50, %f48, 0f40000002;+ max.f32 %f51, %f50, %f6;+ mov.f32 %f52, 0f437F0000;+ min.f32 %f53, %f51, %f52;+ add.f32 %f54, %f53, 0f3F000000;+ cvt.rzi.u32.f32 %r38, %f54;+ div.rn.f32 %f55, %f49, 0f40000002;+ max.f32 %f56, %f55, %f6;+ min.f32 %f57, %f56, %f52;+ add.f32 %f58, %f57, 0f3F000000;+ cvt.rzi.u32.f32 %r39, %f58;+ mul.wide.s32 %rd24, %r3, %r1;+ cvt.s64.s32 %rd25, %r2;+ add.s64 %rd26, %rd24, %rd25;+ cvta.to.global.u64 %rd27, %rd3;+ add.s64 %rd28, %rd27, %rd26;+ st.global.u8 [%rd28], %r38;+ st.global.u8 [%rd28+1], %r39;++$L__BB4_2:+ ret;++}+ // .globl rs_420_uv_to_p010+.visible .entry rs_420_uv_to_p010(+ .param .u64 rs_420_uv_to_p010_param_0,+ .param .u64 rs_420_uv_to_p010_param_1,+ .param .u64 rs_420_uv_to_p010_param_2,+ .param .u32 rs_420_uv_to_p010_param_3,+ .param .u32 rs_420_uv_to_p010_param_4,+ .param .u32 rs_420_uv_to_p010_param_5+)+{+ .reg .pred %p<4>;+ .reg .b16 %rs<5>;+ .reg .f32 %f<59>;+ .reg .b32 %r<43>;+ .reg .b64 %rd<30>;+++ ld.param.u64 %rd1, [rs_420_uv_to_p010_param_0];+ ld.param.u64 %rd2, [rs_420_uv_to_p010_param_1];+ ld.param.u64 %rd3, [rs_420_uv_to_p010_param_2];+ ld.param.u32 %r3, [rs_420_uv_to_p010_param_3];+ ld.param.u32 %r4, [rs_420_uv_to_p010_param_4];+ ld.param.u32 %r5, [rs_420_uv_to_p010_param_5];+ mov.u32 %r6, %ntid.x;+ mov.u32 %r7, %ctaid.x;+ mov.u32 %r8, %tid.x;+ mad.lo.s32 %r9, %r7, %r6, %r8;+ mov.u32 %r10, %ntid.y;+ mov.u32 %r11, %ctaid.y;+ mov.u32 %r12, %tid.y;+ mad.lo.s32 %r1, %r11, %r10, %r12;+ shl.b32 %r2, %r9, 1;+ setp.ge.s32 %p1, %r2, %r4;+ shl.b32 %r13, %r1, 1;+ setp.ge.s32 %p2, %r13, %r5;+ or.pred %p3, %p1, %p2;+ @%p3 bra $L__BB5_2;++ cvta.to.global.u64 %rd4, %rd1;+ cvt.s64.s32 %rd5, %r1;+ mul.lo.s64 %rd6, %rd5, %rd2;+ add.s64 %rd7, %rd4, %rd6;+ add.s32 %r14, %r2, -3;+ add.s32 %r15, %r4, -1;+ min.s32 %r16, %r15, %r14;+ max.s32 %r17, %r16, 0;+ mul.wide.s32 %rd8, %r17, 8;+ add.s64 %rd9, %rd7, %rd8;+ ld.global.v2.f32 {%f1, %f2}, [%rd9];+ fma.rn.f32 %f5, %f1, 0fBD0E38D5, 0f00000000;+ mov.f32 %f6, 0f00000000;+ fma.rn.f32 %f7, %f2, 0fBD0E38D5, 0f00000000;+ add.s32 %r18, %r2, -2;+ min.s32 %r19, %r15, %r18;+ max.s32 %r20, %r19, 0;+ mul.wide.s32 %rd10, %r20, 8;+ add.s64 %rd11, %rd7, %rd10;+ ld.global.v2.f32 {%f8, %f9}, [%rd11];+ fma.rn.f32 %f12, %f8, 0f3D638E55, %f5;+ fma.rn.f32 %f13, %f9, 0f3D638E55, %f7;+ add.s32 %r21, %r2, -1;+ min.s32 %r22, %r15, %r21;+ max.s32 %r23, %r22, 0;+ mul.wide.s32 %rd12, %r23, 8;+ add.s64 %rd13, %rd7, %rd12;+ ld.global.v2.f32 {%f14, %f15}, [%rd13];+ fma.rn.f32 %f18, %f14, 0f3F08E38F, %f12;+ fma.rn.f32 %f19, %f15, 0f3F08E38F, %f13;+ min.s32 %r24, %r15, %r2;+ max.s32 %r25, %r24, 0;+ mul.wide.s32 %rd14, %r25, 8;+ add.s64 %rd15, %rd7, %rd14;+ ld.global.v2.f32 {%f20, %f21}, [%rd15];+ fma.rn.f32 %f24, %f20, 0f3F638E39, %f18;+ fma.rn.f32 %f25, %f21, 0f3F638E39, %f19;+ add.s32 %r26, %r2, 1;+ min.s32 %r27, %r15, %r26;+ max.s32 %r28, %r27, 0;+ mul.wide.s32 %rd16, %r28, 8;+ add.s64 %rd17, %rd7, %rd16;+ ld.global.v2.f32 {%f26, %f27}, [%rd17];+ fma.rn.f32 %f30, %f26, 0f3F08E38F, %f24;+ fma.rn.f32 %f31, %f27, 0f3F08E38F, %f25;+ add.s32 %r29, %r2, 2;+ min.s32 %r30, %r15, %r29;+ max.s32 %r31, %r30, 0;+ mul.wide.s32 %rd18, %r31, 8;+ add.s64 %rd19, %rd7, %rd18;+ ld.global.v2.f32 {%f32, %f33}, [%rd19];+ fma.rn.f32 %f36, %f32, 0f3D638E55, %f30;+ fma.rn.f32 %f37, %f33, 0f3D638E55, %f31;+ add.s32 %r32, %r2, 3;+ min.s32 %r33, %r15, %r32;+ max.s32 %r34, %r33, 0;+ mul.wide.s32 %rd20, %r34, 8;+ add.s64 %rd21, %rd7, %rd20;+ ld.global.v2.f32 {%f38, %f39}, [%rd21];+ fma.rn.f32 %f42, %f38, 0fBD0E38D5, %f36;+ fma.rn.f32 %f43, %f39, 0fBD0E38D5, %f37;+ add.s32 %r35, %r2, 4;+ min.s32 %r36, %r15, %r35;+ max.s32 %r37, %r36, 0;+ mul.wide.s32 %rd22, %r37, 8;+ add.s64 %rd23, %rd7, %rd22;+ ld.global.v2.f32 {%f44, %f45}, [%rd23];+ fma.rn.f32 %f48, %f44, 0f00000000, %f42;+ fma.rn.f32 %f49, %f45, 0f00000000, %f43;+ div.rn.f32 %f50, %f48, 0f40000002;+ max.f32 %f51, %f50, %f6;+ mov.f32 %f52, 0f447FC000;+ min.f32 %f53, %f51, %f52;+ add.f32 %f54, %f53, 0f3F000000;+ cvt.rzi.u32.f32 %r38, %f54;+ div.rn.f32 %f55, %f49, 0f40000002;+ max.f32 %f56, %f55, %f6;+ min.f32 %f57, %f56, %f52;+ add.f32 %f58, %f57, 0f3F000000;+ cvt.rzi.u32.f32 %r39, %f58;+ shr.u32 %r40, %r3, 31;+ add.s32 %r41, %r3, %r40;+ shr.s32 %r42, %r41, 1;+ mul.wide.s32 %rd24, %r42, %r1;+ cvt.s64.s32 %rd25, %r2;+ add.s64 %rd26, %rd24, %rd25;+ cvta.to.global.u64 %rd27, %rd3;+ shl.b64 %rd28, %rd26, 1;+ add.s64 %rd29, %rd27, %rd28;+ cvt.u16.u32 %rs1, %r38;+ shl.b16 %rs2, %rs1, 6;+ st.global.u16 [%rd29], %rs2;+ cvt.u16.u32 %rs3, %r39;+ shl.b16 %rs4, %rs3, 6;+ st.global.u16 [%rd29+2], %rs4;++$L__BB5_2:+ ret;++}+ // .globl rs_copy_rgba16f+.visible .entry rs_copy_rgba16f(+ .param .u64 rs_copy_rgba16f_param_0,+ .param .u64 rs_copy_rgba16f_param_1,+ .param .u64 rs_copy_rgba16f_param_2,+ .param .u64 rs_copy_rgba16f_param_3,+ .param .u32 rs_copy_rgba16f_param_4,+ .param .u32 rs_copy_rgba16f_param_5+)+{+ .reg .pred %p<4>;+ .reg .b32 %r<15>;+ .reg .b64 %rd<15>;+++ ld.param.u64 %rd1, [rs_copy_rgba16f_param_0];+ ld.param.u64 %rd2, [rs_copy_rgba16f_param_1];+ ld.param.u64 %rd3, [rs_copy_rgba16f_param_2];+ ld.param.u64 %rd4, [rs_copy_rgba16f_param_3];+ ld.param.u32 %r3, [rs_copy_rgba16f_param_4];+ ld.param.u32 %r4, [rs_copy_rgba16f_param_5];+ mov.u32 %r5, %ctaid.x;+ mov.u32 %r6, %ntid.x;+ mov.u32 %r7, %tid.x;+ mad.lo.s32 %r1, %r5, %r6, %r7;+ mov.u32 %r8, %ntid.y;+ mov.u32 %r9, %ctaid.y;+ mov.u32 %r10, %tid.y;+ mad.lo.s32 %r2, %r9, %r8, %r10;+ setp.ge.s32 %p1, %r1, %r3;+ setp.ge.s32 %p2, %r2, %r4;+ or.pred %p3, %p1, %p2;+ @%p3 bra $L__BB6_2;++ cvta.to.global.u64 %rd5, %rd1;+ cvt.s64.s32 %rd6, %r2;+ mul.lo.s64 %rd7, %rd6, %rd2;+ add.s64 %rd8, %rd5, %rd7;+ cvta.to.global.u64 %rd9, %rd3;+ mul.lo.s64 %rd10, %rd6, %rd4;+ add.s64 %rd11, %rd9, %rd10;+ mul.wide.s32 %rd12, %r1, 8;+ add.s64 %rd13, %rd8, %rd12;+ ld.global.v2.u32 {%r11, %r12}, [%rd13];+ add.s64 %rd14, %rd11, %rd12;+ st.global.v2.u32 [%rd14], {%r11, %r12};++$L__BB6_2:+ ret;++}+++)VE_RS_PTX";diff --git a/src/processing/reshade_dependencies.hpp b/src/processing/reshade_dependencies.hppnew file mode 100644index 0000000..55f021d--- /dev/null+++ b/src/processing/reshade_dependencies.hpp@@ -0,0 +1,88 @@+#pragma once+#include "configuration/settings.hpp"+#include <QCryptographicHash>+#include <QDateTime>+#include <QDir>+#include <QDirIterator>+#include <QFile>+#include <QFileInfo>+#include <QJsonDocument>+#include <QJsonObject>+#include <QSet>++namespace ve {+inline QJsonObject reshadeOverrideValues(const QString& raw) {+ if (raw.trimmed().startsWith('{')) return QJsonDocument::fromJson(raw.toUtf8()).object();+ QJsonObject values;+ for (const auto& line : raw.split('\n', Qt::SkipEmptyParts)) {+ const auto eq = line.indexOf('=');+ if (eq > 0) values.insert(line.left(eq).trimmed(), line.mid(eq + 1).trimmed());+ }+ return values;+}+inline QString reshadeGraphOverrides(const QString& raw) {+ const auto values = reshadeOverrideValues(raw);+ QJsonObject graph;+ for (auto it = values.begin(); it != values.end(); ++it)+ if (it.key() == "Techniques" || it.key() == "TechniqueSorting" || it.key().endsWith("PreprocessorDefinitions"))+ graph.insert(it.key(), it.value());+ return QString::fromUtf8(QJsonDocument(graph).toJson(QJsonDocument::Compact));+}+// A CPU-only identity shared by inspection and preview caching. Automatic+// package roots must be represented even when the path fields are empty.+inline QByteArray reshadeDependencyIdentity(const Settings& raw, bool video, const QString& root) {+ const auto s = reshadeSettingsForMode(raw, video);+ QSet<QString> files;+ const auto addFile = [&](const QString& path) {+ const QFileInfo fi(path);+ if (fi.isFile()) files.insert(fi.canonicalFilePath());+ };+ QSet<QString> scanned;+ const auto scan = [&](const QString& dir, bool recursive) {+ const auto key = QDir::cleanPath(dir) + (recursive ? "/**" : "/.");+ if (scanned.contains(key)) return;+ scanned.insert(key);+ QDirIterator it(dir, QDir::Files, recursive ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags);+ while (it.hasNext()) {+ const auto path = it.next();+ const auto ext = QFileInfo(path).suffix().toLower();+ if (QStringList{"ini", "fx", "fxh", "cube", "png", "jpg", "jpeg", "bmp", "dds", "tga", "tif", "tiff", "webp", "json"}.contains(ext))+ addFile(path);+ }+ };+ addFile(s.reshade_preset_path);+ const auto parent = QFileInfo(s.reshade_preset_path).absolutePath();+ const auto runtime = root + "/bin/runtime/reshade";+ for (const auto& paths : {s.reshade_shader_search_paths, s.reshade_texture_search_paths}) {+ if (!paths.trimmed().isEmpty()) {+ for (const auto& path : paths.split(';', Qt::SkipEmptyParts)) scan(path.trimmed(), true);+ } else if (!s.reshade_preset_path.isEmpty()) {+ scan(parent, false);+ for (const auto& path : {parent + "/Shaders", parent + "/Textures", parent + "/reshade-shaders",+ runtime + "/reshade-shaders", runtime + "/shaders", runtime + "/textures"})+ scan(path, true);+ }+ }+ addFile(runtime + "/runtime-manifest.json");+ addFile(runtime + "/models/moge-2-vits/model.manifest.json");+ auto sorted = files.values();+ sorted.sort();+ QCryptographicHash hash(QCryptographicHash::Sha256);+ hash.addData("reshade-media-v5-moge2");+ for (const auto& path : sorted) {+ hash.addData(path.toUtf8());+ QFile f(path);+ if (f.open(QIODevice::ReadOnly)) hash.addData(&f);+ }+ for (const auto& name : {"neuroframe_engine_reshade.dll", "ve_reshade_runtime.dll", "onnxruntime.dll", "DirectML.dll"}) {+ const QFileInfo f(runtime + '/' + name);+ hash.addData(QJsonDocument(QJsonObject{{"path", f.absoluteFilePath()}, {"bytes", f.size()},+ {"modified", f.lastModified().toMSecsSinceEpoch()}}).toJson(QJsonDocument::Compact));+ }+ for (const auto& name : {"model.onnx"}) {+ const QFileInfo f(runtime + "/models/moge-2-vits/" + name);+ hash.addData(QJsonDocument(QJsonObject{{"bytes", f.size()}, {"modified", f.lastModified().toMSecsSinceEpoch()}}).toJson(QJsonDocument::Compact));+ }+ return hash.result();+}+} // namespace vediff --git a/src/processing/reshade_native.cpp b/src/processing/reshade_native.cppnew file mode 100644index 0000000..63a5430--- /dev/null+++ b/src/processing/reshade_native.cpp@@ -0,0 +1,766 @@+#include "reshade_native.hpp"+#include "reshade_cuda_adapter.hpp"+#include "infrastructure/log.hpp"+#include "infrastructure/paths.hpp"+#include "media/media.hpp"+#include "media/resolution.hpp"+#include "native_engines.hpp"+#include <QColorSpace>+#include <QDir>+#include <QFile>+#include <QFileInfo>+#include <QJsonArray>+#include <QJsonDocument>+#include <QJsonObject>+#include <QTextStream>+#include <algorithm>+#include <array>+#include <cmath>+#include <mutex>+#include <stdexcept>+#include <windows.h>++namespace ve {+namespace {+using ErrorBuf = std::array<char, 4096>;++int reshadeDxgiOrdinal(int cudaOrdinal) {+ // CUDA/NVIDIA ordinals are not DXGI enumeration indices. Match by LUID+ // when CUDA exists; a host-only D3D12 session does not require CUDA.+ static HMODULE cuda = LoadLibraryW(L"nvcuda.dll");+ if (!cuda) return cudaOrdinal;+ const auto init = reinterpret_cast<int(__cdecl*)(unsigned)>(GetProcAddress(cuda, "cuInit"));+ const auto device = reinterpret_cast<int(__cdecl*)(int*, int)>(GetProcAddress(cuda, "cuDeviceGet"));+ const auto luid = reinterpret_cast<int(__cdecl*)(char*, unsigned*, int)>(GetProcAddress(cuda, "cuDeviceGetLuid"));+ int dev = 0;+ LUID id{};+ unsigned mask = 0;+ if (!init || !device || !luid || init(0) || device(&dev, cudaOrdinal) ||+ luid(reinterpret_cast<char*>(&id), &mask, dev)) return cudaOrdinal;+ Microsoft::WRL::ComPtr<IDXGIFactory4> factory;+ if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&factory)))) return cudaOrdinal;+ for (UINT index = 0;; ++index) {+ Microsoft::WRL::ComPtr<IDXGIAdapter1> adapter;+ if (factory->EnumAdapters1(index, &adapter) == DXGI_ERROR_NOT_FOUND) break;+ DXGI_ADAPTER_DESC1 desc{};+ if (adapter && SUCCEEDED(adapter->GetDesc1(&desc)) &&+ desc.AdapterLuid.HighPart == id.HighPart && desc.AdapterLuid.LowPart == id.LowPart) return 100 + int(index);+ }+ throw std::runtime_error("The selected NVIDIA GPU has no matching D3D12 adapter.");+}++void check(int ok, const ErrorBuf& err, const char* fallback = "ReShade native engine call failed.") {+ if (!ok) {+ throw std::runtime_error(err[0] ? err.data() : fallback);+ }+}++struct Api {+ HMODULE library = nullptr;+ std::recursive_mutex mutex;+ std::mutex sessionMutex;+ bool initialized = false;+ int ordinal = -1;++#define VE_RS_FN(name) decltype(&name) name##Fn = nullptr+ VE_RS_FN(reshade_abi_version);+ VE_RS_FN(reshade_version);+ VE_RS_FN(reshade_optical_flow_backend);+ VE_RS_FN(reshade_init_v2);+ VE_RS_FN(reshade_capabilities);+ VE_RS_FN(reshade_status);+ VE_RS_FN(reshade_inspect_preset);+ VE_RS_FN(reshade_export_preset_copy);+ VE_RS_FN(reshade_session_create);+ VE_RS_FN(reshade_session_release);+ VE_RS_FN(reshade_session_status);+ VE_RS_FN(reshade_process_host);+ VE_RS_FN(reshade_process_d3d12);+ VE_RS_FN(reshade_session_d3d12_device);+ VE_RS_FN(reshade_session_d3d12_queue);++ int (*reshade_process_cuda_yuvFn)(void*, const VeReShadeCudaYuvDesc*, void**, VeReShadeFrameResult*, char*, int) =+ [](void* handle, const VeReShadeCudaYuvDesc* frame, void** out_surface, VeReShadeFrameResult* result, char* error, int capacity) -> int {+ return ReShadeCudaAdapter::instance().processCudaYuv(handle, frame, out_surface, result, error, capacity);+ };+ int (*reshade_process_cuda_rgba16fFn)(void*, const VeReShadeCudaRgbDesc*, void**, VeReShadeFrameResult*, char*, int) =+ [](void* handle, const VeReShadeCudaRgbDesc* frame, void** out_surface, VeReShadeFrameResult* result, char* error, int capacity) -> int {+ return ReShadeCudaAdapter::instance().processCudaRgb(handle, frame, out_surface, result, error, capacity);+ };+ int (*reshade_cuda_surface_descFn)(void*, VeReShadeCudaSurfaceDesc*) =+ [](void* surface, VeReShadeCudaSurfaceDesc* desc) -> int {+ return ReShadeCudaAdapter::instance().surfaceDesc(surface, desc);+ };+ void (*reshade_cuda_surface_retainFn)(void*) =+ [](void* surface) {+ ReShadeCudaAdapter::instance().surfaceRetain(surface);+ };+ void (*reshade_cuda_surface_releaseFn)(void*) =+ [](void* surface) {+ ReShadeCudaAdapter::instance().surfaceRelease(surface);+ };+#undef VE_RS_FN++ Api() {+ const auto dllPath = QDir::toNativeSeparators(+ Paths::instance().at("bin/runtime/reshade/neuroframe_engine_reshade.dll")).toStdWString();+ library = LoadLibraryExW(dllPath.c_str(), nullptr,+ LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32);+ if (!library) {+ throw std::runtime_error("Cannot load ReShade native engine (neuroframe_engine_reshade.dll): Windows error " ++ std::to_string(GetLastError()));+ }+#define VE_RS_LOAD(name) \+ name##Fn = reinterpret_cast<decltype(name##Fn)>(GetProcAddress(library, #name)); \+ if (!name##Fn) throw std::runtime_error("Missing ReShade engine export: " #name)+ VE_RS_LOAD(reshade_abi_version);+ VE_RS_LOAD(reshade_version);+ VE_RS_LOAD(reshade_optical_flow_backend);+ VE_RS_LOAD(reshade_init_v2);+ VE_RS_LOAD(reshade_capabilities);+ VE_RS_LOAD(reshade_status);+ VE_RS_LOAD(reshade_inspect_preset);+ VE_RS_LOAD(reshade_export_preset_copy);+ VE_RS_LOAD(reshade_session_create);+ VE_RS_LOAD(reshade_session_release);+ VE_RS_LOAD(reshade_session_status);+ VE_RS_LOAD(reshade_process_host);+ VE_RS_LOAD(reshade_process_d3d12);+ VE_RS_LOAD(reshade_session_d3d12_device);+ VE_RS_LOAD(reshade_session_d3d12_queue);+#undef VE_RS_LOAD++ if (reshade_abi_versionFn() != VE_RESHADE_ABI_VERSION) {+ throw std::runtime_error("Incompatible ReShade native engine ABI version.");+ }+ const QString backend = QString::fromUtf8(reshade_optical_flow_backendFn());+ if (!backend.startsWith("AMD FidelityFX Optical Flow 1.1.2")) {+ throw std::runtime_error("ReShade optical flow backend contract violation: expected AMD FidelityFX Optical Flow 1.1.2.");+ }+ }++ void ensureInitialized(int gpuOrdinal) {+ std::lock_guard lock(mutex);+ if (initialized && ordinal == gpuOrdinal) {+ return;+ }+ const auto runtimeRoot = QDir::toNativeSeparators(Paths::instance().at("bin/runtime/reshade")).toStdWString();+ const auto dataRoot = QDir::toNativeSeparators(Paths::instance().nativeDataDirectory()).toStdWString();+ ErrorBuf err{};+ check(reshade_init_v2Fn(reshadeDxgiOrdinal(gpuOrdinal), runtimeRoot.c_str(), dataRoot.c_str(), err.data(), int(err.size())),+ err, "ReShade engine initialization failed.");+ ReShadeCudaAdapter::instance().initialize(gpuOrdinal);+ initialized = true;+ ordinal = gpuOrdinal;+ }++ static Api& get() {+ static Api instance;+ return instance;+ }+};++uint32_t mapPrecisionPolicy(const QString& policy) {+ if (policy == "FP16") return VE_RESHADE_PRECISION_FP16;+ if (policy == "8-bit sRGB Compatibility") return VE_RESHADE_PRECISION_UNORM8_SRGB;+ return VE_RESHADE_PRECISION_AUTO;+}++uint32_t mapHdrPolicy(const QString& policy) {+ if (policy == "HDR Aware") return VE_RESHADE_HDR_AWARE;+ if (policy == "SDR Adapter") return VE_RESHADE_HDR_SDR_ADAPTER;+ if (policy == "Reject Unsupported") return VE_RESHADE_HDR_REJECT_UNSUPPORTED;+ return VE_RESHADE_HDR_AUTO;+}++uint32_t mapDepthMode(const QString& mode) {+ if (mode == "Off") return VE_RESHADE_DEPTH_OFF;+ if (mode == "AI Depth") return VE_RESHADE_DEPTH_AI;+ return VE_RESHADE_DEPTH_AUTO;+}++uint32_t mapTemporalPolicy(const QString& policy) {+ if (policy == "Spatial Only (Off)") return VE_RESHADE_TEMPORAL_SPATIAL_OFF;+ return VE_RESHADE_TEMPORAL_QUALITY;+}++qint64 secondsToNs(double seconds) {+ if (!std::isfinite(seconds) || seconds < 0.0) return 0;+ return qint64(std::llround(seconds * 1000000000.0));+}+} // namespace++uint32_t reshadeColorTransfer(const MediaInfo& info, bool hdrOverride) {+ if (info.transfer == "smpte2084") return VE_RESHADE_TRANSFER_PQ;+ if (info.transfer == "arib-std-b67") return VE_RESHADE_TRANSFER_HLG;+ if (info.transfer == "linear") return VE_RESHADE_TRANSFER_LINEAR;+ if (hdrOverride || info.hdr) return VE_RESHADE_TRANSFER_PQ;+ if (!info.video || QStringList{"iec61966-2-1", "srgb"}.contains(info.transfer)) return VE_RESHADE_TRANSFER_SRGB;+ if (QStringList{"gamma22", "bt470m"}.contains(info.transfer)) return VE_RESHADE_TRANSFER_GAMMA22;+ if (QStringList{"gamma28", "bt470bg"}.contains(info.transfer)) return VE_RESHADE_TRANSFER_GAMMA28;+ return VE_RESHADE_TRANSFER_BT709;+}++bool reshadeUsesTemporalDepth(const Settings& raw, bool video) {+ if (!video) return false;+ const auto s = reshadeSettingsForMode(raw, true);+ if (s.reshade_temporal_stability == "Spatial Only (Off)") return false;+ return s.reshade_depth_mode != "Off";+}++QString reshadeReport(const Settings& raw, bool video) {+ const auto s = reshadeSettingsForMode(raw, video);+ const QString presetName = s.reshade_preset_path.isEmpty()+ ? QStringLiteral("No preset (passthrough)")+ : QFileInfo(s.reshade_preset_path).fileName();+ return QString("ReShade (%1, mix %2%, depth %3, motion AMD FidelityFX Optical Flow 1.1.2)")+ .arg(presetName)+ .arg(s.reshade_mix)+ .arg(s.reshade_depth_mode);+}++void ReShadeEngine::initialize(int ordinal) {+ Api::get().ensureInitialized(ordinal);+}++VeReShadeCapabilities ReShadeEngine::capabilities(int ordinal) {+ auto& api = Api::get();+ api.ensureInitialized(ordinal);+ std::lock_guard lock(api.mutex);+ VeReShadeCapabilities caps{};+ caps.size = sizeof(caps);+ caps.abi = VE_RESHADE_ABI_VERSION;+ ErrorBuf err{};+ check(api.reshade_capabilitiesFn(&caps, err.data(), int(err.size())), err, "Cannot query ReShade capabilities.");+ caps.cuda_interop_available = ReShadeCudaAdapter::instance().isAvailable() ? 1u : 0u;+ return caps;+}++QString ReShadeEngine::version() {+ return QString::fromUtf8(Api::get().reshade_versionFn());+}++QString ReShadeEngine::opticalFlowBackend() {+ return QString::fromUtf8(Api::get().reshade_optical_flow_backendFn());+}++QString ReShadeEngine::diagnostics() {+ try {+ auto& api = Api::get();+ if (!api.initialized) {+ api.ensureInitialized(0);+ }+ std::array<char, 8192> buf{};+ if (api.reshade_statusFn(buf.data(), int(buf.size()))) {+ return QString::fromUtf8(buf.data());+ }+ return QStringLiteral("{}");+ } catch (const std::exception& e) {+ return QString::fromUtf8(e.what());+ }+}++QVariantMap ReShadeEngine::statusMap() {+ const auto json = diagnostics().toUtf8();+ return QJsonDocument::fromJson(json).object().toVariantMap();+}++QString ReShadeEngine::presetResetOverrides(const QString& presetPath) {+ if (presetPath.trimmed().isEmpty()) return {};+ struct PresetDefaults {+ bool hasTechniques = false;+ QString techniques, redirect;+ };+ const auto read = [](const QString& path) {+ QFile file(path);+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))+ throw std::runtime_error(file.errorString().toStdString());+ PresetDefaults defaults;+ QTextStream stream(&file);+ QString section;+ while (!stream.atEnd()) {+ const auto line = stream.readLine().trimmed();+ if (line.isEmpty() || line.startsWith(';') || line.startsWith('#')) continue;+ if (line.startsWith('[') && line.endsWith(']')) {+ section = line.mid(1, line.size() - 2);+ continue;+ }+ const auto separator = line.indexOf('=');+ if (separator < 0) continue;+ const auto key = line.left(separator).trimmed();+ const auto value = line.mid(separator + 1).trimmed();+ if (section.isEmpty() && key == "Techniques") {+ defaults.hasTechniques = true;+ defaults.techniques = value;+ } else if (section == "GENERAL") {+ if (key == "PresetFiles") defaults.redirect = value.section(',', 0, 0).trimmed();+ else if (defaults.redirect.isEmpty() && (key == "PresetPath" || key == "CurrentPresetPath"))+ defaults.redirect = value;+ }+ }+ if (stream.status() != QTextStream::Ok)+ throw std::runtime_error(file.errorString().toStdString());+ return defaults;+ };+ const QFileInfo preset(localPath(presetPath));+ auto defaults = read(preset.absoluteFilePath());+ // Match the runtime's one-level ReShade.ini preset indirection.+ if (!defaults.hasTechniques && !defaults.redirect.isEmpty()) {+ const auto target = QDir(preset.absolutePath()).filePath(defaults.redirect);+ if (QFileInfo(target).isFile()) defaults = read(target);+ }+ QJsonObject overrides;+ if (defaults.hasTechniques) overrides.insert("Techniques", defaults.techniques);+ return QString::fromUtf8(QJsonDocument(overrides).toJson(QJsonDocument::Compact));+}++QByteArray normalizeOverridesForBridge(const QString& raw) {+ const auto trimmed = raw.trimmed();+ if (trimmed.isEmpty())+ return {};+ if (trimmed.startsWith('{')) {+ QJsonParseError err{};+ const auto doc = QJsonDocument::fromJson(trimmed.toUtf8(), &err);+ if (err.error == QJsonParseError::NoError && doc.isObject()) {+ QStringList lines;+ const auto obj = doc.object();+ for (auto it = obj.begin(); it != obj.end(); ++it) {+ if (it.value().isBool())+ lines.append(it.key() + '=' + (it.value().toBool() ? "1" : "0"));+ else if (it.value().isArray()) {+ QStringList parts;+ for (const auto& elem : it.value().toArray())+ parts.append(elem.toVariant().toString());+ lines.append(it.key() + '=' + parts.join(','));+ } else+ lines.append(it.key() + '=' + it.value().toVariant().toString());+ }+ return lines.join('\n').toUtf8();+ }+ }+ return trimmed.toUtf8();+}++QVariantMap ReShadeEngine::inspectPreset(const Settings& raw, bool video, QSize previewSize) {+ const auto s = reshadeSettingsForMode(raw, video);+ if (s.reshade_preset_path.trimmed().isEmpty()) {+ return {+ {"valid", true},+ {"empty", true},+ {"error", QString()},+ {"compatibility_class", QStringLiteral("none")},+ {"requires_depth", false},+ {"requires_unorm8", false},+ {"requires_custom_semantic", false},+ {"uses_interactive_input", false},+ {"optical_flow_backend", QStringLiteral("AMD FidelityFX Optical Flow 1.1.2")},+ {"techniques", QVariantList{}},+ {"parameters", QVariantList{}},+ {"dependencies", QVariantList{}}+ };+ }++ auto& api = Api::get();+ api.ensureInitialized(gpuOrdinal(s.ai_gpu_uuid));+ std::lock_guard sessionLock(api.sessionMutex);+ std::lock_guard apiLock(api.mutex);++ const QByteArray presetUtf8 = s.reshade_preset_path.toUtf8();+ const QByteArray shadersUtf8 = s.reshade_shader_search_paths.toUtf8();+ const QByteArray texturesUtf8 = s.reshade_texture_search_paths.toUtf8();+ const QByteArray overridesUtf8 = normalizeOverridesForBridge(s.reshade_parameter_overrides);++ VeReShadePresetDesc desc{};+ desc.size = sizeof(desc);+ desc.abi = VE_RESHADE_ABI_VERSION;+ desc.preset_path_utf8 = presetUtf8.constData();+ desc.shader_roots_utf8 = shadersUtf8.constData();+ desc.texture_roots_utf8 = texturesUtf8.constData();+ desc.overrides_json_utf8 = overridesUtf8.constData();+ desc.preview_width = uint32_t(std::clamp(previewSize.width(), 16, 4096));+ desc.preview_height = uint32_t(std::clamp(previewSize.height(), 16, 4096));++ std::vector<char> jsonBuf(1024 * 1024, '\0');+ ErrorBuf err{};+ const int rc = api.reshade_inspect_presetFn(&desc, jsonBuf.data(), int(jsonBuf.size()), err.data(), int(err.size()));+ auto map = QJsonDocument::fromJson(QByteArray(jsonBuf.data())).object().toVariantMap();+ if (!rc && map.value("error").toString().isEmpty()) {+ map["valid"] = false;+ map["error"] = QString::fromUtf8(err[0] ? err.data() : "ReShade preset validation failed.");+ }+ return map;+}++void ReShadeEngine::exportPresetCopy(const Settings& raw, bool video, const QString& destinationPath) {+ const auto s = reshadeSettingsForMode(raw, video);+ if (s.reshade_preset_path.trimmed().isEmpty()) {+ throw std::runtime_error("Select a ReShade .ini preset before exporting a copy.");+ }+ auto& api = Api::get();+ api.ensureInitialized(gpuOrdinal(s.ai_gpu_uuid));+ std::lock_guard apiLock(api.mutex);++ const QByteArray presetUtf8 = s.reshade_preset_path.toUtf8();+ const QByteArray shadersUtf8 = s.reshade_shader_search_paths.toUtf8();+ const QByteArray texturesUtf8 = s.reshade_texture_search_paths.toUtf8();+ const QByteArray overridesUtf8 = normalizeOverridesForBridge(s.reshade_parameter_overrides);+ const QByteArray dstUtf8 = destinationPath.toUtf8();++ VeReShadePresetDesc desc{};+ desc.size = sizeof(desc);+ desc.abi = VE_RESHADE_ABI_VERSION;+ desc.preset_path_utf8 = presetUtf8.constData();+ desc.shader_roots_utf8 = shadersUtf8.constData();+ desc.texture_roots_utf8 = texturesUtf8.constData();+ desc.overrides_json_utf8 = overridesUtf8.constData();+ desc.preview_width = 64;+ desc.preview_height = 64;++ ErrorBuf err{};+ check(api.reshade_export_preset_copyFn(&desc, dstUtf8.constData(), err.data(), int(err.size())),+ err, "Cannot export ReShade preset copy.");+}++struct ReShadeSession::State {+ std::unique_lock<std::mutex> ownership;+ void* handle = nullptr;+ QSize size;+ MediaInfo colors;+ bool still = false;+ bool wideOutput = false;+ uint32_t transfer = VE_RESHADE_TRANSFER_BT709;+ VeReShadeFrameResult lastResult{};++ ~State() {+ if (handle) {+ ReShadeCudaAdapter::instance().releaseSessionBuffers(handle);+ auto& api = Api::get();+ std::lock_guard lock(api.mutex);+ api.reshade_session_releaseFn(handle);+ handle = nullptr;+ }+ }+};++ReShadeSession::ReShadeSession(QSize size, const Settings& raw, const MediaInfo& colors,+ bool still, bool wideOutput, bool preserveAlpha)+ : state_(std::make_unique<State>()) {+ requireResolution(size, "ReShade session");+ const auto s = reshadeSettingsForMode(raw, !still);+ const int ordinal = gpuOrdinal(s.ai_gpu_uuid);+ auto& api = Api::get();+ api.ensureInitialized(ordinal);++ state_->ownership = std::unique_lock<std::mutex>(api.sessionMutex);+ std::lock_guard apiLock(api.mutex);++ state_->size = size;+ state_->colors = colors;+ state_->still = still;+ state_->wideOutput = wideOutput;+ state_->transfer = reshadeColorTransfer(colors);++ const QByteArray presetUtf8 = s.reshade_preset_path.trimmed().toUtf8();+ const QByteArray shadersUtf8 = s.reshade_shader_search_paths.toUtf8();+ const QByteArray texturesUtf8 = s.reshade_texture_search_paths.toUtf8();+ const QByteArray overridesUtf8 = normalizeOverridesForBridge(s.reshade_parameter_overrides);++ VeReShadeSessionDesc desc{};+ desc.size = sizeof(desc);+ desc.abi = VE_RESHADE_ABI_VERSION;+ desc.width = uint32_t(size.width());+ desc.height = uint32_t(size.height());+ desc.still_image = still ? 1u : 0u;+ desc.precision_policy = mapPrecisionPolicy(s.reshade_precision_policy);+ desc.color_transfer = state_->transfer;+ desc.hdr_policy = mapHdrPolicy(s.reshade_hdr_policy);+ desc.depth_mode = mapDepthMode(s.reshade_depth_mode);+ desc.depth_resolution_bound = uint32_t(std::clamp(s.reshade_depth_resolution, 196, 1008));+ desc.temporal_policy = still ? VE_RESHADE_TEMPORAL_SPATIAL_OFF : mapTemporalPolicy(s.reshade_temporal_stability);+ desc.temporal_strength = float(std::clamp(s.reshade_temporal_strength / 100.0, 0.0, 1.0));+ desc.mix = float(std::clamp(s.reshade_mix / 100.0, 0.0, 1.0));+ desc.preserve_alpha = (preserveAlpha && s.reshade_preserve_alpha) ? 1u : 0u;+ desc.deterministic_seed = uint32_t(s.reshade_deterministic_seed);+ desc.preset_path_utf8 = presetUtf8.constData();+ desc.shader_roots_utf8 = shadersUtf8.constData();+ desc.texture_roots_utf8 = texturesUtf8.constData();+ desc.overrides_json_utf8 = overridesUtf8.constData();++ ErrorBuf err{};+ state_->handle = api.reshade_session_createFn(&desc, err.data(), int(err.size()));+ check(state_->handle != nullptr, err, "Cannot create ReShade session.");+}++ReShadeSession::~ReShadeSession() = default;++QImage ReShadeSession::process(const QImage& input, bool reset, qint64 frameOrdinal,+ qint64 ptsNs, qint64 durationNs) {+ auto& api = Api::get();+ std::lock_guard lock(api.mutex);++ const bool fp16 = input.format() == QImage::Format_RGBA16FPx4;+ const auto source = fp16 ? input+ : input.convertToFormat(input.format() == QImage::Format_RGBA8888+ ? QImage::Format_RGBA8888+ : QImage::Format_RGBA64);+ const bool eightOut = !fp16 && state_->still && !state_->wideOutput && source.depth() <= 32;+ QImage output(state_->size, fp16 ? QImage::Format_RGBA16FPx4+ : eightOut ? QImage::Format_RGBA8888+ : QImage::Format_RGBA64);+ requireImageAllocation(output, "ReShade output allocation");++ VeReShadeHostFrameDesc frame{};+ frame.size = sizeof(frame);+ frame.abi = VE_RESHADE_ABI_VERSION;+ frame.input_pixels = source.constBits();+ frame.output_pixels = output.bits();+ frame.input_stride = uint32_t(source.bytesPerLine());+ frame.output_stride = uint32_t(output.bytesPerLine());+ frame.input_format = fp16 ? VE_RESHADE_FORMAT_RGBA16F+ : source.format() == QImage::Format_RGBA8888 ? VE_RESHADE_FORMAT_RGBA8+ : VE_RESHADE_FORMAT_RGBA16_UNORM;+ frame.output_format = fp16 ? VE_RESHADE_FORMAT_RGBA16F+ : eightOut ? VE_RESHADE_FORMAT_RGBA8+ : VE_RESHADE_FORMAT_RGBA16_UNORM;+ frame.frame_ordinal = uint64_t(std::max<qint64>(0, frameOrdinal));+ frame.pts_ns = ptsNs;+ frame.duration_ns = std::max<qint64>(1, durationNs);+ frame.reset = reset ? 1u : 0u;++ state_->lastResult = {};+ state_->lastResult.size = sizeof(VeReShadeFrameResult);+ state_->lastResult.abi = VE_RESHADE_ABI_VERSION;+ ErrorBuf err{};+ check(api.reshade_process_hostFn(state_->handle, &frame, &state_->lastResult, err.data(), int(err.size())),+ err, "ReShade host frame processing failed.");+ output.setColorSpace(input.colorSpace());+ return output;+}++CudaVideoFrame ReShadeSession::process(const CudaVideoFrame& input, CudaFramePool& pool,+ bool p010, bool reset, qint64 frameOrdinal) {+ if (!input.owner || input.memory != FrameMemory::Cuda) {+ throw std::runtime_error("ReShade CUDA YUV processing requires owned CUDA decoder planes.");+ }+ auto& api = Api::get();+ std::lock_guard lock(api.mutex);++ const double ptsSec = (input.timeBase.denominator > 0)+ ? double(input.pts) * input.timeBase.numerator / input.timeBase.denominator+ : 0.0;+ const double durSec = (input.duration > 0 && input.timeBase.denominator > 0)+ ? double(input.duration) * input.timeBase.numerator / input.timeBase.denominator+ : (state_->colors.fps > 0 ? 1.0 / state_->colors.fps : 1.0 / 30.0);++ VeReShadeCudaYuvDesc frame{};+ frame.size = sizeof(frame);+ frame.abi = VE_RESHADE_ABI_VERSION;+ frame.y_pointer = input.planes[0];+ frame.uv_pointer = input.planes[1];+ frame.y_stride = input.strides[0];+ frame.uv_stride = input.strides[1];+ frame.width = uint32_t(input.size.width());+ frame.height = uint32_t(input.size.height());+ frame.pixel_format = input.format == VideoPixelFormat::P010 ? VE_RESHADE_FORMAT_P010 : VE_RESHADE_FORMAT_NV12;+ frame.output_format = p010 ? VE_RESHADE_FORMAT_P010 : VE_RESHADE_FORMAT_NV12;+ frame.color_matrix = input.colorMatrix;+ frame.color_range = input.colorRange;+ frame.chroma_location = input.chromaLocation;+ frame.rotation = input.rotation;+ frame.frame_ordinal = uint64_t(std::max<qint64>(0, frameOrdinal));+ frame.pts_ns = secondsToNs(ptsSec);+ frame.duration_ns = std::max<int64_t>(1, secondsToNs(durSec));+ frame.reset = reset ? 1u : 0u;++ state_->lastResult = {};+ state_->lastResult.size = sizeof(VeReShadeFrameResult);+ state_->lastResult.abi = VE_RESHADE_ABI_VERSION;+ void* surface = nullptr;+ ErrorBuf err{};+ check(api.reshade_process_cuda_yuvFn(state_->handle, &frame, &surface, &state_->lastResult, err.data(), int(err.size())),+ err, "ReShade CUDA YUV frame processing failed.");++ const auto release = api.reshade_cuda_surface_releaseFn;+ std::shared_ptr<void> owner(surface, [release](void* s) { release(s); });+ VeReShadeCudaSurfaceDesc desc{};+ desc.size = sizeof(desc);+ desc.abi = VE_RESHADE_ABI_VERSION;+ if (!api.reshade_cuda_surface_descFn(surface, &desc) ||+ desc.width != uint32_t(state_->size.width()) ||+ desc.height != uint32_t(state_->size.height()) ||+ desc.pixel_format != uint32_t(p010 ? VE_RESHADE_FORMAT_P010 : VE_RESHADE_FORMAT_NV12)) {+ throw std::runtime_error("ReShade returned an incompatible CUDA YUV surface.");+ }+ auto output = pool.wrap(std::move(owner), {desc.y_pointer, desc.uv_pointer, 0},+ {desc.stride, desc.stride, 0}, input.colorMatrix, input.colorRange);+ output.pts = input.pts;+ output.duration = input.duration;+ output.timeBase = input.timeBase;+ return output;+}++GpuRgbFrame ReShadeSession::processRgb(const CudaVideoFrame& input, bool reset, qint64 frameOrdinal) {+ if (!input.owner || input.memory != FrameMemory::Cuda) {+ throw std::runtime_error("ReShade RGB delivery requires owned CUDA decoder planes.");+ }+ auto& api = Api::get();+ std::lock_guard lock(api.mutex);++ const double ptsSec = (input.timeBase.denominator > 0)+ ? double(input.pts) * input.timeBase.numerator / input.timeBase.denominator+ : 0.0;+ const double durSec = (input.duration > 0 && input.timeBase.denominator > 0)+ ? double(input.duration) * input.timeBase.numerator / input.timeBase.denominator+ : (state_->colors.fps > 0 ? 1.0 / state_->colors.fps : 1.0 / 30.0);++ VeReShadeCudaYuvDesc frame{};+ frame.size = sizeof(frame);+ frame.abi = VE_RESHADE_ABI_VERSION;+ frame.y_pointer = input.planes[0];+ frame.uv_pointer = input.planes[1];+ frame.y_stride = input.strides[0];+ frame.uv_stride = input.strides[1];+ frame.width = uint32_t(input.size.width());+ frame.height = uint32_t(input.size.height());+ frame.pixel_format = input.format == VideoPixelFormat::P010 ? VE_RESHADE_FORMAT_P010 : VE_RESHADE_FORMAT_NV12;+ frame.output_format = VE_RESHADE_FORMAT_RGBA16F;+ frame.color_matrix = input.colorMatrix;+ frame.color_range = input.colorRange;+ frame.chroma_location = input.chromaLocation;+ frame.rotation = input.rotation;+ frame.frame_ordinal = uint64_t(std::max<qint64>(0, frameOrdinal));+ frame.pts_ns = secondsToNs(ptsSec);+ frame.duration_ns = std::max<int64_t>(1, secondsToNs(durSec));+ frame.reset = reset ? 1u : 0u;++ state_->lastResult = {};+ state_->lastResult.size = sizeof(VeReShadeFrameResult);+ state_->lastResult.abi = VE_RESHADE_ABI_VERSION;+ void* surface = nullptr;+ ErrorBuf err{};+ check(api.reshade_process_cuda_yuvFn(state_->handle, &frame, &surface, &state_->lastResult, err.data(), int(err.size())),+ err, "ReShade CUDA YUV to RGBA16F processing failed.");++ const auto release = api.reshade_cuda_surface_releaseFn;+ std::shared_ptr<void> owner(surface, [release](void* s) { release(s); });+ VeReShadeCudaSurfaceDesc desc{};+ desc.size = sizeof(desc);+ desc.abi = VE_RESHADE_ABI_VERSION;+ if (!api.reshade_cuda_surface_descFn(surface, &desc) ||+ desc.pixel_format != VE_RESHADE_FORMAT_RGBA16F || desc.uv_pointer != 0 ||+ desc.width != uint32_t(state_->size.width()) || desc.height != uint32_t(state_->size.height())) {+ throw std::runtime_error("ReShade returned an incompatible CUDA RGBA16F surface.");+ }+ return {std::move(owner), state_->size, desc.y_pointer, desc.stride,+ state_->transfer, state_->transfer >= 5 ? 2u : 1u, bool(state_->lastResult.history_reset)};+}++GpuRgbFrame ReShadeSession::processRgb(const GpuRgbFrame& input, bool reset, qint64 frameOrdinal,+ qint64 ptsNs, qint64 durationNs) {+ if (!input.owner || !input.pointer || input.transfer != state_->transfer) {+ throw std::runtime_error("ReShade RGB input requires an owned surface matching the session transfer function.");+ }+ auto& api = Api::get();+ std::lock_guard lock(api.mutex);++ VeReShadeCudaRgbDesc frame{};+ frame.size = sizeof(frame);+ frame.abi = VE_RESHADE_ABI_VERSION;+ frame.pointer = input.pointer;+ frame.stride = input.stride;+ frame.width = uint32_t(input.size.width());+ frame.height = uint32_t(input.size.height());+ frame.output_format = VE_RESHADE_FORMAT_RGBA16F;+ frame.color_matrix = input.primaries == 2 ? 2u : 1u;+ frame.color_range = 0;+ frame.frame_ordinal = uint64_t(std::max<qint64>(0, frameOrdinal));+ frame.pts_ns = ptsNs;+ frame.duration_ns = std::max<int64_t>(1, durationNs);+ frame.reset = (reset || input.historyReset) ? 1u : 0u;++ state_->lastResult = {};+ state_->lastResult.size = sizeof(VeReShadeFrameResult);+ state_->lastResult.abi = VE_RESHADE_ABI_VERSION;+ void* surface = nullptr;+ ErrorBuf err{};+ check(api.reshade_process_cuda_rgba16fFn(state_->handle, &frame, &surface, &state_->lastResult, err.data(), int(err.size())),+ err, "ReShade CUDA RGBA16F to RGBA16F processing failed.");++ const auto release = api.reshade_cuda_surface_releaseFn;+ std::shared_ptr<void> owner(surface, [release](void* s) { release(s); });+ VeReShadeCudaSurfaceDesc desc{};+ desc.size = sizeof(desc);+ desc.abi = VE_RESHADE_ABI_VERSION;+ if (!api.reshade_cuda_surface_descFn(surface, &desc) ||+ desc.pixel_format != VE_RESHADE_FORMAT_RGBA16F || desc.uv_pointer != 0 ||+ desc.width != uint32_t(state_->size.width()) || desc.height != uint32_t(state_->size.height())) {+ throw std::runtime_error("ReShade returned an incompatible CUDA RGBA16F surface.");+ }+ return {std::move(owner), state_->size, desc.y_pointer, desc.stride,+ state_->transfer, input.primaries, bool(state_->lastResult.history_reset) || input.historyReset};+}++CudaVideoFrame ReShadeSession::process(const GpuRgbFrame& input, CudaFramePool& pool,+ bool p010, bool reset, qint64 frameOrdinal,+ qint64 ptsNs, qint64 durationNs) {+ if (!input.owner || !input.pointer || input.transfer != state_->transfer) {+ throw std::runtime_error("ReShade RGB input requires an owned surface matching the session transfer function.");+ }+ auto& api = Api::get();+ std::lock_guard lock(api.mutex);++ VeReShadeCudaRgbDesc frame{};+ frame.size = sizeof(frame);+ frame.abi = VE_RESHADE_ABI_VERSION;+ frame.pointer = input.pointer;+ frame.stride = input.stride;+ frame.width = uint32_t(input.size.width());+ frame.height = uint32_t(input.size.height());+ frame.output_format = p010 ? VE_RESHADE_FORMAT_P010 : VE_RESHADE_FORMAT_NV12;+ frame.color_matrix = input.primaries == 2 ? 2u : 1u;+ frame.color_range = 0;+ frame.frame_ordinal = uint64_t(std::max<qint64>(0, frameOrdinal));+ frame.pts_ns = ptsNs;+ frame.duration_ns = std::max<int64_t>(1, durationNs);+ frame.reset = (reset || input.historyReset) ? 1u : 0u;++ state_->lastResult = {};+ state_->lastResult.size = sizeof(VeReShadeFrameResult);+ state_->lastResult.abi = VE_RESHADE_ABI_VERSION;+ void* surface = nullptr;+ ErrorBuf err{};+ check(api.reshade_process_cuda_rgba16fFn(state_->handle, &frame, &surface, &state_->lastResult, err.data(), int(err.size())),+ err, "ReShade CUDA RGBA16F to YUV processing failed.");++ const auto release = api.reshade_cuda_surface_releaseFn;+ std::shared_ptr<void> owner(surface, [release](void* s) { release(s); });+ VeReShadeCudaSurfaceDesc desc{};+ desc.size = sizeof(desc);+ desc.abi = VE_RESHADE_ABI_VERSION;+ if (!api.reshade_cuda_surface_descFn(surface, &desc) ||+ desc.pixel_format != uint32_t(p010 ? VE_RESHADE_FORMAT_P010 : VE_RESHADE_FORMAT_NV12) ||+ desc.width != uint32_t(state_->size.width()) || desc.height != uint32_t(state_->size.height())) {+ throw std::runtime_error("ReShade returned an incompatible CUDA YUV delivery surface.");+ }+ return pool.wrap(std::move(owner), {desc.y_pointer, desc.uv_pointer, 0},+ {desc.stride, desc.stride, 0}, frame.color_matrix, frame.color_range);+}++QString ReShadeSession::diagnostics() const {+ auto& api = Api::get();+ std::lock_guard lock(api.mutex);+ std::array<char, 8192> buf{};+ if (!api.reshade_session_statusFn(state_->handle, buf.data(), int(buf.size()))) {+ throw std::runtime_error("Cannot read ReShade session telemetry.");+ }+ return QString::fromUtf8(buf.data());+}++QVariantMap ReShadeSession::statusMap() const {+ return QJsonDocument::fromJson(diagnostics().toUtf8()).object().toVariantMap();+}++VeReShadeFrameResult ReShadeSession::lastResult() const {+ return state_->lastResult;+}+} // namespace vediff --git a/src/processing/reshade_native.hpp b/src/processing/reshade_native.hppnew file mode 100644index 0000000..1966e4c--- /dev/null+++ b/src/processing/reshade_native.hpp@@ -0,0 +1,63 @@+#pragma once+#include "configuration/settings.hpp"+#include "media/cuda_video.hpp"+#include "media/native_rgb.hpp"+#include "processing/reshade/reshade_bridge.h"+#include <QImage>+#include <QSize>+#include <QString>+#include <QVariantMap>+#include <memory>++namespace ve {+class JobControl;+struct MediaInfo;++[[nodiscard]] uint32_t reshadeColorTransfer(const MediaInfo& info, bool hdrOverride = false);+[[nodiscard]] QString reshadeReport(const Settings& settings, bool video);+[[nodiscard]] bool reshadeUsesTemporalDepth(const Settings& settings, bool video);++class ReShadeEngine {+ public:+ static void initialize(int ordinal = 0);+ [[nodiscard]] static VeReShadeCapabilities capabilities(int ordinal = 0);+ [[nodiscard]] static QString version();+ [[nodiscard]] static QString opticalFlowBackend();+ [[nodiscard]] static QString diagnostics();+ [[nodiscard]] static QVariantMap statusMap();+ [[nodiscard]] static QVariantMap inspectPreset(const Settings& settings, bool video,+ QSize previewSize = QSize(128, 128));+ // Restore the authored technique selection, including explicit lens effects.+ // Other overrides are omitted so uniforms, sorting and macros come from the preset.+ [[nodiscard]] static QString presetResetOverrides(const QString& presetPath);+ static void exportPresetCopy(const Settings& settings, bool video, const QString& destinationPath);+};++class ReShadeSession {+ public:+ ReShadeSession(QSize size, const Settings& settings, const MediaInfo& colors,+ bool still, bool wideOutput = false, bool preserveAlpha = true);+ ~ReShadeSession();+ ReShadeSession(const ReShadeSession&) = delete;+ ReShadeSession& operator=(const ReShadeSession&) = delete;++ [[nodiscard]] QImage process(const QImage& input, bool reset, qint64 frameOrdinal = 0,+ qint64 ptsNs = 0, qint64 durationNs = 33333333ll);+ [[nodiscard]] CudaVideoFrame process(const CudaVideoFrame& input, CudaFramePool& pool,+ bool p010, bool reset, qint64 frameOrdinal = 0);+ [[nodiscard]] GpuRgbFrame processRgb(const CudaVideoFrame& input, bool reset, qint64 frameOrdinal = 0);+ [[nodiscard]] GpuRgbFrame processRgb(const GpuRgbFrame& input, bool reset, qint64 frameOrdinal = 0,+ qint64 ptsNs = 0, qint64 durationNs = 33333333ll);+ [[nodiscard]] CudaVideoFrame process(const GpuRgbFrame& input, CudaFramePool& pool,+ bool p010, bool reset, qint64 frameOrdinal = 0,+ qint64 ptsNs = 0, qint64 durationNs = 33333333ll);++ [[nodiscard]] QString diagnostics() const;+ [[nodiscard]] QVariantMap statusMap() const;+ [[nodiscard]] VeReShadeFrameResult lastResult() const;++ private:+ struct State;+ std::unique_ptr<State> state_;+};+} // namespace vediff --git a/src/processing/reshade_video.cpp b/src/processing/reshade_video.cppnew file mode 100644index 0000000..350572d--- /dev/null+++ b/src/processing/reshade_video.cpp@@ -0,0 +1,192 @@+#include "reshade_video.hpp"+#include "infrastructure/log.hpp"+#include "infrastructure/scratch.hpp"+#include "media/cuda_video.hpp"+#include "media/native_rgb.hpp"+#include "media/video_delivery.hpp"+#include "native_engines.hpp"+#include "reshade_native.hpp"+#include <QElapsedTimer>+#include <algorithm>+#include <cmath>+#include <memory>+#include <optional>++namespace ve {+bool renderReShadeVideo(const RenderRequest& request, const MediaInfo& source,+ const Settings& settings, const PipelineEstimate& estimate,+ const QString& destination, JobControl& control,+ const ProgressCallback& progress) {+ const bool sole = estimate.stages == QStringList{"reshade"};+ const bool rrBefore = estimate.stages == QStringList{"dlss_ray_reconstruction", "reshade"};+ const bool rrAfter = estimate.stages == QStringList{"reshade", "dlss_ray_reconstruction"};+ if (request.preview || (!sole && !rrBefore && !rrAfter) ||+ ((source.width | source.height | estimate.width | estimate.height) & 1)) {+ return false;+ }++ const bool nvenc = settings.codec.contains("NVIDIA NVENC") ||+ (settings.ffmpeg_device != "cpu" && QStringList{"H.264", "H.265", "AV1"}.contains(settings.codec));+ if (!nvenc || source.range == "pc" ||+ (source.hdr ? source.primaries != "bt2020" || source.colorSpace != "bt2020nc"+ : !QStringList{"bt709", "unknown", "unspecified", ""}.contains(source.primaries) ||+ !QStringList{"bt709", "unknown", "unspecified", ""}.contains(source.colorSpace))) {+ return false;+ }+ if (!source.hdr && !QStringList{"bt709", "gamma22", "bt470m", "iec61966-2-1", "srgb", "unknown", "unspecified", ""}.contains(source.transfer)) {+ return false;+ }++ const int ordinal = gpuOrdinal(settings.ai_gpu_uuid);+ const auto devices = detectGpus();+ const auto selected = std::ranges::find_if(devices, [ordinal](const Gpu& gpu) { return gpu.index == ordinal; });+ if (selected == devices.end() ||+ (settings.video_gpu_uuid != "auto" && settings.video_gpu_uuid != selected->uuid) ||+ (settings.ffmpeg_device != "auto" && settings.ffmpeg_device != "cpu" &&+ settings.ffmpeg_device.mid(7).compare(selected->uuid.mid(4), Qt::CaseInsensitive) != 0)) {+ return false;+ }++ ScratchDirectory temporary(QStringLiteral("reshade-cuda-render-XXXXXX"));+ if (!temporary.isValid()) {+ throw std::runtime_error("Cannot create the ReShade GPU render directory.");+ }+ const auto video = temporary.filePath("video.mp4");+ const auto codec = settings.codec.startsWith("H.264") ? QString("h264_nvenc")+ : settings.codec.startsWith("H.265") ? QString("hevc_nvenc") : QString("av1_nvenc");+ const double duration = request.seconds > 0+ ? std::min(request.seconds, source.duration - request.startSeconds)+ : source.duration - request.startSeconds;++ qint64 count = 0;+ double actualDuration = 0.0;+ double origin = 0.0;+ QElapsedTimer timer;+ timer.start();++ try {+ CudaVideoDecoder decoder(request.input, ordinal, request.startSeconds, control);+ auto frame = decoder.read();+ if (!frame) {+ throw std::runtime_error("Source contains no decodable video frames.");+ }+ origin = decoder.timeOrigin();+ auto colors = source;+ colors.width = estimate.width;+ colors.height = estimate.height;+ colors.hdr = estimate.hdr;+ if (rrBefore || rrAfter || source.precisionBits() > 8 || estimate.hdr) {+ colors.pixelFormat = "p010le";+ }++ ReShadeEngine::initialize(ordinal);+ const auto caps = ReShadeEngine::capabilities(ordinal);+ if (!caps.cuda_interop_available) {+ throw CudaUnavailable("ReShade D3D12-CUDA interop is unavailable on the selected adapter.");+ }+ if (rrBefore || rrAfter) {+ NativeEngines::instance().prepare(ordinal, {"dlss_ray_reconstruction"});+ }++ const uint32_t transfer = reshadeColorTransfer(source);+ std::unique_ptr<NativeEngines::RayReconstruction> rrSession;+ if (rrBefore || rrAfter) {+ rrSession = std::make_unique<NativeEngines::RayReconstruction>(+ QSize(source.width, source.height), settings.rr_optical_flow_quality, false, true, transfer);+ }+ ReShadeSession rsSession(QSize(source.width, source.height), settings, source, false, true, true);++ CudaVideoEncoder encoder(video, codec, settings, colors, decoder.timeBase(), decoder.device(), ordinal, control);+ const bool p010 = encoder.pixelFormat() == VideoPixelFormat::P010;+ CudaFramePool pool(decoder.device(), QSize(estimate.width, estimate.height), p010, source.hdr);++ if (sole) {+ info("reshade", "NVDEC -> ReShade (D3D12 + AMD FidelityFX Optical Flow 1.1.2) -> " + codec + " (owned device surfaces)");+ } else if (rrBefore) {+ info("reshade", "NVDEC -> DLSS Ray Reconstruction -> ReShade -> " + codec + " (owned device surfaces)");+ } else {+ info("reshade", "NVDEC -> ReShade -> DLSS Ray Reconstruction -> " + codec + " (owned device surfaces)");+ }++ qint64 previous = -1;+ while (frame) {+ control.checkpoint();+ const double seconds = frame->pts * double(frame->timeBase.numerator) / frame->timeBase.denominator;+ if (request.seconds > 0 && seconds >= duration - 1e-9) {+ break;+ }+ if (frame->pts <= previous) {+ throw std::runtime_error("Video has non-increasing presentation timestamps.");+ }+ const float delta = previous >= 0+ ? float((frame->pts - previous) * 1000.0 * frame->timeBase.numerator / frame->timeBase.denominator)+ : (source.fps > 0 ? float(1000.0 / source.fps) : 33.333f);+ const bool gap = count > 0 && delta > std::max(250.0f, source.fps > 0 ? float(4000.0 / source.fps) : 250.0f);+ previous = frame->pts;+ frame->rotation = uint32_t(source.clockwiseRotation());++ if (frame->colorMatrix != (source.hdr ? 2u : 1u) || frame->colorRange != 0) {+ throw CudaUnavailable("ReShade device delivery requires matching 709/2020 limited-range planes.");+ }++ const qint64 ptsNs = qint64(std::llround(seconds * 1000000000.0));+ const qint64 durNs = std::max<qint64>(1, qint64(std::llround(double(delta) * 1000000.0)));+ const bool reset = (count == 0 || gap);++ CudaVideoFrame output;+ if (sole) {+ output = rsSession.process(*frame, pool, p010, reset, count);+ } else if (rrBefore) {+ auto rgb = rrSession->processRgb(*frame, reset, quint32(count), std::clamp(delta, 0.01f, 1000.0f));+ output = rsSession.process(rgb, pool, p010, reset, count, ptsNs, durNs);+ output.pts = frame->pts;+ output.duration = frame->duration;+ output.timeBase = frame->timeBase;+ } else {+ auto rgb = rsSession.processRgb(*frame, reset, count);+ output = rrSession->process(rgb, pool, p010, reset, quint32(count), std::clamp(delta, 0.01f, 1000.0f));+ output.pts = frame->pts;+ output.duration = frame->duration;+ output.timeBase = frame->timeBase;+ }++ control.checkpoint();+ encoder.write(output);+ ++count;+ actualDuration = std::max(actualDuration, seconds + (frame->duration > 0+ ? frame->duration * double(frame->timeBase.numerator) / frame->timeBase.denominator+ : (source.fps > 0 ? 1.0 / source.fps : 1.0 / 30.0)));+ if (progress) {+ progress({std::min(0.98, duration > 0 ? seconds / duration : 0.1),+ QT_TRANSLATE_NOOP("App", "Processing ReShade video"),+ count, source.frames, timer.elapsed() > 0 ? count * 1000.0 / timer.elapsed() : 0.0});+ }+ frame = decoder.read();+ }+ encoder.finish();+ info("reshade", "Device delivery counters: " + rsSession.diagnostics());+ if (rrSession) {+ info("dlssrr", "Combined RR+ReShade device counters: " + rrSession->diagnostics());+ }+ } catch (const CudaUnavailable& error) {+ if (count) {+ throw;+ }+ control.checkpoint();+ info("reshade", "CUDA delivery unavailable; using host composition: " + QString::fromUtf8(error.what()));+ return false;+ }++ if (count <= 0) {+ throw std::runtime_error("ReShade produced no video frames.");+ }+ control.checkpoint();+ if (request.seconds > 0) {+ actualDuration = std::min(actualDuration, request.seconds);+ }+ info("reshade", reshadeReport(settings, true));+ muxDelivery(video, destination, request, source, settings, actualDuration, control,+ request.preview ? std::nullopt : std::optional(origin));+ return true;+}+} // namespace vediff --git a/src/processing/reshade_video.hpp b/src/processing/reshade_video.hppnew file mode 100644index 0000000..883333c--- /dev/null+++ b/src/processing/reshade_video.hpp@@ -0,0 +1,9 @@+#pragma once+#include "pipeline.hpp"++namespace ve {+[[nodiscard]] bool renderReShadeVideo(const RenderRequest& request, const MediaInfo& source,+ const Settings& settings, const PipelineEstimate& estimate,+ const QString& destination, JobControl& control,+ const ProgressCallback& progress);+} // namespace vediff --git a/src/processing/reshade_worker.cpp b/src/processing/reshade_worker.cppnew file mode 100644index 0000000..c3e5ca7--- /dev/null+++ b/src/processing/reshade_worker.cpp@@ -0,0 +1,276 @@+#include "reshade_worker.hpp"+#include "infrastructure/log.hpp"+#include "infrastructure/paths.hpp"+#include "infrastructure/process.hpp"+#include "infrastructure/scratch.hpp"+#include "media/video_preview.hpp"+#include "native_engines.hpp"+#include "reshade_native.hpp"+#include "video_still_preview.hpp"+#include <QDir>+#include <QElapsedTimer>+#include <QFile>+#include <QFileInfo>+#include <QJsonDocument>+#include <QJsonObject>+#include <QScopeGuard>+#include <QTemporaryFile>+#include <QTextStream>+#include <algorithm>+#include <mutex>+#include <thread>++namespace ve {+namespace {+std::mutex diagnosticsMutex;+QString diagnostics;++void save(const QString& path, const QJsonObject& data) {+ QFile file(path);+ if (!file.open(QIODevice::WriteOnly) || file.write(QJsonDocument(data).toJson()) < 0) {+ throw std::runtime_error("Cannot write ReShade worker request.");+ }+}++void call(const QString& file, JobControl& control, const ProgressCallback& progress = {}) {+ const auto state = file + ".state";+ const auto writeState = [state](bool paused, bool cancelled) {+ QFile value(state);+ if (value.open(QIODevice::WriteOnly | QIODevice::Truncate)) {+ value.write(cancelled ? "C" : paused ? "P" : "R");+ value.flush();+ }+ };+ writeState(control.paused(), control.cancelled());+ control.setStateChanged(writeState);+ const auto cleanup = qScopeGuard([&] { control.setStateChanged({}); });+ QByteArray pending;+ const auto result = runProcess(+ Paths::instance().at("VE_CLI.exe"), {"--internal-reshade-worker", file}, &control, 0, {},+ [&](const QByteArray& data) {+ pending += data;+ for (auto end = pending.indexOf('\n'); end >= 0; end = pending.indexOf('\n')) {+ const auto message = QJsonDocument::fromJson(pending.left(end)).object();+ pending.remove(0, end + 1);+ if (progress && message.value("kind") == "progress") {+ progress({message.value("fraction").toDouble(),+ message.value("message").toString(),+ message.value("frames").toInteger(),+ message.value("total").toInteger(),+ message.value("fps").toDouble()});+ }+ if (message.value("kind") == "diagnostics") {+ {+ std::lock_guard lock(diagnosticsMutex);+ diagnostics = message.value("text").toString();+ }+ info("reshade-worker", message.value("text").toString());+ }+ }+ });+ if (result.exitCode) {+ throw std::runtime_error(result.error.isEmpty()+ ? "ReShade worker exited unexpectedly."+ : result.error.toStdString());+ }+}++QJsonObject base(const QString& kind, const QString& input, const QString& output,+ const Settings& settings, const QString& preset) {+ if (auto result = settings.exportPreset(preset, "ReShade worker"); !result) {+ throw std::runtime_error(result.error().toStdString());+ }+ return {{"protocol", 1}, {"kind", kind}, {"input", input}, {"output", output}, {"preset", preset}};+}++void send(const QJsonObject& object) {+ QTextStream stream(stdout);+ stream << QJsonDocument(object).toJson(QJsonDocument::Compact) << '\n';+ stream.flush();+}+} // namespace++QString reshadeWorkerDiagnostics() {+ std::lock_guard lock(diagnosticsMutex);+ return diagnostics;+}++RenderResult renderIsolatedReShade(const RenderRequest& request, JobControl& control,+ const ProgressCallback& progress) {+ QElapsedTimer elapsed;+ elapsed.start();+ if (QFileInfo::exists(request.output)) {+ throw std::runtime_error("Output already exists. Choose a different filename.");+ }+ ProcessingTemporaryDirectory directory(ProcessingCacheKind::Scratch);+ if (!directory.isValid()) {+ throw std::runtime_error("Cannot create ReShade worker directory.");+ }+ const auto rendered = directory.filePath("processed." + QFileInfo(request.output).suffix());+ auto job = base("render", request.input, rendered, request.settings, directory.filePath("preset.json"));+ job.insert("workflow", int(request.workflow));+ job.insert("preview", request.preview);+ job.insert("start", request.startSeconds);+ job.insert("seconds", request.seconds);+ job.insert("temporal_context", request.temporalContextIncluded);+ const auto path = directory.filePath("job.json");+ save(path, job);+ directory.cacheRoot()->registerFile(path + ".state");+ call(path, control, [&](const Progress& p) {+ if (progress) {+ auto delivery = p;+ delivery.fraction = std::min(0.98, p.fraction);+ progress(delivery);+ }+ });+ QDir().mkpath(QFileInfo(request.output).absolutePath());+ QFile source(rendered);+ QTemporaryFile destination(QFileInfo(request.output).absolutePath() + "/.reshade-delivery-XXXXXX");+ if (!source.open(QIODevice::ReadOnly) || !destination.open()) {+ throw std::runtime_error("Cannot save ReShade worker delivery.");+ }+ while (!source.atEnd()) {+ control.checkpoint();+ const auto bytes = source.read(8 * 1024 * 1024);+ if (bytes.isEmpty() && source.error() != QFileDevice::NoError) {+ throw std::runtime_error("Cannot read ReShade worker delivery.");+ }+ if (destination.write(bytes) != bytes.size()) {+ throw std::runtime_error("Cannot write ReShade worker delivery.");+ }+ }+ control.checkpoint();+ destination.close();+ if (!destination.rename(request.output)) {+ throw std::runtime_error("Cannot commit ReShade worker delivery; the destination may already exist.");+ }+ destination.setAutoRemove(false);+ const auto outInfo = probeMedia(request.output, &control);+ if (progress) {+ progress({1.0, outInfo.video ? QT_TRANSLATE_NOOP("App", "Video complete")+ : QT_TRANSLATE_NOOP("App", "Image complete")});+ }+ return {request.input, request.output, reshadeReport(request.settings, outInfo.video),+ outInfo, elapsed.elapsed() / 1000.0};+}++QImage previewIsolatedReShade(const QString& path, const Settings& settings,+ const MediaInfo&, double seconds, JobControl& control) {+ ProcessingTemporaryDirectory directory(ProcessingCacheKind::Scratch);+ if (!directory.isValid()) {+ throw std::runtime_error("Cannot create ReShade preview worker directory.");+ }+ const auto output = directory.filePath("preview.png");+ auto job = base("still", path, output, settings, directory.filePath("preset.json"));+ job.insert("seconds", seconds);+ const auto file = directory.filePath("job.json");+ save(file, job);+ directory.cacheRoot()->registerFile(file + ".state");+ call(file, control);+ QImage pixels(output);+ if (pixels.isNull()) {+ throw std::runtime_error("ReShade preview worker returned no image.");+ }+ return pixels;+}++int runReShadeWorker(const QString& path) {+ try {+ ProcessingCacheActivity cacheActivity;+ QFile file(path);+ if (!file.open(QIODevice::ReadOnly)) {+ throw std::runtime_error("Cannot read ReShade worker request.");+ }+ const auto job = QJsonDocument::fromJson(file.readAll()).object();+ if (job.value("protocol").toInt() != 1) {+ throw std::runtime_error("Invalid ReShade worker protocol.");+ }+ WorkerScratchScope scratch(QFileInfo(path).absolutePath());+ Settings settings;+ if (auto preset = settings.importPreset(job.value("preset").toString()); !preset) {+ throw std::runtime_error(preset.error().toStdString());+ }+ JobControl control;+ const auto input = job.value("input").toString();+ const auto output = job.value("output").toString();+ QElapsedTimer poll;+ poll.start();+ control.setExternalCheckpoint([&] {+ if (poll.elapsed() < 20) return;+ const auto started = std::chrono::steady_clock::now();+ bool paused = false;+ for (;;) {+ QFile state(path + ".state");+ QByteArray value;+ if (state.open(QIODevice::ReadOnly)) value = state.readAll();+ state.close();+ if (value == "C") throw Cancelled{};+ if (value != "P") break;+ paused = true;+ std::this_thread::sleep_for(std::chrono::milliseconds(20));+ }+ if (paused) {+ control.accountExternalPause(std::chrono::steady_clock::now() - started);+ }+ poll.restart();+ });++ if (job.value("kind") == "render") {+ RenderRequest request{input, output, settings, Workflow(job.value("workflow").toInt()),+ job.value("preview").toBool(), job.value("start").toDouble(),+ job.value("seconds").toDouble()};+ request.isolatedReShadeWorker = true;+ request.temporalContextIncluded = job.value("temporal_context").toBool();+ const auto rendered = Pipeline{}.render(request, control, [](const Progress& p) {+ send({{"kind", "progress"}, {"fraction", p.fraction}, {"message", p.message},+ {"frames", p.frames}, {"total", p.totalFrames}, {"fps", p.fps}});+ });+ (void)rendered;+ } else if (job.value("kind") == "still") {+ auto info = probeMedia(input, &control);+ const double seconds = job.value("seconds").toDouble();+ const auto position = quantizePlayhead(seconds * 1000, info.fps, info.duration);+ const auto stages = settings.stages(true);+ VideoFrameReader reader;+ auto source = reader.frame(input, info, position, control, false,+ gpuOrdinal(settings.ai_gpu_uuid), settings.ffmpeg_device != "cpu");+ const bool history = stages.contains("dlss_super_resolution") ||+ stages.contains("dlss_ray_reconstruction") ||+ (stages.contains("reshade") && reshadeUsesTemporalDepth(settings, true));+ std::vector<TimedImage> temporal;+ if (!stages.contains("dlss_ray_reconstruction") && history) {+ temporal = reader.temporalContext(input, info, position, source.absoluteSeconds,+ reconstructionHistoryFrames(settings, stages), control,+ gpuOrdinal(settings.ai_gpu_uuid), settings.ffmpeg_device != "cpu",+ rrNeedsGeneratedHistory(stages));+ }+ PreviewFrameCache cache;+ VideoStillPreview preview;+ auto pixels = preview.process(source.pixels, settings, info, stages, cache, source.identity,+ control, temporal,+ stages.contains("dlss_ray_reconstruction") ? source.absoluteSeconds : -1,+ input);+ if (info.hdr || stages.contains("rtx_video_hdr")) {+ auto colors = info;+ colors.hdr = true;+ if (stages.contains("rtx_video_hdr")) {+ colors.primaries = "bt2020";+ colors.transfer = "smpte2084";+ }+ pixels = toneMapVideoPreview(pixels, colors, control, settings.ffmpeg_device);+ }+ if (!pixels.save(output, "PNG")) {+ throw std::runtime_error("Cannot save ReShade worker preview.");+ }+ } else {+ throw std::runtime_error("Unknown ReShade worker operation.");+ }+ send({{"kind", "diagnostics"}, {"text", ReShadeEngine::diagnostics()}});+ return 0;+ } catch (const std::exception& error) {+ send({{"kind", "diagnostics"}, {"text", ReShadeEngine::diagnostics()}});+ QTextStream(stderr) << error.what() << '\n';+ return 1;+ }+}+} // namespace vediff --git a/src/processing/reshade_worker.hpp b/src/processing/reshade_worker.hppnew file mode 100644index 0000000..4a900ff--- /dev/null+++ b/src/processing/reshade_worker.hpp@@ -0,0 +1,11 @@+#pragma once+#include "pipeline.hpp"++namespace ve {+[[nodiscard]] RenderResult renderIsolatedReShade(const RenderRequest& request, JobControl& control,+ const ProgressCallback& progress);+[[nodiscard]] QImage previewIsolatedReShade(const QString& path, const Settings& settings,+ const MediaInfo& info, double seconds, JobControl& control);+int runReShadeWorker(const QString& path);+[[nodiscard]] QString reshadeWorkerDiagnostics();+} // namespace vediff --git a/src/processing/video_still_preview.cpp b/src/processing/video_still_preview.cppindex de3d635..4fd59c6 100644--- a/src/processing/video_still_preview.cpp+++ b/src/processing/video_still_preview.cpp@@ -24,7 +24,7 @@ QImage VideoStillPreview::process(const QImage &input, Settings settings, MediaI// The former source container quantized wide layouts back to the original// integer depth before the streaming stages read them. Preserve that step.info.pixelFormat = ffv1PreviewPixelFormat(info);- const bool nativeTemporal=stages.contains("dlss_super_resolution")||stages.contains("dlss_ray_reconstruction");+ const bool nativeTemporal=stages.contains("dlss_super_resolution")||stages.contains("dlss_ray_reconstruction")||stages.contains("reshade");if(nativeTemporal)info.pixelFormat=input.depth()>32?"rgba64le":"rgba";info.colorSpace = "gbr";info.range = "pc";@@ -162,7 +162,7 @@ QImage VideoStillPreview::process(const QImage &input, Settings settings, MediaIwhile(auto frame=pipeline.read()) {control.checkpoint();if(generatedTarget>=0&&frame->seconds()>generatedTarget+1e-7)break;output=std::move(frame);}if (!output)throw std::runtime_error("Video still preview returned no frame.");- if (!stages.isEmpty() && stages.back() != "neural_model" && stages.back() != "dlss_super_resolution" && stages.back() != "dlss_ray_reconstruction")+ if (!stages.isEmpty() && stages.back() != "neural_model" && stages.back() != "dlss_super_resolution" && stages.back() != "dlss_ray_reconstruction" && stages.back() != "reshade")info.pixelFormat = "gbrp10le";else if (info.pixelFormat == "gbrp10le" && !stages.isEmpty())info.pixelFormat = "rgba64le";diff --git a/third_party/ffmpeg/libavcodec/avcodec.h b/third_party/ffmpeg/libavcodec/avcodec.hindex 108df5a..6824bfc 100644--- a/third_party/ffmpeg/libavcodec/avcodec.h+++ b/third_party/ffmpeg/libavcodec/avcodec.h@@ -415,6 +415,14 @@ typedef struct RcOverride{*/#define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0)+/**+ * The decoder will bypass frame threading and return the next frame as soon as+ * possible. Note that this may deliver frames earlier than the advertised+ * `AVCodecContext.delay`. No effect when frame threading is disabled, or on+ * encoding.+ */+#define AV_CODEC_RECEIVE_FRAME_FLAG_SYNCHRONOUS (1 << 0)+/*** main external API structure.* New fields can be added to the end with minor version bumps.@@ -963,12 +971,16 @@ typedef struct AVCodecContext {*/uint16_t *chroma_intra_matrix;+#if FF_API_INTRA_DC_PRECISION/*** precision of the intra DC coefficient - 8* - encoding: Set by user.* - decoding: Set by libavcodec+ * @deprecated Use the MPEG-2 encoder's private option "intra_dc_precision" instead.*/+ attribute_deprecatedint intra_dc_precision;+#endif/*** minimum MB Lagrange multiplier@@ -1923,6 +1935,13 @@ typedef struct AVCodecContext {*/AVFrameSideData **decoded_side_data;int nb_decoded_side_data;++ /**+ * Indicates how the alpha channel of the video is represented.+ * - encoding: Set by user+ * - decoding: Set by libavcodec+ */+ enum AVAlphaMode alpha_mode;} AVCodecContext;/**@@ -2353,6 +2372,7 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);* frame (depending on the decoder type) allocated by the* codec. Note that the function will always call* av_frame_unref(frame) before doing anything else.+ * @param flags Combination of AV_CODEC_RECEIVE_FRAME_FLAG_* flags.** @retval 0 success, a frame was returned* @retval AVERROR(EAGAIN) output is not available in this state - user must@@ -2363,6 +2383,11 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);* @ref AV_CODEC_FLAG_RECON_FRAME flag enabled* @retval "other negative error code" legitimate decoding errors*/+int avcodec_receive_frame_flags(AVCodecContext *avctx, AVFrame *frame, unsigned flags);++/**+ * Alias for `avcodec_receive_frame_flags(avctx, frame, 0)`.+ */int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame);/**@@ -2528,6 +2553,7 @@ enum AVCodecConfig {AV_CODEC_CONFIG_CHANNEL_LAYOUT, ///< AVChannelLayout, terminated by {0}AV_CODEC_CONFIG_COLOR_RANGE, ///< AVColorRange, terminated by AVCOL_RANGE_UNSPECIFIEDAV_CODEC_CONFIG_COLOR_SPACE, ///< AVColorSpace, terminated by AVCOL_SPC_UNSPECIFIED+ AV_CODEC_CONFIG_ALPHA_MODE, ///< AVAlphaMode, terminated by AVALPHA_MODE_UNSPECIFIED};/**@@ -2724,17 +2750,35 @@ typedef struct AVCodecParserContext {} AVCodecParserContext;typedef struct AVCodecParser {+#if FF_API_PARSER_CODECIDint codec_ids[7]; /* several codec IDs are permitted */+#else+ enum AVCodecID codec_ids[7]; /* several codec IDs are permitted */+#endif+#if FF_API_PARSER_PRIVATE+ /*****************************************************************+ * All fields below this line are not part of the public API. They+ * may not be used outside of libavcodec and can be changed and+ * removed at will.+ * New public fields should be added right above.+ *****************************************************************+ */+ attribute_deprecatedint priv_data_size;+ attribute_deprecatedint (*parser_init)(AVCodecParserContext *s);/* This callback never returns an error, a negative value means that* the frame start was in a previous packet. */+ attribute_deprecatedint (*parser_parse)(AVCodecParserContext *s,AVCodecContext *avctx,const uint8_t **poutbuf, int *poutbuf_size,const uint8_t *buf, int buf_size);+ attribute_deprecatedvoid (*parser_close)(AVCodecParserContext *s);+ attribute_deprecatedint (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);+#endif} AVCodecParser;/**@@ -2748,7 +2792,11 @@ typedef struct AVCodecParser {*/const AVCodecParser *av_parser_iterate(void **opaque);+#if FF_API_PARSER_CODECIDAVCodecParserContext *av_parser_init(int codec_id);+#else+AVCodecParserContext *av_parser_init(enum AVCodecID codec_id);+#endif/*** Parse a packet.diff --git a/third_party/ffmpeg/libavcodec/codec_desc.h b/third_party/ffmpeg/libavcodec/codec_desc.hindex 96afd20..1186433 100644--- a/third_party/ffmpeg/libavcodec/codec_desc.h+++ b/third_party/ffmpeg/libavcodec/codec_desc.h@@ -96,6 +96,14 @@ typedef struct AVCodecDescriptor {*/#define AV_CODEC_PROP_FIELDS (1 << 4)+/**+ * Video codec contains enhancement information meant to be applied to other+ * existing frames, and can't generate usable image data on its own.+ * A standalone decoder is unlikely to be available for it and should not+ * be expected.+ */+#define AV_CODEC_PROP_ENHANCEMENT (1 << 5)+/*** Subtitle codec is bitmap based* Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.diff --git a/third_party/ffmpeg/libavcodec/codec_id.h b/third_party/ffmpeg/libavcodec/codec_id.hindex c4842e6..6529f0a 100644--- a/third_party/ffmpeg/libavcodec/codec_id.h+++ b/third_party/ffmpeg/libavcodec/codec_id.h@@ -331,6 +331,7 @@ enum AVCodecID {AV_CODEC_ID_JPEGXL_ANIM,AV_CODEC_ID_APV,AV_CODEC_ID_PRORES_RAW,+ AV_CODEC_ID_JPEGXS,/* various PCM "codecs" */AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs@@ -427,6 +428,14 @@ enum AVCodecID {AV_CODEC_ID_ADPCM_XMD,AV_CODEC_ID_ADPCM_IMA_XBOX,AV_CODEC_ID_ADPCM_SANYO,+ AV_CODEC_ID_ADPCM_IMA_HVQM4,+ AV_CODEC_ID_ADPCM_IMA_PDA,+ AV_CODEC_ID_ADPCM_N64,+ AV_CODEC_ID_ADPCM_IMA_HVQM2,+ AV_CODEC_ID_ADPCM_IMA_MAGIX,+ AV_CODEC_ID_ADPCM_PSXC,+ AV_CODEC_ID_ADPCM_CIRCUS,+ AV_CODEC_ID_ADPCM_IMA_ESCAPE,/* AMR */AV_CODEC_ID_AMR_NB = 0x12000,@@ -556,6 +565,7 @@ enum AVCodecID {AV_CODEC_ID_QOA,AV_CODEC_ID_LC3,AV_CODEC_ID_G728,+ AV_CODEC_ID_AHX,/* subtitle codecs */AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.diff --git a/third_party/ffmpeg/libavcodec/codec_par.h b/third_party/ffmpeg/libavcodec/codec_par.hindex 64b01f7..2697605 100644--- a/third_party/ffmpeg/libavcodec/codec_par.h+++ b/third_party/ffmpeg/libavcodec/codec_par.h@@ -212,6 +212,11 @@ typedef struct AVCodecParameters {* Audio only. Number of samples to skip after a discontinuity.*/int seek_preroll;++ /**+ * Video with alpha channel only. Alpha channel handling+ */+ enum AVAlphaMode alpha_mode;} AVCodecParameters;/**diff --git a/third_party/ffmpeg/libavcodec/exif.h b/third_party/ffmpeg/libavcodec/exif.hindex f70d213..1824a38 100644--- a/third_party/ffmpeg/libavcodec/exif.h+++ b/third_party/ffmpeg/libavcodec/exif.h@@ -1,6 +1,7 @@/** EXIF metadata parser* Copyright (c) 2013 Thilo Borgmann <thilo.borgmann _at_ mail.de>+ * Copyright (c) 2024-2025 Leo Izen <[email protected]>** This file is part of FFmpeg.*@@ -23,21 +24,206 @@* @file* EXIF metadata parser* @author Thilo Borgmann <thilo.borgmann _at_ mail.de>+ * @author Leo Izen <[email protected]>*/#ifndef AVCODEC_EXIF_H#define AVCODEC_EXIF_H+#include <stddef.h>#include <stdint.h>++#include "libavutil/buffer.h"#include "libavutil/dict.h"-#include "bytestream.h"+#include "libavutil/rational.h"+#include "version_major.h"++/** Data type identifiers for TIFF tags */+enum AVTiffDataType {+ AV_TIFF_BYTE = 1,+ AV_TIFF_STRING,+ AV_TIFF_SHORT,+ AV_TIFF_LONG,+ AV_TIFF_RATIONAL,+ AV_TIFF_SBYTE,+ AV_TIFF_UNDEFINED,+ AV_TIFF_SSHORT,+ AV_TIFF_SLONG,+ AV_TIFF_SRATIONAL,+ AV_TIFF_FLOAT,+ AV_TIFF_DOUBLE,+ AV_TIFF_IFD,+};++enum AVExifHeaderMode {+ /**+ * The TIFF header starts with 0x49492a00, or 0x4d4d002a.+ * This one is used internally by FFmpeg.+ */+ AV_EXIF_TIFF_HEADER,+ /** skip the TIFF header, assume little endian */+ AV_EXIF_ASSUME_LE,+ /** skip the TIFF header, assume big endian */+ AV_EXIF_ASSUME_BE,+ /** The first four bytes point to the actual start, then it's AV_EXIF_TIFF_HEADER */+ AV_EXIF_T_OFF,+ /** The first six bytes contain "Exif\0\0", then it's AV_EXIF_TIFF_HEADER */+ AV_EXIF_EXIF00,+};++typedef struct AVExifEntry AVExifEntry;++typedef struct AVExifMetadata {+ /* array of EXIF metadata entries */+ AVExifEntry *entries;+ /* number of entries in this array */+ unsigned int count;+ /* size of the buffer, used for av_fast_realloc */+ unsigned int size;+} AVExifMetadata;++struct AVExifEntry {+ uint16_t id;+ enum AVTiffDataType type;+ uint32_t count;++ /*+ * These are for IFD-style MakerNote+ * entries which occur after a fixed+ * offset rather than at the start of+ * the entry. The ifd_lead field contains+ * the leading bytes which typically+ * identify the type of MakerNote.+ */+ uint32_t ifd_offset;+ uint8_t *ifd_lead;++ /*+ * An array of entries of size count+ * Unless it's an IFD, in which case+ * it's not an array and count = 1+ */+ union {+ void *ptr;+ int64_t *sint;+ uint64_t *uint;+ double *dbl;+ char *str;+ uint8_t *ubytes;+ int8_t *sbytes;+ AVRational *rat;+ AVExifMetadata ifd;+ } value;+};++/**+ * Retrieves the tag name associated with the provided tag ID.+ * If the tag ID is unknown, NULL is returned.+ *+ * For example, av_exif_get_tag_name(0x112) returns "Orientation".+ */+const char *av_exif_get_tag_name(uint16_t id);++/**+ * Retrieves the tag ID associated with the provided tag string name.+ * If the tag name is unknown, a negative number is returned. Otherwise+ * it always fits inside a uint16_t integer.+ *+ * For example, av_exif_get_tag_id("Orientation") returns 274 (0x0112).+ */+int32_t av_exif_get_tag_id(const char *name);++/**+ * Add an entry to the provided EXIF metadata struct. If one already exists with the provided+ * ID, it will set the existing one to have the other information provided. Otherwise, it+ * will allocate a new entry.+ *+ * This function reallocates ifd->entries using av_realloc and allocates (using av_malloc)+ * a new value member of the entry, then copies the contents of value into that buffer.+ */+int av_exif_set_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, enum AVTiffDataType type,+ uint32_t count, const uint8_t *ifd_lead, uint32_t ifd_offset, const void *value);++/**+ * Also check subdirectories.+ */+#define AV_EXIF_FLAG_RECURSIVE (1 << 0)++/**+ * Get an entry with the tagged ID from the EXIF metadata struct. A pointer to the entry+ * will be written into *value.+ *+ * If the entry was present and returned successfully, a positive number is returned.+ * If the entry was not found, *value is left untouched and zero is returned.+ * If an error occurred, a negative number is returned.+ */+int av_exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags, AVExifEntry **value);-/** Recursively decodes all IFD's and- * adds included TAGS into the metadata dictionary. */-int avpriv_exif_decode_ifd(void *logctx, const uint8_t *buf, int size,- int le, int depth, AVDictionary **metadata);+/**+ * Remove an entry from the provided EXIF metadata struct.+ *+ * If the entry was present and removed successfully, a positive number is returned.+ * If the entry was not found, zero is returned.+ * If an error occurred, a negative number is returned.+ */+int av_exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags);++/**+ * Decodes the EXIF data provided in the buffer and writes it into the+ * struct *ifd. If this function succeeds, the IFD is owned by the caller+ * and must be cleared after use by calling av_exif_free(); If this function+ * fails and returns a negative value, it will call av_exif_free(ifd) before+ * returning.+ */+int av_exif_parse_buffer(void *logctx, const uint8_t *data, size_t size,+ AVExifMetadata *ifd, enum AVExifHeaderMode header_mode);++/**+ * Allocates a buffer using av_malloc of an appropriate size and writes the+ * EXIF data represented by ifd into that buffer.+ *+ * Upon error, *buffer will be NULL. The buffer becomes owned by the caller upon+ * success. The *buffer argument must be NULL before calling.+ */+int av_exif_write(void *logctx, const AVExifMetadata *ifd, AVBufferRef **buffer, enum AVExifHeaderMode header_mode);++/**+ * Frees all resources associated with the given EXIF metadata struct.+ * Does not free the pointer passed itself, in case it is stack-allocated.+ * The pointer passed to this function must be freed by the caller,+ * if it is heap-allocated. Passing NULL is permitted.+ */+void av_exif_free(AVExifMetadata *ifd);-int ff_exif_decode_ifd(void *logctx, GetByteContext *gbytes, int le,- int depth, AVDictionary **metadata);+/**+ * Recursively reads all tags from the IFD and stores them in the+ * provided metadata dictionary.+ */+int av_exif_ifd_to_dict(void *logctx, const AVExifMetadata *ifd, AVDictionary **metadata);++/**+ * Allocates a duplicate of the provided EXIF metadata struct. The caller owns+ * the duplicate and must free it with av_exif_free. Returns NULL if the duplication+ * process failed.+ */+AVExifMetadata *av_exif_clone_ifd(const AVExifMetadata *ifd);++/**+ * Convert a display matrix used by AV_FRAME_DATA_DISPLAYMATRIX+ * into an orientation constant used by EXIF's orientation tag.+ *+ * Returns an EXIF orientation between 1 and 8 (inclusive) depending+ * on the rotation and flip factors. Returns 0 if the matrix is singular.+ */+int av_exif_matrix_to_orientation(const int32_t *matrix);++/**+ * Convert an orientation constant used by EXIF's orientation tag+ * into a display matrix used by AV_FRAME_DATA_DISPLAYMATRIX.+ *+ * Returns 0 on success and negative if the orientation is invalid,+ * i.e. not between 1 and 8 (inclusive).+ */+int av_exif_orientation_to_matrix(int32_t *matrix, int orientation);#endif /* AVCODEC_EXIF_H */diff --git a/third_party/ffmpeg/libavcodec/packet.h b/third_party/ffmpeg/libavcodec/packet.hindex 55389a9..59bfddf 100644--- a/third_party/ffmpeg/libavcodec/packet.h+++ b/third_party/ffmpeg/libavcodec/packet.h@@ -362,6 +362,12 @@ enum AVPacketSideDataType {*/AV_PKT_DATA_RTCP_SR,+ /**+ * Extensible image file format metadata. The payload is a buffer containing+ * EXIF metadata, starting with either 49 49 2a 00, or 4d 4d 00 2a.+ */+ AV_PKT_DATA_EXIF,+/*** The number of side data types.* This is not part of the public API/ABI in the sense that it may@@ -483,6 +489,36 @@ void av_packet_side_data_remove(AVPacketSideData *sd, int *nb_sd,*/void av_packet_side_data_free(AVPacketSideData **sd, int *nb_sd);+struct AVFrameSideData;++/**+ * Add a new packet side data entry to an array based on existing frame+ * side data, if a matching type exists for packet side data.+ *+ * @param flags Currently unused. Must be 0.+ * @retval >= 0 Success+ * @retval AVERROR(EINVAL) The frame side data type does not have a matching+ * packet side data type.+ * @retval AVERROR(ENOMEM) Failed to add a side data entry to the array, or+ * similar.+ */+int av_packet_side_data_from_frame(AVPacketSideData **sd, int *nb_sd,+ const struct AVFrameSideData *src, unsigned int flags);+/**+ * Add a new frame side data entry to an array based on existing packet+ * side data, if a matching type exists for frame side data.+ *+ * @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags,+ * or 0.+ * @retval >= 0 Success+ * @retval AVERROR(EINVAL) The packet side data type does not have a matching+ * frame side data type.+ * @retval AVERROR(ENOMEM) Failed to add a side data entry to the array, or+ * similar.+ */+int av_packet_side_data_to_frame(struct AVFrameSideData ***sd, int *nb_sd,+ const AVPacketSideData *src, unsigned int flags);+const char *av_packet_side_data_name(enum AVPacketSideDataType type);/**diff --git a/third_party/ffmpeg/libavcodec/version.h b/third_party/ffmpeg/libavcodec/version.hindex 8b53586..1e3be34 100644--- a/third_party/ffmpeg/libavcodec/version.h+++ b/third_party/ffmpeg/libavcodec/version.h@@ -29,8 +29,8 @@#include "version_major.h"-#define LIBAVCODEC_VERSION_MINOR 11-#define LIBAVCODEC_VERSION_MICRO 100+#define LIBAVCODEC_VERSION_MINOR 28+#define LIBAVCODEC_VERSION_MICRO 102#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \LIBAVCODEC_VERSION_MINOR, \diff --git a/third_party/ffmpeg/libavcodec/version_major.h b/third_party/ffmpeg/libavcodec/version_major.hindex 97e4e12..6c65237 100644--- a/third_party/ffmpeg/libavcodec/version_major.h+++ b/third_party/ffmpeg/libavcodec/version_major.h@@ -42,9 +42,13 @@#define FF_API_V408_CODECID (LIBAVCODEC_VERSION_MAJOR < 63)#define FF_API_CODEC_PROPS (LIBAVCODEC_VERSION_MAJOR < 63)#define FF_API_EXR_GAMMA (LIBAVCODEC_VERSION_MAJOR < 63)+#define FF_API_INTRA_DC_PRECISION (LIBAVCODEC_VERSION_MAJOR < 63)#define FF_API_NVDEC_OLD_PIX_FMTS (LIBAVCODEC_VERSION_MAJOR < 63)+#define FF_API_PARSER_PRIVATE (LIBAVCODEC_VERSION_MAJOR < 63)+#define FF_API_PARSER_CODECID (LIBAVCODEC_VERSION_MAJOR < 63)+// reminder to remove the OMX encoder on next major bump#define FF_CODEC_OMX (LIBAVCODEC_VERSION_MAJOR < 63)// reminder to remove Sonic Lossy/Lossless encoders on next major bumpdiff --git a/third_party/ffmpeg/libavformat/avformat.h b/third_party/ffmpeg/libavformat/avformat.hindex be6e532..ee0dddd 100644--- a/third_party/ffmpeg/libavformat/avformat.h+++ b/third_party/ffmpeg/libavformat/avformat.h@@ -1065,9 +1065,8 @@ typedef struct AVStreamGroupTileGrid {* AVStreamGroupLCEVC is meant to define the relation between video streams* and a data stream containing LCEVC enhancement layer NALUs.*- * No more than one stream of @ref AVCodecParameters.codec_type "codec_type"- * AVMEDIA_TYPE_DATA shall be present, and it must be of- * @ref AVCodecParameters.codec_id "codec_id" AV_CODEC_ID_LCEVC.+ * No more than one stream of+ * @ref AVCodecParameters.codec_id "codec_id" AV_CODEC_ID_LCEVC shall be present.*/typedef struct AVStreamGroupLCEVC {const AVClass *av_class;@@ -1884,6 +1883,11 @@ typedef struct AVFormatContext {* @see skip_estimate_duration_from_pts*/int64_t duration_probesize;++ /**+ * Name of this format context, only used for logging purposes.+ */+ char *name;} AVFormatContext;/**@@ -2364,6 +2368,101 @@ int av_read_play(AVFormatContext *s);*/int av_read_pause(AVFormatContext *s);+/**+ * Command IDs that can be sent to the demuxer+ *+ * The following commands can be sent to a demuxer+ * using ::avformat_send_command.+ */+enum AVFormatCommandID {+ /**+ * Send a RTSP `SET_PARAMETER` request to the server+ *+ * Sends an SET_PARAMETER RTSP command to the server,+ * with a data payload of type ::AVRTSPCommandRequest,+ * ownership of it and its data remains with the caller.+ *+ * A reply retrieved is of type ::AVRTSPResponse and it+ * and its contents must be freed by the caller.+ */+ AVFORMAT_COMMAND_RTSP_SET_PARAMETER,+};++typedef struct AVRTSPCommandRequest {+ /**+ * Headers sent in the request to the server+ */+ AVDictionary *headers;++ /**+ * Body payload size+ */+ size_t body_len;++ /**+ * Body payload+ */+ char *body;+} AVRTSPCommandRequest;++typedef struct AVRTSPResponse {+ /**+ * Response status code from server+ */+ int status_code;++ /**+ * Reason phrase from the server, describing the+ * status in a human-readable way.+ */+ char *reason;++ /**+ * Body payload size+ */+ size_t body_len;++ /**+ * Body payload+ */+ unsigned char *body;+} AVRTSPResponse;++/**+ * Send a command to the demuxer+ *+ * Sends the specified command and (depending on the command)+ * optionally a command-specific payload to the demuxer to handle.+ *+ * @param s Format context, must be allocated with+ * ::avformat_alloc_context.+ * @param id Identifier of type ::AVFormatCommandID,+ * indicating the command to send.+ * @param data Command-specific data, allocated by the caller+ * and ownership remains with the caller.+ * For details what is expected here, consult the+ * documentation of the respective ::AVFormatCommandID.+ */+int avformat_send_command(AVFormatContext *s, enum AVFormatCommandID id, void *data);++/**+ * Receive a command reply from the demuxer+ *+ * Retrieves a reply for a previously sent command from the muxer.+ *+ * @param s Format context, must be allocated with+ * ::avformat_alloc_context.+ * @param id Identifier of type ::AVFormatCommandID,+ * indicating the command for which to retrieve+ * the reply.+ * @param data_out Pointee is set to the command reply, the actual+ * type depends on the command. This is allocated by+ * the muxer and must be freed with ::av_free.+ * For details on the actual data set here, consult the+ * documentation of the respective ::AVFormatCommandID.+ */+int avformat_receive_command_reply(AVFormatContext *s, enum AVFormatCommandID id, void **data_out);+/*** Close an opened input AVFormatContext. Free it and all its contents* and set *s to NULL.@@ -2819,7 +2918,8 @@ void av_dump_format(AVFormatContext *ic,int is_output);-#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1 ///< Allow multiple %d+#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1 ///< Allow multiple %d+#define AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION 2 ///< Ignore truncated output instead of returning an error/*** Return in 'buf' the path with '%d' replaced by a number.@@ -2889,6 +2989,20 @@ int av_match_ext(const char *filename, const char *extensions);int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,int std_compliance);+struct AVBPrint;+/**+ * Make a RFC 4281/6381 like string describing a codec for MIME types.+ *+ * @param par pointer to an AVCodecParameters struct describing the codec+ * @param frame_rate an AVRational for the frame rate, for deciding the+ * right profile for video codecs. Pass an invalid+ * AVRational (1/0) to indicate that it is unknown.+ * @param out the AVBPrint to write the output to+ * @return <0 on error+ */+int av_mime_codec_str(const AVCodecParameters *par,+ AVRational frame_rate, struct AVBPrint *out);+/*** @defgroup riff_fourcc RIFF FourCCs* @{diff --git a/third_party/ffmpeg/libavformat/avio.h b/third_party/ffmpeg/libavformat/avio.hindex ebf6111..fbcb7db 100644--- a/third_party/ffmpeg/libavformat/avio.h+++ b/third_party/ffmpeg/libavformat/avio.h@@ -461,17 +461,17 @@ int avio_put_str16be(AVIOContext *s, const char *str);void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type);/**- * ORing this as the "whence" parameter to a seek function causes it to+ * Passing this as the "whence" parameter to a seek function causes it to* return the filesize without seeking anywhere. Supporting this is optional.* If it is not supported then the seek function will return <0.*/#define AVSEEK_SIZE 0x10000/**- * Passing this flag as the "whence" parameter to a seek function causes it to+ * OR'ing this flag into the "whence" parameter to a seek function causes it to* seek by any means (like reopening and linear reading) or other normally unreasonable* means that can be extremely slow.- * This may be ignored by the seek code.+ * This is the default and therefore ignored by the seek code since 2010.*/#define AVSEEK_FORCE 0x20000diff --git a/third_party/ffmpeg/libavformat/version.h b/third_party/ffmpeg/libavformat/version.hindex 7ff1483..ea3d73c 100644--- a/third_party/ffmpeg/libavformat/version.h+++ b/third_party/ffmpeg/libavformat/version.h@@ -31,8 +31,8 @@#include "version_major.h"-#define LIBAVFORMAT_VERSION_MINOR 3-#define LIBAVFORMAT_VERSION_MICRO 100+#define LIBAVFORMAT_VERSION_MINOR 12+#define LIBAVFORMAT_VERSION_MICRO 102#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \LIBAVFORMAT_VERSION_MINOR, \diff --git a/third_party/ffmpeg/libavutil/attributes.h b/third_party/ffmpeg/libavutil/attributes.hindex d15ede1..0e49b22 100644--- a/third_party/ffmpeg/libavutil/attributes.h+++ b/third_party/ffmpeg/libavutil/attributes.h@@ -40,8 +40,27 @@# define AV_HAS_BUILTIN(x) 0#endif+#ifdef __has_attribute+# define AV_HAS_ATTRIBUTE(x) __has_attribute(x)+#else+# define AV_HAS_ATTRIBUTE(x) 0+#endif++#if defined(__cplusplus) && \+ defined(__has_cpp_attribute) && \+ __cplusplus >= 201103L+# define AV_HAS_STD_ATTRIBUTE(x) __has_cpp_attribute(x)+#elif !defined(__cplusplus) && \+ defined(__has_c_attribute) && \+ defined(__STDC_VERSION__) && \+ __STDC_VERSION__ >= 202311L+# define AV_HAS_STD_ATTRIBUTE(x) __has_c_attribute(x)+#else+# define AV_HAS_STD_ATTRIBUTE(x) 0+#endif+#ifndef av_always_inline-#if AV_GCC_VERSION_AT_LEAST(3,1)+#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)# define av_always_inline __attribute__((always_inline)) inline#elif defined(_MSC_VER)# define av_always_inline __forceinline@@ -58,13 +77,15 @@#endif#endif-#if AV_GCC_VERSION_AT_LEAST(3,4)+#if AV_HAS_STD_ATTRIBUTE(nodiscard)+# define av_warn_unused_result [[nodiscard]]+#elif AV_GCC_VERSION_AT_LEAST(3,4) || defined(__clang__)# define av_warn_unused_result __attribute__((warn_unused_result))#else# define av_warn_unused_result#endif-#if AV_GCC_VERSION_AT_LEAST(3,1)+#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)# define av_noinline __attribute__((noinline))#elif defined(_MSC_VER)# define av_noinline __declspec(noinline)@@ -96,7 +117,9 @@# define av_flatten#endif-#if AV_GCC_VERSION_AT_LEAST(3,1)+#if AV_HAS_STD_ATTRIBUTE(deprecated)+# define attribute_deprecated [[deprecated]]+#elif AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)# define attribute_deprecated __attribute__((deprecated))#elif defined(_MSC_VER)# define attribute_deprecated __declspec(deprecated)@@ -127,7 +150,9 @@#endif#endif-#if defined(__GNUC__) || defined(__clang__)+#if AV_HAS_STD_ATTRIBUTE(maybe_unused)+# define av_unused [[maybe_unused]]+#elif defined(__GNUC__) || defined(__clang__)# define av_unused __attribute__((unused))#else# define av_unused@@ -158,15 +183,42 @@#if defined(__GNUC__) || defined(__clang__)# define av_builtin_constant_p __builtin_constant_p-# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))-# define av_scanf_format(fmtpos, attrpos) __attribute__((__format__(__scanf__, fmtpos, attrpos)))#else# define av_builtin_constant_p(x) 0+#endif++// for __MINGW_PRINTF_FORMAT and __MINGW_SCANF_FORMAT+#ifdef __MINGW32__+# include <stdio.h>+#endif++#ifdef __MINGW_PRINTF_FORMAT+# define AV_PRINTF_FMT __MINGW_PRINTF_FORMAT+#elif AV_HAS_ATTRIBUTE(format)+# define AV_PRINTF_FMT __printf__+#endif++#ifdef __MINGW_SCANF_FORMAT+# define AV_SCANF_FMT __MINGW_SCANF_FORMAT+#elif AV_HAS_ATTRIBUTE(format)+# define AV_SCANF_FMT __scanf__+#endif++#ifdef AV_PRINTF_FMT+# define av_printf_format(fmtpos, attrpos) __attribute__((format(AV_PRINTF_FMT, fmtpos, attrpos)))+#else# define av_printf_format(fmtpos, attrpos)+#endif++#ifdef AV_SCANF_FMT+# define av_scanf_format(fmtpos, attrpos) __attribute__((format(AV_SCANF_FMT, fmtpos, attrpos)))+#else# define av_scanf_format(fmtpos, attrpos)#endif-#if AV_GCC_VERSION_AT_LEAST(2,5) || defined(__clang__)+#if AV_HAS_STD_ATTRIBUTE(noreturn)+# define av_noreturn [[noreturn]]+#elif AV_GCC_VERSION_AT_LEAST(2,5) || defined(__clang__)# define av_noreturn __attribute__((noreturn))#else# define av_noreturndiff --git a/third_party/ffmpeg/libavutil/avassert.h b/third_party/ffmpeg/libavutil/avassert.hindex f4f039d..e316a3c 100644--- a/third_party/ffmpeg/libavutil/avassert.h+++ b/third_party/ffmpeg/libavutil/avassert.h@@ -34,6 +34,7 @@#include "attributes.h"#include "log.h"#include "macros.h"+#include "version.h"/*** assert() equivalent, that is always enabled.@@ -63,18 +64,25 @@*/#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1#define av_assert2(cond) av_assert0(cond)-#define av_assert2_fpu() av_assert0_fpu()#else#define av_assert2(cond) ((void)0)-#define av_assert2_fpu() ((void)0)#endif+#if FF_API_ASSERT_FPU+#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1+#define av_assert2_fpu() av_assert0_fpu()+#else+#define av_assert2_fpu() ((void)0)+#endif/*** Assert that floating point operations can be executed.** This will av_assert0() that the cpu is not in MMX state on X86+ * @deprecated without replacement*/+attribute_deprecatedvoid av_assert0_fpu(void);+#endif/*** Asserts that are used as compiler optimization hints depending@@ -108,16 +116,10 @@ do { \#define av_unreachable(msg) ((void)0)#endif-#if AV_HAS_BUILTIN(__builtin_assume)-#define av_assume(cond) __builtin_assume(cond)-#elif defined(_MSC_VER)-#define av_assume(cond) __assume(cond)-#else#define av_assume(cond) do { \if (!(cond)) \av_unreachable(); \} while (0)#endif-#endif#endif /* AVUTIL_AVASSERT_H */diff --git a/third_party/ffmpeg/libavutil/avconfig.h b/third_party/ffmpeg/libavutil/avconfig.hindex ca0f665..c289fbb 100644--- a/third_party/ffmpeg/libavutil/avconfig.h+++ b/third_party/ffmpeg/libavutil/avconfig.h@@ -1,3 +1,6 @@-#pragma once+/* Generated by ffmpeg configure */+#ifndef AVUTIL_AVCONFIG_H+#define AVUTIL_AVCONFIG_H#define AV_HAVE_BIGENDIAN 0#define AV_HAVE_FAST_UNALIGNED 1+#endif /* AVUTIL_AVCONFIG_H */diff --git a/third_party/ffmpeg/libavutil/bswap.h b/third_party/ffmpeg/libavutil/bswap.hindex f53e576..c1e6591 100644--- a/third_party/ffmpeg/libavutil/bswap.h+++ b/third_party/ffmpeg/libavutil/bswap.h@@ -68,7 +68,7 @@ static av_always_inline av_const uint32_t av_bswap32(uint32_t x)#ifndef av_bswap64static inline uint64_t av_const av_bswap64(uint64_t x){- return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);+ return (uint64_t)av_bswap32((uint32_t)x) << 32 | av_bswap32((uint32_t)(x >> 32));}#endifdiff --git a/third_party/ffmpeg/libavutil/cpu.h b/third_party/ffmpeg/libavutil/cpu.hindex 5ef5da5..464d4cd 100644--- a/third_party/ffmpeg/libavutil/cpu.h+++ b/third_party/ffmpeg/libavutil/cpu.h@@ -24,7 +24,9 @@#include <stddef.h>#include "version.h"-#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */+#if FF_API_CPU_FLAG_FORCE+#define AV_CPU_FLAG_FORCE 0x80000000 /* @deprecated, should not be used */+#endif/* lower 16 bits - CPU features */#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX@@ -45,6 +47,7 @@#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions#define AV_CPU_FLAG_AESNI 0x80000 ///< Advanced Encryption Standard functions+#define AV_CPU_FLAG_CLMUL 0x400000 ///< Carry-less Multiplication instruction#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used#define AV_CPU_FLAG_AVXSLOW 0x8000000 ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer)#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions@@ -74,6 +77,10 @@#define AV_CPU_FLAG_I8MM (1 << 9)#define AV_CPU_FLAG_SVE (1 <<10)#define AV_CPU_FLAG_SVE2 (1 <<11)+#define AV_CPU_FLAG_SME (1 <<12)+#define AV_CPU_FLAG_ARM_CRC (1 <<13)+#define AV_CPU_FLAG_SME2 (1 <<14)+#define AV_CPU_FLAG_SME_I16I64 (1 <<15)#define AV_CPU_FLAG_SETEND (1 <<16)#define AV_CPU_FLAG_MMI (1 << 0)diff --git a/third_party/ffmpeg/libavutil/csp.h b/third_party/ffmpeg/libavutil/csp.hindex 9871b1c..9d75ccb 100644--- a/third_party/ffmpeg/libavutil/csp.h+++ b/third_party/ffmpeg/libavutil/csp.h@@ -133,6 +133,22 @@ enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc **/double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc);+/**+ * Determine a suitable EOTF 'gamma' value to match the supplied+ * AVColorTransferCharacteristic.+ *+ * This function returns the gamma value (exponent) for a simple pure power+ * function approximation of the supplied AVColorTransferCharacteristic, or 0.+ * if no reasonable approximation exists.+ *+ * EOTF(v) = (L_w - L_b) * v^gamma + L_b+ *+ * @return Will return an approximation to the simple gamma function matching+ * the supplied Transfer Characteristic EOTF, Will return 0.0 for any+ * we cannot reasonably match against.+ */+double av_csp_approximate_eotf_gamma(enum AVColorTransferCharacteristic trc);+/*** Determine the function needed to apply the given* AVColorTransferCharacteristic to linear input.diff --git a/third_party/ffmpeg/libavutil/dovi_meta.h b/third_party/ffmpeg/libavutil/dovi_meta.hindex 5e8a1e4..c102bf3 100644--- a/third_party/ffmpeg/libavutil/dovi_meta.h+++ b/third_party/ffmpeg/libavutil/dovi_meta.h@@ -279,12 +279,20 @@ typedef struct AVDOVIDmLevel11 {uint8_t content_type;uint8_t whitepoint;uint8_t reference_mode_flag;+#if FF_API_DOVI_L11_INVALID_PROPS+ attribute_deprecateduint8_t sharpness;+ attribute_deprecateduint8_t noise_reduction;+ attribute_deprecateduint8_t mpeg_noise_reduction;+ attribute_deprecateduint8_t frame_rate_conversion;+ attribute_deprecateduint8_t brightness;+ attribute_deprecateduint8_t color;+#endif} AVDOVIDmLevel11;typedef struct AVDOVIDmLevel254 {@@ -369,6 +377,10 @@ av_dovi_get_color(const AVDOVIMetadata *data)return (AVDOVIColorMetadata *)((uint8_t *) data + data->color_offset);}+/**+ * Gets the specified Dolby Vision Display Management (DM) metadata+ * @param index must be non negative and below data->num_ext_blocks+ */static av_always_inline AVDOVIDmData *av_dovi_get_ext(const AVDOVIMetadata *data, int index){diff --git a/third_party/ffmpeg/libavutil/frame.h b/third_party/ffmpeg/libavutil/frame.hindex d440cfb..771c9ce 100644--- a/third_party/ffmpeg/libavutil/frame.h+++ b/third_party/ffmpeg/libavutil/frame.h@@ -254,6 +254,12 @@ enum AVFrameSideDataType {* libavutil/tdrdi.h.*/AV_FRAME_DATA_3D_REFERENCE_DISPLAYS,++ /**+ * Extensible image file format metadata. The payload is a buffer containing+ * EXIF metadata, starting with either 49 49 2a 00, or 4d 4d 00 2a.+ */+ AV_FRAME_DATA_EXIF,};enum AVActiveFormatDescription {@@ -652,7 +658,7 @@ typedef struct AVFrame {** For coding bitstream formats which support both lossless and lossy* encoding, it is sometimes possible for a decoder to determine which method- * was used when the bitsream was encoded.+ * was used when the bitstream was encoded.*/#define AV_FRAME_FLAG_LOSSLESS (1 << 5)/**@@ -736,7 +742,7 @@ typedef struct AVFrame {/*** @anchor cropping* @name Cropping- * Video frames only. The number of pixels to discard from the the+ * Video frames only. The number of pixels to discard from the* top/bottom/left/right border of the frame to obtain the sub-rectangle of* the frame intended for presentation.* @{@@ -767,6 +773,13 @@ typedef struct AVFrame {* Duration of the frame, in the same units as pts. 0 if unknown.*/int64_t duration;++ /**+ * Indicates how the alpha channel of the video is to be handled.+ * - encoding: Set by user+ * - decoding: Set by libavcodec+ */+ enum AVAlphaMode alpha_mode;} AVFrame;@@ -812,7 +825,7 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src);* Ensure the destination frame refers to the same data described by the source* frame, either by creating a new reference for each AVBufferRef from src if* they differ from those in dst, by allocating new buffers and copying data if- * src is not reference counted, or by unrefencing it if src is empty.+ * src is not reference counted, or by unreferencing it if src is empty.** Frame properties on dst will be replaced by those from src.*diff --git a/third_party/ffmpeg/libavutil/hwcontext_amf.h b/third_party/ffmpeg/libavutil/hwcontext_amf.hindex 8823190..6f2cabc 100644--- a/third_party/ffmpeg/libavutil/hwcontext_amf.h+++ b/third_party/ffmpeg/libavutil/hwcontext_amf.h@@ -38,6 +38,10 @@ typedef struct AVAMFDeviceContext {int64_t version; ///< version of AMF runtimeAMFContext *context;AMF_MEMORY_TYPE memory_type;++ void (*lock)(void *lock_ctx);+ void (*unlock)(void *lock_ctx);+ void *lock_ctx;} AVAMFDeviceContext;enum AMF_SURFACE_FORMAT av_av_to_amf_format(enum AVPixelFormat fmt);diff --git a/third_party/ffmpeg/libavutil/hwcontext_d3d11va.h b/third_party/ffmpeg/libavutil/hwcontext_d3d11va.hindex 77d2d72..b87b1e8 100644--- a/third_party/ffmpeg/libavutil/hwcontext_d3d11va.h+++ b/third_party/ffmpeg/libavutil/hwcontext_d3d11va.h@@ -94,6 +94,20 @@ typedef struct AVD3D11VADeviceContext {void (*lock)(void *lock_ctx);void (*unlock)(void *lock_ctx);void *lock_ctx;+ /**+ * D3D11_TEXTURE2D_DESC.BindFlags to be applied to D3D11 resources allocated+ * for frames using this device context.+ *+ * It applies globally to all AVD3D11VAFramesContext allocated from this device context.+ */+ UINT BindFlags;+ /**+ * D3D11_TEXTURE2D_DESC.MiscFlags to be applied to D3D11 resources allocated+ * for frames using this device context.+ *+ * It applies globally to all AVD3D11VAFramesContext allocated from this device context.+ */+ UINT MiscFlags;} AVD3D11VADeviceContext;/**diff --git a/third_party/ffmpeg/libavutil/hwcontext_d3d12va.h b/third_party/ffmpeg/libavutil/hwcontext_d3d12va.hindex 212a6a6..adbec88 100644--- a/third_party/ffmpeg/libavutil/hwcontext_d3d12va.h+++ b/third_party/ffmpeg/libavutil/hwcontext_d3d12va.h@@ -75,6 +75,26 @@ typedef struct AVD3D12VADeviceContext {void (*lock)(void *lock_ctx);void (*unlock)(void *lock_ctx);void *lock_ctx;++ /**+ * Resource flags to be applied to D3D12 resources allocated+ * for frames using this device context.+ *+ * If unset, this will be D3D12_RESOURCE_FLAG_NONE.+ *+ * It applies globally to all AVD3D12VAFramesContext allocated from this device context.+ */+ D3D12_RESOURCE_FLAGS resource_flags;++ /**+ * Heap flags to be applied to D3D12 resources allocated+ * for frames using this device context.+ *+ * If unset, this will be D3D12_HEAP_FLAG_NONE.+ *+ * It applies globally to all AVD3D12VAFramesContext allocated from this device context.+ */+ D3D12_HEAP_FLAGS heap_flags;} AVD3D12VADeviceContext;/**@@ -99,6 +119,18 @@ typedef struct AVD3D12VASyncContext {uint64_t fence_value;} AVD3D12VASyncContext;+/**+ * Define the behaviours of frame allocation.+ */+typedef enum AVD3D12VAFrameFlags {+ AV_D3D12VA_FRAME_FLAG_NONE = 0,++ /**+ * Indicates that frame data should be allocated using a texture array resource.+ */+ AV_D3D12VA_FRAME_FLAG_TEXTURE_ARRAY = (1 << 1),+} AVD3D12VAFrameFlags;+/*** @brief D3D12VA frame descriptor for pool allocation.*@@ -111,12 +143,26 @@ typedef struct AVD3D12VAFrame {*/ID3D12Resource *texture;+ /**+ * Index of the subresource within the texture.+ *+ * In texture array mode, this specifies the array slice index.+ * When texture array mode is not used, this value is always 0.+ */+ int subresource_index;+/*** The sync context for the texture** @see: https://learn.microsoft.com/en-us/windows/win32/medfound/direct3d-12-video-overview#directx-12-fences*/AVD3D12VASyncContext sync_ctx;++ /**+ * A combination of AVD3D12VAFrameFlags.+ * Set by AVD3D12VAFramesContext.+ */+ AVD3D12VAFrameFlags flags;} AVD3D12VAFrame;/**@@ -136,7 +182,28 @@ typedef struct AVD3D12VAFramesContext {** @see https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_resource_flags*/- D3D12_RESOURCE_FLAGS flags;+ D3D12_RESOURCE_FLAGS resource_flags;++ /**+ * Options for working with heaps allocation when creating resources.+ * If unset, this will be D3D12_HEAP_FLAG_NONE.+ *+ * @see https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_heap_flags+ */+ D3D12_HEAP_FLAGS heap_flags;++ /**+ * In texture array mode, the D3D12 uses the same texture array (resource)for all+ * pictures.+ */+ ID3D12Resource *texture_array;++ /**+ * A combination of AVD3D12VAFrameFlags. Unless AV_D3D12VA_FRAME_FLAG_NONE is set,+ * autodetected flags will be OR'd based on the device and frame features during+ * av_hwframe_ctx_init().+ */+ AVD3D12VAFrameFlags flags;} AVD3D12VAFramesContext;#endif /* AVUTIL_HWCONTEXT_D3D12VA_H */diff --git a/third_party/ffmpeg/libavutil/hwcontext_vaapi.h b/third_party/ffmpeg/libavutil/hwcontext_vaapi.hindex 0b2e071..82e4194 100644--- a/third_party/ffmpeg/libavutil/hwcontext_vaapi.h+++ b/third_party/ffmpeg/libavutil/hwcontext_vaapi.h@@ -26,7 +26,7 @@* API-specific header for AV_HWDEVICE_TYPE_VAAPI.** Dynamic frame pools are supported, but note that any pool used as a render- * target is required to be of fixed size in order to be be usable as an+ * target is required to be of fixed size in order to be usable as an* argument to vaCreateContext().** For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefsdiff --git a/third_party/ffmpeg/libavutil/hwcontext_vulkan.h b/third_party/ffmpeg/libavutil/hwcontext_vulkan.hindex 15cf515..b9a841a 100644--- a/third_party/ffmpeg/libavutil/hwcontext_vulkan.h+++ b/third_party/ffmpeg/libavutil/hwcontext_vulkan.h@@ -97,6 +97,8 @@ typedef struct AVVulkanDeviceContext {* each entry containing the specified Vulkan extension string to enable.* Duplicates are possible and accepted.* If no extensions are enabled, set these fields to NULL, and 0 respectively.+ * av_vk_get_optional_instance_extensions() can be used to enumerate extensions+ * that FFmpeg may use if enabled.*/const char * const *enabled_inst_extensions;int nb_enabled_inst_extensions;@@ -108,6 +110,8 @@ typedef struct AVVulkanDeviceContext {* If supplying your own device context, these fields takes the same format as* the above fields, with the same conditions that duplicates are possible* and accepted, and that NULL and 0 respectively means no extensions are enabled.+ * av_vk_get_optional_device_extensions() can be used to enumerate extensions+ * that FFmpeg may use if enabled.*/const char * const *enabled_dev_extensions;int nb_enabled_dev_extensions;@@ -164,18 +168,26 @@ typedef struct AVVulkanDeviceContext {int nb_decode_queues;#endif+#if FF_API_VULKAN_SYNC_QUEUES/*** Locks a queue, preventing other threads from submitting any command* buffers to this queue.* If set to NULL, will be set to lavu-internal functions that utilize a* mutex.+ *+ * Deprecated: use VK_KHR_internally_synchronized_queues.*/+ attribute_deprecatedvoid (*lock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index);/*** Similar to lock_queue(), unlocks a queue. Must only be called after locking.+ *+ * Deprecated: use VK_KHR_internally_synchronized_queues.*/+ attribute_deprecatedvoid (*unlock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index);+#endif/*** Queue families used. Must be preferentially ordered. List may contain@@ -218,7 +230,8 @@ typedef struct AVVulkanFramesContext {/*** Defines extra usage of output frames. If non-zero, all flags MUST be- * supported by the VkFormat. Otherwise, will use supported flags amongst:+ * supported by the VkFormat. Regardless, frames will always have the+ * following usage flags enabled, if supported by the format:* - VK_IMAGE_USAGE_SAMPLED_BIT* - VK_IMAGE_USAGE_STORAGE_BIT* - VK_IMAGE_USAGE_TRANSFER_SRC_BIT@@ -374,4 +387,18 @@ AVVkFrame *av_vk_frame_alloc(void);*/const VkFormat *av_vkfmt_from_pixfmt(enum AVPixelFormat p);+/**+ * Returns an array of optional Vulkan instance extensions that FFmpeg+ * may use if enabled.+ * @note Must be freed via av_free()+ */+const char **av_vk_get_optional_instance_extensions(int *count);++/**+ * Returns an array of optional Vulkan device extensions that FFmpeg+ * may use if enabled.+ * @note Must be freed via av_free()+ */+const char **av_vk_get_optional_device_extensions(int *count);+#endif /* AVUTIL_HWCONTEXT_VULKAN_H */diff --git a/third_party/ffmpeg/libavutil/iamf.h b/third_party/ffmpeg/libavutil/iamf.hindex 855f642..a755e7d 100644--- a/third_party/ffmpeg/libavutil/iamf.h+++ b/third_party/ffmpeg/libavutil/iamf.h@@ -330,14 +330,17 @@ typedef struct AVIAMFLayer {/*** Demixing matrix as defined in section 3.6.3 of IAMF.*- * The length of the array is ch_layout.nb_channels multiplied by the sum of- * the amount of streams in the group plus the amount of streams in the group- * that are stereo.- ** May be set only if @ref ambisonics_mode == AV_IAMF_AMBISONICS_MODE_PROJECTION,* must be NULL otherwise.*/AVRational *demixing_matrix;++ /**+ * The length of the Demixing matrix array. Must be ch_layout.nb_channels multiplied+ * by the sum of the amount of streams in the group plus the amount of streams in+ * the group that are stereo.+ */+ unsigned int nb_demixing_matrix;} AVIAMFLayer;diff --git a/third_party/ffmpeg/libavutil/pixdesc.h b/third_party/ffmpeg/libavutil/pixdesc.hindex ba2f632..0cc70eb 100644--- a/third_party/ffmpeg/libavutil/pixdesc.h+++ b/third_party/ffmpeg/libavutil/pixdesc.h@@ -291,6 +291,16 @@ int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation p*/enum AVChromaLocation av_chroma_location_pos_to_enum(int xpos, int ypos);+/**+ * @return the name for provided alpha mode or NULL if unknown.+ */+const char *av_alpha_mode_name(enum AVAlphaMode mode);++/**+ * @return the AVAlphaMode value for name or an AVError if not found.+ */+enum AVAlphaMode av_alpha_mode_from_name(const char *name);+/*** Return the pixel format corresponding to name.*diff --git a/third_party/ffmpeg/libavutil/pixfmt.h b/third_party/ffmpeg/libavutil/pixfmt.hindex 823ea8e..2e7b645 100644--- a/third_party/ffmpeg/libavutil/pixfmt.h+++ b/third_party/ffmpeg/libavutil/pixfmt.h@@ -651,7 +651,12 @@ enum AVColorPrimaries {AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3AVCOL_PRI_EBU3213 = 22, ///< EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphorsAVCOL_PRI_JEDEC_P22 = AVCOL_PRI_EBU3213,- AVCOL_PRI_NB ///< Not part of ABI+ AVCOL_PRI_NB, ///< Not part of ABI++ /* The following entries are not part of H.273, but custom extensions */+ AVCOL_PRI_EXT_BASE = 256,+ AVCOL_PRI_V_GAMUT = AVCOL_PRI_EXT_BASE,+ AVCOL_PRI_EXT_NB ///< Not part of ABI};/**@@ -680,7 +685,12 @@ enum AVColorTransferCharacteristic {AVCOL_TRC_SMPTE428 = 17, ///< SMPTE ST 428-1AVCOL_TRC_SMPTEST428_1 = AVCOL_TRC_SMPTE428,AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma"- AVCOL_TRC_NB ///< Not part of ABI+ AVCOL_TRC_NB, ///< Not part of ABI++ /* The following entries are not part of H.273, but custom extensions */+ AVCOL_TRC_EXT_BASE = 256,+ AVCOL_TRC_V_LOG = AVCOL_TRC_EXT_BASE,+ AVCOL_TRC_EXT_NB ///< Not part of ABI};/**@@ -794,4 +804,14 @@ enum AVChromaLocation {AVCHROMA_LOC_NB ///< Not part of ABI};+/**+ * Correlation between the alpha channel and color values.+ */+enum AVAlphaMode {+ AVALPHA_MODE_UNSPECIFIED = 0, ///< Unknown alpha handling, or no alpha channel+ AVALPHA_MODE_PREMULTIPLIED = 1, ///< Alpha channel is multiplied into color values+ AVALPHA_MODE_STRAIGHT = 2, ///< Alpha channel is independent of color values+ AVALPHA_MODE_NB ///< Not part of ABI+};+#endif /* AVUTIL_PIXFMT_H */diff --git a/third_party/ffmpeg/libavutil/samplefmt.h b/third_party/ffmpeg/libavutil/samplefmt.hindex 43a57a4..6e55d71 100644--- a/third_party/ffmpeg/libavutil/samplefmt.h+++ b/third_party/ffmpeg/libavutil/samplefmt.h@@ -122,8 +122,7 @@ enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);* @param sample_fmt the number of the sample format to print the* corresponding info string, or a negative value to print the* corresponding header.- * @return the pointer to the filled buffer or NULL if sample_fmt is- * unknown or in case of other errors+ * @return the pointer to the filled buffer or NULL in case of other errors*/char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);diff --git a/third_party/ffmpeg/libavutil/version.h b/third_party/ffmpeg/libavutil/version.hindex 6ce6607..16335f0 100644--- a/third_party/ffmpeg/libavutil/version.h+++ b/third_party/ffmpeg/libavutil/version.h@@ -79,8 +79,8 @@*/#define LIBAVUTIL_VERSION_MAJOR 60-#define LIBAVUTIL_VERSION_MINOR 8-#define LIBAVUTIL_VERSION_MICRO 100+#define LIBAVUTIL_VERSION_MINOR 26+#define LIBAVUTIL_VERSION_MICRO 102#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \LIBAVUTIL_VERSION_MINOR, \@@ -110,6 +110,10 @@#define FF_API_VULKAN_FIXED_QUEUES (LIBAVUTIL_VERSION_MAJOR < 61)#define FF_API_OPT_INT_LIST (LIBAVUTIL_VERSION_MAJOR < 61)#define FF_API_OPT_PTR (LIBAVUTIL_VERSION_MAJOR < 61)+#define FF_API_CPU_FLAG_FORCE (LIBAVUTIL_VERSION_MAJOR < 61)+#define FF_API_DOVI_L11_INVALID_PROPS (LIBAVUTIL_VERSION_MAJOR < 61)+#define FF_API_ASSERT_FPU (LIBAVUTIL_VERSION_MAJOR < 61)+#define FF_API_VULKAN_SYNC_QUEUES (LIBAVUTIL_VERSION_MAJOR < 62)/*** @}diff --git a/third_party/ffmpeg/libswscale/swscale.h b/third_party/ffmpeg/libswscale/swscale.hindex 39e2307..1cfd406 100644--- a/third_party/ffmpeg/libswscale/swscale.h+++ b/third_party/ffmpeg/libswscale/swscale.h@@ -82,6 +82,7 @@ typedef enum SwsDither {SWS_DITHER_A_DITHER, /* arithmetic addition */SWS_DITHER_X_DITHER, /* arithmetic xor */SWS_DITHER_NB, /* not part of the ABI */+ SWS_DITHER_MAX_ENUM = 0x7FFFFFFF, /* force size to 32 bits, not a valid dither type */} SwsDither;typedef enum SwsAlphaBlend {@@ -89,6 +90,7 @@ typedef enum SwsAlphaBlend {SWS_ALPHA_BLEND_UNIFORM,SWS_ALPHA_BLEND_CHECKERBOARD,SWS_ALPHA_BLEND_NB, /* not part of the ABI */+ SWS_ALPHA_BLEND_MAX_ENUM = 0x7FFFFFFF, /* force size to 32 bits, not a valid blend mode */} SwsAlphaBlend;typedef enum SwsFlags {@@ -155,6 +157,13 @@ typedef enum SwsFlags {SWS_ACCURATE_RND = 1 << 18,SWS_BITEXACT = 1 << 19,+ /**+ * Allow using experimental new code paths. This may be faster, slower,+ * or produce different output, with semantics subject to change at any+ * point in time. For testing and debugging purposes only.+ */+ SWS_UNSTABLE = 1 << 20,+/*** Deprecated flags.*/@@ -258,7 +267,7 @@ void sws_free_context(SwsContext **ctx);***************************//**- * Test if a given pixel format is supported.+ * Test if a given (software) pixel format is supported.** @param output If 0, test if compatible with the source/input frame;* otherwise, with the destination/output frame.@@ -268,6 +277,15 @@ void sws_free_context(SwsContext **ctx);*/int sws_test_format(enum AVPixelFormat format, int output);+/**+ * Test if a given hardware pixel format is supported.+ *+ * @param format The hardware format to check, or AV_PIX_FMT_NONE.+ *+ * @return A positive integer if supported or AV_PIX_FMT_NONE, 0 otherwise.+ */+int sws_test_hw_format(enum AVPixelFormat format);+/*** Test if a given color space is supported.*@@ -422,7 +440,7 @@ int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt);* Initialize the swscaler context sws_context.** This function is considered deprecated, and provided only for backwards- * compatibility with sws_scale() and sws_start_frame(). The preferred way to+ * compatibility with sws_scale() and sws_frame_start(). The preferred way to* use libswscale is to set all frame properties correctly and call* sws_scale_frame() directly, without explicitly initializing the context.*@@ -467,8 +485,8 @@ SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,/*** Scale the image slice in srcSlice and put the resulting scaled* slice in the image in dst. A slice is a sequence of consecutive- * rows in an image. Requires a context that has been previously- * been initialized with sws_init_context().+ * rows in an image. Requires a context that has previously been+ * initialized with sws_init_context().** Slices have to be provided in sequential order, either in* top-bottom or bottom-top order. If slices are provided in@@ -498,8 +516,7 @@ int sws_scale(SwsContext *c, const uint8_t *const srcSlice[],/*** Initialize the scaling process for a given pair of source/destination frames.* Must be called before any calls to sws_send_slice() and sws_receive_slice().- * Requires a context that has been previously been initialized with- * sws_init_context().+ * Requires a context that has previously been initialized with sws_init_context().** This function will retain references to src and dst, so they must both use* refcounted buffers (if allocated by the caller, in case of dst).@@ -570,7 +587,7 @@ int sws_receive_slice(SwsContext *c, unsigned int slice_start,unsigned int slice_height);/**- * Get the alignment required for slices. Requires a context that has been+ * Get the alignment required for slices. Requires a context that has* previously been initialized with sws_init_context().** @param c The scaling context@@ -582,8 +599,8 @@ unsigned int sws_receive_slice_alignment(const SwsContext *c);/*** @param c the scaling context- * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg)- * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg)+ * @param dstRange flag indicating the white-black range of the output (1=jpeg / 0=mpeg)+ * @param srcRange flag indicating the white-black range of the input (1=jpeg / 0=mpeg)* @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x]* @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x]* @param brightness 16.16 fixed point brightness correctiondiff --git a/third_party/ffmpeg/libswscale/version.h b/third_party/ffmpeg/libswscale/version.hindex 4e54701..a108017 100644--- a/third_party/ffmpeg/libswscale/version.h+++ b/third_party/ffmpeg/libswscale/version.h@@ -28,8 +28,8 @@#include "version_major.h"-#define LIBSWSCALE_VERSION_MINOR 1-#define LIBSWSCALE_VERSION_MICRO 100+#define LIBSWSCALE_VERSION_MINOR 5+#define LIBSWSCALE_VERSION_MICRO 102#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \LIBSWSCALE_VERSION_MINOR, \diff --git a/tools/Release.ps1 b/tools/Release.ps1index f4b6220..6edbb31 100644--- a/tools/Release.ps1+++ b/tools/Release.ps1@@ -6,8 +6,11 @@ function Get-VeOwnedBinaries([string]$PackageRoot) {'bin/runtime/dlsssr/neuroframe_engine_super_resolution.dll','bin/runtime/dlssrr/neuroframe_engine_ray_reconstruction.dll','bin/runtime/dlssg/neuroframe_engine_frame_interpolation.dll',+ 'bin/runtime/fsrfg/neuroframe_engine_fsr_frame_generation.dll','bin/runtime/rtx_video/neuroframe_engine_upscaling.dll',- 'bin/runtime/vfx/neuroframe_engine_video_effects.dll')) {+ 'bin/runtime/vfx/neuroframe_engine_video_effects.dll',+ 'bin/runtime/reshade/neuroframe_engine_reshade.dll',+ 'bin/runtime/reshade/ve_reshade_runtime.dll')) {$path = Join-Path $PackageRoot $relativeif (-not (Test-Path -LiteralPath $path -PathType Leaf)) { throw "Missing application binary: $relative" }Get-Item -LiteralPath $pathdiff --git a/tools/audit-release.ps1 b/tools/audit-release.ps1index 7d7cd72..c77e277 100644--- a/tools/audit-release.ps1+++ b/tools/audit-release.ps1@@ -15,7 +15,10 @@ foreach ($required in @('resources/desktop/qml/Main.qml', 'resources/desktop/app'resources/shaders', "platforms/qwindows$qtSuffix.dll", "platforms/qoffscreen$qtSuffix.dll","Qt6Core$qtSuffix.dll", "Qt6Gui$qtSuffix.dll", "Qt6Quick$qtSuffix.dll", 'qml/QtQuick/Controls/Basic','bin/ffmpeg/bin/ffmpeg.exe', 'bin/ffmpeg/bin/ffprobe.exe', 'bin/avif/avifenc.exe',- 'bin/avif/avifdec.exe', 'bin/exiv2/exiv2.exe', 'LICENSE.txt', 'THIRD-PARTY-NOTICES.txt')) {+ 'bin/avif/avifdec.exe', 'bin/exiv2/exiv2.exe', 'LICENSE.txt', 'THIRD-PARTY-NOTICES.txt',+ 'bin/runtime/reshade/runtime-manifest.json',+ 'bin/runtime/reshade/models/moge-2-vits/model.onnx',+ 'bin/runtime/reshade/presets/FDVanilla/FDVanilla_reshade.ini')) {if (-not (Test-Path -LiteralPath (Join-Path $root $required))) { throw "Missing package dependency: $required" }}$owned = @(Get-VeOwnedBinaries $root)@@ -26,18 +29,62 @@ $contracts = @{super_resolution = 'dlsssr/neuroframe_engine_super_resolution.dll'ray_reconstruction = 'dlssrr/neuroframe_engine_ray_reconstruction.dll'frame_interpolation = 'dlssg/neuroframe_engine_frame_interpolation.dll'+ fsr_frame_generation = 'fsrfg/neuroframe_engine_fsr_frame_generation.dll'rtx_video = 'rtx_video/neuroframe_engine_upscaling.dll'video_effects = 'vfx/neuroframe_engine_video_effects.dll'+ reshade = 'reshade/neuroframe_engine_reshade.dll'}foreach ($module in $contracts.Keys) {$contractPath = Join-Path (Split-Path -Parent (Split-Path -Parent $PSScriptRoot)) "native (dev)/modules/$module/contract.json"$contract = Get-Content -LiteralPath $contractPath -Raw | ConvertFrom-Json- if ($module -ne 'video_effects' -and $contract.initialization_abi -ne 2) { throw "Outdated initialization contract: $module" }+ if ($module -eq 'fsr_frame_generation') {+ if ($contract.abi -ne 1 -or $contract.initialization_abi -ne 1 -or $contract.provider -ne '3.1.6') { throw 'Invalid FSR 3 engine contract.' }+ } elseif ($module -ne 'video_effects' -and $contract.initialization_abi -ne 2) { throw "Outdated initialization contract: $module" }$exports = @(Get-VePeExports (Join-Path $root ('bin/runtime/' + $contracts[$module])))foreach ($export in $contract.exports) {if ($export -notin $exports) { throw "Missing $module export: $export" }}}+# Require the pinned FSR 3 payload and one unambiguous FFmpeg dependency set.+$fsrRuntime = Join-Path $root 'bin/runtime/fsrfg'+$fsrManifest = Get-Content -LiteralPath (Join-Path $fsrRuntime 'runtime-manifest.json') -Raw | ConvertFrom-Json+if ($fsrManifest.selected_provider -ne '3.1.6') { throw 'The package must select AMD FSR 3.1.6.' }+foreach ($record in $fsrManifest.binaries) {+ if ($record.File -ne [IO.Path]::GetFileName($record.File)) { throw 'Invalid FSR manifest filename.' }+ $path = Join-Path $fsrRuntime $record.File+ if ((Get-FileHash -LiteralPath $path).Hash -ne $record.SHA256) { throw "FSR runtime checksum mismatch: $($record.File)" }+}+foreach ($required in @('amd_fidelityfx_framegeneration_dx12.dll','WinPixEventRuntime.dll','LICENSE-AMD-FSR.md','LICENSE-AMD-OPTICAL-FLOW.txt','LICENSE-PIX.txt','contract.json')) {+ if (-not (Test-Path -LiteralPath (Join-Path $fsrRuntime $required) -PathType Leaf)) { throw "Missing FSR runtime dependency: $required" }+}+foreach ($file in Get-ChildItem -LiteralPath $fsrRuntime -Recurse -File) {+ if ($file.Name -match '(?i)nvofapi|nvcuda|cudart|cublas|python|torch') { throw "Forbidden FSR runtime dependency: $($file.Name)" }+}+if ((Get-FileHash -LiteralPath (Join-Path $fsrRuntime 'amd_fidelityfx_framegeneration_dx12.dll')).Hash -ne '02297BEEDD285E822D3A64F314CF00FAF378DCEC0EDC47FF0C4DD71B3A8C2F18') { throw 'Unrecognized AMD FSR vendor DLL.' }+$mediaRuntime = Join-Path $root 'bin/runtime/av'+$mediaManifest = Get-Content -LiteralPath (Join-Path $mediaRuntime 'source-manifest.json') -Raw | ConvertFrom-Json+if ($mediaManifest.version -ne '8.1.2') { throw 'The DirectX video path requires the pinned FFmpeg runtime.' }+$mediaNames = @('avutil-60.dll','avcodec-62.dll','avformat-62.dll','swscale-9.dll','swresample-6.dll')+if (@(Get-ChildItem -LiteralPath $mediaRuntime -File -Filter '*.dll').Count -ne $mediaNames.Count) { throw 'Ambiguous AV runtime dependency set.' }+foreach ($name in $mediaNames) {+ $record = @($mediaManifest.libraries | Where-Object name -EQ $name)+ if ($record.Count -ne 1 -or (Get-FileHash -LiteralPath (Join-Path $mediaRuntime $name)).Hash -ne $record[0].sha256) { throw "AV runtime checksum mismatch: $name" }+}+# ReShade motion is AMD FidelityFX Optical Flow only; its private runtime must stay free of NVIDIA Optical Flow,+# RTGI shaders, Python and PyTorch.+$reshadeRuntime = Join-Path $root 'bin/runtime/reshade'+foreach ($file in (Get-ChildItem -LiteralPath $reshadeRuntime -Recurse -File)) {+ if ($file.Name -match '(?i)nvofapi|nvofa|^rtgi|pytorch|torch|python') { throw "Forbidden ReShade runtime payload: $($file.FullName)" }+ if ($file.Extension -in @('.fx', '.fxh') -and $file.Name -match '(?i)rtgi|mxao_gi|global.?illumination') { throw "RTGI shader is not allowed: $($file.FullName)" }+}+foreach ($binary in @('ve_reshade_runtime.dll', 'neuroframe_engine_reshade.dll', 'onnxruntime.dll')) {+ $path = Join-Path $reshadeRuntime $binary+ if (-not (Test-Path -LiteralPath $path)) { throw "Missing ReShade runtime binary: $binary" }+ $bytes = [IO.File]::ReadAllBytes($path)+ $text = [Text.Encoding]::ASCII.GetString($bytes) + [Text.Encoding]::Unicode.GetString($bytes)+ if ($text -match '(?i)nvofapi') { throw "ReShade runtime binary references NVIDIA Optical Flow: $binary" }+}+$inventory = foreach ($file in (Get-ChildItem -LiteralPath $root -Recurse -File |Where-Object { $_.Extension -in @('.exe', '.dll') -and -not $_.FullName.StartsWith((Join-Path $root 'outputs') + '\', [StringComparison]::OrdinalIgnoreCase) -and -not $_.FullName.StartsWith((Join-Path $root 'logs') + '\', [StringComparison]::OrdinalIgnoreCase) } | Sort-Object FullName)) {$isOwned = $file.FullName -in $ownedPathsdiff --git a/tools/deploy.ps1 b/tools/deploy.ps1index 1d5dd32..c272056 100644--- a/tools/deploy.ps1+++ b/tools/deploy.ps1@@ -6,6 +6,7 @@ param([string]$Destination,[string]$NativeBuildRoot,[string]$RuntimeSource,+ [string]$MediaRuntimeSource,[string]$CertificateThumbprint,[string]$TimestampServer = 'http://timestamp.digicert.com',[switch]$MachineCertificateStore,@@ -34,7 +35,7 @@ if (-not $RuntimeSource) {else { $RuntimeSource = Join-Path $destinationRoot 'app' }}& (Join-Path $PSScriptRoot 'package.ps1') -Configuration $Configuration -QtRoot $QtRoot -BuildDir $BuildDir `- -Destination $stage -NativeBuildRoot $NativeBuildRoot -RuntimeSource $RuntimeSource `+ -Destination $stage -NativeBuildRoot $NativeBuildRoot -RuntimeSource $RuntimeSource -MediaRuntimeSource $MediaRuntimeSource `-CertificateThumbprint $CertificateThumbprint -TimestampServer $TimestampServer `-MachineCertificateStore:$MachineCertificateStore -RequireSignatures:$RequireSignatures -OutputDirectory $OutputDirectory$entrypointTests = Join-Path $workspace 'Tests/entrypoint_tests.ps1'diff --git a/tools/package.ps1 b/tools/package.ps1index 38f7b32..e5d51ae 100644--- a/tools/package.ps1+++ b/tools/package.ps1@@ -6,6 +6,7 @@ param([string]$Destination,[string]$NativeBuildRoot,[string]$RuntimeSource,+ [string]$MediaRuntimeSource,[string]$CertificateThumbprint,[string]$TimestampServer = 'http://timestamp.digicert.com',[switch]$MachineCertificateStore,@@ -31,6 +32,21 @@ $runtimeSource = if ($RuntimeSource) { Resolve-VePath $RuntimeSource $projectRooJoin-Path $workspaceRoot 'Visual Enhancer'} else { Join-Path $workspaceRoot 'Visual Enhancer/app' }$binaryDirectory = Join-Path $resolvedBuild $Configuration+if (-not $MediaRuntimeSource) {+ $MediaRuntimeSource = if (Test-Path -LiteralPath (Join-Path $runtimeSource 'bin/runtime/av/source-manifest.json')) { $runtimeSource }+ else { Join-Path $workspaceRoot 'native (dev)/external/VisualEnhancerMediaRuntime' }+}+$mediaSource = Resolve-VePath $MediaRuntimeSource $projectRoot+$mediaAv = Join-Path $mediaSource 'bin/runtime/av'+$mediaManifestPath = Join-Path $mediaAv 'source-manifest.json'+if (-not (Test-Path -LiteralPath $mediaManifestPath -PathType Leaf)) { throw 'Prepare the pinned DirectX media runtime with tools/prepare-media-runtime.ps1.' }+$mediaManifest = Get-Content -LiteralPath $mediaManifestPath -Raw | ConvertFrom-Json+if ($mediaManifest.version -ne '8.1.2') { throw 'Unexpected DirectX media runtime version.' }+$mediaLibraries = @('avutil-60.dll','avcodec-62.dll','avformat-62.dll','swscale-9.dll','swresample-6.dll')+foreach ($name in $mediaLibraries) {+ $record = @($mediaManifest.libraries | Where-Object name -EQ $name)+ if ($record.Count -ne 1 -or (Get-FileHash -LiteralPath (Join-Path $mediaAv $name)).Hash -ne $record[0].sha256) { throw "Media runtime checksum mismatch: $name" }+}$deployment = Join-Path $resolvedQt 'bin/windeployqt.exe'foreach ($name in @('Visual Enhancer.exe', 'VE_CLI.exe')) {$binary = Join-Path $binaryDirectory $name@@ -53,6 +69,7 @@ $nativeModules = @{frame_interpolation = @('dlssg', 'neuroframe_engine_frame_interpolation.dll')rtx_video = @('rtx_video', 'neuroframe_engine_upscaling.dll')video_effects = @('vfx', 'neuroframe_engine_video_effects.dll')+ reshade = @('reshade', 'neuroframe_engine_reshade.dll')}if (-not $NativeBuildRoot) {$localNativeRoot = Join-Path $workspaceRoot 'native (dev)/modules'@@ -72,6 +89,8 @@ if ($NativeBuildRoot) {# including any source asset directories backed by junctions.function Copy-VeTree([string]$Source, [string]$Target) {if ([IO.Path]::GetFullPath($Source) -eq [IO.Path]::GetFullPath($Target)) { return }+ # This dependency set is staged separately from its pinned manifest.+ if ([IO.Path]::GetFullPath($Source) -eq [IO.Path]::GetFullPath((Join-Path $runtimeSource 'bin/runtime/av'))) { return }New-Item -ItemType Directory -Path $Target -Force | Out-Nullforeach ($item in Get-ChildItem -LiteralPath $Source -Force) {$targetItem = Join-Path $Target $item.Name@@ -101,6 +120,10 @@ if ([IO.Path]::GetFullPath($runtimeSource) -ne [IO.Path]::GetFullPath($appDirect}}Copy-VeTree (Join-Path $runtimeSource 'bin') (Join-Path $appDirectory 'bin')+$targetAv = Join-Path $appDirectory 'bin/runtime/av'+New-Item -ItemType Directory -Path $targetAv -Force | Out-Null+foreach ($name in $mediaLibraries + @('source-manifest.json')) { Copy-Item -LiteralPath (Join-Path $mediaAv $name) -Destination $targetAv -Force }+foreach ($name in @('FFMPEG-SHARED-LICENSE.txt','FFMPEG-SHARED-BUILD.txt')) { Copy-Item -LiteralPath (Join-Path $mediaSource "bin/licenses/$name") -Destination (Join-Path $appDirectory 'bin/licenses') -Force }Copy-Item -LiteralPath (Join-Path $PSScriptRoot 'QT-RELINKING.txt') -Destination (Join-Path $appDirectory 'bin/licenses/QT-RELINKING.txt') -Force$vfxModuleRoot = Join-Path $workspaceRoot 'native (dev)/modules/video_effects'$vfxBinary = Join-Path $vfxModuleRoot 'build/neuroframe_engine_video_effects.dll'@@ -116,6 +139,21 @@ if(Test-Path -LiteralPath $vfxBinary){Copy-Item -LiteralPath (Join-Path $vfxSdk "features/$($plugin[0])/bin/$($plugin[1])") -Destination (Join-Path $appDirectory "bin/runtime/rtx_video/$($plugin[1])") -Force}}elseif(-not(Test-Path -LiteralPath (Join-Path $vfxRuntime 'neuroframe_engine_video_effects.dll'))){throw 'Build the NVIDIA VFX bridge before packaging the application.'}+$reshadeModuleRoot = Join-Path $workspaceRoot 'native (dev)/modules/reshade'+$reshadeBinary = Join-Path $reshadeModuleRoot 'build/neuroframe_engine_reshade.dll'+if ($NativeBuildRoot) { $reshadeBinary = Join-Path $resolvedNativeBuildRoot 'reshade/build/neuroframe_engine_reshade.dll' }+$reshadeRuntime = Join-Path $appDirectory 'bin/runtime/reshade'+if (Test-Path -LiteralPath $reshadeBinary) {+ & (Join-Path $reshadeModuleRoot 'package_runtime.ps1') -Destination $reshadeRuntime+} elseif (-not (Test-Path -LiteralPath (Join-Path $reshadeRuntime 'neuroframe_engine_reshade.dll'))) {+ throw 'Build the ReShade bridge before packaging the application.'+}+$fsrModuleRoot = Join-Path $workspaceRoot 'native (dev)/modules/fsr_frame_generation'+$fsrBridgePath = if ($NativeBuildRoot) { Join-Path $resolvedNativeBuildRoot 'fsr_frame_generation/build/Release/neuroframe_engine_fsr_frame_generation.dll' }+ else { Join-Path $fsrModuleRoot 'build/Release/neuroframe_engine_fsr_frame_generation.dll' }+& (Join-Path $fsrModuleRoot 'package_runtime.ps1') -Destination (Join-Path $appDirectory 'bin/runtime/fsrfg') -BridgePath $fsrBridgePath+$nvencLicense = Join-Path $workspaceRoot 'native (dev)/external/VideoCodecHeaders-12.2/LICENSE-header.txt'+Copy-Item -LiteralPath $nvencLicense -Destination (Join-Path $appDirectory 'bin/licenses/NVENC-HEADERS-LICENSE.txt') -Forceif ($NativeBuildRoot) {foreach ($feature in $nativeModules.Keys) {$binary = Join-Path $resolvedNativeBuildRoot "$feature/build/$($nativeModules[$feature][1])"@@ -125,11 +163,23 @@ if ($NativeBuildRoot) {}foreach ($name in @('LICENSE.txt', 'THIRD-PARTY-NOTICES.txt')) {$source = Join-Path $runtimeSource $name+ if ($name -eq 'THIRD-PARTY-NOTICES.txt' -and (Test-Path -LiteralPath (Join-Path $projectRoot 'THIRD-PARTY-NOTICES') -PathType Leaf)) {+ $source = Join-Path $projectRoot 'THIRD-PARTY-NOTICES'+ } elseif ($name -eq 'LICENSE.txt' -and (Test-Path -LiteralPath (Join-Path $projectRoot 'LICENSE.txt') -PathType Leaf)) {+ $source = Join-Path $projectRoot 'LICENSE.txt'+ }$target = Join-Path $appDirectory $nameif ($source -ne $target -and (Test-Path -LiteralPath $source)) {Copy-Item -LiteralPath $source -Destination $target -Force}}+# The optional user guide may come from the source tree or the runtime bundle.+foreach ($guide in @((Join-Path $projectRoot 'FSR-FRAME-GENERATION.md'), (Join-Path $runtimeSource 'FSR-FRAME-GENERATION.md'))) {+ if (Test-Path -LiteralPath $guide -PathType Leaf) {+ Copy-Item -LiteralPath $guide -Destination (Join-Path $appDirectory 'FSR-FRAME-GENERATION.md') -Force+ break+ }+}$resources = Join-Path $appDirectory 'resources'$brandingDirectory = Join-Path $resources 'branding'New-Item -ItemType Directory -Path $brandingDirectory -Force | Out-Null@@ -151,7 +201,9 @@ $visualStudio = Get-VeVisualStudioInstallation$originalVcDirectory = [Environment]::GetEnvironmentVariable('VCINSTALLDIR')try {$env:VCINSTALLDIR = (Join-Path $visualStudio.installationPath 'VC') + '\'- $deploymentArguments = @($mode, '--compiler-runtime', '--skip-plugin-types', 'qmltooling', '--dir', $appDirectory,+ # The Qt-bundled D3DCompiler_47 (6.3.9600) rejects the shader model 5.1 targets used by the ReShade runtime;+ # the in-box Windows 10+ compiler in System32 is used instead.+ $deploymentArguments = @($mode, '--compiler-runtime', '--no-system-d3d-compiler', '--skip-plugin-types', 'qmltooling', '--dir', $appDirectory,'--qmldir', (Join-Path $projectRoot 'src/desktop/qml'),(Join-Path $appDirectory 'Visual Enhancer.exe'), (Join-Path $appDirectory 'VE_CLI.exe'))Invoke-VeCommand $deployment $deploymentArguments@@ -231,6 +283,15 @@ if ($CertificateThumbprint) {& (Join-Path $PSScriptRoot 'sign-release.ps1') -PackageRoot $resolvedDestination `-CertificateThumbprint $CertificateThumbprint -TimestampServer $TimestampServer `-MachineCertificateStore:$MachineCertificateStore+ # Signing changes the application bridge's hash; vendor binaries stay pinned.+ $fsrManifestPath = Join-Path $appDirectory 'bin/runtime/fsrfg/runtime-manifest.json'+ $fsrManifest = Get-Content -LiteralPath $fsrManifestPath -Raw | ConvertFrom-Json+ foreach ($record in $fsrManifest.binaries) {+ if ($record.File -eq 'neuroframe_engine_fsr_frame_generation.dll') {+ $record.SHA256 = (Get-FileHash -LiteralPath (Join-Path $appDirectory "bin/runtime/fsrfg/$($record.File)")).Hash+ }+ }+ $fsrManifest | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath $fsrManifestPath -Encoding utf8}& (Join-Path $PSScriptRoot 'audit-release.ps1') -PackageRoot $resolvedDestination `-RequireSignatures:($RequireSignatures -or [bool]$CertificateThumbprint) -OutputDirectory $OutputDirectorydiff --git a/tools/prepare-media-runtime.ps1 b/tools/prepare-media-runtime.ps1new file mode 100644index 0000000..f6ff3e4--- /dev/null+++ b/tools/prepare-media-runtime.ps1@@ -0,0 +1,52 @@+[CmdletBinding()]+param(+ [string]$DownloadRoot = (Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'VisualEnhancerBuildCache'),+ [string]$ArchivePath,+ [string]$Destination,+ [switch]$UpdateHeaders+)+$ErrorActionPreference = 'Stop'+. (Join-Path $PSScriptRoot 'Toolchain.ps1')+$workspaceRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)+if (-not $Destination) { $Destination = Join-Path $workspaceRoot 'native (dev)/external/VisualEnhancerMediaRuntime' }+$destinationRoot = Resolve-VePath $Destination $workspaceRoot+$cache = Resolve-VePath $DownloadRoot $workspaceRoot+$name = 'ffmpeg-8.1.2-full_build-shared.7z'+$url = "https://github.com/GyanD/codexffmpeg/releases/download/8.1.2/$name"+$hash = 'cba748035c21ce1431d0823c7a3a711f38616f89f87a265dceddf9b7f6749d2d'+New-Item -ItemType Directory -Path $cache -Force | Out-Null+if (-not $ArchivePath) {+ $ArchivePath = Join-Path $cache $name+ if (-not (Test-Path -LiteralPath $ArchivePath) -or (Get-FileHash -LiteralPath $ArchivePath).Hash -ne $hash) {+ Invoke-VeCommand 'curl.exe' @('--fail','--location','--silent','--show-error','--connect-timeout','15','--max-time','240','--output',$ArchivePath,$url)+ }+}+if ((Get-FileHash -LiteralPath $ArchivePath).Hash -ne $hash) { throw 'FFmpeg shared runtime checksum mismatch.' }+$sevenZip = Join-Path ([Environment]::GetFolderPath('ProgramFiles')) '7-Zip/7z.exe'+if (-not (Test-Path -LiteralPath $sevenZip)) { $sevenZip = (Get-Command 7z.exe -ErrorAction Stop).Source }+$extract = Join-Path $cache 'ffmpeg-shared-8.1.2'+Invoke-VeCommand $sevenZip @('x',$ArchivePath,"-o$extract",'-y','-bso0','-bsp0')+$upstream = Join-Path $extract 'ffmpeg-8.1.2-full_build-shared'+$libraries = Join-Path $destinationRoot 'bin/runtime/av'+$licenses = Join-Path $destinationRoot 'bin/licenses'+New-Item -ItemType Directory -Path $libraries,$licenses -Force | Out-Null+$records = @()+foreach ($file in @('avutil-60.dll','avcodec-62.dll','avformat-62.dll','swscale-9.dll','swresample-6.dll')) {+ $source = Join-Path $upstream "bin/$file"+ Copy-Item -LiteralPath $source -Destination (Join-Path $libraries $file) -Force+ $records += [ordered]@{name=$file;sha256=(Get-FileHash -LiteralPath $source).Hash.ToLowerInvariant()}+}+Copy-Item -LiteralPath (Join-Path $upstream 'LICENSE') -Destination (Join-Path $licenses 'FFMPEG-SHARED-LICENSE.txt') -Force+Copy-Item -LiteralPath (Join-Path $upstream 'README.txt') -Destination (Join-Path $licenses 'FFMPEG-SHARED-BUILD.txt') -Force+[ordered]@{version='8.1.2';source=$url;archive_sha256=$hash;upstream='https://github.com/FFmpeg/FFmpeg/tree/n8.1.2';libraries=$records} |+ ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $libraries 'source-manifest.json') -Encoding utf8+if ($UpdateHeaders) {+ $headers = Join-Path (Split-Path -Parent $PSScriptRoot) 'third_party/ffmpeg'+ foreach ($directory in Get-ChildItem -LiteralPath (Join-Path $upstream 'include') -Directory) {+ $target = Join-Path $headers $directory.Name+ New-Item -ItemType Directory -Path $target -Force | Out-Null+ foreach ($header in Get-ChildItem -LiteralPath $directory.FullName -File -Filter '*.h') { Copy-Item -LiteralPath $header.FullName -Destination $target -Force }+ }+ Copy-Item -LiteralPath (Join-Path $libraries 'source-manifest.json') -Destination (Join-Path $headers 'source-manifest.json') -Force+}+Write-Host "Prepared FFmpeg 8.1.2 with DirectX decode, AMD AMF and Intel QSV: $destinationRoot"diff --git a/tools/prepare-nvenc-headers.py b/tools/prepare-nvenc-headers.pynew file mode 100644index 0000000..c8bba51--- /dev/null+++ b/tools/prepare-nvenc-headers.py@@ -0,0 +1,36 @@+"""Prepare the MIT NVENC API header for DirectX-only hardware encoding.++No CUDA headers, libraries or dynamic loader are downloaded or used.+API 12.2 supports DirectX 12 and AV1 while retaining broad driver compatibility.+"""+from pathlib import Path+import hashlib+import json+import urllib.request++ROOT=Path(__file__).resolve().parents[2]+DEST=ROOT/'native (dev)/external/VideoCodecHeaders-12.2'+COMMIT='c69278340ab1d5559c7d7bf0edf615dc33ddbba7'+BLOB='5dfec5207f3af11c8040b72b1f39008ff968cd92'+URL=f'https://raw.githubusercontent.com/FFmpeg/nv-codec-headers/{COMMIT}/include/ffnvcodec/nvEncodeAPI.h'+++def main():+ target=DEST/'nvEncodeAPI.h'+ data=target.read_bytes() if target.exists() else b''+ identity=lambda value:hashlib.sha1(b'blob '+str(len(value)).encode()+b'\0'+value).hexdigest()+ if identity(data)!=BLOB:+ with urllib.request.urlopen(URL,timeout=60) as response:data=response.read()+ if identity(data)!=BLOB:raise RuntimeError('NVENC header does not match the pinned official Git blob')+ DEST.mkdir(parents=True,exist_ok=True)+ if not target.exists() or target.read_bytes()!=data:target.write_bytes(data)+ text=data.decode('utf-8-sig')+ license=text[text.index('/*')+2:text.index('*/')].strip()+'\n'+ (DEST/'LICENSE-header.txt').write_text(license,encoding='utf-8')+ (DEST/'source-manifest.json').write_text(json.dumps({'repository':'FFmpeg/nv-codec-headers',+ 'tag':'n12.2.72.0','commit':COMMIT,'git_blob':BLOB,'sha256':hashlib.sha256(data).hexdigest(),+ 'source':URL,'usage':'NVENC DirectX 12 hardware encoding; no CUDA'},indent=2)+'\n')+ print(f'Verified DirectX NVENC API header in {DEST}')+++if __name__=='__main__':main()diff --git a/tools/prepare-runtime.ps1 b/tools/prepare-runtime.ps1index c863d3e..5b56579 100644--- a/tools/prepare-runtime.ps1+++ b/tools/prepare-runtime.ps1@@ -21,12 +21,11 @@ New-Item -ItemType Directory -Force -Path $downloadDirectory, $destinationRoot |# Versions and SHA-256 values are pinned. Only vendor dependencies are extracted# from archives; no application executable or engine DLL comes from a release.-# PyAV 16 supplies libavcodec 62/libavutil 60/swscale 9, matching our headers.+# Shared libav is prepared separately with the pinned DirectX-capable build.$downloads = @(@{Name='ffmpeg-9.0.2-full_build.7z';Url='https://github.com/GyanD/codexffmpeg/releases/download/9.0.2/ffmpeg-9.0.2-full_build.7z';Hash='f0e46253c70dfe902bac915dfb4224f0cf1b7c6eeab9da2ccc9a5581f9a71b13'},@{Name='windows-artifacts.zip';Url='https://github.com/AOMediaCodec/libavif/releases/download/v1.4.2/windows-artifacts.zip';Hash='cb2d9fea43dcbab1d0707e3b37eb7b08070ad2fb60a2c188c39ec12382c0484a'},@{Name='exiv2-0.28.9-2022msvc-AMD64.zip';Url='https://github.com/Exiv2/exiv2/releases/download/v0.28.9/exiv2-0.28.9-2022msvc-AMD64.zip';Hash='47b455d7102d5d3b92227e580c582d4c36f0291902dc70af95062c32852d3f1c'},- @{Name='av-16.0.1-cp312-cp312-win_amd64.whl';Url='https://files.pythonhosted.org/packages/15/37/c7811eca0f318d5fd3212f7e8c3d8335f75a54907c97a89213dc580b8056/av-16.0.1-cp312-cp312-win_amd64.whl';Hash='0c669b6b6668c8ae74451c15ec6d6d8a36e4c3803dc5d9910f607a174dd18f17'},@{Name='pillow_heif-1.8.1-cp312-cp312-win_amd64.whl';Url='https://files.pythonhosted.org/packages/db/fd/2ff579be4694ac68cc73bfaafe1abc255bd658b678bfb3b33922784ddaf0/pillow_heif-1.8.1-cp312-cp312-win_amd64.whl';Hash='ce0ff957ad901a5a6bf8cd22ea26c4304bab7cf2f93d0a2f03046487e5711910'},# The private NR model has no public SDK/source package. Extract its original# NVIDIA DLL alone from the project's published archive, then verify it.@@ -61,9 +60,19 @@ foreach ($file in Get-ChildItem -LiteralPath (Join-Path $exiv2Root 'bin') -FileCopy-Dependency $file.FullName "bin/exiv2/$($file.Name)"}Copy-Dependency (Join-Path $exiv2Root 'COPYING') 'bin/exiv2/COPYING'-$avRoot = $extracted['av-16.0.1-cp312-cp312-win_amd64.whl']-foreach ($file in Get-ChildItem -LiteralPath (Join-Path $avRoot 'av.libs') -File -Filter '*.dll') { Copy-Dependency $file.FullName "bin/runtime/av/$($file.Name)" }-Copy-Dependency (Join-Path $avRoot 'av-16.0.1.dist-info/licenses/LICENSE.txt') 'bin/licenses/PYAV-NATIVE-DEPENDENCIES.txt'+# Prepare one coherent runtime; obsolete hashed wheel DLLs must never coexist+# with the selected libav libraries because the loader resolves by prefix.+$avTarget = [IO.Path]::GetFullPath((Join-Path $destinationRoot 'bin/runtime/av'))+$safePrefix = [IO.Path]::GetFullPath($destinationRoot).TrimEnd('\','/') + [IO.Path]::DirectorySeparatorChar+if (-not $avTarget.StartsWith($safePrefix,[StringComparison]::OrdinalIgnoreCase)) { throw 'AV dependency target is outside the runtime.' }+if (Test-Path -LiteralPath $avTarget) {+ if ((Get-Item -LiteralPath $avTarget).Attributes -band [IO.FileAttributes]::ReparsePoint) { throw 'AV dependency target cannot be a link.' }+}+& (Join-Path $PSScriptRoot 'prepare-media-runtime.ps1') -DownloadRoot $downloadDirectory -Destination $destinationRoot+$currentAvNames = @('avutil-60.dll','avcodec-62.dll','avformat-62.dll','swscale-9.dll','swresample-6.dll')+foreach ($file in Get-ChildItem -LiteralPath $avTarget -File -Filter '*.dll') {+ if ($file.Name -notin $currentAvNames) { Remove-Item -LiteralPath $file.FullName -Force }+}$heifRoot = $extracted['pillow_heif-1.8.1-cp312-cp312-win_amd64.whl']foreach ($file in Get-ChildItem -LiteralPath $heifRoot -Recurse -File -Filter '*.dll') { Copy-Dependency $file.FullName "bin/runtime/image-codecs/$($file.Name)" }Copy-Dependency (Join-Path $heifRoot 'pillow_heif-1.8.1.dist-info/licenses/LICENSES_bundled.txt') 'bin/licenses/HEIF-NATIVE-DEPENDENCIES.txt'