diff options
author | James Zern <jzern@google.com> | 2013-09-09 14:38:01 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-09-09 14:38:01 -0700 |
commit | c1913c9cf4a1f5a417349ad59dc81ca8397fd456 (patch) | |
tree | 11b75d722c713ea39b331718c5c4266d1a5b5f52 /vp9/encoder/vp9_segmentation.c | |
parent | 132ef4295a40f9159205e9253c18fff9130f69eb (diff) | |
parent | 54a03e20ddffd1fd9abf960daa74572cf173a5c8 (diff) | |
download | libvpx-c1913c9cf4a1f5a417349ad59dc81ca8397fd456.tar libvpx-c1913c9cf4a1f5a417349ad59dc81ca8397fd456.tar.gz libvpx-c1913c9cf4a1f5a417349ad59dc81ca8397fd456.tar.bz2 libvpx-c1913c9cf4a1f5a417349ad59dc81ca8397fd456.zip |
Merge "Revert "New mode_info_context storage""
Diffstat (limited to 'vp9/encoder/vp9_segmentation.c')
-rw-r--r-- | vp9/encoder/vp9_segmentation.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/vp9/encoder/vp9_segmentation.c b/vp9/encoder/vp9_segmentation.c index 10655e8a7..0a6d2abe2 100644 --- a/vp9/encoder/vp9_segmentation.c +++ b/vp9/encoder/vp9_segmentation.c @@ -117,7 +117,7 @@ static int cost_segmap(int *segcounts, vp9_prob *probs) { return cost; } -static void count_segs(VP9_COMP *cpi, MODE_INFO **mi_8x8, +static void count_segs(VP9_COMP *cpi, MODE_INFO *mi, int *no_pred_segcounts, int (*temporal_predictor_count)[2], int *t_unpred_seg_counts, @@ -129,8 +129,8 @@ static void count_segs(VP9_COMP *cpi, MODE_INFO **mi_8x8, if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; - segment_id = mi_8x8[0]->mbmi.segment_id; - + segment_id = mi->mbmi.segment_id; + xd->mode_info_context = mi; set_mi_row_col(cm, xd, mi_row, bh, mi_col, bw); // Count the number of hits on each segment with no prediction @@ -138,7 +138,7 @@ static void count_segs(VP9_COMP *cpi, MODE_INFO **mi_8x8, // Temporal prediction not allowed on key frames if (cm->frame_type != KEY_FRAME) { - const BLOCK_SIZE bsize = mi_8x8[0]->mbmi.sb_type; + const BLOCK_SIZE bsize = mi->mbmi.sb_type; // Test to see if the segment id matches the predicted value. const int pred_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map, bsize, mi_row, mi_col); @@ -147,7 +147,7 @@ static void count_segs(VP9_COMP *cpi, MODE_INFO **mi_8x8, // Store the prediction status for this mb and update counts // as appropriate - vp9_set_pred_flag_seg_id(xd, pred_flag); + vp9_set_pred_flag_seg_id(cm, bsize, mi_row, mi_col, pred_flag); temporal_predictor_count[pred_context][pred_flag]++; if (!pred_flag) @@ -156,7 +156,7 @@ static void count_segs(VP9_COMP *cpi, MODE_INFO **mi_8x8, } } -static void count_segs_sb(VP9_COMP *cpi, MODE_INFO **mi_8x8, +static void count_segs_sb(VP9_COMP *cpi, MODE_INFO *mi, int *no_pred_segcounts, int (*temporal_predictor_count)[2], int *t_unpred_seg_counts, @@ -170,22 +170,21 @@ static void count_segs_sb(VP9_COMP *cpi, MODE_INFO **mi_8x8, if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) return; - bw = num_8x8_blocks_wide_lookup[mi_8x8[0]->mbmi.sb_type]; - bh = num_8x8_blocks_high_lookup[mi_8x8[0]->mbmi.sb_type]; + bw = num_8x8_blocks_wide_lookup[mi->mbmi.sb_type]; + bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type]; if (bw == bs && bh == bs) { - count_segs(cpi, mi_8x8, no_pred_segcounts, temporal_predictor_count, + count_segs(cpi, mi, no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, bs, bs, mi_row, mi_col); } else if (bw == bs && bh < bs) { - count_segs(cpi, mi_8x8, no_pred_segcounts, temporal_predictor_count, + count_segs(cpi, mi, no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, bs, hbs, mi_row, mi_col); - count_segs(cpi, mi_8x8 + hbs * mis, no_pred_segcounts, - temporal_predictor_count, t_unpred_seg_counts, bs, hbs, - mi_row + hbs, mi_col); + count_segs(cpi, mi + hbs * mis, no_pred_segcounts, temporal_predictor_count, + t_unpred_seg_counts, bs, hbs, mi_row + hbs, mi_col); } else if (bw < bs && bh == bs) { - count_segs(cpi, mi_8x8, no_pred_segcounts, temporal_predictor_count, + count_segs(cpi, mi, no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, hbs, bs, mi_row, mi_col); - count_segs(cpi, mi_8x8 + hbs, no_pred_segcounts, temporal_predictor_count, + count_segs(cpi, mi + hbs, no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, hbs, bs, mi_row, mi_col + hbs); } else { const BLOCK_SIZE subsize = subsize_lookup[PARTITION_SPLIT][bsize]; @@ -197,7 +196,7 @@ static void count_segs_sb(VP9_COMP *cpi, MODE_INFO **mi_8x8, const int mi_dc = hbs * (n & 1); const int mi_dr = hbs * (n >> 1); - count_segs_sb(cpi, &mi_8x8[mi_dr * mis + mi_dc], + count_segs_sb(cpi, &mi[mi_dr * mis + mi_dc], no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts, mi_row + mi_dr, mi_col + mi_dc, subsize); @@ -223,7 +222,7 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) { vp9_prob t_nopred_prob[PREDICTION_PROBS]; const int mis = cm->mode_info_stride; - MODE_INFO **mi_ptr, **mi; + MODE_INFO *mi_ptr, *mi; // Set default state for the segment tree probabilities and the // temporal coding probabilities @@ -234,7 +233,7 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) { // predicts this one for (tile_col = 0; tile_col < 1 << cm->log2_tile_cols; tile_col++) { vp9_get_tile_col_offsets(cm, tile_col); - mi_ptr = cm->mi_grid_visible + cm->cur_tile_mi_col_start; + mi_ptr = cm->mi + cm->cur_tile_mi_col_start; for (mi_row = 0; mi_row < cm->mi_rows; mi_row += 8, mi_ptr += 8 * mis) { mi = mi_ptr; |