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 2nd August 2017, 20:41   #21  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Just to be clear, while I'd love to take creidt for RemoveDirtMC, I did not develop it. I did, however, re-discover it and found that it was amazing for removing dirt from film transfers. I then spent quite a bit of time tweaking parameters for that particular purpose (and also developed set of hyper-aggressive settings for Polavision instant movie film).
johnmeyer is offline   Reply With Quote
Old 2nd August 2017, 21:35   #22  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
No problem John, the function I met thanks to you, in which you worked hard. I actually put "adapted".
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 22nd August 2020, 17:39   #23  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Didée post earlier in this thread.

Quote:
Originally Posted by Didée View Post
For what it's worth, here is a possible primitive for spot removal:

Code:
AviSource("D:\sample_spotty.avi")              

o=last ox=o.width() oy=o.height()

osup = o.MSuper(pel=2,sharp=2)
bv1  = osup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1  = osup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4) 
bc1  = o.MCompensate(osup,bv1)
fc1  = o.MCompensate(osup,fv1)

Interleave(fc1,o,bc1)
MedianblurT(0,0,0,1)   #  you can also use "Clense(reduceflicker=false)" instead
SelectEvery(3,1)

StackHorizontal(o,last)

Nifty mod, SpotLess()
Code:
Function SpotLess(clip c,int "RadT",int "ThSAD2") {
/*
    SpotLess v1.0. temporal spot/noise remover, by StainlessS @ Doom9. https://forum.doom9.org/showthread.php?t=181777
    Original idea from Didée post :-                          https://forum.doom9.org/showthread.php?p=1402690#post1402690
    Req:- Pinterf MvTools2, Pinterf Medianblur2() with MedianBlurTemporal rather than the MedianBlurT() from Didée post.
          With appropriate plugins, will be AVS+ colorspace and x64 compatible.

    NOT FOR cartoon/anime, live video only, sorry.

    RadT, Range 1 -> 6, Default 2. Removes Spots on up to RadT consecutive frames.
        RadT > 2 will usually be overkill. Setting too high could possibly result in blurring [no problems encountered so far at max RadT=6].
    ThSAD2, 400 <= ThSAD2 <= 10000, Default 10000=NEARLY OFF. Lower removes fewer spots, but less chance of blurring.
        Reduce if produces blurred frames, absolute minimum of maybe about 400, probably pretty good as is.
        Lower reduces effect of bad non matching blocks, reduced more so on blocks from more distant radii frames.
        ThSAD for frame @ distance 1 defaults to 10,000 [and we let it default], ThSAD2 sets the SAD [Sum of Absolute Differences] threshold
        for most distant frame at distance RadT, with those frames that are distances in-between being given a SAD threshold linearly spread between the two.
        Wild guess that maybe about 10000 at RadT=1, and 5000 (10000/2) where RadT=6, might be a good compromise if concerned about blurring.
        Suggested, based on wild guesses above :) [if you experience blurred results, otherwise leave as is]
          Where below RadT is 6, and ThSAD2=5000, then blocks @ frames current_frame +- 6 gets weighted SAD threshold value of 5000 (same as ThSAD2),
          @ current_frame +- 3, gets distance weighted SAD threshold value 8000, etc
            Radius  SAD threshold : Where RadT=1, SAD threshold=ThSAD2. Where RadT>1; SAD threshold=(RadT-Radius)*((10000-ThSAD2)/(RadT-1))+ThSAD2; (6-Radius)*((10000-5000)/(6-1))+5000.
            1          10000        10000, Almost switches OFF SAD thresholding at frame distance 1. [Ignores blocks of only really high SAD differences]
            2           9000
            3           8000        In between frames acquire SAD threshold value linearly between 10000 @ distance 1, and ThSAD2[here 5,000] at distance RadT[here 6].
            4           7000
            5           6000
            6           5000        Where RadT=6 and ThSAD2 = 5000, so frame @ distance 6 gets SAD threshold value of ThSAD2[5000]
          And to weight similar to above where eg RadT=3, set RadT=3, ThSAD2=8000 to set as above Radius=3,SAD threshold=8000. Radii 2 and 1 will acquire 9000 and 10000 resp.
        From mvtools2 docs:
          ThSAD is SAD threshold for safe (dummy) compensation.
              If block SAD is above the thSAD, the block is bad, and we use source block instead of the compensated block. Default is 10000 (practically disabled).
          ThSAD2:
              Defines the SAD soft threshold for the furthest frames.
              The actual SAD threshold for each reference frame is a smooth interpolation between the original thSAD (close to the current frame, EDIT: Default 10000)
              and thSAD2. Setting thSAD2 lower than thSAD allows large temporal radii and good compensation for low SAD blocks while reducing the global error and the
              risk of bluring when the result of MCompensate is passed to a temporal denoising filter.
        In SpotLess, we dont actually set mvtools ThSAD arg, only ThSAD2, ThSAD will default 10000, but where RadT=1 and you set ThSAD2 to eg 5000 it should (I hope)
        set soft SAD threshold at radii 1 to ThSAD2 [and override the ThSAD default 10000].
        If anybody can explain above any better, then please do. I hate doing docs and as you can see, I aint very good at it.
*/
    RadT   = Default(RadT,2)                              # Temporal radius
    ThSAD2 = Default(ThSAD2,10000)                        # Setting lower, sets SAD thresold to limit blurring effect of more distant reference frame BAD matching blocks.
    Assert(1 <= RadT <= 6,"SpotLess: 1 <= RadT <= 6")
    sup      = c.MSuper(pel=2,sharp=2)
    MultiVec = sup.MAnalyse(multi=true, delta=RadT,blksize=8,overlap=4,search=4)
    c.MCompensate(sup,MultiVec,tr=RadT,ThSAD2=ThSAD2)
    MedianBlurTemporal(radiusY=0,radiusU=0,radiusV=0,temporalradius=RadT)  # Temporal median blur only
    SelectEvery(RadT*2+1,RadT)                                             # Return middle frame
}
Hacked this for a clip with spots on double frames, did not know if would be much better, but as it turns out is fandabbydozy.

EDIT: MvTools2/MedianBlur2 by Pinterf, so AVS+ colorspace and x64 compatible.
EDIT: I'm not using for cartoons, ie live video [Old B&W WW2 footage].
EDIT: Chosen function name would seem to be a very good choice, not perfect, but very nearly is.
EDIT: BugFix, + Mod RadT up to 6, more than 2 probably overkill but the choice is there.

Now has its own threaad here:- https://forum.doom9.org/showthread.p...73#post1921773

EDIT:
Quote:
Originally Posted by StainlessS View Post
Perhaps someone would like to test SpotLess() on 'old cartoon' which is subject of this thread.
I dont usually touch cartoon/anime at all, and even less 'old cartoon'.
I not sure that Mvtools copes well with cartoon at all.
Quote:
Originally Posted by lansing View Post
It doesn't work on anime, it wiped out all moving objects in motion scenes.
So not much good for cartoon/anime, sorry.
__________________
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; 25th August 2020 at 16:19. Reason: Update
StainlessS is offline   Reply With Quote
Old 22nd August 2020, 18:01   #24  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
You should also try spotless as a prefilter in smdegrain. Worked very good for me with almost zero artifacts left from spotless.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 22nd August 2020, 18:05   #25  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I'm sure that RealFinder will give it a try.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 22nd August 2020, 19:06   #26  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Think may need arg for setting MCompensate(ThSad) esp where at scene change [and RadT=3, can produce bad frame).

Quote:
thSAD is SAD threshold for safe (dummy) compensation.
If block SAD is above the thSAD, the block is bad, and we use source block instead of the compensated block. Default is 10000 (practically disabled).
Not sure what to set it [ThSAD] at, nor if should set separate ThSAD for 2nd vector pair and also for 3rd vector pair compensations.
Think we dont need ThSAD setting for 1st MCompensate vector pair.
Any ideas ??? [10,000 is OFF, what are usable values]

EDIT: Hang on, Just fixed bug in SpotLess, gotta test it again. Fixed in prev post #23.
__________________
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; 23rd August 2020 at 00:04.
StainlessS is offline   Reply With Quote
Old 22nd August 2020, 21:18   #27  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, Spotless() update. think problem was mostly/all self-inflicted, fixed.
Post 23 update.

I'm not seeing any problems so far with this one, even at RadT=6 [and ThSAD2=10,000 ie nearly OFF].

EDIT:
From recent MvTools2, (I added ThSAD2 arg)

Quote:
thSAD2

Define the SAD soft threshold for the furthest frames.
The actual SAD threshold for each reference frame is a smooth interpolation between the original thSAD (close to the current frame)
and thSAD2.
Setting thSAD2 lower than thSAD allows large temporal radii and good compensation for low SAD blocks while reducing the global error
and the risk of bluring when the result of MCompensate is passed to a temporal denoising filter.
I Luv this filter.
So much nicer than that horrid GMJCZP KillerSpots().
__________________
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; 23rd August 2020 at 00:38.
StainlessS is offline   Reply With Quote
Old 23rd August 2020, 03:17   #28  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StainlessS View Post
I'm sure that RealFinder will give it a try.
yes

Quote:
Originally Posted by ChaosKing View Post
You should also try spotless as a prefilter in smdegrain. Worked very good for me with almost zero artifacts left from spotless.
do you have a video sample?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 23rd August 2020, 05:37   #29  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
do you have a video sample?
SendSpace, below in sig. VTS_01_1.demuxed.m2v 30 secs.

Code:
Mpeg2source(".\VTS_01_1.demuxed.d2v")
ORG=Last
SpotLess(RadT=2)
StackHorizontal(ORG,Last)
__________________
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; 23rd August 2020 at 06:03.
StainlessS is offline   Reply With Quote
Old 23rd August 2020, 07:31   #30  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StainlessS View Post
SendSpace, below in sig. VTS_01_1.demuxed.m2v 30 secs.

Code:
Mpeg2source(".\VTS_01_1.demuxed.d2v")
ORG=Last
SpotLess(RadT=2)
StackHorizontal(ORG,Last)


yes, it's do better job than any methods, I was using this

Code:
RemoveDirtMC_SE(twopass=false,dct=4,mcthSAD=2800,resrepmode=16,repmode=0,clmode=0,rstr=1.5,PreNR=FFT3DFilter(sigma=4,plane=4,bw=16,bh=16,ow=8,oh=8,bt=3,wintype=1).ColorYUV(autogain=true).TemporalDeGrain_SE(5,9))
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 23rd August 2020, 15:14   #31  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, me thinks I set description of RadT wrong, was probably correct-ish the first time around. This bit.
Code:
    RadT Range 1 -> 6, Default 2. RadT > 2 will usually be overkill. Setting too high could remove fast moving non spot objects.
        RadT = 1: Remove spots on single frame only.
        RadT = 2: Remove spots on up to 3 consecutive frames. Seems pretty reliable. [Default]
        RadT = 3: Remove spots on up to 5 consecutive frames. Possibly many false spots removed. [Needs testing]
        RadT = n: Remove Spots on up to 2n-1 consecutive frames.
As it is Median, and number of frames spanned is ODD and 2*RadT+1 (the 1 being current frame), so max number of frames where spot can occur is
maybe I think RadT (as I previously stated), with max bad count being RadT and good having to be at least RadT+1 to fix it.

So number of consecutive frames on which spot can occur is RadT.

Would that sound about right to anybody ? [if so I'll mod description as so]

EDIT: @ 05:30AM this morning, I thought would fix all between outer frames, which is obviously wrong for median.

EDIT: Maybe summick like this
Code:
    RadT Range 1 -> 6, Default 2. Removes Spots on up to RadT consecutive frames.
        RadT > 2 will usually be overkill. Setting too high could possibly remove fast moving non spot objects.
    400 <= ThSAD2 <= 10000, Default 10000=NEARLY OFF. Lower removes fewer spots, but less chance of removing non spot object.
        Reduce if produces bad frames, absolute minimum of maybe about 400, probably pretty good as is.
        Lower reduces effect of bad non matching blocks, more so on blocks from more distant MC frames.
        ThSAD for frame @ distance 1 is always 10,000, ThSAD2 sets ThSAD for most distant frame at distance RadT, with those frames
        that are distances in-between being given a value linearly spread between the two.
        Wild guess that maybe about 10000 at RadT=1, and 5000 (10000/2) where RadT=6, might be a good compromise if concerned about it.
        Suggested, based on wild guesses above :) [if you experience bad results, otherwise leave as is]
          Where RadT below is 6, and ThSAD2=5000, then blocks @ frames current_frame +- 6 gets weighted ThSAD value of 5000 (same as ThSAD2),
          @ current_frame +- 3, gets distance weighted ThSAD value 8000, etc
            Radius     ThSAD    : Where RadT > 1 :: (RadT-Radius) * ((10000-ThSAD2)/(RadT-1)) + ThSAD2 :: (6-Radius) * ((10000-5000)/(6-1)) + 5000
            1          10,000
            2           9,000
            3           8,000    In between frames get ThSAD value between 10000 @ distance 1, to ThSAD2 at distance RadT.
            4           7,000
            5           6,000
            6           5,000    When RadT=6 and ThSAD2 = 5000, so frame @ distance 6 get ThSAD value same as ThSAD2
          And to weight similar to above where eg RadT=3, then set ThSAD2=8000.
Does above make sense ? [suggestions, I'm lousy at explaining things]
__________________
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; 23rd August 2020 at 19:00.
StainlessS is offline   Reply With Quote
Old 23rd August 2020, 17:37   #32  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
This is a wonderful tool. As it happens, I've been cleaning a VHS cap and the silly video has quite a lot of spots and scratches in every other field. SpotLess cleans them up nicely and also takes care of most of the chroma noise too.. I haven't checked things with longer samples but looks good anyway.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 23rd August 2020, 18:36   #33  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yeh but does above make any sense[EDIT: post #31], please comment. [the ThSAD2 stuff]

I'm considering seeing if I can add sharpening, as per McDegrainSharp (optional), maybe could avoid doing 2nd pass with McDegrainSharp() func.
Might not work as required, but I'm gonna have a play, if it dont get added, you know it did not work very well.

EDIT: Also, would SmDegrain/McDegrain be required after SpotLess, it does a pretty good job of removing spots, but also
noise and temporal grain too.
EDIT: OK, maybe SmDegrain/McDegrain would be of benefit I guess, this func does a median [middle value] rather than mean
which smdegrain/mcdegrain would do.
__________________
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; 23rd August 2020 at 18:49.
StainlessS is offline   Reply With Quote
Old 23rd August 2020, 19:28   #34  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
This was the original purpose in knocking up Spotless,
EDIT: Update here:- https://forum.doom9.org/showthread.p...23#post1923123
Code:
### DGIndex Template, HyBrid_PAL.avs
#VideoFileName   ="__vid__"
#AudioFileName   ="__aud__"
#AudioDelay      =Value("__del__")

# Filled in by DGIndex
VideoFileName   ="D:\DVD\PS1\VIDEO_TS\PS1.d2v"
AudioFileName   ="D:\DVD\PS1\VIDEO_TS\PS1 T80 2_0ch 192Kbps DELAY 0ms.ac3"
AudioDelay      =Value("0.000")

###############
# PAL Hybrid Interlaced/Progressive mix, output to singlerate or doublerate.
###############
MPEG2Source(VideoFileName)
AudioExt=RT_GetFileExtension(AudioFileName)

Audio=      (AudioExt==".ac3") ? NICAC3Source(AudioFileName,channels=2,DRC=0)
        \ : (AudioExt==".mpa"||AudioExt=="mp1"||AudioExt==".mp2"||AudioExt==".mp3") ? NicMPG123Source(AudioFileName,Normalize=False)
        \ : (AudioExt==".wav") ? RaWavSource(AudioFileName)
        \ : (AudioExt==".dts") ? NicDTSSource(AudioFileName)
        \ : 0

Assert(!isInt(Audio),"NO AUDIO")

(!isInt(Audio)) ? AudioDub(Audio).DelayAudio(AudioDelay).Trim(0,0) : NOP    # Trim, chop/add audio to length

(!isInt(Audio) && AudioRate() <> 44100) ? ResampleAudio(44100) : NOP
####### CONFIG ##########

AssumeTFF                                                        # Whatever (check) : Almost always TFF for PAL DVD. Default field order is BFF.

OUTPUT = 0      # 0=SingleRate 25FPS Progressive.    Progressive src frames as input, interlaced src frames are even frames from dbl rate deinterlacing.
                # 1=SingleRate 25FPS Hybrid.         Progressive src frames as input, interlaced src frames dbl rate deinterlaced, reinterlaced to 25FPS after processing.
                # 2=DblRate 50fps. Prog=ChangeFPS.   Progressive src frames doubled with ChangeFPS, interlaced src frames are dbl rate deinterlaced.
                # 3=DblRate 50fps. Prog=Interpolate. Progressive src frames double rate interpolated with JohnFPS [ie MvTools], interlaced src frames are dbl rate deinterlaced.

UNSPOT_P=True   # Use SplotLess() on Progressive parts to remove spots and noise.
UNSPOT_I=True   # Use SplotLess() on Interlaced parts to remove spots and noise.

RADT   = 2      # SpotLess temporal radius (spots on 2 consecutive frames)
ThSAD2 = 10000  # Almost OFF.


FRAMES_P=1      # Progressive McDegrainSharp(frames=FRAMES_P), (0=Dont McDegrainSharp)
CSHARP_P=0.6

FRAMES_I=2      # Interlaced McDegrainSharp(frames=FRAMES_I), (Maybe double FRAMES_P for detail migration, although max possible for McDegrainSharp=3).  (0=Dont McDegrainSharp)
CSHARP_I=CSHARP_P

                # IsCombedTIVTC args, all at defaults.
CTHRESH = 10    # Area combing threshold.
                # Valid settings are from -1 (every pixel will be detected as combed) to 255 (no pixel will be detected as combed).
                # This is basically a pixel difference value. A good range is between 8 to 12.
MI      = 85    # Number of combed pixels inside any of the blocky by blockx size blocks on the frame for the frame to be detected as combed.
CHROMA  = true  # Whether or not chroma is considered in the combed frame decision. [We want chroma as interlaced parts in color]
BLOCKX  = 16    # X-axis size of the window used during combed frame detection.
BLOCKY  = 16    # Y-axis size of the window used during combed frame detection.
                # So in any single block, if 85[MI] out of 256[BLOCKX x BLOCKY] pixels pass CThresh as combed, then is Interlaced.

                # Deinterlace mode
BOBMOD=1        # 0=BOB, 1=YadifMod2, 2=QTGMC : QTGMC here is way memory/CPU intensive, req x64. Suggest YadifMod2

BOB_FUNC_0 =    """Bob()"""                                                                                                    # Cheap & cheerful Doublerate simple Bob.
BOB_FUNC_1 =    """YadifMod2(Order=-1,Mode=1,edeint=NNedi3(Field=-2, nns=2))"""                                                # Doublerate Yadifmod2 filter.
                # # Field-2=double rate, internal parity value to start : Order-1=Internal Parity. Mode 1=double rate do spactial check (3=no spatial check).

BOB_FUNC_2 =    """QTGMC(Preset="Slow",NoisePreset="Fast",SourceMatch=2,Lossless=2,EZKeepGrain=0.4,Sharpness=0.1, tr2=0)"""  # Doublerate QTGMC filter.

FUNC       =   Select(BOBMOD, BOB_FUNC_0, BOB_FUNC_1, BOB_FUNC_2)
FNAME      =   Select(BOBMOD,"BOB",      "YADIF",     "QTGMC")


PRE_FETCH=4    # 1 = No Prefetch, Else eg 4 = Prefetch(4) ie MT mode

###            # Display stuff
SUBS   = True  # Show where Deinterlaced/ReInterlaced
STACK  = True # Show Src and Result
TITLE  = False # Show Title Bar
TITNUM = True # Show Frame Number on Title Bar (Only if TITLE)
FINAL  = False # True, switch off SUBS, STACK, and Title

##### End Config ##########

Src=Last

SUBS  = (!FINAL&&SUBS)
TITLE = (!FINAL&&TITLE)
STACK = (!FINAL&&STACK)

PreProc = Src.SpotLess(Radt=RADT,thsad2=ThSAD2) # Remove Spot noise even for double frame spots.

# Interlaced parts
# DeSpot, Deinterlace to doublerate, McDeGrainSharp to migrate detail between original fields[now frames].
PreProc_I = (UNSPOT_I) ? PreProc : Src
Deint=PreProc_I.Eval(FUNC)
Deint=(FRAMES_I>0) ? Deint.McDeGrainSharp(frames=FRAMES_I,csharp=CSHARP_I) : Deint

SUBTXT    = (OUTPUT==0) ? FNAME+"_DEINTERLACED-EVEN" : (OUTPUT==1) ? FNAME+"_RE-INTERLACED" : FNAME+"_DblRate-DEINTERLACED"
PostProc_I = (OUTPUT==0) ? Deint.SelectEven : (OUTPUT==1) ? Deint.SeparateFields.SelectEvery(4,0,3).Weave  : Deint
PostProc_I = (!SUBS) ?  PostProc_I : PostProc_I.Subtitle(SUBTXT,Align=5)

# Progressive parts, Despot, Degrain sharp, still @ singlerate
PreProc_P = (UNSPOT_P) ? PreProc : Src
Prog = (FRAMES_P>0) ? PreProc_P.McDeGrainSharp(frames=FRAMES_P,csharp=CSHARP_P) : PreProc_P
# Progressive to O/P rate
PostProc_P = (OUTPUT==2) ? Prog.ChangeFPS(Src.FrameRateNumerator*2,Src.FrameRateDenominator) : (OUTPUT==3) ? Prog.JohnFPS() : Prog

#################

### IsCombedTIVTC with args, as a string eg "IsCombedTIVTC(cthresh=10,mi=85,chroma=true,blockx=16,blocky=16)"
COMBDET = RT_String("IsCombedTIVTC(cthresh=%d,mi=%d,chroma=%s,blockx=%d,blocky=%d)",CTHRESH,MI,CHROMA,BLOCKX,BLOCKY)

SrcTest = (OUTPUT<=1) ? Src : Src.ChangeFPS(Src.FrameRateNumerator*2,Src.FrameRateDenominator)

# Select Progressive / Deinterlaced frame, based on IsCombedTIVTC detection on original source clip frame.
Result=ConditionalFilter(SrcTest, PostProc_I, PostProc_P, COMBDET,"=","true")


SrcOut = (!TITLE)?SrcTest:(OUTPUT<=1) ? Src.TSub("Source",TITNUM) : Src.TSub("Source DblRate via ChangeFPS, ie dupes",TITNUM).ChangeFPS(Src.FrameRateNumerator*2,Src.FrameRateDenominator)
Result = (!TITLE)?Result :(OUTPUT<=1) ? Result.TSub(String(OUTPUT,"%.0f) Result SingleRate"),TITNUM) : (OUTPUT==2) ? Result.TSub("2) Result DblRate (Progressive frames via ChangeFPS)",TITNUM)
        \ : Result.TSub("3) Result DblRate (Progressive frames via JohnFPS, ie MvTools2)",TITNUM)

(STACK) ? Stackhorizontal(SrcOut, Result) : Result

(PRE_FETCH>1) ? Prefetch(PRE_FETCH) : NOP  # I had problems using x64 and Prefetch [Access Violation], culprit was old IsCombedTIVTC, fixed via Pinterf version.

Return Last

#####################
# Stack Overhead Subtitle Text, with optional FrameNumber shown.
Function TSub(clip c,string Tit,Bool "ShowFrameNo",Int "Col"){
    c.BlankClip(height=20,Color=Default(Col,0))
    (Default(ShowFrameNo,False))?ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))"""):Trim(0,-1).Subtitle(Tit)
    Return StackVertical(c).AudioDubEx(c)
}
Hybrid PAL Progressive/Interlaced, Many double frame Spots, noise. did not want doublerate result [although with above script I now have options].
Spots mainly [but not exclusively] on progressive parts. Interlaced parts color, Progressive B&W.
EDIT: Updated a bit. Output to doublerate, or singlerate Progressive, OR hybrid; Optional Interpolation for Progressive parts, re-Interlace deinterlaced parts [after Processing DeSpot, Deinterlace, McDegrainSharp].

EDIT:
To make into a DGIndex template, remove the comment # from lines 2, 3 and 4, and delete the 3 lines preceded by "# Filled in by DGIndex".
Save the file in your DGIndex "Templates" folder, and to use set DGIndex Menu/Option/AVS Template to point to the template file.
DGIndex will create an avs file, and fill in the VideoFilename, AudioFilename, and AudioDelay with correct data, when you "Save Project".
__________________
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; 14th September 2020 at 16:08. Reason: Update
StainlessS is offline   Reply With Quote
Old 24th August 2020, 16:07   #35  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
SpotLess update post #23, awarded a version of v1.0:- https://forum.doom9.org/showthread.p...83#post1921583

Could probably do with its own thread, if only to be able to point to something in New Plugins thread.
Hope the updated docs make a bit more sense.

EDIT: Changed to v1.0
New thread here:- https://forum.doom9.org/showthread.p...73#post1921773
__________________
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; 24th August 2020 at 16:53.
StainlessS is offline   Reply With Quote
Old 25th August 2020, 15:17   #36  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Perhaps someone would like to test SpotLess() on 'old cartoon' which is subject of this thread.
I dont usually touch cartoon/anime at all, and even less 'old cartoon'.
I not sure that Mvtools copes well with cartoon at all.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 25th August 2020, 15:34   #37  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by StainlessS View Post
Perhaps someone would like to test SpotLess() on 'old cartoon' which is subject of this thread.
I dont usually touch cartoon/anime at all, and even less 'old cartoon'.
I not sure that Mvtools copes well with cartoon at all.
It doesn't work on anime, it wiped out all moving objects in motion scenes.
lansing is offline   Reply With Quote
Old 25th August 2020, 16:12   #38  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanks for the report lansing, too bad.

EDIT: Ill put warning in Spotless thread and next to spotless post in this thread.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 24th December 2021, 13:16   #39  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
KillerSpots 3.1 (see post #12):

- Added anim (KillerSpots 3.0)
- Added repmode (KillerSpots 3.1)

Merry Xmas!
__________________
By law and justice!

GMJCZP's Arsenal

Last edited by GMJCZP; 24th December 2021 at 14:10.
GMJCZP is offline   Reply With Quote
Old 7th May 2022, 22:28   #40  |  Link
fAy01
Registered User
 
Join Date: Jun 2010
Posts: 91
Quote:
Originally Posted by GMJCZP View Post
KillerSpots 3.1 (see post #12):

- Added anim (KillerSpots 3.0)
- Added repmode (KillerSpots 3.1)

Merry Xmas!
Wow. This is wonderful. Thank you!
fAy01 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 02:13.


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