View Full Version : QP usefulness without BVOPs
lordadmira
8th July 2004, 20:15
I was thinking about Quarter Pel and I can't seem to find any use for it without BVOPs enabled. The purpose of it is to increase the precision of interpolated motion right? But if there are only P frames there's nothing to interpolate. Because everything is directly predicted from the preceeding frame. It seems that the greater the distance between P frames (BVOPs) the more benefit this would be. Am I right? This should be in a FAQ somewhere. "If u disable BVOPs, don't use QP cuz it doesn't do anything!".
LA
Asmodian
8th July 2004, 21:35
I have not done any tests but it seems, at least theoretically, that this isn't true as you are still predicting motion from the previous P frame. The magnitude of the motion is usually smaller as the frame used for predicting off of is closer but Q-pel doesn't change much regarding magnitude (AFAIK) but increases precision.
Manao
8th July 2004, 21:40
The gain in precision brought by QPel is the same in each cases ( b-frames or not ), because that gain is not correlated to the length of the motion vectors. So your final statement is somehow groundless.
Teegedeck
8th July 2004, 22:21
There's no indication anywhere that the usefullness of quarterpel is connected to interpolation in any way. How did you jump to that shaky conclusion in the first place, lordadmira?
RadicalEd
8th July 2004, 23:12
Probably a mix up of terms. B-frames are said to be "bidirectionally interpolated" whereas qpel is "quater pixel interpolation". B-frames of course referring to temporal interpolation and qpel referring to spatial, but if you're unaware of that, it could lead to statements such as "The purpose of it is to increase the precision of interpolated motion right?" :|
lordadmira
9th July 2004, 05:10
I say that based on Crusty's FAQ. Ed seems to be onto what I'm talking about. I'll just quote it here:
Motion search tries to capture all the motion between one frame and the next, so that the macroblocks (MB's) can get the right motion vectors assigned to them. If the motion is properly captured then there will be no need for extra alterations to the MB other than a motion vector, sparing quite some bits. The more precisely the motion is captured, the less bits have to be assigned to the content of the MB's, and the more MB's can just consist of a motion vector. So, theoretically, a more precise motion capture would save in altered texture information, thereby saving bits, and increase precision of the overall compression, thereby increasing quality.
Normally XviD uses half-pixel motion search precision. This means that it can 'see' movement in a sub-pixel precision; if a MB moves from a width,height-position of 200,300 to 201, 300 in the next two frames, it can detect that movement correctly and can give the MB a motion vector that says "move me half a pixel to the right this frame please" in those next two frames. Motion will be captured correctly and no texture bits get altered.
Now with Qpel you can capture motion that is only a quarter of a pixel per frame, effectively doubling precision.
Example:
A MB that moves (fluently) from position 200,300 to 201,300 in the next four frames only moves one quarter of a pixel per frame. With normal half-pixel precision this motion would appear 'jumpy' and the codec might have to compensate for this by altering the texture bits of the MB. This of course takes space, and the MB would no longer consist of only a motion vector; it would have to be assigned additional bits for the altered
texture information, thereby decreasing compressibility. Notice how he talks about it capturing motion occuring across 2 and 4 frames. Now unless I'm way off base and don't know that Xvid can make a P frame off non-proximal references, that has to refer to intervening B frames. As Ed said, that implies motion interpolated over that gap. The interpolation takes the form of the motion vectors of the B frames predicted back from each P frame.
Now the reason I question this is that a pixel cannot move less than 1 pixel between frames n and n+1. For the simple fact that the locations of pixels are quantum, it can have only 1 of e.g. 307,200 values (at 640x480). It's not continuous. So for sub-pixel motion to make sense it has to be in terms of motion across 3 or more frames. Obviously when the pixel is ultimately rendered it has to take on 1 of the discrete values, probably with texture info too of course.
If someone has a more technical explanation of QP I'ld like to hear it. How will it function with and without B frames? And please, in the interest of factuality, no Monday morning quarterbacks, I only want to hear from people with first hand knowledge.
LA
RadicalEd
9th July 2004, 05:29
Crusty isn't saying it can only be useful across multiple frames, he's using that as an example. I think. Either that or he's confused. Or I am.
As far as I understand it, the codec will literally interpolate the macroblock up to subpel depth in an attempt to get a better match. The plane of pixels in an image isn't continuous, but the actual objects in the image are/were before being digitized. So it's possible for something to shift a half pixel to the right, and in doing so merely cause the whole pixel to change slightly. Unless I'm totally off base, this is what half/quarter pel is designed to account for. That probably isn't the best way to explain it either. But it really has nothing to do with b-frames. In fact, according to your argument based on crusty's example, b-frames would nullify its effect, since the object would have moved a whole pixel by the next p-frame.
lordadmira
9th July 2004, 05:42
Originally posted by RadicalEd
So it's possible for something to shift a half pixel to the right, and in doing so merely cause the whole pixel to change slightly. Yes, that's how I understand it works too.
But it really has nothing to do with b-frames. In fact, according to your argument based on crusty's example, b-frames would nullify its effect, since the object would have moved a whole pixel by the next p-frame. I wasn't trying to say it had anything to do directly with B frames. Another way of saying it is that QP precision won't help any in motion going from frame 10 to frame 11. It will help u in motion going from frame 10 to 15, which necessitates interveneing B frames. So if ur doing no-BVOP encodes, what good will it be? This is a really visual thing that's hard to write down. :mad:
LA
Manao
9th July 2004, 06:00
I think, at least I hope, that your saying : QPel is useless because I can find an integer motion vector between frame n and n+1 that match perfectly, because there are only 256 different values for the pixel, and 307000 pixels on the frame.
But, first, you're not moving pixels, but blocks ( 8x8 or 16x16 ) of pixels. Hence, instead of having 256 different possible values, you have at least 256^64. So all your reasonning is wrong.
RadicalEd
9th July 2004, 06:04
Originally posted by lordadmira
Another way of saying it is that QP precision won't help any in motion going from frame 10 to frame 11. It will help u in motion going from frame 10 to 15
Yes, and that's totally wrong. Qpel will help from frame 10 to 11, but not from frame 10 to 15. Going from frame 10-15, chances are good the motion will be on an integral scale. From 10-11, on the other hand, the motion is much more subtle. If anything, qpel is less useful with bframes, at least in the context of how useful it is for pframes.
Manao
9th July 2004, 06:15
Qpel will help from frame 10 to 11, but not from frame 10 to 15Wrong, QPel will help both as much.
Going from frame 10-15, chances are good the motion will be on an integral scaleThey are exactly the same. Qpel isn't only true for motion vectors whose length is less than one pixel. QPel means that we can encode in the bitstream a vector such as (4.25, 17.75).
lordadmira
9th July 2004, 06:21
Originally posted by Manao
I think, at least I hope, that your saying : QPel is useless because I can find an integer motion vector between frame n and n+1 that match perfectly, because there are only 256 different values for the pixel, and 307000 pixels on the frame. I'm not saying that.
I don't know why u just keep saying "ur wrong" over and over again. My post was not a statement but a question. Add some fundamental information about the subject.....
LA
RadicalEd
9th July 2004, 07:16
Originally posted by Manao
Wrong, QPel will help both as much.
They are exactly the same. Qpel isn't only true for motion vectors whose length is less than one pixel. QPel means that we can encode in the bitstream a vector such as (4.25, 17.75).
Ah, yeah, that's true of course. Suppose I got caught up in the duality as presented by arima.
Manao
9th July 2004, 08:07
My post was not a statement but a questionhowever, you present them as statements.
Anyway, imagine the following : horizontal black & white stripes, with a width of one pixel. That thing can be moved from half a pixel up or downward, and in the next frame it will be totally grey. Now, if you want find the motion vector between those two frames, you'll come up with a far better motion vector if you allow half-pixel precision than if you don't, no matter how many frames are between those two frames.
Hence, half-pixel interpolation is useful. The reasonning can be extended to quarter pixel, of course.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.