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 10th September 2016, 18:11   #1  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,547
Miscellaneous filters to test

GitHub and downloads

I decided to do some more filter cleanup and see what could be improved and what was still missing. These are kinda useful functions but not useful enough for me to put them into the core so I just turned them into a lump.

Hysteresis (clipa clip;clipb clip;planes int[] opt) - the leftover from genericfilters that got dropped and some people still miss, based on HolyWu's pull request
SCDetect (clip clip;threshold float opt) - substitute for the scd.Detect function, internally implemented by using planestats (which won't be optimized until the next vs release)
AverageFrames ("clips clip[];weights float[];scale float opt;scenechange int opt;planes int[] opt") - a replacement for temporalsoften, temporalsoften is only ever used to average frames with or without different weights so this is more elegant, currently not optimized

For example misc.AverageFrames(singleclip, [1, 1, 1, 1, 1]) will replace temporalsoften with radius2 and max threshold (just blend)

version 4
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 15th October 2016 at 20:47.
Myrsloik is offline   Reply With Quote
Old 11th September 2016, 17:07   #2  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,547
Fixed the Hysteresis bug and that AverageFrames would always ignore the scale argument and use the default. Link in first post.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th September 2016, 21:53   #3  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,547
Version 3 is recompiled so maybe hysteresis will work for everyone now. Also fixes a few tiny argument checks and some coding style stuff. I consider everything in it done apart from maybe doing more optimizations.

Note that SCDetect will be a lot faster in the new VS release when planestats (which is used internally) is properly optimized.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th October 2016, 20:52   #4  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,547
Update to version 4 if you're using this, I fixed plenty of issues and actually tested things this time.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th December 2016, 14:16   #5  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Guess it's better off to merge fix telecined fades into this misc stuff than to leave it as a standalone plugin, what do you say?
feisty2 is offline   Reply With Quote
Old 30th December 2016, 14:28   #6  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,547
Quote:
Originally Posted by feisty2 View Post
Guess it's better off to merge fix telecined fades into this misc stuff than to leave it as a standalone plugin, what do you say?
I'll take a look at it. Maybe it'd fit into vivtc if I convert it to C and make it take integer input. Seems simple and useful. Maybe introduce a threshold so it leaves all pixels unmodified unless the change would be meaningful.

This is probably a bug in your code
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th December 2016, 14:44   #7  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by Myrsloik View Post
I kinda copied that from the "invert" example
Code:
    if (d.enabled < 0 || d.enabled > 1) {
        vsapi->setError(out, "Invert: enabled must be 0 or 1");
        vsapi->freeNode(d.node);
        return;
    }
something wrong with it?
feisty2 is offline   Reply With Quote
Old 30th December 2016, 15:06   #8  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,547
Quote:
Originally Posted by feisty2 View Post
I kinda copied that from the "invert" example
Code:
    if (d.enabled < 0 || d.enabled > 1) {
        vsapi->setError(out, "Invert: enabled must be 0 or 1");
        vsapi->freeNode(d.node);
        return;
    }
something wrong with it?
YES! IT IS NOT A COPY! C DOESN'T HAVE DESTRUCTORS!

FixFadesData (the equivalent) is allocated on the stack and doesn't need to be freed. Obviously you want something like
Code:
	if (d->mode < 0 || d->mode > 2) {
		vsapi->setError(out, "FixFades: mode must be 0, 1, or 2!");
		delete d;
		return;
	}
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th December 2016, 15:14   #9  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by Myrsloik View Post
YES! IT IS NOT A COPY! C DOESN'T HAVE DESTRUCTORS!

FixFadesData (the equivalent) is allocated on the stack and doesn't need to be freed. Obviously you want something like
Code:
	if (d->mode < 0 || d->mode > 2) {
		vsapi->setError(out, "FixFades: mode must be 0, 1, or 2!");
		delete d;
		return;
	}
oops, thought releasing "d" itself would be fixfadesFree()'s job(which was the reason I made node a null pointer after freeNode() so it won't be released twice.)
feisty2 is offline   Reply With Quote
Old 30th December 2016, 15:21   #10  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
anyways, it's now corrected
feisty2 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 12:13.


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