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. |
12th June 2009, 02:36 | #1 | Link |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
nnedi2/nnedi3/eedi3
nnedi3 v0.9.4
nnedi3 v0.9.2 - 64-bit eedi3 v0.9.1 nnedi2 v1.6 Filter operation is the same as nnedi... how it accomplishes the task is improved - hopefully. Syntax is almost the same - removed one parameter, added two new ones. 4x enlargement examples with spline36, nnedi, and nnedi2 are here: (nnedi/nnedi2 were used on r/g/b planes, nnedi2 used qual=3, spline36 was used on rgb) http://bengal.missouri.edu/~kes25c/nnedi2_images Differences are best seen if you quickly flip back and forth between images. Improvement over nnedi isn't huge by any means, but I thought it was enough to finally warrant a new release. Last edited by tritical; 10th June 2011 at 20:12. |
12th June 2009, 04:14 | #3 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,714
|
Holy Cow Batman! I would definitely say that there is a noticeable difference. Atleast with still images anyways.
__________________
FAQs:Bond's AVC/H.264 FAQ Site:Adubvideo Zsmooth - Cross-platform smoothing for Vapoursynth Last edited by Adub; 1st July 2010 at 17:21. |
12th June 2009, 09:50 | #9 | Link |
Registered User
Join Date: Jan 2005
Location: cz
Posts: 704
|
just added
# Create spatially interpolated bob-clips dbob = clp.bob(0,0.5) edi = (EdiMode=="NNEDI") ? clp.nnedi(field=-2) \ : (EdiMode=="EEDI2") ? clp.SeparateFields().EEDI2(field=-2, maxd=EEDI2maxd) \ : (EdiMode=="NNEDI2")? clp.nnedi2(field=-2) \ : (EdiMode=="Yadif") ? clp.Yadif(mode=1) \ : dbob speed of TGMC looks +- the same, maybee a bit faster. !good work tritical! |
12th June 2009, 11:14 | #12 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,433
|
Thanks for this, Tritical - good work!
One question which has puzzled me about nnedi (and now nnedi2): With YV12 clips, simply interpolating between the original pixels introduces a chroma shift of 1/4 pixel. Is this too small to worry about? |
12th June 2009, 18:33 | #13 | Link | |||
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Quote:
Quote:
Quote:
If you follow that with a turnleft or turnright and another dh=true it gets more complicated. Since horizontally the chroma samples are aligned with the left pixel in each pair in the original image, everything should be fine if you use field=1 in the subsequent nnedi2(dh=true) call. However, another shift would be introduced if you use field=0. That also applies to yuy2 since it has the same horizontal subsampling as yv12. From that point if you rotate the image back, so that you have a 2x enlargement, there will be a vertical shift in chroma. If instead you rotate the image again in the same direction and make another dh=true call, I think there is the possibility to cancel part of the vertical shift or introduce even more vertical shift depending on how you set 'field'. I'll try to modify the avs functions in the help file to minimize chroma shift when enlarging yv12/yuy2. Last edited by tritical; 12th June 2009 at 18:37. |
|||
12th June 2009, 19:57 | #14 | Link | ||
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,433
|
Quote:
Quote:
Conversely, for the horizontal resizings, you need to use field=0 if doing TurnLeft.Nnedi2().TurnRight() and field=1 for TurnRight().Nnedi2().TurnLeft(). In either of these cases, there will be no shift at all. EDIT: Arghh, the vertical doubling case is not so simple once you move beyond 4x. It turns out that for a chain of vertical doublings, the way to minimise the shift is to have field=0 for the first one and field=1 for all the others, or vice versa (start with field=1 and use field=0 for the others). So for 8x, use fields (0, 1, 1) or (1, 0, 0). Last edited by Gavino; 13th June 2009 at 08:53. Reason: Vertical doubling of more than 4x |
||
13th June 2009, 10:29 | #15 | Link | |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Quote:
Say you start with field=1, that introduces an upwards shift. turnright() and use field=1 because chroma is aligned with the top field luma... so that doesn't introduce any shift. turnright() again, and the image is now upside down (and flipped horizontally). Since the first call introduced an upwards shift we want to introduce a downwards shift by using field=1 to shift the upside down image upwards. turnright() again, and use field=0 because chroma is aligned with bottom field luma, which introduces no shift. turnright() the final time and the image is enlarged 4x with chroma shifted 1/2 pixel (at 4x scale) upwards relative to luma. Right or wrong |
|
13th June 2009, 11:24 | #16 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,433
|
Right. Indeed, we're both right.
You are essentially using the same approach as me, but doing things in a different order. I was applying the vertical doublings without rotation, so using a different field for the second one. In your case, the second doubling is done on an upside-down image, so you use the same field. And changing the field used for the horizontal doubling is consistent with my description, since the field to use depends on whether you have turned left or right. For the 8x case using your approach, if you started with field 1, you would continue with nnedi(0, dh=true).turnright().nnedi(1, dh=true).turnleft |
13th June 2009, 11:46 | #17 | Link |
ffdshow/AviSynth wrangler
Join Date: Feb 2003
Location: Austria
Posts: 2,441
|
Wouldn't it be possible for your filter to have a dedicated function that'll internally enlarge the image a given number of times in both directions with non-subsampled chroma?
np: Lali Puna - B-Movie (Faking The Books)
__________________
now playing: [artist] - [track] ([album]) |
13th June 2009, 19:51 | #19 | Link |
Registered User
Join Date: Feb 2004
Posts: 1,348
|
nnedi is basid on training a neural net to interpolate a specific spatial position very well, If nnedi2 is based on the same principles, it would be quite dificult to change its interpolation operation. It would also most likely end up two times slower.
|
13th June 2009, 23:10 | #20 | Link | |||
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
Quote:
Quote:
Quote:
On that note, v1.1 changes (zip file is at the same location). Code:
+ added RGB24 support + added nnedi2_rpow2 function + faster SSE2 routines nnedi2_rpow2(int rfactor, int qual, bool pscrn, string cshift, int fwidth, int fheight, int threads, int opt) It will use nnedi2 to enlarge by a power of 2 (rfactor) while minimizing relative luma/chroma shifting as much as possible. With a secondary goal of minimizing image center shifting when possible. It can then automatically correct for any image center shifting using the resizer you specify with 'cshift', and if you do specify 'cshift' it also gives you the option to set a new output width/height (fwidth/fheight). It works with yv12, yuy2, rgb24. Examples: enlarge image by 4x, don't correct for center shift. nnedi2_rpow2(rfactor=4) enlarge image by 2x, correct for center shift using spline36resize. nnedi2_rpow2(rfactor=2,cshift="spline36resize") enlarge image by 8x, correct for center shift and downsample from 8x to 7x using lanczosresize. nnedi2_rpow2(rfactor=8,cshift="lanczosresize",fwidth=width*7,fheight=height*7) Last edited by tritical; 13th June 2009 at 23:15. |
|||
Thread Tools | Search this Thread |
Display Modes | |
|
|