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 Display Modes
Old 30th September 2010, 02:24   #321  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
Quote:
Originally Posted by Bi11 View Post
Is there any chance of being able to do assembly-level optimizations to improve performance similar to the speed improvement seen with nnedi3?
My version gains 6% speed from 64bit. This is almost entirely due to better scheduling of dotproducts. I have no code that needs more than 8 registers for a naive scheduling, but out of order execution isn't perfect.
akupenguin is offline   Reply With Quote
Old 7th November 2010, 06:45   #322  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 6,016
I had a wonderful experience with NNEDI3 tonight for an unusual task: Upscaling a 12 megapixel image from my Canon s90 (RAW -> Lightroom -> 16bpc ProPhoto TIFF -> 8 bit sRGB PNG) to ~48 megapixels for professional printing on 20" x 30" paper.

A 64 bit toolchain was mandatory

Code:
imagesource("...\felix_source.png")
trim(1,1)

red=showred.converttoyuy2(matrix="pc.709")
green=showgreen.converttoyuy2(matrix="pc.709")
blue=showblue.converttoyuy2(matrix="pc.709")

red=red.nnedi3(field=-1,dh=true).turnright.nnedi3(field=-1,dh=true).turnleft
green=green.nnedi3(field=-1,dh=true).turnright.nnedi3(field=-1,dh=true).turnleft
blue=blue.nnedi3(field=-1,dh=true).turnright.nnedi3(field=-1,dh=true).turnleft

mergeRGB(red,green,blue)

spline64resize(7949,6000)
I used a solid 2.8GB of RAM for this script on a single frame. Processing time was under a minute, using PNG output from VirtualDub x64.

The result was very good! When stacked with an image scaled by Photoshop's bicubic filter, it was noticeably better, especially after I staked an instance of Photoshop's "Smart Sharpen" filter on each image.

MARVELOUS work, akupenguin and tritical et al!

Now, if I had support for 16 bpc through the whole pipeline, I'd be REALLY happy
__________________
These are all my personal statements, not those of my employer :)

Last edited by Blue_MiSfit; 7th November 2010 at 06:53.
Blue_MiSfit is offline   Reply With Quote
Old 7th November 2010, 20:28   #323  |  Link
dansrfe
Registered User
 
Join Date: Jan 2009
Posts: 1,210
Trying that out now^

EDIT: AvsP starts throwing errors when I press F5. CPU usage does shoot up to 100% for about 1 min though.

EDIT EDIT: for rfactor = 4, rfactor = 2 works very snappily on my c2d.

Last edited by dansrfe; 8th November 2010 at 04:12.
dansrfe is offline   Reply With Quote
Old 8th November 2010, 10:13   #324  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,635
I'm wondering if there is not some kind of memory leak in nnedi3_rpow ? I've made an avisynth script with only AVISource and nnedi3_rpow, absolutely nothing else, and noticed during VDub process that memory usage was always increasing regularly. I've noticed this with x64 version, not tested yet with x86 version. Doesn't anybody else noticed it ?
jpsdr is offline   Reply With Quote
Old 8th December 2010, 07:26   #325  |  Link
bcn_246
Registered User
 
bcn_246's Avatar
 
Join Date: Nov 2005
Location: UK
Posts: 117
tritical,
I have been using your plug-ins for some time, thought I should say thanks for all your hard work.

I tried your 64-bit build of NNEDI3 using "NNEDI3_rpow2(rfactor=2,cshift="Spline64Resize")" and found the speed improvement to be vast. Using JoshyD's 2.5.8 MT x64 build, an i7 @ 4.00GHz w/6GB RAM, processing the same video (Gorillaz - Feel Good Inc. @ 720p), I got ~3fps on x86 and ~8fps on x64. Probably the most significant x86->x64 increase I have seen.

I tried your first x64 build of EEDI3 but it threw up a "unable to load plugin..." error. I just re-downloaded the file from your post and see the timestamp is different, updated today (08/12/2010), so I will have a go with that build of EEDI3 x64 once my current processing job is done.

Ben

Last edited by bcn_246; 8th December 2010 at 07:45. Reason: wrong info
bcn_246 is offline   Reply With Quote
Old 8th December 2010, 07:43   #326  |  Link
bcn_246
Registered User
 
bcn_246's Avatar
 
Join Date: Nov 2005
Location: UK
Posts: 117
Tried the EEDI3 version you posted today. Still refusing to load with JoshyD's AviSynth v2.5.8 MT x64 build 4/16/2010.



- Ben
bcn_246 is offline   Reply With Quote
Old 8th December 2010, 17:07   #327  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@bcn_246
I haven't posted any new versions since my last post - not sure why the timestamps are different. Probably you need the visual studio 2010 runtime (http://www.microsoft.com/downloads/e...displaylang=en) for the openmp dependency.

@jpsdr
nnedi2_rpow is just a wrapper around nnedi3() that automates resizing. It constructs an avisynth filter chain consisting of nnedi3(), turnleft/turnright, final resize filter, etc... It doesn't allocate any memory directly so if memory is leaking it is either Avisynth or nnedi3(). It's difficult to tell for sure just looking at memory usage due to the way Avisynth's cache operates... after you open a script Avisynth doesn't immediately gobble up all the memory it plans to use. It gradually fills the cache as frames are requested until it hits its memory limit. If you let it run for a while does the memory usage stabilize? I will look into this.

@dansrfe
rfactor=3 in nnedi2_rpow2 should throw an error. Only powers of two are supported.
tritical is offline   Reply With Quote
Old 8th December 2010, 19:13   #328  |  Link
bcn_246
Registered User
 
bcn_246's Avatar
 
Join Date: Nov 2005
Location: UK
Posts: 117
My (stupid) mistake with the timestamps. My download manager wasn't set to copy the file's date from the server, so re-downloading modified the creation date.

I installed Microsoft Visual C++ 2010 (x64), and updated .NET to v4.0 while I was at it, EEDI3 x64 is still refusing to load.

I am using Windows 7 Ultimate x64, up-to-date with MS. Here is a list of other plug-ins I have in my 'plugins64' folder. I am guessing that there is something that should be here (or in SysWOW64/System...) that EEDI3 depends on.

Code:
\Documentation
\Scripts
fieldhint.cpp
Utilities.cpp
AddGrainC.dll
autocrop.dll
aWarpSharp.dll
colormatrix.dll
defreq.dll
DeGrainMedian.dll
dfttest.dll
DirectshowSource.dll
EEDI2.dll
eedi3_64.dll
ffms2.dll
FFT3DFilter.dll
FFT3dGPU.dll
fftw3.dll
FieldHint.dll
FluxSmooth.dll
gradfun2db.dll
hqdn3d.dll
LeakKernelDeint.dll
libfftw3f-3.dll
MipSmooth.dll
motion.dll
MT.dll
mt_masktools-25-x64.dll
mvtools2.dll
nnedi3_64.dll
RemoveGrain.dll
Repair.dll
TDeinterlace.dll
TelecideHints.dll
TIVTC.dll
TNLMeans.dll
TTempSmooth.dll
UnDot.dll
VerticalCleaner.dll
yadifmod.dll
ffmsindex.exe
avisynth.h
info.h
internal.h
Utilities.h
fft3dgpu.hlsl
FieldHint.icproj
FieldHint.sln
FieldHint.vcproj

- Ben

Last edited by bcn_246; 8th December 2010 at 19:29. Reason: added list of plugin64 files
bcn_246 is offline   Reply With Quote
Old 9th December 2010, 09:55   #329  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,635
Quote:
Originally Posted by tritical View Post
@jpsdr
If you let it run for a while does the memory usage stabilize? I will look into this.
Yes, it's stabilize at around 500MB after a long time. This seems a little high considering the fact :
- It begins at around 150MB and constantly increase.
- I'm working in input with 720x480 pictures, asking for an increase size of 2 (so output at 1440x960) + Spline36Resize.
I've not waiting all the time, i've just noticed the continuous increase on the begining, and noticed that several hours laters, and so dozen of file processed laters, memory usage seems stabilized at around 500MB.

Edit : Video is YV12.

Note : You've provided the source code of last version, thanks, nice. You've also made an experimental 64bits version, but without the source code. Is it possible you made this one avaible ?

Last edited by jpsdr; 10th December 2010 at 09:51.
jpsdr is offline   Reply With Quote
Old 9th December 2010, 22:10   #330  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
For a system with 2+GB of ram this is more or less what I would expect. The default SetMemoryMax is 25% physical memory capped to 512Mb. You can of course change this with a SetMemoryMax() statement at the start of your script.
IanB is offline   Reply With Quote
Old 10th December 2010, 09:57   #331  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,635
I don't understand the slow growing use of memory. Once a filter has done all the memory allocations it needs, if there is no memory leak, i don't understand why memory should slowly go bigger and bigger and bigger.... I use some others avisynth scripts (always simple basic things), and memory used is always stabilised in the few seconds, it doesn't still growing half an hour after starting the process.
This is not the case, but i think if on a script like (YV12 video) :
Code:
AVISource("File.avi")
Spline36Resize(1280,720)
I would see a memory use of 500MB !!! I thought it could be a problem................
Wait... I remember now IanB.... I've got similar issue with something totaly different, and problem was linked to the fact that source is YV12 in 720x480, and so some resolution not mod16, and so created some cache default or i don't remember what, resulting in avisynth cache always increasing...
At the time i thought there was a problem with avisynht or Lagarith...
I must look out for the solution you provided me, and test it and check if there is still the memory increase.

Last edited by jpsdr; 10th December 2010 at 10:15.
jpsdr is offline   Reply With Quote
Old 10th December 2010, 17:23   #332  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,635
It's not what i thought...
I've replaced
Code:
AVISource("File.avi")
nnedi3_rpow2(rfactor=2,cshift="Spline36Resize",fwidth=960,fheight=720,nsize=0,nns=3,qual=2)
by
Code:
AVISource("File.avi",False,"YV12")
SetPlanarLegacyAlignment(True)
nnedi3_rpow2(rfactor=2,cshift="Spline36Resize",fwidth=960,fheight=720,nsize=0,nns=3,qual=2)
but nothing changed, memory is still begining at around 150MB, and is slowly growing until reaching around 500MB.
So, it behaves like there is some kind of memory leak somewhere...
jpsdr is offline   Reply With Quote
Old 10th December 2010, 17:32   #333  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,406
Did you read IanB's post? Start your script with the line "SetMemoryMax(16)", and see Avisynth using only very little memory.

Avisynth has an internal frame buffer. If not used elsehow by internal (temporal) filters, Avisynth will fill that frame cache with "past output frames". (For example, that means that if you're running a very slow/complex "1fps" script, you can very quickly step backwards lots of frames that already have been rendered.)
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 10th December 2010, 18:28   #334  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,635
After some test with only Spline36Resize, it seems it's my mistake, behavior is the same.
jpsdr is offline   Reply With Quote
Old 10th December 2010, 21:53   #335  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
There are some heuristics involved with the cache memory usage that tries to fight growth. This involves cache instances trying to recognise non-usage cases and marking VFB's involved as returned for early reuse. If the memory manager has a VFB of the right size marked as returned it will issue that one (limit mode) instead of checking the SetMemoryMax values and issuing a new one if current usage is less (growth mode) or issuing one from the LRU chain (plateau mode). The heuristic code errs on the side of safety and won't return VFB's unless it is pretty sure they will never be needed again.

If the growth is a problem use SetMemoryMax() to constrain it. Also the OS had to have memory free at script compile time to set the initial SetMemoryMax value, so that memory was not being used for anything else anyway.

Last edited by IanB; 10th December 2010 at 22:40.
IanB is offline   Reply With Quote
Old 10th December 2010, 22:04   #336  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,442
Interesting stuff, thanks for the details, Ian.
Quote:
Originally Posted by IanB View Post
The heuristic code errs on the side of safety and won't return VFB's unless it is 100% sure they will never be needed again.
Can it ever be 100% sure, given that a plugin could request frames in some totally arbitrary order?
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 10th December 2010, 22:39   #337  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Well no it can never be 100% sure.
IanB is offline   Reply With Quote
Old 16th December 2010, 00:52   #338  |  Link
Amateur
Registered User
 
Join Date: Dec 2010
Posts: 146
new user here. i am wanting to give this eedi3 filter a try but it won't load in megui. i keep getting an error saying "there is no function named eedi3". i put the dll into the plugin folder of avisynth so i don't know what i'm missing.

a secondary question:
i'm wanting to use this filter for some anti-aliasing. am i choosing the proper filter for this purpose? here a the scene that i see it the most. i tried to use aaa() but that didn't seem to do much. here is the script that i am using that has given me the best results so far

Quote:
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("E:\xv1e1\VTS_01_1.d2v", info=3)
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\avisynth_plugin\ColorMatrix.dll")
ColorMatrix(hints=true, threads=0)

undot()

AnimeIVTC(mode=1, aa=1, precision=3, edimode="nnedi3")

Deen("a2d",7,11,13,min=0.5)

crop( 8, 0, -6, -4)

LanczosResize(640,480)

trim(4000,6000)
**notes on the parameters - i found that line for animeivtc in another thread so i just used it for mine. reading the documentation for that was like looking at chinese for me. i took that deen line from scintilla...maybe that can be tweaked to make my picture look better. and i read that undot is risk free compressibility so i just add that to all of my scripts...not really sure what it does.

here is what the scene looks like at 600kbps bitrate (might bump that up more if i can't get filters to help clean up the image)

i've been trying to read up on filters for the last week or more but a lot of comments are beyond me so i very well might be implementing these filters in the wrong way. would love any help possible. kind of blindly using scintilla's filter guide as a baseline for quite a while but that is somewhat limited now that i've been snooping around on doom9

here is a vob clip of the opening scene if anyone cares to fool around with it. source is a North American DVD (ntsc?)

just in case the opening scene is different from the actual episode, here is a one minute vob clip following the opening scene.

Last edited by Amateur; 16th December 2010 at 02:05.
Amateur is offline   Reply With Quote
Old 16th December 2010, 07:37   #339  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Amateur!
try:
http://forum.doom9.org/showthread.ph...90#post1423090
If You want antialiasing use function inside AnimeIVTC (ediaa, daa, maa). I prefer daa with nnedi3, and try setting for nnedi3 for improving accuracy.
yup.
yup is offline   Reply With Quote
Old 16th December 2010, 15:16   #340  |  Link
Amateur
Registered User
 
Join Date: Dec 2010
Posts: 146
alright i clicked on the link from the response to your link that is supposed to be the fix and was given a page that had three download options
Quote:
vcredist_IA64.exe
vcredist_x64.exe
vcredist_x86.exe
i am running a 64 bit operating system so i chose the first two. i went to install the first one and am told my processor isn't compatible (phenom ii x4) so i installed the second one only. but i still get the error there is no function named eedi3. i even restarted my computer after running that vcredist_x64.exe and no change in error

and how do i anti-alias from within animeivtc? i tried finding it in the info of animeivtc but again, it's kind of like reading another language with that much info that i'm not familiar with. i changed aa=2 because the filter had
Quote:
aaed = aa==0 ? dec :
\ aa==1 ? dec.ediaa() :
\ aa==2 ? dec.daa() :
\ aa==3 ? dec.maa() :

i'm so lost...

also, could deen be tweaked in any way for some improvement?

Last edited by Amateur; 16th December 2010 at 16:06.
Amateur is offline   Reply With Quote
Reply

Thread Tools
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:53.


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