Go to the documentation of this file.
53 #define T1_NMSEDEC_BITS 7
55 #define T1_NUMCTXS_ZC 9
56 #define T1_NUMCTXS_SC 5
57 #define T1_NUMCTXS_MAG 3
58 #define T1_NUMCTXS_AGG 1
59 #define T1_NUMCTXS_UNI 1
62 #define T1_CTXNO_SC (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
63 #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
64 #define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
65 #define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)
66 #define T1_NUMCTXS (T1_CTXNO_UNI+T1_NUMCTXS_UNI)
68 #define T1_NMSEDEC_FRACBITS (T1_NMSEDEC_BITS-1)
91 #define T1_SIGMA_0 (1U << 0)
92 #define T1_SIGMA_1 (1U << 1)
93 #define T1_SIGMA_2 (1U << 2)
94 #define T1_SIGMA_3 (1U << 3)
95 #define T1_SIGMA_4 (1U << 4)
96 #define T1_SIGMA_5 (1U << 5)
97 #define T1_SIGMA_6 (1U << 6)
98 #define T1_SIGMA_7 (1U << 7)
99 #define T1_SIGMA_8 (1U << 8)
100 #define T1_SIGMA_9 (1U << 9)
101 #define T1_SIGMA_10 (1U << 10)
102 #define T1_SIGMA_11 (1U << 11)
103 #define T1_SIGMA_12 (1U << 12)
104 #define T1_SIGMA_13 (1U << 13)
105 #define T1_SIGMA_14 (1U << 14)
106 #define T1_SIGMA_15 (1U << 15)
107 #define T1_SIGMA_16 (1U << 16)
108 #define T1_SIGMA_17 (1U << 17)
110 #define T1_CHI_0 (1U << 18)
111 #define T1_CHI_0_I 18
112 #define T1_CHI_1 (1U << 19)
113 #define T1_CHI_1_I 19
114 #define T1_MU_0 (1U << 20)
115 #define T1_PI_0 (1U << 21)
116 #define T1_CHI_2 (1U << 22)
117 #define T1_CHI_2_I 22
118 #define T1_MU_1 (1U << 23)
119 #define T1_PI_1 (1U << 24)
120 #define T1_CHI_3 (1U << 25)
121 #define T1_MU_2 (1U << 26)
122 #define T1_PI_2 (1U << 27)
123 #define T1_CHI_4 (1U << 28)
124 #define T1_MU_3 (1U << 29)
125 #define T1_PI_3 (1U << 30)
126 #define T1_CHI_5 (1U << 31)
127 #define T1_CHI_5_I 31
149 #define T1_SIGMA_NW T1_SIGMA_0
150 #define T1_SIGMA_N T1_SIGMA_1
151 #define T1_SIGMA_NE T1_SIGMA_2
152 #define T1_SIGMA_W T1_SIGMA_3
153 #define T1_SIGMA_THIS T1_SIGMA_4
154 #define T1_SIGMA_E T1_SIGMA_5
155 #define T1_SIGMA_SW T1_SIGMA_6
156 #define T1_SIGMA_S T1_SIGMA_7
157 #define T1_SIGMA_SE T1_SIGMA_8
158 #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
160 #define T1_CHI_THIS T1_CHI_1
161 #define T1_CHI_THIS_I T1_CHI_1_I
162 #define T1_MU_THIS T1_MU_0
163 #define T1_PI_THIS T1_PI_0
164 #define T1_CHI_S T1_CHI_2
166 #define T1_LUT_SGN_W (1U << 0)
167 #define T1_LUT_SIG_N (1U << 1)
168 #define T1_LUT_SGN_E (1U << 2)
169 #define T1_LUT_SIG_W (1U << 3)
170 #define T1_LUT_SGN_N (1U << 4)
171 #define T1_LUT_SIG_E (1U << 5)
172 #define T1_LUT_SGN_S (1U << 6)
173 #define T1_LUT_SIG_S (1U << 7)
static void opj_t1_dec_sigpass_mqc_64x64_novsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:687
#define T1_MU_THIS
Definition: t1.h:162
OPJ_UINT32 cw
Definition: tcd.h:150
#define J2K_CCP_CBLKSTY_PTERM
Predictable termination.
Definition: j2k.h:62
unsigned char OPJ_BYTE
Definition: openjpeg.h:123
float OPJ_FLOAT32
Definition: openjpeg.h:121
OPJ_INT32 * decoded_data
Definition: tcd.h:143
opj_tccp_t * tccp
Definition: t1.c:2152
void opj_mqc_raw_init_dec(opj_mqc_t *mqc, OPJ_BYTE *bp, OPJ_UINT32 len, OPJ_UINT32 extra_writable_bytes)
Initialize the decoder for RAW decoding.
Definition: mqc.c:463
void * opj_calloc(size_t num, size_t size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.c:198
void opj_mqc_init_enc(opj_mqc_t *mqc, OPJ_BYTE *bp)
Initialize the encoder.
Definition: mqc.c:188
#define opj_t1_dec_sigpass_mqc_internal(t1, bpno, vsc, w, h, flags_stride)
Definition: t1.c:643
#define T1_CHI_2_I
Definition: t1.h:117
OPJ_INT32 x0
Definition: tcd.h:81
void opj_mqc_reset_enc(opj_mqc_t *mqc)
RESET mode switch.
Definition: mqc.c:310
MQ coder.
Definition: mqc.h:74
OPJ_FLOAT64 opj_dwt_getnorm_real(OPJ_UINT32 level, OPJ_UINT32 orient)
Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT.
Definition: dwt.c:1953
OPJ_BYTE * bp
pointer to the current position in the buffer
Definition: mqc.h:84
#define J2K_CCP_CBLKSTY_SEGSYM
Segmentation symbols are used.
Definition: j2k.h:63
opj_flag_t * flags
Flags used by decoder and encoder.
Definition: t1.h:195
void opj_mqc_erterm_enc(opj_mqc_t *mqc)
ERTERM mode switch (PTERM)
Definition: mqc.c:357
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
FIXME DOC.
Definition: tcd.h:77
static INLINE long opj_lrintf(float f)
Definition: opj_includes.h:174
const opj_mqc_state_t ** curctx
Active context.
Definition: mqc.h:92
#define OPJ_COMMON_CBLK_DATA_EXTRA
Margin for a fake FFFF marker.
Definition: opj_common.h:39
#define T1_CTXNO_UNI
Definition: t1.h:65
void opj_mqc_bypass_init_enc(opj_mqc_t *mqc)
BYPASS mode switch, initialization operation.
Definition: mqc.c:229
OPJ_INT32 roishift
Region Of Interest shift.
Definition: j2k.h:199
#define T1_SIGMA_10
Definition: t1.h:101
static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a)
Get logarithm of an integer and round downwards.
Definition: opj_intmath.h:225
OPJ_INT32 x0
Definition: tcd.h:164
Segment of a code-block.
Definition: tcd.h:105
static double opj_t1_encode_cblk(opj_t1_t *t1, opj_tcd_cblk_enc_t *cblk, OPJ_UINT32 orient, OPJ_UINT32 compno, OPJ_UINT32 level, OPJ_UINT32 qmfbid, OPJ_FLOAT64 stepsize, OPJ_UINT32 cblksty, OPJ_UINT32 numcomps, const OPJ_FLOAT64 *mct_norms, OPJ_UINT32 mct_numcomps)
Return "cumwmsedec" that should be used to increase tile->distotile.
Definition: t1.c:2405
opj_tcd_band_t * band
Definition: t1.c:1593
#define T1_PI_3
Definition: t1.h:125
void opj_mqc_segmark_enc(opj_mqc_t *mqc)
SEGMARK mode switch (SEGSYM)
Definition: mqc.c:410
OPJ_INT32 x0
Definition: tcd.h:178
OPJ_UINT32 numchunks
Definition: tcd.h:140
#define T1_CTXNO_AGG
Definition: t1.h:64
OPJ_INT32 y1
Definition: tcd.h:178
OPJ_UINT32 real_num_passes
Definition: tcd.h:110
static void opj_t1_dec_clnpass_check_segsym(opj_t1_t *t1, OPJ_INT32 cblksty)
Definition: t1.c:1340
OPJ_INT32 y1
Definition: tcd.h:149
OPJ_UINT32 compno
Definition: t1.c:2146
OPJ_INT32 x1
Definition: tcd.h:178
opj_tcd_pass_t * passes
Definition: tcd.h:80
#define T1_PI_0
Definition: t1.h:115
static INLINE void opj_t1_update_flags(opj_flag_t *flagsp, OPJ_UINT32 ci, OPJ_UINT32 s, OPJ_UINT32 stride, OPJ_UINT32 vsc)
Definition: t1.c:350
#define T1_SIGMA_4
Definition: t1.h:95
static void opj_t1_dec_clnpass_generic_novsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:1375
OPJ_INT32 x1
Definition: tcd.h:124
#define opj_mqc_encode_macro(mqc, curctx, a, c, ct, d)
Definition: mqc_inl.h:253
#define T1_CTXNO_ZC
Definition: t1.h:61
#define opj_smr_abs(x)
Definition: t1.c:66
opj_tcd_band_t bands[3]
Definition: tcd.h:184
OPJ_BOOL opj_event_msg(opj_event_mgr_t *p_event_mgr, OPJ_INT32 event_type, const char *fmt,...)
Write formatted data to a string and send the string to a user callback.
Definition: event.c:91
#define J2K_CCP_CBLKSTY_LAZY
Selective arithmetic coding bypass.
Definition: j2k.h:58
#define OPJ_ARG_NOT_USED(x)
Definition: openjpeg.h:142
#define T1_SIGMA_NEIGHBOURS
Definition: t1.h:158
void opj_t1_decode_cblks(opj_tcd_t *tcd, volatile OPJ_BOOL *pret, opj_tcd_tilecomp_t *tilec, opj_tccp_t *tccp, opj_event_mgr_t *p_manager, opj_mutex_t *p_manager_mutex, OPJ_BOOL check_pterm)
Decode the code-blocks of a tile.
Definition: t1.c:1836
static void opj_t1_clbl_decode_processor(void *user_data, opj_tls_t *tls)
Definition: t1.c:1608
OPJ_UINT32 opj_mqc_bypass_get_extra_bytes(opj_mqc_t *mqc, OPJ_BOOL erterm)
Return number of extra bytes to add to opj_mqc_numbytes() for theĀ² size of a non-terminating BYPASS p...
Definition: mqc.c:266
#define DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct)
Definition: mqc_inl.h:159
static const OPJ_INT16 lut_nmsedec_ref[1U<< T1_NMSEDEC_BITS]
Definition: t1_luts.h:138
#define T1_PI_2
Definition: t1.h:122
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
#define UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct)
Definition: mqc_inl.h:165
@ tcp
Definition: query_parser.h:41
volatile OPJ_BOOL * pret
Definition: t1.c:2155
static void opj_t1_enc_clnpass(opj_t1_t *t1, OPJ_INT32 bpno, OPJ_INT32 *nmsedec, OPJ_UINT32 cblksty)
Encode clean-up pass.
Definition: t1.c:1160
OPJ_UINT32 w
Definition: t1.h:197
OPJ_UINT32 h
Definition: t1.h:198
OPJ_INT32 x1
Definition: tcd.h:196
Message handler object used for.
Definition: event.h:50
opj_tcd_tilecomp_t * tilec
Definition: t1.c:2151
void opq_mqc_finish_dec(opj_mqc_t *mqc)
Terminate RAW/MQC decoding.
Definition: mqc.c:472
#define INLINE
Definition: openjpeg.h:65
OPJ_UINT32 ph
Definition: tcd.h:180
opj_t1_t * opj_t1_create(OPJ_BOOL isEncoder)
Creates a new Tier 1 handle and initializes the look-up tables of the Tier-1 coder/decoder.
Definition: t1.c:1548
OPJ_UINT32 len
Definition: tcd.h:60
#define opj_t1_dec_clnpass_step_macro(check_flags, partial, flags, flagsp, flags_stride, data, data_stride, ci, mqc, curctx, v, a, c, ct, oneplushalf, vsc)
Definition: t1.c:1115
struct opj_t1 opj_t1_t
Tier-1 coding (coding of code-block coefficients)
OPJ_INT32 y1
Definition: tcd.h:124
static void opj_t1_dec_refpass_mqc_64x64(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:1020
#define OPJ_TLS_KEY_T1
Definition: tls_keys.h:35
static const OPJ_BYTE lut_ctxno_zc[2048]
Definition: t1_luts.h:3
OPJ_UINT32 opj_mqc_numbytes(opj_mqc_t *mqc)
Return the number of bytes written/read since initialisation.
Definition: mqc.c:179
OPJ_BYTE * data
Definition: tcd.h:78
OPJ_UINT32 a
only used by MQ decoder
Definition: mqc.h:78
opj_tcd_resolution_t * resolutions
Definition: tcd.h:204
static OPJ_INT16 opj_t1_getnmsedec_ref(OPJ_UINT32 x, OPJ_UINT32 bitpos)
Definition: t1.c:312
opj_tccp_t * tccp
Definition: t1.c:1595
static void opj_t1_dec_refpass_raw(opj_t1_t *t1, OPJ_INT32 bpno)
Decode refinement pass.
Definition: t1.c:922
static void opj_t1_dec_sigpass_mqc_generic_novsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:701
#define T1_CHI_THIS_I
Definition: t1.h:161
double OPJ_FLOAT64
Definition: openjpeg.h:122
OPJ_INT32 x0
Definition: tcd.h:196
OPJ_UINT32 pw
Definition: tcd.h:180
OPJ_INT32 x0
Definition: tcd.h:124
static OPJ_FLOAT64 opj_t1_getwmsedec(OPJ_INT32 nmsedec, OPJ_UINT32 compno, OPJ_UINT32 level, OPJ_UINT32 orient, OPJ_INT32 bpno, OPJ_UINT32 qmfbid, OPJ_FLOAT64 stepsize, OPJ_UINT32 numcomps, const OPJ_FLOAT64 *mct_norms, OPJ_UINT32 mct_numcomps)
mod fixed_quality
Definition: t1.c:1414
OPJ_UINT32 resno
Definition: t1.c:1591
OPJ_BOOL check_pterm
Definition: t1.c:1600
#define EVT_WARNING
Warning event type.
Definition: event.h:67
OPJ_BOOL opj_t1_encode_cblks(opj_tcd_t *tcd, opj_tcd_tile_t *tile, opj_tcp_t *tcp, const OPJ_FLOAT64 *mct_norms, OPJ_UINT32 mct_numcomps)
Encode the code-blocks of a tile.
Definition: t1.c:2304
OPJ_BOOL whole_tile_decoding
Only valid for decoding.
Definition: tcd.h:287
Tier-1 coding (coding of code-block coefficients)
Definition: t1.h:184
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
#define opj_t1_dec_sigpass_step_mqc_macro(flags, flagsp, flags_stride, data, data_stride, ci, mqc, curctx, v, a, c, ct, oneplushalf, vsc)
Definition: t1.c:433
static INLINE OPJ_UINT32 opj_t1_getctxtno_sc_or_spb_index(OPJ_UINT32 fX, OPJ_UINT32 pfX, OPJ_UINT32 nfX, OPJ_UINT32 ci)
Definition: t1.c:256
opj_tcd_cblk_dec_t * cblk
Definition: t1.c:1592
void opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb, OPJ_INT32 prob)
Set the state of a particular context.
Definition: mqc.c:486
#define opj_t1_setcurctx(curctx, ctxno)
Definition: t1.c:62
OPJ_UINT32 minimum_num_resolutions
Definition: tcd.h:202
OPJ_INT32 x1
Definition: tcd.h:149
static int opj_t1_enc_is_term_pass(opj_tcd_cblk_enc_t *cblk, OPJ_UINT32 cblksty, OPJ_INT32 bpno, OPJ_UINT32 passtype)
Definition: t1.c:2374
int OPJ_BOOL
Definition: openjpeg.h:116
opj_tcd_cblk_enc_t * enc
Definition: tcd.h:152
size_t OPJ_SIZE_T
Definition: openjpeg.h:139
OPJ_UINT32 opj_flag_t
Flags for 4 consecutive rows of a column.
Definition: t1.h:179
Precinct structure.
Definition: tcd.h:147
static void opj_t1_dec_sigpass_mqc_64x64_vsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:694
opj_tcd_tile_t * tile
Definition: t1.c:2149
static INLINE OPJ_BYTE opj_t1_getctxno_sc(OPJ_UINT32 lu)
Definition: t1.c:286
OPJ_INT32 y0
Definition: tcd.h:81
static OPJ_INT16 opj_t1_getnmsedec_sig(OPJ_UINT32 x, OPJ_UINT32 bitpos)
Definition: t1.c:303
#define opj_t1_dec_clnpass_internal(t1, bpno, vsc, w, h, flags_stride)
Definition: t1.c:1251
OPJ_INT32 x0
Definition: tcd.h:149
void opj_mutex_lock(opj_mutex_t *mutex)
Lock/acquire the mutex.
Definition: thread.c:448
volatile OPJ_BOOL * pret
Definition: t1.c:1597
#define T1_SIGMA_1
Definition: t1.h:92
void opj_mqc_init_dec(opj_mqc_t *mqc, OPJ_BYTE *bp, OPJ_UINT32 len, OPJ_UINT32 extra_writable_bytes)
Initialize the decoder for MQ decoding.
Definition: mqc.c:439
opj_mutex_t * mutex
Definition: t1.c:2156
FIXME DOC.
Definition: tcd.h:57
Tile-component resolution structure.
Definition: tcd.h:176
#define T1_MU_0
Definition: t1.h:114
OPJ_FLOAT64 opj_dwt_getnorm(OPJ_UINT32 level, OPJ_UINT32 orient)
Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.
Definition: dwt.c:1926
OPJ_BYTE * end
pointer to the end of the buffer
Definition: mqc.h:88
static INLINE void opj_t1_dec_sigpass_step_mqc(opj_t1_t *t1, opj_flag_t *flagsp, OPJ_INT32 *datap, OPJ_INT32 oneplushalf, OPJ_UINT32 row, OPJ_UINT32 flags_stride, OPJ_UINT32 vsc)
Definition: t1.c:459
OPJ_INT32 x1
Definition: tcd.h:81
Tile-component structure.
Definition: tcd.h:194
Sub-band structure.
Definition: tcd.h:162
OPJ_UINT32 totalpasses
Definition: tcd.h:89
OPJ_INT32 * data
Definition: t1.h:189
static const OPJ_INT16 lut_nmsedec_sig0[1U<< T1_NMSEDEC_BITS]
Definition: t1_luts.h:119
OPJ_UINT32 numbands
Definition: tcd.h:182
OPJ_BOOL encoder
Definition: t1.h:201
int32_t OPJ_INT32
Definition: openjpeg.h:131
#define opj_mqc_setcurctx(mqc, ctxno)
Set the current context used for coding/decoding.
Definition: mqc.h:139
OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1, opj_tcd_cblk_dec_t *cblk, OPJ_UINT32 orient, OPJ_UINT32 roishift, OPJ_UINT32 cblksty, opj_event_mgr_t *p_manager, opj_mutex_t *p_manager_mutex, OPJ_BOOL check_pterm)
Decode 1 HT code-block.
Definition: ht_dec.c:1096
OPJ_BYTE * cblkdatabuffer
Definition: t1.h:207
#define opj_t1_dec_refpass_mqc_internal(t1, bpno, w, h, flags_stride)
Definition: t1.c:978
OPJ_BITFIELD term
Definition: tcd.h:61
static void opj_t1_dec_clnpass_64x64_vsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:1368
OPJ_FLOAT64 distortiondec
Definition: tcd.h:59
OPJ_INT32 y0
Definition: tcd.h:178
OPJ_UINT32 mct_numcomps
Definition: t1.c:2154
#define opj_t1_enc_refpass_step_macro(mqc, curctx, a, c, ct, flags, flagsUpdated, datap, bpno, one, nmsedec, type, ci)
Encode refinement pass step.
Definition: t1.c:740
#define opj_to_smr(x)
Definition: t1.c:68
#define J2K_CCP_CBLKSTY_HT
(high throughput) HT codeblocks
Definition: j2k.h:64
void opj_mqc_flush(opj_mqc_t *mqc)
Flush the encoder, so that all remaining data is written.
Definition: mqc.c:212
#define T1_SIGMA_13
Definition: t1.h:104
Byte4_t max(Byte4_t n1, Byte4_t n2)
Definition: index_manager.c:774
#define T1_TYPE_MQ
Normal coding using entropy coder.
Definition: t1.h:70
void opj_t1_destroy(opj_t1_t *p_t1)
Destroys a previously created T1 handle.
Definition: t1.c:1568
#define OPJ_RESTRICT
Definition: opj_includes.h:121
OPJ_UINT32 datasize
Definition: t1.h:199
OPJ_BOOL mustuse_cblkdatabuffer
Definition: t1.h:205
#define opj_t1_enc_clnpass_step_macro(mqc, curctx, a, c, ct, flagspIn, datapIn, bpno, one, nmsedec, agg, runlen, lim, cblksty)
Encode clean-up pass step.
Definition: t1.c:1048
void * opj_realloc(void *ptr, size_t new_size)
Reallocate memory blocks.
Definition: opj_malloc.c:239
opj_mutex_t * p_manager_mutex
Definition: t1.c:1599
static void opj_t1_destroy_wrapper(void *t1)
Definition: t1.c:1603
OPJ_BYTE * start
pointer to the start of the buffer
Definition: mqc.h:86
#define OPJ_TRUE
Definition: openjpeg.h:117
OPJ_FLOAT64 distotile
Definition: tcd.h:239
static void opj_t1_cblk_encode_processor(void *user_data, opj_tls_t *tls)
Procedure to deal with a asynchronous code-block encoding job.
Definition: t1.c:2164
void opj_t1_decode_cblks(opj_tcd_t *tcd, volatile OPJ_BOOL *pret, opj_tcd_tilecomp_t *tilec, opj_tccp_t *tccp, opj_event_mgr_t *p_manager, opj_mutex_t *p_manager_mutex, OPJ_BOOL check_pterm)
Decode the code-blocks of a tile.
Definition: t1.c:1836
static void opj_t1_dec_clnpass_64x64_novsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:1361
OPJ_UINT32 numresolutions
Definition: tcd.h:200
opj_tcd_band_t * band
Definition: t1.c:2150
static const OPJ_INT16 lut_nmsedec_ref0[1U<< T1_NMSEDEC_BITS]
Definition: t1_luts.h:157
void opj_free(void *ptr)
Deallocates or frees a memory block.
Definition: opj_malloc.c:246
OPJ_UINT32 numcomps
Definition: tcd.h:236
OPJ_UINT32 numbps
Definition: tcd.h:83
static void opj_t1_dec_sigpass_raw(opj_t1_t *t1, OPJ_INT32 bpno, OPJ_INT32 cblksty)
Decode significant pass.
Definition: t1.c:579
static void opj_t1_enc_refpass(opj_t1_t *t1, OPJ_INT32 bpno, OPJ_INT32 *nmsedec, OPJ_BYTE type)
Encode refinement pass.
Definition: t1.c:811
static const OPJ_INT16 lut_nmsedec_sig[1U<< T1_NMSEDEC_BITS]
Definition: t1_luts.h:100
union opj_tcd_precinct::@3 cblks
static INLINE void opj_t1_dec_sigpass_step_raw(opj_t1_t *t1, opj_flag_t *flagsp, OPJ_INT32 *datap, OPJ_INT32 oneplushalf, OPJ_UINT32 vsc, OPJ_UINT32 row)
Decode significant pass.
Definition: t1.c:409
OPJ_INT32 y0
Definition: tcd.h:149
static void opj_t1_dec_sigpass_mqc_generic_vsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:709
#define opj_t1_enc_sigpass_step_macro(mqc, curctx, a, c, ct, flagspIn, datapIn, bpno, one, nmsedec, type, ciIn, vscIn)
Encode significant pass.
Definition: t1.c:360
void opj_mutex_unlock(opj_mutex_t *mutex)
Unlock/release the mutex.
Definition: thread.c:453
OPJ_BOOL opj_tcd_is_band_empty(opj_tcd_band_t *band)
Returns whether a sub-band is empty (i.e.
Definition: tcd.c:2707
#define T1_FLAGS(x, y)
Definition: t1.c:60
OPJ_UINT32 qmfbid
discrete wavelet transform identifier
Definition: j2k.h:191
#define T1_SIGMA_3
Definition: t1.h:94
static void opj_t1_dec_clnpass_generic_vsc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:1383
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: j2k.h:245
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
static void opj_t1_dec_clnpass_step(opj_t1_t *t1, opj_flag_t *flagsp, OPJ_INT32 *datap, OPJ_INT32 oneplushalf, OPJ_UINT32 row, OPJ_UINT32 vsc)
Decode clean-up pass.
Definition: t1.c:1143
void opj_mutex_destroy(opj_mutex_t *mutex)
Destroy a mutex.
Definition: thread.c:458
OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd, OPJ_UINT32 compno, OPJ_UINT32 resno, OPJ_UINT32 bandno, OPJ_UINT32 band_x0, OPJ_UINT32 band_y0, OPJ_UINT32 band_x1, OPJ_UINT32 band_y1)
Returns whether a sub-band region contributes to the area of interest tcd->win_x0,...
Definition: tcd.c:2712
OPJ_UINT32 len
Definition: tcd.h:99
#define T1_NMSEDEC_FRACBITS
Definition: t1.h:68
static OPJ_BOOL opj_t1_allocate_buffers(opj_t1_t *t1, OPJ_UINT32 w, OPJ_UINT32 h)
Definition: t1.c:1449
OPJ_UINT32 cblksty
code-block coding style
Definition: j2k.h:189
static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b)
Get the maximum of two integers.
Definition: opj_intmath.h:74
OPJ_INT32 y0
Definition: tcd.h:164
void opj_mqc_resetstates(opj_mqc_t *mqc)
Reset the states of all the context of the coder/decoder (each context is set to a state where 0 and ...
Definition: mqc.c:478
static void opj_t1_dec_refpass_mqc_generic(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:1027
struct opj_mutex_t opj_mutex_t
Opaque type for a mutex.
Definition: thread.h:52
#define T1_SIGMA_5
Definition: t1.h:96
Code-block for decoding.
Definition: tcd.h:120
OPJ_FLOAT32 stepsize
Definition: tcd.h:172
void opj_mqc_bypass_flush_enc(opj_mqc_t *mqc, OPJ_BOOL erterm)
BYPASS mode switch, flush operation.
Definition: mqc.c:272
opj_mutex_t * opj_mutex_create(void)
Creates a mutex.
Definition: thread.c:443
#define T1_CTXNO_MAG
Definition: t1.h:63
Tile-component coding parameters.
Definition: j2k.h:179
OPJ_INT32 * data
Definition: tcd.h:209
static INLINE OPJ_BYTE opj_t1_getctxno_zc(opj_mqc_t *mqc, OPJ_UINT32 f)
Definition: t1.c:251
void opj_aligned_free(void *ptr)
Definition: opj_malloc.c:225
#define T1_SIGMA_7
Definition: t1.h:98
opj_thread_pool_t * thread_pool
Thread pool.
Definition: tcd.h:280
FIXME DOC.
Definition: tcd.h:233
static INLINE OPJ_UINT32 opj_mqc_raw_decode(opj_mqc_t *mqc)
Decode a symbol using raw-decoder.
Definition: mqc_inl.h:74
opj_tcd_cblk_enc_t * cblk
Definition: t1.c:2148
OPJ_UINT32 compno
Definition: tcd.h:198
#define T1_PI_1
Definition: t1.h:119
OPJ_INT32 y0
Definition: tcd.h:124
opj_event_mgr_t * p_manager
Definition: t1.c:1598
void * opj_aligned_malloc(size_t size)
Allocate memory aligned to a 16 byte boundary.
Definition: opj_malloc.c:207
OPJ_UINT32 len
Definition: tcd.h:106
#define J2K_CCP_CBLKSTY_RESET
Reset context probabilities on coding pass boundaries.
Definition: j2k.h:59
static INLINE OPJ_BYTE opj_t1_getspb(OPJ_UINT32 lu)
Definition: t1.c:298
static void opj_t1_dec_clnpass(opj_t1_t *t1, OPJ_INT32 bpno, OPJ_INT32 cblksty)
Definition: t1.c:1391
#define opj_t1_dec_refpass_step_mqc_macro(flags, data, data_stride, ci, mqc, curctx, v, a, c, ct, poshalf)
Definition: t1.c:783
OPJ_UINT32 c
temporary buffer where bits are coded or decoded
Definition: mqc.h:76
#define EVT_ERROR
Error event type.
Definition: event.h:66
uint32_t OPJ_UINT32
Definition: openjpeg.h:132
OPJ_UINT32 bandno
Definition: tcd.h:166
OPJ_UINT32 real_num_segs
Definition: tcd.h:138
opj_tcd_seg_data_chunk_t * chunks
Definition: tcd.h:122
OPJ_BYTE * data
Definition: tcd.h:98
OPJ_UINT32 cblkdatabuffersize
Definition: t1.h:209
#define T1_SIGMA_THIS
Definition: t1.h:153
void opj_mqc_restart_init_enc(opj_mqc_t *mqc)
RESTART mode switch (TERMALL) reinitialisation.
Definition: mqc.c:337
opj_tcd_seg_t * segs
Definition: tcd.h:121
#define T1_CHI_1_I
Definition: t1.h:113
#define OPJ_FALSE
Definition: openjpeg.h:118
static INLINE void opj_t1_dec_refpass_step_raw(opj_t1_t *t1, opj_flag_t *flagsp, OPJ_INT32 *datap, OPJ_INT32 poshalf, OPJ_UINT32 row)
Decode refinement pass.
Definition: t1.c:764
opj_t1_t * opj_t1_create(OPJ_BOOL isEncoder)
Creates a new Tier 1 handle and initializes the look-up tables of the Tier-1 coder/decoder.
Definition: t1.c:1548
static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1, opj_tcd_cblk_dec_t *cblk, OPJ_UINT32 orient, OPJ_UINT32 roishift, OPJ_UINT32 cblksty, opj_event_mgr_t *p_manager, opj_mutex_t *p_manager_mutex, OPJ_BOOL check_pterm)
Decode 1 code-block.
Definition: t1.c:1962
int16_t OPJ_INT16
Definition: openjpeg.h:129
static const OPJ_BYTE lut_ctxno_sc[256]
Definition: t1_luts.h:70
OPJ_UINT32 resno
Definition: t1.c:2147
static void opj_t1_enc_sigpass(opj_t1_t *t1, OPJ_INT32 bpno, OPJ_INT32 *nmsedec, OPJ_BYTE type, OPJ_UINT32 cblksty)
Encode significant pass.
Definition: t1.c:476
const OPJ_FLOAT64 * mct_norms
Definition: t1.c:2153
OPJ_BOOL mustuse_cblkdatabuffer
Definition: t1.c:1596
#define J2K_CCP_CBLKSTY_TERMALL
Termination on each coding pass.
Definition: j2k.h:60
#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc)
Definition: t1.c:321
#define T1_CHI_0_I
Definition: t1.h:111
OPJ_UINT32 numbps
Definition: tcd.h:130
OPJ_INT32 y1
Definition: tcd.h:82
OPJ_UINT32 rate
Definition: tcd.h:58
opj_tcd_cblk_dec_t * dec
Definition: tcd.h:153
static void opj_t1_dec_refpass_mqc(opj_t1_t *t1, OPJ_INT32 bpno)
Definition: t1.c:1034
static const OPJ_BYTE lut_spb[256]
Definition: t1_luts.h:89
OPJ_UINT32 ct
number of bits already read or free to write
Definition: mqc.h:80
static INLINE void opj_t1_dec_refpass_step_mqc(opj_t1_t *t1, opj_flag_t *flagsp, OPJ_INT32 *datap, OPJ_INT32 poshalf, OPJ_UINT32 row)
Definition: t1.c:796
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_mqc_t mqc
MQC component.
Definition: t1.h:187
void opj_t1_destroy(opj_t1_t *p_t1)
Destroys a previously created T1 handle.
Definition: t1.c:1568
opj_tcd_tilecomp_t * comps
Definition: tcd.h:237
OPJ_BOOL opj_t1_encode_cblks(opj_tcd_t *tcd, opj_tcd_tile_t *tile, opj_tcp_t *tcp, const OPJ_FLOAT64 *mct_norms, OPJ_UINT32 mct_numcomps)
Encode the code-blocks of a tile.
Definition: t1.c:2304
#define T1_PI_THIS
Definition: t1.h:163
OPJ_UINT32 flagssize
Definition: t1.h:200
#define T1_TYPE_RAW
No encoding the information is store under raw format in codestream (mode switch RAW)
Definition: t1.h:71
OPJ_BOOL whole_tile_decoding
Definition: t1.c:1590
OPJ_UINT32 end_of_byte_stream_counter
Definition: mqc.h:82
static INLINE OPJ_UINT32 opj_t1_getctxno_mag(OPJ_UINT32 f)
Definition: t1.c:291
OPJ_UINT32 ch
Definition: tcd.h:150
static void opj_t1_dec_sigpass_mqc(opj_t1_t *t1, OPJ_INT32 bpno, OPJ_INT32 cblksty)
Definition: t1.c:717
Tile coder/decoder.
Definition: tcd.h:256
opj_tcd_tilecomp_t * tilec
Definition: t1.c:1594
#define J2K_CCP_CBLKSTY_VSC
Vertically stripe causal context.
Definition: j2k.h:61
#define T1_NMSEDEC_BITS
Definition: t1.h:53
#define opj_mqc_decode(d, mqc)
Decode a symbol.
Definition: mqc_inl.h:193
const OPJ_BYTE * lut_ctxno_zc_orient
Definition: mqc.h:94