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 26th May 2010, 15:42   #201  |  Link
D3C0D3R
Registered User
 
Join Date: Mar 2010
Location: Ukraine
Posts: 50
Quote:
Just that the usual "decision elements" (mostly threshold-driven) would be replaced by neural network decisions.
now i clearly understand, what tritical meant. thnx.
that means further improving mvTools alhorithms can make deinterlacers quality significantly better
__________________
blendhater
D3C0D3R is offline   Reply With Quote
Old 2nd June 2010, 15:28   #202  |  Link
PhrostByte
Grand Fruitioner
 
PhrostByte's Avatar
 
Join Date: Mar 2004
Location: Chicago, IL
Posts: 115
How would one correct for the center shift manually? I need to not only resize, but crop after using nnedi2 so I'd like to do it all in one go.
PhrostByte is offline   Reply With Quote
Old 10th June 2010, 10:57   #203  |  Link
daimroc
Registered User
 
Join Date: Mar 2005
Posts: 65
I don't see a post for nnedi3, but I see here there is some questions about nnedi3, so I use this post.

Well, I am noticed in some videos that when I use nnedi3, in the top and in the bottom I see that crop an uncrop one or two pixels, and it is a bit disturb, because It's like the image tremble in the top and int the bottom. The rest of the image it's perfect.

I play the video without deinterlacing it, and this effect doesnt happend, so the problem it seems nnedi3.

If I use the internal yadif of ffdshow this effect doesnt happend.

I use nnedi3 in the following way:

nnedi3(field=3, dh=false, Y=true, U=true, V=true, nsize=4, nns=3, qual=1, pscrn=true, threads=0, opt=0)

I try with nsize = 0 too and field = 2, although I know the video is top field first.



Thanks.
Daimroc.
daimroc is offline   Reply With Quote
Old 11th June 2010, 01:10   #204  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by PhrostByte View Post
How would one correct for the center shift manually? I need to not only resize, but crop after using nnedi2 so I'd like to do it all in one go.
For YV12:
mergechroma(spline36resize(w,h,src_left=-.5,src_top=-.5,src_width=w,src_height=h), \
spline36resize(w,h,src_left=-1.0,src_top=-1.0,src_width=w,src_height=h))

Modify the src_ values to do your cropping. w = final width after crop, same for h.

Last edited by foxyshadis; 11th June 2010 at 02:48.
foxyshadis is offline   Reply With Quote
Old 11th June 2010, 01:59   #205  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by foxyshadis View Post
mergechroma(spline36resize(w,h,src_left=-.5,src_top=-.5,src_width=w,src_height=h), \
spline36resize(w,h,src_left=-1.5,src_top=-1.5,src_width=w,src_height=h))
nnedi2_rpow2 already corrects the chroma shift automatically (see posts #36 and #38), so shouldn't this just be
spline36resize(w,h,src_left=-.5,src_top=-.5,src_width=w,src_height=h)

(And in any case I think the correct shift would be -1.0, not -1.5)
Gavino is offline   Reply With Quote
Old 11th June 2010, 02:48   #206  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
He's not using chromashift, he specifically asked for a way to do it manually so it doesn't need a shift+crop or double shift.

Also, yes, you're correct about the 1.0, I'll fix that. Damn, I've been using -1.5 for weeks now.
foxyshadis is offline   Reply With Quote
Old 11th June 2010, 09:25   #207  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
Is an x64 version of the pluggin scheduled ?
jpsdr is offline   Reply With Quote
Old 11th June 2010, 10:14   #208  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by foxyshadis View Post
He's not using chromashift, he specifically asked for a way to do it manually so it doesn't need a shift+crop or double shift.
If using nnedi2 directly (with dh=true) rather than nnedi2_rpow2, note that the sign of the required shifts will depend on the value of the field parameter and, for the horizontal shift, whether you use TurnRight or TurnLeft before calling nnedi2 the second time.

The values you gave (assuming 1.5 is corrected to 1.0) correspond to using field=1 and intermediate TurnRight.
Gavino is offline   Reply With Quote
Old 24th June 2010, 12:09   #209  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Any news about eedi3 optimization, at least multithreading? It has been 7 months since last update, I like it because it works great for agressive (animation) aliasing.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 24th June 2010, 19:38   #210  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
I put up a new version of eedi3 http://bengal.missouri.edu/~kes25c/eedi3.zip. Source is included. It is multithreaded using openmp. I had made some changes to the defaults (alpha/beta) and reworked the reliability checking (vcheck). From the readme:
Code:
Info:

     eedi3 works by finding the best non-decreasing (non-crossing) warping between two lines by minimizing a cost functional.
   The cost is based on neighborhood similarity (favor connecting regions that look similar), the vertical difference created
   by the interpolated values (favor small differences), the interpolation directions (favor short connections vs long), and
   the change in interpolation direction from pixel to pixel (favor small changes).


Functions:


  "eedi3", "c[field]i[dh]b[Y]b[U]b[V]b[alpha]f[beta]f[gamma]f[nrad]i
     [mdis]i[hp]b[ucubic]b[cost3]b[vcheck]i[vthresh0]f[vthresh1]f[vthresh2]f[sclip]c[threads]i"

  "eedi3_rpow2", "c[rfactor]i[alpha]f[beta]f[gamma]f[nrad]i[mdis]i[hp]b[ucubic]b
      [cost3]b[vcheck]i[vthresh0]f[vthresh1]f[vthresh2]f[cshift]s[fwidth]i[fheight]i[ep0]f[ep1]f[threads]i"


Parameters:

   field/dh/y/u/v are the same as nnedi2/nnedi3. 

   rfactor/cshift/fwidth/fheight/ep0/ep1 are the same as nnedi2_rpow2/nnedi3_rpow2. 


   alpha/beta/gamma (defaults: 0.2,0.25,20.0):

     These trade off line/edge connection vs artifacts created. alpha and beta must be in the range [0,1], and the sum
     alpha+beta must be in the range [0,1]. alpha is the weight given to connecting similar neighborhoods.. the larger
     it is the more lines/edges should be connected. beta is the weight given to vertical difference created by the
     interpolation... the larger beta is the less edges/lines will be connected (at 1.0 you get no edge directedness at all). 
     The remaining weight (1.0-alpha-beta) is given to interpolation direction (large directions (away from vertical) 
     cost more)... so the more weight you have here the more shorter connections will be favored. Finally, gamma penalizes
     changes in interpolation direction, the larger gamma is the smoother the interpolation field between two lines 
     (range is [0,inf].

     If lines aren't getting connected than increase alpha and maybe decrease beta/gamma. Go the other way if you are 
     getting unwanted artifacts.


   nrad/mdis (defaults: 2,20):

     nrad sets the radius used for computing neighborhood similarity. Valid range is [0,3]. mdis sets the maximum
     connection radius. Valid range is [1,40]. If mdis=20, then when interpolating pixel (50,10) (x,y), the farthest
     connections allowed would be between (30,9)/(70,11) and (70,9)/(30,11). Larger mdis will allow connecting lines
     of smaller slope, but also increases the chance of artifacts. Larger mdis will be slower. Larger nrad will be
     slower.


   hp/ucubic/cost3 (defaults: false, true, true):

      These are speed vs quality options. hp=true, use half pel steps, hp=false, use full pel steps. ucubic=true, use 
      cubic 4 point interpolation, ucubic=false, use 2 point linear interpolation. cost3=true, use 3 neighborhood cost
      function to define similarity, cost3=false, use 1 neighborhood cost function.


   vcheck/vthresh0/vthresh1/vthresh2/sclip (defaults: 2, 32.0, 64.0, 4.0, NULL):

      vcheck settings:

          0 - no reliability check
          1 - weak reliability check
          2 - med reliability check
          3 - strong reliability check

      If vcheck is greater than 0, then the resulting interpolation is checked for reliability/consistency. Assume
      we interpolated pixel 'fh' below using dir=4 (i.e. averaging pixels bl and cd).

           aa ab ac ad ae af ag ah ai aj ak al am an ao ap
                                eh          el
           ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp
                    fd          fh          fl
           ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp
                    gd          gh
           da db dc dd de df dg dh di dj dk dl dm dn do dp

      When checking pixel 'fh' the following is computed:

            d0 = abs((el+fd)/2 - bh)
            d1 = abs((fl+gd)/2 - ch)

            q2 = abs(bh-fh)+abs(ch-fh)
            q3 = abs(el-bl)+abs(fl-bl)
            q4 = abs(fd-cd)+abs(gd-cd)

            d2 = abs(q2-q3)
            d3 = abs(q2-q4)

            mdiff0 = vcheck == 1 ? min(d0,d1) : vcheck == 2 ? ((d0+d1+1)>>1) : max(d0,d1)
            mdiff1 = vcheck == 1 ? min(d2,d3) : vcheck == 2 ? ((d2+d3+1)>>1) : max(d2,d3)

            a0 = mdiff0/vthresh0;
            a1 = mdiff1/vthresh1;
            a2 = max((vthresh2-abs(dir))/vthresh2,0.0f)
						
            a = min(max(max(a0,a1),a2),1.0f)
						
            final_value = (1.0-a)*fh + a*cint


        ** If sclip is supplied, cint is the corresponding value from sclip. If sclip isn't supplied,
           then vertical cubic interpolation is used to create it.


   threads (default: 0):

      Sets the number of threads used by openmp.

         0 = default (environment variable OMP_NUM_THREADS)
         > 0 = calls omp_set_num_threads(threads)
Any other optimization would not be very easy so I'm not going to try .

Last edited by tritical; 24th June 2010 at 19:45.
tritical is offline   Reply With Quote
Old 24th June 2010, 20:06   #211  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
AWESOME! I've been waiting for this.
Gser is offline   Reply With Quote
Old 24th June 2010, 20:11   #212  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Are we still supposed to use it like this:
Code:
eedi3(sclip=nnedi2())
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 25th June 2010, 02:45   #213  |  Link
Bi11
Architect
 
Bi11's Avatar
 
Join Date: May 2010
Posts: 57
Thanks a lot for the multithreaded EEDI3!

Now I can do fine deinterlacing using supersampling with TGMC (in reasonable time ), like so:
Code:
 \   : (EdiMode=="EEDI3_SS")  ? clp.eedi3(field=-2, sclip=clp.nnedi3(field=-2)).eedi3_rpow2(rfactor=2, cshift="spline64resize").eedi3().spline64resize(clp.width, clp.height)
The output is very smooth, having continuous curves with no trace of combing, and is virtually flicker-free, which makes for an easily compressible encode.
It's as though the supersampled use of eedi3 acted as a "precision denoiser" - reconstructing lines if pixels can connect, else it blurs those "random" pixels - resulting in a rather stable clip.
Makes me wonder how to configure eedi3 into a general "edge reconstructor + denoiser".

Quote:
Originally Posted by LoRd_MuldeR View Post
Are we still supposed to use it like this:
Code:
eedi3(sclip=nnedi2())
Code:
final_value = (1.0-a)*fh + a*cint


        ** If sclip is supplied, cint is the corresponding value from sclip. If sclip isn't supplied,
           then vertical cubic interpolation is used to create it.
In the few videos I tested, sclip=nnedi3() gave less artifacts and connected lines better than not using it, though the actual difference is small.

Last edited by Bi11; 25th June 2010 at 02:55.
Bi11 is offline   Reply With Quote
Old 25th June 2010, 03:52   #214  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Quote:
Are we still supposed to use it like this: eedi3(sclip=nnedi2())
The defaults for vcheck/vthresh0/vthresh1/vthresh2 are configured with that mind. Probably the most important is vthresh2. That literally controls whether to trust eedi3 or sclip (cubic interpolation if sclip isn't given) for small directions (vertical/large slope lines). This part of the explanation for vcheck:

a2 = max((vthresh2-abs(dir))/vthresh2,0.0f)

a = min(max(max(a0,a1),a2),1.0f)
final_value = (1.0-a)*fh + a*cint


Here, dir is literally the inverse slope, as detected by eedi3, at the current pixel location. You can also think of it as the direction of interpolation. So if dir=3, eedi3 is going to form the current pixel by connecting the pixel at x+3 from the line above and x-3 from the line below. If dir was -6 it would be formed by connecting x-6 from the line above and x+6 from the line below. So with vthresh2=4.0 (the default), and ignoring a0/a1, eedi3's interpolated value will get all weight for directions >= 4.0. At 0.0 the sclip value will get all weight. For directions in between you get a weighted average. The reason is I trust nnedi2/nnedi3 more for small directions than eedi3 (the reason is most image structures that can't be fit by eedi3's interpolation model will have small directions), but I trust eedi3 more for large directions. If you don't use sclip=nnedi3/nnedi2 then vthresh2 should really be adjusted... for example if sclip isn't given and cubic interpolation is used I would lower it to 3 or 2 probably... maybe 1. Also the other reliability checks determine whether eedi3's detected direction is accurate or not. If it's determined not to be accurate then sclip is the follow over (it does a weighted average between the two based on how inaccurate eedi3 is)... so the more accurate sclip is the more accurate the final output will be.

Last edited by tritical; 25th June 2010 at 03:56.
tritical is offline   Reply With Quote
Old 25th June 2010, 08:52   #215  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 704
Quote:
\ : (EdiMode=="EEDI3_SS") ? clp.eedi3(field=-2, sclip=clp.nnedi3(field=-2)).eedi3_rpow2(rfactor=2, cshift="spline64resize").eedi3().spline64resize(clp.width, clp.height)
got error if itry it.
eedi3_rpow2: error using env -> invoke (function not found)!
Terka is offline   Reply With Quote
Old 25th June 2010, 10:56   #216  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
spline64resize is part of avisynth 2.6 iirc. Use spline36resize if you're still using 2.5, or install newresizers plugin.
foxyshadis is offline   Reply With Quote
Old 25th June 2010, 11:25   #217  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Spline64Resize is also present in Avisynth 2.58, but not in 2.57 or the MT version derived from it.
Gavino is offline   Reply With Quote
Old 25th June 2010, 13:21   #218  |  Link
Terka
Registered User
 
Join Date: Jan 2005
Location: cz
Posts: 704
Thank you, spline36 works! but nnedi2 is still better for me, both for quality and of course for speed.

Last edited by Terka; 25th June 2010 at 13:23.
Terka is offline   Reply With Quote
Old 25th June 2010, 14:25   #219  |  Link
markanini
Registered User
 
Join Date: Apr 2006
Posts: 299
what can one expect when running nnediX in eediX compared to pure nnediX? Would results be in-between nnedi and eedi?

Last edited by markanini; 25th June 2010 at 14:27. Reason: More clear Q stated
markanini is offline   Reply With Quote
Old 25th June 2010, 16:41   #220  |  Link
Great Dragon
Registered User
 
Great Dragon's Avatar
 
Join Date: Feb 2005
Location: Ukraine, Lviv
Posts: 121
Quote:
Now I can do fine deinterlacing using supersampling with TGMC (in reasonable time ),
It is slow as hell. It takes 2 mins to process one frame on my Q6600 with all 4 cores loaded for 100%.
But if you hold your breath and wait till it finished you'll be happily surprised about quality.

Default TGMC

EEDI3_SS with nnedi2

Last edited by Great Dragon; 30th August 2010 at 15:43.
Great Dragon 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 11:14.


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