Go to the documentation of this file.
31 #ifndef IHDRBOX_MANAGER_H_
32 # define IHDRBOX_MANAGER_H_
unsigned char OPJ_BYTE
Definition: openjpeg.h:123
static INLINE void mel_init(dec_mel_t *melp, OPJ_UINT8 *bbuf, int lcup, int scup)
Initiates a dec_mel_t structure for MEL decoding and reads some bytes in order to get the read addres...
Definition: ht_dec.c:297
opj_flag_t * flags
Flags used by decoder and encoder.
Definition: t1.h:195
struct frwd_struct frwd_struct_t
State structure for reading and unstuffing of forward-growing bitstreams; these are: MagSgn and SPP b...
int vlc_tbl1[1024]
vlc_tbl1 contains decoding information for non-initial row of quads
Definition: t1_ht_generate_luts.c:904
OPJ_UINT32 numchunks
Definition: tcd.h:140
static INLINE OPJ_UINT32 count_leading_zeros(OPJ_UINT32 val)
Counts the number of leading zeros.
Definition: ht_dec.c:95
OPJ_INT32 x1
Definition: tcd.h:124
Byte4_t big4(Byte_t *buf)
convert 4-byte big endian Byte codes to number
Definition: byte_manager.c:147
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
OPJ_BOOL unstuff
true if a bit needs to be unstuffed from next byte
Definition: ht_dec.c:874
uint8_t Byte_t
Definition: byte_manager.h:37
OPJ_UINT32 Mb
Definition: tcd.h:128
struct rev_struct rev_struct_t
A structure for reading and unstuffing a segment that grows backward, such as VLC and MRP.
static OPJ_BOOL opj_t1_allocate_buffers(opj_t1_t *t1, OPJ_UINT32 w, OPJ_UINT32 h)
Allocates T1 buffers.
Definition: ht_dec.c:1023
int bits
number of bits stored in tmp
Definition: ht_dec.c:142
OPJ_UINT32 w
Definition: t1.h:197
OPJ_UINT32 h
Definition: t1.h:198
box parameters
Definition: box_manager.h:37
Message handler object used for.
Definition: event.h:50
#define INLINE
Definition: openjpeg.h:65
static INLINE OPJ_UINT32 rev_fetch_mrp(rev_struct_t *mrp)
Retrieves 32 bits from the head of a rev_struct structure.
Definition: ht_dec.c:650
OPJ_INT32 y1
Definition: tcd.h:124
uint8_t OPJ_UINT8
Definition: openjpeg.h:128
OPJ_UINT32 bits
number of bits stored in tmp
Definition: ht_dec.c:365
static INLINE OPJ_UINT32 rev_fetch(rev_struct_t *vlcp)
Retrieves 32 bits from the head of a rev_struct structure.
Definition: ht_dec.c:505
struct dec_mel dec_mel_t
MEL state structure for reading and decoding the MEL bitstream.
OPJ_INT32 x0
Definition: tcd.h:124
static INLINE void frwd_read(frwd_struct_t *msp)
Read and unstuffs 32 bits from forward-growing bitstream.
Definition: ht_dec.c:897
box_param_t * gene_boxbyTypeinStream(Byte_t *stream, OPJ_OFF_T offset, OPJ_SIZE_T length, const char TBox[])
generate(search) box from code stream
Definition: box_manager.c:243
static INLINE OPJ_UINT32 decode_init_uvlc(OPJ_UINT32 vlc, OPJ_UINT32 mode, OPJ_UINT32 *u)
Decode initial UVLC to get the u value (or u_q)
Definition: ht_dec.c:688
Byte_t bpc
bits per component
Definition: ihdrbox_manager.h:43
ihdrbox_param_t * gene_ihdrbox(metadatalist_param_t *metadatalist, Byte_t *jpipstream)
generate ihdr box
Definition: ihdrbox_manager.c:36
#define EVT_WARNING
Warning event type.
Definition: event.h:67
Tier-1 coding (coding of code-block coefficients)
Definition: t1.h:184
OPJ_BOOL unstuff
true if the last byte is more than 0x8F
Definition: ht_dec.c:367
static INLINE OPJ_UINT32 decode_noninit_uvlc(OPJ_UINT32 vlc, OPJ_UINT32 mode, OPJ_UINT32 *u)
Decode non-initial UVLC to get the u value (or u_q)
Definition: ht_dec.c:801
int OPJ_BOOL
Definition: openjpeg.h:116
OPJ_UINT32 opj_flag_t
Flags for 4 consecutive rows of a column.
Definition: t1.h:179
static INLINE void rev_read_mrp(rev_struct_t *mrp)
Reads and unstuffs from rev_struct.
Definition: ht_dec.c:543
OPJ_UINT64 tmp
temporary buffer for read data
Definition: ht_dec.c:141
static INLINE void rev_read(rev_struct_t *vlcp)
Read and unstuff data from a backwardly-growing segment.
Definition: ht_dec.c:392
Byte2_t big2(Byte_t *buf)
convert 2-byte big endian Byte codes to number
Definition: byte_manager.c:142
void opj_mutex_lock(opj_mutex_t *mutex)
Lock/acquire the mutex.
Definition: thread.c:448
uint64_t OPJ_UINT64
Definition: openjpeg.h:134
OPJ_INT32 * data
Definition: t1.h:189
int32_t OPJ_INT32
Definition: openjpeg.h:131
int k
state of MEL decoder
Definition: ht_dec.c:145
OPJ_UINT8 * data
pointer to where to read data
Definition: ht_dec.c:363
OPJ_UINT32 datasize
Definition: t1.h:199
Byte4_t width
Definition: ihdrbox_manager.h:41
static INLINE void rev_init_mrp(rev_struct_t *mrp, OPJ_UINT8 *data, int lcup, int len2)
Initialized rev_struct structure for MRP segment, and reads a number of bytes such that the next 32 b...
Definition: ht_dec.c:612
void * opj_realloc(void *ptr, size_t new_size)
Reallocate memory blocks.
Definition: opj_malloc.c:239
OPJ_UINT64 runs
runs of decoded MEL codewords (7 bits/run)
Definition: ht_dec.c:149
static INLINE OPJ_UINT32 rev_advance_mrp(rev_struct_t *mrp, OPJ_UINT32 num_bits)
Consumes num_bits from a rev_struct structure.
Definition: ht_dec.c:668
int num_runs
number of decoded runs left in runs (maximum 8)
Definition: ht_dec.c:148
#define OPJ_TRUE
Definition: openjpeg.h:117
ihdrbox_param_t * gene_ihdrbox(metadatalist_param_t *metadatalist, Byte_t *jpipstream)
generate ihdr box
Definition: ihdrbox_manager.c:36
OPJ_SIZE_T get_DBoxlen(box_param_t *box)
get DBox length
Definition: box_manager.c:311
int size
size of data
Definition: ht_dec.c:875
MEL state structure for reading and decoding the MEL bitstream.
Definition: ht_dec.c:138
uint32_t Byte4_t
Definition: byte_manager.h:39
OPJ_UINT32 X
0 or 0xFF, X's are inserted at end of bitstream
Definition: ht_dec.c:876
void opj_mutex_unlock(opj_mutex_t *mutex)
Unlock/release the mutex.
Definition: thread.c:453
OPJ_UINT64 tmp
temporary buffer of read data
Definition: ht_dec.c:872
OPJ_UINT32 len
Definition: tcd.h:99
State structure for reading and unstuffing of forward-growing bitstreams; these are: MagSgn and SPP b...
Definition: ht_dec.c:870
static INLINE int mel_get_run(dec_mel_t *melp)
Retrieves one run from dec_mel_t; if there are no runs stored MEL segment is decoded.
Definition: ht_dec.c:344
static INLINE OPJ_UINT32 rev_advance(rev_struct_t *vlcp, OPJ_UINT32 num_bits)
Consumes num_bits from a rev_struct structure.
Definition: ht_dec.c:523
struct opj_mutex_t opj_mutex_t
Opaque type for a mutex.
Definition: thread.h:52
Code-block for decoding.
Definition: tcd.h:120
static INLINE void mel_read(dec_mel_t *melp)
Reads and unstuffs the MEL bitstream.
Definition: ht_dec.c:165
static INLINE void rev_init(rev_struct_t *vlcp, OPJ_UINT8 *data, int lcup, int scup)
Initiates the rev_struct_t structure and reads a few bytes to move the read address to multiple of 4.
Definition: ht_dec.c:460
struct ihdrbox_param ihdrbox_param_t
I.5.3.1 Image Header box.
void opj_aligned_free(void *ptr)
Definition: opj_malloc.c:225
static INLINE OPJ_UINT32 frwd_fetch(frwd_struct_t *msp)
Fetches 32 bits from the frwd_struct_t bitstream.
Definition: ht_dec.c:1005
static INLINE OPJ_UINT32 read_le_uint32(const void *dataIn)
Read a little-endian serialized UINT32.
Definition: ht_dec.c:118
OPJ_INT32 y0
Definition: tcd.h:124
void * opj_aligned_malloc(size_t size)
Allocate memory aligned to a 16 byte boundary.
Definition: opj_malloc.c:207
static INLINE void frwd_advance(frwd_struct_t *msp, OPJ_UINT32 num_bits)
Consume num_bits bits from the bitstream of frwd_struct_t.
Definition: ht_dec.c:992
#define EVT_ERROR
Error event type.
Definition: event.h:66
A structure for reading and unstuffing a segment that grows backward, such as VLC and MRP.
Definition: ht_dec.c:361
uint32_t OPJ_UINT32
Definition: openjpeg.h:132
static OPJ_BOOL only_cleanup_pass_is_decoded
Displays the error message for disabling the decoding of SPP and MRP passes.
Definition: ht_dec.c:62
static INLINE void frwd_init(frwd_struct_t *msp, const OPJ_UINT8 *data, int size, OPJ_UINT32 X)
Initialize frwd_struct_t struct and reads some bytes.
Definition: ht_dec.c:956
opj_tcd_seg_data_chunk_t * chunks
Definition: tcd.h:122
uint16_t Byte2_t
Definition: byte_manager.h:38
OPJ_UINT8 * data
the address of data (or bitstream)
Definition: ht_dec.c:140
Byte4_t height
Definition: ihdrbox_manager.h:40
const OPJ_UINT8 * data
pointer to bitstream
Definition: ht_dec.c:871
#define OPJ_FALSE
Definition: openjpeg.h:118
box_param_t * search_box(const char type[], boxlist_param_t *boxlist)
search a box by box type
Definition: box_manager.c:346
OPJ_UINT64 tmp
temporary buffer of read data
Definition: ht_dec.c:364
I.5.3.1 Image Header box.
Definition: ihdrbox_manager.h:39
int size
number of bytes left
Definition: ht_dec.c:366
OPJ_UINT32 numbps
Definition: tcd.h:130
OPJ_UINT32 bits
number of bits stored in tmp
Definition: ht_dec.c:873
static INLINE OPJ_UINT32 population_count(OPJ_UINT32 val)
Generates population count (i.e., the number of set bits)
Definition: ht_dec.c:70
OPJ_OFF_T get_DBoxoff(box_param_t *box)
get DBox offset
Definition: box_manager.c:306
int size
number of bytes in MEL code
Definition: ht_dec.c:143
OPJ_BOOL unstuff
true if the next bit needs to be unstuffed
Definition: ht_dec.c:144
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)
Decodes one codeblock, processing the cleanup, siginificance propagation, and magnitude refinement pa...
Definition: ht_dec.c:1096
OPJ_UINT32 flagssize
Definition: t1.h:200
int vlc_tbl0[1024]
vlc_tbl0 contains decoding information for initial row of quads
Definition: t1_ht_generate_luts.c:901
static INLINE void mel_decode(dec_mel_t *melp)
Decodes unstuffed MEL segment bits stored in tmp to runs.
Definition: ht_dec.c:247
#define J2K_CCP_CBLKSTY_VSC
Vertically stripe causal context.
Definition: j2k.h:61
Byte2_t nc
number of components
Definition: ihdrbox_manager.h:42