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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd August 2013, 09:18   #461  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by wOxxOm View Post
on default settings nnedi3_rpow2 is about 20% faster (39 -> 47 fps @ 480p -> 960p) when recompiled against FTurn instead of avisynth's built-in turnleft/turnright.
OK, did some tests using "official" Avisynth 2.6 Alpha4:

The test clip is a short 720p avc video.

Script:
Code:
LoadPlugin("DGDecodeNV.dll")
LoadPlugin("nnedi3.dll")
DGSource("F:\Test\test.dgi")
NNEDI3_rpow2(rfactor = 2)
Results (AVSMeter):
Code:
nnedi3_tritical.dll : 26.70 fps (from tritical's website)
nnedi3_fturn.dll    : 28.14 fps
nnedi3_icl10.dll    : 28.28 fps
Groucho2004 is offline   Reply With Quote
Old 2nd August 2013, 10:09   #462  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
It looks like you didn't load fturn.dll. It would use avisynth's turn functions as usual in this case. "Compiled against" was an incorrect term. "Able to use if available" is.
TurboPascal7 is offline   Reply With Quote
Old 2nd August 2013, 10:12   #463  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
So nnedi3_fturn.dll will use the fturn.dll if it is loaded in the script?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 2nd August 2013, 10:17   #464  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
Quote:
Originally Posted by Selur View Post
So nnedi3_fturn.dll will use the fturn.dll if it is loaded in the script?
Yes.
Or if fturn was autoloaded from plugins directory.
wOxxOm is offline   Reply With Quote
Old 2nd August 2013, 10:17   #465  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Let me just paste the code.
Code:
 auto turnRightFunction = env->FunctionExists("FTurnRight") ? "FTurnRight" : "TurnRight";
    auto turnLeftFunction = env->FunctionExists("FTurnLeft") ? "FTurnLeft" : "TurnLeft";
	try 
	{
		double hshift = 0.0, vshift = 0.0;
		if (vi.IsRGB24())
		{
			for (int i=0; i<ct; ++i)
			{
				v = new nnedi3(v.AsClip(),i==0?1:0,true,true,true,true,nsize,nns,qual,etype,pscrn,threads,opt,fapprox,env);
				v = env->Invoke(turnRightFunction,v).AsClip();
				v = new nnedi3(v.AsClip(),i==0?1:0,true,true,true,true,nsize,nns,qual,etype,pscrn,threads,opt,fapprox,env);
				v = env->Invoke(turnLeftFunction,v).AsClip();
			}
			hshift = vshift = -0.5;
		}
Nothing fancy, one minute's job. If fast alternative is available - use it, otherwise go with default one. Optimizing this function in the core/writing nnedi3_rpow2 as a script would be better, but we get what we get. I'm surprised tritical didn't implement fast turns himself.
TurboPascal7 is offline   Reply With Quote
Old 2nd August 2013, 10:19   #466  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Okay, thanks, that clears it up.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 2nd August 2013, 10:19   #467  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by TurboPascal7 View Post
It looks like you didn't load fturn.dll. It would use avisynth's turn functions as usual in this case. "Compiled against" was an incorrect term. "Able to use if available" is.
Aaaahh, I see. Now that certainly changes things. With FTurn I get actually 57 fps (!) in the same scenario. Nice.
Groucho2004 is offline   Reply With Quote
Old 2nd August 2013, 13:10   #468  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Since we're on the subject of speed and turning...

Currently nnedi3_rpow2() does this internally:
nnedi3()
turnright()
nnedi3()
turnleft()

It should in theory be slightly faster if rearranged to:
turnright()
nnedi3()
turnleft()
nnedi3()

I didn't bother to test it myself but you'll be turning half the number of pixels so maybe it'll be a noticable improvement. Or maybe it'll look a lot different... who knows...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd August 2013, 15:45   #469  |  Link
PetitDragon
Registered User
 
Join Date: Sep 2006
Posts: 81
Quote:
Originally Posted by wOxxOm View Post
Yes.
Or if fturn was autoloaded from plugins directory.
Hi wOxxOm,

If I do it with ffdshow in realtime, I just put both nnedi3_fturn.dll and fturn.dll in avisynth plugin folder, then nnedi3_rpow2 will use the new fturn automatically. right?
PetitDragon is offline   Reply With Quote
Old 2nd August 2013, 15:47   #470  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
PetitDragon, yeah. Anyway you can check in ffdshow if FTurn is autoloaded by explicit call: FTurnLeft().FTurnRight()
wOxxOm is offline   Reply With Quote
Old 2nd August 2013, 15:50   #471  |  Link
PetitDragon
Registered User
 
Join Date: Sep 2006
Posts: 81
Quote:
Originally Posted by wOxxOm View Post
PetitDragon, yeah. Anyway you can check in ffdshow if FTurn is autoloaded by explicit call: FTurnLeft().FTurnRight()
Got it!
PetitDragon is offline   Reply With Quote
Old 3rd August 2013, 05:50   #472  |  Link
aegisofrime
Registered User
 
Join Date: Apr 2009
Posts: 478
Hi Groucho2004! While you are at it, do you think you could do a ICL10 compile of the Vapoursynth version of NNEDI3 as well?
aegisofrime is offline   Reply With Quote
Old 3rd August 2013, 10:38   #473  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by aegisofrime View Post
Hi Groucho2004! While you are at it, do you think you could do a ICL10 compile of the Vapoursynth version of NNEDI3 as well?
It won't make any difference. All the "speed-relevant" code is already ASM. A C compiler can't perform miracles.
Groucho2004 is offline   Reply With Quote
Old 11th November 2013, 11:25   #474  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
I did some modifications on EEDI3 0.9.2:
  • SSE/SSE2 optimizations, giving a nice 4× speedup.
  • Added an optional mask to process only the specified parts. It’s helpful when EEDI3 is used as an anti-aliasing processor on cartoon-like materials. Additional 1.2×–2× speedup, depending on the source.
  • I fixed a typo in the original code too, but I don’t know if it has any visible effect.
  • Be sure to have Visual C++ Redistributable for Visual Studio 2012 installed (needed for vcomp11.dll).
The SSE2 code is 16-bit ready, although the glue code to pass stack16 clips hasn’t been implemented yet. It will probably come in a next update.

If you compare the C++ and SSE2 results, there are some rare and minor differences here and there, but I don’t know the exact reason at the moment (different rounding? bug?), and it’s difficult to tell which result is better.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding

Last edited by cretindesalpes; 11th November 2013 at 11:43. Reason: VS2012 redist
cretindesalpes is offline   Reply With Quote
Old 21st November 2013, 06:43   #475  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Regarding eedi3... today I found that eedi3rpow2 displays the same chroma shift issue that nnedi3rpow2 has - see this post and following discussion. Just so that people know.

Sadly I totally forgot that the issue is (still) there, only finding out today. Aw, I was using nnedi3rpow2 for antialiasing purposes...
I'm not sure how correct would Sapo84's scripted workaround (described back there) be, since I have no idea how exactly does nnedi3 implement the shifting mechanism in nnedi3rpow2.

Edit: Nice to see this update, cretindesalpes. Thanks!
mandarinka is offline   Reply With Quote
Old 22nd November 2013, 04:06   #476  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 103
Quote:
Originally Posted by mandarinka View Post
Regarding eedi3... today I found that eedi3rpow2 displays the same chroma shift issue that nnedi3rpow2 has - see this post and following discussion. Just so that people know.

Sadly I totally forgot that the issue is (still) there, only finding out today. Aw, I was using nnedi3rpow2 for antialiasing purposes...
I'm not sure how correct would Sapo84's scripted workaround (described back there) be, since I have no idea how exactly does nnedi3 implement the shifting mechanism in nnedi3rpow2.

Edit: Nice to see this update, cretindesalpes. Thanks!
nnedi3_rpow2 internally uses Spline36Resize to fix the vertical chroma shift introduced by nnedi3(dh=True, field=1).nnedi3(dh=True, field=0).nnedi3(dh=True, field=0)...
For horizontal scaling, nnedi3_rpow2 doesn't produce horizontal chroma shift for MPEG-2 chroma placement by nnedi3(dh=True, field=1).nnedi3(dh=True, field=1).nnedi3(dh=True, field=1)...(both of them are left-aligned)

When "cshift" is set, nnedi3_rpow2 uses AviSynth resizers to fix the center shift introduced by nnedi3. As for the chroma shift issues when "fwidth" is set, that's exactly the problem of AviSynth's resizers. For 4:2:x content, AviSynth's resizers always assume they are of MPEG-1 chroma placement and produce horizontal chroma shift.

Recently I wrote a script named Resize8, which fixes the chroma shift issues of AviSynth's resizers: http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=1323
I have also written a script named nnedi3_resize16, which combines nnedi3 & Dither_resize16 for scaling & color space transferring, and it also correctly deal with center shift & chroma shift: http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=1117

Last edited by mawen1250; 22nd November 2013 at 04:24.
mawen1250 is offline   Reply With Quote
Old 22nd November 2013, 18:36   #477  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Quote:
Be sure to have Visual C++ Redistributable for Visual Studio 2012 installed (needed for vcomp11.dll).
how about a statically compiled version?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 23rd November 2013, 04:22   #478  |  Link
TurboPascal7
Registered User
 
TurboPascal7's Avatar
 
Join Date: Jan 2010
Posts: 270
Quote:
Originally Posted by Selur View Post
how about a statically compiled version?
Out of curiosity: why?
__________________
Me on GitHub | AviSynth+ - the (dead) future of AviSynth
TurboPascal7 is offline   Reply With Quote
Old 23rd November 2013, 11:01   #479  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Because having to keep track which avisynth dlls needs what runtime is a pain and atm. no other plugin is using the 2012 runtime, especially if you use Avisynth as a portable package.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 16th December 2013, 20:37   #480  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
y8, yv16, yv24, please.
wOxxOm is offline   Reply With Quote
Reply


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:16.


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