ref: e5e3cabeb94d2104d2229384498ad323d7c7656c
parent: 197a19ad702d5e7472852efcde98feeb07f373e0
author: James Almer <jamrial@gmail.com>
date: Mon Nov 26 09:02:10 EST 2018
dav1d: add public defines for max amount of tile and frame threads Otherwise the library user will have to guess and find out the limit the hard way.
--- a/include/dav1d/dav1d.h
+++ b/include/dav1d/dav1d.h
@@ -41,6 +41,9 @@
typedef struct Dav1dContext Dav1dContext;
typedef struct Dav1dRef Dav1dRef;
+#define DAV1D_MAX_FRAME_THREADS 256
+#define DAV1D_MAX_TILE_THREADS 64
+
typedef struct Dav1dSettings {
int n_frame_threads;
int n_tile_threads;
--- a/src/lib.c
+++ b/src/lib.c
@@ -75,9 +75,9 @@
validate_input_or_ret(c_out != NULL, -EINVAL);
validate_input_or_ret(s != NULL, -EINVAL);
validate_input_or_ret(s->n_tile_threads >= 1 &&
- s->n_tile_threads <= 64, -EINVAL);
+ s->n_tile_threads <= DAV1D_MAX_TILE_THREADS, -EINVAL);
validate_input_or_ret(s->n_frame_threads >= 1 &&
- s->n_frame_threads <= 256, -EINVAL);
+ s->n_frame_threads <= DAV1D_MAX_FRAME_THREADS, -EINVAL);
validate_input_or_ret(s->allocator.alloc_picture_callback != NULL,
-EINVAL);
validate_input_or_ret(s->allocator.release_picture_callback != NULL,