Merge "Support up to 64 row tile coding" into nextgen

This commit is contained in:
Jingning Han 2015-05-21 22:23:42 +00:00 committed by Gerrit Code Review
commit ad5ede6e36
4 changed files with 25 additions and 5 deletions

View File

@ -1885,7 +1885,7 @@ static void setup_tile_info(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
if (cm->log2_tile_rows > 10) if (cm->log2_tile_rows > 10)
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
"Invalid number of tile columns"); "Invalid number of tile rows");
#else #else
cm->log2_tile_rows = vp9_rb_read_bit(rb); cm->log2_tile_rows = vp9_rb_read_bit(rb);
if (cm->log2_tile_rows) if (cm->log2_tile_rows)
@ -1961,7 +1961,11 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
const int aligned_cols = mi_cols_aligned_to_sb(cm->mi_cols); const int aligned_cols = mi_cols_aligned_to_sb(cm->mi_cols);
const int tile_cols = 1 << cm->log2_tile_cols; const int tile_cols = 1 << cm->log2_tile_cols;
const int tile_rows = 1 << cm->log2_tile_rows; const int tile_rows = 1 << cm->log2_tile_rows;
#if CONFIG_ROW_TILE
TileBuffer tile_buffers[64][64];
#else
TileBuffer tile_buffers[4][1 << 6]; TileBuffer tile_buffers[4][1 << 6];
#endif
int tile_row, tile_col; int tile_row, tile_col;
int mi_row, mi_col; int mi_row, mi_col;
TileData *tile_data = NULL; TileData *tile_data = NULL;
@ -1988,8 +1992,13 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
vp9_loop_filter_frame_init(cm, cm->lf.filter_level); vp9_loop_filter_frame_init(cm, cm->lf.filter_level);
} }
#if CONFIG_ROW_TILE
assert(tile_rows <= (1 << 6));
assert(tile_cols <= (1 << 6));
#else
assert(tile_rows <= 4); assert(tile_rows <= 4);
assert(tile_cols <= (1 << 6)); assert(tile_cols <= (1 << 6));
#endif
// Note: this memset assumes above_context[0], [1] and [2] // Note: this memset assumes above_context[0], [1] and [2]
// are allocated as part of the same buffer. // are allocated as part of the same buffer.

View File

@ -4536,8 +4536,13 @@ static void encode_tiles(VP9_COMP *cpi) {
const int tile_rows = 1 << cm->log2_tile_rows; const int tile_rows = 1 << cm->log2_tile_rows;
int tile_col, tile_row; int tile_col, tile_row;
#if CONFIG_ROW_TILE
TileInfo tile[64][64];
TOKENEXTRA *tok[64][64];
#else
TileInfo tile[4][1 << 6]; TileInfo tile[4][1 << 6];
TOKENEXTRA *tok[4][1 << 6]; TOKENEXTRA *tok[4][1 << 6];
#endif
TOKENEXTRA *pre_tok = cpi->tok; TOKENEXTRA *pre_tok = cpi->tok;
int tile_tok = 0; int tile_tok = 0;

View File

@ -572,12 +572,18 @@ void vp9_new_framerate(VP9_COMP *cpi, double framerate) {
static void set_tile_limits(VP9_COMP *cpi) { static void set_tile_limits(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common; VP9_COMMON *const cm = &cpi->common;
int min_log2_tile_cols, max_log2_tile_cols; int min_log2_tiles, max_log2_tiles;
vp9_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols); vp9_get_tile_n_bits(cm->mi_cols, &min_log2_tiles, &max_log2_tiles);
cm->log2_tile_cols = clamp(cpi->oxcf.tile_columns, cm->log2_tile_cols = clamp(cpi->oxcf.tile_columns,
min_log2_tile_cols, max_log2_tile_cols); min_log2_tiles, max_log2_tiles);
#if CONFIG_ROW_TILE
vp9_get_tile_n_bits(cm->mi_rows, &min_log2_tiles, &max_log2_tiles);
cm->log2_tile_rows = clamp(cpi->oxcf.tile_rows,
min_log2_tiles, max_log2_tiles);
#else
cm->log2_tile_rows = cpi->oxcf.tile_rows; cm->log2_tile_rows = cpi->oxcf.tile_rows;
#endif
} }
static void init_buffer_indices(VP9_COMP *cpi) { static void init_buffer_indices(VP9_COMP *cpi) {

View File

@ -208,7 +208,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
RANGE_CHECK(extra_cfg, cpu_used, -16, 16); RANGE_CHECK(extra_cfg, cpu_used, -16, 16);
RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6); RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6);
RANGE_CHECK(extra_cfg, tile_columns, 0, 6); RANGE_CHECK(extra_cfg, tile_columns, 0, 6);
RANGE_CHECK(extra_cfg, tile_rows, 0, 2); RANGE_CHECK(extra_cfg, tile_rows, 0, 6);
RANGE_CHECK_HI(extra_cfg, sharpness, 7); RANGE_CHECK_HI(extra_cfg, sharpness, 7);
RANGE_CHECK(extra_cfg, arnr_max_frames, 0, 15); RANGE_CHECK(extra_cfg, arnr_max_frames, 0, 15);
RANGE_CHECK_HI(extra_cfg, arnr_strength, 6); RANGE_CHECK_HI(extra_cfg, arnr_strength, 6);