summaryrefslogtreecommitdiffstats
path: root/third_party/aom/apps/aomdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/apps/aomdec.c')
-rw-r--r--third_party/aom/apps/aomdec.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/third_party/aom/apps/aomdec.c b/third_party/aom/apps/aomdec.c
index 6c4d724a4..48952586f 100644
--- a/third_party/aom/apps/aomdec.c
+++ b/third_party/aom/apps/aomdec.c
@@ -83,6 +83,8 @@ static const arg_def_t outputfile =
ARG_DEF("o", "output", 1, "Output file name pattern (see below)");
static const arg_def_t threadsarg =
ARG_DEF("t", "threads", 1, "Max threads to use");
+static const arg_def_t rowmtarg =
+ ARG_DEF(NULL, "row-mt", 1, "Enable row based multi-threading");
static const arg_def_t verbosearg =
ARG_DEF("v", "verbose", 0, "Show version string");
static const arg_def_t scalearg =
@@ -114,12 +116,12 @@ static const arg_def_t outallarg = ARG_DEF(
NULL, "all-layers", 0, "Output all decoded frames of a scalable bitstream");
static const arg_def_t *all_args[] = {
- &help, &codecarg, &use_yv12, &use_i420, &flipuvarg,
- &rawvideo, &noblitarg, &progressarg, &limitarg, &skiparg,
- &postprocarg, &summaryarg, &outputfile, &threadsarg, &verbosearg,
- &scalearg, &fb_arg, &md5arg, &framestatsarg, &continuearg,
- &outbitdeptharg, &tilem, &tiler, &tilec, &isannexb,
- &oppointarg, &outallarg, NULL
+ &help, &codecarg, &use_yv12, &use_i420, &flipuvarg,
+ &rawvideo, &noblitarg, &progressarg, &limitarg, &skiparg,
+ &postprocarg, &summaryarg, &outputfile, &threadsarg, &rowmtarg,
+ &verbosearg, &scalearg, &fb_arg, &md5arg, &framestatsarg,
+ &continuearg, &outbitdeptharg, &tilem, &tiler, &tilec,
+ &isannexb, &oppointarg, &outallarg, NULL
};
#if CONFIG_LIBYUV
@@ -512,6 +514,7 @@ static int main_loop(int argc, const char **argv_) {
int do_scale = 0;
int operating_point = 0;
int output_all_layers = 0;
+ unsigned int row_mt = 0;
aom_image_t *scaled_img = NULL;
aom_image_t *img_shifted = NULL;
int frame_avail, got_data, flush_decoder = 0;
@@ -601,6 +604,15 @@ static int main_loop(int argc, const char **argv_) {
summary = 1;
} else if (arg_match(&arg, &threadsarg, argi)) {
cfg.threads = arg_parse_uint(&arg);
+#if !CONFIG_MULTITHREAD
+ if (cfg.threads > 1) {
+ die("Error: --threads=%d is not supported when CONFIG_MULTITHREAD = "
+ "0.\n",
+ cfg.threads);
+ }
+#endif
+ } else if (arg_match(&arg, &rowmtarg, argi)) {
+ row_mt = arg_parse_uint(&arg);
} else if (arg_match(&arg, &verbosearg, argi)) {
quiet = 0;
} else if (arg_match(&arg, &scalearg, argi)) {
@@ -763,6 +775,11 @@ static int main_loop(int argc, const char **argv_) {
aom_codec_error(&decoder));
goto fail;
}
+
+ if (aom_codec_control(&decoder, AV1D_SET_ROW_MT, row_mt)) {
+ fprintf(stderr, "Failed to set row_mt: %s\n", aom_codec_error(&decoder));
+ goto fail;
+ }
#endif
if (arg_skip) fprintf(stderr, "Skipping first %d frames.\n", arg_skip);
@@ -910,9 +927,8 @@ static int main_loop(int argc, const char **argv_) {
// Shift up or down if necessary
if (output_bit_depth != 0) {
const aom_img_fmt_t shifted_fmt =
- output_bit_depth == 8
- ? img->fmt ^ (img->fmt & AOM_IMG_FMT_HIGHBITDEPTH)
- : img->fmt | AOM_IMG_FMT_HIGHBITDEPTH;
+ output_bit_depth == 8 ? img->fmt & ~AOM_IMG_FMT_HIGHBITDEPTH
+ : img->fmt | AOM_IMG_FMT_HIGHBITDEPTH;
if (shifted_fmt != img->fmt || output_bit_depth != img->bit_depth) {
if (img_shifted &&