]> git.sesse.net Git - ffmpeg/commitdiff
Add options for spatial layers.
authorThierry Foucu <tfoucu@gmail.com>
Thu, 28 Nov 2019 00:25:33 +0000 (16:25 -0800)
committerJames Almer <jamrial@gmail.com>
Thu, 28 Nov 2019 13:21:20 +0000 (10:21 -0300)
Disable by default to output all the layers, to match libaomdec wrapper.
Add option to select the operating point for the spatial layers.
Update the documentation with the new options.

Signed-off-by: James Almer <jamrial@gmail.com>
doc/decoders.texi
libavcodec/libdav1d.c
libavcodec/version.h

index 676e062e72a72d78ed003446b01753997f7b7104..f18226b3504a891470a2a215c2004e98ae59ff31 100644 (file)
@@ -71,6 +71,13 @@ Set amount of tile threads to use during decoding. The default value is 0 (autod
 Apply film grain to the decoded video if present in the bitstream. Defaults to the
 internal default of the library.
 
+@item oppoint
+Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
+internal default of the library.
+
+@item alllayers
+Output all spatial layers of a scalable AV1 bitstream. The default value is false.
+
 @end table
 
 @section libdavs2
index cf4b178f1d9da7b78084b476b984d53d33b2bf62..5248e3f9f56ffe7d48f4f0d3f84182c87f80c8d6 100644 (file)
@@ -40,6 +40,8 @@ typedef struct Libdav1dContext {
     int tile_threads;
     int frame_threads;
     int apply_grain;
+    int operating_point;
+    int all_layers;
 } Libdav1dContext;
 
 static const enum AVPixelFormat pix_fmt[][3] = {
@@ -134,6 +136,10 @@ static av_cold int libdav1d_init(AVCodecContext *c)
     if (dav1d->apply_grain >= 0)
         s.apply_grain = dav1d->apply_grain;
 
+    s.all_layers = dav1d->all_layers;
+    if (dav1d->operating_point >= 0)
+        s.operating_point = dav1d->operating_point;
+
     s.n_tile_threads = dav1d->tile_threads
                      ? dav1d->tile_threads
                      : FFMIN(floor(sqrt(threads)), DAV1D_MAX_TILE_THREADS);
@@ -378,6 +384,8 @@ static const AVOption libdav1d_options[] = {
     { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
     { "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
     { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
+    { "oppoint",  "Select an operating point of the scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 31, VD },
+    { "alllayers", "Output all spatial layers", OFFSET(all_layers), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
     { NULL }
 };
 
index efa9d743f7c4ffc87efcd5ffea622b826f82c52c..8b9c27378c2bd33829cc49fca42cd1167f7af4d1 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  64
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \