|
|
|
@ -923,7 +923,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, |
|
|
|
|
c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp); |
|
|
|
|
c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp); |
|
|
|
|
c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp); |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV; |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV; |
|
|
|
|
|
|
|
|
|
get_limits(s, 16*mb_x, 16*mb_y); |
|
|
|
|
c->skip=0; |
|
|
|
@ -1090,7 +1090,7 @@ int ff_pre_estimate_p_frame_motion(MpegEncContext * s, |
|
|
|
|
av_assert0(s->quarter_sample==0 || s->quarter_sample==1); |
|
|
|
|
|
|
|
|
|
c->pre_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_pre_cmp); |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV; |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV; |
|
|
|
|
|
|
|
|
|
get_limits(s, 16*mb_x, 16*mb_y); |
|
|
|
|
c->skip=0; |
|
|
|
@ -1139,7 +1139,7 @@ static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y, |
|
|
|
|
const int shift= 1+s->quarter_sample; |
|
|
|
|
const int mot_stride = s->mb_stride; |
|
|
|
|
const int mot_xy = mb_y*mot_stride + mb_x; |
|
|
|
|
uint8_t * const mv_penalty= c->mv_penalty[f_code] + MAX_MV; |
|
|
|
|
uint8_t * const mv_penalty= c->mv_penalty[f_code] + MAX_DMV; |
|
|
|
|
int mv_scale; |
|
|
|
|
|
|
|
|
|
c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp); |
|
|
|
@ -1203,8 +1203,8 @@ static inline int check_bidir_mv(MpegEncContext * s, |
|
|
|
|
//FIXME better f_code prediction (max mv & distance)
|
|
|
|
|
//FIXME pointers
|
|
|
|
|
MotionEstContext * const c= &s->me; |
|
|
|
|
uint8_t * const mv_penalty_f= c->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
|
|
|
|
|
uint8_t * const mv_penalty_b= c->mv_penalty[s->b_code] + MAX_MV; // f_code of the prev frame
|
|
|
|
|
uint8_t * const mv_penalty_f= c->mv_penalty[s->f_code] + MAX_DMV; // f_code of the prev frame
|
|
|
|
|
uint8_t * const mv_penalty_b= c->mv_penalty[s->b_code] + MAX_DMV; // f_code of the prev frame
|
|
|
|
|
int stride= c->stride; |
|
|
|
|
uint8_t *dest_y = c->scratchpad; |
|
|
|
|
uint8_t *ptr; |
|
|
|
@ -1417,7 +1417,7 @@ static inline int direct_search(MpegEncContext * s, int mb_x, int mb_y) |
|
|
|
|
int mx, my, xmin, xmax, ymin, ymax; |
|
|
|
|
int16_t (*mv_table)[2]= s->b_direct_mv_table; |
|
|
|
|
|
|
|
|
|
c->current_mv_penalty= c->mv_penalty[1] + MAX_MV; |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[1] + MAX_DMV; |
|
|
|
|
ymin= xmin=(-32)>>shift; |
|
|
|
|
ymax= xmax= 31>>shift; |
|
|
|
|
|
|
|
|
@ -1553,11 +1553,11 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, |
|
|
|
|
if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) { |
|
|
|
|
//FIXME mb type penalty
|
|
|
|
|
c->skip=0; |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV; |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_DMV; |
|
|
|
|
fimin= interlaced_search(s, 0, |
|
|
|
|
s->b_field_mv_table[0], s->b_field_select_table[0], |
|
|
|
|
s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 0); |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV; |
|
|
|
|
c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_DMV; |
|
|
|
|
bimin= interlaced_search(s, 2, |
|
|
|
|
s->b_field_mv_table[1], s->b_field_select_table[1], |
|
|
|
|
s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 0); |
|
|
|
|