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 25th February 2022, 23:29   #1  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
Feedback on this nnedi3 script

I had an idea, the idea is to compensate the interpolated field from nnedi3 while keeping the original field untouched. If you could give me some feedback on this. I tested it only on telecined material, I don't know if it works on pure interlaced stuff.
nnedi3(-2)
Script
Code:
nnedi3(-2)
src = last
dClip1 = Interleave(Trim(1,0),last,Trim(1,0)).ex_ReduceFlicker(3,true).SelectEvery(3,1)
dClip2 = Interleave(DuplicateFrame(0),last,DuplicateFrame(0)).ex_ReduceFlicker(3,true).SelectEvery(3,1)
aClip1 = mt_average(dClip1.Trim(1,0),dClip1.DuplicateFrame(0),u=1,v=1)
aClip2 = mt_average(dClip2.Trim(1,0),dClip2.DuplicateFrame(0),u=1,v=1)
sClip1 = mt_makediff(aClip1,dClip1,u=1,v=1).mt_edge("sobel",3,3,u=1,v=1)
sClip2 = mt_makediff(aClip2,dClip2,u=1,v=1).mt_edge("sobel",3,3,u=1,v=1)
ScriptClip("""
A = AverageLuma(sClip1)
B = AverageLuma(sClip2)
A > B ? dClip1 : dClip2
""")
dClp = last
bEvn = SeparateFields().SelectEven()
bOdd = SeparateFields().SelectOdd()
nEvn = src.SeparateFields().SelectEven()
nOdd = src.SeparateFields().SelectOdd()
Interleave( \
Interleave(nEvn,bOdd).Weave().SelectEven(),\
Interleave(bEvn,nOdd).Weave().SelectOdd())
Ceppo is offline   Reply With Quote
Old 26th February 2022, 17:27   #2  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Your result looks excellent, I will try it with some samples I have
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 26th February 2022, 21:25   #3  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
Thanks!
Ceppo is offline   Reply With Quote
Old 26th February 2022, 22:27   #4  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
seems it not work well with 60i

tested with these samples https://forum.doom9.org/showthread.p...37#post1379837
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 26th February 2022, 23:03   #5  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
Code:
nnedi3(-2)
src = last
dClip1 = Interleave(Trim(1,0),last,Trim(1,0)).ex_ReduceFlicker(3,true).SelectEvery(3,1)
dClip2 = Interleave(DuplicateFrame(0),last,DuplicateFrame(0)).ex_ReduceFlicker(3,true).SelectEvery(3,1)
aClip1 = mt_average(dClip1.Trim(1,0),dClip1.DuplicateFrame(0),u=1,v=1)
aClip2 = mt_average(dClip2.Trim(1,0),dClip2.DuplicateFrame(0),u=1,v=1)
sClip1 = mt_makediff(aClip1,dClip1,u=1,v=1).mt_edge("sobel",3,3,u=1,v=1)
sClip2 = mt_makediff(aClip2,dClip2,u=1,v=1).mt_edge("sobel",3,3,u=1,v=1)
ScriptClip("""
A = AverageLuma(sClip1)
B = AverageLuma(sClip2)
A > B ? dClip1 : dClip2
""")
dClp = last
bEvn = SeparateFields().SelectEven()
bOdd = SeparateFields().SelectOdd()
nEvn = src.SeparateFields().SelectEven()
nOdd = src.SeparateFields().SelectOdd()
Interleave( \
Interleave(nEvn,bOdd).Weave().SelectEven(),\
Interleave(bEvn,nOdd).Weave().SelectOdd())
comp = last
mt_lutxy(vinverse(),"x y - abs 5 > 255 x ?",u=1,v=1)
ScriptClip("""
AverageLuma() > AverageLuma(comp) + 0.25 ? src : comp
""")
Seems to fix it.
Ceppo is offline   Reply With Quote
Old 27th February 2022, 03:29   #6  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
Improved!
Code:
nnedi3(-2)
src = last
bClip1 = mt_average(Trim(1,0),u=3,v=3)
bClip2 = mt_average(DuplicateFrame(0),u=3,v=3)
aClip1 = mt_average(bClip1.Trim(1,0),bClip1.DuplicateFrame(0),u=1,v=1)
aClip2 = mt_average(bClip2.Trim(1,0),bClip2.DuplicateFrame(0),u=1,v=1)
sClip1 = mt_makediff(aClip1,bClip1,u=1,v=1).mt_edge("sobel",3,3,u=1,v=1)
sClip2 = mt_makediff(aClip2,bClip2,u=1,v=1).mt_edge("sobel",3,3,u=1,v=1)
ScriptClip("""
A = AverageLuma(sClip1)
B = AverageLuma(sClip2)
A > 10 && B > 10 ? src : A > B ? bClip1 : bClip2
""")
dClip = last
bEvn = SeparateFields().SelectEven()
bOdd = SeparateFields().SelectOdd()
nEvn = src.SeparateFields().SelectEven()
nOdd = src.SeparateFields().SelectOdd()
Interleave( \
Interleave(nEvn,bOdd).Weave().SelectEven(),\
Interleave(bEvn,nOdd).Weave().SelectOdd())
Ceppo is offline   Reply With Quote
Old 27th February 2022, 18:10   #7  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
it better but the 60i problem is back

also I did test it against BWDIF(-2,nnedi3(-2)), BWDIF(-2,nnedi3(-2)) win, more exciting I note yadifmod2(mode=3, edeint=nnedi3(-2)) work better in Anime (less shimmer) than BWDIF
__________________
See My Avisynth Stuff

Last edited by real.finder; 28th February 2022 at 00:13.
real.finder is offline   Reply With Quote
Old 27th February 2022, 22:59   #8  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
Quote:
it better but the 60i problem is back
Code:
A > 10 && B > 10
You need to tune that "10" to fix that.

Quote:
also I did test it against BWDIF(-2,nnedi3(-2)), BWDIF(-2,nnedi3(-2)) win, more exciting I note yadifmod2(mode=3, nnedi3(-2)) work better in Anime (less shimmer) than BWDIF
Good :O
Ceppo 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 06:06.


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