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

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th November 2011, 20:39   #1541  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
I wouldn't say that it's one or the other as the docs say that "Interpolated vectors of old blocks are used as predictors for new vectors".

Fizick definitely isn't a writer of clear documentation as he has many times said himself
__________________
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 27th November 2011, 22:30   #1542  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
Then it would be good someone to confirm it, because I have never seen that approach. QTGMC, interframe, Killer, FizzKiller, etc all use the same processed super for manalyse and mrecalculate.
Dogway is offline   Reply With Quote
Old 27th November 2011, 23:21   #1543  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Documentation states that SAD is recalculated, so you should be able to change both super and settings if you have reason.

MRecalculate is not only useful for bad sources, it can help generally. Large block sizes are good for large areas moving fairly simply, they are not confused by complex / repeated patterns within the image and tend to be more stable even on fairly low contrast areas. However, they will not capture edges or small objects well, and are confused by more complex motion when large blocks change too much. Smaller blocks will capture fine motion detail, edges and more complex motion, but they more easily make mistakes. Consequently a large->small block recalculate can capture the best of both. Start with the large block attempt, then refine where the smaller blocks feel it is necessary. Smaller block recalculation uses settings that avoid changing the original vectors too much without compelling reason (balance the improvement in SAD against reduction in coherence, lambda & pnew). In such a context, and especially with a good source, I see reason to filter less (or differently) on the super for the MRecalculate - initial large block pass aims for stability, smaller block pass for detail. But as ever with MVTools, the theory sounds cleaner than the practice...

The mythical next version of QTGMC already supports multiple levels of MRecalculate as an option, I have been intending to experiment with different pre-filters for the reasons above (and also try the interesting concept that I *think* Boulder was referring to earlier: MRecalculating after scaling the vectors). I don't think there's a plugin reason not to try, whether there's any value...
-Vit- is offline   Reply With Quote
Old 28th November 2011, 05:05   #1544  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Yes, that approach is what I was experimenting with. At least by looking at MShow's output, it seems that doing the initial MAnalyse on the full-size frame and downscaling the vectors and doing MRecalculate on the downsized clip and vectors will stabilize the analysis. Of course, this is just an MVTools newbie talking. It is possible that the same would be achieved by recalculating also on a full-size frame but on HD sources (and x264 encoding), you take whatever speedup you can have.

I have built a hack-of-a-function to play around with things MVTools, and I think the next phase will be to add the possibility to preclean the full-sized frame and disable precleaning for the downscaled clip, or allow setting a different precleaning method
__________________
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 28th November 2011, 22:31   #1545  |  Link
SSH4
Registered User
 
Join Date: Nov 2006
Posts: 90
hmm, don't find in documentation, but why i can't set blocksize 16 and overlap 12 for example, like i can made this in dfttest?
SSH4 is offline   Reply With Quote
Old 13th January 2012, 17:09   #1546  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
I found something very strange. Either it is a bug or I didn't understand the behaviour.
When I process chroma with the motion vectors I got from the luma plane, sometimes chroma just smears a lot in an even conservative environment as thSAD=200 and tr=2 is. Shifting to tr=1 doesn't show this issue but I don't know, I thought luma plane was more reliable for motion vectors than the chroma planes.

Code:
chroma=false
plane=4

super_search=MSuper(chroma=chroma?true:(plane==0?false:true))
bv2=super_search.MAnalyse(isb = true, delta = 2,chroma=chroma)
bv1=super_search.MAnalyse(isb = true, delta = 1,chroma=chroma)
fv1=super_search.MAnalyse(isb = false, delta = 1,chroma=chroma)
fv2=super_search.MAnalyse(isb = false, delta = 2,chroma=chroma)
MDegrain2(super_search, bv1, fv1, bv2, fv2, thSAD=200,plane=plane)

Dogway is offline   Reply With Quote
Old 13th January 2012, 17:48   #1547  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Not sure if it's related to the problem, but you have "chroma=chroma ? ... : ..." in the MSuper() line. That should be "chroma==chroma ? ... : ...".
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 13th January 2012, 18:02   #1548  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Didée View Post
Not sure if it's related to the problem, but you have "chroma=chroma ? ... : ..." in the MSuper() line. That should be "chroma==chroma ? ... : ...".
Not at all.
The first 'chroma' is the argument name in the call, the second is the variable previously defined in the script.
'chroma==chroma' is obviously always true, so makes no sense here.

Incidentally, instead of
chroma=chroma? true : (plane==0?false:true)
you could write
chroma=(chroma || plane!=0)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 13th January 2012, 18:44   #1549  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Aiii, yes, you're right. I got confused. Script syntax is correct.

However, if msuper is called with chroma=false, then the super clip does not contain valid chroma data. And if the super clip does not contain valid chroma data, then the subsequent MDegrain (with plane=4, i.e. with chroma processing) might become problematic, obviously.

If you want to avoid the risk that source-damaged chroma influences the motionsearch, set chroma=false in the manalyse() call. But you need to keep chroma in the super-clip.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 13th January 2012, 19:01   #1550  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Didée View Post
However, if msuper is called with chroma=false, then the super clip does not contain valid chroma data. And if the super clip does not contain valid chroma data, then the subsequent MDegrain (with plane=4, i.e. with chroma processing) might become problematic, obviously.
But if plane=4 (or any non-zero value), MSuper() is called with chroma=true.

Quote:
If you want to avoid the risk that source-damaged chroma influences the motionsearch, set chroma=false in the manalyse() call. But you need to keep chroma in the super-clip.
Dogway's script does exactly that.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 13th January 2012, 19:35   #1551  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Hmmh. That's true, again.

Today is not my day, it seems. ^^
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 13th January 2012, 20:10   #1552  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
Quote:
Originally Posted by Didée View Post
Hmmh. That's true, again.

Today is not my day, it seems. ^^
Friday 13th

Cheers
manolito
manolito is offline   Reply With Quote
Old 18th January 2012, 16:59   #1553  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Hi, somebody could say me if i apply mmask properly???

Code:
a=last

######SPATIAL DENOISE####
b=dfttest(tbsize=1,sigma=14,lsb=true)

#####MASK####
vectors = MSuper().MAnalyse(isb = false)
msk=MMask(vectors).dfttest(tbsize=1,sigma=12)
      
#####BACK MERGING WITH DFTTEST####       
dither_merge16_8(b,a.Dither_convert_8_to_16(),msk,luma=true).ditherpost(mode=6)

#####CONTRASHARPEN#### 
contrasharpening(last, a)

#####TEMPORAL DENOISE####
super=Msuper(last)

backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)

MDegrain2(super,backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=320,lsb=true)

#####DEBANDING####
gradfun3(smode=1,lsb_in=true,mode=0,ampo=1.2)

#####ANTIALIASING####
LSharpAAF(StrDrk=10,aatype="supaa")
Thanks in advance
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 20th January 2012, 12:50   #1554  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Sorry no I don't think it's a proper use. I don't know exactly what you want to achieve, but I guess you want to spatially filter only areas on which the motion estimation failed. Default kind parameter value for MMask is 0, meaning that it will output grey shades based on the vector length, even if the vector is completely wrong. You should set kind=1 to use the SAD value: smallest value = good match. I recommend to set Ysc=255 (scene change = bad match), and to play with the ml and gamma parameters. Display the msk clip to finetune the values. Then, the two first Dither_merge16 arguments should be swapped: 0 = use original clip, 255 = use spatially filtered clip.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 20th January 2012, 13:37   #1555  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Quote:
Originally Posted by cretindesalpes View Post
Sorry no I don't think it's a proper use. I don't know exactly what you want to achieve, but I guess you want to spatially filter only areas on which the motion estimation failed. Default kind parameter value for MMask is 0, meaning that it will output grey shades based on the vector length, even if the vector is completely wrong. You should set kind=1 to use the SAD value: smallest value = good match. I recommend to set Ysc=255 (scene change = bad match), and to play with the ml and gamma parameters. Display the msk clip to finetune the values. Then, the two first Dither_merge16 arguments should be swapped: 0 = use original clip, 255 = use spatially filtered clip.
With the code I wanted to avoid that areas not affected by the mask, had a more smooth movement. Follow your recommendations although the masks that I'm a newbie. Thanks
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 26th April 2012, 18:33   #1556  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Some more dumb questions:

Is it generally wise to use a very high searchparam, such as 6-8 for SD sources with pel=2 and search=5? Or with any source, I'd expect that higher resolution actually needs a higher search range.

Is it useful to use MRecalculate and search=3 with a high (once again 6-8) searchparam value?

Let's say that the slowdown does not need to be considered, this is only some throwing of ideas off the top of my head. I've been trying to check the MShow output but I cannot determine which one produces better output, that's why I'd like to have some second opinions.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...

Last edited by Boulder; 26th April 2012 at 18:40.
Boulder is offline   Reply With Quote
Old 26th June 2012, 02:13   #1557  |  Link
alexx7777
Registered User
 
Join Date: Mar 2012
Posts: 69
Please tell me how to be a script for doubling the frame rate (25> 50) interlaced video (TFF) using MVFlowFps2?
alexx7777 is offline   Reply With Quote
Old 26th June 2012, 03:17   #1558  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
MVFlowFps2 seems to have been removed from v2 mvtools (there was a request
for comment (in v1) as to whether or not the filter was needed, but seems to have
just disappeared without further note).

The only example in v1 is for progressive however, here is the v1 example for progressive:

Code:
To change fps with MVFlowFps2:

# Assume progressive PAL 25 fps source. Lets try convert it to 50.
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1, search=3)
# we use explicit idx for more fast processing and use full search
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1, search=3)
cropped = source.crop(4,4,-4,-4) # by half of block size 8
backward_vec2 = cropped.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2, search=3)
forward_vec2 = cropped.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2, search=3)
source.MVFlowFps2(backward_vec,forward_vec,backward_vec2,forward_vec2,num=50,idx=1,idx2=2)
Doubt this helps but ...
__________________
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; 26th June 2012 at 03:20.
StainlessS is offline   Reply With Quote
Old 26th June 2012, 06:04   #1559  |  Link
SubJunk
Registered User
 
Join Date: Jun 2010
Posts: 443
The best way to make interlaced video double framerate is to use a deinterlacing script like QTGMC. It is an automatic function of that script (just don't use SelectEven() or SelectOdd() afterwards).
MVTools2 is a great way to double the framerate of progressive video, but not interlaced.
SubJunk is offline   Reply With Quote
Old 6th December 2012, 09:03   #1560  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Suggestion for handling YV12 U-V plane swaps

In the following scenario the YV12 U & V planes get swapped from FFVideoSource()'s CS_I420 to ConvertToYV12()'s CS_YV12, causing MRecalculate() to fail with "wrong pixel type":
Code:
source  = "input.avi"
FFIndex(source=source, cachefile=source+".ffindex", indexmask=-1, dumpmask=0, errorhandling=3, overwrite=false)
FFVideoSource(source=source, track=-1, cache=true, cachefile=source+".ffindex", seekmode=1, rffmode=0, width=-1, height=-1, colorspace="YV12")
a       = last
Assert(IsYV12(a), "Source is not YV12")
MSuper(hpad=16, vpad=16, pel=2, rfilter=4)
bvec1   = MAnalyse(isb=true, delta=1, blksize=16, overlap=8)
fvec1   = MAnalyse(isb=false, delta=1, blksize=16, overlap=8)
a.ConvertToRGB32()
# ... some filter/s requiring RGB32
ConvertToYV12()
MSuper(hpad=16, vpad=16, pel=2, rfilter=4, levels=1)
bvec1   = MRecalculate(bvec1, thSAD=400, blksize=8, overlap=4)
fvec1   = MRecalculate(fvec1, thSAD=400, blksize=8, overlap=4)
MDegrain1(a, last, bvec1, fvec1)
Discussion at http://forum.doom9.org/showthread.php?t=166603.

I raised the issue with the FFmpegSource2 developers, but their respone contained impolite language and indicated that they won't address this.

I realise that various work-arounds are possible, but as a convenience - and to prevent unexpected gotchas like the one above - please consider automatically handling swapped U-V planes? Perhaps existing behaviour could be extended with a bool "pixfmtstrict" parameter.
fvisagie 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 10:41.


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