From 67611119b53e01cbed170c6e6926759c8355e9b8 Mon Sep 17 00:00:00 2001 From: Yury Gitman Date: Wed, 22 Jun 2016 12:20:06 -0700 Subject: cosmetics: Beautify whitespaces and line wrapping Change-Id: I9afa02cae671bd3527cf344695e53d0cc767f549 --- vp9/encoder/vp9_encodeframe.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'vp9/encoder/vp9_encodeframe.c') diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index d04ea6b5e..9f3665511 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1329,8 +1329,7 @@ static int set_segment_rdmult(VP9_COMP *const cpi, VP9_COMMON *const cm = &cpi->common; vp9_init_plane_quantizers(cpi, x); vpx_clear_system_state(); - segment_qindex = vp9_get_qindex(&cm->seg, segment_id, - cm->base_qindex); + segment_qindex = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex); return vp9_compute_rd_mult(cpi, segment_qindex + cm->y_dc_delta_q); } @@ -2729,6 +2728,7 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, break; } } + if (skip) { if (src_diff_var == UINT_MAX) { set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); @@ -2763,12 +2763,13 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, ctx->mic.interp_filter; rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &sum_rdc, subsize, pc_tree->leaf_split[0], best_rdc.rdcost); + if (sum_rdc.rate == INT_MAX) sum_rdc.rdcost = INT64_MAX; } else { for (i = 0; i < 4 && sum_rdc.rdcost < best_rdc.rdcost; ++i) { - const int x_idx = (i & 1) * mi_step; - const int y_idx = (i >> 1) * mi_step; + const int x_idx = (i & 1) * mi_step; + const int y_idx = (i >> 1) * mi_step; if (mi_row + y_idx >= cm->mi_rows || mi_col + x_idx >= cm->mi_cols) continue; @@ -2872,6 +2873,7 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, } restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize); } + // PARTITION_VERT if (partition_vert_allowed && (do_rect || vp9_active_v_edge(cpi, mi_col, mi_step))) { @@ -2954,6 +2956,8 @@ static void encode_rd_sb_row(VP9_COMP *cpi, MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; SPEED_FEATURES *const sf = &cpi->sf; + const int mi_col_start = tile_info->mi_col_start; + const int mi_col_end = tile_info->mi_col_end; int mi_col; // Initialize the left context for the new SB row @@ -2961,8 +2965,7 @@ static void encode_rd_sb_row(VP9_COMP *cpi, memset(xd->left_seg_context, 0, sizeof(xd->left_seg_context)); // Code each SB in the row - for (mi_col = tile_info->mi_col_start; mi_col < tile_info->mi_col_end; - mi_col += MI_BLOCK_SIZE) { + for (mi_col = mi_col_start; mi_col < mi_col_end; mi_col += MI_BLOCK_SIZE) { const struct segmentation *const seg = &cm->seg; int dummy_rate; int64_t dummy_dist; @@ -3762,6 +3765,8 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi, TileInfo *const tile_info = &tile_data->tile_info; MACROBLOCK *const x = &td->mb; MACROBLOCKD *const xd = &x->e_mbd; + const int mi_col_start = tile_info->mi_col_start; + const int mi_col_end = tile_info->mi_col_end; int mi_col; // Initialize the left context for the new SB row @@ -3769,8 +3774,7 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi, memset(xd->left_seg_context, 0, sizeof(xd->left_seg_context)); // Code each SB in the row - for (mi_col = tile_info->mi_col_start; mi_col < tile_info->mi_col_end; - mi_col += MI_BLOCK_SIZE) { + for (mi_col = mi_col_start; mi_col < mi_col_end; mi_col += MI_BLOCK_SIZE) { const struct segmentation *const seg = &cm->seg; RD_COST dummy_rdc; const int idx_str = cm->mi_stride * mi_row + mi_col; @@ -3981,8 +3985,7 @@ static int get_skip_encode_frame(const VP9_COMMON *cm, ThreadData *const td) { } return (intra_count << 2) < inter_count && - cm->frame_type != KEY_FRAME && - cm->show_frame; + cm->frame_type != KEY_FRAME && cm->show_frame; } void vp9_init_tile_data(VP9_COMP *cpi) { @@ -4035,14 +4038,15 @@ void vp9_encode_tile(VP9_COMP *cpi, ThreadData *td, &cpi->tile_data[tile_row * tile_cols + tile_col]; const TileInfo * const tile_info = &this_tile->tile_info; TOKENEXTRA *tok = cpi->tile_tok[tile_row][tile_col]; + const int mi_row_start = tile_info->mi_row_start; + const int mi_row_end = tile_info->mi_row_end; int mi_row; // Set up pointers to per thread motion search counters. td->mb.m_search_count_ptr = &td->rd_counts.m_search_count; td->mb.ex_search_count_ptr = &td->rd_counts.ex_search_count; - for (mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end; - mi_row += MI_BLOCK_SIZE) { + for (mi_row = mi_row_start; mi_row < mi_row_end; mi_row += MI_BLOCK_SIZE) { if (cpi->sf.use_nonrd_pick_mode) encode_nonrd_sb_row(cpi, td, this_tile, mi_row, &tok); else @@ -4169,10 +4173,10 @@ static void encode_frame_internal(VP9_COMP *cpi) { vpx_usec_timer_start(&emr_timer); #if CONFIG_FP_MB_STATS - if (cpi->use_fp_mb_stats) { - input_fpmb_stats(&cpi->twopass.firstpass_mb_stats, cm, - &cpi->twopass.this_frame_mb_stats); - } + if (cpi->use_fp_mb_stats) { + input_fpmb_stats(&cpi->twopass.firstpass_mb_stats, cm, + &cpi->twopass.this_frame_mb_stats); + } #endif // If allowed, encoding tiles in parallel with one thread handling one tile. @@ -4484,8 +4488,8 @@ static void encode_superblock(VP9_COMP *cpi, ThreadData *td, } else { mi->tx_size = (bsize >= BLOCK_8X8) ? mi->tx_size : TX_4X4; } - } + ++td->counts->tx.tx_totals[mi->tx_size]; ++td->counts->tx.tx_totals[get_uv_tx_size(mi, &xd->plane[1])]; if (cm->seg.enabled && cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) -- cgit v1.2.3