summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 29ab41dc8c..d17ffe42b4 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -895,7 +895,6 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
int P[10][2];
const int shift= 1+s->quarter_sample;
int mb_type=0;
- Picture * const pic= &s->current_picture;
init_ref(c, s->new_picture->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0);
@@ -917,8 +916,8 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
varc = s->mpvencdsp.pix_norm1(pix, s->linesize) -
(((unsigned) sum * sum) >> 8) + 500;
- pic->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
- pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
+ s->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
+ s->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
c->mb_var_sum_temp += (varc+128)>>8;
if (s->motion_est != FF_ME_ZERO) {
@@ -965,7 +964,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
vard = s->mecc.sse[0](NULL, pix, ppix, s->linesize, 16);
- pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8;
+ s->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8;
c->mc_mb_var_sum_temp += (vard+128)>>8;
if (c->avctx->mb_decision > FF_MB_DECISION_SIMPLE) {
@@ -1509,7 +1508,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
score= ((unsigned)(score*score + 128*256))>>16;
c->mc_mb_var_sum_temp += score;
- s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
+ s->mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
s->mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_DIRECT0;
return;
@@ -1574,7 +1573,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
score= ((unsigned)(score*score + 128*256))>>16;
c->mc_mb_var_sum_temp += score;
- s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
+ s->mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
}
if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){
@@ -1629,7 +1628,8 @@ int ff_get_best_fcode(MpegEncContext * s, const int16_t (*mv_table)[2], int type
continue;
for(j=0; j<fcode && j<8; j++){
- if(s->pict_type==AV_PICTURE_TYPE_B || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])
+ if (s->pict_type == AV_PICTURE_TYPE_B ||
+ s->mc_mb_var[xy] < s->mb_var[xy])
score[j]-= 170;
}
}