Commit 3a4445bd authored by Janne Grunau's avatar Janne Grunau

API/scalable: add all_layers Dav1dSettings

Refs #188, adds a dav1d CLI option. Defaults to 1 to allow adjustment of the
tests of scalable bitstreams.
parent 0eafb6f5
......@@ -47,6 +47,7 @@ typedef struct Dav1dSettings {
Dav1dPicAllocator allocator;
int apply_grain;
int operating_point; ///< select an operating point for scalable AV1 bitstreams (0 - 31)
int all_layers; ///< output all spatial layers of a scalable AV1 biststream
} Dav1dSettings;
/**
......
......@@ -118,6 +118,7 @@ struct Dav1dContext {
int apply_grain;
int operating_point;
unsigned operating_point_idc;
int all_layers;
};
struct Dav1dFrameContext {
......
......@@ -63,6 +63,7 @@ void dav1d_default_settings(Dav1dSettings *const s) {
s->allocator.alloc_picture_callback = default_picture_allocator;
s->allocator.release_picture_callback = default_picture_release;
s->operating_point = 0;
s->all_layers = 1; // just until the tests are adjusted
}
int dav1d_open(Dav1dContext **const c_out,
......@@ -91,6 +92,7 @@ int dav1d_open(Dav1dContext **const c_out,
c->allocator = s->allocator;
c->apply_grain = s->apply_grain;
c->operating_point = s->operating_point;
c->all_layers = s->all_layers;
c->n_fc = s->n_frame_threads;
c->fc = dav1d_alloc_aligned(sizeof(*c->fc) * s->n_frame_threads, 32);
if (!c->fc) goto error;
......
......@@ -50,6 +50,7 @@ enum {
ARG_VERIFY,
ARG_FILM_GRAIN,
ARG_OPPOINT,
ARG_ALL_LAYERS,
};
static const struct option long_opts[] = {
......@@ -66,6 +67,7 @@ static const struct option long_opts[] = {
{ "verify", 1, NULL, ARG_VERIFY },
{ "filmgrain", 1, NULL, ARG_FILM_GRAIN },
{ "oppoint", 1, NULL, ARG_OPPOINT },
{ "alllayers", 1, NULL, ARG_ALL_LAYERS },
{ NULL, 0, NULL, 0 },
};
......@@ -91,7 +93,8 @@ static void usage(const char *const app, const char *const reason, ...) {
" --framethreads $num: number of frame threads (default: 1)\n"
" --tilethreads $num: number of tile threads (default: 1)\n"
" --filmgrain enable film grain application (default: 1, except if muxer is md5)\n"
" --oppoint $num: select an operating point for scalable AV1 (0 - 32)\n"
" --oppoint $num: select an operating point of a scalable AV1 bitstream (0 - 32)\n"
" --alllayers $num: output all spatial layers of a scalable AV1 bitstream (default: 1)\n"
" --verify $md5: verify decoded md5. implies --muxer md5, no output\n");
exit(1);
}
......@@ -175,6 +178,10 @@ void parse(const int argc, char *const *const argv,
lib_settings->operating_point =
parse_unsigned(optarg, ARG_OPPOINT, argv[0]);
break;
case ARG_ALL_LAYERS:
lib_settings->all_layers =
!!parse_unsigned(optarg, ARG_ALL_LAYERS, argv[0]);
break;
case 'v':
fprintf(stderr, "%s\n", dav1d_version());
exit(0);
......
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