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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st November 2016, 22:19   #81  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
@pinterf

can you add rgb24 support in MSuper and MAnalyse and MRecalculate?

making the support work as if it one colour not treats it as R G B separately

__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 1st November 2016, 23:39   #82  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
RGB sucks
I added RGB support in my branch of mvtools and it didn't work out so well
feisty2 is offline   Reply With Quote
Old 1st November 2016, 23:43   #83  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by real.finder View Post
@pinterf

can you add rgb24 support in MSuper and MAnalyse and MRecalculate?

making the support work as if it one colour not treats it as R G B separately

How exactly would one measure differences if implemented as above ?

Would diff in blue count a teeny weeny bit, in green somewhat more, and in red a helluva lot ?
__________________
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 2nd November 2016, 00:16   #84  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StainlessS View Post
How exactly would one measure differences if implemented as above ?

Would diff in blue count a teeny weeny bit, in green somewhat more, and in red a helluva lot ?
I didn't get what you mean well but what about convert rgb24 to hex internally in MAnalyse and MRecalculate?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 2nd November 2016, 00:26   #85  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
One would have to have some difference measure, eg convert rgb to luma-y, and measure dif in that.
Or rgb color cube distance.
I don't get what you are saying about convert to hex.
Perhaps you should elaborate a little on what you want.
__________________
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 2nd November 2016, 00:31   #86  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by StainlessS View Post
One would have to have some difference measure, eg convert rgb to luma-y, and measure dif in that.
Or rgb color cube distance.
I don't get what you are saying about convert to hex.
Perhaps you should elaborate a little on what you want.
https://en.wikipedia.org/wiki/Web_co...to_hexadecimal
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 2nd November 2016, 00:45   #87  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Mixing color component together does not help. The base of the whole motion analysis is SAD, pixel values of two frames get subtracted, then we get the absolute value and finally sum them up for 8x8, 16x16, up to 128x128 (vapoursynth mvtools2 port) pixel blocks.
Creating a compound representation of rgb value result us that the component at the lsb side will affect the result for 1/65536 of weight than the component at the msb side 0xff0000 mask (for 8 bits)
pinterf is offline   Reply With Quote
Old 14th November 2016, 02:22   #88  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
See here Bug in v2.5.11.2 and v2.5.11.20, and v2.5.11.22. Fixed in v2.7.1.22:- http://forum.doom9.org/showthread.php?t=174025

Also, MvTools2 v2.7.1.22 MBlockFps(Blend=False) and MFlowFps(Blend=False) are broken, creates mangled frames at scene change.
__________________
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 November 2016 at 03:07.
StainlessS is offline   Reply With Quote
Old 14th November 2016, 08:55   #89  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
mvtool2

Hi,

could you please try this test build (overlap fix only), and report back, though the scenechange problem is not intended to be fixed.

http://www.mediafire.com/file/u8pp73...orStainless.7z
(test only, not for public)

Edit: what do you mean under "mangled", can you provide a test script and a hint where to look at that behaviour, and also, whether older 2.5.xx or 2.6.0.5 versions behave similarly?

Last edited by pinterf; 14th November 2016 at 08:59.
pinterf is offline   Reply With Quote
Old 14th November 2016, 10:25   #90  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Overlap fix seems to work ok.

By Mangled I meant that bad frame was produced, did not seem to be blend or correct behavior when Blend=False, ie duplicate previous frame
(that is End Of Scene Frame) at scene change.

Script testing v2.6.0.5 (frames are so different that synthesized frames should be same as frame prior to them [EDIT: when Blend=false).
EDIT: Result Frames 0, 2 and 4 are the original frames with a scene change between each, frames 1 and 3 are synthesized frames at scene change.
Code:
Function DoubleRate(clip c,Bool "Blend",Bool "Flow") {
    # Works OK with MvTools2 v2.6.0.5
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4)
    bw_1      = MAnalyse(super, chroma = false, isb = true,  blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(super, chroma = false, isb = false, blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    bw_2      = MRecalculate(super, chroma = false, bw_1, blksize = 8, searchparam = 1, search = 3)    # No Overlap (currently broken for final vectors)
    fw_2      = MRecalculate(super, chroma = false, fw_1, blksize = 8, searchparam = 1, search = 3)    # No Overlap
    Return (!Flow)
        \ ? MBlockFps(super, bw_2, fw_2, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), mode=0, Blend=Blend)
        \ : MFlowFps(super, bw_2, fw_2, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend)
}

BLEND=False
FLOW=False
A=Colorbars.Killaudio.ConvertToYV12.Trim(0,-1)
B=A.FlipHorizontal
(A++B++A).ShowFrameNumber
DoubleRate(Blend=BLEND,Flow=FLOW)
BilinearResize(320,240)
I=Last.Blankclip(Height=4)
StackVertical(Trim(0,-1),I,Trim(1,-1),I,Trim(2,-1),I,Trim(3,-1),I,Trim(4,-1))
result


Script testing v2.7.1.22 and working for OverLap and without the previous script MRecalculate to step over the Overlap bug (In actual fact v2.6.0.5 puts
up error OverLap Must be 0, if function creating MBlockFps used vectors, use Overlap>0).

Code:
Function DoubleRate(clip c,Bool "Blend",Bool "Flow") {
    # for MvTools2 v2.7.1.22 testing
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4)
    bw_1      = MAnalyse(super, chroma = false, isb = true,  blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(super, chroma = false, isb = false, blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    Return (!Flow)
        \ ? MBlockFps(super, bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), mode=0, Blend=Blend)
        \ : MFlowFps(super, bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend)
}

BLEND=False
FLOW=False
A=Colorbars.Killaudio.ConvertToYV12.Trim(0,-1)
B=A.FlipHorizontal
(A++B++A).ShowFrameNumber
DoubleRate(Blend=BLEND,Flow=FLOW)
BilinearResize(320,240)
I=Last.Blankclip(Height=4)
StackVertical(Trim(0,-1),I,Trim(1,-1),I,Trim(2,-1),I,Trim(3,-1),I,Trim(4,-1))
Result (showing 'Mangled frames')


You can check the behaviour using 2nd script DoubleRate() and look at any scene change, with Blend=True, should create blend at scene change, if false, then should use copy of End of Scene frame for synthesized frame [EDIT: As in first above result].

Thanks pinterf, looking good.

EDIT: I dont know if you saw a previous edit from the Interframe thread, here tis:-
Quote:
Originally Posted by StainlessS View Post
EDIT: The problem seems to occur if OverLap used in creating final BackWards and Forwards vectors supplied to MBlockFps,
ie MAnalyse(Overlap=whatever) if MRecalculate not used, and in final MRecalculate(Overlap=whatever) if used.

This works ok without Overlap in final vectors
Code:
Function foo2(clip source, int "multi") {
    last       = source
    multi      = default(multi, 2)
    prefilt    = DeGrainMedian()                                        # some smoothing
    superfilt  = MSuper(prefilt, hpad=16, vpad=16)                         # all levels for MAnalyse
    super      = MSuper(source, pel = 2, hpad = 16, vpad = 16, rfilter = 4) # one level is enough for MRecalculate
    bw_1       = MAnalyse(superfilt, chroma = false, isb = true, blksize = 16,  OverLap=8, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1       = MAnalyse(superfilt, chroma = false, isb = false, blksize = 16, OverLap=8, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    bw_2       = MRecalculate(super, chroma = false, bw_1, blksize = 8, OverLap=4, searchparam = 1, search = 3)
    fw_2       = MRecalculate(super, chroma = false, fw_1, blksize = 8, OverLap=4,searchparam = 1, search = 3)
    bw_3       = MRecalculate(super, chroma = false, bw_2, blksize = 4, searchparam = 0, search = 3)    # No Overlap
    fw_3       = MRecalculate(super, chroma = false, fw_2, blksize = 4, searchparam = 0, search = 3)    # No Overlap
    MBlockFps(source, super, bw_3, fw_3, FramerateNumerator(Source) * multi, FramerateDenominator(Source), mode = 0, Blend=False)
    return last
}
But think I'll be using this until fixed at least.
Code:
Function DoubleRate(clip c,Bool "Blend") {
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    prefilt   = DeGrainMedian()                                     # some smoothing
    superfilt = MSuper(prefilt, hpad=16, vpad=16, rfilter = 4)      # all levels for MAnalyse
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4,levels=1)  # one level is enough for MRecalculate
    bw_1      = MAnalyse(superfilt, chroma = false, isb = true,  blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(superfilt, chroma = false, isb = false, blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    bw_2      = MRecalculate(super, chroma = false, bw_1, blksize = 8, searchparam = 1, search = 3)    # No Overlap (currently broken for final vectors)
    fw_2      = MRecalculate(super, chroma = false, fw_1, blksize = 8, searchparam = 1, search = 3)    # No Overlap
    MBlockFps(super, bw_2, fw_2, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), mode=0, Blend=Blend)
    Return Last
}
EDIT: Ive Added BLEND arg to above two scripts, Default False, here are both results in order with BLEND=True

script 1


script 2 (showing 'Mangled frames')


EDIT: I've added FLOW=False default to both scripts, so you can also test MFlowFps if set true.

EDIT: I spoke too soon, there seems to be a problem at right and bottom edges on real video, also can be seen on frames 1 and 3
of 2nd results.

Script producing
Code:
Function DoubleRate(clip c,Bool "Blend",Bool "Flow") {
    # for MvTools2 v2.7.1.22 testing
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4)
    bw_1      = MAnalyse(super, chroma = false, isb = true,  blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(super, chroma = false, isb = false, blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    Return (!Flow)
        \ ? MBlockFps(super, bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), mode=0, Blend=Blend)
        \ : MFlowFps(super, bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend)
}


AvisourcE("F:\v\StarWars.avi")

DoubleRate
Trim(12744,12746)
LanczosResize(400,224)
StackVertical(Trim(0,-1),Trim(1,-1),Trim(2,-1))


EDIT: Still occurs if adding Crop(4,4,-4,-4) before call to DoubleRate (get rid of any crud, for padding).
EDIT: Still occurs if changing hpad and vpad to 0.
EDIT: And a live video scene change (Blend=false)


EDIT: What above looks like using v2.6.0.5 and same script but with script1 DoubeRate(Blend=True), Blend=False (as above)
should produce 2nd frame same as the 1st frame.
__________________
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; 16th December 2018 at 01:19.
StainlessS is offline   Reply With Quote
Old 14th November 2016, 16:35   #91  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Thanks, don't spend any more time on it, fabuolus error report. Now it's my turn.
pinterf is offline   Reply With Quote
Old 16th November 2016, 00:43   #92  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Hi StainlessS!

Try this test build please.
http://www.mediafire.com/file/aako4w...StainlessS.zip

About the bug. er...
Guess what: A /256 was somehow changed into /(8*8) for better readability . No, it wasn't really me, but the monkeys.

As a side-effect I think I have ported MFlowFPS to native 10-16 bits that can be used with Avisynth+.
pinterf is offline   Reply With Quote
Old 16th November 2016, 03:42   #93  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
MBlockFPS, have fixed side green border, but bottom green border remains in synthesized frames where not at scene change,
ie at scene change, synthesized frame is duplicate of previous frame (blend=false), or simple 50.0/50.0 blend (Blend=True),
so just a problem in synthesized frames that are not at scene change.
The Mangled frames at scene change have gone.

MFlowFPS, dont see any problems.

Unfortunately, I made a bob-boo earlier in other 'Compiler Error ???' thread, I said problem was gone (MSCDetection floating point -1.#IND000),
unfortunately, I dont seem to have checked for more than the disappearance of the floating point error, seems that the MSCDetection return clip
never spots a scene change, all frames identical Green, which is I think all YUV channels 0. (Both End of Scene and Start of Scene clips fail).

Below, code snippet to do detections easily yourself, requires no external plugins (EXCEPT of course MVTools2, which I know you have ).

Code:
FN="F:\v\StarWars.avi"

BLEND= false
FLOW = false

#######################
Avisource(FN)

#Trim(10000,0)

DORG=SelectEvery(1,0,0)                                 # Original Each frame twice
DBL =DoubleRate(Blend=BLEND,Flow=FLOW)

DORG_S = DORG.Sub("Original, Each frame twice",0)
DBL_S  = DBL.Sub("Double Rate : Blend="+String(Blend)+" Flow="+String(Flow),1)

Return StackVertical(DORG_S,DBL_S)
#######################

Function DoubleRate(clip c,Bool "Blend",Bool "Flow") {
    # for MvTools2 v2.7.1.22 testing
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4)
    bw_1      = MAnalyse(super, chroma = false, isb = true,  blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(super, chroma = false, isb = false, blksize = 16, OverLap=2, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    Return (!Flow)
        \ ? MBlockFps(super, bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend, mode=0)
        \ : MFlowFps(super,  bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend)
}

Function Sub(clip c,string tit,int Md) {
    Function SubStrLo(int n,string tit,Int Md) {Return string(n)+"] "+tit+(n%2==0?"":Md==0?" (Duplicate)":" (Synthesized)")}
    S = "SubTitle(SubStrLo(current_frame,"+Chr(34)+tit+Chr(34)+","+String(Md)+"))"
    StackVertical(c.BlankClip(height=20).ScriptClip(S),c)
}
Produces something like below (at scene change, Blend=true [no green bottom border in synth frame at scene change])


EDIT: Above script, you can scrub through whole movie in eg VDubMod and check-out scene changes, and mod BLEND and FLOW
to check other modes.

EDIT: Oops, sorry, above script requires Grunt plugin.

EDIT: Got rid of Grunt() requirement, script updated.
__________________
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; 16th December 2018 at 01:23.
StainlessS is offline   Reply With Quote
Old 16th November 2016, 15:22   #94  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Hi! Found something, another try

http://www.mediafire.com/file/60o8c4...tainLessS2.zip
Test build, not a release.

The bottom line bug was fixed.

The fixes/additions since 2.7.1.22:
- new: MBlockFPS 10-16 bit
- nSCD2 regression fix
- nSCD1 (thCSD1) scale for 10+ bits
- MBlockFPS: overlaps working buffers were not copied to the output.
- MBlockFPS: overlaps: Right columns were ok for the luma only.
- MBlockFPS: overlaps: Blend of bottom rows were operating on somewhere the top rows instead of the last row.

There are still visible differences on the edges, because right and bottom lines are simply blended when we use overlaps, but this is the way it works.

Last edited by pinterf; 16th November 2016 at 16:08.
pinterf is offline   Reply With Quote
Old 17th November 2016, 14:09   #95  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by pinterf View Post
There are still visible differences on the edges, because right and bottom lines are simply blended when we use overlaps, but this is the way it works.
Oh dear, wish you had not told me that, I'll be forever looking for it now



Script, no requirements.
Code:
FN="F:\v\StarWars.avi"

BLEND= false
FLOW = false

#######################
Avisource(FN)

DORG = SelectEvery(1,0,0)                                 # Original Each frame twice
DBLA = DoubleRateA(Blend=BLEND,Flow=FLOW)
DBLB = DoubleRateB(Blend=BLEND,Flow=FLOW)
DBLC = DoubleRateC(Blend=BLEND,Flow=FLOW)

DORG_S = DORG.Sub("Original, Each frame twice",0)
DBLA_S = DBLA.Sub("DoubleRate_A(OLap=0) : Blend="+String(Blend)+" Flow="+String(Flow),1)
DBLB_S = DBLB.Sub("DoubleRate_B(NEW, Olap=8)    : Blend="+String(Blend)+" Flow="+String(Flow),1)
DBLC_S = DBLC.Sub("DoubleRate_C(MRecalc, Olap=8): Blend="+String(Blend)+" Flow="+String(Flow),1)

H     = DORG_S.Blankclip(Height=4,color=$FFFFFF)
LFT   = StackVertical(DORG_S,H,DBLB_S)
RGT   = StackVertical(DBLA_S,H,DBLC_S)
V     = LFT.Blankclip(Width=4,color=$FFFFFF)

Return  StackHorizontal(LFT,V,RGT)  #.trim(48115,0)
#######################

Function DoubleRateA(clip c,Bool "Blend",Bool "Flow") {
    # Overlap = 0
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4)
    bw_1      = MAnalyse(super, chroma = false, isb = true,  blksize = 16, OverLap=0, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(super, chroma = false, isb = false, blksize = 16, OverLap=0, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    Return (!Flow)
        \ ? MBlockFps(super, bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend, mode=0)
        \ : MFlowFps(super,  bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend)
}


Function DoubleRateB(clip c,Bool "Blend",Bool "Flow") {
    # for MvTools2 v2.7.1.22 testing
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4)
    bw_1      = MAnalyse(super, chroma = false, isb = true,  blksize = 16, OverLap=8, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(super, chroma = false, isb = false, blksize = 16, OverLap=8, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    Return (!Flow)
        \ ? MBlockFps(super, bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend, mode=0)
        \ : MFlowFps(super,  bw_1, fw_1, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend)
}

Function DoubleRateC(clip c,Bool "Blend",Bool "Flow") {
    # Works OK with MvTools2 v2.6.0.5
    c
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    super     = MSuper(pel=2, hpad=16, vpad=16,rfilter=4)
    bw_1      = MAnalyse(super, chroma = false, isb = true,  blksize = 16, OverLap=8, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    fw_1      = MAnalyse(super, chroma = false, isb = false, blksize = 16, OverLap=8, searchparam = 3, plevel = 0, search = 3, badrange = (-24))
    bw_2      = MRecalculate(super, chroma = false, bw_1, blksize = 8, searchparam = 1, search = 3)    # No Overlap (currently broken for final vectors)
    fw_2      = MRecalculate(super, chroma = false, fw_1, blksize = 8, searchparam = 1, search = 3)    # No Overlap
    Return (!Flow)
        \ ? MBlockFps(super,bw_2, fw_2, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend, mode=0)
        \ : MFlowFps(super, bw_2, fw_2, num=FramerateNumerator(c) * 2, den=FramerateDenominator(c), Blend=Blend)
}

Function Sub(clip c,string tit,int Md) {
    Function SubStrLo(int n,string tit,Int Md) {Return string(n)+"] "+tit+(n%2==0?"":Md==0?" (Duplicate)":" (Synthesized)")}
    S = "SubTitle(SubStrLo(current_frame,"+Chr(34)+tit+Chr(34)+","+String(Md)+"))"
    StackVertical(c.BlankClip(height=20).ScriptClip(S),c)
}
Shows Synthesized frame, not at scene change, motion coming in from RHS.
TopLeft, original frames, every other one a duplicate,
Top Right, Overlap=0,
Bot Left, New version MvTools, Overlap=8
Bot Right, Old, Overlap=8, with MRecalculate.

All seems to be working OK, for block/Flow/FPS.

Script to show problem in MSCDetection, no requrements.

Code:
FN="LowBitrateAnime.AVI"
Avisource(FN)

Function EndOfSceneClip(clip c,Int "thSCD1",Int "thSCD2") { # All Luma Samples set 255 at EOS
    thSCD1=Default(thSCD1,400)  thSCD2=Default(thSCD2,130)
    sup=c.MSuper(pel=1,sharp=0,rfilter=2,hpad=16, vpad=16)
    bv=sup.MAnalyse(isb=true, delta=1,blksize=16,overlap=8)
    Return c.MSCDetection(bv,thSCD1=thSCD1,thSCD2=thSCD2)
}

Function StartOfSceneClip(clip c,Int "thSCD1",Int "thSCD2") { # All Luma Samples set 255 at SOS
    thSCD1=Default(thSCD1,400)  thSCD2=Default(thSCD2,130)
    sup=c.MSuper(pel=1,sharp=0,rfilter=2,hpad=16, vpad=16)
    fv=sup.MAnalyse(isb=false,delta=1,blksize=16,overlap=8)
    Return c.MSCDetection(fv,thSCD1=thSCD1,thSCD2=thSCD2)
}

EOS = EndOfSceneClip
SOS = StartOfSceneClip
#return EOS
SSS="""
    e = EOS.AverageLuma
    s = SOS.AverageLuma
    Subtitle(String(current_frame)+String(e,"] EOS=%.1f")+String(s," : SOS=%.1f"))
    (e!=0.0)
        \ ? Subtitle("End Of Scene",Size=48,Text_Color=$FF0000,Y=Height/2-24,Align=5)
        \ : (s!=0.0) ? Subtitle("Start Of Scene",Size=48,Text_Color=$0000FF,Y=Height/2+24,Align=5)
        \ : NOP
    return last
"""

Scriptclip(SSS)
We are nearly there

EDIT: Oh damn, meant to put the MBlockFPS example up on PhotoBucket instead of MFlowFPS, arh well done now.

EDIT: MBlockFPS version

EDIT: Above image lost due to Photobucket problem.

EDIT: The Blending mentioned in the quote at top of post is shown on Right Hand Edge of lower two (Overlap) images in
both image sets (dark edge, sourced from next image coming from rhs).
__________________
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; 30th August 2018 at 11:57.
StainlessS is offline   Reply With Quote
Old 17th November 2016, 19:40   #96  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
I'm not saying I'm ready, this is just a new test build inspired by StainlessS

http://www.mediafire.com/file/k78dcm...tainlessS4.zip

There were side effects again, ported some more mvtools2 filters to native 10-16 bits and fixed some bugs.

Recent change log
  • 20161117: MFlow, MFlowInter, MFlowBlur: native 10-16 bits
  • 20161117: MSCDetection: fix scene change filler pixel default value
  • 20161117: MFlowFPS: native 10-16 bit
  • 20161117: MCompensate: native 10-16 bit + possible bugfix bottom padding UV
  • 20161117: Fix SAD for 10-16 bit depths for horizontal block sizes >= 16
  • 20161116: MBlockFPS: Additional overlap fixes (bottom lines)
  • 20161116: MBlockFPS: native 10-16 bit with Avisynth plus
  • 20161116: MBlockFPS: additional overlap fix (Right)
  • 20161115: Fix nSCD2 (Scene change threshold block count %) (2.7.1.22 regression)
  • 20161114: MBlockFPS overlap fix test build (copy buffer to output)

Short status report on the 8+ bit transition:
MShow, MDepan are not yet ported to 10-16 bits. You can try the others, e.g. MDegrains for 10+ bits with Avisynth plus.

EDIT: MFlow, MFlowInter, MFlowBlur ported, removed from the non-16 bit list.

And of course you can freely use 4:2:2 and 4:4:4 formats.
(like YV16 and YV24)

Last edited by pinterf; 17th November 2016 at 20:58. Reason: MFlow, MFlowInter, MFlowBlur ported
pinterf is offline   Reply With Quote
Old 18th November 2016, 12:25   #97  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanks pinterf, everything seems hunky dory,
I'll continue to use this version and report if I find any anomalies, again thanx.

EDIT: I'll probably be using something like below
Code:
Function ChangeFrameRate(clip c,Bool "Blend",Bool "Flow",Int "Num",Int "Den",Int "BlkSize",Int "OverLap") {
    # Req MvTools2 v2.7.1.22+ for Overlap>0
    Blend=Default(Blend,False)                                      # Avoid blends at scene change (copy previous frame)
    Flow=Default(Flow,False)                                        # If True, Use MFlowFps instead of MBlockFps
    BlkSize=Default(BlkSize,16)     Overlap=Default(Overlap,BlkSize/2)
    n=Default(num,0)  d=default(den,0)  valid=(n>0 && d>0)    n=(!valid)?c.FramerateNumerator*2:n    d=(!valid)?c.FramerateDenominator:d  # Default = doublerate
    super   = c.MSuper(pel=2, hpad=BlkSize, vpad=BlkSize,rfilter=4)
    bv      = MAnalyse(super, chroma=false, isb=true,  blksize=BlkSize, OverLap=OverLap, searchparam=3, plevel=0, search=3, badrange=(-24))
    fv      = MAnalyse(super, chroma=false, isb=false, blksize=BlkSize, OverLap=OverLap, searchparam=3, plevel=0, search=3, badrange=(-24))
    Return (!Flow)
        \ ? c.MBlockFps(super, bv, fv, num=n, den=d, Blend=Blend, mode=0)
        \ : c.MFlowFps(super,  bv, fv, num=n, den=d, Blend=Blend)
}

Function DoubleRate(clip c,Bool "Blend",Bool "Flow") {Return c.ChangeFrameRate(Blend,Flow,c.FramerateNumerator*2,c.FramerateDenominator)}
__________________
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; 18th November 2016 at 13:35. Reason: Edited
StainlessS is offline   Reply With Quote
Old 18th November 2016, 23:18   #98  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Thanks, StainlessS, you were excellent, first class tester. You really deserve a new mvtools3 that can realtime interpolate the two suns of tatooine on a ZX81.
But until then I will just bump the version numbers and make a release soon.

Good news for me that finally I have finished porting the last two filters, MDepan and MShow for high bit depth, and also finished the two other DLLs for video stabilizing with Depan (DepanEstimate) and DepanStabilize.
pinterf is offline   Reply With Quote
Old 19th November 2016, 19:46   #99  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
New release:
  • MvTools2 2.7.5.22 (20161119)
    General support of 10-16 bit formats with Avisynth Plus (r2294 or newer recommended)
    with new MDegrain4 and MDegrain5 filters.
  • Depan: 2.13.1 (20161119)
  • DepanEstimate: 2.10 (20161119)
    General support of 10-16 bit formats with Avisynth Plus
    Compiled for 64 bit for the first time
    Supporting YV16 and YV24 for 8 bit and their 10+ bits equivalents
    Requires 2.6 interface

Download:
MvTools 2.7.5.22 + Depan + DepanEstimate for 32 and 64 bits

For general info see readme or the first page of the thread.
Have fun.

Todo:
  • greyscale support (not tested)
  • Port remaining inline assembly to SIMD intrinsics
  • satd 16 bit to SIMD
  • fix reported bugs
pinterf is offline   Reply With Quote
Old 19th November 2016, 19:56   #100  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
Great work, guys!
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Sparktank is offline   Reply With Quote
Reply


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 00:42.


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