//VARIANCE_INVOKE(&cpi->rtcd.variance, satd16x16)
best_err = VARIANCE_INVOKE(&cpi->rtcd.variance, sad16x16)
(xd->dst.y_buffer, xd->dst.y_stride,
- xd->predictor, 16, best_err);
+ xd->predictor, 16, INT_MAX);
/* restore UMV window */
x->mv_col_min = tmp_col_min;
err = VARIANCE_INVOKE(&cpi->rtcd.variance, sad16x16)
(xd->predictor, 16,
buf->y_buffer + mb_y_offset,
- buf->y_stride, err);
+ buf->y_stride, best_err);
// find best
if (err < best_err)
{
&frame_stats->mb_stats[offset + mb_col];
int altref_err = mb_stats->ref[ALTREF_FRAME].err;
-
- int intra_err =
- mb_stats->ref[INTRA_FRAME ].err + 250;
-
- int golden_err =
- mb_stats->ref[GOLDEN_FRAME].err + 250;
+ int intra_err = mb_stats->ref[INTRA_FRAME ].err;
+ int golden_err = mb_stats->ref[GOLDEN_FRAME].err;
// Test for altref vs intra and gf and that its mv was 0,0.
if ( (altref_err > 1000) ||
// being a GF - so exit if we don't look ahead beyond that
if (n_frames <= cpi->frames_till_gf_update_due)
return;
+ if( n_frames > cpi->common.frames_till_alt_ref_frame)
+ n_frames = cpi->common.frames_till_alt_ref_frame;
if (n_frames > MAX_LAG_BUFFERS)
n_frames = MAX_LAG_BUFFERS;
ratey = cost_coeffs(x, b, PLANE_TYPE_Y_WITH_DC, &tempa, &templ);
rate += ratey;
- distortion = ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), berr)(be->coeff, b->dqcoeff) >> 2;
+ distortion = ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), berr)(
+ be->coeff, b->dqcoeff) >> 2;
this_rd = RDCOST(x->rdmult, x->rddiv, rate, distortion);
vp8_quantize_mbuv(x);
rate_to = rd_cost_mbuv(x);
- rate = rate_to + x->intra_uv_mode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context->mbmi.uv_mode];
+ rate = rate_to
+ + x->intra_uv_mode_cost[x->e_mbd.frame_type]
+ [x->e_mbd.mode_info_context->mbmi.uv_mode];
distortion = ENCODEMB_INVOKE(&cpi->rtcd.encodemb, mbuverr)(x) / 4;
return cost;
}
-static unsigned int vp8_encode_inter_mb_segment(MACROBLOCK *x, int const *labels, int which_label, const vp8_encodemb_rtcd_vtable_t *rtcd)
+static unsigned int vp8_encode_inter_mb_segment(
+ MACROBLOCK *x,
+ int const *labels,
+ int which_label,
+ const VP8_ENCODER_RTCD *rtcd)
{
int i;
unsigned int distortion = 0;
{
BLOCKD *bd = &x->e_mbd.block[i];
BLOCK *be = &x->block[i];
-
+ int thisdistortion;
vp8_build_inter_predictors_b(bd, 16, x->e_mbd.subpixel_predict);
- ENCODEMB_INVOKE(rtcd, subb)(be, bd, 16);
+ ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, bd, 16);
x->vp8_short_fdct4x4(be->src_diff, be->coeff, 32);
// set to 0 no way to account for 2nd order DC so discount
//be->coeff[0] = 0;
x->quantize_b(be, bd);
-
- distortion += ENCODEMB_INVOKE(rtcd, berr)(be->coeff, bd->dqcoeff);
+ thisdistortion = ENCODEMB_INVOKE(&rtcd->encodemb,berr)(
+ be->coeff,
+ bd->dqcoeff)/4;
+ distortion += thisdistortion;
}
}
-
return distortion;
}
continue;
}
- distortion = vp8_encode_inter_mb_segment(x, labels, i, IF_RTCD(&cpi->rtcd.encodemb)) / 4;
+ distortion = vp8_encode_inter_mb_segment(
+ x, labels, i,
+ IF_RTCD(&cpi->rtcd));
labelyrate = rdcost_mbsegment_y(x, labels, i, ta_s, tl_s);
rate += labelyrate;