Refactor internal tile_info variables to support 1024 tiles
Move the 2D tile info arrays as global variables. This resolves the local function stack overflow issue due to excessively large tile info variables. This allows the internal operation to support up to 1024 row and column tiles. Change-Id: I6644cc929e5d3a778a5c03a712ebfc0b8729f576
This commit is contained in:
parent
8e3099aa2b
commit
225097a7ed
@ -1893,12 +1893,6 @@ static void setup_tile_info(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef struct TileBuffer {
|
||||
const uint8_t *data;
|
||||
size_t size;
|
||||
int col; // only used with multi-threaded decoding
|
||||
} TileBuffer;
|
||||
|
||||
// Reads the next tile returning its size and adjusting '*data' accordingly
|
||||
// based on 'is_last'.
|
||||
static void get_tile_buffer(const uint8_t *const data_end,
|
||||
@ -1939,7 +1933,7 @@ static void get_tile_buffer(const uint8_t *const data_end,
|
||||
static void get_tile_buffers(VP9Decoder *pbi,
|
||||
const uint8_t *data, const uint8_t *data_end,
|
||||
int tile_cols, int tile_rows,
|
||||
TileBuffer (*tile_buffers)[1 << 6]) {
|
||||
TileBuffer (*tile_buffers)[1024]) {
|
||||
int r, c;
|
||||
|
||||
for (r = 0; r < tile_rows; ++r) {
|
||||
@ -1962,9 +1956,9 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
|
||||
const int tile_cols = 1 << cm->log2_tile_cols;
|
||||
const int tile_rows = 1 << cm->log2_tile_rows;
|
||||
#if CONFIG_ROW_TILE
|
||||
TileBuffer tile_buffers[64][64];
|
||||
TileBuffer (*tile_buffers)[1024] = pbi->tile_buffers;
|
||||
#else
|
||||
TileBuffer tile_buffers[4][1 << 6];
|
||||
TileBuffer tile_buffers[4][1024];
|
||||
#endif
|
||||
int tile_row, tile_col;
|
||||
int mi_row, mi_col;
|
||||
@ -2138,6 +2132,8 @@ static int compare_tile_buffers(const void *a, const void *b) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(jingning): Multi-thread tile decoding is not supporting
|
||||
// arbitrary row/column tile numbers yet.
|
||||
static const uint8_t *decode_tiles_mt(VP9Decoder *pbi,
|
||||
const uint8_t *data,
|
||||
const uint8_t *data_end) {
|
||||
@ -2148,7 +2144,7 @@ static const uint8_t *decode_tiles_mt(VP9Decoder *pbi,
|
||||
const int tile_cols = 1 << cm->log2_tile_cols;
|
||||
const int tile_rows = 1 << cm->log2_tile_rows;
|
||||
const int num_workers = MIN(pbi->max_threads & ~1, tile_cols);
|
||||
TileBuffer tile_buffers[1][1 << 6];
|
||||
TileBuffer tile_buffers[1][1024];
|
||||
int n;
|
||||
int final_worker = -1;
|
||||
|
||||
|
@ -33,6 +33,12 @@ typedef struct TileData {
|
||||
DECLARE_ALIGNED(16, MACROBLOCKD, xd);
|
||||
} TileData;
|
||||
|
||||
typedef struct TileBuffer {
|
||||
const uint8_t *data;
|
||||
size_t size;
|
||||
int col; // only used with multi-threaded decoding
|
||||
} TileBuffer;
|
||||
|
||||
typedef struct VP9Decoder {
|
||||
DECLARE_ALIGNED(16, MACROBLOCKD, mb);
|
||||
|
||||
@ -59,6 +65,10 @@ typedef struct VP9Decoder {
|
||||
int max_threads;
|
||||
int inv_tile_order;
|
||||
int need_resync; // wait for key/intra-only frame
|
||||
|
||||
#if CONFIG_ROW_TILE
|
||||
TileBuffer tile_buffers[1024][1024];
|
||||
#endif
|
||||
} VP9Decoder;
|
||||
|
||||
int vp9_receive_compressed_data(struct VP9Decoder *pbi,
|
||||
|
@ -4537,8 +4537,8 @@ static void encode_tiles(VP9_COMP *cpi) {
|
||||
|
||||
int tile_col, tile_row;
|
||||
#if CONFIG_ROW_TILE
|
||||
TileInfo tile[64][64];
|
||||
TOKENEXTRA *tok[64][64];
|
||||
TileInfo (*tile)[1024] = cpi->tile_info;
|
||||
TOKENEXTRA *(*tok)[1024] = cpi->tile_tok;
|
||||
#else
|
||||
TileInfo tile[4][1 << 6];
|
||||
TOKENEXTRA *tok[4][1 << 6];
|
||||
|
@ -426,6 +426,11 @@ typedef struct VP9_COMP {
|
||||
int multi_arf_enabled;
|
||||
int multi_arf_last_grp_enabled;
|
||||
|
||||
#if CONFIG_ROW_TILE
|
||||
TileInfo tile_info[1024][1024];
|
||||
TOKENEXTRA *tile_tok[1024][1024];
|
||||
#endif
|
||||
|
||||
#if CONFIG_VP9_TEMPORAL_DENOISING
|
||||
VP9_DENOISER denoiser;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user