Merge "Configure selective tile decoding" into nextgen
This commit is contained in:
commit
d8d30cfb9b
@ -68,6 +68,7 @@ typedef struct VP9Decoder {
|
||||
|
||||
#if CONFIG_ROW_TILE
|
||||
TileBuffer tile_buffers[1024][1024];
|
||||
int dec_tile_row, dec_tile_col;
|
||||
#endif
|
||||
} VP9Decoder;
|
||||
|
||||
|
@ -309,6 +309,16 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
|
||||
|
||||
cm = &ctx->pbi->common;
|
||||
|
||||
#if CONFIG_ROW_TILE
|
||||
#if CONFIG_KEY_FRAME_TILE
|
||||
ctx->pbi->dec_tile_row = ctx->cfg.tile_row;
|
||||
ctx->pbi->dec_tile_col = ctx->cfg.tile_col;
|
||||
#else
|
||||
ctx->pbi->dec_tile_row = -1;
|
||||
ctx->pbi->dec_tile_col = -1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (vp9_receive_compressed_data(ctx->pbi, data_sz, data))
|
||||
return update_error_state(ctx, &cm->error);
|
||||
|
||||
|
@ -108,6 +108,10 @@ extern "C" {
|
||||
unsigned int threads; /**< Maximum number of threads to use, default 1 */
|
||||
unsigned int w; /**< Width */
|
||||
unsigned int h; /**< Height */
|
||||
int tile_row; /**< The index of row tile to be decoded.
|
||||
Value -1 means to decode all row tiles. */
|
||||
int tile_col; /**< The index of column tile to be decoded.
|
||||
Value -1 means to decode all column tiles */
|
||||
} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */
|
||||
|
||||
|
||||
|
24
vpxdec.c
24
vpxdec.c
@ -91,6 +91,12 @@ static const arg_def_t md5arg = ARG_DEF(
|
||||
static const arg_def_t outbitdeptharg = ARG_DEF(
|
||||
NULL, "output-bit-depth", 1, "Output bit-depth for decoded frames");
|
||||
#endif
|
||||
#if CONFIG_ROW_TILE && CONFIG_KEY_FRAME_TILE
|
||||
static const arg_def_t tiler = ARG_DEF(
|
||||
NULL, "tile-row", 1, "Row tile index");
|
||||
static const arg_def_t tilec = ARG_DEF(
|
||||
NULL, "tile-column", 1, "Column tile index");
|
||||
#endif
|
||||
|
||||
static const arg_def_t *all_args[] = {
|
||||
&codecarg, &use_yv12, &use_i420, &flipuvarg, &rawvideo, &noblitarg,
|
||||
@ -99,6 +105,9 @@ static const arg_def_t *all_args[] = {
|
||||
&md5arg, &error_concealment, &continuearg,
|
||||
#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH
|
||||
&outbitdeptharg,
|
||||
#endif
|
||||
#if CONFIG_ROW_TILE && CONFIG_KEY_FRAME_TILE
|
||||
&tiler, &tilec,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
@ -561,6 +570,10 @@ int main_loop(int argc, const char **argv_) {
|
||||
#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH
|
||||
int output_bit_depth = 0;
|
||||
#endif
|
||||
#if CONFIG_ROW_TILE && CONFIG_KEY_FRAME_TILE
|
||||
int tile_row = -1;
|
||||
int tile_col = -1;
|
||||
#endif
|
||||
#if CONFIG_VP8_DECODER
|
||||
vp8_postproc_cfg_t vp8_pp_cfg = {0};
|
||||
int vp8_dbg_color_ref_frame = 0;
|
||||
@ -655,6 +668,12 @@ int main_loop(int argc, const char **argv_) {
|
||||
output_bit_depth = arg_parse_uint(&arg);
|
||||
}
|
||||
#endif
|
||||
#if CONFIG_ROW_TILE && CONFIG_KEY_FRAME_TILE
|
||||
else if (arg_match(&arg, &tiler, argi))
|
||||
tile_row = arg_parse_uint(&arg);
|
||||
else if (arg_match(&arg, &tilec, argi))
|
||||
tile_col = arg_parse_uint(&arg);
|
||||
#endif
|
||||
#if CONFIG_VP8_DECODER
|
||||
else if (arg_match(&arg, &addnoise_level, argi)) {
|
||||
postproc = 1;
|
||||
@ -793,6 +812,11 @@ int main_loop(int argc, const char **argv_) {
|
||||
if (!interface)
|
||||
interface = get_vpx_decoder_by_index(0);
|
||||
|
||||
#if CONFIG_ROW_TILE && CONFIG_KEY_FRAME_TILE
|
||||
cfg.tile_row = tile_row;
|
||||
cfg.tile_col = tile_col;
|
||||
#endif
|
||||
|
||||
dec_flags = (postproc ? VPX_CODEC_USE_POSTPROC : 0) |
|
||||
(ec_enabled ? VPX_CODEC_USE_ERROR_CONCEALMENT : 0);
|
||||
if (vpx_codec_dec_init(&decoder, interface->codec_interface(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user