Add row tile coding support in bit-stream

Fix the row tile boundary detection issues. This allows to use
more resources for parallel encoding/decoding when avaiable.

Change-Id: Ifda9f66d1d7c2567dd4e0a572a99a83f179b55f9
This commit is contained in:
Jingning Han 2015-04-07 12:23:26 -07:00
parent 9e0466d0fd
commit 7a2f9bbda4
4 changed files with 25 additions and 36 deletions

1
configure vendored
View File

@ -297,6 +297,7 @@ EXPERIMENT_LIST="
newmvref
intrabc
loop_postfilter
row_tile
"
CONFIG_LIST="
external_build

View File

@ -204,10 +204,18 @@ static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref,
static INLINE int is_inside(const TileInfo *const tile,
int mi_col, int mi_row, int mi_rows,
const POSITION *mi_pos) {
#if CONFIG_ROW_TILE
(void) mi_rows;
return !(mi_row + mi_pos->row < tile->mi_row_start ||
mi_col + mi_pos->col < tile->mi_col_start ||
mi_row + mi_pos->row >= tile->mi_row_end ||
mi_col + mi_pos->col >= tile->mi_col_end);
#else
return !(mi_row + mi_pos->row < 0 ||
mi_col + mi_pos->col < tile->mi_col_start ||
mi_row + mi_pos->row >= mi_rows ||
mi_col + mi_pos->col >= tile->mi_col_end);
#endif
}
// TODO(jingning): this mv clamping function should be block size dependent.

View File

@ -328,7 +328,11 @@ static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8;
// Are edges available for intra prediction?
#if VP9_ROW_TILE
xd->up_available = (mi_row > tile->mi_row_start);
#else
xd->up_available = (mi_row != 0);
#endif
xd->left_available = (mi_col > tile->mi_col_start);
}

View File

@ -2017,15 +2017,16 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
}
for (tile_row = 0; tile_row < tile_rows; ++tile_row) {
TileInfo tile;
vp9_tile_set_row(&tile, cm, tile_row);
for (mi_row = tile.mi_row_start; mi_row < tile.mi_row_end;
mi_row += MI_BLOCK_SIZE) {
for (tile_col = 0; tile_col < tile_cols; ++tile_col) {
for (tile_col = 0; tile_col < tile_cols; ++tile_col) {
TileInfo tile;
vp9_tile_set_row(&tile, cm, tile_row);
vp9_tile_set_col(&tile, cm, tile_col);
for (mi_row = tile.mi_row_start; mi_row < tile.mi_row_end;
mi_row += MI_BLOCK_SIZE) {
const int col = pbi->inv_tile_order ?
tile_cols - tile_col - 1 : tile_col;
tile_data = pbi->tile_data + tile_cols * tile_row + col;
vp9_tile_set_col(&tile, tile_data->cm, col);
vp9_zero(tile_data->xd.left_context);
vp9_zero(tile_data->xd.left_seg_context);
for (mi_col = tile.mi_col_start; mi_col < tile.mi_col_end;
@ -2039,39 +2040,14 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
}
pbi->mb.corrupted |= tile_data->xd.corrupted;
}
#if !CONFIG_INTRABC
// Loopfilter one row.
if (!pbi->mb.corrupted && cm->lf.filter_level) {
const int lf_start = mi_row - MI_BLOCK_SIZE;
LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1;
// delay the loopfilter by 1 macroblock row.
if (lf_start < 0) continue;
// decoding has completed: finish up the loop filter in this thread.
if (mi_row + MI_BLOCK_SIZE >= cm->mi_rows) continue;
winterface->sync(&pbi->lf_worker);
lf_data->start = lf_start;
lf_data->stop = mi_row;
if (pbi->max_threads > 1) {
winterface->launch(&pbi->lf_worker);
} else {
winterface->execute(&pbi->lf_worker);
}
}
#endif // !CONFIG_INTRABC
}
}
// Loopfilter remaining rows in the frame.
if (!pbi->mb.corrupted && cm->lf.filter_level) {
LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1;
winterface->sync(&pbi->lf_worker);
lf_data->start = lf_data->stop;
lf_data->stop = cm->mi_rows;
winterface->execute(&pbi->lf_worker);
}
#if !CONFIG_INTRABC
if (cm->lf.filter_level > 0)
vp9_loop_filter_frame(get_frame_new_buffer(cm), cm,
&pbi->mb, cm->lf.filter_level, 0, 0);
#endif
// Get last tile data.
tile_data = pbi->tile_data + tile_cols * tile_rows - 1;