Commit b25ba508 authored by Thomas Davies's avatar Thomas Davies

Remove the CONFIG_TILE_GROUPS experimental flag.

Tile groups are now an integral part of the codec.

Change-Id: I620a88ec7a44b057d5cce0bf6cf602822a3339a9
parent f99e9ed4
......@@ -418,14 +418,12 @@ static const arg_def_t qm_min = ARG_DEF(
static const arg_def_t qm_max = ARG_DEF(
NULL, "qm-max", 1, "Max quant matrix flatness (0..15), default is 16");
#endif
#if CONFIG_TILE_GROUPS
static const arg_def_t num_tg = ARG_DEF(
NULL, "num-tile-groups", 1, "Maximum number of tile groups, default is 1");
static const arg_def_t mtu_size =
ARG_DEF(NULL, "mtu-size", 1,
"MTU size for a tile group, default is 0 (no MTU targeting), "
"overrides maximum number of tile groups");
#endif
#if CONFIG_TEMPMV_SIGNALING
static const arg_def_t disable_tempmv = ARG_DEF(
NULL, "disable-tempmv", 1, "Disable temporal mv prediction (default is 0)");
......@@ -581,10 +579,8 @@ static const arg_def_t *av1_args[] = { &cpu_used_av1,
#if CONFIG_EXT_PARTITION
&superblock_size,
#endif // CONFIG_EXT_PARTITION
#if CONFIG_TILE_GROUPS
&num_tg,
&mtu_size,
#endif
#if CONFIG_TEMPMV_SIGNALING
&disable_tempmv,
#endif
......@@ -639,10 +635,8 @@ static const int av1_arg_ctrl_map[] = { AOME_SET_CPUUSED,
#if CONFIG_EXT_PARTITION
AV1E_SET_SUPERBLOCK_SIZE,
#endif // CONFIG_EXT_PARTITION
#if CONFIG_TILE_GROUPS
AV1E_SET_NUM_TG,
AV1E_SET_MTU,
#endif
#if CONFIG_TEMPMV_SIGNALING
AV1E_SET_DISABLE_TEMPMV,
#endif
......
......@@ -55,10 +55,8 @@ struct av1_extracfg {
unsigned int qm_min;
unsigned int qm_max;
#endif
#if CONFIG_TILE_GROUPS
unsigned int num_tg;
unsigned int mtu_size;
#endif
#if CONFIG_TEMPMV_SIGNALING
unsigned int disable_tempmv;
#endif
......@@ -121,10 +119,8 @@ static struct av1_extracfg default_extra_cfg = {
DEFAULT_QM_FIRST, // qm_min
DEFAULT_QM_LAST, // qm_max
#endif
#if CONFIG_TILE_GROUPS
1, // max number of tile groups
0, // mtu_size
#endif
#if CONFIG_TEMPMV_SIGNALING
0, // disable temporal mv prediction
#endif
......@@ -482,14 +478,12 @@ static aom_codec_err_t set_encoder_config(
oxcf->qm_maxlevel = extra_cfg->qm_max;
#endif
#if CONFIG_TILE_GROUPS
oxcf->num_tile_groups = extra_cfg->num_tg;
#if CONFIG_EXT_TILE
// In large-scale tile encoding mode, num_tile_groups is always 1.
if (cfg->large_scale_tile) oxcf->num_tile_groups = 1;
#endif // CONFIG_EXT_TILE
oxcf->mtu = extra_cfg->mtu_size;
#endif
#if CONFIG_TEMPMV_SIGNALING
oxcf->disable_tempmv = extra_cfg->disable_tempmv;
......@@ -869,7 +863,6 @@ static aom_codec_err_t ctrl_set_qm_max(aom_codec_alg_priv_t *ctx,
}
#endif
#if CONFIG_TILE_GROUPS
static aom_codec_err_t ctrl_set_num_tg(aom_codec_alg_priv_t *ctx,
va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg;
......@@ -882,7 +875,6 @@ static aom_codec_err_t ctrl_set_mtu(aom_codec_alg_priv_t *ctx, va_list args) {
extra_cfg.mtu_size = CAST(AV1E_SET_MTU, args);
return update_extra_cfg(ctx, &extra_cfg);
}
#endif
#if CONFIG_TEMPMV_SIGNALING
static aom_codec_err_t ctrl_set_disable_tempmv(aom_codec_alg_priv_t *ctx,
va_list args) {
......@@ -1545,10 +1537,8 @@ static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
{ AV1E_SET_QM_MIN, ctrl_set_qm_min },
{ AV1E_SET_QM_MAX, ctrl_set_qm_max },
#endif
#if CONFIG_TILE_GROUPS
{ AV1E_SET_NUM_TG, ctrl_set_num_tg },
{ AV1E_SET_MTU, ctrl_set_mtu },
#endif
#if CONFIG_TEMPMV_SIGNALING
{ AV1E_SET_DISABLE_TEMPMV, ctrl_set_disable_tempmv },
#endif
......
......@@ -196,11 +196,7 @@ static INLINE int is_inside(const TileInfo *const tile, int mi_col, int mi_row,
const int dependent_horz_tile_flag = 0;
(void)cm;
#endif
#if CONFIG_TILE_GROUPS
if (dependent_horz_tile_flag && !tile->tg_horz_boundary) {
#else
if (dependent_horz_tile_flag) {
#endif
return !(mi_row + mi_pos->row < 0 ||
mi_col + mi_pos->col < tile->mi_col_start ||
mi_row + mi_pos->row >= mi_rows ||
......
......@@ -365,11 +365,9 @@ typedef struct AV1Common {
#if CONFIG_DEPENDENT_HORZTILES
int dependent_horz_tiles;
#if CONFIG_TILE_GROUPS
int tile_group_start_row[MAX_TILE_ROWS][MAX_TILE_COLS];
int tile_group_start_col[MAX_TILE_ROWS][MAX_TILE_COLS];
#endif
#endif
#if CONFIG_LOOPFILTERING_ACROSS_TILES
int loop_filter_across_tiles_enabled;
#endif // CONFIG_LOOPFILTERING_ACROSS_TILES
......@@ -427,9 +425,7 @@ typedef struct AV1Common {
int delta_lf_res;
#endif
#endif
#if CONFIG_TILE_GROUPS
int num_tg;
#endif
#if CONFIG_REFERENCE_BUFFER
int current_frame_id;
int ref_frame_id[REF_FRAMES];
......@@ -654,11 +650,7 @@ static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
#if CONFIG_DEPENDENT_HORZTILES
if (dependent_horz_tile_flag) {
#if CONFIG_TILE_GROUPS
xd->up_available = (mi_row > tile->mi_row_start) || !tile->tg_horz_boundary;
#else
xd->up_available = (mi_row > 0);
#endif // CONFIG_TILE_GROUPS
} else {
#endif // CONFIG_DEPENDENT_HORZTILES
// Are edges available for intra prediction?
......
......@@ -23,7 +23,7 @@ void av1_tile_set_col(TileInfo *tile, const AV1_COMMON *cm, int col) {
tile->mi_col_end = AOMMIN(tile->mi_col_start + cm->tile_width, cm->mi_cols);
}
#if CONFIG_DEPENDENT_HORZTILES && CONFIG_TILE_GROUPS
#if CONFIG_DEPENDENT_HORZTILES
void av1_tile_set_tg_boundary(TileInfo *tile, const AV1_COMMON *const cm,
int row, int col) {
if (row < cm->tile_rows - 1) {
......@@ -41,7 +41,7 @@ void av1_tile_set_tg_boundary(TileInfo *tile, const AV1_COMMON *const cm,
void av1_tile_init(TileInfo *tile, const AV1_COMMON *cm, int row, int col) {
av1_tile_set_row(tile, cm, row);
av1_tile_set_col(tile, cm, col);
#if CONFIG_DEPENDENT_HORZTILES && CONFIG_TILE_GROUPS
#if CONFIG_DEPENDENT_HORZTILES
av1_tile_set_tg_boundary(tile, cm, row, col);
#endif
}
......@@ -119,11 +119,7 @@ void av1_setup_across_tile_boundary_info(const AV1_COMMON *const cm,
int row, col;
#if CONFIG_DEPENDENT_HORZTILES
#if CONFIG_TILE_GROUPS
if (!cm->dependent_horz_tiles || tile_info->tg_horz_boundary)
#else
if (!cm->dependent_horz_tiles)
#endif // CONFIG_TILE_GROUPS
#endif // CONFIG_DEPENDENT_HORZTILES
{
mi = mi_start;
......
......@@ -20,9 +20,7 @@ extern "C" {
struct AV1Common;
#if CONFIG_TILE_GROUPS
#define DEFAULT_MAX_NUM_TG 1
#endif
typedef struct TileInfo {
int mi_row_start, mi_row_end;
......@@ -37,7 +35,7 @@ void av1_tile_init(TileInfo *tile, const struct AV1Common *cm, int row,
void av1_tile_set_row(TileInfo *tile, const struct AV1Common *cm, int row);
void av1_tile_set_col(TileInfo *tile, const struct AV1Common *cm, int col);
#if CONFIG_DEPENDENT_HORZTILES && CONFIG_TILE_GROUPS
#if CONFIG_DEPENDENT_HORZTILES
void av1_tile_set_tg_boundary(TileInfo *tile, const struct AV1Common *const cm,
int row, int col);
#endif
......
......@@ -3361,16 +3361,12 @@ static void read_tile_info(AV1Decoder *const pbi,
cm->tile_width = ALIGN_POWER_OF_TWO(cm->tile_width, MAX_MIB_SIZE_LOG2);
cm->tile_height = ALIGN_POWER_OF_TWO(cm->tile_height, MAX_MIB_SIZE_LOG2);
// tile size magnitude
#if !CONFIG_TILE_GROUPS
if (cm->tile_rows > 1 || cm->tile_cols > 1)
#endif
pbi->tile_size_bytes = aom_rb_read_literal(rb, 2) + 1;
// tile size magnitude
pbi->tile_size_bytes = aom_rb_read_literal(rb, 2) + 1;
#if CONFIG_EXT_TILE
}
#endif // CONFIG_EXT_TILE
#if CONFIG_TILE_GROUPS
// Store an index to the location of the tile group information
pbi->tg_size_bit_offset = rb->bit_offset;
pbi->tg_size = 1 << (cm->log2_tile_rows + cm->log2_tile_cols);
......@@ -3380,7 +3376,6 @@ static void read_tile_info(AV1Decoder *const pbi,
pbi->tg_size =
1 + aom_rb_read_literal(rb, cm->log2_tile_rows + cm->log2_tile_cols);
}
#endif
}
static int mem_get_varsize(const uint8_t *src, int sz) {
......@@ -3581,7 +3576,6 @@ static void get_tile_buffers(
AV1Decoder *pbi, const uint8_t *data, const uint8_t *data_end,
TileBufferDec (*const tile_buffers)[MAX_TILE_COLS]) {
AV1_COMMON *const cm = &pbi->common;
#if CONFIG_TILE_GROUPS
int r, c;
const int tile_cols = cm->tile_cols;
const int tile_rows = cm->tile_rows;
......@@ -3628,21 +3622,6 @@ static void get_tile_buffers(
#endif
}
}
#else
int r, c;
const int tile_cols = cm->tile_cols;
const int tile_rows = cm->tile_rows;
for (r = 0; r < tile_rows; ++r) {
for (c = 0; c < tile_cols; ++c) {
const int is_last = (r == tile_rows - 1) && (c == tile_cols - 1);
TileBufferDec *const buf = &tile_buffers[r][c];
buf->col = c;
get_tile_buffer(data_end, pbi->tile_size_bytes, is_last, &cm->error,
&data, pbi->decrypt_cb, pbi->decrypt_state, buf);
}
}
#endif
}
#if CONFIG_PVQ
......@@ -3853,13 +3832,9 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
av1_tile_set_col(&tile_info, cm, col);
#if CONFIG_DEPENDENT_HORZTILES
#if CONFIG_TILE_GROUPS
av1_tile_set_tg_boundary(&tile_info, cm, tile_row, tile_col);
if (!cm->dependent_horz_tiles || tile_row == 0 ||
tile_info.tg_horz_boundary) {
#else
if (!cm->dependent_horz_tiles || tile_row == 0) {
#endif
av1_zero_above_context(cm, tile_info.mi_col_start,
tile_info.mi_col_end);
}
......@@ -4004,11 +3979,7 @@ static int tile_worker_hook(TileWorkerData *const tile_data,
tile_data->error_info.setjmp = 1;
tile_data->xd.error_info = &tile_data->error_info;
#if CONFIG_DEPENDENT_HORZTILES
#if CONFIG_TILE_GROUPS
if (!cm->dependent_horz_tiles || tile->tg_horz_boundary) {
#else
if (!cm->dependent_horz_tiles) {
#endif
av1_zero_above_context(&pbi->common, tile->mi_col_start, tile->mi_col_end);
}
#else
......@@ -5253,10 +5224,8 @@ void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
}
#endif // CONFIG_EXT_TILE
#if CONFIG_TILE_GROUPS
pbi->first_partition_size = first_partition_size;
pbi->uncomp_hdr_size = aom_rb_bytes_read(&rb);
#endif
new_fb = get_frame_new_buffer(cm);
xd->cur_buf = new_fb;
#if CONFIG_INTRABC
......
......@@ -135,11 +135,9 @@ typedef struct AV1Decoder {
#endif
size_t uncomp_hdr_size; // Size of the uncompressed header
size_t first_partition_size; // Size of the compressed header
#if CONFIG_TILE_GROUPS
int tg_size; // Number of tiles in the current tilegroup
int tg_start; // First tile in the current tilegroup
int tg_size; // Number of tiles in the current tilegroup
int tg_start; // First tile in the current tilegroup
int tg_size_bit_offset;
#endif
#if CONFIG_REFERENCE_BUFFER
SequenceHeader seq_params;
#endif
......
This diff is collapsed.
......@@ -4774,12 +4774,8 @@ void av1_encode_tile(AV1_COMP *cpi, ThreadData *td, int tile_row,
int mi_row;
#if CONFIG_DEPENDENT_HORZTILES
#if CONFIG_TILE_GROUPS
if ((!cm->dependent_horz_tiles) || (tile_row == 0) ||
tile_info->tg_horz_boundary) {
#else
if ((!cm->dependent_horz_tiles) || (tile_row == 0)) {
#endif
av1_zero_above_context(cm, tile_info->mi_col_start, tile_info->mi_col_end);
}
#else
......
......@@ -140,14 +140,10 @@ static void build_nmv_component_cost_table(int *mvcost,
static void update_mv(aom_writer *w, const unsigned int ct[2], aom_prob *cur_p,
aom_prob upd_p) {
(void)upd_p;
#if CONFIG_TILE_GROUPS
// Just use the default maximum number of tile groups to avoid passing in the
// actual
// number
av1_cond_prob_diff_update(w, cur_p, ct, DEFAULT_MAX_NUM_TG);
#else
av1_cond_prob_diff_update(w, cur_p, ct, 1);
#endif
}
void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
......
......@@ -827,7 +827,7 @@ void av1_new_framerate(AV1_COMP *cpi, double framerate) {
static void set_tile_info(AV1_COMP *cpi) {
AV1_COMMON *const cm = &cpi->common;
#if CONFIG_TILE_GROUPS && CONFIG_DEPENDENT_HORZTILES
#if CONFIG_DEPENDENT_HORZTILES
int tile_row, tile_col, num_tiles_in_tg;
int tg_row_start, tg_col_start;
#endif
......@@ -901,7 +901,6 @@ static void set_tile_info(AV1_COMP *cpi) {
}
#endif // CONFIG_EXT_TILE
#if CONFIG_TILE_GROUPS
#if CONFIG_EXT_TILE
if (!cm->large_scale_tile) {
#endif // CONFIG_EXT_TILE
......@@ -930,7 +929,6 @@ static void set_tile_info(AV1_COMP *cpi) {
}
#endif // CONFIG_EXT_TILE
#endif
#endif
#if CONFIG_LOOPFILTERING_ACROSS_TILES
cm->loop_filter_across_tiles_enabled =
......@@ -4733,7 +4731,6 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
cm->reset_frame_context = RESET_FRAME_CONTEXT_CURRENT;
}
}
#if CONFIG_TILE_GROUPS
if (cpi->oxcf.mtu == 0) {
cm->num_tg = cpi->oxcf.num_tile_groups;
} else {
......@@ -4741,7 +4738,6 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
// updates
cm->num_tg = DEFAULT_MAX_NUM_TG;
}
#endif
#if CONFIG_EXT_TILE
cm->large_scale_tile = cpi->oxcf.large_scale_tile;
......
......@@ -202,10 +202,8 @@ typedef struct AV1EncoderConfig {
int qm_minlevel;
int qm_maxlevel;
#endif
#if CONFIG_TILE_GROUPS
unsigned int num_tile_groups;
unsigned int mtu;
#endif
#if CONFIG_TEMPMV_SIGNALING
unsigned int disable_tempmv;
......
......@@ -300,11 +300,7 @@ void av1_choose_segmap_coding_method(AV1_COMMON *cm, MACROBLOCKD *xd) {
int t_pred_cost = INT_MAX;
int tile_col, tile_row, mi_row, mi_col;
#if CONFIG_TILE_GROUPS
const int probwt = cm->num_tg;
#else
const int probwt = 1;
#endif
unsigned(*temporal_predictor_count)[2] = cm->counts.seg.pred;
unsigned *no_pred_segcounts = cm->counts.seg.tree_total;
......@@ -329,7 +325,7 @@ void av1_choose_segmap_coding_method(AV1_COMMON *cm, MACROBLOCKD *xd) {
for (tile_col = 0; tile_col < cm->tile_cols; tile_col++) {
MODE_INFO **mi_ptr;
av1_tile_set_col(&tile_info, cm, tile_col);
#if CONFIG_TILE_GROUPS && CONFIG_DEPENDENT_HORZTILES
#if CONFIG_DEPENDENT_HORZTILES
av1_tile_set_tg_boundary(&tile_info, cm, tile_row, tile_col);
#endif
mi_ptr = cm->mi_grid_visible + tile_info.mi_row_start * cm->mi_stride +
......
......@@ -139,7 +139,6 @@ set(CONFIG_ADAPT_SCAN 0 CACHE NUMBER "Internal flag.")
set(CONFIG_FILTER_7BIT 1 CACHE NUMBER "Internal flag.")
set(CONFIG_PARALLEL_DEBLOCKING 1 CACHE NUMBER "Internal flag.")
set(CONFIG_LOOPFILTERING_ACROSS_TILES 1 CACHE NUMBER "Internal flag.")
set(CONFIG_TILE_GROUPS 1 CACHE NUMBER "Internal flag.")
set(CONFIG_TEMPMV_SIGNALING 1 CACHE NUMBER "Internal flag.")
set(CONFIG_RD_DEBUG 0 CACHE NUMBER "Internal flag.")
set(CONFIG_REFERENCE_BUFFER 1 CACHE NUMBER "Internal flag.")
......
......@@ -304,7 +304,6 @@ EXPERIMENT_LIST="
filter_7bit
parallel_deblocking
loopfiltering_across_tiles
tile_groups
tempmv_signaling
rd_debug
reference_buffer
......@@ -444,7 +443,6 @@ CMDLINE_SELECT="
highbitdepth
experimental
colorspace_headers
tile_groups
"
process_cmdline() {
......@@ -496,7 +494,6 @@ post_process_cmdline() {
soft_enable filter_7bit
soft_enable reference_buffer
soft_enable delta_q
soft_enable tile_groups
soft_enable rect_tx
soft_enable global_motion
soft_enable ext_tx
......
......@@ -38,4 +38,4 @@ class TempFileDeleter {
} // namespace libwebm
#endif // LIBWEBM_COMMON_FILE_UTIL_H_
\ No newline at end of file
#endif // LIBWEBM_COMMON_FILE_UTIL_H_
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