opj_worker_thread_t * worker_threads
Definition: thread.c:606
unsigned char OPJ_BYTE
Definition: openjpeg.h:123
void opj_cond_signal(opj_cond_t *cond)
Signal waiting threads on a condition.
Definition: thread.c:474
opj_worker_thread_job_t * job
Definition: thread.c:594
int signaling_threshold
Definition: thread.c:616
int tw
number of tiles in X
Definition: openjpeg.h:873
OPJ_SIZE_T opj_stream_write_data(opj_stream_private_t *p_stream, const OPJ_BYTE *p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t *p_event_mgr)
Writes some bytes to the stream.
Definition: cio.c:385
void * opj_calloc(size_t num, size_t size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.c:198
opj_cond_t * cond
Definition: thread.c:584
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:839
void opj_thread_pool_destroy(opj_thread_pool_t *tp)
Destroy a thread pool.
Definition: thread.c:919
OPJ_BOOL opj_tls_set(opj_tls_t *tls, int key, void *value, opj_tls_free_func opj_free_func)
Set a thread local value corresponding to the provided key.
Definition: thread.c:540
void opj_mutex_destroy(opj_mutex_t *mutex)
Destroy a mutex.
Definition: thread.c:458
void(* opj_tls_free_func)(void *value)
Type of the function used to free a TLS value.
Definition: thread.h:177
int tp_end_header
end position of tile part header
Definition: openjpeg.h:799
void(* opj_thread_fn)(void *user_data)
User function to execute in a thread.
Definition: thread.h:146
volatile int pending_jobs_count
Definition: thread.c:612
void opj_cond_signal(opj_cond_t *cond)
Signal waiting threads on a condition.
Definition: thread.c:474
#define JPIP_THIX
Definition: indexbox_manager.h:49
opj_tls_t * tls
Definition: thread.c:615
OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t *tp, opj_job_fn job_fn, void *user_data)
Submit a new job to be run by one of the thread in the thread pool.
Definition: thread.c:827
opj_thread_pool_t * tp
Definition: thread.c:579
int key
Definition: thread.c:499
#define JPIP_MHIX
Definition: indexbox_manager.h:47
OPJ_BOOL opj_tls_set(opj_tls_t *tls, int key, void *value, opj_tls_free_func free_func)
Set a thread local value corresponding to the provided key.
Definition: thread.c:540
int64_t OPJ_OFF_T
Definition: openjpeg.h:136
OPJ_OFF_T opj_stream_skip(opj_stream_private_t *p_stream, OPJ_OFF_T p_size, opj_event_mgr_t *p_event_mgr)
Skips a number of bytes from the stream.
Definition: cio.c:593
OPJ_BOOL opj_stream_seek(opj_stream_private_t *p_stream, OPJ_OFF_T p_size, struct opj_event_mgr *p_event_mgr)
Seeks a number of bytes from the stream.
Definition: cio.c:641
Message handler object used for.
Definition: event.h:50
opj_thread_t * opj_thread_create(opj_thread_fn thread_fn, void *user_data)
Creates a new thread.
Definition: thread.c:484
OPJ_OFF_T opj_stream_tell(const opj_stream_private_t *p_stream)
Tells the byte offset on the stream (similar to ftell).
Definition: cio.c:579
volatile opj_worker_thread_state state
Definition: thread.c:610
void opj_thread_pool_destroy(opj_thread_pool_t *tp)
Destroy a thread pool.
Definition: thread.c:919
OPJ_UINT32 type
Definition: jp2.h:200
Byte input-output stream.
Definition: cio.h:81
int opj_thread_pool_get_thread_count(opj_thread_pool_t *tp)
Return the number of threads associated with the thread pool.
Definition: thread.c:914
OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t *tp, opj_job_fn job_fn, void *user_data)
Submit a new job to be run by one of the thread in the thread pool.
Definition: thread.c:827
static opj_worker_thread_job_t * opj_thread_pool_get_next_job(opj_thread_pool_t *tp, opj_worker_thread_t *worker_thread, OPJ_BOOL signal_job_finished)
Definition: thread.c:757
void * user_data
Definition: thread.c:575
@ OPJWTS_ERROR
Definition: thread.c:590
int opj_thread_pool_get_thread_count(opj_thread_pool_t *tp)
Return the number of threads associated with the thread pool.
Definition: thread.c:914
void opj_write_manf(int second, int v, opj_jp2_box_t *box, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Definition: cidx_manager.c:157
OPJ_BOOL OPJ_CALLCONV opj_has_thread_support(void)
Returns if the library is built with thread support.
Definition: thread.c:433
int OPJ_BOOL
Definition: openjpeg.h:116
void opj_cond_destroy(opj_cond_t *cond)
Destroy a condition.
Definition: thread.c:479
int waiting_worker_thread_count
Definition: thread.c:614
int key_val_count
Definition: thread.c:506
int tp_start_pos
start position of tile part
Definition: openjpeg.h:797
void opj_mutex_unlock(opj_mutex_t *mutex)
Unlock/release the mutex.
Definition: thread.c:453
static void opj_tls_destroy(opj_tls_t *tls)
Definition: thread.c:514
void opj_mutex_lock(opj_mutex_t *mutex)
Lock/acquire the mutex.
Definition: thread.c:448
Index structure : Information concerning tile-parts.
Definition: openjpeg.h:795
void opj_cond_wait(opj_cond_t *cond, opj_mutex_t *mutex)
Wait for the condition to be signaled.
Definition: thread.c:468
JP2 Box.
Definition: jp2.h:198
opj_thread_t * opj_thread_create(opj_thread_fn thread_fn, void *user_data)
Creates a new thread.
Definition: thread.c:484
void * value
Definition: thread.c:500
void opj_cond_wait(opj_cond_t *cond, opj_mutex_t *mutex)
Wait for the condition to be signaled.
Definition: thread.c:468
static void opj_worker_thread_function(void *user_data)
Definition: thread.c:656
void * opj_realloc(void *ptr, size_t new_size)
Reallocate memory blocks.
Definition: opj_malloc.c:239
opj_mutex_t * mutex
Definition: thread.c:609
#define OPJ_TRUE
Definition: openjpeg.h:117
opj_cond_t * cond
Definition: thread.c:608
void * opj_malloc(size_t size)
Allocate an uninitialized memory block.
Definition: opj_malloc.c:191
opj_tls_free_func opj_free_func
Definition: thread.c:501
opj_thread_pool_t * opj_thread_pool_create(int num_threads)
Create a new thread pool.
Definition: thread.c:625
void opj_free(void *ptr)
Deallocates or frees a memory block.
Definition: opj_malloc.c:246
void opj_thread_join(opj_thread_t *thread)
Wait for a thread to be finished and release associated resources to the thread handle.
Definition: thread.c:491
int worker_threads_count
Definition: thread.c:607
int marked_as_waiting
Definition: thread.c:581
opj_thread_t * thread
Definition: thread.c:580
void opj_mutex_unlock(opj_mutex_t *mutex)
Unlock/release the mutex.
Definition: thread.c:453
opj_mutex_t * opj_mutex_create(void)
Creates a mutex.
Definition: thread.c:443
void opj_thread_pool_wait_completion(opj_thread_pool_t *tp, int max_remaining_jobs)
Wait that no more than max_remaining_jobs jobs are remaining in the queue of the thread pool.
Definition: thread.c:894
void opj_mutex_lock(opj_mutex_t *mutex)
Lock/acquire the mutex.
Definition: thread.c:448
void opj_mutex_destroy(opj_mutex_t *mutex)
Destroy a mutex.
Definition: thread.c:458
opj_job_fn job_fn
Definition: thread.c:574
struct opj_mutex_t opj_mutex_t
Opaque type for a mutex.
Definition: thread.h:52
opj_mutex_t * opj_mutex_create(void)
Creates a mutex.
Definition: thread.c:443
opj_worker_thread_state
Definition: thread.c:587
opj_thread_pool_t * opj_thread_pool_create(int num_threads)
Create a new thread pool.
Definition: thread.c:625
int marknum
number of markers
Definition: openjpeg.h:837
opj_cond_t * opj_cond_create(void)
Creates a condition.
Definition: thread.c:463
OPJ_UINT32 length
Definition: jp2.h:199
opj_job_list_t * job_queue
Definition: thread.c:611
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:897
opj_mutex_t * mutex
Definition: thread.c:583
Index structure of the codestream.
Definition: openjpeg.h:851
@ OPJWTS_STOP
Definition: thread.c:589
@ OPJWTS_OK
Definition: thread.c:588
uint32_t OPJ_UINT32
Definition: openjpeg.h:132
static OPJ_BOOL opj_thread_pool_setup(opj_thread_pool_t *tp, int num_threads)
Definition: thread.c:684
int OPJ_CALLCONV opj_get_num_cpus(void)
Return the number of virtual CPUs.
Definition: thread.c:438
opj_worker_thread_t * worker_thread
Definition: thread.c:600
struct opj_cond_t opj_cond_t
Opaque type for a condition.
Definition: thread.h:81
opj_tp_info_t * tp
information concerning tile parts
Definition: openjpeg.h:845
Index structure : information regarding tiles.
Definition: openjpeg.h:811
static opj_tls_t * opj_tls_new(void)
Definition: thread.c:509
struct opj_worker_thread_list_t * next
Definition: thread.c:601
void opj_thread_join(opj_thread_t *thread)
Wait for a thread to be finished and release associated resources to the thread handle.
Definition: thread.c:491
struct opj_thread_t opj_thread_t
Opaque type for a thread handle.
Definition: thread.h:141
#define OPJ_FALSE
Definition: openjpeg.h:118
struct opj_job_list_t * next
Definition: thread.c:595
opj_worker_thread_list_t * waiting_worker_thread_list
Definition: thread.c:613
void * opj_tls_get(opj_tls_t *tls, int key)
Get a thread local value corresponding to the provided key.
Definition: thread.c:529
opj_cond_t * opj_cond_create(void)
Creates a condition.
Definition: thread.c:463
void opj_thread_pool_wait_completion(opj_thread_pool_t *tp, int max_remaining_jobs)
Wait that no more than max_remaining_jobs jobs are remaining in the queue of the thread pool.
Definition: thread.c:894
#define opj_write_bytes
Definition: cio.h:64
void * opj_tls_get(opj_tls_t *tls, int key)
Get a thread local value corresponding to the provided key.
Definition: thread.c:529
opj_tls_key_val_t * key_val
Definition: thread.c:505
int th
number of tiles in Y
Definition: openjpeg.h:875
#define OPJ_CALLCONV
Definition: openjpeg.h:98
Marker structure.
Definition: openjpeg.h:782
int opj_write_tilemhix(int coff, opj_codestream_info_t cstr_info, int tileno, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Definition: thix_manager.c:97
int opj_write_thix(int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Definition: thix_manager.c:40
void(* opj_job_fn)(void *user_data, opj_tls_t *tls)
User function to execute in a thread.
Definition: thread.h:213
void opj_cond_destroy(opj_cond_t *cond)
Destroy a condition.
Definition: thread.c:479