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 11th July 2012, 13:31   #1  |  Link
Sp00kyFox
Registered User
 
Sp00kyFox's Avatar
 
Join Date: Aug 2007
Posts: 79
after IVTC'ing anime material still some combed frames left

hello there

have some trouble here to ivtc batman the animated series. tried the following usual combo:

Code:
tfm(chroma=true, pp=0, slow=2)
tdecimate(mode=1)
result is ok except for some residual interlaced frames. with pp=5 it gets rid of the combing but there is some chroma overlapping (left pp0, right pp5):



thought about srestore (doubleblend removal) with blur or vinverse as a preprocessing step:

Code:
vinverse() #or blur(0,1)
Srestore(omode="PP3")
but since tfm mostly finds good matches the quality is siginificantly worse than the tfm.tdecimate clip in the non-combed frames.
so the last thing I tried was to combine both clips with conditionalfilter. only to use frames of the srestore clip on still combed frames of the tfmclip.
but since the frames doesn't match exactly it introduces jerky movement on cam panning:

Code:
ConditionalFilter(tfm, sres, tfm, "IsCombedTIVTC(chroma=true)", "=", "true")
tdecimate(mode=1)
well I ran out of ideas.
hope you can help me with the problem.

I uploaded the intro of an episode as a sample (35MB):
http://mir.cr/14HLXHXE
Sp00kyFox is offline   Reply With Quote
Old 11th July 2012, 14:35   #2  |  Link
librarian
Registered User
 
Join Date: Nov 2011
Posts: 63
I think this script may be effectve:


Code:
blur(0,1)#.sharpen(0,0.7)# perhaps
fixblendivtc()
decimate()
librarian is offline   Reply With Quote
Old 11th July 2012, 14:58   #3  |  Link
Sp00kyFox
Registered User
 
Sp00kyFox's Avatar
 
Join Date: Aug 2007
Posts: 79
@librarian
that's nearly the same solution like my vinverse/blur.srestore-try with the same described problems.
besides that fixblend seems to produce worse results than srestore. look at frame 333 with your script (the eyes):

Sp00kyFox is offline   Reply With Quote
Old 11th July 2012, 15:17   #4  |  Link
librarian
Registered User
 
Join Date: Nov 2011
Posts: 63
I cannot get your result. This is my output:

http://www.imagebanana.com/view/83a5uytn/frame333.png

Last edited by librarian; 11th July 2012 at 15:20.
librarian is offline   Reply With Quote
Old 11th July 2012, 15:41   #5  |  Link
Sp00kyFox
Registered User
 
Sp00kyFox's Avatar
 
Join Date: Aug 2007
Posts: 79
yeah you're right. the error was probably caused by non-linear order of frame serving.
I used vdub to preview the avs. put in a requestlinearorder after fixblendivtc and its ok now.

poblem still remains: because of the preprocessing step for the blend removal there is a loss in
sharpness and detail in fine textured areas compared to the tfm.tdecimate clip.

edit: my script for now with the best results:

Code:
DGDecode_mpeg2source("VTS_01_1.d2v")
ColorMatrix(d2v="VTS_01_1.d2v", threads=0, interlaced=true)

vinverse().Srestore(omode="PP3", cache=10)
tdecimate(mode=1)
any suggestions?

Last edited by Sp00kyFox; 12th July 2012 at 14:32.
Sp00kyFox is offline   Reply With Quote
Old 15th July 2012, 23:53   #6  |  Link
Sp00kyFox
Registered User
 
Sp00kyFox's Avatar
 
Join Date: Aug 2007
Posts: 79
came up with a solution while searching through the interwebs. maybe it can help someone else.
here is the commented code (based on Didée), you still have to add extra filters for any other artifacts or picture enhancements:

Code:
luma   = tfm(pp=0, slow=2)
chroma = vinverse().Srestore(omode="PP3", cache=10)

# 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
MergeChroma(luma,chroma).mt_merge(chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3)

tdecimate(mode=1)



# debug output. check calculations and decisions

#stackhorizontal(stackvertical(maskp,luma)\
#,stackvertical(chroma.selectevery(1,-1),chroma))

#stackhorizontal(stackvertical(diffp,diffc)\
#,stackvertical(mp,mc))
you can verify that you have the same problem with the following two lines. look for field blendings in the chroma plane:

Code:
separatefields.bilinearresize(width,height)
stackvertical(last.greyscale(),stackhorizontal(last.utoy(),last.vtoy()))
edit:
simplified the code (only current or previous frame is necessary) and change to a better frame distance norm. since after every calculation the result is rounded to the next integer in [0,255] it's better to scale it logarithmically, otherwise small differences are indistinguishable. the constant factor 46 is there to stretch the value to our luma range.

Last edited by Sp00kyFox; 20th July 2012 at 00:45.
Sp00kyFox is offline   Reply With Quote
Old 29th July 2012, 09:30   #7  |  Link
DragonM
Registered User
 
Join Date: Jul 2007
Posts: 4
Quote:
Originally Posted by Sp00kyFox View Post
came up with a solution while searching through the interwebs. maybe it can help someone else.
here is the commented code (based on Didée), you still have to add extra filters for any other artifacts or picture enhancements:

Code:
luma   = tfm(pp=0, slow=2)
chroma = vinverse().Srestore(omode="PP3", cache=10)

# 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
MergeChroma(luma,chroma).mt_merge(chroma.selectevery(1,-1),maskp,luma=true,Y=2,U=3,V=3)

tdecimate(mode=1)



# debug output. check calculations and decisions

#stackhorizontal(stackvertical(maskp,luma)\
#,stackvertical(chroma.selectevery(1,-1),chroma))

#stackhorizontal(stackvertical(diffp,diffc)\
#,stackvertical(mp,mc))
you can verify that you have the same problem with the following two lines. look for field blendings in the chroma plane:

Code:
separatefields.bilinearresize(width,height)
stackvertical(last.greyscale(),stackhorizontal(last.utoy(),last.vtoy()))
edit:
simplified the code (only current or previous frame is necessary) and change to a better frame distance norm. since after every calculation the result is rounded to the next integer in [0,255] it's better to scale it logarithmically, otherwise small differences are indistinguishable. the constant factor 46 is there to stretch the value to our luma range.
This really seems to help with a video I have. The video I have has chroma blends quite often, especially at scenechanges it happens a lot. There's also one particular scene where it doesn't fix all of them, but I'm not sure what to change in this script to possibly improve it. I could post a sample clip of that particular scene later.
DragonM is offline   Reply With Quote
Old 24th August 2012, 13:34   #8  |  Link
Sp00kyFox
Registered User
 
Sp00kyFox's Avatar
 
Join Date: Aug 2007
Posts: 79
Quote:
Originally Posted by DragonM View Post
This really seems to help with a video I have. The video I have has chroma blends quite often, especially at scenechanges it happens a lot. There's also one particular scene where it doesn't fix all of them, but I'm not sure what to change in this script to possibly improve it. I could post a sample clip of that particular scene later.
a sample clip would be helpful. besides that the main core of the script is the srestore call. and this function only fixes double blends. if you have scenes with triple (or more) blendings you're pretty much screwed. well at least I don't know how to fix those. I guess that's the problem in your case. (or you have to tweak the difference norm)

Last edited by Sp00kyFox; 25th August 2012 at 11:23.
Sp00kyFox is offline   Reply With Quote
Old 14th February 2013, 16:20   #9  |  Link
x265
Registered User
 
Join Date: Oct 2012
Posts: 176
I have these DVD's, i will try this script.
x265 is offline   Reply With Quote
Old 22nd November 2020, 19:38   #10  |  Link
lordsmurf
Registered User
 
lordsmurf's Avatar
 
Join Date: Jan 2003
Posts: 124
My source is a 29.97 cartoon with bad interlace resizing.
A TFM().TDecimate() removed most of the interlace, but there are chroma ghosting and linear chroma leftovers in some frames.

I attempted to run the above script, but I get this:
Code:
Average: all clips must be have same or greater number of frames as the first one.
(Srestore.avsi, line 53)
(New File (1), line 12)
What's causing this?
lordsmurf is offline   Reply With Quote
Old 22nd November 2020, 21:10   #11  |  Link
SaurusX
Registered User
 
Join Date: Feb 2017
Posts: 134
Quote:
Originally Posted by lordsmurf View Post

What's causing this?
I’ve found that srestore v27h is the best to use with animated material. Far more effective. And other versions will cause the error you’re encountering. I’ve ALSO had problem getting 27h to run with “pp3” in 64bit. 32bit only for this case
SaurusX 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 15:59.


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