diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2016-05-25 16:36:47 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2016-05-25 21:02:07 +0200 |
| commit | d4b7f03cfa4732132767188782683f3d957da912 (patch) | |
| tree | 47ae5bbd2694e2df24c80d3f4779a25f07345181 /src/lib/openjp2/tcd.h | |
| parent | 54179fe1d53156c6b440166fe71a10f238a6ea56 (diff) | |
Add opj_codec_set_threads() in public API and propagate resulting thread pool to tcd level
By default, only the main thread is used. If opj_codec_set_threads() is not used,
but the OPJ_NUM_THREADS environment variable is set, its value will be
used to initialize the number of threads. The value can be either an integer
number, or "ALL_CPUS". If OPJ_NUM_THREADS is set and this function is called,
this function will override the behaviour of the environment variable.
Diffstat (limited to 'src/lib/openjp2/tcd.h')
| -rw-r--r-- | src/lib/openjp2/tcd.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/openjp2/tcd.h b/src/lib/openjp2/tcd.h index 07f8379a..77817bf6 100644 --- a/src/lib/openjp2/tcd.h +++ b/src/lib/openjp2/tcd.h @@ -220,6 +220,8 @@ typedef struct opj_tcd OPJ_UINT32 tcd_tileno; /** tell if the tcd is a decoder. */ OPJ_UINT32 m_is_decoder : 1; + /** Thread pool */ + opj_thread_pool_t* thread_pool; } opj_tcd_t; /** @name Exported functions */ @@ -249,12 +251,14 @@ void opj_tcd_destroy(opj_tcd_t *tcd); * @param p_tcd TCD handle. * @param p_image raw image. * @param p_cp coding parameters. + * @param p_tp thread pool * * @return true if the encoding values could be set (false otherwise). */ OPJ_BOOL opj_tcd_init( opj_tcd_t *p_tcd, opj_image_t * p_image, - opj_cp_t * p_cp ); + opj_cp_t * p_cp, + opj_thread_pool_t* p_tp); /** * Allocates memory for decoding a specific tile. |
