View Single Post
Old 5th July 2014, 23:00   #20  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
OK, this is an idea for how to make an improvement on my original attempt.

I think the idea of using motion estimation is still useful, but my original code (in my earlier post) applies the motion estimation to the entire clip. This doesn't work when there is vertical motion because the bands are affected differently when they move up or down into the area previously occupied by bands from another part of the image.

Therefore, a possible better solution would be to first create two clips using the "macro fields" that were created by the improper resizing. Macro fields?? OK, to define my made-up term, "macro fields" refers to the alternating 18-line horizontal blocks of pixels. The idea would be to do something similar to a "separatefields", but do this instead on each group of 18 horizontal lines. Then, assemble the odd horizontal groups of 18 lines into one "field" and the even blocks into a second "field." The motion estimation would then be applied to just the odd fields. Finally, the odd and even "fields" would be "weaved" back together, but in 18-line chunks.

This is similar to:

Code:
separatefields()
even = selecteven()
odd  = selectodd()
super=MSuper(even,pel=2)
vfe=manalyse(super,truemotion=true,isb=false,delta=1)
vbe=manalyse(super,truemotion=true,isb=true,delta=1)
neweven = mflowinter(even,super,vbe,vfe,time=50)
interleave(neweven,odd)
weave()
except that the separate, select, interleave, and weave statements would work on groups of 18 lines instead of one line at a time.

I think -- but am not sure -- that doing it this way would let the motion estimation work its magic in both the x and y directions without being confused by the moving, hard discontinuities every 18 pixels.

I'm not quite sure how to code this ...
johnmeyer is offline   Reply With Quote