Commit 1121514b authored by kostya's avatar kostya

RV30 thirdpel motion compensation support

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11398 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent fdb3a930
This diff is collapsed.
...@@ -559,6 +559,8 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir) ...@@ -559,6 +559,8 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir)
fill_rectangle(cur_pic->motion_val[!dir][mv_pos], 2, 2, s->b8_stride, 0, 4); fill_rectangle(cur_pic->motion_val[!dir][mv_pos], 2, 2, s->b8_stride, 0, 4);
} }
static const int chroma_coeffs[3] = { 8, 5, 3 };
/** /**
* generic motion compensation function * generic motion compensation function
* *
...@@ -584,21 +586,15 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, ...@@ -584,21 +586,15 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type,
int is16x16 = 1; int is16x16 = 1;
if(thirdpel){ if(thirdpel){
#if 0 /// todo
int lx, ly; int lx, ly;
mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] / 3; mx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24);
my = s->current_picture_ptr->motion_val[dir][mv_pos][1] / 3; my = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24);
lx = ((s->current_picture_ptr->motion_val[dir][mv_pos][0] % 3) + 3) % 3; lx = (s->current_picture_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3;
ly = ((s->current_picture_ptr->motion_val[dir][mv_pos][1] % 3) + 3) % 3; ly = (s->current_picture_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3;
dxy = ly*3 + lx; dxy = ly*4 + lx;
uvmx = uvmx = chroma_coeffs[(3*(mx&1) + lx) >> 1];
#endif uvmy = chroma_coeffs[(3*(my&1) + ly) >> 1];
mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] >> 2;
my = s->current_picture_ptr->motion_val[dir][mv_pos][1] >> 2;
dxy = ((my & 3) << 2) | (mx & 3);
uvmx = mx & 6;
uvmy = my & 6;
}else{ }else{
mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] >> 2; mx = s->current_picture_ptr->motion_val[dir][mv_pos][0] >> 2;
my = s->current_picture_ptr->motion_val[dir][mv_pos][1] >> 2; my = s->current_picture_ptr->motion_val[dir][mv_pos][1] >> 2;
...@@ -655,15 +651,21 @@ static void rv34_mc_1mv(RV34DecContext *r, const int block_type, ...@@ -655,15 +651,21 @@ static void rv34_mc_1mv(RV34DecContext *r, const int block_type,
const int width, const int height, int dir) const int width, const int height, int dir)
{ {
rv34_mc(r, block_type, xoff, yoff, mv_off, width, height, dir, r->rv30, 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_tpel_pixels_tab
: r->s.dsp.put_h264_qpel_pixels_tab,
r->s.dsp.put_h264_chroma_pixels_tab);
} }
static void rv34_mc_2mv(RV34DecContext *r, const int block_type) static void rv34_mc_2mv(RV34DecContext *r, const int block_type)
{ {
rv34_mc(r, block_type, 0, 0, 0, 2, 2, 0, r->rv30, 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_tpel_pixels_tab
: r->s.dsp.put_h264_qpel_pixels_tab,
r->s.dsp.put_h264_chroma_pixels_tab);
rv34_mc(r, block_type, 0, 0, 0, 2, 2, 1, r->rv30, 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_tpel_pixels_tab
: r->s.dsp.avg_h264_qpel_pixels_tab,
r->s.dsp.avg_h264_chroma_pixels_tab);
} }
/** number of motion vectors in each macroblock type */ /** number of motion vectors in each macroblock type */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment