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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th February 2015, 20:03   #1  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Continuity Fixer for VapourSynth

I ported Continuity fixer to vapousynth about a month ago.

For those who don't know this avs filter, it help repairing damaged borders of video frames, often used for inverse kernel downscaling when you have some dead pixel at the borders.

I moved the code to github just because, you'll find all the information there.
https://github.com/MonoS/VS-ContinuityFixer

Thanks
Mirkosp, JEEB, HolyWu, jackoneill and Myrsloik

Last edited by MonoS; 24th February 2015 at 15:15. Reason: V4 released
MonoS is offline   Reply With Quote
Old 14th February 2015, 22:31   #2  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
You ported your first plugin! Congratulations!

Here are some things I noticed:
* The double negative (!!) will turn your filter's parameters into either 0 or 1. The Avisynth filter doesn't behave that way.

* The parameters "left", "top", "right", and "bottom" are not optional. VapourSynth will throw an error if any of them is not passed. In that case, continuityCreate is not executed, therefore "err" is always 0:
Code:
    d.bottom = !!vsapi->propGetInt(in, "bottom", 0, &err);
    if (err)
    {
        vsapi->setError(out, "ContinuityFixer: no bottom parameter");
        vsapi->freeNode(d.node);
        return;
    }
* The registerFunc call can look like this too:
Code:
    registerFunc("ContinuityFixer",
            "clip:clip;"
            "left:int;"
            "top:int;"
            "right:int;"
            "bottom:int;"
            "radius:int:opt;"
            , continuityCreate, 0, plugin);
The compiler will concatenate that into a single string. It's much easier to read.

* The default value for "radius" is 0 in the Avisynth filter. I wonder why you chose
Code:
    d.radius = !!vsapi->propGetInt(in, "radius", 0, &err);
    if (err)
    {
        d.radius = d.vi->height < d.vi->width ? d.vi->height : d.vi->width;
    }
?

* For 16 bit input, you need larger data types in "least_squares", to prevent overflow. Maybe in other places, too. I didn't look too closely.

* You have some unused variables.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 15th February 2015, 01:08   #3  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
* The double negative (!!) will turn your filter's parameters into either 0 or 1. The Avisynth filter doesn't behave that way.
That's actually explain a lot of things, copypasta from the example plugin, having tested the plugin with only little border i didn't noticed that bug.

Quote:
* The parameters "left", "top", "right", and "bottom" are not optional. VapourSynth will throw an error if any of them is not passed. In that case, continuityCreate is not executed, therefore "err" is always 0
Then i'll remove the 4 checks

Quote:
* The registerFunc call can look like this too
A LOOOOOOOOOT nicer, i'll do it

Quote:
* The default value for "radius" is 0 in the Avisynth filter. I wonder why you chose
I chose this following mirkosp explanation on an italian forum
Quote:
di default usa il lato pił corto come radius (quindi, generalmente, l'altezza)
Translated: by default it use the shortest side as the radius (generally the height)
He created the first version so i think he is right, also cause a radius of 0 will probably interpolate nothing.

Quote:
* For 16 bit input, you need larger data types in "least_squares", to prevent overflow. Maybe in other places, too. I didn't look too closely.
This is a reason for not port plugin at 3AM, i completely forgot about the squaring and multiplication, i'll try larger type and see if the artifact disappear.

Quote:
* You have some unused variables.
Some leftover, i'll delete them [but the compiler should delete it anyway]

Thanks you a lot for the tips, i'll try to address all of those ASAP [probably tomorrow]
MonoS is offline   Reply With Quote
Old 16th February 2015, 12:27   #4  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
v2 released
-fixed some "i can't write proper code" bug
-Added some optimization in the compile script
-Removed some unused variables

v3 should come in the future with 16bit support, i hope
MonoS is offline   Reply With Quote
Old 18th February 2015, 19:46   #5  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
v3 released
16bit support, yay(??)

For v4 i plan to extend the plugin to work on all the planes in a single call or maybe to port ReferenceFixer [JEEB already wrote, is only a matter of integrating it], we will see.
MonoS is offline   Reply With Quote
Old 18th February 2015, 20:34   #6  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by MonoS View Post
v3 released
16bit support, yay(??)

For v4 i plan to extend the plugin to work on all the planes in a single call or maybe to port ReferenceFixer [JEEB already wrote, is only a matter of integrating it], we will see.
That looks like you only support 16 bit now. You can have both with C++ templates (and C macros, but that's uglier).
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 18th February 2015, 21:04   #7  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by jackoneill View Post
That looks like you only support 16 bit now. You can have both with C++ templates (and C macros, but that's uglier).
Yes, as i said i don't care and i prefer to use my time implement useful things than fighting with the template system
MonoS is offline   Reply With Quote
Old 19th February 2015, 15:04   #8  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by MonoS View Post
Yes, as i said i don't care and i prefer to use my time implement useful things than fighting with the template system
There is no need to fight. It's a very simple use of templates: https://gist.github.com/dubhater/b96...64f5/revisions
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 24th February 2015, 12:27   #9  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
V4 released
8 and 16bit support [maybe also intermediate bitdepth] thanks to jackoneill

Next version all plane processing in one call, maybe.
MonoS is offline   Reply With Quote
Old 24th February 2015, 15:18   #10  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
I moved the code to github cause i had some spare time
MonoS is offline   Reply With Quote
Old 1st April 2015, 12:10   #11  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
New version, now the plugin seems to behave like the original [at least for 8bit clips].
MonoS is offline   Reply With Quote
Old 6th April 2015, 00:29   #12  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Two version and finally the plugin got multiplane processing in a single call, now the user can process the plane of Baator and Carceri in the same call if he/she wants

Also solved a bug in the saturating procedure.
MonoS is offline   Reply With Quote
Old 15th June 2016, 21:28   #13  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,576
Hey guys. I'm trying to use latest github release of this plugin with VS R32. First of all, it doesn't work at all unless I'll put "libgcc_s_dw2-1.dll" near it. This doesn't look correct to me.
And then while it does work, it barely makes any difference, unlike its avisynth version (with equivalent settings). Is there anything that can be done about it?
Keiyakusha is offline   Reply With Quote
Old 15th June 2016, 23:02   #14  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by Keiyakusha View Post
Hey guys. I'm trying to use latest github release of this plugin with VS R32. First of all, it doesn't work at all unless I'll put "libgcc_s_dw2-1.dll" near it. This doesn't look correct to me.
And then while it does work, it barely makes any difference, unlike its avisynth version (with equivalent settings). Is there anything that can be done about it?
Hi Keiyakusha, if i'm not mistaken you are using the 32 bit version, am i right? the lack of this dll is due to the fact that i compiled the dll without including other libraries, AFAIK this does not cause any missing dll on the 64bit build.

This version was never properly tested because i don't have an x86 vapoursynth installation.

Can you try this script?
Code:
down = core.fmtc.bitdepth(src, bits=8).fmtc.bitdepth(bits=16)

fixed = core.edgefixer.ContinuityFixer(down, [10,10,10], [10,10,10], [10,10,10], [10,10,10], [10,10,10])

stacked = core.fmtc.nativetostack16(fixed)
if the filter is working you'll see some gibberish at the edge of the bottom frame (something like this https://abload.de/img/gibberishxrk46.png ), if you see all green then there is a problem.

I can assure you the 64bit version is working fine, i've used it right now for making the screen i sent you, maybe it's behaving differently than the avisynth version, in this case this is a bug and i should further study this problem (remember that the 16bit version supposedly should work as the original continuity fixer, but i can't be sure).

Thanks for reporting this problem
MonoS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.