diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-04-29 11:50:17 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-05-20 20:30:21 +0200 |
| commit | 97eb7e0bf17b476d516262e0af462ec7eeb8f505 (patch) | |
| tree | 3006779d0ae78b84909c6f52f52bb9a254a83160 /src/lib/openjp2/openjpeg.c | |
| parent | 1d358f25c8eabbc7c274bcc148f4f5d594ec13fe (diff) | |
Add multithreading support in the T1 (entropy phase) encoder
- API wise, opj_codec_set_threads() can be used on the encoding side
- opj_compress has a -threads switch similar to opj_uncompress
Diffstat (limited to 'src/lib/openjp2/openjpeg.c')
| -rw-r--r-- | src/lib/openjp2/openjpeg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/openjp2/openjpeg.c b/src/lib/openjp2/openjpeg.c index 1e2d60a6..9c9b6eb0 100644 --- a/src/lib/openjp2/openjpeg.c +++ b/src/lib/openjp2/openjpeg.c @@ -657,6 +657,9 @@ opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format) const char* const*, struct opj_event_mgr *)) opj_j2k_encoder_set_extra_options; + l_codec->opj_set_threads = + (OPJ_BOOL(*)(void * p_codec, OPJ_UINT32 num_threads)) opj_j2k_set_threads; + l_codec->m_codec = opj_j2k_create_compress(); if (! l_codec->m_codec) { opj_free(l_codec); @@ -700,6 +703,9 @@ opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format) const char* const*, struct opj_event_mgr *)) opj_jp2_encoder_set_extra_options; + l_codec->opj_set_threads = + (OPJ_BOOL(*)(void * p_codec, OPJ_UINT32 num_threads)) opj_jp2_set_threads; + l_codec->m_codec = opj_jp2_create(OPJ_FALSE); if (! l_codec->m_codec) { opj_free(l_codec); |
