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 9th December 2018, 21:03   #501  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Bugfix release, thanks Seedmanc!
Download MvTools2 2.7.38 with depans
Code:
- 2.7.38 (20181209)
  MCompensate: Fix regression in latest v37: overlap=0 crash - ouch, sorry
  MAnalyze DCT: FFTW float: quicker postprocess of DCT'd blocks, now is correct for non power-of-2 block sizes e.g. 12 or 24 (no effect on 8x8 for which fast integer DCT is used)
  MAnalyze DCT: more consistent handling of post DCT internal normalization for non-square block sizes.
pinterf is offline   Reply With Quote
Old 15th December 2018, 13:27   #502  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
I've been out for a while (up the mountains in China) and... wow Pinterf you've been on fire!
MysteryX is offline   Reply With Quote
Old 2nd January 2019, 11:58   #503  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Happy New Year!
New build, a bugfix (thanks ErazorTT for the report) and an MDegrain extension.
Download MvTools2 2.7.39 with depans

Code:
- 2.7.39 (20190102)
  - MSuper: fix 16 bits, pel=2, sharp=2, which caused bottom-section artifacts for MDegrain using 8 bit vector origin and 16 bit real clip
  - MDegrain1-6,N: Enhanced:
       Input clip (and super) format now is fully independent from vector clip's base format (subsampling had to be the same before)
       E.g. make motion vector clips from a YV12 source and apply them on a 8-32 bit 4:4:4 input
pinterf is offline   Reply With Quote
Old 27th January 2019, 05:39   #504  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
And a Happy New Year to you too sir

Small prob in first two (mvtools docs) examples:

Code:
# To show the motion vectors ( forward ) :
AVISource("c:\test.avi") # or MPEG2Source, DirectShowSource, some previous filter, etc
vectors = MSuper().MAnalyse(isb = false)
MShow(vectors) # implicit last works properly          # ERROR:- MShow: Wrong Super Frame Clip
FIXED
Code:
AVISource("c:\test.avi") # or MPEG2Source, DirectShowSource, some previous filter, etc
Last=MSuper()                                           # Assigns implicit last with Super clip
vectors = Last.MAnalyse(isb = false)                    # Implicit Last = super, 1st arg
Last.MShow(vectors)                                     # Implicit Last = super, 1st arg
2nd example similar prob isb=true.
__________________
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; 27th January 2019 at 15:06.
StainlessS is offline   Reply With Quote
Old 29th January 2019, 11:56   #505  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Fixed, thanks
pinterf is offline   Reply With Quote
Old 12th February 2019, 17:24   #506  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
New build
Download MvTools2 2.7.40 with depans

A bugfix, thanks to zorr a.k.a. father of "Zopti" (formerly Avisynth Optimizer) for the report.
Another bugfix for the 16 bit MFlowInter version.

Then, perhaps this version a milestone release.
Most filters fully support 8-16 bit and 32 bit float with greyscale, YUV and Planar RGB videos.
MDegrain family, MCompensate, MFlowXX family, MSuper all can handle practically any Avisynth+ input formats.
It was quite a bit of modification, I hope bugs (small or big) will fly elsewhere, at least there won’t be many.

Have fun.

Code:
- 2.7.40 (20190212)
  - Fix: MFlowInter possible crash with specific parameter and colorspace settings.
  - Fix: MFlowInter possible overflow at 16 bit clips (artifacts)
  - MFlow, MFlowInter, MFlowFPS, MFlowBlur, MBlockFPS: support all 8-16 and 32 bit float Y, YUV (4:2:0, 4:2:2, 4:4:4) and planar RGB color spaces.
    Input clip format is independent from the ones used for getting motion vectors.

Last edited by pinterf; 12th February 2019 at 22:26.
pinterf is offline   Reply With Quote
Old 12th February 2019, 21:10   #507  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Thank you, pinterf, very appreciated, as always!
I just tested it with a 10bit yv16 source brought to 16bit yv24 and it works:

Quote:
FFMpegSource2("test.mov", fpsnum=25000, fpsden=1000)

ConvertBits(16)

Converttoyuv444(matrix="Rec709", interlaced=false)

super=MSuper(pel=1, hpad=0, vpad=0)
backward_1=MAnalyse(super, chroma=false, isb=true, blksize=16, blksizev=16, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1 =MAnalyse(super, chroma=false, isb=false, blksize=16, blksizev=16, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, blksizev=8, searchparam=0, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, blksizev=8, searchparam=0, search=3)
MBlockFps(super, backward_2, forward_2, num=50000, den=1000, mode=0)
it correctly returns a 16bit 4:4:4 50fps file.
Thank you!
FranceBB is offline   Reply With Quote
Old 12th February 2019, 21:50   #508  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
FranceBB,
Quote:
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, blksizev=8, searchparam=0, search=3)
Quote:
search, searchparam, pelsearch

search decides the type of search at every level, searchparam is an additional parameter (step, radius) for this search, and pelsearch is the radius parameter at finest (pel) level.
Below are the possible values for the search type:

...

3 Exhaustive search, searchparam is the radius (square side is 2*radius+1). It is slow, but it gives the best results, SAD-wise.
In MRecalculate, with square side = 1, does that mean that it searches only 1 pixel side to side, up and down, or NONE.

Not sure if problem, just asking. [EDIT: ie, is your MRecalculate a timewasting NOP]
__________________
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; 12th February 2019 at 22:40.
StainlessS is offline   Reply With Quote
Old 13th April 2019, 11:27   #509  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
A curiosity came to me about degraining using larger frame span: beside having less noise, can we say the output is more accurate and/or better quality, given same other parameters, as we are evaluating more frames?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 13th April 2019, 18:37   #510  |  Link
althor1138
Registered User
 
Join Date: Jan 2012
Location: Sweden
Posts: 22
I've been using this function on 2.7.33 and it's always worked. Today I upgraded to the latest 2.7.40 and the output clip is the same as the input clip(nothing has been filtered). I've sifted through the new readme and couldn't figure what's changed to make it not work. If some kind soul could take a look below and point out what is wrong I'd greatly appreciate it. Using avs+ r2772 mt x64 btw.

EDIT: I had to revert back to 2.7.34 before the function started working as expected.

EDIT2: starting with 2.7.35 and up it works in yv12 yv24 colorspace but not yuy2.

EDIT3: Ah but it works with yv16 as well. So I guess yuy2 was dropped? In any case, problem solved. Sorry to bother you all.

Code:
#Motion Compensated Temporalsoften
function TSMC(clip input, int "tradius", int "mthresh", int "lumathresh", int "blocksize")
{
tradius=default(tradius,5)

mthresh=default(mthresh,70)

lumathresh=default(lumathresh,255)

blocksize=default(blocksize,4)

    prefilt=input.blur(1.58)
    super=MSuper(input, pel=2,mt=false)
    superfilt=MSuper(prefilt,pel=2,mt=false)
   
    multivectors=Manalyse(superfilt,multi=true,delta=tradius,mt=false)
    multivectors2=Mrecalculate(superfilt,multivectors,thsad=mthresh,tr=tradius,mt=false,blksize=blocksize,overlap=2)
    mc=Mcompensate(input,super,multivectors2,thsad=mthresh,mt=false,tr=tradius,center=true)
    dnmc=mc.temporalsoften(tradius,lumathresh,lumathresh,15,2)
    decimate=selectevery(dnmc,tradius * 2 + 1,tradius)
    return(decimate)
}

Last edited by althor1138; 13th April 2019 at 20:55.
althor1138 is offline   Reply With Quote
Old 2nd May 2019, 09:50   #511  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
New build, includes an important fix for YUY2 users who experienced troubles after 2.7.35.

Download MvTools with Depans 2.7.41

Now with 2x2 DLL versions, compiled with v142 and v141_xp toolset. XP users please use the latter.

Planar RGB support for DepanStabilize is the first mod that I made for myself. I'm using it in my neverending (neverstarting) 8mm film restoration project to have a stabilized intermediate file in the same format (I have RGB source) for better days when I'll have more time for do further filtering.

Code:
MvTools2 2.7.41 (20190502)

    Fix: regression since 2.7.35: MSuper chroma for non-planar YUY2 (Thanks to mkauf)
    Project moved to Visual Studio 2019, v141_xp and v142 toolset

Depan 2.13.1.4 (20190502)
    DepanStabilize planar RGB 8-16 bits support: Generate motion vectors with mvtools MDepan, use it for DepanStabilize. Input clip can be planar RGB.
    add missing roundings to some internal interpolation calculations

DepanEstimate 2.10.0.3 (20190502)
    simple rebuild
pinterf is offline   Reply With Quote
Old 5th May 2019, 10:27   #512  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by pinterf View Post
New build, includes an important fix for YUY2 users who experienced troubles after 2.7.35.
In the documentation, overlap.png is present from FFT3DFilter one
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th May 2019, 17:30   #513  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Now with 2x2 DLL versions, compiled with v142 and v141_xp toolset. XP users please use the latter.
My other XP computer says "thank you".
By the way, v141_xp is still there in Visual Studio 2019, but this time Microsoft clearly stated that is deprecated, sadly (I noticed it when I upgraded from Visual Studio 2017 to 2019): Picture

Anyway, thank you, Ferenc, your work is always very appreciated.
FranceBB is offline   Reply With Quote
Old 17th May 2019, 22:55   #514  |  Link
Dreamject
Registered User
 
Join Date: Dec 2018
Posts: 140
Sorry, can you write or give an instruction how to use this and can it be used for SVP parameters , I ported SVPgenerator to clear avs (I'm newbe in avs and not a coder, script can be stupid) and wanna know can I adapt it https://forum.doom9.org/showthread.php?t=176268

Last edited by Dreamject; 17th May 2019 at 23:14.
Dreamject is offline   Reply With Quote
Old 28th May 2019, 21:05   #515  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
is it ok to use convertbits() with Msuper super clip?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 29th May 2019, 13:48   #516  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by real.finder View Post
is it ok to use convertbits() with Msuper super clip?
I'm not 100% sure. There is a hack (as a result of lacking frame properties) with the VideoInfo structure, super clip passes padding and plane handling information through a pointer which is stuffed into num_audio_samples videoinfo field. And audio_samples_per_second if set to zero.

If this videoinfo information is copied between filters _and_ the source MSuper instance is not freed up (the memory for this extra clip info is allocated there inside), you can do with a super clip whatever you want (except size modification)
pinterf is offline   Reply With Quote
Old 29th May 2019, 19:14   #517  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
I'm not 100% sure. There is a hack (as a result of lacking frame properties) with the VideoInfo structure, super clip passes padding and plane handling information through a pointer which is stuffed into num_audio_samples videoinfo field. And audio_samples_per_second if set to zero.

If this videoinfo information is copied between filters _and_ the source MSuper instance is not freed up (the memory for this extra clip info is allocated there inside), you can do with a super clip whatever you want (except size modification)
well, in last update of SMDegrain it's seems work
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 26th June 2019, 01:45   #518  |  Link
magnetite
Registered User
 
Join Date: May 2010
Posts: 64
Does MDegrain make use of multithreading? I didn't see it on the mtmodes.avsi list, so I wasn't sure.
magnetite is offline   Reply With Quote
Old 26th June 2019, 05:34   #519  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Reports itself as MT_MULTI_INSTANCE automatically.
pinterf is offline   Reply With Quote
Old 5th November 2019, 13:34   #520  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Is this an mvtools2 bug for Occlusion Mask ?

Code:
Function VectorTest(Int "Delta",Float "Time",Int "MaskT",Int "BlkSz",Int "XStep",Bool "Align",Bool "HFlip",String "CS") {
/*
    VectorTest(), An MvTools2::MFlowInter folly. by StainlessS @ Doom9 : https://forum.doom9.org/showthread.php?t=175373

    Req AVS+ or GSCript, GRunt, MvTools2, RT_Stats v1.43+
    Avs v2.58, Avs/+ v2.60.

    Delta, Default 1.     As for MvTools2
    Time,  Default 50.0,  As for MvTools2
    MaskT, Default 3,     As for MvTools2::MMask(kind=MASK_TYPE), 0=Motion, 1=Sad, 2=Occlusion, 3=Horizontal, 4=Vertical, 5=ColorMap
    BlkSz, Default 4,     As for MvTools2
    XStep, Default 8,     Motion per frame of synthesized clip.
    Align, Default True,  Aligns forward vector frame n+Delta to n. False show frame n of forward vector.
    HFlip, Default False, False, Animate from Right to Left, else Left to Right.
                          (Right to Left is less confusing, same direction that the frames come in from).
    CS,                   Avs v2.5 defaults "YV12" else "Y8".

    Returns RGB32 clip.
*/
    Function MTyp(Int n) {Return " Type="+Select(n,"Motion","Sad","Occlusion","Horizontal","Vertical","ColorMap")}
    myName="VectorTest: "
    IsAvsPlus=(FindStr(UCase(versionString),"AVISYNTH+")!=0)    HasGScript=RT_FunctionExist("GScript")
    HasGrunt=RT_FunctionExist("GScriptclip")                    HasMvTools2=RT_FunctionExist("MSuper")  Is26=VersionNumber>=2.6
    Assert(IsAvsPlus||HasGscript,myName+"Essential AVS+ or GScript installed")
    Assert(HasGrunt,myName+"Essential GRunt installed")         Assert(HasMvTools2,myName+"Essential MvTools2 installed")
    Delta=Default(Delta,1)  Time=Default(Time,50.0)             MaskT=Default(MaskT,3)    BlkSz=DefaulT(BlkSz,4)
    XStep=Default(XStep,8)  Align=Default(Align,True)           HFlip=Default(HFlip,False)
    CS=Default(CS,Is26?"Y8":"YV12")
    OLap=(BlkSz>=4)?BlkSz/2:RT_Undefined
#    OLap=RT_Undefined        # EDIT: Fixes Weirdness
    FuncS="""
        Function Fn(clip c,Int Delta,Float Time,Int XStep,Bool Align,Bool HFlip,String mType) {
            c    n=current_frame
            Hit=(Height-20)/5
            if(Align) {
                Steps=640/XStep
                x=((n+1)*XStep) + (Delta*XStep/2)
                x=Min(x,(Steps-1)*XStep)
                x=HFlip?x:639-x
                cF=RT_YPlaneMin(n=n,x=x,y=Round(2.5*Hit)+20,w=1,h=1)-128
                cB=RT_YPlaneMin(n=n,x=x,y=Round(3.5*Hit)+20,w=1,h=1)-128
                Z=c.BlankClip(width=1,height=1,Color=$FFFFFF,Length=1)
                OverLay(Z,x=x,y=Round(2.5*Hit)+20)
                OverLay(Z,x=x,y=Round(3.5*Hit)+20)
                Subtitle(RT_String("@x=%d FGrey=128%+d : BGrey=128%+d",x,cF,cB))
            } else {
                Subtitle("Align=False, Colors NOT shown")
            }
            Subtitle(String(n,"SRC[n=%.0f] (1st interp srcS)")                      , Y=0.5*Hit+20,Align=5)
            Subtitle(String(n+Delta,"SRC[n+Delta=%.0f] (2nd interp srcE)")          , Y=1.5*Hit+20,Align=5)
            (Align)
              \ ? Subtitle(String(n+Delta,"FVEC[n+DELTA=%.0f]")+mType+ " (Aligned)" , Y=2.5*Hit+20,Align=5)
              \ : Subtitle(String(n,"FVEC[n=%.0f]")+mType                           , Y=2.5*Hit+20,Align=5)
            Subtitle(String(n,"BVEC[n=%.0f]")+mType                                 , Y=3.5*Hit+20,Align=5)
            Subtitle(string(n+Delta*Time/100.0,"MFlowInter Predicted @ [%.2f]")     , Y=4.5*Hit+20,Align=5)
            Return Last
        }
        Wid=640 Hit=64  Steps=Wid/XStep
        White=BlankClip(width=WID,height=HIT,Length=1,Color=$FFFFFF,Pixel_type=CS)  Black=White.BlankClip  srcS=Black.BlankClip(Length=0)
        For(i=1,Steps-1) { W=White.Crop(0,0,i*XStep,0)  K=Black.Crop(0,0,Wid-W.Width,0)  Frm=StackHorizontal(K,W) srcS=srcS++Frm }
        srcS=(HFlip)?srcS.FlipHorizontal:srcS
        srcE=SrcS.Loop(0,0,Delta-1)                                # Delete Delta frames, end interp src
        super=srcS.MSuper(pel=2,hpad=16,vpad=16)
        fvec =MAnalyse(super, isb=false, blksize=BlkSz, overlap=OLap, delta=Delta, truemotion=true)
        bvec =MAnalyse(super, isb=true,  blksize=BlkSz, overlap=OLap, delta=Delta, truemotion=true)
        inter=srcS.MFlowInter(super, bvec,fvec, time=Time)
        mbv=srcS.MMask(bvec,kind=MaskT)    mfv=srcS.MMask(fvec,kind=MaskT)
        mfv=(Align)?mfv.Loop(0,0,Delta-1):mfv                      # Align, Delete DELTA frames from start, align n+delta with n
        TXT=SrcS.BlankClip(Height=20,Length=1,Color=$404040)
        StackVertical(TXT,srcS,SrcE,MFV,MBV,Inter)
        mType=mTyp(MaskT)
        ARGS = "Delta,Time,XStep,Align,HFlip,MType"
        Last.GScriptClip("Fn(last, "+ARGS+")", local=true, args=ARGS)
        DIR=(HFlip) ? " : ---->" : " : <----"
        TXT=TXT.Subtitle(String(Delta,"Delta=%.0f")+String(Time," : Time=%.2f")+
            \ String(BLKSZ," : BLKSZ=%.0f")+String(XSTEP," : XSTEP=%.0f")+" : ALIGN="+String(ALIGN)+" : HFlip="+String(HFlip)+DIR)
        return StackVertical(TXT,Last)
    """
    IsAvsPlus?Eval(FuncS):GScript(FuncS)
    Return Last.ConvertToRGB32
}

# 0=Motion, 1=Sad, 2=Occlusion, 3=Horizontal, 4=Vertical, 5=ColorMap

VectorTest(Delta=2,MaskT=2,Align=FALSE)
Frame 41 (normal, no FWD vector Occlusion mask weirdness)


Frame 42


Frame 43


Frame 44


Frame 45 (back to normal again)


Forward vectors go through a 4 frame cycle, normal, a bit wierd, very weird, a bit weird, back to normal again.
Backward vectors no weirdness.
EDIT: Weirdness above Type on the FVEC line.

EDIT: I've observed similar occlusion weirdness in clip where occlusion appears near top of frame where seemingly sky is pretty much uniform grey [greyscale clip].

EDIT: Changed to ALIGN=False and re-upped images.

EDIT: Above script was only really intended for Horizontal motion mask examination.

EDIT: I suspect that weirdness might be connected with overlap.

EDIT:
If you change this
Code:
    OLap=(BlkSz>=4)?BlkSz/2:RT_Undefined
Code:
    OLap=RT_Undefined
Weirdness disappears [EDIT: And occlusions get fatter and then slimmer as clip progresses though the 4 frame cycle, for both FWD and BWD masks]

EDIT: I still dont have much clue how that occlusion stuff works.

EDIT: I note that author of YFRC
Code:
# Author: RunForLife(Oleg Yushko) http://videomontazh.com.ua
# http://avisynth.nl/index.php/YFRC
uses only backwards Occlusion mask, here posted mod as YFRC2() by RaffRiff42:- https://forum.doom9.org/showthread.php?p=1804170

Below, both SAD masks used, but only BAK backward Occlusion mask.
Code:
    ## "EM" - error or artifact mask
    EM  = C.MMask(bak, ml=190, kind=1)   [** kind=SAD *]
    EM  = EM.Overlay(
    \       C.MMask(fwd, ml=190, kind=1).DeleteFrame(0), 
    \       opacity=0.5, mode="lighten")
    
    EM  = EM.Overlay(
    \       C.MMask(bak, ml=64, kind=2).mt_inpand, [** kind=occlusion *]
    \       opacity=0.5, mode="lighten")
__________________
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; 6th November 2019 at 14:54.
StainlessS 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 20:31.


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