On Sun, Dec 23, 2007 at 05:36:56PM +0100, Michael Niedermayer wrote:
On Sun, Dec 23, 2007 at 04:33:04PM +0200, Kostya wrote:
Here is my attempt to use RV30 1/3pel MC in the same way as standard H.264 ones.
[MC parameters calculation]
something doesnt look correct on this the mx/my are not rounded the same way as lx/ly, this cant be correct what you likely want is mx= (A + (3<<24)) / 3 - (1<<24); my= (B + (3<<24)) / 3 - (1<<24); lx= (A + (3<<24)) % 3; ly= (B + (3<<24)) % 3;
also this is a duplication of svq3_mc_dirs THIRDPEL_MODE
It is very similar indeed but mx/my calculation in svq3 differs.
@@ -643,15 +639,24 @@ const int width, const int height, int dir) { rv34_mc(r, block_type, xoff, yoff, mv_off, width, height, dir, r->rv30, - r->s.dsp.put_h264_qpel_pixels_tab, r->s.dsp.put_h264_chroma_pixels_tab); + r->rv30 ? r->s.dsp.put_rv30_qpel_pixels_tab + : r->s.dsp.put_h264_qpel_pixels_tab, + r->rv30 ? r->s.dsp.put_rv30_chroma_pixels_tab + : r->s.dsp.put_h264_chroma_pixels_tab); }
static void rv34_mc_2mv(RV34DecContext *r, const int block_type) { rv34_mc(r, block_type, 0, 0, 0, 2, 2, 0, r->rv30, - r->s.dsp.put_h264_qpel_pixels_tab, r->s.dsp.put_h264_chroma_pixels_tab); + r->rv30 ? r->s.dsp.put_rv30_qpel_pixels_tab + : r->s.dsp.put_h264_qpel_pixels_tab, + r->rv30 ? r->s.dsp.put_rv30_chroma_pixels_tab + : r->s.dsp.put_h264_chroma_pixels_tab); rv34_mc(r, block_type, 0, 0, 0, 2, 2, 1, r->rv30, - r->s.dsp.avg_h264_qpel_pixels_tab, r->s.dsp.avg_h264_chroma_pixels_tab); + r->rv30 ? r->s.dsp.avg_rv30_qpel_pixels_tab + : r->s.dsp.avg_h264_qpel_pixels_tab, + r->rv30 ? r->s.dsp.avg_rv30_chroma_pixels_tab + : r->s.dsp.avg_h264_chroma_pixels_tab); }
qpel stands for quarter pel -> 1/4 pel third pel would be tpel :)
I made it too similar then. [chroma MC]
this looks like a duplication of the h264 chroma mc functions, you dont need new functions for mapping 1->3, 2->5, 3->8
Now it is done along with other parameters calculation.
[...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB