Log in

View Full Version : The power of Avisynth: new 8mm film restoring examples


videoFred
7th February 2017, 13:07
Hello everybody,

New film 8mm restoration examples on Vimeo and youtube:

https://vimeo.com/user678523/videos/all/sort:date

https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg

Please set Vimeo and Youtube player quality to HD if possible.

Used filter chain:

- RemoveDirtSMC()
- GamMac() (wonderful filter, thank you again Stainlesss)
- DePanStabilize()
- Tweak() (6x tweak() separate colors with starthue and endhue)
- RgbAdjust()
- McDegrainSharp()

- Special sharpening:
- UnsharpMask (from WarpSharp) radius 3
- blur
- Unsharpmask radius 2
- blur
- final: Sharpen()

It seems that adding blur between sharpening steps avoids halos.
I buy a Belgian Beer for someone who can show me halos on my example clips ;)


I had to solve a few problems: the newest DePan.dll 1.13.1.0 is very good, no more issues at scene change. But it creates some kind of "raster" effect in the AvsPmod preview. In VDub however, this effect is not there.

After many testings, I discovered that MvTools2 2.5.11.22 (used both in McDegrainSharp and RemoveDirtSMC) was causing the problem. I replaced it with MvTools 2.4.2.0 and the "raster" effect in AvsPmod was gone.

Also, RemoveDirtSMC() was causing problems in AvsPmod when trimming. (frame read errors) This was solved by changing blksize to 16 in MAnalyse.

Anyhow, I'm pretty happy with the results.
Feedback and/or suggestions are welcome as usual :p

PS: the Vimeo clips can be downloaded in Xvid for further examination


Fred.

StainlessS
7th February 2017, 14:02
- Special sharpening:
- UnsharpMask (from WarpSharp) radius 3
- blur
- Unsharpmask radius 2
- blur
- final: Sharpen()

It seems that adding blur between sharpening steps avoids halos.
I buy a Belgian Beer for someone who can show me halos on my example clips ;)


After InGoldie supplication asking how to get rid of oversharpened artifacts, I nearly suggested (jokingly) something like "a bit of Blur might help", not knowing that I could have been absolutely correct.

Fred, can you try MvTools current ie "MvTools2 2.7.14.22 (20170206) with depans" Uploaded Yesterday, see if it displays the raster type effect described, thanx. (Maybe we can get it fixed if so)

I'll down all samples tomorrow, hope the XVid samples are without subs (Anything special you have to do to get the XVid samples ?, Never used Vimeo before)

EDIT:
Maybe we can get it fixed if so
OK, looks like AvsPMod problem rather than MVTools, but might be nice to know if problem persists.
Also, What version AvsPMod affected, for devs ?

EDIT: Fred, is there a new version of your script somewhere, latest seems to be dated in 2012 ?

videoFred
7th February 2017, 15:12
After InGoldie supplication asking how to get rid of artifacts, I nearly suggested (jokingly) something like "a bit of Blur might help", not knowing that I could have been absolutely correct.

Haha.. intuition doktorrr :)


Fred, can you try MvTools current ie "MvTools2 2.7.14.22 (20170206) with depans" Uploaded Yesterday, see if it displays the raster type effect described, thanx. (Maybe we can get it fixed if so)

Uploaded? Where?


I'll down all samples tomorrow, hope the XVid samples are without subs (Anything special you have to do to get the XVid samples ?, Never used Vimeo before)

Simple: just hit the "download" button :p
Sorry for the subs, I must protect my work.
But I could upload them without subs for you only ;)



OK, looks like AvsPMod problem rather than MVTools,

Yes


Also, What version AvsPMod affected, for devs ?

2.5.1.0


many greetings,
Fred.

StainlessS
7th February 2017, 16:23
Uploaded? Where?

In Avisynth Development, MvTools-PfMod (where current development is in rapid progress):- https://forum.doom9.org/showthread.php?p=1796069#post1796069

But I could upload them without subs for you only
Yes please, if you would, I would like to reproduce results. [EDIT: I dont have much in the way of good test clips for eg GamMac.]

many greetings,
And to you also sir.
Steve.

EDIT: I see that you like MCDegrainSharp, was just an daft idea to see if I understood how to use MvTools, but I use it all of the time now.
Do you use the update one with 'Precise' arg ? any improvement ? [EDIT: I usually dont bother]

EDIT: MCDegrainSharp:- https://forum.doom9.org/showthread.php?p=1508635&highlight=mcdegrainsharp#post1508635
Precise version a few posts later.

This lot could probably be improved for Precise, (uses blksize=bs/2, overlap=bs/4 in all incantations)

backward_vec3 = (Precise) ? MRecalculate(super, backward_vec3, blksize=bs/2, overlap=bs/4,thSAD=100) : backward_vec3
backward_vec2 = (Precise) ? MRecalculate(super, backward_vec2, blksize=bs/2, overlap=bs/4,thSAD=100) : backward_vec2
backward_vec1 = (Precise) ? MRecalculate(super, backward_vec1, blksize=bs/2, overlap=bs/4,thSAD=100) : backward_vec1
forward_vec1 = (Precise) ? MRecalculate(super, forward_vec1 , blksize=bs/2, overlap=bs/4,thSAD=100) : forward_vec1
forward_vec2 = (Precise) ? MRecalculate(super, forward_vec2 , blksize=bs/2, overlap=bs/4,thSAD=100) : forward_vec2
forward_vec3 = (Precise) ? MRecalculate(super, forward_vec3 , blksize=bs/2, overlap=bs/4,thSAD=100) : forward_vec3


EDIT: Maybe I should change Precise Bool to int 0->3 (could I suppose do it without breaking scripts, use Var instead of bool
and check internally for either bool or int(0->3) supplied, error if not, and convert bool true to 3 and false to 0)

EDIT: There were some comments later, maybe I also implement what master Feisty2 said.

ingoldie
8th February 2017, 13:45
@videoFred

Can you post your script?

johnmeyer
8th February 2017, 16:04
@videoFred

Can you post your script?https://forum.doom9.org/showthread.php?t=144271

ingoldie
8th February 2017, 16:17
I'm talking about script for this



Used filter chain:

- RemoveDirtSMC()
- GamMac() (wonderful filter, thank you again Stainlesss)
- DePanStabilize()
- Tweak() (6x tweak() separate colors with starthue and endhue)
- RgbAdjust()
- McDegrainSharp()

- Special sharpening:
- UnsharpMask (from WarpSharp) radius 3
- blur
- Unsharpmask radius 2
- blur
- final: Sharpen()

videoFred
8th February 2017, 19:50
I'm talking about script for this

Yes, it's a new script, not ready for publishing. But if you are looking for a solution for your sharpening problem: try blur() between sharpening steps. This is not a joke, that's how I did it.

Fred.

videoFred
9th February 2017, 22:50
In Avisynth Development, MvTools-PfMod (where current development is in rapid progress):- https://forum.doom9.org/showthread.php?p=1796069#post1796069

Ok, I have tested this version of MVTools and all issues are gone!
Thank you for the hint :thanks:

Fred.

EHarlen
31st October 2017, 00:30
Used filter chain:

- RemoveDirtSMC()
- McDegrainSharp()

There are two different types RemoveDirtSMC()...

http://forum.doom9.org/showthread.php?p=1559146#post1559146

http://forum.doom9.org/showthread.php?p=1699132#post1699132


and two different types McDegrainSharp().

https://forum.doom9.org/showthread.php?p=1700776#post1700776

https://forum.doom9.org/showthread.php?p=1737045#post1737045


What type of RemoveDirtSMC() and McDegrainSharp() do you use?


By the way, why do prefer RemoveDirtSMC() instead of RemoveDirtMC()?

videoFred
31st October 2017, 11:10
Hello EHarlen ,

I have done so many testings in the past.... Probably RemoveDirtSMC() was giving better results than RemoveDirtMC().
But you can try them yourself and see what you get.

I am currently using these versions:

RemoveDirtSMC():

# FUNCTION RemoveDirtSMC
#============================================================================================================================================.

function RemoveTempGrain(clip clp, int "_mode")
{
_mode = Default(_mode, 17)

rg = RemoveGrain(clp, mode=_mode)

return TemporalRepair(rg, clp)
}





function RemoveDirtS(clip clp, int "limit", bool "_grey")
{
_grey = Default(_grey, false)
limit = Default(limit, 6)

clensed = clp.Clense(grey=_grey, cache=4)
alt = clp.RemoveGrain(10)

return (RestoreMotionBlocks(clensed, clp, alternative=alt, pthreshold=4, cthreshold=6, gmthreshold=40, \
dist=1, dmode=2, debug=false, noise=limit, noisy=16, grey=_grey))
}





function RemoveDirtSMC(clip clp, int "limit", bool "_grey")
{
_grey = Default(_grey, false)
limit = Default(limit, 6)

super1 = MSuper(clp, pel=2, sharp=2)
bvec1 = MAnalyse(super1, isb=true, blksize=16, delta=1, truemotion=true)
fvec1 = MAnalyse(super1, isb=false, blksize=16, delta=1, truemotion=true)
backw1 = MFlow(clp, super1, bvec1)
forw1 = MFlow(clp, super1, fvec1)

clp = Interleave(backw1, clp, forw1)
clp = clp.RemoveDirtS(limit, _grey).removetempgrain(10)
clp = clp.SelectEvery(3, 1)


return clp
}

McDegrainSharp():

function McDegrainSharp(clip c, int "frames", int"strenght",float "bblur", float "csharp", bool "bsrch")
{ # Based on MCDegrain By Didee, http://forum.doom9.org/showthread.php?t=161594
# Also based on DiDee observations in this thread: http://forum.doom9.org/showthread.php?t=161580
# "Denoise with MDegrainX, do slight sharpening where motionmatch is good, do slight blurring where motionmatch is bad"
# In areas where MAnalyse cannot find good matches, the blur() will be dominant.
# In areas where good matches are found, the sharpen()'ed pixels will overweight the blur()'ed pixels
# when the pixel averaging is performed.
frames = default(frames, 2)
strenght = default(strenght,400)
bblur = default(bblur, 1.0)
csharp = default(csharp, 1.0)
bsrch = default(bsrch, true)

blocks = 16
overl = 8

c2 = c.blur(bblur)
super = bsrch ? c2.MSuper(pel=2, sharp=1) : c.MSuper(pel=2, sharp=1)
super_rend = c.sharpen(csharp).MSuper(pel=2, sharp=1,levels=1)
backward_vec3 = MAnalyse(super, isb = true, delta = 3, blksize=blocks, overlap=overl)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, blksize=blocks, overlap=overl)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=blocks, overlap=overl)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, blksize=blocks, overlap=overl)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, blksize=blocks, overlap=overl)
forward_vec3 = MAnalyse(super, isb = false, delta = 3, blksize=blocks, overlap=overl)
(frames<=0) ? c :\
(frames==1) ? c2.MDegrain1(super_rend, backward_vec1,forward_vec1,thSAD=strenght) :\
(frames==2) ? c2.MDegrain2(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=strenght) :\
c2.MDegrain3(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=strenght)
return(last)
}

Fred.