Removing direct references to VP9_COMP.
Change-Id: Ic37624d807884e71f08b50fd04892f03f2708ba7
This commit is contained in:
@@ -110,14 +110,12 @@ static int cost_segmap(int *segcounts, vp9_prob *probs) {
|
||||
return cost;
|
||||
}
|
||||
|
||||
static void count_segs(VP9_COMP *cpi, const TileInfo *const tile,
|
||||
MODE_INFO **mi,
|
||||
static void count_segs(const VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||
const TileInfo *tile, MODE_INFO **mi,
|
||||
int *no_pred_segcounts,
|
||||
int (*temporal_predictor_count)[2],
|
||||
int *t_unpred_seg_counts,
|
||||
int bw, int bh, int mi_row, int mi_col) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
||||
int segment_id;
|
||||
|
||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||
@@ -151,14 +149,13 @@ static void count_segs(VP9_COMP *cpi, const TileInfo *const tile,
|
||||
}
|
||||
}
|
||||
|
||||
static void count_segs_sb(VP9_COMP *cpi, const TileInfo *const tile,
|
||||
MODE_INFO **mi,
|
||||
static void count_segs_sb(const VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||
const TileInfo *tile, MODE_INFO **mi,
|
||||
int *no_pred_segcounts,
|
||||
int (*temporal_predictor_count)[2],
|
||||
int *t_unpred_seg_counts,
|
||||
int mi_row, int mi_col,
|
||||
BLOCK_SIZE bsize) {
|
||||
const VP9_COMMON *const cm = &cpi->common;
|
||||
const int mis = cm->mi_stride;
|
||||
int bw, bh;
|
||||
const int bs = num_8x8_blocks_wide_lookup[bsize], hbs = bs / 2;
|
||||
@@ -170,18 +167,18 @@ static void count_segs_sb(VP9_COMP *cpi, const TileInfo *const tile,
|
||||
bh = num_8x8_blocks_high_lookup[mi[0]->mbmi.sb_type];
|
||||
|
||||
if (bw == bs && bh == bs) {
|
||||
count_segs(cpi, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||
count_segs(cm, xd, tile, 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, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||
t_unpred_seg_counts, bs, hbs, mi_row, mi_col);
|
||||
count_segs(cpi, tile, mi + hbs * mis, no_pred_segcounts,
|
||||
count_segs(cm, xd, tile, 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, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||
t_unpred_seg_counts, hbs, bs, mi_row, mi_col);
|
||||
count_segs(cpi, tile, mi + hbs,
|
||||
count_segs(cm, xd, tile, mi + hbs,
|
||||
no_pred_segcounts, temporal_predictor_count, t_unpred_seg_counts,
|
||||
hbs, bs, mi_row, mi_col + hbs);
|
||||
} else {
|
||||
@@ -194,7 +191,7 @@ static void count_segs_sb(VP9_COMP *cpi, const TileInfo *const tile,
|
||||
const int mi_dc = hbs * (n & 1);
|
||||
const int mi_dr = hbs * (n >> 1);
|
||||
|
||||
count_segs_sb(cpi, tile, &mi[mi_dr * mis + mi_dc],
|
||||
count_segs_sb(cm, xd, tile, &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);
|
||||
@@ -202,8 +199,7 @@ static void count_segs_sb(VP9_COMP *cpi, const TileInfo *const tile,
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_choose_segmap_coding_method(VP9_COMP *cpi) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
void vp9_choose_segmap_coding_method(VP9_COMMON *cm, MACROBLOCKD *xd) {
|
||||
struct segmentation *seg = &cm->seg;
|
||||
|
||||
int no_pred_cost;
|
||||
@@ -237,7 +233,7 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) {
|
||||
MODE_INFO **mi = mi_ptr;
|
||||
for (mi_col = tile.mi_col_start; mi_col < tile.mi_col_end;
|
||||
mi_col += 8, mi += 8)
|
||||
count_segs_sb(cpi, &tile, mi, no_pred_segcounts,
|
||||
count_segs_sb(cm, xd, &tile, mi, no_pred_segcounts,
|
||||
temporal_predictor_count, t_unpred_seg_counts,
|
||||
mi_row, mi_col, BLOCK_64X64);
|
||||
}
|
||||
|
Reference in New Issue
Block a user