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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st March 2022, 14:30   #1  |  Link
irlnic
Registered User
 
Join Date: Feb 2022
Posts: 4
A script I improve simply may be better than Decimate?

There is the original script.https://forum.doom9.org/showthread.p...50#post1582950
Thank Sp00kyFox!It's based on his script.
Code:
luma   = tfm(pp=0, slow=2)
chroma = vinverse().Srestore(omode="PP3", cache=4)

# manual sync: figure out which frame (previous,current aka p,c) of 'chroma' clip is most similar to current frame of 'luma' clip

# 46*log(|x-y|+1) uses the full [0,255]-range and scales little differences better than |x-y|*2
diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *")
diffc = mt_lutxy(luma,chroma,                  "x y - abs 1 + log 46 *")

# average difference between compared frames
mp = mt_lutf(diffp,diffp,"avg",expr="x")
mc = mt_lutf(diffc,diffc,"avg",expr="x")

# build conditional masks based on the caculated comparisons
maskp = mt_lutxy(mp,mc,"x y < 255 0 ?")

# finally merge the luma of the tfm with the chroma of the srestore clip accordingly to the binary mask
p = MergeChroma(luma,chroma).mt_merge(chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3)
#irlnic:the result is interlaced frames are replaced by previous frames

#the following are what I write
#replace interlaced frames with next frames in the clip
n = p.selectevery(1,1)
n = ConditionalFilter(src,n,p,"IscombedTIVTC","=","true")

#delete surplus frames by pattern of telecine I find
Interleave(p,n)
SelectEvery(5 ,0,1,2,3)
SelectEvery(2 ,0)
Sent my appreciation to Doom9's Forum!It works well for me!I will be glad if it can help some people!

Last edited by irlnic; 2nd March 2022 at 06:05.
irlnic is offline   Reply With Quote
Old 1st March 2022, 15:42   #2  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
Can you explain the idea. I lack some filter so I can't test it. Also, a sample source and the filtered one would be nice.
Ceppo is offline   Reply With Quote
Old 1st March 2022, 17:22   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
I lack some filter so I can't test it.
Code:
chroma = vinverse2().Srestore(omode="PP3", cache=4)
diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *")
You probably lack "luma" clip too, as it seems to be gotten by some kind of magic.
Maybe post the full script irlnic.

EDIT: Also irlnic, wrap code in code tags, looks better, [retains indent formatting] ie,

[CODE]
some code stuff.
[/CODE]

looks like
Code:
some code stuff.
and forum TAB step setting is 8, [I use TAB step = 4 in windows text editor and have to convert to SPACE's to look correct on forum]

and welcome to the forum.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 1st March 2022 at 17:36.
StainlessS is offline   Reply With Quote
Old 1st March 2022, 17:39   #4  |  Link
irlnic
Registered User
 
Join Date: Feb 2022
Posts: 4
Quote:
Originally Posted by Ceppo View Post
Can you explain the idea. I lack some filter so I can't test it. Also, a sample source and the filtered one would be nice.
Well,I'm not very good at English writing,but I have a try.If I can't explan it very well,please forgive me.

There is the original script.https://forum.doom9.org/showthread.php?t=165357

After I used Sp00kyFox's script(I don't know how it work),I found the result is interlaced frames are replaced by previous frames(because of selectevery(1,-1)).

At the same time,I might find regularity of telecine as well.

then I write
Code:
n = p.selectevery(1,1)
n = ConditionalFilter(b,n,p,"IscombedTIVTC","=","true")
to replace interlaced frames with next frames.

by using the regularity,I write
Code:
Interleave(p,n)
SelectEvery(5 ,0,1,2,3)
SelectEvery(2 ,0)
It's also the core of my idea.
It's not very easy for me to explan what is the regularity in English,but I think you can get it after reading this part and apply it to a sample source on the paper.

All in all, except 3:2 pull down,all interlaced frames are surplus.all I want to do is to delete them directly.Luckily,"3:2 pull down" can be solved by Sp00kyFox's script.

Last edited by irlnic; 1st March 2022 at 18:52.
irlnic is offline   Reply With Quote
Old 1st March 2022, 18:12   #5  |  Link
irlnic
Registered User
 
Join Date: Feb 2022
Posts: 4
Quote:
Originally Posted by StainlessS View Post
Code:
chroma = vinverse2().Srestore(omode="PP3", cache=4)
diffp = mt_lutxy(luma,chroma.selectevery(1,-1),"x y - abs 1 + log 46 *")
You probably lack "luma" clip too, as it seems to be gotten by some kind of magic.
Maybe post the full script irlnic.

EDIT: Also irlnic, wrap code in code tags, looks better, [retains indent formatting] ie,

[CODE]
some code stuff.
[/CODE]

looks like
Code:
some code stuff.
and forum TAB step setting is 8, [I use TAB step = 4 in windows text editor and have to convert to SPACE's to look correct on forum]

and welcome to the forum.
Thank you very much for your advice and warm welcome!I'm really new there.I have also seen many your replies,from which I have learned much!Thank you for that as well!Give my best respect to you!
irlnic is offline   Reply With Quote
Old 1st March 2022, 20:34   #6  |  Link
Ceppo
Registered User
 
Join Date: Feb 2016
Location: Nonsense land
Posts: 339
Sorry irlnic, I didn't notice it was your first post/message. Well welcome!
Quote:
You probably lack "luma" clip too, as it seems to be gotten by some kind of magic.
I was just too lazy to download srestore

Anyway, irlnic, max tomorrow and I will give you my feedback.

Quote:
It's not very easy for me to explan what is the regularity in English
Maybe you mean pattern?

EDIT:
BTW do you have a small sample with field blending on chroma? I don't have any and the original script is meant for that and yours seems too.

Last edited by Ceppo; 1st March 2022 at 21:05.
Ceppo is offline   Reply With Quote
Old 2nd March 2022, 00:40   #7  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,148
Just copy/paste
https://github.com/realfinder/AVS-St.../Srestore.avsi
kedautinh12 is offline   Reply With Quote
Old 2nd March 2022, 04:31   #8  |  Link
irlnic
Registered User
 
Join Date: Feb 2022
Posts: 4
Quote:
Maybe you mean pattern?
Yeah,I think "pattern" is accurate expression.

Quote:
BTW do you have a small sample with field blending on chroma?I don't have any.
Sorry...I deleted relevant source weeks ago...
But this isn't problem of source.It occurs after TFM.There are some similar threads you can find in the forum.

Last edited by irlnic; 2nd March 2022 at 06:07.
irlnic is offline   Reply With Quote
Reply

Tags
ivtc

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 04:25.


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