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: Ikea Chair
Posts: 1,896
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, 05:21   #2  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 565
Ouch...I seemed to make a mistake in Hysteresis. At line 397 we should use std::fill_n(dstp, stride * height, lower) instead.
HolyWu is offline   Reply With Quote
Old 11th September 2016, 17:07   #3  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
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   #4  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
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   #5  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
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, 13:16   #6  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,119
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?
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 30th December 2016, 13:28   #7  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
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, 13:44   #8  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,119
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?
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 30th December 2016, 14:06   #9  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,896
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, 14:14   #10  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,119
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.)
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 30th December 2016, 14:21   #11  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,119
anyways, it's now corrected
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
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 14:51.


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