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 April 2006, 11:06   #141  |  Link
KillNoise
Video Engineer
 
Join Date: Jun 2005
Location: Göttingen, Germany
Posts: 13
Fast subpixel motion estimation

Ever thought of implementing fast subpixel ME by fitting the subpixel resolution vector to the SAD-curvature samples calculated at integer vector positions ?
Instead of interpolating an intermediate 2x resoution "blow-up" image to perform the search at half-pixel positions, you have to search only in the original size image to find the SAD minimum integer position, then approximate the subpixel position from the values of SAD-minimum and its 4 (or 8) neighbours.
Searching blocks in lower resolution saves a lot SAD-calculations, making ME much faster. Curve-fit approximation of the block vectors (yielding resolution of 1/2-pixel or beyond) can be implemented fast and easy. (If you doubt, ask me to go into detail.)
KillNoise is offline   Reply With Quote
Old 5th June 2006, 19:34   #142  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
I released new MVTools version 1.3.0 (beta?)
Implemented overlapped block motion compensation to MVCompensation(mode=1).
Changed default to mode=1 in MVCompensation as the most universal.
Added sharp subpixel interpolation method for pel=2.
Fixed bug for blksize=16 with YUY2.
(To-do list: assembler SSE speed optimization for new compensation and interpolation methods.)
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 5th June 2006, 20:32   #143  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
would it be possible to implement edge directed internal sampling to increase subpixel accuracy over the linear subpixel accuracy?
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 5th June 2006, 20:56   #144  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Did you try set sharp=1?
Fizick is offline   Reply With Quote
Old 5th June 2006, 21:05   #145  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
No I didn't I was just asking.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 5th June 2006, 21:42   #146  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Answer: Yes, it is possible to imlement any pixel interpolation.
Really I firstly want to add Wiener interpolation. But "true" Wiener (local adaptive) is complex. So, I implement sort of invariant Wiener 6 taps interpolation (do not know why ).

Coeffs= (1; -5; 20 ; 20; -5; 1)/32

About edge-directed. Really Manao used horizontal, vertical and diagonal bilinear interpolation.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 7th June 2006, 12:04   #147  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Hey, a big Thank-You, Fizick. Block overlapped compensation is doing a very good job, and the sharp interpolation comes nice, too.


- One bug discovered:

An error is thrown when compensating after "padding(x,y)":
Code:
vectors = source .padding(4,4) .mvanalyse( [parameters] )
comp = source .padding(4,4) .mvcompensate(vectors, [parameters]) .crop(4,4,-4,-4)
will give "MVTools: MVCompensate does not have a named parameter 'truemotion' / 'blksize' / 'pnew' " etc.pp.
I noticed this when just plugging MVT 1.3.0 into a script where a manual block overlapped ME+MC is done. Probably no big deal, since padding() isn't documented, hence not used very much. Still, it's not exactly the expected behaviour ...


- A question:

"sharp" interpolation can only be specified in MVAnalyse(). Now, in case if compensation is done with new interpolation:
Code:
vectors = source_1 .mvanalyse( sharp=1, idx=a )
comp = source_2 .mvcompensate( vectors, idx=b, mode=1 )
will MVCompensate also use sharp interpolation (reckognizing some flag, or whatever, in the vector clip), or will it use normal bilinear interpolation?


- Question / Suggestion:

Compairing the block overlapped estimation + compensation with the scripted approach I tried, your method seems clearly superior in, say, 80% to 90% of the problematic areas. (Darn you! ) However, there are some percent left.

What I tried was a different method, more kind of a "best match":

- create vectors on orignal, and on padded original
- create compensations with both vectors
- weight both compensations acc. to their amount of difference to the original (including some 8x8-block-restricted spatial blurring of all three clips)

It seems feasable that in areas where compensation #1 shows an obvious bigger difference to the original than compensation #2, the weighting of compensation #1 should be reduced (and vice versa).

Does your block summation method already include something like this? If not, it could be worth a try.
__________________
- 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 9th June 2006, 02:20   #148  |  Link
dirio49
JuSt a PoWer uSEr
 
Join Date: Mar 2005
Location: None of your Business
Posts: 288
Help

i have no idea how to use it

can somebody post a sample working script with everythink that is need?

thanks
__________________
Birthdays are good. Statistics show that the people who have the most live the longest.
dirio49 is offline   Reply With Quote
Old 9th June 2006, 02:55   #149  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Quote:
can somebody post a sample working script with everythink that is need?
What exactly are you trying to do? And, what part don't you understand?
johnmeyer is offline   Reply With Quote
Old 9th June 2006, 02:58   #150  |  Link
dirio49
JuSt a PoWer uSEr
 
Join Date: Mar 2005
Location: None of your Business
Posts: 288
I went to the site and don't really understand what to do?

i just want to try it out in some low bitrate encode

1500 avg bitrate..

I want to try motion blur.

thanks


EDIT:

@Fizick

sorry thanks for pointing it out
__________________
Birthdays are good. Statistics show that the people who have the most live the longest.

Last edited by dirio49; 9th June 2006 at 13:51.
dirio49 is offline   Reply With Quote
Old 9th June 2006, 04:45   #151  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Didйe,
1. edges processing is not implemented. I never used "padding" command. Will look later.

2. MVCompensate use same (sharp) interpolation (reckognizing some flag in the vector clip) in mode=1 and mode=0.

3. your suggestion is interesting, but it may produce some blocking.
One of aims of my current overlapped procesing is deblocking.
Will try strives for perfection later.


drio49,
MFlowblur?
But please post your "usage" questions to "usage" forum:
http://forum.doom9.org/showthread.php?t=84770
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 10th June 2006, 05:23   #152  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Didйe,
I disabled external "Padding" function since MVTools v.1.1.1.
We do not need in external double-sided padding (but only bottom and right).
Now I simply fill it by source pixels.
Try use addborders or mirrorborders as a workaround now.
May be I will implement better padding internally some time.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 22nd November 2006, 21:00   #153  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Would there be any way to make MVTools work with tsp's multithreaded version of Avisynth?
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 23rd November 2006, 03:27   #154  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
Only if you buy Fizick a dual core system to debug the new code with....

Have you looked at Motion by mg262/clouded? It isn't as sophisticated, but it might work with MT Avisynth.

Last edited by Pookie; 23rd November 2006 at 03:39.
Pookie is offline   Reply With Quote
Old 23rd November 2006, 03:42   #155  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Use 2 PCs to process 1st/2nd half of the source. Very stable solution, and available right now.

If short of a 2nd PC, you can simulate it like this: first do the 1st-PC's part, then do the 2nd-PC's part, and join both parts afterwards.
[*running man*]
__________________
- 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 23rd November 2006, 06:25   #156  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
You also may try run two AVS (two part of file) in separate threads

Seriously, some time I will look to it. I am afraid I firstly must remove all IDX, but it will run slower.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 23rd November 2006, 11:52   #157  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
That's good to hear, and your suggestion is actually a pretty good idea. Take your time, good things do tend to take lots of time .
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.

Last edited by Chainmax; 17th December 2006 at 05:19.
Chainmax is offline   Reply With Quote
Old 24th November 2006, 18:36   #158  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
@Chainmax,

If you really want to run MVtools in Dual-CPU, make sure to get a big HDD and encode 2 avs files to lossless. I always do this with MVBOB. I then encode after I'm done. The process is alot faster. The speed increase for me is about 70%.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 24th November 2006 at 18:39.
Revgen is offline   Reply With Quote
Old 18th December 2006, 22:32   #159  |  Link
TSchniede
Registered User
 
Join Date: Aug 2006
Posts: 77
But it is not that straight-forward, mvbob for example can only be used in one encoding at a time unless you specify different idx values for every thread. With the new 1.5 mvtools and the 2x-clip it's probably easier.
Most of the time it works using different idx-values for each thread, but avisynth tends to mix different values of the same variable name, so better no reuses of the same name. Tracking these bugs is very difficult (only sporadically visible).
TSchniede 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 16:45.


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