Go to the documentation of this file.
54 #define J2K_CP_CSTY_PRT 0x01
55 #define J2K_CP_CSTY_SOP 0x02
56 #define J2K_CP_CSTY_EPH 0x04
57 #define J2K_CCP_CSTY_PRT 0x01
58 #define J2K_CCP_CBLKSTY_LAZY 0x01
59 #define J2K_CCP_CBLKSTY_RESET 0x02
60 #define J2K_CCP_CBLKSTY_TERMALL 0x04
61 #define J2K_CCP_CBLKSTY_VSC 0x08
62 #define J2K_CCP_CBLKSTY_PTERM 0x10
63 #define J2K_CCP_CBLKSTY_SEGSYM 0x20
64 #define J2K_CCP_CBLKSTY_HT 0x40
65 #define J2K_CCP_CBLKSTY_HTMIXED 0x80
66 #define J2K_CCP_QNTSTY_NOQNT 0
67 #define J2K_CCP_QNTSTY_SIQNT 1
68 #define J2K_CCP_QNTSTY_SEQNT 2
72 #define J2K_MS_SOC 0xff4f
73 #define J2K_MS_SOT 0xff90
74 #define J2K_MS_SOD 0xff93
75 #define J2K_MS_EOC 0xffd9
76 #define J2K_MS_CAP 0xff50
77 #define J2K_MS_SIZ 0xff51
78 #define J2K_MS_COD 0xff52
79 #define J2K_MS_COC 0xff53
80 #define J2K_MS_CPF 0xff59
81 #define J2K_MS_RGN 0xff5e
82 #define J2K_MS_QCD 0xff5c
83 #define J2K_MS_QCC 0xff5d
84 #define J2K_MS_POC 0xff5f
85 #define J2K_MS_TLM 0xff55
86 #define J2K_MS_PLM 0xff57
87 #define J2K_MS_PLT 0xff58
88 #define J2K_MS_PPM 0xff60
89 #define J2K_MS_PPT 0xff61
90 #define J2K_MS_SOP 0xff91
91 #define J2K_MS_EPH 0xff92
92 #define J2K_MS_CRG 0xff63
93 #define J2K_MS_COM 0xff64
94 #define J2K_MS_CBD 0xff78
95 #define J2K_MS_MCC 0xff75
96 #define J2K_MS_MCT 0xff74
97 #define J2K_MS_MCO 0xff77
103 #define J2K_MS_EPC 0xff68
104 #define J2K_MS_EPB 0xff66
105 #define J2K_MS_ESD 0xff67
106 #define J2K_MS_RED 0xff69
109 #define J2K_MS_SEC 0xff65
110 #define J2K_MS_INSEC 0xff94
114 #define J2K_MAX_POCS 32
865 const char*
const* p_options,
#define OPJ_J2K_MAXRLVLS
Number of maximum resolution level authorized.
Definition: openjpeg.h:152
static void opj_j2k_dump_MH_info(opj_j2k_t *p_j2k, FILE *out_stream)
Definition: j2k.c:11313
opj_procedure_list_t * m_procedure_list
the list of procedures to exec
Definition: j2k.h:587
OPJ_UINT32 cblkw
log2 of code-blocks width
Definition: openjpeg.h:914
#define opj_read_double
Definition: cio.h:67
static OPJ_BOOL opj_j2k_read_cbd(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a CBD marker (Component bit depth definition)
Definition: j2k.c:6578
OPJ_UINT32 * m_comps_indices_to_decode
Definition: j2k.h:493
OPJ_UINT32 num_layers_to_decode
Definition: j2k.h:252
OPJ_BOOL ownsData
Definition: tcd.h:211
OPJ_UINT32 compE
Definition: openjpeg.h:383
OPJ_UINT32 x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:715
OPJ_UINT32 opj_get_encoding_packet_count(const opj_image_t *p_image, const opj_cp_t *p_cp, OPJ_UINT32 p_tile_no)
Return the number of packets in the tile.
Definition: pi.c:1592
unsigned char OPJ_BYTE
Definition: openjpeg.h:123
OPJ_BITFIELD m_fixed_quality
add fixed_quality
Definition: j2k.h:333
static void opj_j2k_write_float_to_float64(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1634
void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t **cstr_info)
Destroy Codestream information after compression or decompression.
Definition: openjpeg.c:1041
float OPJ_FLOAT32
Definition: openjpeg.h:121
static OPJ_BOOL opj_j2k_update_image_data(opj_tcd_t *p_tcd, opj_image_t *p_output_image)
Definition: j2k.c:9927
static OPJ_BOOL opj_j2k_write_mct_record(opj_j2k_t *p_j2k, opj_mct_data_t *p_mct_record, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the MCT marker (Multiple Component Transform)
Definition: j2k.c:5730
OPJ_BOOL jpwl_correct
activates the JPWL correction capabilities
Definition: openjpeg.h:602
#define OPJ_COMP_PARAM_DEFAULT_PROG_ORDER
Definition: opj_common.h:44
OPJ_BYTE * m_header_data
Definition: j2k.h:470
opj_j2k_dec_t m_decoder
Definition: j2k.h:572
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
static OPJ_BOOL opj_j2k_write_qcd(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the QCD marker (quantization default)
Definition: j2k.c:2998
OPJ_BOOL opj_tcd_copy_tile_data(opj_tcd_t *p_tcd, OPJ_BYTE *p_src, OPJ_SIZE_T p_src_length)
Copies tile data from the given memory block onto the system.
Definition: tcd.c:2619
OPJ_FLOAT32 * m_mct_coding_matrix
the mct coding matrix
Definition: j2k.h:292
static OPJ_UINT32 opj_j2k_get_max_toc_size(opj_j2k_t *p_j2k)
Gets the maximum size taken by the toc headers of all the tile parts of any given tile.
Definition: j2k.c:3450
int hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: j2k.h:421
OPJ_PROG_ORDER prg
progression order
Definition: j2k.h:249
OPJ_BYTE * m_data
Definition: j2k.h:236
OPJ_BITFIELD m_fixed_alloc
allocation by fixed layer
Definition: j2k.h:331
enum PROG_ORDER OPJ_PROG_ORDER
Progression order.
OPJ_UINT32 cur_pino
Current Packet iterator number.
Definition: tcd.h:266
#define OPJ_EXTENSION_NONE
JPEG 2000 Part-2 extensions.
Definition: openjpeg.h:222
float tcp_rates[100]
rates of layers - might be subsequently limited by the max_cs_size field.
Definition: openjpeg.h:427
OPJ_UINT32 m_index
Definition: j2k.h:217
opj_image_t * image
image header
Definition: tcd.h:270
OPJ_UINT32 dy
YRsiz: vertical separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:681
OPJ_UINT32 m_data_size
Definition: j2k.h:219
opj_poc_t pocs[J2K_MAX_POCS]
progression order changes
Definition: j2k.h:260
OPJ_UINT32 nb_of_tiles
Definition: openjpeg.h:1056
void opj_dwt_calc_explicit_stepsizes(opj_tccp_t *tccp, OPJ_UINT32 prec)
Explicit calculation of the Quantization Stepsizes.
Definition: dwt.c:1966
void opj_thread_pool_destroy(opj_thread_pool_t *tp)
Destroy a thread pool.
Definition: thread.c:919
OPJ_BYTE m_tp_flag
Flag determining tile part generation.
Definition: j2k.h:327
static OPJ_BOOL opj_j2k_read_cap(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a CAP marker (extended capabilities definition).
Definition: j2k.c:6639
static OPJ_BOOL opj_j2k_read_SPCod_SPCoc(opj_j2k_t *p_j2k, OPJ_UINT32 compno, OPJ_BYTE *p_header_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
Reads a SPCod or SPCoc element, i.e.
Definition: j2k.c:10649
#define OPJ_COMMON_CBLK_DATA_EXTRA
Margin for a fake FFFF marker.
Definition: opj_common.h:39
OPJ_API int OPJ_CALLCONV opj_get_num_cpus(void)
Return the number of virtual CPUs.
Definition: thread.c:438
OPJ_CHAR * comment
comment
Definition: j2k.h:365
OPJ_UINT32 states
value of the state when the marker can appear
Definition: j2k.c:1399
OPJ_INT32 roishift
Region Of Interest shift.
Definition: j2k.h:199
static OPJ_BOOL opj_j2k_check_poc_val(const opj_poc_t *p_pocs, OPJ_UINT32 tileno, OPJ_UINT32 p_nb_pocs, OPJ_UINT32 p_nb_resolutions, OPJ_UINT32 numcomps, OPJ_UINT32 numlayers, opj_event_mgr_t *p_manager)
Checks the progression order changes values.
Definition: j2k.c:1662
static OPJ_BOOL opj_j2k_write_first_tile_part(opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, OPJ_UINT32 total_data_size, opj_stream_private_t *p_stream, struct opj_event_mgr *p_manager)
Definition: j2k.c:12754
static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a)
Get logarithm of an integer and round downwards.
Definition: opj_intmath.h:225
#define OPJ_PROFILE_IMF_2K
Definition: openjpeg.h:212
#define J2K_MAX_POCS
Maximum number of POCs.
Definition: j2k.h:114
static OPJ_BOOL opj_j2k_write_mcc_record(opj_j2k_t *p_j2k, opj_simple_mcc_decorrelation_data_t *p_mcc_record, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the MCC marker (Multiple Component Collection)
Definition: j2k.c:5937
static OPJ_BOOL opj_j2k_write_mco(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the MCO marker (Multiple component transformation ordering)
Definition: j2k.c:6285
opj_mct_data_t * m_offset_array
Definition: j2k.h:230
#define J2K_MS_ESD
ESD marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:105
OPJ_OFF_T main_head_start
main header start position (SOC position)
Definition: openjpeg.h:1039
OPJ_UINT32 numresolutions
number of resolutions
Definition: j2k.h:183
OPJ_BYTE * m_encoded_tile_data
Definition: j2k.h:537
#define OPJ_PROFILE_IMF_4K
Definition: openjpeg.h:213
struct opj_tcd * m_tcd
the current tile coder/decoder
Definition: j2k.h:599
opj_cp_t m_cp
Coding parameters.
Definition: j2k.h:584
static OPJ_BOOL opj_j2k_write_rgn(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no, OPJ_UINT32 nb_comps, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the RGN marker (Region Of Interest)
Definition: j2k.c:5071
struct opj_j2k opj_j2k_t
JPEG-2000 codestream reader/writer.
#define opj_write_double
Definition: cio.h:66
static OPJ_BOOL opj_j2k_write_siz(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the SIZ marker (image and tile size)
Definition: j2k.c:1968
static void opj_j2k_update_tlm(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_part_size)
Updates the Tile Length Marker.
Definition: j2k.c:911
static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b)
Get the minimum of two integers.
Definition: opj_intmath.h:56
void opj_j2k_destroy(opj_j2k_t *p_j2k)
Destroys a jpeg2000 codec.
Definition: j2k.c:9178
OPJ_BITFIELD m_can_decode
to tell that a tile can be decoded.
Definition: j2k.h:496
OPJ_INT32 x0
Definition: tcd.h:178
static OPJ_FLOAT32 opj_j2k_get_tp_stride(opj_tcp_t *p_tcp)
Definition: j2k.c:5249
static OPJ_BOOL opj_j2k_create_tcd(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Creates a tile-coder encoder.
Definition: j2k.c:13119
#define J2K_MS_PLT
PLT marker value.
Definition: j2k.h:87
static OPJ_BOOL opj_j2k_exec(opj_j2k_t *p_j2k, opj_procedure_list_t *p_procedure_list, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Executes the given procedures on the given codec.
Definition: j2k.c:8985
static OPJ_BOOL opj_j2k_write_all_qcc(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes QCC marker for each component.
Definition: j2k.c:5575
opj_encoding_param_t m_enc
Definition: j2k.h:401
@ OPJ_CINEMA2K_48
2K Digital Cinema at 24 fps
Definition: openjpeg.h:296
static OPJ_BOOL opj_j2k_setup_decoding_validation(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Sets up the validation ,i.e.
Definition: j2k.c:8473
unsigned int dump_state
Set to 1 by the decoder initialization if OPJ_DPARAMETERS_DUMP_FLAG is set.
Definition: j2k.h:611
int cp_tx0
XTOsiz.
Definition: openjpeg.h:397
OPJ_INT32 y1
Definition: tcd.h:178
JPEG-2000 codestream reader/writer.
Definition: j2k.h:566
#define OPJ_DPARAMETERS_DUMP_FLAG
Definition: openjpeg.h:547
static OPJ_BOOL opj_j2k_read_qcd(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a QCD marker (Quantization defaults)
Definition: j2k.c:3066
static void opj_j2k_copy_tile_quantization_parameters(opj_j2k_t *p_j2k)
Copies the tile quantization parameters of all the component from the first tile component.
Definition: j2k.c:11108
J2K_MCT_ARRAY_TYPE m_array_type
Definition: j2k.h:216
OPJ_BOOL opj_stream_has_seek(const opj_stream_private_t *p_stream)
Tells if the given stream is seekable.
Definition: cio.c:648
OPJ_INT32 x1
Definition: tcd.h:178
OPJ_UINT32 y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:717
J2K_STATUS
Values that specify the status of the decoding process when decoding the main header.
Definition: j2k.h:122
OPJ_BOOL opj_j2k_end_decompress(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Ends the decompression procedures and possibiliy add data to be read after the codestream.
Definition: j2k.c:8379
int tcp_numlayers
number of layers
Definition: openjpeg.h:423
#define OPJ_PROFILE_NONE
JPEG 2000 Profiles, see Table A.10 from 15444-1 (updated in various AMD) These values help choosing t...
Definition: openjpeg.h:200
static OPJ_BOOL opj_j2k_write_cbd(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the CBD marker (Component bit depth definition)
Definition: j2k.c:6509
static OPJ_BOOL opj_j2k_write_plt_in_memory(opj_j2k_t *p_j2k, opj_tcd_marker_info_t *marker_info, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, opj_event_mgr_t *p_manager)
Write one or more PLT markers in the provided buffer.
Definition: j2k.c:4696
OPJ_UINT32 max_tiles
maximum number of tiles at the decoder
Definition: j2k.h:449
OPJ_BOOL opj_j2k_read_header(opj_stream_private_t *p_stream, opj_j2k_t *p_j2k, opj_image_t **p_image, opj_event_mgr_t *p_manager)
Reads a jpeg2000 codestream header structure.
Definition: j2k.c:8390
OPJ_INT32 m_tp_pos
Position of tile part flag in progression order.
Definition: j2k.h:323
OPJ_BITFIELD m_is_irreversible
Definition: j2k.h:231
OPJ_UINT32 qntsty
quantisation style
Definition: openjpeg.h:922
void opj_procedure_list_destroy(opj_procedure_list_t *p_list)
Destroys a validation list.
Definition: function_list.c:58
OPJ_BOOL opj_j2k_set_threads(opj_j2k_t *j2k, OPJ_UINT32 num_threads)
Definition: j2k.c:6710
OPJ_UINT32 numcomps
number of components in the image
Definition: openjpeg.h:719
static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b)
Divide an integer and round upwards.
Definition: opj_intmath.h:170
static OPJ_BOOL opj_j2k_read_coc(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a COC marker (Coding Style Component)
Definition: j2k.c:2939
OPJ_UINT32 current_nb_tps
current nb of tile part (allocated)
Definition: openjpeg.h:1012
OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k, opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Definition: j2k.c:7616
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_has_thread_support(void)
Returns if the library is built with thread support.
Definition: thread.c:433
OPJ_UINT32 m_sot_length
to tell the tile part length
Definition: j2k.h:473
static OPJ_UINT32 opj_j2k_get_max_coc_size(opj_j2k_t *p_j2k)
Gets the maximum size taken by a coc.
Definition: j2k.c:2911
OPJ_OFF_T end_pos
end position
Definition: openjpeg.h:998
int subsampling_dy
subsampling value for dy
Definition: openjpeg.h:469
static OPJ_BOOL opj_j2k_read_SQcd_SQcc(opj_j2k_t *p_j2k, OPJ_UINT32 compno, OPJ_BYTE *p_header_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
Reads a SQcd or SQcc element, i.e.
Definition: j2k.c:10989
OPJ_BOOL opj_tcd_init_encode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, opj_event_mgr_t *p_manager)
Initialize the tile coder and may reuse some meory.
Definition: tcd.c:1198
float tcp_distoratio[100]
different psnr for successive layers.
Definition: openjpeg.h:430
OPJ_BOOL opj_j2k_end_compress(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Ends the compression procedures and possibiliy add data to be read after the codestream.
Definition: j2k.c:12339
@ J2K_STATE_MT
the EOC marker has just been read
Definition: j2k.h:129
#define SIZE_MAX
Definition: opj_malloc.c:40
#define OPJ_CINEMA_48_COMP
Definition: openjpeg.h:270
#define OPJ_J2K_TH_INFO
Tile information based on the current tile header.
Definition: openjpeg.h:178
OPJ_INT32 * data
image component data
Definition: openjpeg.h:701
#define OPJ_IS_IMF(v)
Definition: openjpeg.h:231
int pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (>=0)
Definition: j2k.h:427
@ THRESH_CALC
Definition: j2k.h:162
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 OPJ_PROFILE_CINEMA_S4K
Definition: openjpeg.h:207
OPJ_UINT32 ppm_len
size of the ppm_data
Definition: j2k.h:379
#define OPJ_J2K_TCH_INFO
Tile/Component information of all tiles.
Definition: openjpeg.h:179
OPJ_BOOL opj_j2k_write_tile(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes a tile.
Definition: j2k.c:13148
OPJ_OFF_T opj_stream_get_number_byte_left(const opj_stream_private_t *p_stream)
Get the number of bytes left before the end of the stream (similar to cio_numbytesleft).
Definition: cio.c:584
@ J2K_STATE_MHSOC
a SOC marker is expected
Definition: j2k.h:124
static OPJ_BOOL opj_j2k_compare_SPCod_SPCoc(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
Compare 2 a SPCod/ SPCoc elements, i.e.
Definition: j2k.c:10533
static const j2k_prog_order_t j2k_prog_order_list[]
Definition: j2k.c:1352
int64_t OPJ_INT64
Definition: openjpeg.h:133
static OPJ_BOOL opj_j2k_move_data_from_codec_to_output_image(opj_j2k_t *p_j2k, opj_image_t *p_image)
Definition: j2k.c:11902
union opj_j2k::@1 m_specific_param
static OPJ_BOOL opj_j2k_setup_header_reading(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Sets up the procedures to do on reading header.
Definition: j2k.c:8452
int cblockh_init
initial code block height, default to 64
Definition: openjpeg.h:436
static const opj_j2k_mct_function j2k_mct_read_functions_to_float[]
Definition: j2k.c:1374
#define OPJ_GET_IMF_SUBLEVEL(v)
Definition: openjpeg.h:236
static OPJ_BOOL opj_j2k_write_sod(opj_j2k_t *p_j2k, opj_tcd_t *p_tile_coder, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, OPJ_UINT32 total_data_size, const opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the SOD marker (Start of data)
Definition: j2k.c:4780
static OPJ_BOOL opj_j2k_write_tlm(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the TLM marker (Tile Length Marker)
Definition: j2k.c:4200
OPJ_BITFIELD ppt
If ppt == 1 --> there was a PPT marker for the present tile.
Definition: j2k.h:311
OPJ_BYTE * m_tlm_sot_offsets_buffer
Stores the sizes of the tlm.
Definition: j2k.h:526
static OPJ_UINT32 opj_j2k_get_max_qcc_size(opj_j2k_t *p_j2k)
Gets the maximum size taken by a qcc.
Definition: j2k.c:3196
static OPJ_BOOL opj_j2k_read_ppt(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a PPT marker (Packed packet headers, tile-part header)
Definition: j2k.c:4062
#define OPJ_PROFILE_CINEMA_4K
Definition: openjpeg.h:205
#define J2K_MS_PPT
PPT marker value.
Definition: j2k.h:89
int sens_MH
sensitivity method for MH (-1,0-7)
Definition: j2k.h:439
@ OPJ_CINEMA4K
Profile name for a 2K image.
Definition: openjpeg.h:285
OPJ_UINT16 rsiz
RSIZ value To be used to combine OPJ_PROFILE_*, OPJ_EXTENSION_* and (sub)levels values.
Definition: openjpeg.h:543
static OPJ_BOOL opj_j2k_read_qcc(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a QCC marker (Quantization component)
Definition: j2k.c:3208
static OPJ_BOOL opj_j2k_write_SPCod_SPCoc(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
Writes a SPCod or SPCoc element, i.e.
Definition: j2k.c:10580
OPJ_BOOL info_on
enables writing of informative techniques of ESD, in case of activated JPWL
Definition: j2k.h:417
#define OPJ_J2K_DEFAULT_HEADER_SIZE
Definition: openjpeg.h:157
OPJ_UINT32 maxmarknum
actual size of markers array
Definition: openjpeg.h:1024
#define J2K_MS_COC
COC marker value.
Definition: j2k.h:79
OPJ_UINT32 opj_procedure_list_get_nb_procedures(opj_procedure_list_t *p_validation_list)
Gets the number of validation procedures.
Definition: function_list.c:102
OPJ_BYTE * ppm_buffer
packet header storage original buffer
Definition: j2k.h:386
OPJ_UINT32 m_nb_mcc_records
the number of mct records.
Definition: j2k.h:302
OPJ_UINT32 ihdr_h
Image height coming from JP2 IHDR box.
Definition: j2k.h:608
OPJ_BYTE * m_data
Definition: j2k.h:218
OPJ_UINT32 m_index
Definition: j2k.h:227
static OPJ_BOOL opj_j2k_add_mct(opj_tcp_t *p_tcp, opj_image_t *p_image, OPJ_UINT32 p_index)
Definition: j2k.c:6422
int res_spec
Definition: openjpeg.h:446
OPJ_UINT32 m_end_tile_x
Definition: j2k.h:477
@ OPJ_CINEMA2K
Standard JPEG2000 profile.
Definition: openjpeg.h:284
OPJ_BOOL opj_j2k_decode_tile(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Decode tile data.
Definition: j2k.c:9827
OPJ_BOOL opj_j2k_get_tile(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager, OPJ_UINT32 tile_index)
Definition: j2k.c:12020
int cp_fixed_quality
add fixed_quality
Definition: openjpeg.h:409
#define J2K_MS_SEC
SEC marker value (Part 8: Secure JPEG 2000)
Definition: j2k.h:109
static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a SIZ marker (image and tile size)
Definition: j2k.c:2074
void *OPJ_CALLCONV opj_image_data_alloc(OPJ_SIZE_T size)
Allocator for opj_image_t->comps[].data To be paired with opj_image_data_free.
Definition: openjpeg.c:1128
static void opj_j2k_copy_tile_component_parameters(opj_j2k_t *p_j2k)
Copies the tile component parameters of all the component from the first tile component.
Definition: j2k.c:10801
static OPJ_BOOL opj_j2k_read_sot(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a SOT marker (Start of tile-part)
Definition: j2k.c:4374
@ tcp
Definition: query_parser.h:41
OPJ_BOOL opj_tcd_update_tile_data(opj_tcd_t *p_tcd, OPJ_BYTE *p_dest, OPJ_UINT32 p_dest_length)
Copies tile data from the system onto the given memory block.
Definition: tcd.c:1731
static OPJ_BOOL opj_j2k_read_plt(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a PLT marker (Packet length, tile-part header)
Definition: j2k.c:3790
OPJ_BOOL m_last_tile_part
Indicate that the current tile-part is assume as the last tile part of the codestream.
Definition: j2k.h:490
OPJ_BYTE * ppt_data
packet header store there for future use in t2_decode_packet
Definition: j2k.h:268
static OPJ_BOOL opj_j2k_is_imf_compliant(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Definition: j2k.c:7175
int64_t OPJ_OFF_T
Definition: openjpeg.h:136
#define J2K_MS_SOP
SOP marker value.
Definition: j2k.h:90
OPJ_BITFIELD ppm
if ppm == 1 --> there was a PPM marker
Definition: j2k.h:454
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
OPJ_BOOL red_on
enables writing of RED, in case of activated JPWL
Definition: j2k.h:419
int exp_comps
expected number of components at the decoder
Definition: j2k.h:447
#define J2K_MS_INSEC
INSEC marker value (Part 8: Secure JPEG 2000)
Definition: j2k.h:110
int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (>=0)
Definition: openjpeg.h:502
@ OPJ_RLCP
resolution-layer-component-precinct order
Definition: openjpeg.h:306
OPJ_FLOAT32 rates[100]
rates of layers
Definition: j2k.h:256
OPJ_INT32 x1
Definition: tcd.h:196
@ MCT_TYPE_DEPENDENCY
Definition: j2k.h:151
Message handler object used for.
Definition: event.h:50
#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS
Definition: openjpeg.h:158
opj_j2k_t * opj_j2k_create_decompress(void)
Creates a J2K decompression structure.
Definition: j2k.c:10411
opj_tccp_info_t * tccp_info
information concerning tile component parameters
Definition: openjpeg.h:955
void j2k_dump_image_comp_header(opj_image_comp_t *comp_header, OPJ_BOOL dev_dump_flag, FILE *out_stream)
Dump a component image header structure.
Definition: j2k.c:11358
static const opj_j2k_mct_function j2k_mct_write_functions_from_float[]
Definition: j2k.c:1388
#define J2K_CCP_QNTSTY_SEQNT
Definition: j2k.h:68
@ OPJ_STD_RSIZ
Definition: openjpeg.h:283
OPJ_UINT32 cp_layer
Set the maximum number of quality layers to decode.
Definition: openjpeg.h:567
enum MCT_ARRAY_TYPE J2K_MCT_ARRAY_TYPE
Type of MCT array.
OPJ_BITFIELD m_nb_tile_parts_correction
Definition: j2k.h:501
const char * opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
Converts an enum type progression order to string type.
Definition: j2k.c:1651
opj_packet_info_t * packet_index
information concerning packets inside tile
Definition: openjpeg.h:1030
#define OPJ_IS_BROADCAST(v)
Definition: openjpeg.h:230
int sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1,0-7)
Definition: j2k.h:443
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
OPJ_BITFIELD allow_different_bit_depth_sign
whether different bit depth or sign per component is allowed.
Definition: j2k.h:458
OPJ_INT32 m_dc_level_shift
the dc_level_shift
Definition: j2k.h:205
char * cp_comment
comment for coding
Definition: openjpeg.h:413
OPJ_BYTE * ppm_data_first
pointer remaining on the first byte of the first header if ppm is used
Definition: j2k.h:388
char str_prog[5]
Definition: j2k.c:1349
OPJ_UINT32 cur_tp_num
Current tile part number.
Definition: tcd.h:262
opj_j2k_t * opj_j2k_create_compress(void)
Creates a J2K compression structure.
Definition: j2k.c:6758
int jpwl_sens_size
enables writing of ESD, (0=no/1/2 bytes)
Definition: openjpeg.h:494
static OPJ_BOOL opj_j2k_setup_header_writing(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Sets up the procedures to do on writing header.
Definition: j2k.c:12663
OPJ_PROG_ORDER prog_order
progression order (default OPJ_LRCP)
Definition: openjpeg.h:417
OPJ_BOOL opj_j2k_encode(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Encodes an image into a JPEG-2000 codestream.
Definition: j2k.c:12231
OPJ_UINT32 m_max_comp_size
Maximum rate for each component.
Definition: j2k.h:321
OPJ_BOOL m_TLM
Definition: j2k.h:513
uint8_t OPJ_UINT8
Definition: openjpeg.h:128
static void opj_j2k_dump_tile_info(opj_tcp_t *l_default_tile, OPJ_INT32 numcomps, FILE *out_stream)
Definition: j2k.c:11137
static OPJ_BOOL opj_j2k_setup_end_compress(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Sets up the validation ,i.e.
Definition: j2k.c:12603
static void opj_j2k_set_imf_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Definition: j2k.c:7086
Defines a single image component.
Definition: openjpeg.h:677
static OPJ_BOOL opj_j2k_write_eoc(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the EOC marker (End of Codestream)
Definition: j2k.c:5134
static OPJ_BOOL opj_j2k_read_cod(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a COD marker (Coding style defaults)
Definition: j2k.c:2662
opj_procedure_list_t * m_validation_list
the list of validation procedures to follow to make sure the code is valid
Definition: j2k.h:590
OPJ_UINT32 m_layer
if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers ...
Definition: j2k.h:343
void opj_calculate_norms(OPJ_FLOAT64 *pNorms, OPJ_UINT32 pNbComps, OPJ_FLOAT32 *pMatrix)
FIXME DOC.
Definition: mct.c:444
OPJ_OFF_T main_head_end
main header end position (first SOT position)
Definition: openjpeg.h:1041
static void opj_j2k_write_poc_in_memory(opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, opj_event_mgr_t *p_manager)
Writes the POC marker (Progression Order Change)
Definition: j2k.c:3343
#define J2K_MS_EPC
EPC marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:103
OPJ_UINT32 ppm_data_read
size of the ppm_data
Definition: j2k.h:381
Byte input-output stream.
Definition: cio.h:81
@ OPJ_CPRL
component-precinct-resolution-layer order
Definition: openjpeg.h:309
opj_tcd_resolution_t * resolutions
Definition: tcd.h:204
OPJ_UINT32 m_nb_max_mct_records
the max number of mct records.
Definition: j2k.h:298
static void opj_j2k_get_tile_data(opj_tcd_t *p_tcd, OPJ_BYTE *p_data)
Definition: j2k.c:12470
int pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (>=0)
Definition: j2k.h:429
#define OPJ_COMP_PARAM_DEFAULT_CBLOCKW
Definition: opj_common.h:42
#define OPJ_J2K_MAXBANDS
Number of maximum sub-band linked to number of resolution level.
Definition: openjpeg.h:153
OPJ_OFF_T end_header
end position of the header
Definition: openjpeg.h:996
int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (>=0)
Definition: openjpeg.h:488
static void opj_j2k_read_int16_to_float(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1447
OPJ_UINT32 qmfbid
discrete wavelet transform identifier: 0 = 9-7 irreversible, 1 = 5-3 reversible
Definition: openjpeg.h:920
@ MCT_TYPE_DOUBLE
MCT data is stored as floats.
Definition: j2k.h:144
OPJ_UINT32 m_nb_max_mcc_records
the max number of mct records.
Definition: j2k.h:304
double OPJ_FLOAT64
Definition: openjpeg.h:122
Coding parameters.
Definition: j2k.h:351
opj_stepsize_t stepsizes[OPJ_J2K_MAXBANDS]
stepsizes used for quantization
Definition: j2k.h:195
OPJ_UINT32 nb_packet
packet number
Definition: openjpeg.h:1028
OPJ_INT32 x0
Definition: tcd.h:196
#define OPJ_CINEMA_24_COMP
Definition: openjpeg.h:269
Index structure about a tile.
Definition: openjpeg.h:1005
@ J2K_STATE_MH
the decoding process is in the main header
Definition: j2k.h:126
OPJ_UINT32 cblksty
code-block coding style
Definition: openjpeg.h:918
opj_codestream_index_t * j2k_get_cstr_index(opj_j2k_t *p_j2k)
Get the codestream index from a JPEG2000 codec.
Definition: j2k.c:11457
OPJ_BITFIELD m_discard_tiles
Definition: j2k.h:497
int numresolution
number of resolutions
Definition: openjpeg.h:432
static OPJ_BOOL opj_j2k_setup_decoding(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Sets up the procedures to do on decoding data.
Definition: j2k.c:11754
OPJ_UINT32 m_nb_comps
Definition: j2k.h:228
OPJ_OFF_T m_tlm_start
locate the start position of the TLM marker after encoding the tilepart, a jump (in j2k_write_sod) is...
Definition: j2k.h:522
int jpwl_exp_comps
expected number of components
Definition: openjpeg.h:604
OPJ_UINT32 csty
coding style
Definition: j2k.h:247
Compression parameters.
Definition: openjpeg.h:393
OPJ_UINT32 m_current_tile_number
number of the tile currently concern by coding/decoding
Definition: j2k.h:596
OPJ_BOOL opj_j2k_set_decoded_components(opj_j2k_t *p_j2k, OPJ_UINT32 numcomps, const OPJ_UINT32 *comps_indices, opj_event_mgr_t *p_manager)
Sets the indices of the components to decode.
Definition: j2k.c:10196
#define OPJ_PROFILE_IMF_2K_R
Definition: openjpeg.h:215
OPJ_BOOL opj_j2k_start_compress(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Starts a compression scheme, i.e.
Definition: j2k.c:12355
OPJ_UINT32 m_start_tile_y
Definition: j2k.h:476
static OPJ_BOOL opj_j2k_write_coc(opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the COC marker (Coding style component)
Definition: j2k.c:2789
OPJ_PROG_ORDER prg
progression order
Definition: openjpeg.h:948
void j2k_destroy_cstr_index(opj_codestream_index_t *p_cstr_ind)
Destroys a codestream index structure.
Definition: j2k.c:9248
void j2k_dump_image_comp_header(opj_image_comp_t *comp, OPJ_BOOL dev_dump_flag, FILE *out_stream)
Dump a component image header structure.
Definition: j2k.c:11358
#define J2K_MS_PPM
PPM marker value.
Definition: j2k.h:88
static const opj_j2k_mct_function j2k_mct_read_functions_to_int32[]
Definition: j2k.c:1381
static OPJ_BOOL opj_j2k_read_poc(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a POC marker (Progression Order Change)
Definition: j2k.c:3523
struct opj_simple_mcc_decorrelation_data opj_simple_mcc_decorrelation_data_t
FIXME DOC.
@ OPJ_CINEMA2K_24
Not Digital Cinema.
Definition: openjpeg.h:295
opj_image_t * m_output_image
Definition: j2k.h:581
OPJ_BOOL esd_on
enables writing of ESD, in case of activated JPWL
Definition: j2k.h:415
OPJ_BOOL opj_tcd_init(opj_tcd_t *p_tcd, opj_image_t *p_image, opj_cp_t *p_cp, opj_thread_pool_t *p_tp)
Initialize the tile coder and may reuse some memory.
Definition: tcd.c:646
int cp_tdx
XTsiz.
Definition: openjpeg.h:401
static OPJ_BOOL opj_j2k_write_poc(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the POC marker (Progression Order Change)
Definition: j2k.c:3288
OPJ_INT32 x1
Definition: tcd.h:235
Quantization stepsize.
Definition: j2k.h:169
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:1022
OPJ_UINT32 m_total_tile_parts
Total num of tile parts in whole image = num tiles* num tileparts in each tile.
Definition: j2k.h:534
int hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (>=0)
Definition: j2k.h:423
#define EVT_WARNING
Warning event type.
Definition: event.h:67
OPJ_INT32 ppm_store
use in case of multiple marker PPM (number of info already store)
Definition: j2k.h:392
int irreversible
1 : use the irreversible DWT 9-7, 0 : use lossless compression (default)
Definition: openjpeg.h:440
#define OPJ_IS_STORAGE(v)
Definition: openjpeg.h:229
OPJ_UINT32 ihdr_w
Image width coming from JP2 IHDR box.
Definition: j2k.h:605
static void opj_j2k_read_float32_to_int32(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1549
OPJ_BOOL whole_tile_decoding
Only valid for decoding.
Definition: tcd.h:287
static OPJ_BOOL opj_j2k_merge_ppm(opj_cp_t *p_cp, opj_event_mgr_t *p_manager)
Merges all PPM markers read (Packed headers, main header)
Definition: j2k.c:3922
OPJ_BOOL opj_j2k_set_threads(opj_j2k_t *j2k, OPJ_UINT32 num_threads)
Definition: j2k.c:6710
OPJ_BOOL opj_j2k_set_decoded_resolution_factor(opj_j2k_t *p_j2k, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
Definition: j2k.c:12135
OPJ_UINT32 tdy
YTsiz.
Definition: j2k.h:363
static OPJ_UINT32 opj_j2k_get_specific_header_sizes(opj_j2k_t *p_j2k)
Gets the maximum size taken by the headers of the SOT.
Definition: j2k.c:3469
OPJ_UINT32 tx0
XTOsiz.
Definition: j2k.h:357
OPJ_BOOL m_is_decoder
Definition: j2k.h:568
#define J2K_MS_TLM
TLM marker value.
Definition: j2k.h:85
OPJ_UINT32 ppm_markers_count
number of ppm markers (reserved size)
Definition: j2k.h:372
struct opj_j2k_dec opj_j2k_dec_t
OPJ_FLOAT32 * m_mct_decoding_matrix
the mct decoding matrix
Definition: j2k.h:290
OPJ_UINT32 prch[OPJ_J2K_MAXRLVLS]
precinct height
Definition: j2k.h:203
OPJ_INT32 mant
mantissa
Definition: j2k.h:173
static OPJ_BOOL opj_j2k_are_all_used_components_decoded(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Definition: j2k.c:11597
#define J2K_MS_RED
RED marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:106
OPJ_BOOL opj_matrix_inversion_f(OPJ_FLOAT32 *pSrcMatrix, OPJ_FLOAT32 *pDestMatrix, OPJ_UINT32 nb_compo)
Matrix inversion.
Definition: invert.c:70
OPJ_INT32 expn
exponent
Definition: j2k.h:171
OPJ_SIZE_T opj_tcd_get_encoder_input_buffer_size(opj_tcd_t *p_tcd)
Get the size in bytes of the input buffer provided before encoded.
Definition: tcd.c:2367
OPJ_BOOL opj_j2k_decode(opj_j2k_t *j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Decode an image from a JPEG-2000 codestream.
Definition: j2k.c:11962
OPJ_UINT32 prcw[OPJ_J2K_MAXRLVLS]
precinct width
Definition: openjpeg.h:932
OPJ_BOOL opj_j2k_encoder_set_extra_options(opj_j2k_t *p_j2k, const char *const *p_options, opj_event_mgr_t *p_manager)
Specify extra options for the encoder.
Definition: j2k.c:12168
static OPJ_BOOL opj_j2k_decoding_validation(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
The default decoding validation procedure without any extension.
Definition: j2k.c:8767
#define OPJ_IMG_INFO
EXPERIMENTAL FOR THE MOMENT Supported options about file information used only in j2k_dump.
Definition: openjpeg.h:176
OPJ_BOOL opj_j2k_set_decode_area(opj_j2k_t *p_j2k, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_x, OPJ_INT32 p_end_y, opj_event_mgr_t *p_manager)
Sets the given area to be decoded.
Definition: j2k.c:10256
OPJ_UINT32 numpocs
number of progression order changes
Definition: j2k.h:258
int cp_ty0
YTOsiz.
Definition: openjpeg.h:399
OPJ_UINT32 minimum_num_resolutions
Definition: tcd.h:202
OPJ_CINEMA_MODE cp_cinema
DEPRECATED: use RSIZ, OPJ_PROFILE_* and MAX_COMP_SIZE instead Digital Cinema compliance 0-not complia...
Definition: openjpeg.h:512
OPJ_UINT32 tdx
XTsiz.
Definition: j2k.h:361
OPJ_UINT32 maxmarknum
actual size of markers array
Definition: openjpeg.h:1052
OPJ_UINT32 numgbits
number of guard bits
Definition: openjpeg.h:928
static OPJ_BOOL opj_j2k_encoding_validation(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
The default encoding validation procedure without any extension.
Definition: j2k.c:8716
#define OPJ_UNUSED(x)
Definition: jp2.c:47
static OPJ_BOOL opj_j2k_read_unk(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, OPJ_UINT32 *output_marker, opj_event_mgr_t *p_manager)
Reads an unknown marker.
Definition: j2k.c:5667
T2_MODE
T2 encoding mode.
Definition: j2k.h:161
static OPJ_BOOL opj_j2k_get_end_header(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Gets the offset of the header.
Definition: j2k.c:5487
static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b)
Get the saturated sum of two unsigned integers.
Definition: opj_intmath.h:92
@ MCT_TYPE_OFFSET
Definition: j2k.h:153
OPJ_UINT32 marknum
number of markers
Definition: openjpeg.h:1048
int sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (>=0)
Definition: j2k.h:441
int OPJ_BOOL
Definition: openjpeg.h:116
OPJ_UINT32 cp_reduce
Set the number of highest resolution levels to be discarded.
Definition: openjpeg.h:560
#define J2K_MS_QCC
QCC marker value.
Definition: j2k.h:83
OPJ_UINT32 ppm_data_size
Number of bytes actually stored inside the ppm_data.
Definition: j2k.h:390
OPJ_UINT32 ty0
tile origin in y = YTOsiz
Definition: openjpeg.h:967
opj_tcp_t * tcps
tile coding parameters
Definition: j2k.h:397
void opj_j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: j2k.c:6688
size_t OPJ_SIZE_T
Definition: openjpeg.h:139
unsigned int flags
Definition: openjpeg.h:610
static OPJ_BOOL opj_j2k_decode_one_tile(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Definition: j2k.c:11773
#define OPJ_J2K_MH_INFO
Codestream information based only on the main header.
Definition: openjpeg.h:177
#define J2K_MS_SIZ
SIZ marker value.
Definition: j2k.h:77
static OPJ_BOOL opj_j2k_read_header_procedure(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
The read header procedure.
Definition: j2k.c:8800
OPJ_BOOL(* handler)(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
action linked to the marker
Definition: j2k.c:1401
static OPJ_BOOL opj_j2k_write_mct_data_group(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the CBD-MCT-MCC-MCO markers (Multi components transform)
Definition: j2k.c:5503
OPJ_PROG_ORDER prg
Definition: openjpeg.h:373
#define OPJ_GET_IMF_MAINLEVEL(v)
Definition: openjpeg.h:235
OPJ_UINT32 csty
coding style
Definition: openjpeg.h:910
@ OPJ_PROG_UNKNOWN
place-holder
Definition: openjpeg.h:304
static void opj_j2k_tcp_destroy(opj_tcp_t *p_tcp)
Destroys a tile coding parameter structure.
Definition: j2k.c:9287
OPJ_BYTE * m_header_tile_data
Definition: j2k.h:543
#define J2K_MS_SOT
SOT marker value.
Definition: j2k.h:73
struct opj_cp opj_cp_t
Coding parameters.
static void opj_j2k_write_coc_in_memory(opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, opj_event_mgr_t *p_manager)
Writes the COC marker (Coding style component)
Definition: j2k.c:2861
void opj_tcd_marker_info_destroy(opj_tcd_marker_info_t *p_tcd_marker_info)
Destroy a previously created opj_tcd_marker_info_t* structure.
Definition: tcd.c:2851
@ MCT_TYPE_INT16
Definition: j2k.h:141
static OPJ_BOOL opj_j2k_setup_encoding_validation(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Sets up the validation ,i.e.
Definition: j2k.c:12638
OPJ_BYTE * ppm_data_current
Definition: j2k.h:383
static void opj_j2k_write_qcc_in_memory(opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, opj_event_mgr_t *p_manager)
Writes the QCC marker (quantization component)
Definition: j2k.c:3146
opj_procedure_list_t * opj_procedure_list_create()
Creates a validation list.
Definition: function_list.c:39
#define OPJ_J2K_MH_IND
Codestream index based only on the main header.
Definition: openjpeg.h:180
static OPJ_BOOL opj_j2k_calculate_tp(opj_j2k_t *p_j2k, opj_cp_t *cp, OPJ_UINT32 *p_nb_tiles, opj_image_t *image, opj_event_mgr_t *p_manager)
Calculates the total number of tile parts needed by the encoder to encode such an image.
Definition: j2k.c:1806
@ OPJ_PCRL
precinct-component-resolution-layer order
Definition: openjpeg.h:308
OPJ_BOOL opj_stream_flush(opj_stream_private_t *p_stream, opj_event_mgr_t *p_event_mgr)
Writes the content of the stream buffer to the stream.
Definition: cio.c:433
OPJ_BITFIELD m_skip_data
Definition: j2k.h:498
OPJ_UINT32 prcw[OPJ_J2K_MAXRLVLS]
precinct width
Definition: j2k.h:201
OPJ_BOOL opj_procedure_list_add_procedure(opj_procedure_list_t *p_validation_list, opj_procedure p_procedure, opj_event_mgr_t *p_manager)
Adds a new validation procedure.
Definition: function_list.c:70
struct opj_dec_memory_marker_handler opj_dec_memory_marker_handler_t
OPJ_UINT32 x0
x component offset compared to the whole image
Definition: openjpeg.h:687
#define J2K_MS_CAP
CAP marker value.
Definition: j2k.h:76
static OPJ_BOOL opj_j2k_add_tlmarker(OPJ_UINT32 tileno, opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len)
Add tile header marker information.
Definition: j2k.c:8326
opj_ppx * ppm_markers
ppm markers data (table indexed by Zppm)
Definition: j2k.h:374
static OPJ_BOOL opj_j2k_read_rgn(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a RGN marker (Region Of Interest)
Definition: j2k.c:5175
#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS
Definition: openjpeg.h:159
void OPJ_CALLCONV opj_image_destroy(opj_image_t *image)
Deallocate any resources associated with an image.
Definition: image.c:91
#define J2K_MS_SOC
SOC marker value.
Definition: j2k.h:72
static void opj_j2k_read_float32_to_float(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1481
OPJ_BOOL opj_j2k_decode_tile(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Decode tile data.
Definition: j2k.c:9827
#define OPJ_PROFILE_PART2
Definition: openjpeg.h:203
#define OPJ_IS_CINEMA(v)
JPEG 2000 profile macros.
Definition: openjpeg.h:228
opj_codestream_info_v2_t * j2k_get_cstr_info(opj_j2k_t *p_j2k)
Get the codestream info from a JPEG2000 codec.
Definition: j2k.c:11381
static OPJ_BOOL opj_j2k_write_all_coc(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes COC marker for each component.
Definition: j2k.c:5551
OPJ_BYTE * ppt_buffer
used to keep a track of the allocated memory
Definition: j2k.h:270
struct j2k_prog_order j2k_prog_order_t
static OPJ_BOOL opj_j2k_need_nb_tile_parts_correction(opj_stream_private_t *p_stream, OPJ_UINT32 tile_no, OPJ_BOOL *p_correction_needed, opj_event_mgr_t *p_manager)
Checks for invalid number of tile-parts in SOT marker (TPsot==TNsot).
Definition: j2k.c:9410
Tile-component resolution structure.
Definition: tcd.h:176
opj_ppx * ppt_markers
ppt markers data (table indexed by Zppt)
Definition: j2k.h:265
static OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_UINT16 rsiz, opj_event_mgr_t *p_manager)
Definition: j2k.c:6972
char OPJ_CHAR
Definition: openjpeg.h:120
#define opj_read_float
Definition: cio.h:69
OPJ_UINT32 m_numcomps_to_decode
Definition: j2k.h:492
opj_tile_index_t * tile_index
Definition: openjpeg.h:1058
opj_tcd_tile_t * tiles
Definition: tcd.h:248
Tile-component structure.
Definition: tcd.h:194
int len
length, marker val included
Definition: openjpeg.h:788
OPJ_UINT32 tw
number of tiles in X
Definition: openjpeg.h:973
static OPJ_BOOL opj_j2k_write_epc(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes EPC ????
Definition: j2k.c:5627
enum T2_MODE J2K_T2_MODE
T2 encoding mode.
OPJ_PROG_ORDER enum_prog
Definition: j2k.c:1348
uint64_t OPJ_UINT64
Definition: openjpeg.h:134
OPJ_UINT32 sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:695
static const struct opj_dec_memory_marker_handler * opj_j2k_get_marker_handler(OPJ_UINT32 p_id)
Reads the lookup table containing all the marker, status and action, and returns the handler associat...
Definition: j2k.c:9166
void opj_procedure_list_clear(opj_procedure_list_t *p_validation_list)
Clears the list of validation procedures.
Definition: function_list.c:114
OPJ_INT32 * data_win
data of the component limited to window of interest.
Definition: tcd.h:218
opj_thread_pool_t * m_tp
Thread pool.
Definition: j2k.h:602
Information structure about the codestream (FIXME should be expand and enhance)
Definition: openjpeg.h:962
OPJ_BITFIELD m_tp_on
Enabling Tile part generation.
Definition: j2k.h:335
static OPJ_BOOL opj_j2k_read_ppm(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a PPM marker (Packed headers, main header)
Definition: j2k.c:3844
MCT_ARRAY_TYPE
Type of MCT array.
Definition: j2k.h:150
OPJ_BOOL opj_j2k_start_compress(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Starts a compression scheme, i.e.
Definition: j2k.c:12355
int32_t OPJ_INT32
Definition: openjpeg.h:131
void(* opj_j2k_mct_function)(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1371
OPJ_UINT32 th
number of tiles in height
Definition: j2k.h:369
OPJ_UINT32 m_current_tile_part_number
Tile part number currently coding, taking into account POC.
Definition: j2k.h:510
opj_decoding_param_t m_dec
Definition: j2k.h:400
OPJ_UINT32 resE
Definition: openjpeg.h:383
#define J2K_MS_UNK
UNKNOWN marker value.
Definition: j2k.h:99
FIXME DOC.
Definition: j2k.h:214
static OPJ_BOOL opj_j2k_read_sod(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads a SOD marker (Start Of Data)
Definition: j2k.c:4923
OPJ_UINT32 prch[OPJ_J2K_MAXRLVLS]
precinct height
Definition: openjpeg.h:934
opj_j2k_t * opj_j2k_create_compress(void)
Creates a J2K compression structure.
Definition: j2k.c:6758
OPJ_UINT32 mct
multi-component transform identifier
Definition: j2k.h:254
OPJ_UINT32 nb_tps
number of tile parts
Definition: openjpeg.h:1010
@ J2K_STATE_TPH
the decoding process is in a tile part header
Definition: j2k.h:128
OPJ_UINT32 stepsizes_mant[OPJ_J2K_MAXBANDS]
stepsizes used for quantization
Definition: openjpeg.h:924
OPJ_UINT32 h
data height
Definition: openjpeg.h:685
OPJ_BOOL tile_size_on
size of tile: tile_size_on = false (not in argument) or = true (in argument)
Definition: openjpeg.h:395
OPJ_BYTE * ppm_data
packet header store there for future use in t2_decode_packet
Definition: j2k.h:377
@ J2K_STATE_DATA
a tile header has been successfully read and codestream is expected
Definition: j2k.h:131
opj_tile_info_v2_t * tile_info
information regarding tiles inside image
Definition: openjpeg.h:984
OPJ_BOOL opj_j2k_end_decompress(opj_j2k_t *j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Ends the decompression procedures and possibiliy add data to be read after the codestream.
Definition: j2k.c:8379
A list of procedures.
Definition: function_list.h:57
#define J2K_MS_RGN
RGN marker value.
Definition: j2k.h:81
OPJ_UINT32 win_x0
Definition: tcd.h:187
OPJ_UINT32 packet_count
OUT: Number of elements in p_packet_size[] array.
Definition: tcd.h:301
OPJ_BOOL opj_j2k_setup_mct_encoding(opj_tcp_t *p_tcp, opj_image_t *p_image)
Definition: j2k.c:8529
char tp_flag
Flag for Tile part generation.
Definition: openjpeg.h:526
OPJ_BOOL epb_on
enables writing of EPB, in case of activated JPWL
Definition: j2k.h:413
OPJ_INT32 y0
Definition: tcd.h:178
opj_image_t * opj_image_create0(void)
Create an empty image.
Definition: image.c:34
OPJ_UINT32 numlayers
number of layers
Definition: j2k.h:251
static OPJ_BOOL opj_j2k_add_mhmarker(opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len)
Add main header marker information.
Definition: j2k.c:8295
#define OPJ_IS_PART2(v)
Definition: openjpeg.h:232
#define J2K_CCP_CBLKSTY_HTMIXED
MIXED mode HT codeblocks.
Definition: j2k.h:65
const char *OPJ_CALLCONV opj_version(void)
Definition: openjpeg.c:171
int jpwl_sens_range
sensitivity range (0-3)
Definition: openjpeg.h:498
OPJ_UINT32 prec
precision: number of bits per component per pixel
Definition: openjpeg.h:691
#define OPJ_CINEMA_24_CS
JPEG 2000 codestream and component size limits in cinema profiles.
Definition: openjpeg.h:267
int image_offset_y0
subimage encoding: origin image offset in y direction
Definition: openjpeg.h:465
int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1=no,0-7)
Definition: openjpeg.h:504
OPJ_OFF_T pos
position in codestream
Definition: openjpeg.h:786
#define OPJ_JP2_INFO
<
Definition: openjpeg.h:183
static OPJ_BOOL opj_j2k_write_qcc(opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the QCC marker (quantization component)
Definition: j2k.c:3094
OPJ_INT32 x0
Definition: tcd.h:235
static OPJ_BOOL opj_j2k_compare_qcc(opj_j2k_t *p_j2k, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
Compare QCC markers (quantization component)
Definition: j2k.c:3139
static OPJ_BOOL opj_j2k_write_SQcd_SQcc(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
Writes a SQcd or SQcc element, i.e.
Definition: j2k.c:10914
static void opj_j2k_read_float64_to_int32(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1566
int jpwl_sens_MH
sensitivity method for MH (-1=no,0-7)
Definition: openjpeg.h:500
OPJ_UINT32 y0
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area.
Definition: openjpeg.h:713
static OPJ_BOOL opj_j2k_read_tlm(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a TLM marker (Tile Length Marker)
Definition: j2k.c:3656
void * opj_realloc(void *ptr, size_t new_size)
Reallocate memory blocks.
Definition: opj_malloc.c:239
int subsampling_dx
subsampling value for dx
Definition: openjpeg.h:467
#define J2K_CCP_CSTY_PRT
Definition: j2k.h:57
OPJ_UINT32 current_tpsno
current tile-part index
Definition: openjpeg.h:1014
OPJ_BOOL opj_j2k_setup_mct_encoding(opj_tcp_t *p_tcp, opj_image_t *p_image)
Definition: j2k.c:8529
OPJ_BITFIELD POC
indicates if a POC marker has been used O:NO, 1:YES
Definition: j2k.h:313
void opj_j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: j2k.c:6688
OPJ_UINT32 y0
y component offset compared to the whole image
Definition: openjpeg.h:689
#define J2K_MS_EOC
EOC marker value.
Definition: j2k.h:75
@ MCT_TYPE_DECORRELATION
Definition: j2k.h:152
@ J2K_STATE_TPHSOT
the decoding process is in a tile part header and expects a SOT marker
Definition: j2k.h:127
OPJ_UINT32 cblkw
code-blocks width
Definition: j2k.h:185
OPJ_BOOL m_Ttlmi_is_byte
Definition: j2k.h:516
opj_tcd_marker_info_t * opj_tcd_marker_info_create(OPJ_BOOL need_PLT)
Create a new opj_tcd_marker_info_t* structure.
Definition: tcd.c:2836
#define OPJ_PROFILE_CINEMA_S2K
Definition: openjpeg.h:206
int pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: j2k.h:431
static int opj_j2k_get_default_thread_count()
Definition: j2k.c:6729
OPJ_UINT32 m_nb_mct_records
the number of mct records.
Definition: j2k.h:296
static void opj_j2k_write_float_to_int32(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1600
Tile-component coding parameters information.
Definition: openjpeg.h:906
static OPJ_BOOL opj_j2k_merge_ppt(opj_tcp_t *p_tcp, opj_event_mgr_t *p_manager)
Merges all PPT markers read (Packed headers, tile-part header)
Definition: j2k.c:4147
int packno
packet number
Definition: openjpeg.h:855
OPJ_UINT32 tx0
tile origin in x = XTOsiz
Definition: openjpeg.h:965
int jpwl_pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: openjpeg.h:492
static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b)
Get the minimum of two integers.
Definition: opj_intmath.h:65
#define OPJ_TRUE
Definition: openjpeg.h:117
int jpwl_sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: openjpeg.h:496
static OPJ_UINT32 opj_j2k_get_SPCod_SPCoc_size(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no)
Gets the size taken by writing a SPCod or SPCoc for the given tile and component.
Definition: j2k.c:10507
OPJ_BOOL opj_j2k_set_decoded_components(opj_j2k_t *p_j2k, OPJ_UINT32 numcomps, const OPJ_UINT32 *comps_indices, opj_event_mgr_t *p_manager)
Sets the indices of the components to decode.
Definition: j2k.c:10196
int roi_compno
region of interest: affected component in [0..3], -1 means no ROI
Definition: openjpeg.h:442
OPJ_BYTE * m_tlm_sot_offsets_current
The current offset of the tlm buffer.
Definition: j2k.h:530
static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b)
Get the maximum of two integers.
Definition: opj_intmath.h:83
OPJ_INT32 roishift
Region Of Interest shift.
Definition: openjpeg.h:930
void * opj_malloc(size_t size)
Allocate an uninitialized memory block.
Definition: opj_malloc.c:191
OPJ_UINT32 nbcomps
number of components
Definition: openjpeg.h:978
static OPJ_BOOL opj_j2k_destroy_header_memory(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Destroys the memory associated with the decoding of headers.
Definition: j2k.c:13031
void OPJ_CALLCONV opj_image_data_free(void *ptr)
Destructor for opj_image_t->comps[].data To be paired with opj_image_data_alloc.
Definition: openjpeg.c:1135
static OPJ_BOOL opj_j2k_write_com(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the COM marker (comment)
Definition: j2k.c:2495
@ J2K_STATE_ERR
the decoding process has encountered an error (FIXME warning V1 = 0x0080)
Definition: j2k.h:134
opj_poc_t POC[32]
progression order changes
Definition: openjpeg.h:419
OPJ_BOOL opj_stream_read_seek(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:600
OPJ_INT32 y1
Definition: tcd.h:235
#define J2K_MS_COM
COM marker value.
Definition: j2k.h:93
#define J2K_MS_MCO
MCO marker value.
Definition: j2k.h:97
OPJ_UINT32 layE
End value, initialised in pi_initialise_encode.
Definition: openjpeg.h:383
OPJ_INT32 y0
Definition: tcd.h:196
OPJ_BOOL opj_tcd_decode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 win_x0, OPJ_UINT32 win_y0, OPJ_UINT32 win_x1, OPJ_UINT32 win_y1, OPJ_UINT32 numcomps_to_decode, const OPJ_UINT32 *comps_indices, OPJ_BYTE *p_src, OPJ_UINT32 p_max_length, OPJ_UINT32 p_tile_no, opj_codestream_index_t *p_cstr_index, opj_event_mgr_t *p_manager)
Decode a tile from a buffer into a raw image.
Definition: tcd.c:1477
#define J2K_CP_CSTY_SOP
Definition: j2k.h:55
OPJ_UINT32 compno0
Definition: openjpeg.h:367
OPJ_BOOL m_PLT
Definition: j2k.h:550
opj_procedure * opj_procedure_list_get_first_procedure(opj_procedure_list_t *p_validation_list)
Gets the pointer on the first validation procedure.
Definition: function_list.c:108
char tcp_mct
MCT (multiple component transform)
Definition: openjpeg.h:528
OPJ_BOOL opj_j2k_end_compress(opj_j2k_t *p_j2k, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Ends the compression procedures and possibiliy add data to be read after the codestream.
Definition: j2k.c:12339
struct opj_stepsize opj_stepsize_t
Quantization stepsize.
void opj_free(void *ptr)
Deallocates or frees a memory block.
Definition: opj_malloc.c:246
int cp_fixed_alloc
allocation by fixed layer
Definition: openjpeg.h:407
@ MCT_TYPE_FLOAT
MCT data is stored as signed integers.
Definition: j2k.h:143
static OPJ_BOOL opj_j2k_compare_SQcd_SQcc(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
Compares 2 SQcd or SQcc element, i.e.
Definition: j2k.c:10866
OPJ_UINT32 numcomps
Definition: tcd.h:236
#define J2K_MS_PLM
PLM marker value.
Definition: j2k.h:86
struct opj_encoding_param opj_encoding_param_t
int max_cs_size
Maximum size (in bytes) for the whole codestream.
Definition: openjpeg.h:540
#define J2K_CP_CSTY_EPH
Definition: j2k.h:56
static void opj_j2k_tcp_data_destroy(opj_tcp_t *p_tcp)
Destroys the data inside a tile coding parameter structure.
Definition: j2k.c:9358
OPJ_OFF_T m_last_sot_read_pos
Position of the last SOT marker read.
Definition: j2k.h:483
void * mct_data
Naive implementation of MCT restricted to a single reversible array based encoding without offset con...
Definition: openjpeg.h:533
@ OPJ_RPCL
resolution-precinct-component-layer order
Definition: openjpeg.h:307
OPJ_UINT32 resno_decoded
number of decoded resolution
Definition: openjpeg.h:697
OPJ_UINT32 ppt_data_size
Number of bytes stored inside ppt_data.
Definition: j2k.h:272
static OPJ_BOOL opj_j2k_read_plm(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a PLM marker (Packet length, main header marker)
Definition: j2k.c:3717
OPJ_UINT32 m_state
locate in which part of the codestream the decoder is (main header, tile header, end)
Definition: j2k.h:465
static OPJ_BOOL opj_j2k_update_rates(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Updates the rates of the tcp.
Definition: j2k.c:5260
@ J2K_STATE_EOC
the decoding process has encountered the EOC marker
Definition: j2k.h:133
static int opj_j2k_initialise_4K_poc(opj_poc_t *POC, int numres)
Definition: j2k.c:6805
static OPJ_BOOL opj_j2k_mct_validation(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
The mct encoding validation procedure.
Definition: j2k.c:8493
Index structure of the codestream (FIXME should be expand and enhance)
Definition: openjpeg.h:1037
OPJ_UINT16 rsiz
Size of the image in bits.
Definition: j2k.h:355
int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (>=0)
Definition: openjpeg.h:484
void opj_tcd_destroy(opj_tcd_t *tcd)
Destroy a previously created TCD handle.
Definition: tcd.c:676
int prch_init[OPJ_J2K_MAXRLVLS]
initial precinct height
Definition: openjpeg.h:450
static OPJ_BOOL opj_j2k_update_image_dimensions(opj_image_t *p_image, opj_event_mgr_t *p_manager)
Definition: j2k.c:10144
static OPJ_BOOL opj_j2k_setup_decoding_tile(opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
Sets up the procedures to do on decoding one tile.
Definition: j2k.c:11886
@ J2K_STATE_NONE
a SOC marker is expected
Definition: j2k.h:123
#define J2K_MS_CBD
CBD marker value.
Definition: j2k.h:94
static opj_codestream_index_t * opj_j2k_create_cstr_index(void)
Definition: j2k.c:10485
opj_codestream_index_t * j2k_get_cstr_index(opj_j2k_t *p_j2k)
Get the codestream index from a JPEG2000 codec.
Definition: j2k.c:11457
OPJ_UINT32 qntsty
quantisation style
Definition: j2k.h:193
OPJ_UINT32 m_header_tile_data_size
Definition: j2k.h:547
OPJ_UINT32 qmfbid
discrete wavelet transform identifier
Definition: j2k.h:191
static OPJ_BOOL opj_j2k_write_updated_tlm(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the updated tlm.
Definition: j2k.c:12961
static OPJ_BOOL opj_j2k_decode_tiles(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads the tiles.
Definition: j2k.c:11633
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: j2k.h:245
opj_tccp_t * tccps
tile-component coding parameters
Definition: j2k.h:278
opj_codestream_index_t * cstr_index
helper used to write the index file
Definition: j2k.h:593
static OPJ_BOOL opj_j2k_allocate_tile_element_cstr_index(opj_j2k_t *p_j2k)
Definition: j2k.c:11572
opj_j2k_t * opj_j2k_create_decompress(void)
Creates a J2K decompression structure.
Definition: j2k.c:10411
OPJ_UINT32 ppt_len
size of ppt_data
Definition: j2k.h:274
OPJ_UINT32 compno1
Definition: openjpeg.h:369
static void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Definition: j2k.c:6824
OPJ_UINT32 m_encoded_tile_size
Definition: j2k.h:540
#define J2K_CP_CSTY_PRT
Definition: j2k.h:54
OPJ_BITFIELD m_nb_tile_parts_correction_checked
TNsot correction : see issue 254.
Definition: j2k.h:500
OPJ_UINT32 ppt_markers_count
number of ppt markers (reserved size)
Definition: j2k.h:263
OPJ_UINT32 * p_packet_size
OUT: Array of size packet_count, such that p_packet_size[i] is the size in bytes of the ith packet.
Definition: tcd.h:305
OPJ_UINT32 stepsizes_expn[OPJ_J2K_MAXBANDS]
stepsizes used for quantization
Definition: openjpeg.h:926
static OPJ_BOOL opj_j2k_read_mct(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a MCT marker (Multiple Component Transform)
Definition: j2k.c:5804
OPJ_BOOL opj_j2k_set_decoded_resolution_factor(opj_j2k_t *p_j2k, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
Definition: j2k.c:12135
struct opj_ppx_struct opj_ppx
enum MCT_ELEMENT_TYPE J2K_MCT_ELEMENT_TYPE
Type of elements storing in the MCT data.
#define J2K_MS_MCT
MCT marker value.
Definition: j2k.h:96
static void opj_j2k_read_int32_to_int32(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1532
OPJ_UINT32 cblksty
code-block coding style
Definition: j2k.h:189
uint16_t OPJ_UINT16
Definition: openjpeg.h:130
OPJ_UINT32 tdy
tile size in y = YTsiz
Definition: openjpeg.h:971
unsigned short int type
marker type
Definition: openjpeg.h:784
#define OPJ_IMF_MAINLEVEL_MAX
Definition: openjpeg.h:238
static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b)
Get the maximum of two integers.
Definition: opj_intmath.h:74
static void opj_get_tile_dimensions(opj_image_t *l_image, opj_tcd_tilecomp_t *l_tilec, opj_image_comp_t *l_img_comp, OPJ_UINT32 *l_size_comp, OPJ_UINT32 *l_width, OPJ_UINT32 *l_height, OPJ_UINT32 *l_offset_x, OPJ_UINT32 *l_offset_y, OPJ_UINT32 *l_image_width, OPJ_UINT32 *l_stride, OPJ_UINT32 *l_tile_offset)
Definition: j2k.c:12434
OPJ_UINT32 opj_tcd_get_decoded_tile_size(opj_tcd_t *p_tcd, OPJ_BOOL take_into_account_partial_decoding)
Gets the maximum tile size that will be taken by the tile once decoded.
Definition: tcd.c:1326
OPJ_UINT32 m_current_poc_tile_part_number
Tile part number, regardless of poc, for each new poc, tp is reset to 1.
Definition: j2k.h:507
static OPJ_BOOL opj_j2k_read_mco(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a MCO marker (Multiple Component Transform Ordering)
Definition: j2k.c:6356
OPJ_INT32 m_current_tile_part_number
current tile part number or -1 if first time into this tile
Definition: j2k.h:280
@ OPJ_OFF
Definition: openjpeg.h:294
OPJ_BOOL correct
enables JPWL correction at the decoder
Definition: j2k.h:445
static void opj_j2k_read_float64_to_float(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1498
#define J2K_MS_CPF
CPF marker value.
Definition: j2k.h:80
#define EVT_INFO
Debug event type.
Definition: event.h:68
#define OPJ_PROFILE_IMF_8K
Definition: openjpeg.h:214
int cp_disto_alloc
allocation by rate/distortion
Definition: openjpeg.h:405
@ OPJ_CINEMA4K_24
2K Digital Cinema at 48 fps
Definition: openjpeg.h:297
Tile-component coding parameters.
Definition: j2k.h:179
OPJ_INT32 * data
Definition: tcd.h:209
#define OPJ_J2K_TH_IND
Tile index based on the current tile.
Definition: openjpeg.h:181
#define OPJ_PROFILE_CINEMA_2K
Definition: openjpeg.h:204
static OPJ_BOOL opj_j2k_read_com(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a COM marker (comments)
Definition: j2k.c:2560
#define OPJ_JP2_IND
JP2 file index.
Definition: openjpeg.h:184
void j2k_dump_image_header(opj_image_t *img_header, OPJ_BOOL dev_dump_flag, FILE *out_stream)
Dump an image header structure.
Definition: j2k.c:11326
OPJ_UINT32 prcE
Definition: openjpeg.h:383
opj_tcd_image_t * tcd_image
info on each image tile
Definition: tcd.h:268
OPJ_UINT32 w
data width
Definition: openjpeg.h:683
OPJ_UINT32 m_data_size
Definition: j2k.h:237
OPJ_FLOAT32 distoratio[100]
add fixed_quality
Definition: j2k.h:276
OPJ_OFF_T start_pos
start position
Definition: openjpeg.h:994
static void opj_j2k_dump_MH_index(opj_j2k_t *p_j2k, FILE *out_stream)
Definition: j2k.c:11242
#define OPJ_PROFILE_IMF_8K_R
Definition: openjpeg.h:217
OPJ_BOOL epc_on
enables writing of EPC in MH, thus activating JPWL
Definition: j2k.h:411
unsigned int OPJ_BITFIELD
Definition: opj_includes.h:217
static void opj_j2k_write_float_to_float(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1617
int roi_shift
region of interest: upshift value
Definition: openjpeg.h:444
opj_thread_pool_t * opj_thread_pool_create(int num_threads)
Create a new thread pool.
Definition: thread.c:625
static const OPJ_UINT32 MCT_ELEMENT_SIZE[]
FIXME DOC.
Definition: j2k.c:1364
int sens_size
enables writing of ESD, (0/2/4 bytes)
Definition: j2k.h:433
int cblockw_init
initial code block width, default to 64
Definition: openjpeg.h:434
opj_tcd_t * opj_tcd_create(OPJ_BOOL p_is_decoder)
Create a new TCD handle.
Definition: tcd.c:203
OPJ_UINT32 x0
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area.
Definition: openjpeg.h:711
@ OPJ_MCT
Profile name for a 4K image.
Definition: openjpeg.h:286
int hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: j2k.h:425
static OPJ_BOOL opj_j2k_init_info(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Inits the Info.
Definition: j2k.c:13054
static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b)
Divide an integer by a power of 2 and round upwards.
Definition: opj_intmath.h:198
Decompression parameters.
Definition: openjpeg.h:552
void j2k_destroy_cstr_index(opj_codestream_index_t *p_cstr_ind)
Destroys a codestream index structure.
Definition: j2k.c:9248
static OPJ_UINT32 opj_j2k_get_max_poc_size(opj_j2k_t *p_j2k)
Gets the maximum size taken by the writing of a POC.
Definition: j2k.c:3430
struct opj_j2k_enc opj_j2k_enc_t
#define opj_write_float
Definition: cio.h:68
opj_tile_info_v2_t m_default_tile_info
Default information regarding tiles inside image.
Definition: openjpeg.h:981
OPJ_UINT32 m_nb_tile_parts
number of tile parts for the tile.
Definition: j2k.h:282
opj_image_comp_t * comps
image components
Definition: openjpeg.h:723
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)
Divide an integer and round upwards.
Definition: opj_intmath.h:160
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:1050
OPJ_UINT32 packno
Definition: tcd.h:241
static OPJ_BOOL opj_j2k_pre_write_tile(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Definition: j2k.c:12407
void j2k_dump_image_header(opj_image_t *image, OPJ_BOOL dev_dump_flag, FILE *out_stream)
Dump an image header structure.
Definition: j2k.c:11326
#define JPWL_MAX_NO_PACKSPECS
Maximum number of packet parts expected by JPWL: increase at your will.
Definition: openjpeg.h:163
@ FINAL_PASS
Function called in Rate allocation process.
Definition: j2k.h:163
struct opj_tccp opj_tccp_t
Tile-component coding parameters.
#define JPWL_MAX_NO_TILESPECS
Maximum number of tile parts expected by JPWL: increase at your will.
Definition: openjpeg.h:162
Index structure of the codestream.
Definition: openjpeg.h:851
OPJ_INT32 y1
Definition: tcd.h:196
OPJ_BOOL opj_j2k_encoder_set_extra_options(opj_j2k_t *p_j2k, const char *const *p_options, opj_event_mgr_t *p_manager)
Specify extra options for the encoder.
Definition: j2k.c:12168
@ MCT_TYPE_INT32
MCT data is stored as signed shorts.
Definition: j2k.h:142
OPJ_UINT32 numlayers
number of layers
Definition: openjpeg.h:950
OPJ_UINT32 m_reserved_bytes_for_PLT
Definition: j2k.h:553
OPJ_BOOL opj_alloc_tile_component_data(opj_tcd_tilecomp_t *l_tilec)
Allocates tile component data.
Definition: tcd.c:692
static OPJ_BOOL opj_j2k_write_sot(opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 total_data_size, OPJ_UINT32 *p_data_written, const opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the SOT marker (Start of tile-part)
Definition: j2k.c:4285
#define OPJ_COMP_PARAM_DEFAULT_CBLOCKH
Definition: opj_common.h:43
OPJ_INT32 ppm_previous
use in case of multiple marker PPM (case on non-finished previous info)
Definition: j2k.h:394
opj_mct_data_t * m_mct_records
mct records
Definition: j2k.h:294
static void opj_j2k_read_int32_to_float(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1464
OPJ_BOOL strict
OPJ_TRUE if entire bit stream must be decoded, OPJ_FALSE if partial bitstream decoding allowed.
Definition: j2k.h:406
void opj_j2k_decoder_set_strict_mode(opj_j2k_t *j2k, OPJ_BOOL strict)
Definition: j2k.c:6703
struct opj_tcp opj_tcp_t
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
OPJ_UINT32 numgbits
number of guard bits
Definition: j2k.h:197
OPJ_UINT32 tileno
tile index
Definition: openjpeg.h:1007
OPJ_FLOAT64 * mct_norms
encoding norms
Definition: j2k.h:288
int jpwl_max_tiles
maximum number of tiles
Definition: openjpeg.h:606
#define opj_read_bytes
Definition: cio.h:65
OPJ_UINT32 cur_totnum_tp
Total number of tileparts of the current tile.
Definition: tcd.h:264
OPJ_UINT32 m_reduce
if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the ...
Definition: j2k.h:341
#define EVT_ERROR
Error event type.
Definition: event.h:66
OPJ_UINT32 tw
number of tiles in width
Definition: j2k.h:367
J2K_MCT_ELEMENT_TYPE m_element_type
Definition: j2k.h:215
uint32_t OPJ_UINT32
Definition: openjpeg.h:132
#define OPJ_PROFILE_IMF_4K_R
Definition: openjpeg.h:216
OPJ_BOOL opj_j2k_get_tile(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager, OPJ_UINT32 tile_index)
Definition: j2k.c:12020
OPJ_UINT32 factor
number of division by 2 of the out image compared to the original size of image
Definition: openjpeg.h:699
OPJ_BYTE * m_data
data for the tile
Definition: j2k.h:284
static OPJ_BOOL opj_j2k_compare_coc(opj_j2k_t *p_j2k, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
Compares 2 COC markers (Coding style component)
Definition: j2k.c:2840
int image_offset_x0
subimage encoding: origin image offset in x direction
Definition: openjpeg.h:463
void j2k_dump(opj_j2k_t *p_j2k, OPJ_INT32 flag, FILE *out_stream)
Dump some elements from the J2K decompression structure .
Definition: j2k.c:11190
OPJ_UINT32 dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:679
static OPJ_UINT32 opj_j2k_get_num_tp(opj_cp_t *cp, OPJ_UINT32 pino, OPJ_UINT32 tileno)
Gets the number of tile parts used for the given change of progression (if any) and the given tile.
Definition: j2k.c:1749
char tp_on
Tile part generation.
Definition: openjpeg.h:524
int mode
mode switch (cblk_style)
Definition: openjpeg.h:438
static OPJ_BOOL opj_j2k_read_crg(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a CRG marker (Component registration)
Definition: j2k.c:3614
static OPJ_UINT32 opj_j2k_get_SQcd_SQcc_size(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no)
Gets the size taken by writing SQcd or SQcc element, i.e.
Definition: j2k.c:10835
OPJ_UINT32 m_nb_comps
Number of components.
Definition: j2k.h:556
OPJ_UINT32 ty0
YTOsiz.
Definition: j2k.h:359
opj_mct_data_t * m_decorrelation_array
Definition: j2k.h:229
OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k, opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Definition: j2k.c:7616
struct opj_mct_data opj_mct_data_t
FIXME DOC.
int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (>=0)
Definition: openjpeg.h:490
OPJ_BOOL opj_j2k_decode(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Decode an image from a JPEG-2000 codestream.
Definition: j2k.c:11962
OPJ_UINT32 m_start_tile_x
Only tiles index in the correct range will be decoded.
Definition: j2k.h:475
#define OPJ_COMP_PARAM_DEFAULT_NUMRESOLUTION
Definition: opj_common.h:45
OPJ_UINT64 codestream_size
codestream's size
Definition: openjpeg.h:1044
opj_j2k_enc_t m_encoder
Definition: j2k.h:573
static const OPJ_UINT16 tabMaxSubLevelFromMainLevel[]
Definition: j2k.c:7160
static OPJ_FLOAT32 opj_j2k_get_default_stride(opj_tcp_t *p_tcp)
Definition: j2k.c:5254
@ J2K_STATE_MHSIZ
a SIZ marker is expected
Definition: j2k.h:125
static void opj_j2k_cp_destroy(opj_cp_t *p_cp)
Destroys a coding parameter structure.
Definition: j2k.c:9367
OPJ_UINT32 csty
coding style
Definition: openjpeg.h:946
int cp_tdy
YTsiz.
Definition: openjpeg.h:403
static OPJ_BOOL opj_j2k_write_all_tile_parts(opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, OPJ_UINT32 total_data_size, opj_stream_private_t *p_stream, struct opj_event_mgr *p_manager)
Definition: j2k.c:12839
OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t *p_j2k, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_go_on, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads a tile header.
Definition: j2k.c:9518
OPJ_UINT32 mct
multi-component transform identifier
Definition: openjpeg.h:952
#define OPJ_CINEMA_48_CS
Definition: openjpeg.h:268
opj_tp_index_t * tp_index
information concerning tile parts
Definition: openjpeg.h:1016
int csty
csty : coding style
Definition: openjpeg.h:415
OPJ_BOOL opj_j2k_write_tile(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes a tile.
Definition: j2k.c:13148
OPJ_INT32 * m_matrice
fixed layer
Definition: j2k.h:325
static OPJ_BOOL opj_j2k_end_encoding(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Ends the encoding, i.e.
Definition: j2k.c:12997
#define OPJ_FALSE
Definition: openjpeg.h:118
OPJ_BITFIELD m_is_decoder
tells if the parameter is a coding or decoding one
Definition: j2k.h:456
void j2k_dump(opj_j2k_t *p_j2k, OPJ_INT32 flag, FILE *out_stream)
Dump some elements from the J2K decompression structure .
Definition: j2k.c:11190
OPJ_UINT32 th
number of tiles in Y
Definition: openjpeg.h:975
OPJ_PROG_ORDER prg1
Progression order enum.
Definition: openjpeg.h:373
OPJ_INT32 y0
Definition: tcd.h:235
Index structure about a tile part.
Definition: openjpeg.h:992
OPJ_UINT32 m_data_size
size of data
Definition: j2k.h:286
OPJ_BITFIELD m_disto_alloc
allocation by rate/distortion
Definition: j2k.h:329
struct opj_decoding_param opj_decoding_param_t
static OPJ_BOOL opj_j2k_copy_default_tcp_and_create_tcd(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Copies the decoding tile parameters onto all the tile parameters.
Definition: j2k.c:9016
static OPJ_BOOL opj_j2k_read_mcc(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a MCC marker (Multiple Component Collection)
Definition: j2k.c:6052
void opj_copy_image_header(const opj_image_t *p_image_src, opj_image_t *p_image_dest)
Copy only header of image and its component header (no data are copied) if dest image have data,...
Definition: image.c:164
int16_t OPJ_INT16
Definition: openjpeg.h:129
@ OPJ_LRCP
layer-resolution-component-precinct order
Definition: openjpeg.h:305
static const opj_dec_memory_marker_handler_t j2k_memory_marker_handler_tab[]
Definition: j2k.c:1408
void opj_j2k_destroy(opj_j2k_t *p_j2k)
Destroys a jpeg2000 codec.
Definition: j2k.c:9178
static OPJ_BOOL opj_j2k_get_sot_values(OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, OPJ_UINT32 *p_tile_no, OPJ_UINT32 *p_tot_len, OPJ_UINT32 *p_current_part, OPJ_UINT32 *p_num_parts, opj_event_mgr_t *p_manager)
Reads values from a SOT marker (Start of tile-part)
Definition: j2k.c:4345
static int opj_j2k_get_imf_max_NL(opj_cparameters_t *parameters, opj_image_t *image)
Definition: j2k.c:7035
static void opj_j2k_write_float_to_int16(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1583
OPJ_UINT32 cblkh
code-blocks height
Definition: j2k.h:187
static void opj_j2k_read_int16_to_int32(const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
Definition: j2k.c:1515
OPJ_UINT32 win_y1
Definition: tcd.h:190
OPJ_RSIZ_CAPABILITIES cp_rsiz
DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead Profile name.
Definition: openjpeg.h:522
OPJ_BOOL opj_j2k_read_header(opj_stream_private_t *p_stream, opj_j2k_t *p_j2k, opj_image_t **p_image, opj_event_mgr_t *p_manager)
Reads a jpeg2000 codestream header structure.
Definition: j2k.c:8390
FIXME DOC.
Definition: j2k.h:226
void opj_image_comp_header_update(opj_image_t *p_image_header, const struct opj_cp *p_cp)
Updates the components characteristics of the image from the coding parameters.
Definition: image.c:121
OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t *p_j2k, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_go_on, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads a tile header.
Definition: j2k.c:9518
OPJ_BOOL opj_tcd_encode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, OPJ_BYTE *p_dest, OPJ_UINT32 *p_data_written, OPJ_UINT32 p_max_length, opj_codestream_info_t *p_cstr_info, opj_tcd_marker_info_t *p_marker_info, opj_event_mgr_t *p_manager)
Encodes a tile from the raw image into the given buffer.
Definition: tcd.c:1381
#define opj_write_bytes
Definition: cio.h:64
OPJ_UINT32 layno1
Layer num end,Resolution num end, Component num end, given by POC.
Definition: openjpeg.h:369
OPJ_BITFIELD cod
If cod == 1 --> there was a COD marker for the present tile.
Definition: j2k.h:309
#define OPJ_EXTENSION_MCT
Definition: openjpeg.h:223
OPJ_UINT32 tile
Tile number (starting at 1)
Definition: openjpeg.h:377
void opj_pi_update_encoding_parameters(const opj_image_t *p_image, opj_cp_t *p_cp, OPJ_UINT32 p_tile_no)
Updates the encoding parameters of the codec.
Definition: pi.c:2103
opj_tcp_t * m_default_tcp
store decoding parameters common to all tiles (information like COD, COC in main header)
Definition: j2k.h:469
OPJ_UINT32 tp_num
Tile part number.
Definition: tcd.h:260
OPJ_UINT32 cblkh
log2 of code-blocks height
Definition: openjpeg.h:916
OPJ_BOOL opj_j2k_encode(opj_j2k_t *p_j2k, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Encodes an image into a JPEG-2000 codestream.
Definition: j2k.c:12231
int prcw_init[OPJ_J2K_MAXRLVLS]
initial precinct width
Definition: openjpeg.h:448
opj_image_t * m_private_image
pointer to the internal/private encoded / decoded image
Definition: j2k.h:578
OPJ_UINT32 numpocs
number of progression order changes (POC), default to 0
Definition: openjpeg.h:421
static OPJ_BOOL opj_j2k_write_cod(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the COD marker (Coding style default)
Definition: j2k.c:2579
OPJ_UINT32 m_end_tile_y
Definition: j2k.h:478
OPJ_UINT32 resno1
Definition: openjpeg.h:369
void opj_j2k_decoder_set_strict_mode(opj_j2k_t *j2k, OPJ_BOOL strict)
Definition: j2k.c:6703
#define J2K_MS_MCC
MCC marker value.
Definition: j2k.h:95
MCT_ELEMENT_TYPE
Type of elements storing in the MCT data.
Definition: j2k.h:140
#define J2K_CCP_QNTSTY_SIQNT
Definition: j2k.h:67
Structure to hold information needed to generate some markers.
Definition: tcd.h:296
opj_simple_mcc_decorrelation_data_t * m_mcc_records
mcc records
Definition: j2k.h:300
#define J2K_CCP_QNTSTY_NOQNT
Definition: j2k.h:66
OPJ_UINT32 marknum
number of markers
Definition: openjpeg.h:1020
#define J2K_MS_COD
COD marker value.
Definition: j2k.h:78
OPJ_UINT32 csty
coding style
Definition: j2k.h:181
Defines image data and characteristics.
Definition: openjpeg.h:709
int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: openjpeg.h:486
OPJ_UINT32 resno0
Resolution num start, Component num start, given by POC.
Definition: openjpeg.h:367
OPJ_BOOL opj_tcd_init_decode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, opj_event_mgr_t *p_manager)
Allocates memory for decoding a specific tile.
Definition: tcd.c:1205
#define J2K_MS_POC
POC marker value.
Definition: j2k.h:84
OPJ_BOOL jpwl_epc_on
enables writing of EPC in MH, thus activating JPWL
Definition: openjpeg.h:480
opj_codestream_info_v2_t * j2k_get_cstr_info(opj_j2k_t *p_j2k)
Get the codestream info from a JPEG2000 codec.
Definition: j2k.c:11381
int jpwl_hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: openjpeg.h:482
Progression order changes.
Definition: openjpeg.h:365
opj_tcd_tilecomp_t * comps
Definition: tcd.h:237
#define J2K_MS_CRG
CRG marker value.
Definition: j2k.h:92
Marker structure.
Definition: openjpeg.h:782
OPJ_UINT32 id
marker value
Definition: j2k.c:1397
OPJ_INT32 m_tile_ind_to_dec
Index of the tile to decode (used in get_tile)
Definition: j2k.h:481
@ J2K_STATE_NEOC
the decoding process must not expect a EOC marker because the codestream is truncated
Definition: j2k.h:130
OPJ_SIZE_T opj_stream_read_data(opj_stream_private_t *p_stream, OPJ_BYTE *p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t *p_event_mgr)
Reads some bytes from the stream.
Definition: cio.c:281
static OPJ_BOOL opj_j2k_read_cpf(opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a CPF marker (corresponding profile).
Definition: j2k.c:6665
int * cp_matrice
fixed layer
Definition: openjpeg.h:411
const char * opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
Converts an enum type progression order to string type.
Definition: j2k.c:1651
OPJ_UINT32 tdx
tile size in x = XTsiz
Definition: openjpeg.h:969
static OPJ_BOOL opj_j2k_read_soc(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads a SOC marker (Start of Codestream)
Definition: j2k.c:1927
int sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: j2k.h:435
OPJ_UINT32 m_header_data_size
Definition: j2k.h:471
static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b)
Divide an integer by a power of 2 and round upwards.
Definition: opj_intmath.h:180
OPJ_UINT32 numresolutions
number of resolutions
Definition: openjpeg.h:912
static OPJ_BOOL opj_j2k_build_encoder(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Builds the tcd encoder to use to encode tile.
Definition: j2k.c:8704
Tile coder/decoder.
Definition: tcd.h:256
static OPJ_BOOL opj_j2k_write_regions(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes regions of interests.
Definition: j2k.c:5598
union opj_cp::@0 m_specific_param
#define J2K_MS_QCD
QCD marker value.
Definition: j2k.h:82
#define J2K_MS_EPB
EPB marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:104
static OPJ_BOOL opj_j2k_post_write_tile(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Definition: j2k.c:12559
#define OPJ_GET_IMF_PROFILE(v)
Definition: openjpeg.h:234
#define J2K_MS_SOD
SOD marker value.
Definition: j2k.h:74
OPJ_UINT32 win_y0
Definition: tcd.h:188
void(* opj_procedure)(void)
declare a function pointer
Definition: function_list.h:52
int sens_range
sensitivity range (0-3)
Definition: j2k.h:437
int max_comp_size
Maximum size (in bytes) for each component.
Definition: openjpeg.h:517
OPJ_BOOL opj_j2k_set_decode_area(opj_j2k_t *p_j2k, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_x, OPJ_INT32 p_end_y, opj_event_mgr_t *p_manager)
Sets the given area to be decoded.
Definition: j2k.c:10256
static OPJ_BOOL opj_j2k_write_soc(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes the SOC marker (Start Of Codestream)
Definition: j2k.c:1887
OPJ_UINT32 win_x1
Definition: tcd.h:189
static OPJ_BOOL opj_j2k_build_decoder(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Builds the tcd decoder to use to decode tile.
Definition: j2k.c:8692