Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
10th June 2018, 21:31 | #1 | Link |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
SmoothUV plugin and RainbowSmooth derainbow script
A spatial derainbow filter and a script that uses it, ported from the corresponding Avisynth plugin and script.
Hope it works. https://github.com/dubhater/vapoursynth-smoothuv
__________________
Buy me a "coffee" and/or hire me to write code! |
10th June 2018, 22:00 | #2 | Link | |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,822
|
Quote:
Or just use this Code:
clip = core.std.BlankClip(format=vs.YUV420P8) clip = clip.smoothuv.SmoothUV(radius=5, threshold=90) Thx for a new toy
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 10th June 2018 at 22:12. |
|
11th June 2018, 11:11 | #4 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,822
|
Just tried the avs version. Looks ok even with radius 7.
I used the dll from http://avisynth.nl/index.php/SmoothUV
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 11th June 2018 at 11:13. |
11th June 2018, 13:28 | #6 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,822
|
The changelog says something different
Code:
v1.4.0 2003/09/02 - Fixed HQ mode for radius > 4 - Added radius 7
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
11th June 2018, 13:46 | #7 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,822
|
Heres a small compare script. I didn't know that ffms2 could load web stuff
Code:
avsdll = r"D:\AvisynthRepository\AVSPLUS_x86\Avisynth.dll" clip = core.ffms2.Source("https://www.animemusicvideos.org/guides/avtech31/images/avs/rainbow-orig.jpg").std.DuplicateFrames([0]*20) clip = clip.resize.Bicubic(format=vs.YUV420P8, matrix_s="709") r3 = clip.smoothuv.SmoothUV(radius=3) r4 = clip.smoothuv.SmoothUV(radius=4) r5 = clip.smoothuv.SmoothUV(radius=5) avs3 = core.avsw.Eval(' SmoothUV(radius=3) ', clips=[clip], clip_names=["last"], avisynth=avsdll) avs7 = core.avsw.Eval(' SmoothUV(radius=7) ', clips=[clip], clip_names=["last"], avisynth=avsdll) crop=200 clip = core.std.StackHorizontal([ core.std.CropRel(clip, crop,crop,0,0).text.Text("source"), core.std.CropRel(r3, crop,crop,0,0).text.Text("radius 3"), core.std.CropRel(avs3, crop,crop,0,0).text.Text("Avisynth r3"), core.std.CropRel(r4, crop,crop,0,0).text.Text("radius 4"), core.std.CropRel(r5, crop,crop,0,0).text.Text("radius 5"), core.std.CropRel(avs7, crop,crop,0,0).text.Text("Avisynth r7"), ]) clip.set_output()
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
8th July 2018, 20:55 | #11 | Link |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
I figured out what's wrong when radius is 4 or 5. It calculates a sum which has to fit in 14 bits, so it can't be more than 16383. Radius 4 (9 * 9 * 255) is just too many pixels to fit.
This is easily fixed by using the pmulhuw instruction (introduced in SSE) instead of the pmulhw instruction (introduced in MMX). https://github.com/dubhater/vapoursy...eleases/tag/v2 Code:
* Fix bad output with radius 4 and 5 (especially 5). * Allow radius 6 and 7. * Better precision in the calculations.
__________________
Buy me a "coffee" and/or hire me to write code! |
8th July 2018, 21:59 | #12 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,822
|
Good job! I tested rad7 and the output is very similar to the avisynth version. I also noticed that smoothuv blurs the color red a bit or rather the black outlines.
But why is the mask parameter absent in r2? :P
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
9th July 2018, 12:00 | #14 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,822
|
D'oh, you're right.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
Thread Tools | Search this Thread |
Display Modes | |
|
|