[Xvid-devel] What is the RefP in SearchData struct

Michael Militzer michael at xvid.org
Sun May 27 11:03:30 CEST 2012


Hi,

RefP is the past reference picture. Since motion vectors can point also
to subpixel positions, reference samples for motion compensation might
be interpolated accordingly (bilinear or lowpass filtered). For motion
estimation it is most efficient to precalculate the interpolated samples
for the whole picture. This is what the array is about ("N" is non-
interpolated, "H" points to the horizontally interpolated and "V" to
the vertically interpolated picture and so on). cU and cV are pointers
to the chrominance sub-planes (remember, ref pictures have a YV12 layout).

As you realized, we do not store pointers to the reference picture
positions in the SearchData struct. We just keep the motion vectors and
use GetReference() to translate a motion vector into image pointers. As
mentioned above, motion vectors can have subpixel precision. So that's
why there is the shifting...

Regards,
Michael


Quoting Chien Tran <chien.study at gmail.com>:

> Hi everyone,
> I am doing a research about improving the Mode Decision in P frame. After
> the SearchP method is called to search for the best candidate of each
> macroblock, I want to store the pointer to the Macroblock data (Y
> component) as well as 4 pointers to 4 sub block of the MB candidate.
> Currently, I see that they are using the GetReference method to get the
> pointer to the corresponding location of previous frame based on Motion
> Vectors has found. The GetReference method contains only 3 lines of code
> but it's hard to understand what it does. Could someone please explain to
> me the code in GetReference method (about the bit shifting, etc..)? And I
> don't know what the RefP array is used for? The comment says something
> about reference pictures N, V, H... I guess the H is Horizontal, V is
> vertical, but I have no clue about what N, cU and cV are.
>
> Thanks in advance
> --
> Best wishes,
>
> Tran Xuan Chien
> University of Information Technology
> Phone: (+84) 1692 468 154
> _______________________________________________
> Xvid-devel mailing list
> Xvid-devel at xvid.org
> http://list.xvid.org/mailman/listinfo/xvid-devel
>
>








More information about the Xvid-devel mailing list