int frame_over_shoot_limit;
int frame_under_shoot_limit;
int q = 0, q_low = 0, q_high = 0;
+ int enable_acl;
set_size_independent_vars(cpi);
+ enable_acl = cpi->sf.allow_acl
+ ? (cm->frame_type == KEY_FRAME) || (cm->show_frame == 0)
+ : 0;
+
do {
vpx_clear_system_state();
if (!cpi->sf.use_nonrd_pick_mode) vp9_pack_bitstream(cpi, dest, size);
rc->projected_frame_size = (int)(*size) << 3;
- restore_coding_context(cpi);
if (frame_over_shoot_limit == 0) frame_over_shoot_limit = 1;
}
++cpi->tot_recode_hits;
#endif
}
+
+ if (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF)
+ if (loop || !enable_acl) restore_coding_context(cpi);
} while (loop);
+
+ if (enable_acl) {
+ vp9_encode_frame(cpi);
+ vpx_clear_system_state();
+ restore_coding_context(cpi);
+ vp9_pack_bitstream(cpi, dest, size);
+
+ vp9_encode_frame(cpi);
+ vpx_clear_system_state();
+
+ restore_coding_context(cpi);
+ }
}
static int get_ref_frame_flags(const VP9_COMP *cpi) {
sf->mv.subpel_iters_per_step = 1;
sf->mode_skip_start = 10;
sf->adaptive_pred_interp_filter = 1;
+ sf->allow_acl = 0;
sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
sf->use_fast_coef_costing = 1;
sf->allow_exhaustive_searches = 0;
sf->exhaustive_searches_thresh = INT_MAX;
+ sf->allow_acl = 0;
if (speed >= 1) {
sf->allow_txfm_domain_distortion = 1;
sf->tx_domain_thresh = 99.0;
sf->allow_quant_coeff_opt = sf->optimize_coefficients;
sf->quant_opt_thresh = 99.0;
+ sf->allow_acl = 1;
for (i = 0; i < TX_SIZES; i++) {
sf->intra_y_mode_mask[i] = INTRA_ALL;
int allow_quant_coeff_opt;
double quant_opt_thresh;
+ // Enable asymptotic closed-loop encoding decision for key frame and
+ // alternate reference frames.
+ int allow_acl;
+
// Use transform domain distortion. Use pixel domain distortion in speed 0
// and certain situations in higher speed to improve the RD model precision.
int allow_txfm_domain_distortion;