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. |
14th April 2010, 19:35 | #1 | Link |
Registered User
Join Date: Jun 2009
Location: UK
Posts: 263
|
Constrained searches for MVTools / MAnalyse
Hi!
Prompted by the recent discussions about converting anaglyph images to other formats, I've been experimenting with the use of MVTools to synthesize the missing colour data for each eye of a Blue/Yellow anaglyph video (Blue/Yellow? Yeah, it's crazy, but that's how they did it! Nearly all the image info is on the yellow side, natch...) Anyway, I've found that some problems occur due to Manalyse mistakenly assigning vectors well away from the horizontal. Since the images I've got are well aligned vertically, I just need to force MAnalyse to only search along the x-axis, and ignore the y-axis. (This should also speed up the MAnalyse pass quite a lot! ) While I'm at it, for another use I've got in mind, it would be handy to have a vertical-only search too (for detecting and fixing vertical jitter on bad VHS rips). So I've taken the plunge and looked at the sources for MVTools, and here's what I think I need to add: 1. In MVAnalyse.cpp, in the switch(st) block of code, add the following cases: Code:
case 6 : searchType = HORIZONTAL; nSearchParam = ( stp < 1 ) ? 1 : stp; break; case 7 : searchType = VERTICAL; nSearchParam = ( stp < 1 ) ? 1 : stp; break; Code:
//After: if ( searchType & UMHSEARCH ) UMHSearch(nSearchParam, bestMV.x, bestMV.y); //Insert: if ( searchType & HORIZONTAL ) HorizontalSearch(); if ( searchType & VERTICAL ) HorizontalSearch(); Code:
//After: if ( searchType & UMHSEARCH ) UMHSearch(nSearchParam, bestMV.x, bestMV.y); //Add: if ( searchType & HORIZONTAL ) HorizontalSearch(); if ( searchType & VERTICAL ) HorizontalSearch(); Code:
//After the big chunk of code that goes: void PlaneOfBlocks::UMHSearch(int i_me_range, int omx, int omy) // radius { *** LOADS OF STUFF HERE *** } //Add: void PlaneOfBlocks::HorizontalSearch(int r, int s, int mvx, int mvy) // width = 2*r + 1, step=s { // Examine a horizontal line working outward from (mvx, mvy) int i; // work along a line from -r to +r for ( i = 1; i < r; i+=s ) // { CheckMV(mvx + i, mvy); CheckMV(mvx - i, mvy); } } void PlaneOfBlocks::VerticalSearch(int r, int s, int mvx, int mvy) // width = 2*r + 1, step=s { // Examine a horizontal line working outward from (mvx, mvy) int i; // work along a line from -r to +r for ( i = 1; i < r; i+=s ) // { CheckMV(mvx, mvy+ i); CheckMV(mvx, mvy+ i); } } And would folks be interested in seeing these two search types added to MVTools2? |
16th April 2010, 19:48 | #2 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
yes. it may be done
__________________
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. |
16th April 2010, 23:04 | #3 | Link |
Registered User
Join Date: Jun 2009
Location: UK
Posts: 263
|
Hi!
Of all the plugins to cut my teeth on as a plugin modifier, I just *had* to pick the most complex (and powerful) of the lot... MVTools2! But, after a day of wrangling I've finally managed to the compiler and Platform SDK talking to each other correctly on this machine, and after a couple of false starts I've got these two new search modes working. Thanks to their simplicity, they run really fast, too! This is the first time I can remember ever mo-comping 3 minutes of video in less than 5 minutes, let alone de-anaglyphing it to a pretty watchable cross-view version. I'll happily post my tweaked sources and binary here and some samples of input/output here, but I need to get some sleep first. (Hopefully when I wake up, it won't all turn out to have been a dream... ) Expect an update sometime on Sunday. |
17th April 2010, 14:57 | #4 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
posted VerticalSearch has a bug:
CheckMV(mvx, mvy- i); CheckMV(mvx, mvy+ i);
__________________
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. |
26th March 2011, 00:06 | #5 | Link |
Registered User
Join Date: Jun 2009
Location: UK
Posts: 263
|
Just a note here, for anyone who stumbles across this thread in future, that pure horizontal and vertical searches have now been added to the official builds of MVTools2, as search types 6 and 7. (Thanks again, Fizick! )
|
Tags |
de-anaglyph, de-jitter, manalyse, mvtools |
Thread Tools | Search this Thread |
Display Modes | |
|
|