Log in

View Full Version : using mvtools2 on yv24 clip?


feisty2
15th March 2014, 12:36
I got a grayscale clip from a dvd and after cropping, its in odd resolution, so I converted it to yv24 cuz theres no chroma stuff anyway and odd resolution gotta be stored in yv24, then I tried to apply some filters on it, like mvtools2, in the documentation it says mvtools2 only supports yv12/yuy2 but I just used it directly on this yv24 clip and got no errors, only some green screen stuff, very easy to fix anyway, a simple "greyscale ()" fixed that, my question is, will there be problems on luma when using mvtools2 on a grayscale yv24 clip?

ajp_anton
17th March 2014, 08:42
You don't need YV24, Y8 also works with odd resolutions as it doesn't have chroma at all.

feisty2
17th March 2014, 11:29
I know, yv24 and y8 are similar things to odd resolution grayscale clips, but both are not supported by mvtools2, I just wanna know will luma be unexpectedly affected if I use mvtools2 on these colorspaces?

raffriff42
18th March 2014, 11:00
>my question is, will there be problems on luma when using mvtools2 on a grayscale yv24 clip?
I don't know - but wait a second:

>after cropping, its in odd resolution
Cropping to odd resolutions only brings trouble.
Just add this line prior to converting to YV12:Crop(0, 0, -Width % 2, -Height % 2)actually I would to crop to mod 4 or 8...

feisty2
18th March 2014, 12:40
the resolution is already frigging small after cropping, and I cant stand one extra pixel of cropping to make it mod2!
and adding borders is not good cuz black borders will affect motion estimation of few pixels around the borders

Reel.Deel
18th March 2014, 14:56
the resolution is already frigging small after cropping, and I cant stand one extra pixel of cropping to make it mod2!
and adding borders is not good cuz black borders will affect motion estimation of few pixels around the borders
Give this a try:
function Padding(clip c, int left, int top, int right, int bottom)
{
w = c.width()
h = c.height()
c.pointresize( w+left+right, h+top+bottom, -left, -top, w+left+right, h+top+bottom )
}
Originally found here (http://forum.doom9.org/showthread.php?p=1596804#post1596804).

feisty2
18th March 2014, 16:13
pads,borders or whatever won't all these stuff affect motion estimation of few pixels around the borders like I said? I know borders will but donno about pads yet, but thx for ur reply, I'll test it

Reel.Deel
19th March 2014, 03:23
Padding does not harm motion estimation, by default MSuper pads all borders with 8 pixels with similar padding to the function above.

From the documentation:
hpad : it is horizontal padding added to source frame (both left and right). Small padding is added for more correct motion estimation near frame borders. Default=8.

vpad : it is vertical padding added to source frame (both top and bottom). Default=8.

On the other hand, I think feeding MVTools with odd dimension clips is not a good idea. I play it safe and pad so that the input clip/super clip is divisible by the block size I'm using.

feisty2
19th March 2014, 04:51
That sounds great! thx for ur useful reply, it works.