diff --git a/Temp/script-opts.conf b/Temp/script-opts.conf index 9bcb3d0a..45724a2b 100644 --- a/Temp/script-opts.conf +++ b/Temp/script-opts.conf @@ -314,9 +314,9 @@ ##⇘⇘高级屏显式播放列表 - script-opts-append = playlistmanager-dynamic_binds=yes # 是否使用动态的键位绑定(这些键位不应在 input.conf 中设置) + script-opts-append = playlistmanager-dynamic_binds=yes # 是否使用动态的键位绑定(这些键位不应在 input.conf 中设置),默认 yes # 如果设为 no ,那么可以通过任意导航键来唤起播放列表。 -##单个功能可以绑定多个键位,用空格分离 +##单个功能可以绑定多个键位,用空格分离(示例即默认值) script-opts-append = playlistmanager-key_moveup=UP script-opts-append = playlistmanager-key_movedown=DOWN script-opts-append = playlistmanager-key_movepageup=PGUP @@ -333,46 +333,50 @@ ## json=[{"ext":{"all":true},"rules":[{"_":" "}]},{"ext":{"mp4":true,"mkv":true},"rules":[{"^(.+)%..+$":"%1"},{"%s*[%[%(].-[%]%)]%s*":""},{"(%w)%.(%w)":"%1 %2"}]},{"protocol":{"http":true,"https":true},"rules":[{"^%a+://w*%.?":""}]}] script-opts-append = playlistmanager-filename_replace= -##以下五项与 autoload & load_plus 脚本功能重复/冲突,因此禁用 +##以下七项与 autoload & load_plus 脚本功能重复/冲突,因此禁用(示例即默认值) #script-opts-append = playlistmanager-loadfiles_filetypes=["mkv","avi","mp4","ogv","webm","rmvb","flv","wmv","mpeg","mpg","m4v","3gp"] # 搜索目录中的文件类型的白名单 script-opts-append = playlistmanager-loadfiles_on_start=no # 启动时向播放列表添加文件 script-opts-append = playlistmanager-loadfiles_on_idle_start=no # 空闲待机时添加工作路径中的文件 + script-opts-append = playlistmanager-loadfiles_always_append=no # 始终将添加的文件放在当前播放的文件之后 script-opts-append = playlistmanager-sortplaylist_on_start=no # mpv启动时对列表进行排序 script-opts-append = playlistmanager-sortplaylist_on_file_add=no # 在初始任何文件加载时,对播放列表进行排序 - script-opts-append = playlistmanager-alphanumsort=yes # 使用自然排序还是LUA的字符串排序 + script-opts-append = playlistmanager-system=windows # script-opts-append = playlistmanager-playlist_savepath= # 播放列表存储路径,留空则默认为 ~~home/playlists - script-opts-append = playlistmanager-save_playlist_on_file_end=no # 当前文件不挂载时保存播放列表 - script-opts-append = playlistmanager-show_playlist_on_fileload=0 # <0|1|2> 当前文件不挂载时的操作。分别对应不显示,显示当前文件名,显示播放列表 - script-opts-append = playlistmanager-sync_cursor_on_load=yes # 当从外部加载文件时,同步光标状态 - script-opts-append = playlistmanager-open_toggles=yes # 唤起播放列表的键位功能。对应切换可见性和刷新 - script-opts-append = playlistmanager-loop_cursor=no # 是否光标移动到末尾自动切换到首位条目 + script-opts-append = playlistmanager-save_playlist_on_file_end=no # 当前文件不挂载时保存播放列表,默认 no + script-opts-append = playlistmanager-show_playlist_on_fileload=0 # <默认 0|1|2> 当前文件不挂载时的操作。分别对应不显示,显示当前文件名,显示播放列表 + script-opts-append = playlistmanager-sync_cursor_on_load=yes # 当从外部加载文件时,同步光标状态,默认 no + script-opts-append = playlistmanager-open_toggles=yes # <默认 yes|no> 唤起播放列表的键位功能。对应切换可见性和刷新 + script-opts-append = playlistmanager-loop_cursor=no # 是否光标移动到末尾自动切换到首位条目,默认 yes + + script-opts-append = playlistmanager-youtube_dl_executable=yt-dlp + # <默认 youtube-dl|yt-dlp> ytdl的可执行文件,用于解析标题(如果启用),也可以使用绝对路径 - script-opts-append = playlistmanager-prefer_titles=url # 优先为限定的文件类型显示标题(仍使用文件名排序) - script-opts-append = playlistmanager-resolve_titles=no # 调用youtube-dl来解决播放列表中网络链接的标题问题 + script-opts-append = playlistmanager-prefer_titles=url # 优先为限定的文件类型显示标题(仍使用文件名排序) + script-opts-append = playlistmanager-resolve_titles=no # 调用ytdl来解决播放列表中网络链接的标题问题,默认 no - script-opts-append = playlistmanager-playlist_display_timeout=4 # 播放列表短暂停留的时间 - script-opts-append = playlistmanager-showamount=15 # 截断后显示的列表条目数 - script-opts-append = playlistmanager-scale_playlist_by_window=yes # 是否随窗口缩放 + script-opts-append = playlistmanager-playlist_display_timeout=4 # 播放列表短暂停留的时间,默认 5 + script-opts-append = playlistmanager-showamount=15 # 截断后显示的列表条目数,默认 16 + script-opts-append = playlistmanager-scale_playlist_by_window=yes # 是否随窗口缩放,默认 yes -##播放列表的字体样式,下方为示例。 +##播放列表的字体样式,下方为示例。留空则默认使用为 mpv.conf 中的OSD设置 ## {\fnUbuntu\fs10\b0\bord1} 相当于 font=Ubuntu, size=10, bold=no, border=1 +##格式参考 https://aeg-dev.github.io/AegiSite/docs/3.2/ass_tags/ script-opts-append = playlistmanager-style_ass_tags={\fnSans\fs10\b0\bord1} - # 格式参考 https://aeg-dev.github.io/AegiSite/docs/3.2/ass_tags/ - # 留空则默认使用为 mpv.conf 中的OSD设置 - script-opts-append = playlistmanager-text_padding_x=10 # 左上方的边距 + script-opts-append = playlistmanager-text_padding_x=10 # 左上方的边距,默认 10 ; 30 script-opts-append = playlistmanager-text_padding_y=10 - script-opts-append = playlistmanager-set_title_stripped=no # 是否修改MPV的窗口标题 +##此项与原生功能冲突 https://mpv.io/manual/master/#options-title + script-opts-append = playlistmanager-set_title_stripped=no # 是否修改MPV的窗口标题,默认 no script-opts-append = playlistmanager-title_prefix= script-opts-append = playlistmanager-title_suffix= - script-opts-append = playlistmanager-slice_longfilenames=yes # 是否切断长文件名,最大显示字符数 + script-opts-append = playlistmanager-slice_longfilenames=yes # 是否切断长文件名;最大显示字符数。默认 no ; 70 script-opts-append = playlistmanager-slice_longfilenames_amount=100 ##播放列表标题(字符串之后将添加一个换行),下方为示例。 @@ -395,8 +399,8 @@ script-opts-append = playlistmanager-playlist_sliced_prefix=▲ script-opts-append = playlistmanager-playlist_sliced_suffix=▼ - script-opts-append = playlistmanager-display_osd_feedback=yes # 向OSD输出任务的视觉反馈 - script-opts-append = playlistmanager-reset_cursor_on_close=yes # 当播放列表不可见时重置光标位置 + script-opts-append = playlistmanager-display_osd_feedback=yes # 向OSD输出任务的视觉反馈,默认 yes + script-opts-append = playlistmanager-reset_cursor_on_close=yes # 当播放列表不可见时重置光标位置,默认 yes diff --git a/Temp/shaders/AMD-CAS-lite2_rgb.glsl b/Temp/shaders/AMD-CAS-lite2_rgb.glsl new file mode 100644 index 00000000..91a36917 --- /dev/null +++ b/Temp/shaders/AMD-CAS-lite2_rgb.glsl @@ -0,0 +1,154 @@ +// LICENSE +// ======= +// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. +// ------- +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, +// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// ------- +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +// Software. +// ------- +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE + +//Initial port to ReShade: SLSNe https://gist.github.com/SLSNe/bbaf2d77db0b2a2a0755df581b3cf00c + +//Optimizations by Marty McFly: +// vectorized math, even with scalar gcn hardware this should work +// out the same, order of operations has not changed +// For some reason, it went from 64 to 48 instructions, a lot of MOV gone +// Also modified the way the final window is calculated +// +// reordered min() and max() operations, from 11 down to 9 registers +// +// restructured final weighting, 49 -> 48 instructions +// +// delayed RCP to replace SQRT with RSQRT +// +// removed the saturate() from the control var as it is clamped +// by UI manager already, 48 -> 47 instructions +// +// replaced tex2D with tex2Doffset intrinsic (address offset by immediate integer) +// 47 -> 43 instructions +// 9 -> 8 registers + +//Further modified by OopyDoopy and Lord of Lunacy: +// Changed wording in the UI for the existing variable and added a new variable and relevant code to adjust sharpening strength. + +//Fix by Lord of Lunacy: +// Made the shader use a linear colorspace rather than sRGB, as recommended by the original AMD documentation from FidelityFX. + +//Modified by CeeJay.dk: +// Included a label and tooltip description. I followed AMDs official naming guidelines for FidelityFX. +// +// Used gather trick to reduce the number of texture operations by one (9 -> 8). It's now 42 -> 51 instructions but still faster +// because of the texture operation that was optimized away. + +//Fix by CeeJay.dk +// Fixed precision issues with the gather at super high resolutions +// Also tried to refactor the samples so more work can be done while they are being sampled, but it's not so easy and the gains +// I'm seeing are so small they might be statistical noise. So it MIGHT be faster - no promises. + +//Modified by agyild (JPulowski) for mpv port +// Source version: https://github.com/CeeJayDK/SweetFX/blob/4f1692abdc49fbd582b6ac88dff1833beae2eb38/Shaders/CAS.fx +// Added back clamp mechanism to Saturation since it is no longer clamped by ReShade UI +// Changed lerp to mix +// Changed rsqrt to inversesqrt +// Changed rcp(x) to "1.0 / x" +// Changed saturate(x) to clamp(x, 0.0, 1.0) +// Reimplemented linear colorspace processing as an in-shader operation +// Removed gather performance trick because unlike in ReShade, mpv has transparent content with alpha channels, and the gather trick cannot be adapted to capture the alpha channel wihout making an additional texture lookup which makes the whole trick pointless +// Fragments marked as transparent by their alpha channel is no longer processed as a potential performance gain +// Reverted y-coordinate multiplication since mpv uses DX-like coordinate system +// Changed hooked texture to OUTPUT from SCALED, since apparently the gamma curve is applied at this stage + +// Shader code +// Relinearization pass + +//!HOOK OUTPUT +//!BIND HOOKED +//!DESC CAS Relinearization Pass + +vec3 srgb_to_linear(vec3 col) { + return mix(col * 1.0 / 12.92, pow((col + 0.055) / 1.055, vec3(2.4)), ivec3(lessThan(vec3(0.04045), col))); +} + +vec4 hook() +{ + vec4 col = HOOKED_tex(HOOKED_pos); + return vec4(srgb_to_linear(col.rgb), col.a); +} + +// CAS + +//!HOOK OUTPUT +//!BIND HOOKED +//!DESC CAS Sharpening + Delinearization Pass + +// User variables +#define SHARPENING 1.0 // Sharpening intensity: Adjusts sharpening intensity by averaging the original pixels to the sharpened result. 1.0 is the unmodified default. 0.0 to 1.0. +#define CONTRAST 0.0 // Adjusts the range the shader adapts to high contrast (0 is not all the way off). Higher values = more high contrast sharpening. 0.0 to 1.0. + +vec3 linear_to_srgb(vec3 col) { + return mix(col * 12.92, 1.055 * pow(col, vec3(1.0 / 2.4)) - 0.055, ivec3(lessThanEqual(vec3(0.0031308), col))); +} + +vec4 hook() +{ + // fetch a 3x3 neighborhood around the pixel 'e', + // a b c + // d(e)f + // g h i + vec4 e = HOOKED_tex(HOOKED_pos); + + // If the current fragment is transparent, skip further processing + if (e.a == 0.0) + return vec4(linear_to_srgb(e.rgb), e.a); + + vec3 a = HOOKED_texOff(vec2(-1.0, -1.0)).rgb; + vec3 b = HOOKED_texOff(vec2( 0.0, -1.0)).rgb; + vec3 c = HOOKED_texOff(vec2( 1.0, -1.0)).rgb; + vec3 f = HOOKED_texOff(vec2( 1.0, 0.0)).rgb; + vec3 g = HOOKED_texOff(vec2(-1.0, 1.0)).rgb; + vec3 h = HOOKED_texOff(vec2( 0.0, 1.0)).rgb; + vec3 d = HOOKED_texOff(vec2(-1.0, 0.0)).rgb; + vec3 i = HOOKED_texOff(vec2( 1.0, 1.0)).rgb; + + // Soft min and max. + // a b c b + // d e f * 0.5 + d e f * 0.5 + // g h i h + // These are 2.0x bigger (factored out the extra multiply). + vec3 mnRGB = min(min(min(d, e.rgb), min(f, b)), h); + vec3 mnRGB2 = min(mnRGB, min(min(a, c), min(g, i))); + mnRGB += mnRGB2; + + vec3 mxRGB = max(max(max(d, e.rgb), max(f, b)), h); + vec3 mxRGB2 = max(mxRGB, max(max(a, c), max(g, i))); + mxRGB += mxRGB2; + + // Smooth minimum distance to signal limit divided by smooth max. + vec3 rcpMRGB = 1.0 / mxRGB; + vec3 ampRGB = clamp(min(mnRGB, 2.0 - mxRGB) * rcpMRGB, 0.0, 1.0); + + // Shaping amount of sharpening. + ampRGB = inversesqrt(ampRGB); + + float peak = -3.0 * clamp(CONTRAST, 0.0, 1.0) + 8.0; + vec3 wRGB = -(1.0 / (ampRGB * peak)); + + vec3 rcpWeightRGB = 1.0 / (4.0 * wRGB + 1.0); + + // 0 w 0 + // Filter shape: w 1 w + // 0 w 0 + vec3 window = (b + d) + (f + h); + vec3 outColor = clamp((window * wRGB + e.rgb) * rcpWeightRGB, 0.0, 1.0); + + // Delinearize + return vec4(linear_to_srgb(mix(e.rgb, outColor, SHARPENING)), e.a); +} \ No newline at end of file diff --git a/Temp/vs/fft3d-test.vpy b/Temp/vs/fft3d-test.vpy index 67e943a4..47fb2cd3 100644 --- a/Temp/vs/fft3d-test.vpy +++ b/Temp/vs/fft3d-test.vpy @@ -10,7 +10,7 @@ denoise_lv = 2.0 channel = [0] blk_frames = 3 CPU_t = 6 -channel_par = False +channel_p = False # fft3d内核 1=FFT3DFilter // 2=Neo FFT3D # 降噪强度 # 降噪处理的平面 diff --git a/portable_config/script-opts/osc.conf b/portable_config/script-opts/osc.conf index a192c4ff..6e99d567 100644 --- a/portable_config/script-opts/osc.conf +++ b/portable_config/script-opts/osc.conf @@ -5,7 +5,7 @@ # -- 窗口化时显示OSC,默认:yes #showfullscreen=yes # -- 全屏时显示OSC,默认:yes -#showidlescreen=yes +#idlescreen=yes # -- 显示logo信息,默认:yes #scalewindowed=1 # -- 窗口化时OSC的缩放系数,默认:1 diff --git a/portable_config/script-opts/playlistmanager.conf b/portable_config/script-opts/playlistmanager.conf index 842405e1..0e5f71ff 100644 --- a/portable_config/script-opts/playlistmanager.conf +++ b/portable_config/script-opts/playlistmanager.conf @@ -6,7 +6,7 @@ ##是否使用动态的键位绑定(这些键位不应在 input.conf 中设置) ##如果设为 no ,那么可以通过任意导航键来唤起播放列表。 dynamic_binds=yes -##一个功能可以绑定多个键位,用空格分离 +##一个功能可以绑定多个键位,用空格分离(示例即默认值) key_moveup=UP key_movedown=DOWN key_movepageup=PGUP @@ -23,60 +23,59 @@ key_closeplaylist=ESC ## json=[{"ext":{"all":true},"rules":[{"_":" "}]},{"ext":{"mp4":true,"mkv":true},"rules":[{"^(.+)%..+$":"%1"},{"%s*[%[%(].-[%]%)]%s*":""},{"(%w)%.(%w)":"%1 %2"}]},{"protocol":{"http":true,"https":true},"rules":[{"^%a+://w*%.?":""}]}] filename_replace= -##[此项与 autoload & load_plus 脚本功能重复/冲突] 搜索目录中的文件类型的白名单 +##[下七项与 autoload & load_plus 脚本功能重复/冲突] (示例即默认值) +##搜索目录中的文件类型的白名单 #loadfiles_filetypes=["mkv","avi","mp4","ogv","webm","rmvb","flv","wmv","mpeg","mpg","m4v","3gp"] - -##[下二项与 autoload & load_plus 脚本功能重复/冲突] -##启动时向播放列表添加文件;空闲待机时添加工作路径中的文件 -loadfiles_on_start=no -loadfiles_on_idle_start=no - -##[此项与 autoload & load_plus 脚本功能重复/冲突] mpv启动时对列表进行排序 -sortplaylist_on_start=no - -##[此项与 autoload & load_plus 脚本功能重复/冲突] 在初始任何文件加载时,对播放列表进行排序 -sortplaylist_on_file_add=no - +##启动时向播放列表添加文件;空闲待机时添加工作路径中的文件;始终将添加的文件放在当前播放的文件之后 +#loadfiles_on_start=no +#loadfiles_on_idle_start=no +#loadfiles_always_append=no +##mpv启动时对列表进行排序;在初始任何文件加载时,对播放列表进行排序 +#sortplaylist_on_start=no +#sortplaylist_on_file_add=no ##使用自然排序(yes)还是lua的字符串排序(no) -alphanumsort=yes +#alphanumsort=yes -## +## system=windows ##播放列表存储路径,留空则默认为 ~~home/playlists playlist_savepath= -##当前文件不挂载时保存播放列表 +##当前文件不挂载时保存播放列表(默认 no) save_playlist_on_file_end=no -##当前文件不挂载时显示播放列表(2),显示当前文件名(1),不显示(0) +##当前文件不挂载时显示播放列表(2),显示当前文件名(1),不显示(默认 0) show_playlist_on_fileload=0 -##当从外部加载文件时,同步光标状态 +##当从外部加载文件时,同步光标状态(默认 yes) sync_cursor_on_load=yes -##唤起播放列表的键位功能是切换可见性(yes)还是刷新(no) +##唤起播放列表的键位功能是切换可见性(默认 yes)还是刷新(no) open_toggles=yes -##是否光标移动到末尾自动切换到首位条目 +##是否光标移动到末尾自动切换到首位条目(默认 yes) loop_cursor=no +##<默认 youtube-dl|yt-dlp> ytdl的可执行文件,用于解析标题(如果启用),也可以使用绝对路径 +youtube_dl_executable=yt-dlp + #### ------- 视效 ------- #### -## 优先为以下文件显示标题(仍使用文件名排序) +## 优先为以下文件显示标题(仍使用文件名排序) prefer_titles=url -##调用youtube-dl来解决播放列表中网络链接的标题问题 +##调用youtube-dl来解决播放列表中网络链接的标题问题(默认 no) resolve_titles=no -##播放列表短暂停留的时间 +##播放列表短暂停留的时间(默认 5) playlist_display_timeout=4 -##截断后显示的列表条目数 +##截断后显示的列表条目数(默认 16) showamount=15 -##是否随窗口缩放 +##是否随窗口缩放(默认 yes) scale_playlist_by_window=yes ##播放列表的字体样式。下方为示例 @@ -85,16 +84,16 @@ scale_playlist_by_window=yes ##留空则默认使用为 mpv.conf 中的OSD设置 style_ass_tags={\fnSans\fs10\b0\bord1} -##左上方的边距 +##左上方的边距(默认 10 ; 30) text_padding_x=10 text_padding_y=10 -##是否修改MPV的窗口标题 +##[此功能与 https://mpv.io/manual/master/#options-title 冲突] 是否修改MPV的窗口标题(默认 no) set_title_stripped=no title_prefix= title_suffix= -##是否切断长文件名,最大显示字符数 +##是否切断长文件名,最大显示字符数(默认 no ; 70) slice_longfilenames=yes slice_longfilenames_amount=100 @@ -124,8 +123,8 @@ playing_selected_file={\c&C1C1FF&}☑ %name playlist_sliced_prefix=▲ playlist_sliced_suffix=▼ -##向OSD输出任务的视觉反馈 +##向OSD输出任务的视觉反馈(默认 yes) display_osd_feedback=yes -##当播放列表不可见时重置光标位置 +##当播放列表不可见时重置光标位置(默认 yes) reset_cursor_on_close=yes diff --git a/portable_config/scripts/playlistmanager.lua b/portable_config/scripts/playlistmanager.lua index dad5285d..487447cd 100644 --- a/portable_config/scripts/playlistmanager.lua +++ b/portable_config/scripts/playlistmanager.lua @@ -1,6 +1,6 @@ --[[ SOURCE_ https://github.com/jonniek/mpv-playlistmanager -COMMIT_ 20210521 bc139f7 +COMMIT_ 20220720 f0a207e 高级播放列表,用于替换内置的过于简洁的列表 自定义快捷键方案示例,在 input.conf 中另起一行: @@ -80,6 +80,9 @@ local settings = { -- loadfiles from working directory on idle startup loadfiles_on_idle_start = false, + --always put loaded files after currently playing file + loadfiles_always_append = false, + --sort playlist on mpv start sortplaylist_on_start = false, @@ -116,6 +119,9 @@ local settings = { --allow the playlist cursor to loop from end to start and vice versa loop_cursor = true, + --youtube-dl executable for title resolving if enabled, probably "youtube-dl" or "yt-dlp", can be absolute path + youtube_dl_executable = "youtube-dl", + --#### VISUAL SETTINGS @@ -718,19 +724,19 @@ function playlist(force_dir) appendstr = "append-play" hasfile = true end - if filenames[file] then - -- continue - elseif cur == true then + if filename == file then + cur = true + elseif filenames[file] then + -- skip files already in playlist + elseif cur == true or settings.loadfiles_always_append then mp.commandv("loadfile", utils.join_path(dir, file), appendstr) msg.info("Appended to playlist: " .. file) c2 = c2 + 1 - elseif file ~= filename then - mp.commandv("loadfile", utils.join_path(dir, file), appendstr) - msg.info("Prepended to playlist: " .. file) - mp.commandv("playlist-move", mp.get_property_number("playlist-count", 1)-1, c) - c = c + 1 else - cur = true + mp.commandv("loadfile", utils.join_path(dir, file), appendstr) + msg.info("Prepended to playlist: " .. file) + mp.commandv("playlist-move", mp.get_property_number("playlist-count", 1)-1, c) + c = c + 1 end end if c2 > 0 or c>0 then @@ -1038,7 +1044,7 @@ function resolve_titles() then requested_urls[filename] = true - local args = { 'youtube-dl', '--no-playlist', '--flat-playlist', '-sJ', filename } + local args = { settings.youtube_dl_executable, '--no-playlist', '--flat-playlist', '-sJ', filename } local req = mp.command_native_async( { name = "subprocess",