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 November 2012, 18:23   #1  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
nnedi3 plugin for VapourSynth

Source: https://github.com/dubhater/vapoursynth-nnedi3

DLLs can be found in the "releases" section.

Please test and report back. Patches are welcome too.

nnedi3_rpow2 can be found here: http://forum.doom9.org/showthread.php?t=172652
__________________
Buy me a "coffee" and/or hire me to write code!

Last edited by jackoneill; 24th February 2016 at 22:17. Reason: nnedi3_rpow2
jackoneill is offline   Reply With Quote
Old 10th November 2012, 22:10   #2  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
8bit precision only or also 10bit (16) ?
kolak is offline   Reply With Quote
Old 10th November 2012, 22:48   #3  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by kolak View Post
8bit precision only or also 10bit (16) ?
Precision?... If you're asking what bit depths it accepts for input, only 8. (This might change in the future.) Internally it does the same as the avisynth filter. It's mostly the same code.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 11th November 2012, 00:15   #4  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
I notice that there is no "Threads" option for this filter like there is for the avisynth filter. So it can't do multi-threading internally?
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 11th November 2012, 00:59   #5  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Nice job!
mandarinka is offline   Reply With Quote
Old 11th November 2012, 01:04   #6  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
@ jackoneill
Thank you very much for taking time to port NNEDI3, Histogram, and TemporalSoften. Awesome work .
I'll test them out and report back if I find any discrepancies.
=============================================
@ Revgen
This post might answer your question on multi-threading.
Reel.Deel is offline   Reply With Quote
Old 11th November 2012, 07:41   #7  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Revgen View Post
I notice that there is no "Threads" option for this filter like there is for the avisynth filter. So it can't do multi-threading internally?
Indeed, there is no internal threading anymore. There is no need for it, because Vapoursynth makes it process several frames in parallel.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 11th November 2012, 09:46   #8  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
just ran a speed test against the avisynth nnedi3 on a 720x480 clip, encode with x264 ultrafast preset, the avisynth one's got 30+ fps, and the vs' got only 3.x fps, something must be wrong
lansing is offline   Reply With Quote
Old 11th November 2012, 10:22   #9  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by lansing View Post
just ran a speed test against the avisynth nnedi3 on a 720x480 clip, encode with x264 ultrafast preset, the avisynth one's got 30+ fps, and the vs' got only 3.x fps, something must be wrong
Nothing is wrong. The avisynth version has optimised SSE2 code. Mine doesn't.
You'll get about the same low speed from the avisynth version with opt=1.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 16th November 2012, 10:53   #10  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Hi!

A new build is available for testing, now with more speed. Use opt=2, but keep the other parameters at their default values, for now (or it will eat your cat). I have only converted a few of the asm functions — those that are used when all parameters are at their default values (except for opt, of course).

opt=2 requires SSE2, obviously.

This new build also requires VapourSynth R15.

Also, it now accepts any colorspace with 8 bits per sample, not just YUV.

https://github.com/dubhater/vapoursy...edi3/downloads
__________________
Buy me a "coffee" and/or hire me to write code!

Last edited by jackoneill; 16th November 2012 at 11:00. Reason: any colorspace
jackoneill is offline   Reply With Quote
Old 16th November 2012, 21:46   #11  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Quick test. Played back through vdub using a 1920x1080i mpeg2 source and compared vapoursynth SSE2 version (using version R15) and the latest avisynth version (using an avisynth script) with my Q6850 quadcore cpu & WinXP pro. Vapoursynth version runs most optimally with vs.Core(threads=5). Changing it to threads=6 didn't seem to be much better. Avisynth version worked optimally at threads=4. Vapoursynth version runs about 2-3fps faster than avisynth version.

Vapoursynth script

Code:
import vapoursynth as vs
import sys
core = vs.Core(threads=5)
core.avs.LoadPlugin(path=r'C:\dgindex\DGDecode.dll')
core.std.LoadPlugin(path=r'C:\Program Files\VapourSynth\nnedi3-testing.dll')
ret = core.avs.MPEG2Source(r'E:\mympeg2.d2v')
ret = core.nnedi3.nnedi3(clip=ret,opt=2,field=3)
last = ret
17fps-18fps

Avisynth scrpt

Code:
mpeg2source("E:\mympeg2.d2v")
nnedi3(opt=2,field=3,threads=4)
15fps-16fps
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 16th November 2012 at 22:50.
Revgen is offline   Reply With Quote
Old 16th November 2012, 23:06   #12  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Interesting
kolak is offline   Reply With Quote
Old 16th November 2012, 23:11   #13  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,576
Can you also check CPU usage? Because when we'll do actual encoding something like 18fps and 50% cpu load won't make things faster than 10fps and 25% load

Also I posted it before but deleted suggestion cause I'm not sure anymore, but to utilize vapoursynth's MT better, maybe it is good idea to add more filters. Like 2 consecutive nnedi or something (but make sure that it doesn't bottlenecks elsewhere, like overly high resolution...)

Last edited by Keiyakusha; 16th November 2012 at 23:15.
Keiyakusha is offline   Reply With Quote
Old 16th November 2012, 23:29   #14  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Vapoursynth is running at 98-99% load and avisynth is running at 87-88% load.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 17th November 2012, 00:06   #15  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Tried double NNEDI3. Had to bump it up to vs.Core(threads=7) to optimally use vapoursynth this time. Threads=4 was stilll the most optimal for avisynth. Avisynth CPU load was 90% to 91%. Vapoursynth was 97% to 98%. Avisynth was about .5 to 1fps slower than vapoursynth. Vapoursynth ran 12.5fps-13fps while avisynth ran 12fps to 12.5fps. However, there was a huge discreprancy in memory usage. Avisynth was using about 1gb of RAM before I stopped playback. Vapoursynth was always consistently at 200mb of usage.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 17th November 2012, 00:10   #16  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Revgen View Post
Tried double NNEDI3. Had to bump it up to vs.Core(threads=7) to optimally use vapoursynth this time. Threads=4 was stilll the most optimal for avisynth. Avisynth CPU load was 90% to 91%. Vapoursynth was 97% to 98%. Avisynth was about .5 to 1fps slower than vapoursynth. Vapoursynth ran 12.5fps-13fps while avisynth ran 12fps to 12.5fps. However, there was a huge discreprancy in memory usage. Avisynth was using about 1gb of RAM before I stopped playback. Vapoursynth was always consistently at 200mb of usage.
The ram difference is just because of different cache strategies. Avisynth caches everything until it bumps into the set memory limit. VS keeps track of the cache request history as well and is decent at detecting linear scans and minimizing cache sizes then.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 17th November 2012, 00:22   #17  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Okay, I used SetMemoryMax(250) this time. Memory usage is under control and avisynth performance is still the same.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 17th November 2012, 13:08   #18  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Thank you all for testing. I'm glad to see it's working.

I'm done with the asm. The new build should be fully functional now. opt=2 is default. Please try your favourite combination of exotic parameters.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 17th November 2012, 13:30   #19  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by jackoneill View Post
Internally it does the same as the avisynth filter. It's mostly the same code.
If I understand this correctly, this means NNEDI3 works in 16-bit internally, then dithers/rounds/truncates(?) to 8-bit. Correct?
High bit depth input/output would be lovely.

*edit*
My previous question (NNEDI3 internal processing) is irelevant. I (somehow) misinterpreted the quoted statement and thought that NNEDI3 works like avisynth's internal resizing filters. Sorry for being dumb.

Last edited by Reel.Deel; 17th November 2012 at 23:04. Reason: Corrected myself.
Reel.Deel is offline   Reply With Quote
Old 17th November 2012, 20:08   #20  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Reel.Deel View Post
If I understand this correctly, this means NNEDI3 works in 16-bit internally, the dithers/rounds/truncates(?) to 8-bit. Correct?
High bit depth input/output would be lovely.
No idea. Investigating the possibility of high bit depth input and output is on my todo list.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill 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 23:10.


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