Fix seg fault in count_segs_sb with ext_partitions
Change-Id: I609f429006e7d2b849fe0a509f5d9f5123ecf0ec
This commit is contained in:
parent
d0e9499f94
commit
3a3fb8d100
@ -159,6 +159,9 @@ static void count_segs_sb(const VP9_COMMON *cm, MACROBLOCKD *xd,
|
|||||||
const int mis = cm->mi_stride;
|
const int mis = cm->mi_stride;
|
||||||
int bw, bh;
|
int bw, bh;
|
||||||
const int bs = num_8x8_blocks_wide_lookup[bsize], hbs = bs / 2;
|
const int bs = num_8x8_blocks_wide_lookup[bsize], hbs = bs / 2;
|
||||||
|
#if CONFIG_EXT_PARTITION
|
||||||
|
PARTITION_TYPE partition;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
|
||||||
return;
|
return;
|
||||||
@ -166,6 +169,93 @@ static void count_segs_sb(const VP9_COMMON *cm, MACROBLOCKD *xd,
|
|||||||
bw = num_8x8_blocks_wide_lookup[mi[0].src_mi->mbmi.sb_type];
|
bw = num_8x8_blocks_wide_lookup[mi[0].src_mi->mbmi.sb_type];
|
||||||
bh = num_8x8_blocks_high_lookup[mi[0].src_mi->mbmi.sb_type];
|
bh = num_8x8_blocks_high_lookup[mi[0].src_mi->mbmi.sb_type];
|
||||||
|
|
||||||
|
#if CONFIG_EXT_PARTITION
|
||||||
|
if (bsize == BLOCK_8X8)
|
||||||
|
partition = PARTITION_NONE;
|
||||||
|
else
|
||||||
|
partition = get_partition(cm->mi, cm->mi_stride, cm->mi_rows, cm->mi_cols,
|
||||||
|
mi_row, mi_col, bsize);
|
||||||
|
switch (partition) {
|
||||||
|
case PARTITION_NONE:
|
||||||
|
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, bs, bs, mi_row, mi_col);
|
||||||
|
break;
|
||||||
|
case PARTITION_HORZ:
|
||||||
|
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, bs, hbs, mi_row, mi_col);
|
||||||
|
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);
|
||||||
|
break;
|
||||||
|
case PARTITION_VERT:
|
||||||
|
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, bs, mi_row, mi_col);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs,
|
||||||
|
no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, bs, mi_row, mi_col + hbs);
|
||||||
|
break;
|
||||||
|
case PARTITION_HORZ_A:
|
||||||
|
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, hbs, mi_row, mi_col);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs, no_pred_segcounts,
|
||||||
|
temporal_predictor_count, t_unpred_seg_counts, hbs, hbs,
|
||||||
|
mi_row, mi_col + hbs);
|
||||||
|
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);
|
||||||
|
break;
|
||||||
|
case PARTITION_HORZ_B:
|
||||||
|
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, bs, hbs, mi_row, mi_col);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs * mis, no_pred_segcounts,
|
||||||
|
temporal_predictor_count, t_unpred_seg_counts, hbs, hbs,
|
||||||
|
mi_row + hbs, mi_col);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs + hbs * mis, no_pred_segcounts,
|
||||||
|
temporal_predictor_count, t_unpred_seg_counts, hbs, hbs,
|
||||||
|
mi_row + hbs, mi_col + hbs);
|
||||||
|
break;
|
||||||
|
case PARTITION_VERT_A:
|
||||||
|
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, hbs, mi_row, mi_col);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs * mis, no_pred_segcounts,
|
||||||
|
temporal_predictor_count, t_unpred_seg_counts, hbs, hbs,
|
||||||
|
mi_row + hbs, mi_col);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs,
|
||||||
|
no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, bs, mi_row, mi_col + hbs);
|
||||||
|
break;
|
||||||
|
case PARTITION_VERT_B:
|
||||||
|
count_segs(cm, xd, tile, mi, no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, bs, mi_row, mi_col);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs,
|
||||||
|
no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, hbs, mi_row, mi_col + hbs);
|
||||||
|
count_segs(cm, xd, tile, mi + hbs + hbs * mis,
|
||||||
|
no_pred_segcounts, temporal_predictor_count,
|
||||||
|
t_unpred_seg_counts, hbs, hbs, mi_row + hbs, mi_col + hbs);
|
||||||
|
break;
|
||||||
|
case PARTITION_SPLIT:
|
||||||
|
{
|
||||||
|
const BLOCK_SIZE subsize = subsize_lookup[PARTITION_SPLIT][bsize];
|
||||||
|
int n;
|
||||||
|
|
||||||
|
assert(bw < bs && bh < bs);
|
||||||
|
|
||||||
|
for (n = 0; n < 4; n++) {
|
||||||
|
const int mi_dc = hbs * (n & 1);
|
||||||
|
const int mi_dr = hbs * (n >> 1);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (bw == bs && bh == bs) {
|
if (bw == bs && bh == bs) {
|
||||||
count_segs(cm, xd, 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);
|
t_unpred_seg_counts, bs, bs, mi_row, mi_col);
|
||||||
@ -197,6 +287,7 @@ static void count_segs_sb(const VP9_COMMON *cm, MACROBLOCKD *xd,
|
|||||||
mi_row + mi_dr, mi_col + mi_dc, subsize);
|
mi_row + mi_dr, mi_col + mi_dc, subsize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp9_choose_segmap_coding_method(VP9_COMMON *cm, MACROBLOCKD *xd) {
|
void vp9_choose_segmap_coding_method(VP9_COMMON *cm, MACROBLOCKD *xd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user