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. |
![]() |
#1 | Link |
Registered User
Join Date: Jun 2005
Posts: 19
|
Motion Search Method
can someone explain me what's different on ME method on x264
-diamond search -hexagonal search -uneven multi-hexagon -exhaustive search ?? is it true that Code:
/\ /\/\ this is 4 elements of diamond search? \/\/ \/ /-\ | | this is 1 element of hexagon?? \_/ is this on x264 only? how about xvid and another codec |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Jun 2002
Location: Adelaide, Australia
Posts: 1,167
|
Diamond is just four direct neighbours:
Code:
| | Code:
\ / / \ Code:
\ | / / | \ |
![]() |
![]() |
![]() |
#3 | Link |
x264 developer
Join Date: Sep 2004
Posts: 2,392
|
Diamond. The previous best known position is shown as "0", and the positions to try next as "1".
Code:
1 101 1 Code:
1 1 222 12021 222 1 1 Code:
3 3 3 3 3 3 3 3 3 1 3 3 3 3 1 3 3 3 3 3 3 3 1 3 3 3 3 22222 3 3 3 22122 3 31 131 131 13121012131 131 131 13 3 22122 3 3 3 22222 3 3 3 3 1 3 3 3 3 3 3 3 1 3 3 3 3 1 3 3 3 3 3 3 3 3 3 Code:
... 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 ...111111111111011111111111... 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 111111111111111111111111 ... |
![]() |
![]() |
![]() |
#11 | Link |
Angel of Night
![]() Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,562
|
That uneven hexagon is pretty. =D
I still haven't done tests comparing uneven multi to standard hex; since it still goes fast enough, I just use it. One of these days I'd like to see an exhaustive matrix of qual vs. speed tradeoff of the many options, though x264 is probably still enough in flux that it would be outdated within a few months. |
![]() |
![]() |
![]() |
#12 | Link |
Registered User
Join Date: Mar 2005
Posts: 468
|
I use exhaustive motion search on all my encodes! Even if it yields only a few percent extra quality while decreasing encoding speed significantly, it doesn't matter...
The time is unimportant because it takes me 14 days to finish hand-editing 35,089 anime frame, so encoding is only a very small proportion (no more than 5%) of the time anyway. So, thanks for providing ESA mode - and do keep it in future releases, as I know there are those who use it and will continue to do so. And big thanks go out to the developers of x264, without whom I would not have this world-class video compression tool! |
![]() |
![]() |
![]() |
#15 | Link |
<The VFW Sheep of Death>
Join Date: Dec 2004
Location: Deathly pasture of VFW
Posts: 1,149
|
Isochroma, that's pretty cool...hand editing.
Yeah, I also use ME exhaustive range 64 when I'm at a fast computer and my source is less than 30 minutes in length. It's fun to watch it go soooo..... sloooooow... and then suddendly to go at 100fps in no-motion scenes! ![]()
__________________
Recommended all-in-one stop for x264/GCC needs on Windows: Komisar x264 builds! |
![]() |
![]() |
![]() |
#16 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 7,208
|
Here are some additional images, based on my limited understanding of different sources (^#3, papers, slides...) of motion search algorithms, some e.g. used in x264 and x265 as well; no guarantee for a correct representation, correction remarks are welcome in case of a misunderstanding.
Exhaustive search: a waste of time {complexity should be O(nē) ?}, only for comparison with more efficient algorithms if they are possibly less precise
Diamond search: small direct neighborhood, only suitable for littlest expected motion changes
Square search: small complete neighborhood, only suitable for littlest expected motion changes
Hexagonal search: 2-step search in a slightly larger range, assuming more probable vertical directions
Star-shaped search: Large diamond shape with additional satellite samples in the first step, good for expected mainly orthogonal motion
Successive Elimination Algorithm (SEA): Logarithmic square search (effectively as good as exhaustive); here with only 3 steps in a reduced 7Ũ7 range {complexity should be O(ld(n)) ?}:
Uneven Multi Hexagonal search (UMH): 3-step search in a larger range, purposefully suitable for expected wide and probably random motion, but generally elaborate
CC-BY Last edited by LigH; 14th December 2016 at 12:23. |
![]() |
![]() |
![]() |
#17 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Last post was in 2005, Ligh, you're a necromancer.
![]()
__________________
Groucho's Avisynth Stuff |
![]() |
![]() |
![]() |
#20 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 7,208
|
That's the wrong question, IMHO. All three are able to find the optimal motion vector – even if it is rather distant from a previous estimation (due to recursive search steps to continue into the direction of the best match so far). They will merely differ by the required time to find the optimum, but when it's found, the quality will be the same in all cases.
Assumed there are no misleading constellations which provoke the recursive search to fail when led into a wrong direction, in which case the remaining difference to be quantized would be of a bigger magnitude, or an intra coded block would be required, which would take more space and reduce the efficiency. Star has a smaller scope right away, it will terminate faster for rather regular motion, which may differ a bit more in mostly vertical or horizontal direction. The scope of UMH is wider, there are already 49 samples always in a first step (16 directions * 3 radii + the origin of the estimation), which will make it probably one of the slowest of these three on the average, yet may be more suitable for the case of a rather shaky camera or otherwise randomly changing motion. And SEA is effectively exhaustive over the whole motion range square, its speed would be constantly high, equal to the dual logarithm of the range for 8..9 samples in each refinement step; to beat UMH on average speed, it has to calculate at most 6 steps which would cover a square of +/- 32 pixels around the estimation, if I'm not completely wrong... For encoding a TV broadcast of a sports event, I would probably trust the star-shaped motion search because motion will most often be quite regular (well estimated), which will save some time in comparison to UMH (probably good for action body camera footage) and SEA (probably best for those who insist in "the best" regardless of costs). Last edited by LigH; 16th December 2016 at 09:09. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|