summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-03-10 13:55:07 -0700
committerMartin Storsjö <martin@martin.st>2013-04-19 23:18:21 +0300
commitf4fed5a2f97ec843c04af6b91a86dd237a655361 (patch)
tree6a86599304ce7c9bfbc362e5adeb0afe902c726c /libavcodec/motion_est.c
parent6caa44aa7df0ee5aba94f4cfc26a5d2cdcba8115 (diff)
mpegvideo: Use hpeldsp instead of dsputil for half-pel functions
This also converts vc1, since that is mpegvideo-based. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 99c5564544..91304c5377 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -339,9 +339,11 @@ int ff_init_me(MpegEncContext *s){
else
c->sub_motion_search= hpel_motion_search;
}
- c->hpel_avg= s->dsp.avg_pixels_tab;
- if(s->no_rounding) c->hpel_put= s->dsp.put_no_rnd_pixels_tab;
- else c->hpel_put= s->dsp.put_pixels_tab;
+ c->hpel_avg = s->hdsp.avg_pixels_tab;
+ if (s->no_rounding)
+ c->hpel_put = s->hdsp.put_no_rnd_pixels_tab;
+ else
+ c->hpel_put = s->hdsp.put_pixels_tab;
if(s->linesize){
c->stride = s->linesize;
@@ -625,9 +627,9 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
dxy = ((my4 & 1) << 1) | (mx4 & 1);
if(s->no_rounding)
- s->dsp.put_no_rnd_pixels_tab[1][dxy](dest_y , ref , stride, h);
+ s->hdsp.put_no_rnd_pixels_tab[1][dxy](dest_y , ref , stride, h);
else
- s->dsp.put_pixels_tab [1][dxy](dest_y , ref , stride, h);
+ s->hdsp.put_pixels_tab [1][dxy](dest_y , ref , stride, h);
}
dmin_sum+= (mv_penalty[mx4-pred_x4] + mv_penalty[my4-pred_y4])*c->mb_penalty_factor;
}else
@@ -666,11 +668,11 @@ static inline int h263_mv4_search(MpegEncContext *s, int mx, int my, int shift)
offset= (s->mb_x*8 + (mx>>1)) + (s->mb_y*8 + (my>>1))*s->uvlinesize;
if(s->no_rounding){
- s->dsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
- s->dsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
+ s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
+ s->hdsp.put_no_rnd_pixels_tab[1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
}else{
- s->dsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
- s->dsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
+ s->hdsp.put_pixels_tab [1][dxy](c->scratchpad , s->last_picture.f.data[1] + offset, s->uvlinesize, 8);
+ s->hdsp.put_pixels_tab [1][dxy](c->scratchpad + 8, s->last_picture.f.data[2] + offset, s->uvlinesize, 8);
}
dmin_sum += s->dsp.mb_cmp[1](s, s->new_picture.f.data[1] + s->mb_x*8 + s->mb_y*8*s->uvlinesize, c->scratchpad , s->uvlinesize, 8);
@@ -778,9 +780,9 @@ static int interlaced_search(MpegEncContext *s, int ref_index,
dxy = ((my_i & 1) << 1) | (mx_i & 1);
if(s->no_rounding){
- s->dsp.put_no_rnd_pixels_tab[size][dxy](c->scratchpad, ref , stride, h);
+ s->hdsp.put_no_rnd_pixels_tab[size][dxy](c->scratchpad, ref , stride, h);
}else{
- s->dsp.put_pixels_tab [size][dxy](c->scratchpad, ref , stride, h);
+ s->hdsp.put_pixels_tab [size][dxy](c->scratchpad, ref , stride, h);
}
dmin= s->dsp.mb_cmp[size](s, c->src[block][0], c->scratchpad, stride, h);
dmin+= (mv_penalty[mx_i-c->pred_x] + mv_penalty[my_i-c->pred_y] + 1)*c->mb_penalty_factor;
@@ -1217,14 +1219,14 @@ static inline int check_bidir_mv(MpegEncContext * s,
src_y = motion_fy >> 1;
ptr = ref_data[0] + (src_y * stride) + src_x;
- s->dsp.put_pixels_tab[size][dxy](dest_y , ptr , stride, h);
+ s->hdsp.put_pixels_tab[size][dxy](dest_y , ptr , stride, h);
dxy = ((motion_by & 1) << 1) | (motion_bx & 1);
src_x = motion_bx >> 1;
src_y = motion_by >> 1;
ptr = ref2_data[0] + (src_y * stride) + src_x;
- s->dsp.avg_pixels_tab[size][dxy](dest_y , ptr , stride, h);
+ s->hdsp.avg_pixels_tab[size][dxy](dest_y , ptr , stride, h);
}
fbmin = (mv_penalty_f[motion_fx-pred_fx] + mv_penalty_f[motion_fy-pred_fy])*c->mb_penalty_factor