#endif // CONFIG_VP9_HIGHBITDEPTH
#if !CONFIG_REALTIME_ONLY
+#if CONFIG_FP_MB_STATS
static unsigned int get_sby_perpixel_diff_variance(VP9_COMP *cpi,
const struct buf_2d *ref,
int mi_row, int mi_col,
var = cpi->fn_ptr[bs].vf(ref->buf, ref->stride, last_y, last->y_stride, &sse);
return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
}
+#endif
-static BLOCK_SIZE get_rd_var_based_fixed_partition(VP9_COMP *cpi, MACROBLOCK *x,
- int mi_row, int mi_col) {
- unsigned int var = get_sby_perpixel_diff_variance(
- cpi, &x->plane[0].src, mi_row, mi_col, BLOCK_64X64);
- if (var < 8)
- return BLOCK_64X64;
- else if (var < 128)
- return BLOCK_32X32;
- else if (var < 2048)
- return BLOCK_16X16;
- else
- return BLOCK_8X8;
-}
#endif // !CONFIG_REALTIME_ONLY
static void set_segment_index(VP9_COMP *cpi, MACROBLOCK *const x, int mi_row,
set_fixed_partitioning(cpi, tile_info, mi, mi_row, mi_col, bsize);
rd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, BLOCK_64X64,
&dummy_rate, &dummy_dist, 1, td->pc_root);
- } else if (cpi->partition_search_skippable_frame) {
- BLOCK_SIZE bsize;
- set_offsets(cpi, tile_info, x, mi_row, mi_col, BLOCK_64X64);
- bsize = get_rd_var_based_fixed_partition(cpi, x, mi_row, mi_col);
- set_fixed_partitioning(cpi, tile_info, mi, mi_row, mi_col, bsize);
- rd_use_partition(cpi, td, tile_data, mi, tp, mi_row, mi_col, BLOCK_64X64,
- &dummy_rate, &dummy_dist, 1, td->pc_root);
} else if (sf->partition_search_type == VAR_BASED_PARTITION &&
cm->frame_type != KEY_FRAME) {
choose_partitioning(cpi, tile_info, x, mi_row, mi_col);
vp9_init_rd_parameters(cpi);
init_frame_indexes(cm);
- cpi->partition_search_skippable_frame = 0;
cpi->tile_data = NULL;
realloc_segmentation_maps(cpi);
TileDataEnc *tile_data;
int allocated_tiles; // Keep track of memory allocated for tiles.
- // For a still frame, this flag is set to 1 to skip partition search.
- int partition_search_skippable_frame;
-
int scaled_ref_idx[REFS_PER_FRAME];
int lst_fb_idx;
int gld_fb_idx;
}
}
-static int is_skippable_frame(const VP9_COMP *cpi) {
- // If the current frame does not have non-zero motion vector detected in the
- // first pass, and so do its previous and forward frames, then this frame
- // can be skipped for partition check, and the partition size is assigned
- // according to the variance
- const TWO_PASS *const twopass = &cpi->twopass;
-
- return (!frame_is_intra_only(&cpi->common) &&
- twopass->stats_in - 2 > twopass->stats_in_start &&
- twopass->stats_in < twopass->stats_in_end &&
- (twopass->stats_in - 1)->pcnt_inter -
- (twopass->stats_in - 1)->pcnt_motion ==
- 1 &&
- (twopass->stats_in - 2)->pcnt_inter -
- (twopass->stats_in - 2)->pcnt_motion ==
- 1 &&
- twopass->stats_in->pcnt_inter - twopass->stats_in->pcnt_motion == 1);
-}
-
// Configure image size specific vizier parameters.
// Later these will be set via additional command line options
void vp9_init_vizier_params(TWO_PASS *const twopass, int screen_area) {
cm->frame_type = INTER_FRAME;
- // Do the firstpass stats indicate that this frame is skippable for the
- // partition search?
- if (cpi->sf.allow_partition_search_skip && cpi->oxcf.pass == 2 &&
- !cpi->use_svc) {
- cpi->partition_search_skippable_frame = is_skippable_frame(cpi);
- }
-
// The multiplication by 256 reverses a scaling factor of (>> 8)
// applied when combining MB error values for the frame.
twopass->mb_av_energy = log((this_frame.intra_error * 256.0) + 1.0);
vp9_configure_buffer_updates(cpi, gf_group->index);
- // Do the firstpass stats indicate that this frame is skippable for the
- // partition search?
- if (cpi->sf.allow_partition_search_skip && cpi->oxcf.pass == 2 &&
- !cpi->use_svc) {
- cpi->partition_search_skippable_frame = is_skippable_frame(cpi);
- }
-
rc->base_frame_target = gf_group->bit_allocation[gf_group->index];
// The multiplication by 256 reverses a scaling factor of (>> 8)
sf->intra_y_mode_mask[TX_32X32] = INTRA_DC;
sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC;
sf->adaptive_interp_filter_search = 1;
- sf->allow_partition_search_skip = 0;
if (cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) {
for (i = 0; i < MAX_MESH_STEP; ++i) {
sf->max_delta_qindex = 0;
sf->disable_filter_search_var_thresh = 0;
sf->adaptive_interp_filter_search = 0;
- sf->allow_partition_search_skip = 0;
sf->allow_txfm_domain_distortion = 0;
sf->tx_domain_thresh = 99.0;
sf->allow_quant_coeff_opt = sf->optimize_coefficients;
int prune_rect_thresh[4];
} rd_ml_partition;
- // Allow skipping partition search for still image frame
- int allow_partition_search_skip;
-
// Fast approximation of vp9_model_rd_from_var_lapndz
int simple_model_rd_from_var;