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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th July 2015, 07:32   #521  |  Link
CruNcher
Registered User
 
CruNcher's Avatar
 
Join Date: Apr 2002
Location: Germany
Posts: 4,929
@tritical\madshi
can his results be taken serious ?

http://www.resampling.narod.ru/
__________________
all my compares are riddles so please try to decipher them yourselves :)

It is about Time

Join the Revolution NOW before it is to Late !

http://forum.doom9.org/showthread.php?t=168004

Last edited by CruNcher; 12th July 2015 at 08:04.
CruNcher is offline   Reply With Quote
Old 12th July 2015, 08:44   #522  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,577
Quote:
Originally Posted by MysteryX View Post
The exact same script is running at 13fps, over twice the performance!!
Not sure about over twice the performance, but what's the catch here? I thought its a common knowledge that you must disable internal threading in plugins if you use them i'm multithreaded avisynth/vapoursynth. As well as the other way - disable all avisynth threads if you have a gpu-filter in the chain. Even setting source filter threads to 1 sometimes makes slight difference.
Keiyakusha is offline   Reply With Quote
Old 12th July 2015, 10:49   #523  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Keiyakusha View Post
Not sure about over twice the performance
After a quick test with nnedi3_rpow2, that's about right. The internal OpenMP implementations in nnedi3 and eedi3 are quite inefficient.

Quote:
Originally Posted by Keiyakusha View Post
I thought its a common knowledge that you must disable internal threading in plugins if you use them i'm multithreaded avisynth/vapoursynth. As well as the other way - disable all avisynth threads if you have a gpu-filter in the chain. Even setting source filter threads to 1 sometimes makes slight difference.
Common knowledge? Hm, getting on top of things with Avisynth MT, a long filter chain (sane or not) and all the obstacles that come with it takes time.
And don't forget that some people strongly dislike reading documentation and searching forums.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 13th July 2015, 05:55   #524  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,565
Quote:
Originally Posted by CruNcher View Post
@tritical\madshi
can his results be taken serious ?

http://www.resampling.narod.ru/
Looks like good research, but unavailable software and the Russian site is long gone, not even in Internet Archive.
foxyshadis is offline   Reply With Quote
Old 13th July 2015, 06:33   #525  |  Link
vivan
/人 ◕ ‿‿ ◕ 人\
 
Join Date: May 2011
Location: Russia
Posts: 643
Quote:
Originally Posted by foxyshadis View Post
Looks like good research, but unavailable software and the Russian site is long gone, not even in Internet Archive.
It seem to work fine here.

And it was kinda discussed here http://forum.doom9.org/showthread.ph...18#post1576518
vivan is offline   Reply With Quote
Old 15th July 2015, 05:46   #526  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,565
Quote:
Originally Posted by vivan View Post
It seem to work fine here.

And it was kinda discussed here http://forum.doom9.org/showthread.ph...18#post1576518
The site links to a Russian version at http://resample.narod.ru/ and I was hoping that might have software, more details, or a description of the algorithm, but unfortunately it's just a holding page.
foxyshadis is offline   Reply With Quote
Old 11th August 2015, 10:52   #527  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
There have been a number of updates to nnedi3 by jpsdr but for those of you who want to use the original nnedi3 0.9.4, don't need the additional color spaces and also want to take advantage of the substantial speed increase that TP7's "FTurn" brings for nnedi3_rpow2() I have built a DLL that does just that.

Tritical's 0.9.4 code is unaltered except:
  • If TP7's fturn.dll is present in the Avisynth autoload directory, nnedi3 will use it's optimized TurnLeft/TurnRight functions
  • Replaced the utterly obsolete "memcpy_amd" with standard memcpy

The DLL is built with ICL10. Download here.


Some performance tests on my i5 2500K (4 cores):

Script:
Code:
avsmt_threads = 1
edi_threads = 4
(avsmt_threads > 1) ? setmtmode(2, avsmt_threads) : nop()
colorbars(width = 1536, height = 1024, pixel_type = "yv12").killaudio().assumefps(50, 1).trim(0,999)
nnedi3_rpow2(rfactor = 2, nsize = 0, nns = 4, qual = 2, threads = edi_threads)
With "avsmt_threads = 1" and "edi_threads = 4" (using only nnedi's internal multi-threading):
Code:
[Runtime info]
Frames processed:               1000 (0 - 999)
FPS (min | max | average):      11.64 | 13.69 | 13.60
Memory usage (phys | virt):     476 | 488 MB
Thread count:                   14
CPU usage (average):            77%
Time (elapsed):                 00:01:13.539
With "avsmt_threads = 4" and "edi_threads = 1" (using only AVS MT multi-threading):
Code:
[Runtime info]
Frames processed:               1000 (0 - 999)
FPS (min | max | average):      3.231 | 149148 | 16.84
Memory usage (phys | virt):     572 | 626 MB
Thread count:                   23
CPU usage (average):            97%
Time (elapsed):                 00:00:59.375
The sweet spot is actually a combination of both, "avsmt_threads = 3" and "edi_threads = 3":
Code:
[Runtime info]
Frames processed:               1000 (0 - 999)
FPS (min | max | average):      5.305 | 255682 | 17.02
Memory usage (phys | virt):     560 | 600 MB
Thread count:                   31
CPU usage (average):            96%
Time (elapsed):                 00:00:58.751

Last edited by Groucho2004; 11th August 2015 at 17:23.
Groucho2004 is offline   Reply With Quote
Old 11th August 2015, 11:20   #528  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,229
Apparently Fturn (the actual Fturn, not normal turn function) is built in, but used as normal turn with Avisynth+.

From the Avisynth+ changelog (24th November 2013):
Quote:
Code from FTurn is now integrated into the core (with some additional optimizations and new RGB32 routines), making the plugin obsolete.
I realise not everyone wants to use Avisynth+, but it seems that the fturn code got further optimisations that isn't present in the separate plugin. I guess the code could be 'extracted' from the avisynth+ source, it might provide a little extra performance.
burfadel is offline   Reply With Quote
Old 11th August 2015, 11:41   #529  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by burfadel View Post
Apparently Fturn (the actual Fturn, not normal turn function) is built in, but used as normal turn with Avisynth+.
Yes, I should probably have mentioned that this is useful mainly for users of the official or SEt's MT Avisynth versions.

Quote:
Originally Posted by burfadel View Post
I realise not everyone wants to use Avisynth+, but it seems that the fturn code got further optimisations that isn't present in the separate plugin. I guess the code could be 'extracted' from the avisynth+ source, it might provide a little extra performance.
Same script as above, AVS+ r1576, without fturn.dll in the autoload directory:
Code:
[Runtime info]
Frames processed:               1000 (0 - 999)
FPS (min | max | average):      11.82 | 13.45 | 13.35
Memory usage (phys | virt):     74 | 91 MB
Thread count:                   25
CPU usage (average):            76%
Time (elapsed):                 00:01:14.901
with fturn.dll in the autoload directory:
Code:
[Runtime info]
Frames processed:               1000 (0 - 999)
FPS (min | max | average):      11.83 | 13.49 | 13.39
Memory usage (phys | virt):     74 | 91 MB
Thread count:                   25
CPU usage (average):            75%
Time (elapsed):                 00:01:14.658
Groucho2004 is offline   Reply With Quote
Old 11th August 2015, 12:02   #530  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,229
Ah okay, so those results are well within error margin! I was just going by the changelog comment. I presume that in the test that the turn command was using the fturn dll in the fturn test .
burfadel is offline   Reply With Quote
Old 11th August 2015, 12:11   #531  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by burfadel View Post
I presume that in the test that the turn command was using the fturn dll in the fturn test .
Yes, it did.
Groucho2004 is offline   Reply With Quote
Old 2nd September 2015, 18:16   #532  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,534
I have a question about turnleft/turnright. How does that work? If I'm applying EEDI3 + NNEDI3, should I call it in this order?
EEDI3, turnleft, NNEDI3, turnright

and if I'm calling NNEDI3(4), is it automatically calling turnleft/turnright?

In that case, NNEDI3(2) + NNEDI3(2) wouldn't give the same output as NNEDI3(4) ?

Anything else I should know about this?
MysteryX is offline   Reply With Quote
Old 2nd September 2015, 18:55   #533  |  Link
Desbreko
Registered User
 
Desbreko's Avatar
 
Join Date: Feb 2015
Posts: 55
TurnLeft/TurnRight rotates the video on its side so that nnedi3/eedi3's height doubling can be used to double the width of the image. If you use the rpow2 functions, they'll handle the turning to double both the width and height in one function call. If you use the base functions with dh=true, you need to call them twice with TurnLeft/TurnRight in between.

For example, the following two lines do basically the same thing, assuming you're using jpsdr's nnedi3.

nnedi3_rpow2(2)

TurnRight().nnedi3(1, dh=true, nsize=0, nns=3).TurnLeft().nnedi3(1, dh=true, nsize=0, nns=3)
__________________
Twitter, AviSynth scripts

Last edited by Desbreko; 2nd September 2015 at 18:58.
Desbreko is offline   Reply With Quote
Old 12th September 2015, 18:47   #534  |  Link
Desbreko
Registered User
 
Desbreko's Avatar
 
Join Date: Feb 2015
Posts: 55
After putting it off for a long time, seeing jpsdr make improvements to nnedi3_rpow2 in his builds finally gave me the motivation to write a better rpow2 function that also supports the other edi plugins, so here we go.

edi_rpow2 v1.0
(Also requires ResizeX)

It supports jpsdr's nnedi3, nnedi3ocl, eedi3, and eedi2, and includes all the improvements jpsdr made plus more, such as...
  • Supports all AviSynth 2.6 colorspaces except RGB32 with all edi plugins
  • Uses FTurn if it's loaded
  • Separate rfactors for horizontal and vertical image enlargement
  • Corrects for the chroma shift caused by AviSynth's resizers and includes a cplace parameter
  • Can use Dither_resize16 instead of the internal resizers to output a stack16 clip
  • Allows disabling processing of individual YUV planes
  • Avoids distortion at the edges of the frame
  • Supports eedi3's sclip and mclip parameters (sclip works a little differently; see the included documentation)
__________________
Twitter, AviSynth scripts
Desbreko is offline   Reply With Quote
Old 5th October 2015, 22:57   #535  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,534
I mentioned that NNEDI3's multi-threading was inefficient. I just realized it's weirder than that.

I'm running these scripts with AvsMeter to see how many threads are created. I'm running in MT mode with 8 threads.

This creates 16 threads.
nnedi3_rpow2(2, cshift="Spline16Resize", threads=1)

This creates 32 threads.
nnedi3_rpow2(2, cshift="Spline16Resize", threads=2)

This creates 128 threads.
nnedi3_rpow2(2, cshift="Spline16Resize", threads=1)

When running without MT and asking NNEDI3 to use a single thread, it creates 2 more threads.

What's going on here?
MysteryX is offline   Reply With Quote
Old 5th October 2015, 23:20   #536  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,369
Quote:
Originally Posted by MysteryX View Post
This creates 16 threads.
nnedi3_rpow2(2, cshift="Spline16Resize", threads=1)

This creates 32 threads.
nnedi3_rpow2(2, cshift="Spline16Resize", threads=2)

This creates 128 threads.
nnedi3_rpow2(2, cshift="Spline16Resize", threads=1)
The two I've bolded are identical. Is there a typo in one of them?
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 6th October 2015, 03:01   #537  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,534
should be "threads=8" or not specified since it is the default on my system
MysteryX is offline   Reply With Quote
Old 6th October 2015, 03:09   #538  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,080
Quote:
Originally Posted by MysteryX View Post
should be "threads=8" or not specified since it is the default on my system
Might want to say which bolded one you refer to.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 6th October 2015, 03:17   #539  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,534
last one, of course
MysteryX is offline   Reply With Quote
Old 7th October 2015, 14:34   #540  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
Desbreko, the edi_rpow2 v1.0 looks like fine! it's what I need.
I have seven questions about:
1) The jpsdr nnedi3 that edi_rpow2 v1.0 supports is nnedi3 v0.9.4.20, with all original parameters (Update maden in 5th September)?
2) Does eedi3, nnedi3ocl and eedi3, in your plug-in, have the same improvements that jpsdr made in nnedi3? More your improvements, course!
3) Your plug-in works only with nnedi3_rpow2, nnedi3ocl_rpow2, eedi3_rpow2 and eedi2_rpow2 functions, with all original parameters, or works with nnedi3, nnedi3ocl, eedi3 and eedi2 functions too, with all original parameters?
4) If works with nnedi3, nnedi3ocl, eedi3 and eedi2 too, this functions has the jpsdr's improvements and, of course, the yours?
5) There's no chroma and luma shift neither any type of chroma and luma flaws in your plug-in, in all functions and parameters it supports. Am I right?
6) Any future quality improvements plans?
7) You correct only AviSynth internal resizers chroma shift or correct chroma shift of some other resize, such Spline 144, Jinc,... (If yes, please, upload your corrected Avisynth external resizers)?
Please, answer all my questions.
__________________
Searching for great solutions

Last edited by luquinhas0021; 7th October 2015 at 16:09.
luquinhas0021 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 03:00.


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