Topic: MSmoothFps

Hi,
Firstly, this is a cool program. I really like it.
I am the developer of an AviSynth script called InterFrame, so we have similar goals smile
What are the differences between MSmoothFps and MFlowFps/MBlockFps? Is there documentation for that function?
Also, what about MFinest()?
Thanks

Re: MSmoothFps

SubJunk wrote:

What are the differences between MSmoothFps and MFlowFps/MBlockFps?

MSmoothFps is a "next version" of MFlow/MFlowFps/MBlockFps (do you see that these three functions are basically one? wink)

With MSmoothFps right now you can get the same visual results as MFlow/MBlockFps/MFlowFps, but the math is really different (there're two implementations now - SSE2-optimized and OpenCL).
These additions are implemented as "plugins", so they're not covered by GPL and for now can't be used in other software, sorry.

SubJunk wrote:

Is there documentation for that function?

No.

SubJunk wrote:

Also, what about MFinest()?

MFinest exists in original MVTools2 sources, but is commented out. I don't now why, cause it's really useful function for pel>1.
May be Fizick thinks that

AVSValue cache_args[1] = { finest };
finest = env->Invoke("InternalCache", AVSValue(cache_args,1)).AsClip(); 

is enough for caching MVFinest result, but it's not.

Re: MSmoothFps

Chainik wrote:

With MSmoothFps right now you can get the same visual results as MFlow/MBlockFps/MFlowFps, but the math is really different

Are you saying there is no difference in terms of visual quality between MSmoothFps and the others?

Re: MSmoothFps

If we're using the same parameters (and the same vectors) the output is identical.

BTW, I've posted some tests - http://www.avsforum.com/avs-vb/showthre … st20258542 wink

5 (edited by SubJunk 05-04-2011 22:08:53)

Re: MSmoothFps

Cool smile Though there is no point in comparing them because InterFrame is primarily for encoding wink

Edit: You will see that the speed of InterFrame can far exceed yours at different presets, but there will be quality loss at faster presets too. Right now I am doing tests to learn tricks from your code, so the next version of InterFrame will hopefully incorporate them.

By the way, feel free to use any tricks from InterFrame you want. Hopefully we can help eachother to make our scripts better smile

The DeGrainedSource part can be useful and has almost no performance hit

Re: MSmoothFps

SubJunk
Thank you for this advise. We will try it... wink

Re: MSmoothFps

Cool smile One more thing, I noticed you are using DirectShowSource which is not frame accurate. When I encoded samples to test with your script I noticed some frames were missing.
Using DSS2 instead will fix it smile

Re: MSmoothFps

SubJunk
Thanx a lot. We hears about DSS2. Does it way have any lacks?
One lack is requiring avss.dll from Matroska Haali distr. But it is not big trouble wink
And the second DSS2 need another MT mode. I think it is =1 but it needs more testing.
Can you help us with DSS2 best MT mode?

Re: MSmoothFps

SubJunk wrote:

You will see that the speed of InterFrame can far exceed yours at different presets

Fight! Fight! Fight!!!  big_smile

The truth is that SVP can beat any result that you can possibly achieve with original unmodified mvtools wink

InterFrame is primarily for encoding
Yep. But you see that SVP can do the same job in real-time  roll

10 (edited by SubJunk 06-04-2011 08:14:49)

Re: MSmoothFps

MAG79 wrote:

SubJunk
Thanx a lot. We hears about DSS2. Does it way have any lacks?
One lack is requiring avss.dll from Matroska Haali distr. But it is not big trouble wink
And the second DSS2 need another MT mode. I think it is =1 but it needs more testing.
Can you help us with DSS2 best MT mode?

DSS2 has no audio support, other than that it is superior to DirectShowSource to my knowledge smile
I recommend SetMTMode(2) for it.

I will probably have some questions for you later when I have finished testing, thanks for welcoming me here, MAG79 smile

Chainik wrote:

Fight! Fight! Fight!!!  big_smile

We aren't competitors smile

Re: MSmoothFps

Chainik wrote:
SubJunk wrote:

You will see that the speed of InterFrame can far exceed yours at different presets

Fight! Fight! Fight!!!  big_smile

We are here to unite, help each other and create the most perfect frameinterpolation scripts. wink

The bad guys here are the videocard brands. ATI and NVidia that dont want to add the frameinterpolation feature in the cards because they are payed by the TV brands to not add this technology.

Personally Im bored of pay each time for most powerful CPUs and overclock, when dedicated chip in video cards would do that easily.

You have created a way to use the GPU in the frameinterpolation process... so lets help to improve scripts and lets kick the ass of that greedy videcard market smile

Re: MSmoothFps

create the most perfect frameinterpolation scripts

No. Our goal is to create "the most perfect frameinterpolation" software.
Yes, it all started with Avisynth script, but we're trying to make the scripts shorter in each version and to incorporate as much as posible into C++ code. I don't know where it will end, may be in some FrameInterpolation DirectShow filter, without avisynth at all...

Re: MSmoothFps

Which variables do sadml and sadgamma correspond to in the regular MVTools2?

Re: MSmoothFps

It is new parameters to embedded Yushko-mask.
See details about it in YFRC-script at http://videomontazh.com.ua/avisynth/YFRC/

Re: MSmoothFps

Oh very cool. I was wondering what had changed about the mask wink Good idea

Re: MSmoothFps

Oh also, I wonder if you have seen the newer Yushko update which isn't at that link. He was distributing it as "MVTools2 Extreme Edition".
You probably already know about it but just to make sure, the following is YFRC-06dd-01mm-2011yyyy.avsi:

# Author: RunForLife(Oleg Yushko) http://videomontazh.com.ua
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
# http:#www.gnu.org/copyleft/gpl.html.

#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MvTools2\mvtools2debug.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools2.0a36\mt_masktools-26.dll")

#If u feel bad with blending, u can turn it off: YFRC(OverlayType=1)

#####################################################################################################################################################################################################################################
function YFRC(clip clp_Input, int "BlockH", int "BlockV", int "OverlayType", int "MaskExpand")
{
#Yushko Frame Rate Converter 2x
#ColorSpace: YV12
#OverlayType: 0 - soft (blend), 1 - hard (SelectOdd)

clp_input      = ConvertToYV12(clp_input)                      # script produce YV12 colorspace (3 times faster than YUY2!!!)
clp_Super      = MSuper(clp_Input.blur(1), chroma=true, pel=2) # blur(1) - smooth edges for better analysing
ox             = clp_Input.width()
oy             = clp_Input.height()
fps_num        = FrameRateNumerator(clp_input)*2  # Numerator  , always 2X
fps_den        = FrameRateDenominator(clp_input)  # Denominator, always same as input clip

fps_num        = ((fps_num==0||fps_den==0)) ? FramerateNumerator(clp_input)*2 : fps_num
fps_den        = ((fps_num==0||fps_den==0)) ? FramerateDenominator(clp_input) : fps_den
MaskExpand     = default(MaskExpand, 1) # 1 or 2
OverlayType    = default(OverlayType, 0) # 0 - like ConvertFPS (blend); 1 - like ChangeFPS (strong);
blendSOFT      = (OverlayType==0) ? clp_Input.ConvertFPS(fps_num, fps_den).SelectOdd() : DeleteFrame(clp_Input, 0)
BlockH         = default(BlockH, 16) # use 8 for 320x240 (WEB); 16 for 720x576 (SD); 32 for 1280x720 (720p HD); 32 for 1920x1080 (1080p HD)
BlockV         = default(BlockV, 16) # use 8 for 320x240 (WEB); 16 for 720x576 (SD); 32 for 1280x720 (720p HD); 32 for 1920x1080 (1080p HD)
blendHARD      = DeleteFrame(clp_Input, 0) # SceneChange detection

bw1_vec116     = clp_Super.MAnalyse(blksize=BlockH, blksizeV=BlockV, isb = true , chroma=false, search=1, searchparam=1, truemotion=true, lambda=2000, global=true, dct=0, divide=2)
fw1_vec116     = clp_Super.MAnalyse(blksize=BlockH, blksizeV=BlockV, isb = false, chroma=false, search=1, searchparam=1, truemotion=true, lambda=2000, global=true, dct=0, divide=2)
ErrorMask16L   = MMask(clp_input, bw1_vec116, kind=1)
ErrorMask16R   = DeleteFrame(MMask(clp_input, fw1_vec116, kind=1), 0)
ErrorMask16    = Overlay(ErrorMask16L, ErrorMask16R, opacity=0.5, mode="Lighten")#.ColorYUV(gain_y=256)
SceneChange    = MSCDetection(clp_input, bw1_vec116, thSCD2=130)
FPSconverted16 = clp_input.MSimpleFlowFps(clp_input.MSuper(), bw1_vec116, fw1_vec116, num=fps_num, den=fps_den, blend=false, mask=0) #mask=0 - doesn't matter what mode is

CircleExpand   = mt_circle(radius=MaskExpand, zero=true)
CircleInpand   = mt_circle(radius=1         , zero=true)
ErrorMask16    = ErrorMask16.BicubicResize(Round((Ox/BlockH)/4)*4, Round((Oy/BlockV)/4)*4).mt_expand(mode=CircleExpand).mt_inpand(mode=CircleInpand).mt_binarize(64).Blur(1).BicubicResize(ox, oy)

ClipToReturn   = mt_merge(SelectOdd(FPSconverted16), blendSOFT, ErrorMask16, luma=true)
ClipToReturn   = mt_merge(ClipToReturn, blendHARD, SceneChange, luma=true)
ClipToReturn   = Interleave(clp_Input, ClipToReturn)

return ClipToReturn
}
#####################################################################################################################################################################################################################################

I found it to be lower quality than our scripts, but maybe there is something useful in there.

Re: MSmoothFps

SubJunk
The link above is a link to official site of YFRC.
If you want to have a look to our talk with RunForLife you can read translation of it from Russian tech-forum:
MAG79 and RunForLife talk cut
Whole thread, page 30 (start read from post #2948)

MVTools Extreme Edition was failed because of its new function MSimpleFlowFps is equivalent to MFlow. Nothing new.
RunForLife removed it from his site.
I have some version of MVTool2 EE plugin. Ask me if you need one. wink

Re: MSmoothFps

Cool, I thought something like that but I wanted to check smile