Commit 10e23004 authored by Yi Luo's avatar Yi Luo

Setup frame/tile boundary when frame/tile geometry changes

Change-Id: I44bc9d8887526a5ee92bf79730fa3ce6c73b160b
parent b9a822b4
......@@ -374,6 +374,7 @@ typedef struct AV1Common {
int log2_tile_cols, log2_tile_rows; // Used in non-large_scale_tile_coding.
int tile_cols, tile_rows;
int last_tile_cols, last_tile_rows;
int tile_width, tile_height; // In MI units
#if CONFIG_EXT_TILE
unsigned int large_scale_tile;
......
......@@ -3701,6 +3701,15 @@ static void daala_dec_init(AV1_COMMON *const cm, daala_dec_ctx *daala_dec,
}
#endif // #if CONFIG_PVQ
static void dec_setup_across_tile_boundary_info(
const AV1_COMMON *const cm, const TileInfo *const tile_info) {
if (cm->width != cm->last_width || cm->height != cm->last_height ||
cm->tile_cols != cm->last_tile_cols ||
cm->tile_rows != cm->last_tile_rows) {
av1_setup_across_tile_boundary_info(cm, tile_info);
}
}
static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end) {
AV1_COMMON *const cm = &pbi->common;
......@@ -3869,7 +3878,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
av1_zero_above_context(cm, tile_info.mi_col_start, tile_info.mi_col_end);
#endif
av1_setup_across_tile_boundary_info(cm, &tile_info);
dec_setup_across_tile_boundary_info(cm, &tile_info);
for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end;
mi_row += cm->mib_size) {
......@@ -4191,7 +4200,7 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data,
av1_tile_init(tile_info, cm, tile_row, buf->col);
av1_tile_init(&twd->xd.tile, cm, tile_row, buf->col);
av1_setup_across_tile_boundary_info(cm, tile_info);
dec_setup_across_tile_boundary_info(cm, tile_info);
setup_bool_decoder(buf->data, data_end, buf->size, &cm->error,
&twd->bit_reader,
......@@ -5246,6 +5255,22 @@ void superres_post_decode(AV1Decoder *pbi) {
}
#endif // CONFIG_FRAME_SUPERRES
static void dec_setup_frame_boundary_info(AV1_COMMON *const cm) {
if (cm->width != cm->last_width || cm->height != cm->last_height ||
cm->tile_cols != cm->last_tile_cols ||
cm->tile_rows != cm->last_tile_rows) {
int row, col;
for (row = 0; row < cm->mi_rows; ++row) {
MODE_INFO *mi = cm->mi + row * cm->mi_stride;
for (col = 0; col < cm->mi_cols; ++col) {
mi->mbmi.boundary_info = 0;
mi++;
}
}
av1_setup_frame_boundary_info(cm);
}
}
void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end, const uint8_t **p_data_end) {
AV1_COMMON *const cm = &pbi->common;
......@@ -5404,7 +5429,7 @@ void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
av1_frameworker_unlock_stats(worker);
}
av1_setup_frame_boundary_info(cm);
dec_setup_frame_boundary_info(cm);
if (pbi->max_threads > 1 && !CONFIG_CB4X4 &&
#if CONFIG_EXT_TILE
......
......@@ -492,6 +492,8 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size,
} else {
cm->last_width = cm->width;
cm->last_height = cm->height;
cm->last_tile_cols = cm->tile_cols;
cm->last_tile_rows = cm->tile_rows;
if (cm->show_frame) {
cm->current_video_frame++;
}
......
......@@ -4981,6 +4981,9 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
encode_with_recode_loop(cpi, size, dest);
}
cm->last_tile_cols = cm->tile_cols;
cm->last_tile_rows = cm->tile_rows;
#ifdef OUTPUT_YUV_SKINMAP
if (cpi->common.current_video_frame > 1) {
av1_compute_skin_map(cpi, yuv_skinmap_file);
......@@ -5179,6 +5182,7 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
#if CONFIG_EXT_REFS
}
#endif // CONFIG_EXT_REFS
aom_free(tile_ctxs);
aom_free(cdf_ptrs);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment