Grok  7.6.2
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
grk Namespace Reference

Copyright (C) 2016-2020 Grok Image Compression Inc. More...

Namespaces

 t1_ht
 
 t1_part1
 

Classes

class  bibo_gains
 
class  BitIO
 
struct  BlockExec
 
struct  BufferedStream
 Byte input-output stream. More...
 
struct  cblk_dec
 
struct  cblk_enc
 
struct  ChunkBuffer
 
struct  Codeblock
 
struct  CodePass
 
struct  CodeStream
 
struct  CodingParams
 Coding parameters. More...
 
struct  CompressBlockExec
 
struct  CompressCodeblock
 
class  CorruptJP2BoxException
 
class  CPUArch
 
struct  DecoderState
 
class  DecodeUnknownMarkerAtEndOfTileException
 
struct  DecodingParams
 
struct  Decompress97
 
struct  decompress_job
 
struct  DecompressBlockExec
 
struct  DecompressCodeblock
 
class  dwt53
 
class  dwt97
 
struct  dwt_data
 
struct  EncoderState
 
struct  EncodingParams
 
struct  FileFormat
 JPEG 2000 file format reader/writer. More...
 
struct  grk_buffer
 
struct  grk_buffer_2d
 
struct  grk_jp2_box
 JP2 Box. More...
 
struct  grk_jp2_buffer
 
struct  grk_jp2_comps
 JP2 component. More...
 
struct  grk_jp2_header_handler
 
struct  grk_jp2_img_header_writer_handler
 
struct  grk_jp2_uuid
 
struct  grk_mct_data
 MCT data. More...
 
struct  grk_pi_comp
 Packet iterator component. More...
 
struct  grk_pi_resolution
 
struct  grk_plugin_debug_mqc
 
struct  grk_point
 
struct  grk_ppx
 
struct  grk_rectangle
 
struct  grk_simple_mcc_decorrelation_data
 MCC decorrelation data. More...
 
struct  grk_stepsize
 Quantization stepsize. More...
 
struct  grk_tile
 
struct  grk_tl_info
 
class  GrokOutput
 
class  IBitIO
 Bit input/output. More...
 
struct  IBufferedStream
 
struct  ICodeStream
 
class  InvalidMarkerException
 
class  IOpenable
 
class  ISparseBuffer
 
struct  j2k_prog_order
 
struct  Layer
 
struct  logger
 
struct  marker_handler
 
class  mct
 
struct  MemStream
 
struct  minpf_dynamic_library
 
struct  minpf_object_params
 
struct  minpf_platform_services
 
struct  minpf_plugin_api_version
 
struct  minpf_plugin_manager
 
struct  minpf_register_params
 
class  MissingSparseBlockException
 
struct  mqc_state
 
struct  mqcoder
 
struct  PacketIter
 Packet iterator. More...
 
struct  PacketLengthInfo
 
struct  PacketLengthMarkers
 
struct  PacketTracker
 
struct  param_qcd
 
class  Partial53
 
class  Partial97
 
class  PartialInterleaver
 
struct  pass_enc
 
struct  plugin_encode_user_callback_info
 
struct  PluginDecodeCallbackInfo
 
class  PluginDecodeUnsupportedException
 
class  PPMMarker
 
struct  Precinct
 
struct  PrecinctImpl
 
class  Profile
 
class  Quantizer
 
class  RateControl
 
class  RateInfo
 
struct  res_window
 Class to manage multiple buffers needed to perform DWT transform. More...
 
struct  Resolution
 
class  RoiScaleFilter
 
class  RoiScaleHTFilter
 
class  RoiShiftFilter
 
class  RoiShiftHTFilter
 
class  ScaleFilter
 
class  ScaleHTFilter
 
struct  seg
 
struct  seg_data_chunk
 
struct  Segment
 
class  ShiftFilter
 
class  ShiftHTFilter
 
class  SIZMarker
 
class  SOTMarker
 
class  SparseBuffer
 
class  sqrt_energy_gains
 
struct  Subband
 
struct  T1
 
class  T1CompressScheduler
 
class  T1DecompressScheduler
 
class  T1Factory
 
class  T1Interface
 
struct  T2Compress
 Tier-2 coding. More...
 
struct  T2Decompress
 Tier-2 decoding. More...
 
class  TagTree
 Tag tree. More...
 
struct  TagTreeNode
 Tag node. More...
 
struct  TileCodingParams
 Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header) More...
 
struct  TileComponent
 
struct  TileComponentCodingParams
 Tile-component coding parameters. More...
 
struct  TileComponentWindowBuffer
 
struct  TileLengthMarkers
 
struct  TileProcessor
 Tile compressor/decompressor. More...
 
class  TruncatedPacketHeaderException
 
struct  vec4f
 
class  WaveletForward
 
class  WaveletFwdImpl
 
class  WaveletReverse
 

Typedefs

typedef bool(* j2k_procedure) (CodeStream *codeStream)
 
typedef bool(* marker_callback) (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 
typedef bool(* jp2_procedure) (FileFormat *fileFormat)
 
typedef std::vector< grk_tl_infoTL_INFO_VEC
 
typedef std::map< uint8_t, TL_INFO_VEC * > TL_MAP
 
typedef std::vector< uint32_t > PL_INFO_VEC
 
typedef std::map< uint8_t, PL_INFO_VEC * > PL_MAP
 
typedef void(* j2k_mct_function) (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
typedef struct grk::minpf_object_params minpf_object_params
 
typedef struct grk::minpf_plugin_api_version minpf_plugin_api_version
 
typedef void *(* minpf_create_func) (minpf_object_params *)
 
typedef int32_t(* minpf_destroy_func) (void *)
 
typedef struct grk::minpf_register_params minpf_register_params
 
typedef int32_t(* minpf_register_func) (const char *nodeType, const minpf_register_params *params)
 
typedef int32_t(* minpf_invoke_service_func) (const char *serviceName, void *serviceParams)
 
typedef struct grk::minpf_platform_services minpf_platform_services
 
typedef int32_t(* minpf_exit_func) ()
 
typedef minpf_exit_func(* minpf_post_load_func) (const char *pluginPath, const minpf_platform_services *)
 
typedef struct grk::minpf_plugin_manager minpf_plugin_manager
 
typedef uint32_t(* PLUGIN_GET_DEBUG_STATE) (void)
 
typedef void(* PLUGIN_DEBUG_MQC_NEXT_CXD) (grk_plugin_debug_mqc *mqc, uint32_t d)
 
typedef void(* PLUGIN_DEBUG_MQC_NEXT_PLANE) (grk_plugin_debug_mqc *mqc)
 
typedef void(* PLUGIN_ENCODE_USER_CALLBACK) (plugin_encode_user_callback_info *info)
 
typedef bool(* PLUGIN_INIT) (grk_plugin_init_info initInfo)
 
typedef int32_t(* PLUGIN_ENCODE) (grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK callback)
 
typedef int32_t(* PLUGIN_BATCH_ENCODE) (const char *input_dir, const char *output_dir, grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK userCallback)
 
typedef void(* PLUGIN_STOP_BATCH_ENCODE) (void)
 
typedef bool(* PLUGIN_IS_BATCH_COMPLETE) (void)
 
typedef int32_t(* PLUGIN_DECODE_USER_CALLBACK) (PluginDecodeCallbackInfo *info)
 
typedef int32_t(* PLUGIN_DECODE) (grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)
 
typedef int32_t(* PLUGIN_INIT_BATCH_DECODE) (const char *input_dir, const char *output_dir, grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)
 
typedef int32_t(* PLUGIN_BATCH_DECODE) (void)
 
typedef void(* PLUGIN_STOP_BATCH_DECODE) (void)
 
typedef uint32_t grk_flag
 Flags for 4 consecutive rows of a column. More...
 
typedef int32_t grk_handle
 
typedef size_t(* grk_stream_zero_copy_read_fn) (void **p_buffer, size_t nb_bytes, void *user_data)
 
using grk_pt = grk_point< uint32_t >
 
using grk_rect = grk_rectangle< int64_t >
 
using grk_rect_u32 = grk_rectangle< uint32_t >
 
using grk_buf = grk_buffer< uint8_t >
 

Enumerations

enum  J2K_MCT_ELEMENT_TYPE { MCT_TYPE_INT16 = 0, MCT_TYPE_INT32 = 1, MCT_TYPE_FLOAT = 2, MCT_TYPE_DOUBLE = 3 }
 Type of elements storing in the MCT data. More...
 
enum  J2K_MCT_ARRAY_TYPE { MCT_TYPE_DEPENDENCY = 0, MCT_TYPE_DECORRELATION = 1, MCT_TYPE_OFFSET = 2 }
 Type of MCT array. More...
 
enum  J2K_STATUS {
  J2K_DEC_STATE_NONE = 0x0000, J2K_DEC_STATE_MH_SOC = 0x0001, J2K_DEC_STATE_MH_SIZ = 0x0002, J2K_DEC_STATE_MH = 0x0004,
  J2K_DEC_STATE_TPH_SOT = 0x0008, J2K_DEC_STATE_TPH = 0x0010, J2K_DEC_STATE_NO_EOC = 0x0020, J2K_DEC_STATE_DATA = 0x0040,
  J2K_DEC_STATE_EOC = 0x0080, J2K_DEC_STATE_ERR = 0x0100
}
 Status of decoding process when decoding main header. More...
 
enum  JP2_STATE {
  JP2_STATE_NONE = 0x0, JP2_STATE_SIGNATURE = 0x1, JP2_STATE_FILE_TYPE = 0x2, JP2_STATE_HEADER = 0x4,
  JP2_STATE_CODESTREAM = 0x8, JP2_STATE_END_CODESTREAM = 0x10, JP2_STATE_UNKNOWN = 0x7fffffff
}
 
enum  JP2_IMG_STATE { JP2_IMG_STATE_NONE = 0x0, JP2_IMG_STATE_UNKNOWN = 0x7fffffff }
 
enum  J2K_T2_MODE { THRESH_CALC = 0, FINAL_PASS = 1 }
 T2 compressing mode. More...
 
enum  eSplitOrientation { SPLIT_L, SPLIT_H, SPLIT_NUM_ORIENTATIONS }
 
enum  eBandOrientation {
  BAND_ORIENT_LL, BAND_ORIENT_HL, BAND_ORIENT_LH, BAND_ORIENT_HH,
  BAND_NUM_ORIENTATIONS
}
 
enum  eBandIndex { BAND_INDEX_LH, BAND_INDEX_HL, BAND_INDEX_HH, BAND_NUM_INDICES }
 

Functions

static bool j2k_read_header_procedure (CodeStream *codeStream)
 The read header procedure. More...
 
static bool j2k_compress_validation (CodeStream *codeStream)
 The default compressing validation procedure without any extension. More...
 
static bool j2k_decompress_validation (CodeStream *codeStream)
 The default decoding validation procedure without any extension. More...
 
static bool j2k_mct_validation (CodeStream *codeStream)
 The mct compressing validation procedure. More...
 
static bool j2k_update_rates (CodeStream *codeStream)
 Updates the rates of the tcp. More...
 
static bool j2k_copy_default_tcp (CodeStream *codeStream)
 Copies the decoding tile parameters onto all the tile parameters. More...
 
static bool j2k_decompress_tiles (CodeStream *codeStream)
 Read the tiles. More...
 
static bool j2k_get_end_header (CodeStream *codeStream)
 Gets the offset of the header. More...
 
static bool j2k_end_encoding (CodeStream *codeStream)
 Ends the compressing, i.e. More...
 
static bool j2k_init_info (CodeStream *codeStream)
 Inits the Info. More...
 
static bool j2k_check_poc_val (const grk_poc *p_pocs, uint32_t nb_pocs, uint32_t nb_resolutions, uint32_t numcomps, uint32_t numlayers)
 Checks the progression order changes values. More...
 
static uint64_t j2k_get_num_tp (CodingParams *cp, uint32_t pino, uint16_t tileno)
 Gets the number of tile parts used for the given change of progression (if any) and the given tile. More...
 
static bool j2k_calculate_tp (CodingParams *cp, uint16_t *p_nb_tile_parts, grk_image *image)
 Calculates the total number of tile parts needed by the compressor to compress such an image. More...
 
static bool lupDecompose (float *matrix, uint32_t *permutations, float *p_swap_area, uint32_t nb_compo)
 LUP decomposition. More...
 
static void lupSolve (float *pResult, float *pMatrix, float *pVector, uint32_t *pPermutations, uint32_t nb_compo, float *p_intermediate_data)
 LUP solving. More...
 
static void lupInvert (float *pSrcMatrix, float *pDestMatrix, uint32_t nb_compo, uint32_t *pPermutations, float *p_src_temp, float *p_dest_temp, float *p_swap_area)
 LUP inversion (call with the result of lupDecompose) More...
 
static bool matrix_inversion_f (float *pSrcMatrix, float *pDestMatrix, uint32_t n)
 Calculate a n x n double matrix inversion with a LUP method. More...
 
grk_imagegrk_image_create0 (void)
 
bool grk_image_single_component_data_alloc (grk_image_comp *image)
 Allocate data for single image component. More...
 
static void grk_copy_image_header (const grk_image *image_src, grk_image *image_dest)
 Copy only header of image and its component header (no data are copied) if dest image have data, they will be freed. More...
 
static bool update_image_dimensions (grk_image *image, uint32_t reduce)
 
static void transfer_image_data (grk_image *src, grk_image *dest)
 Transfer data from src to dest for each component, and null out src data. More...
 
static bool j2k_decompress_tile (CodeStream *codeStream)
 
static void j2k_dump_MH_info (CodeStream *codeStream, FILE *out_stream)
 
static void j2k_dump_MH_index (CodeStream *codeStream, FILE *out_stream)
 
static void j2k_dump_tile_info (TileCodingParams *default_tile, uint32_t numcomps, FILE *out_stream)
 
void j2k_dump (CodeStream *codeStream, int32_t flag, FILE *out_stream)
 Dump some elements from the J2K decompression structure . More...
 
void j2k_dump_image_header (grk_image *image, bool dev_dump_flag, FILE *out_stream)
 Dump an image header structure. More...
 
void j2k_dump_image_comp_header (grk_image_comp *comp, bool dev_dump_flag, FILE *out_stream)
 Dump a component image header structure. More...
 
grk_codestream_info_v2j2k_get_cstr_info (CodeStream *codeStream)
 Get the code stream info from a JPEG2000 codec. More...
 
grk_codestream_indexj2k_get_cstr_index (CodeStream *codeStream)
 Get the code stream index from a JPEG2000 codec. More...
 
bool j2k_allocate_tile_element_cstr_index (CodeStream *codeStream)
 
grk_codestream_indexj2k_create_cstr_index (void)
 
void j2k_destroy_cstr_index (grk_codestream_index *p_cstr_ind)
 Destroys a code stream index structure. More...
 
void jp2_dump (FileFormat *fileFormat, int32_t flag, FILE *out_stream)
 Dump some elements from the JP2 decompression structure . More...
 
grk_codestream_indexjp2_get_cstr_index (FileFormat *fileFormat)
 Get the code stream index from a JPEG2000 codec. More...
 
grk_codestream_info_v2jp2_get_cstr_info (FileFormat *fileFormat)
 Get the code stream info from a JPEG2000 codec. More...
 
static void j2k_copy_tile_component_parameters (CodeStream *codeStream)
 Copies the tile component parameters of all the component from the first tile component. More...
 
template<typename S , typename D >
void j2k_write (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_int16_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_int32_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float32_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float64_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_int16_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_int32_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float32_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_read_float64_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_int16 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_int32 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_float (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
void j2k_write_float_to_float64 (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
 
bool j2k_add_mhmarker (grk_codestream_index *cstr_index, uint32_t type, uint64_t pos, uint32_t len)
 Add main header marker information. More...
 
bool j2k_write_soc (CodeStream *codeStream)
 Writes the SOC marker (Start Of Codestream) More...
 
bool j2k_read_soc (CodeStream *codeStream)
 Reads a SOC marker (Start of Codestream) More...
 
bool j2k_write_siz (CodeStream *codeStream)
 Writes the SIZ marker (image and tile size) More...
 
bool j2k_read_cap (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a CAP marker. More...
 
bool j2k_write_cap (CodeStream *codeStream)
 Writes the CAP marker. More...
 
bool j2k_read_siz (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a SIZ marker (image and tile size) More...
 
bool j2k_write_com (CodeStream *codeStream)
 Writes the COM marker (comment) More...
 
bool j2k_read_com (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a COM marker (comments) More...
 
bool j2k_write_cod (CodeStream *codeStream)
 Writes the COD marker (Coding style default) More...
 
bool j2k_read_cod (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a COD marker (Coding Style defaults) More...
 
bool j2k_write_coc (CodeStream *codeStream, uint32_t comp_no)
 
bool j2k_compare_coc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compares 2 COC markers (Coding style component) More...
 
bool j2k_read_coc (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a COC marker (Coding Style Component) More...
 
bool j2k_write_qcd (CodeStream *codeStream)
 Writes the QCD marker (quantization default) More...
 
bool j2k_read_qcd (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a QCD marker (Quantization defaults) More...
 
bool j2k_write_qcc (CodeStream *codeStream, uint32_t comp_no)
 
bool j2k_compare_qcc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compare QCC markers (quantization component) More...
 
bool j2k_read_qcc (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a QCC marker (Quantization component) More...
 
uint16_t getPocSize (uint32_t nb_comp, uint32_t nb_poc)
 
bool j2k_write_poc (CodeStream *codeStream)
 Writes the POC marker (Progression Order Change) More...
 
bool j2k_read_poc (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a POC marker (Progression Order Change) More...
 
bool j2k_read_crg (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a CRG marker (Component registration) More...
 
bool j2k_read_plm (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a PLM marker (Packet length, main header marker) More...
 
bool j2k_read_plt (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a PLT marker (Packet length, tile-part header) More...
 
bool j2k_read_ppm (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a PPM marker (Packed packet headers, main header) More...
 
bool j2k_merge_ppm (CodingParams *p_cp)
 Merges all PPM markers read (Packed headers, main header) More...
 
bool j2k_read_ppt (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a PPT marker (Packed packet headers, tile-part header) More...
 
bool j2k_merge_ppt (TileCodingParams *p_tcp)
 Merges all PPT markers read (Packed packet headers, tile-part header) More...
 
bool j2k_read_sot (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Read SOT (Start of tile part) marker. More...
 
bool j2k_write_rgn (CodeStream *codeStream, uint16_t tile_no, uint32_t comp_no, uint32_t nb_comps)
 Writes the RGN marker (Region Of Interest) More...
 
bool j2k_write_eoc (CodeStream *codeStream)
 Writes the EOC marker (End of Codestream) More...
 
bool j2k_read_rgn (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a RGN marker (Region Of Interest) More...
 
bool j2k_write_mct_data_group (CodeStream *codeStream)
 Writes the CBD-MCT-MCC-MCO markers (Multi components transform) More...
 
bool j2k_write_all_coc (CodeStream *codeStream)
 Writes COC marker for each component. More...
 
bool j2k_write_all_qcc (CodeStream *codeStream)
 Writes QCC marker for each component. More...
 
bool j2k_write_regions (CodeStream *codeStream)
 Writes regions of interests. More...
 
bool j2k_write_epc (CodeStream *codeStream)
 Writes EPC ???? More...
 
bool j2k_write_mct_record (grk_mct_data *p_mct_record, BufferedStream *stream)
 Writes the MCT marker (Multiple Component Transform) More...
 
bool j2k_read_mct (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a MCT marker (Multiple Component Transform) More...
 
bool j2k_write_mcc_record (grk_simple_mcc_decorrelation_data *p_mcc_record, BufferedStream *stream)
 Writes the MCC marker (Multiple Component Collection) More...
 
bool j2k_read_mcc (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a MCC marker (Multiple Component Collection) More...
 
bool j2k_write_mco (CodeStream *codeStream)
 Writes the MCO marker (Multiple component transformation ordering) More...
 
bool j2k_read_mco (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a MCO marker (Multiple Component Transform Ordering) More...
 
bool j2k_add_mct (TileCodingParams *p_tcp, grk_image *p_image, uint32_t index)
 
bool j2k_write_cbd (CodeStream *codeStream)
 Writes the CBD marker (Component bit depth definition) More...
 
bool j2k_read_cbd (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a CBD marker (Component bit depth definition) More...
 
bool j2k_read_tlm (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)
 Reads a TLM marker (Tile Length Marker) More...
 
bool j2k_write_tlm_begin (CodeStream *codeStream)
 Begin writing the TLM marker (Tile Length Marker) More...
 
void j2k_update_tlm (CodeStream *codeStream, uint16_t tile_index, uint32_t tile_part_size)
 Updates the Tile Length Marker. More...
 
bool j2k_write_tlm_end (CodeStream *codeStream)
 End writing the updated tlm. More...
 
uint32_t j2k_get_SPCod_SPCoc_size (CodeStream *codeStream, uint32_t comp_no)
 Gets the size taken by writing a SPCod or SPCoc for the given tile and component. More...
 
bool j2k_compare_SPCod_SPCoc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compare 2 a SPCod/ SPCoc elements, i.e. More...
 
bool j2k_write_SPCod_SPCoc (CodeStream *codeStream, uint32_t comp_no)
 Writes a SPCod or SPCoc element, i.e. More...
 
bool j2k_read_SPCod_SPCoc (CodeStream *codeStream, uint32_t compno, uint8_t *p_header_data, uint16_t *header_size)
 Reads a SPCod or SPCoc element, i.e. More...
 
uint32_t j2k_get_SQcd_SQcc_size (CodeStream *codeStream, uint32_t comp_no)
 Gets the size taken by writing SQcd or SQcc element, i.e. More...
 
bool j2k_compare_SQcd_SQcc (CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
 Compares 2 SQcd or SQcc element, i.e. More...
 
bool j2k_write_SQcd_SQcc (CodeStream *codeStream, uint32_t comp_no)
 Writes a SQcd or SQcc element, i.e. More...
 
bool j2k_read_SQcd_SQcc (CodeStream *codeStream, bool fromQCC, uint32_t compno, uint8_t *p_header_data, uint16_t *header_size)
 Reads a SQcd or SQcc element, i.e. More...
 
bool j2k_write_coc (CodeStream *codeStream, uint32_t comp_no, BufferedStream *stream)
 Writes the COC marker (Coding style component) More...
 
bool j2k_write_qcc (CodeStream *codeStream, uint16_t tile_index, uint32_t comp_no, BufferedStream *stream)
 Writes the QCC marker (quantization component) More...
 
static void grk_update_image_comp_header_from_coding_params (grk_image *image_header, const CodingParams *p_cp)
 Updates the components characteristics of the image from the coding parameters. More...
 
bool minpf_get_full_path (const char *path, void *addr, dynamic_handle_t handle, char *fullPath, size_t fullPathLen)
 
bool minpf_unload_dynamic_library (minpf_dynamic_library *library)
 
minpf_dynamic_libraryminpf_load_dynamic_library (const char *path, char *error)
 
void * minpf_get_symbol (minpf_dynamic_library *library, const char *symbol)
 
PLUGIN_API minpf_exit_func minpf_init_plugin (const char *pluginPath, const minpf_platform_services *params)
 
static int32_t minpf_post_load_plugin (const char *pluginPath, minpf_post_load_func initFunc)
 
static const char * get_filename_ext (const char *filename)
 
static int32_t minpf_load (const char *path)
 
static uint32_t minpf_is_valid_plugin (const char *id, const minpf_register_params *params)
 
int32_t minpf_register_object (const char *id, const minpf_register_params *params)
 
const char * minpf_get_dynamic_library_extension (void)
 
void minpf_initialize_plugin_manager (minpf_plugin_manager *manager)
 
minpf_plugin_managerminpf_get_plugin_manager (void)
 
void minpf_cleanup_plugin_manager (void)
 
int32_t minpf_load_from_path (const char *path, minpf_invoke_service_func func)
 
int32_t minpf_load_from_dir (const char *directory_path, minpf_invoke_service_func func)
 
void decompress_synch_plugin_with_host (TileProcessor *tcd)
 
bool tile_equals (grk_plugin_tile *plugin_tile, grk_tile *p_tile)
 
void compress_synch_with_plugin (TileProcessor *tcd, uint32_t compno, uint32_t resno, uint32_t bandIndex, uint64_t precinctIndex, uint64_t cblkno, Subband *band, CompressCodeblock *cblk, uint32_t *numPix)
 
void set_context_stream (TileProcessor *p_tileProcessor)
 
void mqc_next_plane (grk_plugin_debug_mqc *mqc)
 
void nextCXD (grk_plugin_debug_mqc *mqc, uint32_t d)
 
uint32_t mqc_numbytes_enc (mqcoder *mqc)
 
void mqc_resetstates (mqcoder *mqc)
 
void mqc_init_enc (mqcoder *mqc, uint8_t *bp)
 
void mqc_encode (mqcoder *mqc, uint32_t d)
 
void mqc_flush_enc (mqcoder *mqc)
 
void mqc_bypass_init_enc (mqcoder *mqc)
 
uint32_t mqc_bypass_get_extra_bytes_enc (mqcoder *mqc, bool erterm)
 
void mqc_bypass_enc (mqcoder *mqc, uint32_t d)
 
void mqc_bypass_flush_enc (mqcoder *mqc, bool erterm)
 
void mqc_restart_init_enc (mqcoder *mqc)
 
void mqc_erterm_enc (mqcoder *mqc)
 
void mqc_segmark_enc (mqcoder *mqc)
 
void mqc_init_dec (mqcoder *mqc, uint8_t *bp, uint32_t len)
 Initialize the decoder for MQ decoding. More...
 
void mqc_raw_init_dec (mqcoder *mqc, uint8_t *bp, uint32_t len)
 Initialize the decoder for RAW decoding. More...
 
void mqc_finish_dec (mqcoder *mqc)
 Terminate RAW/MQC decoding. More...
 
static void mqc_init_dec_common (mqcoder *mqc, uint8_t *bp, uint32_t len)
 
void mqc_byteout (mqcoder *mqc)
 
static void mqc_renorm_enc (mqcoder *mqc)
 
static void mqc_codemps_enc (mqcoder *mqc)
 
static void mqc_codelps_enc (mqcoder *mqc)
 
static void mqc_setbits_enc (mqcoder *mqc)
 
static INLINE void update_flags (grk_flag *flagsp, uint32_t ci, uint32_t s, uint32_t stride, uint32_t vsc)
 
static int16_t getnmsedec_sig (uint32_t x, uint32_t bitpos)
 
static int16_t getnmsedec_ref (uint32_t x, uint32_t bitpos)
 
static INLINE uint8_t getctxno_zc (mqcoder *mqc, uint32_t f)
 
static INLINE uint32_t getctxno_mag (uint32_t f)
 
static INLINE uint32_t getctxtno_sc_or_spb_index (uint32_t fX, uint32_t pfX, uint32_t nfX, uint32_t ci)
 
static INLINE uint8_t getspb (uint32_t lu)
 
static INLINE uint8_t getctxno_sc (uint32_t lu)
 
static void prepareBlockForFirstLayer (CompressCodeblock *cblk)
 
template<typename T >
void grk_copy_strided (uint32_t w, uint32_t stride, uint32_t h, T *src, int32_t *dest)
 Assume that source stride == source width == destination width. More...
 
uint32_t max_resolution (Resolution *GRK_RESTRICT r, uint32_t i)
 
static void decompress_h_cas0_53 (int32_t *buf, int32_t *bandL, const uint32_t wL, int32_t *bandH, const uint32_t wH, int32_t *dest)
 
static void decompress_h_cas1_53 (int32_t *buf, int32_t *bandL, const uint32_t wL, int32_t *bandH, const uint32_t wH, int32_t *dest)
 
static void decompress_v_cas0_53 (int32_t *buf, int32_t *bandL, const uint32_t hL, const uint32_t strideL, int32_t *bandH, const uint32_t hH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest)
 Vertical inverse 5x3 wavelet transform for one column, when top-most pixel is on even coordinate. More...
 
static void decompress_v_cas1_53 (int32_t *buf, int32_t *bandL, const uint32_t hL, const uint32_t strideL, int32_t *bandH, const uint32_t hH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest)
 Vertical inverse 5x3 wavelet transform for one column, when top-most pixel is on odd coordinate. More...
 
static void decompress_h_53 (const dwt_data< int32_t > *dwt, int32_t *bandL, int32_t *bandH, int32_t *dest)
 
static void decompress_v_53 (const dwt_data< int32_t > *dwt, int32_t *bandL, const uint32_t strideL, int32_t *bandH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest, uint32_t nb_cols)
 
static void decompress_h_strip_53 (const dwt_data< int32_t > *horiz, uint32_t hMin, uint32_t hMax, int32_t *bandL, const uint32_t strideL, int32_t *bandH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest)
 
static bool decompress_h_mt_53 (uint32_t num_threads, size_t data_size, dwt_data< int32_t > &horiz, dwt_data< int32_t > &vert, uint32_t rh, int32_t *bandL, const uint32_t strideL, int32_t *bandH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest)
 
static void decompress_v_strip_53 (const dwt_data< int32_t > *vert, uint32_t wMin, uint32_t wMax, int32_t *bandL, const uint32_t strideL, int32_t *bandH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest)
 
static bool decompress_v_mt_53 (uint32_t num_threads, size_t data_size, dwt_data< int32_t > &horiz, dwt_data< int32_t > &vert, uint32_t rw, int32_t *bandL, const uint32_t strideL, int32_t *bandH, const uint32_t strideH, int32_t *dest, const uint32_t strideDest)
 
static bool decompress_tile_53 (TileComponent *tilec, uint32_t numres)
 
static Decompress97 makeDecompress97 (dwt_data< vec4f > *dwt, bool low)
 
static void decompress_step1_97 (vec4f *data, uint32_t end, const float c)
 
static void decompress_step2_97 (Decompress97 d, float c)
 
static void decompress_step_97 (dwt_data< vec4f > *GRK_RESTRICT dwt)
 
static void interleave_h_97 (dwt_data< vec4f > *GRK_RESTRICT dwt, float *GRK_RESTRICT bandL, const uint32_t strideL, float *GRK_RESTRICT bandH, const uint32_t strideH, uint32_t remaining_height)
 
static void decompress_h_strip_97 (dwt_data< vec4f > *GRK_RESTRICT horiz, const uint32_t rh, float *GRK_RESTRICT bandL, const uint32_t strideL, float *GRK_RESTRICT bandH, const uint32_t strideH, float *dest, const size_t strideDest)
 
static bool decompress_h_mt_97 (uint32_t num_threads, size_t data_size, dwt_data< vec4f > &GRK_RESTRICT horiz, const uint32_t rh, float *GRK_RESTRICT bandL, const uint32_t strideL, float *GRK_RESTRICT bandH, const uint32_t strideH, float *GRK_RESTRICT dest, const uint32_t strideDest)
 
static void interleave_v_97 (dwt_data< vec4f > *GRK_RESTRICT dwt, float *GRK_RESTRICT bandL, const uint32_t strideL, float *GRK_RESTRICT bandH, const uint32_t strideH, uint32_t nb_elts_read)
 
static void decompress_v_strip_97 (dwt_data< vec4f > *GRK_RESTRICT vert, const uint32_t rw, const uint32_t rh, float *GRK_RESTRICT bandL, const uint32_t strideL, float *GRK_RESTRICT bandH, const uint32_t strideH, float *GRK_RESTRICT dest, const uint32_t strideDest)
 
static bool decompress_v_mt_97 (uint32_t num_threads, size_t data_size, dwt_data< vec4f > &GRK_RESTRICT vert, const uint32_t rw, const uint32_t rh, float *GRK_RESTRICT bandL, const uint32_t strideL, float *GRK_RESTRICT bandH, const uint32_t strideH, float *GRK_RESTRICT dest, const uint32_t strideDest)
 
static bool decompress_tile_97 (TileComponent *GRK_RESTRICT tilec, uint32_t numres)
 
template<typename T , uint32_t FILTER_WIDTH, typename D >
bool decompress_partial_tile (TileComponent *GRK_RESTRICT tilec, grk_rect_u32 bounds, uint32_t numres, ISparseBuffer *sa)
 
template<class T >
constexpr T getFilterWidth (bool lossless)
 
template<class T >
constexpr T getHorizontalPassHeight (bool lossless)
 
int32_t getValue (uint32_t i)
 
bool init_tilec (TileComponent *tilec, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t numresolutions, grk_image *output_image)
 
void usage (void)
 
template<typename TYPE >
void grk_write (uint8_t *p_buffer, TYPE value, uint32_t nb_bytes)
 
template<typename TYPE >
void grk_read (const uint8_t *p_buffer, TYPE *value, uint32_t nb_bytes)
 
template<typename TYPE >
void grk_write (uint8_t *p_buffer, TYPE value)
 
template<typename TYPE >
void grk_read (const uint8_t *p_buffer, TYPE *value)
 
template<typename T >
uint32_t ceildiv (T a, T b)
 Divide an integer by another integer and round upwards. More...
 
template<typename T >
ceildivpow2 (T a, uint32_t b)
 
static uint32_t uint64_ceildivpow2 (uint64_t a, uint32_t b)
 Divide a 64-bit integer by a power of 2 and round upwards. More...
 
static uint32_t uint_floordivpow2 (uint32_t a, uint32_t b)
 Divide an unsigned integer by a power of 2 and round downwards. More...
 
template<typename T >
floorlog2 (uint32_t a)
 Get logarithm of an integer and round downwards. More...
 
static int32_t int_fix_mul (int32_t a, int32_t b)
 Multiply two fixed-point numbers. More...
 
static int32_t get_file_open_mode (const char *mode)
 
static uint64_t size_proc (grk_handle fd)
 
static void * grk_map (grk_handle fd, size_t len, bool do_read)
 
static int32_t unmap (void *ptr, size_t len)
 
static grk_handle open_fd (const char *fname, const char *mode)
 
static int32_t close_fd (grk_handle fd)
 
static void mem_map_free (void *user_data)
 
grk_streamcreate_mapped_file_read_stream (const char *fname)
 
grk_streamcreate_mapped_file_write_stream (const char *fname)
 
template<typename ... Args>
void log (grk_msg_callback msg_handler, void *l_data, char const *const format, Args &... args) noexcept
 
void GRK_INFO (const char *fmt,...)
 
void GRK_WARN (const char *fmt,...)
 
void GRK_ERROR (const char *fmt,...)
 
uint32_t grk_make_aligned_width (uint32_t width)
 
static void * grk_aligned_alloc_n (size_t alignment, size_t size)
 
void * grk_malloc (size_t size)
 Allocate an uninitialized memory block. More...
 
void * grk_calloc (size_t numOfElements, size_t sizeOfElements)
 Allocate a memory block with elements initialized to 0. More...
 
void * grk_aligned_malloc (size_t size)
 Allocate memory aligned to a 16 byte boundary. More...
 
void grk_aligned_free (void *ptr)
 
void * grk_realloc (void *m, size_t s)
 Reallocate memory blocks. More...
 
void grk_free (void *m)
 Deallocates or frees a memory block. More...
 
static void free_mem (void *user_data)
 
static size_t zero_copy_read_from_mem (void **p_buffer, size_t nb_bytes, MemStream *p_source_buffer)
 
static size_t read_from_mem (void *p_buffer, size_t nb_bytes, MemStream *p_source_buffer)
 
static size_t write_to_mem (void *dest, size_t nb_bytes, MemStream *src)
 
static bool seek_from_mem (uint64_t nb_bytes, MemStream *src)
 
static void grk_stream_set_zero_copy_read_function (grk_stream *stream, grk_stream_zero_copy_read_fn p_function)
 Set the given function to be used as a zero copy read function. More...
 
void set_up_mem_stream (grk_stream *l_stream, size_t len, bool is_read_stream)
 
size_t get_mem_stream_offset (grk_stream *stream)
 
grk_streamcreate_mem_stream (uint8_t *buf, size_t len, bool ownsBuffer, bool is_read_stream)
 
bool mult_will_overflow (uint32_t a, uint32_t b)
 
bool mult64_will_overflow (uint64_t a, uint64_t b)
 
template<typename T >
clip (int64_t val)
 
template<typename T >
sat_add (int64_t lhs, int64_t rhs)
 
template<typename T >
sat_add (T lhs, T rhs)
 
template<typename T >
sat_sub (T lhs, T rhs)
 
template<typename T >
sat_sub (int64_t lhs, int64_t rhs)
 
Exported functions
bool j2k_init_mct_encoding (TileCodingParams *p_tcp, grk_image *p_image)
 
char * j2k_convert_progression_order (GRK_PROG_ORDER prg_order)
 Converts an enum type progression order to string type. More...
 
bool j2k_decompress_tile (CodeStream *codeStream, grk_image *p_image, uint16_t tile_index)
 

Variables

static j2k_prog_order j2k_prog_order_list []
 
static const j2k_mct_function j2k_mct_write_functions_from_float []
 
const uint32_t sot_marker_segment_len = 12U
 
const uint32_t grk_marker_length = 4U
 
const uint32_t SPCod_SPCoc_len = 5U
 
const uint32_t cod_coc_len = 5U
 
const uint32_t tlm_len_per_tile_part = 5
 
const uint32_t GRK_COMP_PARAM_DEFAULT_CBLOCKW = 64
 
const uint32_t GRK_COMP_PARAM_DEFAULT_CBLOCKH = 64
 
const GRK_PROG_ORDER GRK_COMP_PARAM_DEFAULT_PROG_ORDER = GRK_LRCP
 
const uint32_t GRK_COMP_PARAM_DEFAULT_NUMRESOLUTION = 6
 
const uint32_t max_precision_jpeg_2000 = 38
 
const uint32_t max_num_components = 16384
 
const uint32_t max_passes_per_segment = (max_precision_jpeg_2000-1) * 3 +1
 
const uint32_t max_num_tiles = 65535
 
const uint32_t max_num_tile_parts_per_tile = 255
 
const uint32_t max_num_tile_parts = 65535
 
const uint32_t max_tile_part_size = UINT_MAX
 
const uint32_t max_supported_precision = 16
 
const uint32_t default_numbers_segments = 10
 
const uint32_t default_header_size = 1000
 
const uint32_t default_number_mcc_records = 10
 
const uint32_t default_number_mct_records = 10
 
const uint8_t IPTC_UUID [16]
 
const uint8_t XMP_UUID [16]
 
const uint32_t tlm_marker_start_bytes = 6
 
const uint32_t available_packet_len_bytes_per_plt = USHRT_MAX - 1 - 4
 
const uint32_t min_packets_per_full_plt = available_packet_len_bytes_per_plt / 5
 
static const j2k_mct_function j2k_mct_read_functions_to_float []
 
static const j2k_mct_function j2k_mct_read_functions_to_int32 []
 
const uint32_t MCT_ELEMENT_SIZE [] = { 2, 4, 4, 8 }
 
static const uint16_t tabMaxSubLevelFromMainLevel []
 
const uint32_t tag_tree_uninitialized_node_value = 999
 
minpf_plugin_managermanagerInstance
 
static const char * plugin_debug_mqc_next_cxd_method_name
 
static const char * plugin_debug_mqc_next_plane_method_name
 
static const double mct_norms_rev [3] = { 1.732, .8292, .8292 }
 
static const double mct_norms_irrev [3] = { 1.732, 1.805, 1.573 }
 
const uint32_t A_MIN = 0x8000
 
static const mqc_state mqc_states [47 *2]
 
static const mqc_state mqc_states [47 *2]
 
const uint32_t k_max_bit_planes = 31-T1_NMSEDEC_FRACBITS
 
const uint32_t BAND_RES_ZERO_INDEX_LL = 0
 
const double slopeCutoff = pow(2, 64)
 
const double scale = 256 / log(2)
 
const double invScale = log(2) / 256
 
const double shift = 1 << 16
 
static const float dwt_alpha = 1.586134342f
 
static const float dwt_beta = 0.052980118f
 
static const float dwt_gamma = -0.882911075f
 
static const float dwt_delta = -0.443506852f
 
static const float K = 1.230174105f
 
static const float c13318 = 1.625732422f
 
const uint32_t grk_alignment = 32
 
const size_t default_align = 64
 

Local static functions

static const grk_jp2_header_handler jp2_header []
 
static const grk_jp2_header_handler jp2_img_header []
 
static bool jp2_read_ihdr (FileFormat *fileFormat, uint8_t *p_image_header_data, uint32_t image_header_size)
 Reads a IHDR box - Image Header box. More...
 
static uint8_t * jp2_write_ihdr (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 Writes the Image Header box - Image Header box. More...
 
static bool jp2_read_xml (FileFormat *fileFormat, uint8_t *p_xml_data, uint32_t xml_size)
 Read XML box. More...
 
static uint8_t * jp2_write_xml (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 Write XML box. More...
 
static uint8_t * jp2_write_buffer (uint32_t boxId, grk_jp2_buffer *buffer, uint32_t *p_nb_bytes_written)
 Write buffer box. More...
 
static bool jp2_read_uuid (FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_data_size)
 Read a UUID box. More...
 
static bool jp2_read_res (FileFormat *fileFormat, uint8_t *p_resolution_data, uint32_t resolution_size)
 Reads a Resolution box. More...
 
static uint8_t * jp2_write_res (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 Writes the Resolution box. More...
 
static uint8_t * jp2_write_bpc (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 Writes the Bit per Component box. More...
 
static bool jp2_read_bpc (FileFormat *fileFormat, uint8_t *p_bpc_header_data, uint32_t bpc_header_size)
 Reads a Bit per Component box. More...
 
static bool jp2_read_channel_definition (FileFormat *fileFormat, uint8_t *p_cdef_header_data, uint32_t cdef_header_size)
 
static void jp2_apply_channel_definition (grk_image *image, grk_jp2_color *color)
 
static uint8_t * jp2_write_channel_definition (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 Writes the Channel Definition box. More...
 
static uint8_t * jp2_write_colr (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 Writes the Colour Specification box. More...
 
static bool jp2_write_ftyp (FileFormat *fileFormat)
 Writes a FTYP box - File type box. More...
 
static bool jp2_read_ftyp (FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_size)
 Reads a a FTYP box - File type box. More...
 
static bool jp2_skip_jp2c (FileFormat *fileFormat)
 
static bool jp2_read_jp2h (FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_size)
 Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box). More...
 
static bool jp2_write_uuids (FileFormat *fileFormat)
 
static bool jp2_write_jp2c (FileFormat *fileFormat)
 Writes the Jpeg2000 code stream Header box - JP2C Header box. More...
 
static bool jp2_read_jp (FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_size)
 Reads a JPEG 2000 file signature box. More...
 
static bool jp2_write_jp (FileFormat *fileFormat)
 Writes a JPEG 2000 file signature box. More...
 
static bool jp2_apply_palette_clr (grk_image *image, grk_jp2_color *color)
 Apply collected palette data. More...
 
static void jp2_free_palette_clr (grk_jp2_color *color)
 
static uint8_t * jp2_write_palette_clr (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 
static uint8_t * jp2_write_component_mapping (FileFormat *fileFormat, uint32_t *p_nb_bytes_written)
 
static bool jp2_read_palette_clr (FileFormat *fileFormat, uint8_t *p_pclr_header_data, uint32_t pclr_header_size)
 Collect palette data. More...
 
static bool jp2_read_component_mapping (FileFormat *fileFormat, uint8_t *component_mapping_header_data, uint32_t component_mapping_header_size)
 Collect component mapping data. More...
 
static bool jp2_read_colr (FileFormat *fileFormat, uint8_t *p_colr_header_data, uint32_t colr_header_size)
 Reads the Color Specification box. More...
 
static bool jp2_init_end_header_writing (FileFormat *fileFormat)
 Sets up the procedures to do on writing header after the code stream. More...
 
static bool jp2_init_end_header_reading (FileFormat *fileFormat)
 Sets up the procedures to do on reading header after the code stream. More...
 
static bool jp2_read_header_procedure (FileFormat *fileFormat)
 Reads a JPEG 2000 file header structure. More...
 
static bool jp2_exec (FileFormat *fileFormat, std::vector< jp2_procedure > *procs)
 Executes the given procedures on the given codec. More...
 
static bool jp2_read_box_hdr (grk_jp2_box *box, uint32_t *p_number_bytes_read, BufferedStream *stream)
 Reads a box header. More...
 
static bool jp2_init_compress_validation (FileFormat *fileFormat)
 Sets up the validation ,i.e. More...
 
static bool jp2_init_header_writing (FileFormat *fileFormat)
 Sets up the procedures to do on writing header. More...
 
static bool jp2_default_validation (FileFormat *fileFormat)
 
static const grk_jp2_header_handlerjp2_img_find_handler (uint32_t id)
 Finds the image execution function related to the given box id. More...
 
static const grk_jp2_header_handlerjp2_find_handler (uint32_t id)
 Finds the execution function related to the given box id. More...
 
static bool jp2_read_box (grk_jp2_box *box, uint8_t *p_data, uint32_t *p_number_bytes_read, uint64_t p_box_max_size)
 Reads a box header. More...
 
static bool jp2_init_decompress_validation (FileFormat *fileFormat)
 Sets up the validation ,i.e. More...
 
static bool jp2_init_header_reading (FileFormat *fileFormat)
 Sets up the procedures to do on reading header. More...
 
double calc_res (uint16_t num, uint16_t den, uint8_t exponent)
 
static bool jp2_read_res_box (uint32_t *id, uint32_t *num, uint32_t *den, uint32_t *exponent, uint8_t **p_resolution_data)
 
void find_cf (double x, uint32_t *num, uint32_t *den)
 
static void jp2_write_res_box (double resx, double resy, uint32_t box_id, uint8_t **current_res_ptr)
 
static bool jp2_check_color (grk_image *image, grk_jp2_color *color)
 
static bool jp2_write_jp2h (FileFormat *fileFormat)
 
static bool pi_next_lrcp (PacketIter *pi)
 Get next packet in layer-resolution-component-precinct order. More...
 
static bool pi_next_rlcp (PacketIter *pi)
 Get next packet in resolution-layer-component-precinct order. More...
 
static bool pi_next_rpcl (PacketIter *pi)
 Get next packet in resolution-precinct-component-layer order. More...
 
static bool pi_next_pcrl (PacketIter *pi)
 Get next packet in precinct-component-resolution-layer order. More...
 
static bool pi_next_cprl (PacketIter *pi)
 Get next packet in component-precinct-resolution-layer order. More...
 
static void pi_update_encode_poc_and_final (CodingParams *p_cp, uint16_t tileno, uint32_t tx0, uint32_t tx1, uint32_t ty0, uint32_t ty1, uint64_t max_precincts, uint32_t dx_min, uint32_t dy_min)
 Updates the coding parameters if the compressing is used with Progression order changes and final (or cinema parameters are used). More...
 
static void pi_update_encode_no_poc (CodingParams *p_cp, uint16_t num_comps, uint16_t tileno, uint32_t tx0, uint32_t tx1, uint32_t ty0, uint32_t ty1, uint64_t max_precincts, uint8_t max_res, uint32_t dx_min, uint32_t dy_min)
 Updates the coding parameters if the compressing is not used with Progression order changes and final (and cinema parameters are used). More...
 
static void grk_get_encoding_parameters (const grk_image *p_image, const CodingParams *p_cp, uint16_t tileno, uint32_t *tx0, uint32_t *tx1, uint32_t *ty0, uint32_t *ty1, uint32_t *dx_min, uint32_t *dy_min, uint64_t *max_precincts, uint8_t *max_res)
 Gets the compressing parameters needed to update the coding parameters and all the pocs. More...
 
static void grk_get_all_encoding_parameters (const grk_image *p_image, const CodingParams *p_cp, uint16_t tileno, uint32_t *tx0, uint32_t *tx1, uint32_t *ty0, uint32_t *ty1, uint32_t *dx_min, uint32_t *dy_min, uint64_t *max_precincts, uint8_t *max_res, uint32_t **p_resolutions)
 Gets the compressing parameters needed to update the coding parameters and all the pocs. More...
 
static PacketIterpi_create (const grk_image *p_image, const CodingParams *p_cp, uint16_t tileno, std::vector< uint8_t * > *include)
 Allocates memory for a packet iterator. More...
 
static void pi_update_decode_no_poc (PacketIter *p_pi, TileCodingParams *p_tcp, uint64_t max_precincts, uint8_t max_res)
 Update decompress packet iterator with no POC. More...
 
static void pi_update_decode_poc (PacketIter *p_pi, TileCodingParams *p_tcp, uint64_t max_precincts)
 Upgrade decompress packet iterator with POC. More...
 
static bool pi_check_next_level (int32_t pos, CodingParams *cp, uint16_t tileno, uint32_t pino, const char *prog)
 Check packet iterator's nexxt level. More...
 
static void update_pi_dxy (PacketIter *pi)
 
static void update_pi_dxy_for_comp (PacketIter *pi, grk_pi_comp *comp)
 
static uint8_t pi_next_l (PacketIter *pi)
 
PacketIterpi_create_decompress (grk_image *image, CodingParams *cp, uint16_t tileno, std::vector< uint8_t * > *include)
 Create a packet iterator for Decoder. More...
 
PacketIterpi_create_compress (const grk_image *image, CodingParams *cp, uint16_t tileno, J2K_T2_MODE t2_mode, std::vector< uint8_t * > *include)
 Creates a packet iterator for compressing. More...
 
void pi_enable_tile_part_generation (PacketIter *pi, CodingParams *cp, uint16_t tileno, uint32_t pino, bool first_poc_tile_part, uint32_t tppos, J2K_T2_MODE t2_mode)
 Modify the packet iterator for enabling tile part generation. More...
 
void pi_destroy (PacketIter *p_pi)
 Destroys a packet iterator array. More...
 
void pi_update_encoding_parameters (const grk_image *p_image, CodingParams *p_cp, uint16_t tile_no)
 Updates the compressing parameters of the codec. More...
 
bool pi_next (PacketIter *pi)
 Modify the packet iterator to point to the next packet. More...
 

Detailed Description

Copyright (C) 2016-2020 Grok Image Compression Inc.

This source code is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation.

This source code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Typedef Documentation

◆ grk_buf

using grk::grk_buf = typedef grk_buffer<uint8_t>

◆ grk_flag

typedef uint32_t grk::grk_flag

Flags for 4 consecutive rows of a column.

◆ grk_handle

typedef int32_t grk::grk_handle

◆ grk_pt

using grk::grk_pt = typedef grk_point<uint32_t>

◆ grk_rect

typedef grk_rectangle< int64_t > grk::grk_rect

◆ grk_rect_u32

typedef grk_rectangle< uint32_t > grk::grk_rect_u32

◆ grk_stream_zero_copy_read_fn

typedef size_t(* grk::grk_stream_zero_copy_read_fn) (void **p_buffer, size_t nb_bytes, void *user_data)

◆ j2k_mct_function

typedef void(* grk::j2k_mct_function) (const void *p_src_data, void *p_dest_data, uint64_t nb_elem)

◆ j2k_procedure

typedef bool(* grk::j2k_procedure) (CodeStream *codeStream)

◆ jp2_procedure

typedef bool(* grk::jp2_procedure) (FileFormat *fileFormat)

◆ marker_callback

typedef bool(* grk::marker_callback) (CodeStream *codeStream, uint8_t *p_header_data, uint16_t header_size)

◆ minpf_create_func

typedef void*(* grk::minpf_create_func) (minpf_object_params *)

◆ minpf_destroy_func

typedef int32_t(* grk::minpf_destroy_func) (void *)

◆ minpf_exit_func

typedef int32_t(* grk::minpf_exit_func) ()

◆ minpf_invoke_service_func

typedef int32_t(* grk::minpf_invoke_service_func) (const char *serviceName, void *serviceParams)

◆ minpf_object_params

◆ minpf_platform_services

◆ minpf_plugin_api_version

◆ minpf_plugin_manager

◆ minpf_post_load_func

typedef minpf_exit_func(* grk::minpf_post_load_func) (const char *pluginPath, const minpf_platform_services *)

◆ minpf_register_func

typedef int32_t(* grk::minpf_register_func) (const char *nodeType, const minpf_register_params *params)

◆ minpf_register_params

◆ PL_INFO_VEC

typedef std::vector<uint32_t> grk::PL_INFO_VEC

◆ PL_MAP

typedef std::map<uint8_t, PL_INFO_VEC*> grk::PL_MAP

◆ PLUGIN_BATCH_DECODE

typedef int32_t(* grk::PLUGIN_BATCH_DECODE) (void)

◆ PLUGIN_BATCH_ENCODE

typedef int32_t(* grk::PLUGIN_BATCH_ENCODE) (const char *input_dir, const char *output_dir, grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK userCallback)

◆ PLUGIN_DEBUG_MQC_NEXT_CXD

typedef void(* grk::PLUGIN_DEBUG_MQC_NEXT_CXD) (grk_plugin_debug_mqc *mqc, uint32_t d)

◆ PLUGIN_DEBUG_MQC_NEXT_PLANE

typedef void(* grk::PLUGIN_DEBUG_MQC_NEXT_PLANE) (grk_plugin_debug_mqc *mqc)

◆ PLUGIN_DECODE

typedef int32_t(* grk::PLUGIN_DECODE) (grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)

◆ PLUGIN_DECODE_USER_CALLBACK

typedef int32_t(* grk::PLUGIN_DECODE_USER_CALLBACK) (PluginDecodeCallbackInfo *info)

◆ PLUGIN_ENCODE

typedef int32_t(* grk::PLUGIN_ENCODE) (grk_cparameters *encoding_parameters, PLUGIN_ENCODE_USER_CALLBACK callback)

◆ PLUGIN_ENCODE_USER_CALLBACK

typedef void(* grk::PLUGIN_ENCODE_USER_CALLBACK) (plugin_encode_user_callback_info *info)

◆ PLUGIN_GET_DEBUG_STATE

typedef uint32_t(* grk::PLUGIN_GET_DEBUG_STATE) (void)

◆ PLUGIN_INIT

typedef bool(* grk::PLUGIN_INIT) (grk_plugin_init_info initInfo)

◆ PLUGIN_INIT_BATCH_DECODE

typedef int32_t(* grk::PLUGIN_INIT_BATCH_DECODE) (const char *input_dir, const char *output_dir, grk_decompress_parameters *decoding_parameters, PLUGIN_DECODE_USER_CALLBACK userCallback)

◆ PLUGIN_IS_BATCH_COMPLETE

typedef bool(* grk::PLUGIN_IS_BATCH_COMPLETE) (void)

◆ PLUGIN_STOP_BATCH_DECODE

typedef void(* grk::PLUGIN_STOP_BATCH_DECODE) (void)

◆ PLUGIN_STOP_BATCH_ENCODE

typedef void(* grk::PLUGIN_STOP_BATCH_ENCODE) (void)

◆ TL_INFO_VEC

typedef std::vector<grk_tl_info> grk::TL_INFO_VEC

◆ TL_MAP

typedef std::map<uint8_t, TL_INFO_VEC*> grk::TL_MAP

Enumeration Type Documentation

◆ eBandIndex

Enumerator
BAND_INDEX_LH 
BAND_INDEX_HL 
BAND_INDEX_HH 
BAND_NUM_INDICES 

◆ eBandOrientation

Enumerator
BAND_ORIENT_LL 
BAND_ORIENT_HL 
BAND_ORIENT_LH 
BAND_ORIENT_HH 
BAND_NUM_ORIENTATIONS 

◆ eSplitOrientation

Enumerator
SPLIT_L 
SPLIT_H 
SPLIT_NUM_ORIENTATIONS 

◆ J2K_MCT_ARRAY_TYPE

Type of MCT array.

Enumerator
MCT_TYPE_DEPENDENCY 
MCT_TYPE_DECORRELATION 
MCT_TYPE_OFFSET 

◆ J2K_MCT_ELEMENT_TYPE

Type of elements storing in the MCT data.

Enumerator
MCT_TYPE_INT16 
MCT_TYPE_INT32 

MCT data is stored as signed shorts.

MCT_TYPE_FLOAT 

MCT data is stored as signed integers.

MCT_TYPE_DOUBLE 

MCT data is stored as floats.

◆ J2K_STATUS

Status of decoding process when decoding main header.

These values may be combined with the | operator.

Enumerator
J2K_DEC_STATE_NONE 

no decompress state

J2K_DEC_STATE_MH_SOC 

a SOC marker is expected

J2K_DEC_STATE_MH_SIZ 

a SIZ marker is expected

J2K_DEC_STATE_MH 

the decoding process is in the main header

J2K_DEC_STATE_TPH_SOT 

the decoding process is in a tile part header and expects a SOT marker

J2K_DEC_STATE_TPH 

the decoding process is in a tile part header

J2K_DEC_STATE_NO_EOC 

the decoding process must not expect a EOC marker because the code stream is truncated

J2K_DEC_STATE_DATA 

the decoding process is expecting to read tile data from the code stream

J2K_DEC_STATE_EOC 

the decoding process has encountered the EOC marker

J2K_DEC_STATE_ERR 

the decoding process has encountered an error

◆ J2K_T2_MODE

T2 compressing mode.

Enumerator
THRESH_CALC 
FINAL_PASS 

Function called in Rate allocation process.

◆ JP2_IMG_STATE

Enumerator
JP2_IMG_STATE_NONE 
JP2_IMG_STATE_UNKNOWN 

◆ JP2_STATE

Enumerator
JP2_STATE_NONE 
JP2_STATE_SIGNATURE 
JP2_STATE_FILE_TYPE 
JP2_STATE_HEADER 
JP2_STATE_CODESTREAM 
JP2_STATE_END_CODESTREAM 
JP2_STATE_UNKNOWN 

Function Documentation

◆ calc_res()

double grk::calc_res ( uint16_t  num,
uint16_t  den,
uint8_t  exponent 
)

Referenced by jp2_read_res().

◆ ceildiv()

template<typename T >
uint32_t grk::ceildiv ( a,
b 
)

Divide an integer by another integer and round upwards.

Parameters
ainteger of type T
binteger of type T
Returns
a divided by b

◆ ceildivpow2()

template<typename T >
T grk::ceildivpow2 ( a,
uint32_t  b 
)

◆ clip()

template<typename T >
T grk::clip ( int64_t  val)

◆ close_fd()

static int32_t grk::close_fd ( grk_handle  fd)
static

Referenced by mem_map_free().

◆ compress_synch_with_plugin()

void grk::compress_synch_with_plugin ( TileProcessor tcd,
uint32_t  compno,
uint32_t  resno,
uint32_t  bandIndex,
uint64_t  precinctIndex,
uint64_t  cblkno,
Subband band,
CompressCodeblock cblk,
uint32_t *  numPix 
)

◆ create_mapped_file_read_stream()

grk_stream * grk::create_mapped_file_read_stream ( const char *  fname)

◆ create_mapped_file_write_stream()

grk_stream * grk::create_mapped_file_write_stream ( const char *  fname)

◆ create_mem_stream()

grk_stream * grk::create_mem_stream ( uint8_t *  buf,
size_t  len,
bool  ownsBuffer,
bool  is_read_stream 
)

◆ decompress_h_53()

static void grk::decompress_h_53 ( const dwt_data< int32_t > *  dwt,
int32_t *  bandL,
int32_t *  bandH,
int32_t *  dest 
)
static

◆ decompress_h_cas0_53()

static void grk::decompress_h_cas0_53 ( int32_t *  buf,
int32_t *  bandL,
const uint32_t  wL,
int32_t *  bandH,
const uint32_t  wH,
int32_t *  dest 
)
static

Referenced by decompress_h_53().

◆ decompress_h_cas1_53()

static void grk::decompress_h_cas1_53 ( int32_t *  buf,
int32_t *  bandL,
const uint32_t  wL,
int32_t *  bandH,
const uint32_t  wH,
int32_t *  dest 
)
static

Referenced by decompress_h_53().

◆ decompress_h_mt_53()

static bool grk::decompress_h_mt_53 ( uint32_t  num_threads,
size_t  data_size,
dwt_data< int32_t > &  horiz,
dwt_data< int32_t > &  vert,
uint32_t  rh,
int32_t *  bandL,
const uint32_t  strideL,
int32_t *  bandH,
const uint32_t  strideH,
int32_t *  dest,
const uint32_t  strideDest 
)
static

◆ decompress_h_mt_97()

static bool grk::decompress_h_mt_97 ( uint32_t  num_threads,
size_t  data_size,
dwt_data< vec4f > &GRK_RESTRICT  horiz,
const uint32_t  rh,
float *GRK_RESTRICT  bandL,
const uint32_t  strideL,
float *GRK_RESTRICT  bandH,
const uint32_t  strideH,
float *GRK_RESTRICT  dest,
const uint32_t  strideDest 
)
static

◆ decompress_h_strip_53()

static void grk::decompress_h_strip_53 ( const dwt_data< int32_t > *  horiz,
uint32_t  hMin,
uint32_t  hMax,
int32_t *  bandL,
const uint32_t  strideL,
int32_t *  bandH,
const uint32_t  strideH,
int32_t *  dest,
const uint32_t  strideDest 
)
static

References decompress_h_53().

Referenced by decompress_h_mt_53().

◆ decompress_h_strip_97()

static void grk::decompress_h_strip_97 ( dwt_data< vec4f > *GRK_RESTRICT  horiz,
const uint32_t  rh,
float *GRK_RESTRICT  bandL,
const uint32_t  strideL,
float *GRK_RESTRICT  bandH,
const uint32_t  strideH,
float *  dest,
const size_t  strideDest 
)
static

◆ decompress_partial_tile()

template<typename T , uint32_t FILTER_WIDTH, typename D >
bool grk::decompress_partial_tile ( TileComponent *GRK_RESTRICT  tilec,
grk_rect_u32  bounds,
uint32_t  numres,
ISparseBuffer sa 
)

◆ decompress_step1_97()

static void grk::decompress_step1_97 ( vec4f data,
uint32_t  end,
const float  c 
)
static

References GRK_RESTRICT.

Referenced by decompress_step_97().

◆ decompress_step2_97()

static void grk::decompress_step2_97 ( Decompress97  d,
float  c 
)
static

◆ decompress_step_97()

static void grk::decompress_step_97 ( dwt_data< vec4f > *GRK_RESTRICT  dwt)
static

◆ decompress_synch_plugin_with_host()

void grk::decompress_synch_plugin_with_host ( TileProcessor tcd)

◆ decompress_tile_53()

static bool grk::decompress_tile_53 ( TileComponent tilec,
uint32_t  numres 
)
static

◆ decompress_tile_97()

static bool grk::decompress_tile_97 ( TileComponent *GRK_RESTRICT  tilec,
uint32_t  numres 
)
static

◆ decompress_v_53()

static void grk::decompress_v_53 ( const dwt_data< int32_t > *  dwt,
int32_t *  bandL,
const uint32_t  strideL,
int32_t *  bandH,
const uint32_t  strideH,
int32_t *  dest,
const uint32_t  strideDest,
uint32_t  nb_cols 
)
static

◆ decompress_v_cas0_53()

static void grk::decompress_v_cas0_53 ( int32_t *  buf,
int32_t *  bandL,
const uint32_t  hL,
const uint32_t  strideL,
int32_t *  bandH,
const uint32_t  hH,
const uint32_t  strideH,
int32_t *  dest,
const uint32_t  strideDest 
)
static

Vertical inverse 5x3 wavelet transform for one column, when top-most pixel is on even coordinate.

Referenced by decompress_v_53().

◆ decompress_v_cas1_53()

static void grk::decompress_v_cas1_53 ( int32_t *  buf,
int32_t *  bandL,
const uint32_t  hL,
const uint32_t  strideL,
int32_t *  bandH,
const uint32_t  hH,
const uint32_t  strideH,
int32_t *  dest,
const uint32_t  strideDest 
)
static

Vertical inverse 5x3 wavelet transform for one column, when top-most pixel is on odd coordinate.

Referenced by decompress_v_53().

◆ decompress_v_mt_53()

static bool grk::decompress_v_mt_53 ( uint32_t  num_threads,
size_t  data_size,
dwt_data< int32_t > &  horiz,
dwt_data< int32_t > &  vert,
uint32_t  rw,
int32_t *  bandL,
const uint32_t  strideL,
int32_t *  bandH,
const uint32_t  strideH,
int32_t *  dest,
const uint32_t  strideDest 
)
static

◆ decompress_v_mt_97()

static bool grk::decompress_v_mt_97 ( uint32_t  num_threads,
size_t  data_size,
dwt_data< vec4f > &GRK_RESTRICT  vert,
const uint32_t  rw,
const uint32_t  rh,
float *GRK_RESTRICT  bandL,
const uint32_t  strideL,
float *GRK_RESTRICT  bandH,
const uint32_t  strideH,
float *GRK_RESTRICT  dest,
const uint32_t  strideDest 
)
static

◆ decompress_v_strip_53()

static void grk::decompress_v_strip_53 ( const dwt_data< int32_t > *  vert,
uint32_t  wMin,
uint32_t  wMax,
int32_t *  bandL,
const uint32_t  strideL,
int32_t *  bandH,
const uint32_t  strideH,
int32_t *  dest,
const uint32_t  strideDest 
)
static

References decompress_v_53(), and PLL_COLS_53.

Referenced by decompress_v_mt_53().

◆ decompress_v_strip_97()

static void grk::decompress_v_strip_97 ( dwt_data< vec4f > *GRK_RESTRICT  vert,
const uint32_t  rw,
const uint32_t  rh,
float *GRK_RESTRICT  bandL,
const uint32_t  strideL,
float *GRK_RESTRICT  bandH,
const uint32_t  strideH,
float *GRK_RESTRICT  dest,
const uint32_t  strideDest 
)
static

◆ find_cf()

void grk::find_cf ( double  x,
uint32_t *  num,
uint32_t *  den 
)

References MAX.

Referenced by jp2_write_res_box().

◆ floorlog2()

template<typename T >
T grk::floorlog2 ( uint32_t  a)

Get logarithm of an integer and round downwards.

Parameters
a32 bit integer
Returns
log2(a)

◆ free_mem()

static void grk::free_mem ( void *  user_data)
static

Referenced by create_mem_stream().

◆ get_file_open_mode()

static int32_t grk::get_file_open_mode ( const char *  mode)
static

Referenced by open_fd().

◆ get_filename_ext()

static const char * grk::get_filename_ext ( const char *  filename)
static

Referenced by minpf_load_from_dir().

◆ get_mem_stream_offset()

size_t grk::get_mem_stream_offset ( grk_stream stream)

◆ getctxno_mag()

static INLINE uint32_t grk::getctxno_mag ( uint32_t  f)
static

◆ getctxno_sc()

static INLINE uint8_t grk::getctxno_sc ( uint32_t  lu)
static

References lut_ctxno_sc.

Referenced by grk::T1::enc_clnpass().

◆ getctxno_zc()

static INLINE uint8_t grk::getctxno_zc ( mqcoder mqc,
uint32_t  f 
)
static

◆ getctxtno_sc_or_spb_index()

static INLINE uint32_t grk::getctxtno_sc_or_spb_index ( uint32_t  fX,
uint32_t  pfX,
uint32_t  nfX,
uint32_t  ci 
)
static

◆ getFilterWidth()

template<class T >
constexpr T grk::getFilterWidth ( bool  lossless)
constexpr

◆ getHorizontalPassHeight()

template<class T >
constexpr T grk::getHorizontalPassHeight ( bool  lossless)
constexpr

◆ getnmsedec_ref()

static int16_t grk::getnmsedec_ref ( uint32_t  x,
uint32_t  bitpos 
)
static

◆ getnmsedec_sig()

static int16_t grk::getnmsedec_sig ( uint32_t  x,
uint32_t  bitpos 
)
static

◆ getPocSize()

uint16_t grk::getPocSize ( uint32_t  nb_comp,
uint32_t  nb_poc 
)

◆ getspb()

static INLINE uint8_t grk::getspb ( uint32_t  lu)
static

References lut_spb.

Referenced by grk::T1::enc_clnpass().

◆ getValue()

int32_t grk::getValue ( uint32_t  i)

Referenced by init_tilec(), and main().

◆ grk_aligned_alloc_n()

static void* grk::grk_aligned_alloc_n ( size_t  alignment,
size_t  size 
)
inlinestatic

References SIZE_MAX.

Referenced by grk_aligned_malloc().

◆ grk_aligned_free()

void grk::grk_aligned_free ( void *  ptr)

◆ grk_aligned_malloc()

void * grk::grk_aligned_malloc ( size_t  size)

Allocate memory aligned to a 16 byte boundary.

Parameters
sizeBytes to allocate
Returns
a void pointer to the allocated space, or nullptr if there is insufficient memory available

References default_align, and grk_aligned_alloc_n().

Referenced by grk::grk_buffer_2d< T >::alloc(), grk::dwt_data< T >::alloc(), grk::T1::allocate_buffers(), grk_image_single_component_data_alloc(), and grk::WaveletForward< DWT >::run().

◆ grk_calloc()

void * grk::grk_calloc ( size_t  numOfElements,
size_t  sizeOfElements 
)

◆ grk_copy_image_header()

static void grk::grk_copy_image_header ( const grk_image image_src,
grk_image image_dest 
)
static

◆ grk_copy_strided()

template<typename T >
void grk::grk_copy_strided ( uint32_t  w,
uint32_t  stride,
uint32_t  h,
T *  src,
int32_t *  dest 
)

Assume that source stride == source width == destination width.

◆ GRK_ERROR()

void grk::GRK_ERROR ( const char *  fmt,
  ... 
)

References log(), and grk::logger::m_logger.

Referenced by grk::TileLengthMarkers::add_to_index(), grk::grk_buffer_2d< T >::alloc(), grk::dwt_data< T >::alloc(), grk::SparseBuffer< LBW, LBH >::alloc(), grk::CodeStream::alloc_multi_tile_output_data(), grk::T1::allocate_buffers(), grk::BitIO::bytein(), grk::CodeStream::compress(), grk::T2Compress::compress_packet(), grk::T2Compress::compress_packet_simulate(), grk::T2Compress::compress_packets(), grk::T2Compress::compress_packets_simulate(), compress_synch_with_plugin(), grk::CodeStream::compress_tile(), grk::CodeStream::compress_validation(), grk::TileComponent::create_buffer(), create_mapped_file_read_stream(), create_mapped_file_write_stream(), grk::t1_ht::T1HT::decompress(), grk::FileFormat::decompress(), grk::T1::decompress_cblk(), decompress_h_mt_53(), decompress_h_mt_97(), grk::T2Decompress::decompress_packets(), decompress_partial_tile(), grk::CodeStream::decompress_tile(), grk::FileFormat::decompress_tile(), decompress_tile_53(), decompress_tile_97(), grk::TileProcessor::decompress_tile_t1(), grk::CodeStream::decompress_tile_t2(), grk::CodeStream::decompress_tiles(), decompress_v_mt_53(), decompress_v_mt_97(), grk::T1DecompressScheduler::decompressBlock(), grk::TileProcessor::do_compress(), grk::BufferedStream::flush(), grk::SOTMarker::get_sot_values(), grk_image_create(), grk_image_single_component_data_alloc(), grk::TileComponent::init(), grk::Resolution::init(), grk::TileProcessor::init(), grk::CodeStream::init_compress(), grk::FileFormat::init_compress(), j2k_add_mhmarker(), j2k_calculate_tp(), j2k_check_poc_val(), j2k_merge_ppt(), j2k_read_cap(), j2k_read_cbd(), j2k_read_coc(), j2k_read_cod(), j2k_read_com(), j2k_read_crg(), j2k_read_header_procedure(), j2k_read_mcc(), j2k_read_mco(), j2k_read_mct(), j2k_read_poc(), j2k_read_ppt(), j2k_read_qcc(), j2k_read_qcd(), j2k_read_rgn(), j2k_read_soc(), j2k_read_SPCod_SPCoc(), j2k_write_cod(), j2k_write_qcd(), jp2_apply_palette_clr(), jp2_check_color(), jp2_read_box(), jp2_read_box_hdr(), jp2_read_bpc(), jp2_read_channel_definition(), jp2_read_colr(), jp2_read_component_mapping(), jp2_read_ftyp(), jp2_read_header_procedure(), jp2_read_ihdr(), jp2_read_jp(), jp2_read_jp2h(), jp2_read_palette_clr(), jp2_read_res(), jp2_write_ftyp(), jp2_write_jp2c(), jp2_write_jp2h(), mem_map_free(), grk::PPMMarker::merge(), grk::CodeStream::need_nb_tile_parts_correction(), open_fd(), grk::CodeStream::parse_tile_header_markers(), pi_next_cprl(), pi_next_l(), pi_next_lrcp(), pi_next_pcrl(), pi_next_rlcp(), grk::CodeStream::post_write_tile(), grk::TileProcessor::pre_write_tile(), grk::TileProcessor::prepare_sod_decoding(), grk::T1DecompressScheduler::prepareScheduleDecompress(), grk::CodeStream::process_marker(), grk::SIZMarker::read(), grk::BufferedStream::read(), grk::TileLengthMarkers::read(), grk::PPMMarker::read(), grk::SOTMarker::read(), grk::FileFormat::read_header(), grk::CodeStream::read_header_procedure(), grk::SparseBuffer< LBW, LBH >::read_or_write(), grk::T2Decompress::read_packet_data(), grk::T2Decompress::read_packet_header(), grk::Quantizer::read_SQcd_SQcc(), grk::CodeStream::read_unk(), grk::PacketLengthMarkers::readPLM(), grk::PacketLengthMarkers::readPLT(), grk::WaveletForward< DWT >::run(), grk::CodeStream::set_decompress_window(), grk::Quantizer::setBandStepSizeAndBps(), update_image_dimensions(), and grk::CodeStream::write_tile_part().

◆ grk_free()

void grk::grk_free ( void *  m)

◆ grk_get_all_encoding_parameters()

static void grk::grk_get_all_encoding_parameters ( const grk_image p_image,
const CodingParams p_cp,
uint16_t  tileno,
uint32_t *  tx0,
uint32_t *  tx1,
uint32_t *  ty0,
uint32_t *  ty1,
uint32_t *  dx_min,
uint32_t *  dy_min,
uint64_t *  max_precincts,
uint8_t *  max_res,
uint32_t **  p_resolutions 
)
static

Gets the compressing parameters needed to update the coding parameters and all the pocs.

The precinct widths, heights, dx and dy for each component at each resolution will be stored as well. the last parameter of the function should be an array of pointers of size nb components, each pointer leading to an area of size 4 * max_res. The data is stored inside this area with the following pattern : dx_compi_res0 , dy_compi_res0 , w_compi_res0, h_compi_res0 , dx_compi_res1 , dy_compi_res1 , w_compi_res1, h_compi_res1 , ...

Parameters
p_imagethe image being encoded.
p_cpthe coding parameters.
tilenothe tile index of the tile being encoded.
tx0X0 parameter for the tile
tx1X1 parameter for the tile
ty0Y0 parameter for the tile
ty1Y1 parameter for the tile
max_precinctsmaximum number of precincts for all the bands of the tile
max_resmaximum number of resolutions for all the poc inside the tile.
dx_minminimum dx of all the components of all the resolutions for the tile.
dy_minminimum dy of all the components of all the resolutions for the tile.
p_resolutionspointer to an area corresponding to the one described above.

References _grk_image::comps, _grk_image::numcomps, grk::CodingParams::t_grid_height, grk::CodingParams::t_grid_width, grk::CodingParams::t_height, grk::CodingParams::t_width, grk::TileCodingParams::tccps, grk::CodingParams::tcps, grk::CodingParams::tx0, grk::CodingParams::ty0, uint_floordivpow2(), _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.

Referenced by pi_create_compress(), and pi_create_decompress().

◆ grk_get_encoding_parameters()

static void grk::grk_get_encoding_parameters ( const grk_image p_image,
const CodingParams p_cp,
uint16_t  tileno,
uint32_t *  tx0,
uint32_t *  tx1,
uint32_t *  ty0,
uint32_t *  ty1,
uint32_t *  dx_min,
uint32_t *  dy_min,
uint64_t *  max_precincts,
uint8_t *  max_res 
)
static

Gets the compressing parameters needed to update the coding parameters and all the pocs.

Parameters
p_imagethe image being encoded.
p_cpthe coding parameters.
tilenothe tile index of the tile being encoded.
tx0X0 parameter for the tile
tx1X1 parameter for the tile
ty0Y0 parameter for the tile
ty1Y1 parameter for the tile
max_precinctsmaximum number of precincts for all the bands of the tile
max_resmaximum number of resolutions for all the poc inside the tile.
dx_minminimum dx of all the components of all the resolutions for the tile.
dy_minminimum dy of all the components of all the resolutions for the tile.

References _grk_image::comps, _grk_image::numcomps, grk::CodingParams::t_grid_height, grk::CodingParams::t_grid_width, grk::CodingParams::t_height, grk::CodingParams::t_width, grk::CodingParams::tcps, grk::CodingParams::tx0, grk::CodingParams::ty0, uint_floordivpow2(), _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.

Referenced by pi_update_encoding_parameters().

◆ grk_image_create0()

grk_image* grk::grk_image_create0 ( void  )

◆ grk_image_single_component_data_alloc()

bool grk::grk_image_single_component_data_alloc ( grk_image_comp image)

◆ GRK_INFO()

void grk::GRK_INFO ( const char *  fmt,
  ... 
)

◆ grk_make_aligned_width()

uint32_t grk::grk_make_aligned_width ( uint32_t  width)

◆ grk_malloc()

void * grk::grk_malloc ( size_t  size)

◆ grk_map()

static void* grk::grk_map ( grk_handle  fd,
size_t  len,
bool  do_read 
)
static

◆ grk_read() [1/2]

template<typename TYPE >
void grk::grk_read ( const uint8_t *  p_buffer,
TYPE *  value 
)

◆ grk_read() [2/2]

template<typename TYPE >
void grk::grk_read ( const uint8_t *  p_buffer,
TYPE *  value,
uint32_t  nb_bytes 
)

Referenced by jp2_read_bpc().

◆ grk_realloc()

void * grk::grk_realloc ( void *  m,
size_t  s 
)

Reallocate memory blocks.

Parameters
mPointer to previously allocated memory block
sNew size in bytes
Returns
a void pointer to the reallocated (and possibly moved) memory block

Referenced by grk::TileLengthMarkers::add_to_index(), grk::t1_part1::T1Part1::decompress(), j2k_add_mhmarker(), j2k_init_mct_encoding(), j2k_read_mcc(), j2k_read_mct(), j2k_read_ppt(), jp2_read_header_procedure(), grk::CodeStream::process_marker(), grk::PPMMarker::read(), and grk::SOTMarker::read().

◆ grk_stream_set_zero_copy_read_function()

static void grk::grk_stream_set_zero_copy_read_function ( grk_stream stream,
grk_stream_zero_copy_read_fn  p_function 
)
static

Set the given function to be used as a zero copy read function.

NOTE: this feature is only available for memory mapped and buffer backed streams, not file streams

Parameters
streamstream to modify
p_functionfunction to use as read function.

References GROK_STREAM_STATUS_INPUT.

Referenced by set_up_mem_stream().

◆ grk_update_image_comp_header_from_coding_params()

static void grk::grk_update_image_comp_header_from_coding_params ( grk_image image_header,
const CodingParams p_cp 
)
static

Updates the components characteristics of the image from the coding parameters.

Parameters
image_headerthe image header to update.
p_cpthe coding parameters from which to update the image.

References _grk_image::comps, grk::CodingParams::m_coding_params, grk::CodingParams::m_dec, grk::DecodingParams::m_reduce, _grk_image::numcomps, grk::CodingParams::t_grid_height, grk::CodingParams::t_grid_width, grk::CodingParams::t_height, grk::CodingParams::t_width, grk::CodingParams::tx0, grk::CodingParams::ty0, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.

Referenced by grk::SIZMarker::read().

◆ GRK_WARN()

void grk::GRK_WARN ( const char *  fmt,
  ... 
)

◆ grk_write() [1/2]

template<typename TYPE >
void grk::grk_write ( uint8_t *  p_buffer,
TYPE  value 
)

◆ grk_write() [2/2]

template<typename TYPE >
void grk::grk_write ( uint8_t *  p_buffer,
TYPE  value,
uint32_t  nb_bytes 
)

◆ init_tilec()

bool grk::init_tilec ( TileComponent tilec,
uint32_t  x0,
uint32_t  y0,
uint32_t  x1,
uint32_t  y1,
uint32_t  numresolutions,
grk_image output_image 
)

◆ int_fix_mul()

static int32_t grk::int_fix_mul ( int32_t  a,
int32_t  b 
)
inlinestatic

Multiply two fixed-point numbers.

Parameters
aN-bit precision fixed point number
b13-bit precision fixed point number
Returns
a * b in N-bit precision fixed point

Referenced by grk::mct::compress_custom(), and grk::dwt97::compress_line().

◆ interleave_h_97()

static void grk::interleave_h_97 ( dwt_data< vec4f > *GRK_RESTRICT  dwt,
float *GRK_RESTRICT  bandL,
const uint32_t  strideL,
float *GRK_RESTRICT  bandH,
const uint32_t  strideH,
uint32_t  remaining_height 
)
static

◆ interleave_v_97()

static void grk::interleave_v_97 ( dwt_data< vec4f > *GRK_RESTRICT  dwt,
float *GRK_RESTRICT  bandL,
const uint32_t  strideL,
float *GRK_RESTRICT  bandH,
const uint32_t  strideH,
uint32_t  nb_elts_read 
)
static

◆ j2k_add_mct()

bool grk::j2k_add_mct ( TileCodingParams p_tcp,
grk_image p_image,
uint32_t  index 
)

◆ j2k_add_mhmarker()

bool grk::j2k_add_mhmarker ( grk_codestream_index cstr_index,
uint32_t  type,
uint64_t  pos,
uint32_t  len 
)

Add main header marker information.

Parameters
cstr_indexCodestream information structure
typemarker type
posbyte offset of marker segment
lenlength of marker segment

References GRK_ERROR(), grk_free(), grk_realloc(), _grk_marker_info::len, _grk_codestream_index::marker, _grk_codestream_index::marknum, _grk_codestream_index::maxmarknum, _grk_marker_info::pos, and _grk_marker_info::type.

Referenced by j2k_read_soc(), grk::CodeStream::read_header_procedure(), and grk::CodeStream::read_unk().

◆ j2k_allocate_tile_element_cstr_index()

bool grk::j2k_allocate_tile_element_cstr_index ( CodeStream codeStream)

◆ j2k_calculate_tp()

static bool grk::j2k_calculate_tp ( CodingParams cp,
uint16_t *  p_nb_tile_parts,
grk_image image 
)
static

Calculates the total number of tile parts needed by the compressor to compress such an image.

If not enough memory is available, then the function return false.

Parameters
cpcoding parameters for the image.
p_nb_tile_partstotal number of tile parts in whole image.
imageimage to compress.
Returns
true if the function was successful, false else.

References GRK_ERROR(), j2k_get_num_tp(), max_num_tile_parts, max_num_tile_parts_per_tile, pi_update_encoding_parameters(), grk::CodingParams::t_grid_height, grk::CodingParams::t_grid_width, and grk::CodingParams::tcps.

Referenced by j2k_init_info().

◆ j2k_check_poc_val()

bool grk::j2k_check_poc_val ( const grk_poc p_pocs,
uint32_t  nb_pocs,
uint32_t  nb_resolutions,
uint32_t  numcomps,
uint32_t  numlayers 
)
static

Checks the progression order changes values.

Tells of the poc given as input are valid. A nice message is outputted at errors.

Parameters
p_pocsthe progression order changes.
nb_pocsthe number of progression order changes.
nb_resolutionsthe number of resolutions.
numcompsthe number of components
numlayersthe number of layers.
Returns
true if the pocs are valid.

References _grk_poc::compno0, _grk_poc::compno1, GRK_ERROR(), _grk_poc::layno1, _grk_poc::resno0, and _grk_poc::resno1.

Referenced by grk::CodeStream::init_compress().

◆ j2k_compare_coc()

bool grk::j2k_compare_coc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compares 2 COC markers (Coding style component)

Parameters
codeStreamJPEG 2000 code stream
first_comp_nothe index of the first component to compare.
second_comp_nothe index of the second component to compare.
Returns
true if equals

References j2k_compare_SPCod_SPCoc(), and grk::CodeStream::m_cp.

Referenced by j2k_write_all_coc().

◆ j2k_compare_qcc()

bool grk::j2k_compare_qcc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compare QCC markers (quantization component)

Parameters
codeStreamJPEG 2000 code stream
first_comp_nothe index of the first component to compare.
second_comp_nothe index of the second component to compare.
Returns
true if equals.

References j2k_compare_SQcd_SQcc().

Referenced by j2k_write_all_qcc().

◆ j2k_compare_SPCod_SPCoc()

bool grk::j2k_compare_SPCod_SPCoc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compare 2 a SPCod/ SPCoc elements, i.e.

the coding style of a given component of a tile.

Parameters
codeStreamJPEG 2000 code stream
first_comp_noThe 1st component number to compare.
second_comp_noThe 1st component number to compare.
Returns
true if SPCdod are equals.

References J2K_CCP_CSTY_PRT, and grk::CodeStream::m_cp.

Referenced by j2k_compare_coc().

◆ j2k_compare_SQcd_SQcc()

bool grk::j2k_compare_SQcd_SQcc ( CodeStream codeStream,
uint32_t  first_comp_no,
uint32_t  second_comp_no 
)

Compares 2 SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamJPEG 2000 code stream
first_comp_nothe first component number to compare.
second_comp_nothe second component number to compare.
Returns
true if equals.

References grk::CodeStream::m_cp.

Referenced by j2k_compare_qcc().

◆ j2k_compress_validation()

static bool grk::j2k_compress_validation ( CodeStream codeStream)
static

The default compressing validation procedure without any extension.

Parameters
codeStreamJPEG 2000 code stream
Returns
true if the parameters are correct.

References grk::CodeStream::compress_validation().

Referenced by grk::CodeStream::start_compress().

◆ j2k_convert_progression_order()

char * grk::j2k_convert_progression_order ( GRK_PROG_ORDER  prg_order)

Converts an enum type progression order to string type.

References grk::j2k_prog_order::enum_prog, j2k_prog_order_list, and grk::j2k_prog_order::str_prog.

Referenced by j2k_get_num_tp(), and pi_enable_tile_part_generation().

◆ j2k_copy_default_tcp()

static bool grk::j2k_copy_default_tcp ( CodeStream codeStream)
static

Copies the decoding tile parameters onto all the tile parameters.

Creates also the tile decompressor.

Parameters
codeStreamJPEG 2000 code stream
codeStreamcode stream
Returns

References grk::CodeStream::copy_default_tcp().

Referenced by grk::CodeStream::read_header().

◆ j2k_copy_tile_component_parameters()

static void grk::j2k_copy_tile_component_parameters ( CodeStream codeStream)
static

Copies the tile component parameters of all the component from the first tile component.

Parameters
codeStreamthe J2k codec.

References grk::CodeStream::get_current_decode_tcp(), grk::CodeStream::m_input_image, _grk_image::numcomps, grk::TileComponentCodingParams::numresolutions, and grk::TileCodingParams::tccps.

Referenced by j2k_read_cod().

◆ j2k_create_cstr_index()

grk_codestream_index * grk::j2k_create_cstr_index ( void  )

References grk_calloc(), and grk_free().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_decompress_tile() [1/2]

static bool grk::j2k_decompress_tile ( CodeStream codeStream)
static

◆ j2k_decompress_tile() [2/2]

bool grk::j2k_decompress_tile ( CodeStream codeStream,
grk_image p_image,
uint16_t  tile_index 
)

◆ j2k_decompress_tiles()

static bool grk::j2k_decompress_tiles ( CodeStream codeStream)
static

Read the tiles.

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::decompress_tiles().

Referenced by grk::CodeStream::decompress().

◆ j2k_decompress_validation()

static bool grk::j2k_decompress_validation ( CodeStream codeStream)
static

The default decoding validation procedure without any extension.

Parameters
codeStreamJPEG 2000 code stream
Returns
true if the parameters are correct.

References grk::CodeStream::decompress_validation().

Referenced by grk::CodeStream::read_header().

◆ j2k_destroy_cstr_index()

void grk::j2k_destroy_cstr_index ( grk_codestream_index p_cstr_ind)

Destroys a code stream index structure.

Parameters
p_cstr_indthe code stream index parameter to destroy.

References grk_free(), _grk_tile_index::marker, _grk_codestream_index::marker, _grk_codestream_index::nb_of_tiles, _grk_codestream_index::tile_index, and _grk_tile_index::tp_index.

Referenced by grk_destroy_cstr_index(), and grk::CodeStream::~CodeStream().

◆ j2k_dump()

void grk::j2k_dump ( CodeStream codeStream,
int32_t  flag,
FILE *  out_stream 
)

Dump some elements from the J2K decompression structure .

Parameters
codeStreamJPEG 2000 code stream
flagflag to describe what elements are dumped.
out_streamoutput stream where dump the elements.

References GRK_IMG_INFO, GRK_J2K_MH_IND, GRK_J2K_MH_INFO, GRK_J2K_TCH_INFO, GRK_J2K_TH_IND, GRK_J2K_TH_INFO, GRK_JP2_IND, GRK_JP2_INFO, j2k_dump_image_header(), j2k_dump_MH_index(), j2k_dump_MH_info(), j2k_dump_tile_info(), grk::CodeStream::m_cp, grk::CodeStream::m_input_image, _grk_image::numcomps, grk::CodingParams::t_grid_height, grk::CodingParams::t_grid_width, and grk::CodingParams::tcps.

Referenced by grk::CodeStream::dump(), grk::FileFormat::dump(), and jp2_dump().

◆ j2k_dump_image_comp_header()

void grk::j2k_dump_image_comp_header ( grk_image_comp comp,
bool  dev_dump_flag,
FILE *  out_stream 
)

Dump a component image header structure.

Parameters
compthe component image header to dump.
dev_dump_flagflag to describe if we are in the case of this function is use outside j2k_dump function
out_streamoutput stream where dump the elements.

References _grk_image_comp::dx, _grk_image_comp::dy, _grk_image_comp::prec, and _grk_image_comp::sgnd.

Referenced by j2k_dump_image_header().

◆ j2k_dump_image_header()

void grk::j2k_dump_image_header ( grk_image image,
bool  dev_dump_flag,
FILE *  out_stream 
)

Dump an image header structure.

Parameters
imagethe image header to dump.
dev_dump_flagflag to describe if we are in the case of this function is use outside j2k_dump function
out_streamoutput stream where dump the elements.

References _grk_image::comps, j2k_dump_image_comp_header(), _grk_image::numcomps, _grk_image::x0, _grk_image::x1, _grk_image::y0, and _grk_image::y1.

Referenced by j2k_dump().

◆ j2k_dump_MH_index()

static void grk::j2k_dump_MH_index ( CodeStream codeStream,
FILE *  out_stream 
)
static

References grk::CodeStream::cstr_index.

Referenced by j2k_dump().

◆ j2k_dump_MH_info()

static void grk::j2k_dump_MH_info ( CodeStream codeStream,
FILE *  out_stream 
)
static

◆ j2k_dump_tile_info()

static void grk::j2k_dump_tile_info ( TileCodingParams default_tile,
uint32_t  numcomps,
FILE *  out_stream 
)
static

◆ j2k_end_encoding()

static bool grk::j2k_end_encoding ( CodeStream codeStream)
static

Ends the compressing, i.e.

frees memory.

Parameters
codeStreamJPEG 2000 code stream

Referenced by grk::CodeStream::end_compress().

◆ j2k_get_cstr_index()

grk_codestream_index * grk::j2k_get_cstr_index ( CodeStream codeStream)

◆ j2k_get_cstr_info()

grk_codestream_info_v2 * grk::j2k_get_cstr_info ( CodeStream codeStream)

◆ j2k_get_end_header()

static bool grk::j2k_get_end_header ( CodeStream codeStream)
static

Gets the offset of the header.

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::get_end_header().

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_get_num_tp()

static uint64_t grk::j2k_get_num_tp ( CodingParams cp,
uint32_t  pino,
uint16_t  tileno 
)
static

Gets the number of tile parts used for the given change of progression (if any) and the given tile.

Parameters
cpthe coding parameters.
pinothe offset of the given poc (i.e. its position in the coding parameter).
tilenothe given tile.
Returns
the number of tile parts.

References j2k_convert_progression_order(), grk::CodingParams::m_coding_params, grk::CodingParams::m_enc, grk::EncodingParams::m_tp_flag, grk::EncodingParams::m_tp_on, grk::EncodingParams::m_tp_pos, grk::TileCodingParams::numpocs, grk::CodingParams::t_grid_height, grk::CodingParams::t_grid_width, and grk::CodingParams::tcps.

Referenced by j2k_calculate_tp(), and grk::CodeStream::post_write_tile().

◆ j2k_get_SPCod_SPCoc_size()

uint32_t grk::j2k_get_SPCod_SPCoc_size ( CodeStream codeStream,
uint32_t  comp_no 
)

Gets the size taken by writing a SPCod or SPCoc for the given tile and component.

Parameters
codeStreamthe JPEG 2000 code stream
comp_nothe component being outputted.
Returns
the number of bytes taken by the SPCod element.

References J2K_CCP_CSTY_PRT, grk::CodeStream::m_cp, and SPCod_SPCoc_len.

Referenced by j2k_write_coc(), and j2k_write_cod().

◆ j2k_get_SQcd_SQcc_size()

uint32_t grk::j2k_get_SQcd_SQcc_size ( CodeStream codeStream,
uint32_t  comp_no 
)

Gets the size taken by writing SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamthe JPEG 2000 code stream
comp_nothe component being output.
Returns
the number of bytes taken by the SPCod element.

References grk::CodeStream::m_cp.

Referenced by j2k_write_qcc(), and j2k_write_qcd().

◆ j2k_init_info()

static bool grk::j2k_init_info ( CodeStream codeStream)
static

◆ j2k_init_mct_encoding()

bool grk::j2k_init_mct_encoding ( TileCodingParams p_tcp,
grk_image p_image 
)

◆ j2k_mct_validation()

static bool grk::j2k_mct_validation ( CodeStream codeStream)
static

The mct compressing validation procedure.

Parameters
codeStreamJPEG 2000 code stream
Returns
true if the parameters are correct.

References grk::CodeStream::mct_validation().

Referenced by grk::CodeStream::start_compress().

◆ j2k_merge_ppm()

bool grk::j2k_merge_ppm ( CodingParams p_cp)

Merges all PPM markers read (Packed headers, main header)

Parameters
p_cpmain coding parameters.

References grk::PPMMarker::merge(), and grk::CodingParams::ppm_marker.

Referenced by grk::CodeStream::read_header_procedure().

◆ j2k_merge_ppt()

bool grk::j2k_merge_ppt ( TileCodingParams p_tcp)

◆ j2k_read_cap()

bool grk::j2k_read_cap ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a CAP marker.

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodingParams::ccap, GRK_ERROR(), grk::CodeStream::m_cp, grk::CodingParams::pcap, and ojph::population_count().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_cbd()

bool grk::j2k_read_cbd ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a CBD marker (Component bit depth definition)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References _grk_image::comps, GRK_ERROR(), grk::CodeStream::m_input_image, _grk_image::numcomps, and _grk_image_comp::sgnd.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_coc()

bool grk::j2k_read_coc ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a COC marker (Coding Style Component)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::get_current_decode_tcp(), GRK_ERROR(), j2k_read_SPCod_SPCoc(), grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_cod()

bool grk::j2k_read_cod ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a COD marker (Coding Style defaults)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References cod_coc_len, grk::CodeStream::get_current_decode_tcp(), GRK_CPRL, GRK_ERROR(), GRK_WARN(), J2K_CCP_CSTY_PRT, j2k_copy_tile_component_parameters(), J2K_CP_CSTY_EPH, J2K_CP_CSTY_PRT, J2K_CP_CSTY_SOP, j2k_read_SPCod_SPCoc(), grk::CodeStream::m_cp, and grk::CodeStream::m_input_image.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_com()

bool grk::j2k_read_com ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a COM marker (comments)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodingParams::comment, grk::CodingParams::comment_len, GRK_ERROR(), GRK_NUM_COMMENTS_SUPPORTED, GRK_WARN(), grk::CodingParams::isBinaryComment, grk::CodeStream::m_cp, and grk::CodingParams::num_comments.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_crg()

bool grk::j2k_read_crg ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a CRG marker (Component registration)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References _grk_image::comps, GRK_ERROR(), grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_float32_to_float()

void grk::j2k_read_float32_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_float32_to_int32()

void grk::j2k_read_float32_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_float64_to_float()

void grk::j2k_read_float64_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_float64_to_int32()

void grk::j2k_read_float64_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_header_procedure()

static bool grk::j2k_read_header_procedure ( CodeStream codeStream)
static

The read header procedure.

Parameters
codeStreamJPEG 2000 code stream

References GRK_ERROR(), grk::InvalidMarkerException::m_marker, and grk::CodeStream::read_header_procedure().

Referenced by grk::CodeStream::read_header().

◆ j2k_read_int16_to_float()

void grk::j2k_read_int16_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_int16_to_int32()

void grk::j2k_read_int16_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_int32_to_float()

void grk::j2k_read_int32_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_int32_to_int32()

void grk::j2k_read_int32_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_read_mcc()

bool grk::j2k_read_mcc ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a MCC marker (Multiple Component Collection)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

NOT FOUND

References default_number_mcc_records, grk::CodeStream::get_current_decode_tcp(), GRK_ERROR(), grk_free(), grk_realloc(), and GRK_WARN().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_mco()

bool grk::j2k_read_mco ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a MCO marker (Multiple Component Transform Ordering)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data.
header_sizesize of header data

References grk::CodeStream::get_current_decode_tcp(), GRK_ERROR(), grk_free(), GRK_WARN(), j2k_add_mct(), and grk::CodeStream::m_input_image.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_mct()

bool grk::j2k_read_mct ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a MCT marker (Multiple Component Transform)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References default_number_mct_records, grk::CodeStream::get_current_decode_tcp(), GRK_ERROR(), grk_free(), grk_malloc(), grk_realloc(), GRK_WARN(), grk::grk_simple_mcc_decorrelation_data::m_decorrelation_array, and grk::grk_simple_mcc_decorrelation_data::m_offset_array.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_plm()

bool grk::j2k_read_plm ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PLM marker (Packet length, main header marker)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::m_cp, grk::CodingParams::plm_markers, and grk::PacketLengthMarkers::readPLM().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_plt()

bool grk::j2k_read_plt ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PLT marker (Packet length, tile-part header)

Parameters
codeStreamJPEG 2000 code stream
p_header_datathe data contained in the PLT box.
header_sizethe size of the data contained in the PLT marker.
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::currentProcessor().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_poc()

bool grk::j2k_read_poc ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a POC marker (Progression Order Change)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::get_current_decode_tcp(), GRK_ERROR(), GRK_J2K_MAXRLVLS, GRK_NUM_PROGRESSION_ORDERS, grk::CodeStream::m_input_image, grk::TileComponentCodingParams::numresolutions, and grk::TileCodingParams::tccps.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_ppm()

bool grk::j2k_read_ppm ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PPM marker (Packed packet headers, main header)

Reads a PPM marker (Packed headers, main header)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::m_cp, grk::CodingParams::ppm_marker, and grk::PPMMarker::read().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_ppt()

bool grk::j2k_read_ppt ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a PPT marker (Packed packet headers, tile-part header)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::currentProcessor(), grk_calloc(), GRK_ERROR(), grk_malloc(), grk_realloc(), and grk::CodeStream::m_cp.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_qcc()

bool grk::j2k_read_qcc ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a QCC marker (Quantization component)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References GRK_ERROR(), j2k_read_SQcd_SQcc(), grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_qcd()

bool grk::j2k_read_qcd ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a QCD marker (Quantization defaults)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::Quantizer::apply_quant(), grk::CodeStream::get_current_decode_tcp(), GRK_ERROR(), j2k_read_SQcd_SQcc(), grk::CodeStream::m_input_image, _grk_image::numcomps, grk::TileComponentCodingParams::quant, and grk::TileCodingParams::tccps.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_rgn()

bool grk::j2k_read_rgn ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a RGN marker (Region Of Interest)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::get_current_decode_tcp(), GRK_ERROR(), grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_siz()

bool grk::j2k_read_siz ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a SIZ marker (image and tile size)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::SIZMarker::read().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_soc()

bool grk::j2k_read_soc ( CodeStream codeStream)

◆ j2k_read_sot()

bool grk::j2k_read_sot ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Read SOT (Start of tile part) marker.

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data
codeStreamJPEG 2000 code stream
p_header_dataheader data.
header_sizesize of header data

References grk::SOTMarker::read().

Referenced by grk::CodeStream::CodeStream().

◆ j2k_read_SPCod_SPCoc()

bool grk::j2k_read_SPCod_SPCoc ( CodeStream codeStream,
uint32_t  compno,
uint8_t *  p_header_data,
uint16_t *  header_size 
)

Reads a SPCod or SPCoc element, i.e.

the coding style of a given component of a tile.

Parameters
codeStreamJPEG 2000 code stream
compnocomponent number
p_header_datathe data contained in the COM box.
header_sizethe size of the data contained in the COM marker.

References _grk_image::comps, grk::CodeStream::get_current_decode_tcp(), GRK_CBLKSTY_HT, GRK_ERROR(), GRK_J2K_MAX_DECOMP_LVLS, J2K_CCP_CSTY_PRT, J2K_DEC_STATE_ERR, grk::CodeStream::m_cp, grk::CodeStream::m_decompressor, grk::CodeStream::m_input_image, grk::DecoderState::m_state, _grk_image::numcomps, grk::CodingParams::pcap, _grk_image_comp::prec, _grk_image_comp::sgnd, SPCod_SPCoc_len, and grk::TileCodingParams::tccps.

Referenced by j2k_read_coc(), and j2k_read_cod().

◆ j2k_read_SQcd_SQcc()

bool grk::j2k_read_SQcd_SQcc ( CodeStream codeStream,
bool  fromQCC,
uint32_t  compno,
uint8_t *  p_header_data,
uint16_t *  header_size 
)

Reads a SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamJPEG 2000 code stream
fromQCCtrue if reading QCC, otherwise false (reading QCD)
compnothe component number to output.
p_header_datathe data buffer.
header_sizepointer to the size of the data buffer, it is changed by the function.

References grk::CodeStream::get_current_decode_tcp(), grk::TileComponentCodingParams::quant, grk::Quantizer::read_SQcd_SQcc(), and grk::TileCodingParams::tccps.

Referenced by j2k_read_qcc(), and j2k_read_qcd().

◆ j2k_read_tlm()

bool grk::j2k_read_tlm ( CodeStream codeStream,
uint8_t *  p_header_data,
uint16_t  header_size 
)

Reads a TLM marker (Tile Length Marker)

Parameters
codeStreamJPEG 2000 code stream
p_header_dataheader data
header_sizesize of header data

References grk::CodeStream::m_cp, grk::TileLengthMarkers::read(), and grk::CodingParams::tlm_markers.

Referenced by grk::CodeStream::CodeStream().

◆ j2k_update_rates()

static bool grk::j2k_update_rates ( CodeStream codeStream)
static

Updates the rates of the tcp.

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::update_rates().

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_update_tlm()

void grk::j2k_update_tlm ( CodeStream codeStream,
uint16_t  tile_index,
uint32_t  tile_part_size 
)

◆ j2k_write()

template<typename S , typename D >
void grk::j2k_write ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

References D, and S.

◆ j2k_write_all_coc()

bool grk::j2k_write_all_coc ( CodeStream codeStream)

Writes COC marker for each component.

Parameters
codeStreamJPEG 2000 code stream

References j2k_compare_coc(), j2k_write_coc(), grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_all_qcc()

bool grk::j2k_write_all_qcc ( CodeStream codeStream)

Writes QCC marker for each component.

Parameters
codeStreamJPEG 2000 code stream

References j2k_compare_qcc(), j2k_write_qcc(), grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_cap()

bool grk::j2k_write_cap ( CodeStream codeStream)

Writes the CAP marker.

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), J2K_MS_CAP, and grk::CodeStream::m_cp.

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_cbd()

bool grk::j2k_write_cbd ( CodeStream codeStream)

Writes the CBD marker (Component bit depth definition)

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), J2K_MS_CBD, grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by j2k_write_mct_data_group().

◆ j2k_write_coc() [1/2]

bool grk::j2k_write_coc ( CodeStream codeStream,
uint32_t  comp_no 
)

◆ j2k_write_coc() [2/2]

bool grk::j2k_write_coc ( CodeStream codeStream,
uint32_t  comp_no,
BufferedStream stream 
)

Writes the COC marker (Coding style component)

Parameters
codeStreamJPEG 2000 code stream
comp_nothe index of the component to output.
streambuffered stream.

◆ j2k_write_cod()

bool grk::j2k_write_cod ( CodeStream codeStream)

Writes the COD marker (Coding style default)

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), GRK_ERROR(), j2k_get_SPCod_SPCoc_size(), J2K_MS_COD, j2k_write_SPCod_SPCoc(), and grk::CodeStream::m_cp.

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_com()

bool grk::j2k_write_com ( CodeStream codeStream)

◆ j2k_write_eoc()

bool grk::j2k_write_eoc ( CodeStream codeStream)

Writes the EOC marker (End of Codestream)

Parameters
codeStreamJPEG 2000 code stream

References grk::BufferedStream::flush(), grk::CodeStream::getStream(), and J2K_MS_EOC.

Referenced by grk::CodeStream::end_compress().

◆ j2k_write_epc()

bool grk::j2k_write_epc ( CodeStream codeStream)

Writes EPC ????

Parameters
codeStreamJPEG 2000 code stream

References _grk_codestream_index::codestream_size, grk::CodeStream::cstr_index, and grk::CodeStream::getStream().

Referenced by grk::CodeStream::end_compress().

◆ j2k_write_float_to_float()

void grk::j2k_write_float_to_float ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_float_to_float64()

void grk::j2k_write_float_to_float64 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_float_to_int16()

void grk::j2k_write_float_to_int16 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_float_to_int32()

void grk::j2k_write_float_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
uint64_t  nb_elem 
)

◆ j2k_write_mcc_record()

bool grk::j2k_write_mcc_record ( grk_simple_mcc_decorrelation_data p_mcc_record,
BufferedStream stream 
)

◆ j2k_write_mco()

bool grk::j2k_write_mco ( CodeStream codeStream)

Writes the MCO marker (Multiple component transformation ordering)

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), J2K_MS_MCO, grk::CodeStream::m_cp, and grk::CodingParams::tcps.

Referenced by j2k_write_mct_data_group().

◆ j2k_write_mct_data_group()

bool grk::j2k_write_mct_data_group ( CodeStream codeStream)

Writes the CBD-MCT-MCC-MCO markers (Multi components transform)

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), j2k_write_cbd(), j2k_write_mcc_record(), j2k_write_mco(), j2k_write_mct_record(), grk::CodeStream::m_cp, and grk::CodingParams::tcps.

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_mct_record()

bool grk::j2k_write_mct_record ( grk_mct_data p_mct_record,
BufferedStream stream 
)

◆ j2k_write_poc()

bool grk::j2k_write_poc ( CodeStream codeStream)

◆ j2k_write_qcc() [1/2]

bool grk::j2k_write_qcc ( CodeStream codeStream,
uint16_t  tile_index,
uint32_t  comp_no,
BufferedStream stream 
)

Writes the QCC marker (quantization component)

Parameters
codeStreamJPEG 2000 code stream
tile_indexcurrent tile index
comp_nothe index of the component to output.
streambuffered stream.

◆ j2k_write_qcc() [2/2]

bool grk::j2k_write_qcc ( CodeStream codeStream,
uint32_t  comp_no 
)

◆ j2k_write_qcd()

bool grk::j2k_write_qcd ( CodeStream codeStream)

Writes the QCD marker (quantization default)

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), GRK_ERROR(), j2k_get_SQcd_SQcc_size(), J2K_MS_QCD, and j2k_write_SQcd_SQcc().

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_regions()

bool grk::j2k_write_regions ( CodeStream codeStream)

◆ j2k_write_rgn()

bool grk::j2k_write_rgn ( CodeStream codeStream,
uint16_t  tile_no,
uint32_t  comp_no,
uint32_t  nb_comps 
)

Writes the RGN marker (Region Of Interest)

Parameters
tile_nothe tile to output
comp_nothe component to output
nb_compsthe number of components
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), J2K_MS_RGN, grk::CodeStream::m_cp, and grk::BufferedStream::write_byte().

Referenced by j2k_write_regions().

◆ j2k_write_siz()

bool grk::j2k_write_siz ( CodeStream codeStream)

Writes the SIZ marker (image and tile size)

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), and grk::SIZMarker::write().

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_soc()

bool grk::j2k_write_soc ( CodeStream codeStream)

Writes the SOC marker (Start Of Codestream)

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::getStream(), and J2K_MS_SOC.

Referenced by grk::CodeStream::init_header_writing().

◆ j2k_write_SPCod_SPCoc()

bool grk::j2k_write_SPCod_SPCoc ( CodeStream codeStream,
uint32_t  comp_no 
)

Writes a SPCod or SPCoc element, i.e.

the coding style of a given component of a tile.

Parameters
codeStreamJPEG 2000 code stream
comp_nothe component number to output.
Returns
true if successful

References grk::CodeStream::getStream(), J2K_CCP_CSTY_PRT, grk::CodeStream::m_cp, grk::CodeStream::m_input_image, and _grk_image::numcomps.

Referenced by j2k_write_coc(), and j2k_write_cod().

◆ j2k_write_SQcd_SQcc()

bool grk::j2k_write_SQcd_SQcc ( CodeStream codeStream,
uint32_t  comp_no 
)

Writes a SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
codeStreamJPEG 2000 code stream
comp_nothe component number to output.

References grk::CodeStream::getStream(), and grk::CodeStream::m_cp.

Referenced by j2k_write_qcc(), and j2k_write_qcd().

◆ j2k_write_tlm_begin()

bool grk::j2k_write_tlm_begin ( CodeStream codeStream)

◆ j2k_write_tlm_end()

bool grk::j2k_write_tlm_end ( CodeStream codeStream)

End writing the updated tlm.

Parameters
codeStreamJPEG 2000 code stream

References grk::CodeStream::m_cp, grk::CodingParams::tlm_markers, and grk::TileLengthMarkers::write_end().

Referenced by grk::CodeStream::end_compress().

◆ jp2_apply_channel_definition()

static void grk::jp2_apply_channel_definition ( grk_image image,
grk_jp2_color color 
)
static

◆ jp2_apply_palette_clr()

static bool grk::jp2_apply_palette_clr ( grk_image image,
grk_jp2_color color 
)
static

◆ jp2_check_color()

static bool grk::jp2_check_color ( grk_image image,
grk_jp2_color color 
)
static

◆ jp2_default_validation()

static bool grk::jp2_default_validation ( FileFormat fileFormat)
static

◆ jp2_dump()

void grk::jp2_dump ( FileFormat fileFormat,
int32_t  flag,
FILE *  out_stream 
)

Dump some elements from the JP2 decompression structure .

Parameters
fileFormatthe jp2 codec.
flagflag to describe what elements are dump.
out_streamoutput stream where dump the elements.

References grk::FileFormat::codeStream, and j2k_dump().

◆ jp2_exec()

static bool grk::jp2_exec ( FileFormat fileFormat,
std::vector< jp2_procedure > *  procs 
)
static

Executes the given procedures on the given codec.

Parameters
fileFormatJPEG 2000 code stream to execute the procedures on.
procsthe list of procedures to execute
Returns
true if all the procedures were successfully executed.

Referenced by grk::FileFormat::end_compress(), grk::FileFormat::end_decompress(), grk::FileFormat::read_header(), and grk::FileFormat::start_compress().

◆ jp2_find_handler()

static const grk_jp2_header_handler * grk::jp2_find_handler ( uint32_t  id)
static

Finds the execution function related to the given box id.

Parameters
idthe id of the handler to fetch.
Returns
the given handler or nullptr if it could not be found.

References jp2_header.

Referenced by jp2_read_header_procedure().

◆ jp2_free_palette_clr()

static void grk::jp2_free_palette_clr ( grk_jp2_color color)
static

◆ jp2_get_cstr_index()

grk_codestream_index * grk::jp2_get_cstr_index ( FileFormat fileFormat)

Get the code stream index from a JPEG2000 codec.

Parameters
fileFormatjp2 codec.
Returns
the code stream index extract from the jpg2000 codec

References grk::FileFormat::codeStream, and j2k_get_cstr_index().

◆ jp2_get_cstr_info()

grk_codestream_info_v2 * grk::jp2_get_cstr_info ( FileFormat fileFormat)

Get the code stream info from a JPEG2000 codec.

Parameters
fileFormatjp2 codec.
Returns
the code stream information extract from the jpg2000 codec

References grk::FileFormat::codeStream, and j2k_get_cstr_info().

◆ jp2_img_find_handler()

static const grk_jp2_header_handler * grk::jp2_img_find_handler ( uint32_t  id)
static

Finds the image execution function related to the given box id.

Parameters
idthe id of the handler to fetch.
Returns
the given handler or nullptr if it could not be found.

References jp2_img_header.

Referenced by jp2_read_header_procedure(), and jp2_read_jp2h().

◆ jp2_init_compress_validation()

static bool grk::jp2_init_compress_validation ( FileFormat fileFormat)
static

Sets up the validation ,i.e.

adds the procedures to launch to make sure the codec parameters are valid. Developers wanting to extend the library can add their own validation procedures.

References jp2_default_validation(), and grk::FileFormat::m_validation_list.

Referenced by grk::FileFormat::start_compress().

◆ jp2_init_decompress_validation()

static bool grk::jp2_init_decompress_validation ( FileFormat fileFormat)
static

Sets up the validation ,i.e.

adds the procedures to launch to make sure the codec parameters are valid. Developers wanting to extend the library can add their own validation procedures.

Referenced by grk::FileFormat::read_header().

◆ jp2_init_end_header_reading()

static bool grk::jp2_init_end_header_reading ( FileFormat fileFormat)
static

Sets up the procedures to do on reading header after the code stream.

Developers wanting to extend the library can add their own writing procedures.

References jp2_read_header_procedure(), and grk::FileFormat::m_procedure_list.

Referenced by grk::FileFormat::end_decompress().

◆ jp2_init_end_header_writing()

static bool grk::jp2_init_end_header_writing ( FileFormat fileFormat)
static

Sets up the procedures to do on writing header after the code stream.

Developers wanting to extend the library can add their own writing procedures.

References jp2_write_jp2c(), and grk::FileFormat::m_procedure_list.

Referenced by grk::FileFormat::end_compress().

◆ jp2_init_header_reading()

static bool grk::jp2_init_header_reading ( FileFormat fileFormat)
static

Sets up the procedures to do on reading header.

Developers wanting to extend the library can add their own writing procedures.

References jp2_read_header_procedure(), and grk::FileFormat::m_procedure_list.

Referenced by grk::FileFormat::read_header().

◆ jp2_init_header_writing()

static bool grk::jp2_init_header_writing ( FileFormat fileFormat)
static

Sets up the procedures to do on writing header.

Developers wanting to extend the library can add their own writing procedures.

References jp2_skip_jp2c(), jp2_write_ftyp(), jp2_write_jp(), jp2_write_jp2h(), jp2_write_uuids(), and grk::FileFormat::m_procedure_list.

Referenced by grk::FileFormat::start_compress().

◆ jp2_read_box()

static bool grk::jp2_read_box ( grk_jp2_box box,
uint8_t *  p_data,
uint32_t *  p_number_bytes_read,
uint64_t  p_box_max_size 
)
static

Reads a box header.

Parameters
boxthe box structure to fill.
p_datathe character string to read data from.
p_number_bytes_readnumber of bytes read from the stream
p_box_max_sizethe maximum number of bytes in the box.
Returns
true if the box is recognized, false otherwise

References GRK_ERROR(), grk::grk_jp2_box::length, and grk::grk_jp2_box::type.

Referenced by jp2_read_jp2h().

◆ jp2_read_box_hdr()

static bool grk::jp2_read_box_hdr ( grk_jp2_box box,
uint32_t *  p_number_bytes_read,
BufferedStream stream 
)
static

Reads a box header.

Parameters
streamthe input stream to read data from.
boxthe box structure to fill.
p_number_bytes_readnumber of bytes read from the stream
Returns
true if the box is recognized, false otherwise

References grk::BufferedStream::get_number_byte_left(), GRK_ERROR(), grk::grk_jp2_box::length, grk::BufferedStream::read(), and grk::grk_jp2_box::type.

Referenced by jp2_read_header_procedure().

◆ jp2_read_bpc()

static bool grk::jp2_read_bpc ( FileFormat fileFormat,
uint8_t *  p_bpc_header_data,
uint32_t  bpc_header_size 
)
static

Reads a Bit per Component box.

Parameters
p_bpc_header_datapointer to actual data (already read from file)
fileFormatJPEG 2000 code stream.
bpc_header_sizethe size of the bpc header
Returns
true if the bpc header is valid, false else.

References grk::grk_jp2_comps::bpc, grk::FileFormat::bpc, grk::FileFormat::comps, GRK_ERROR(), grk_read(), GRK_WARN(), and grk::FileFormat::numcomps.

◆ jp2_read_channel_definition()

static bool grk::jp2_read_channel_definition ( FileFormat fileFormat,
uint8_t *  p_cdef_header_data,
uint32_t  cdef_header_size 
)
static

◆ jp2_read_colr()

static bool grk::jp2_read_colr ( FileFormat fileFormat,
uint8_t *  p_colr_header_data,
uint32_t  colr_header_size 
)
static

Reads the Color Specification box.

Parameters
p_colr_header_datapointer to actual data (already read from file)
fileFormatJPEG 2000 code stream.
colr_header_sizethe size of the color header
Returns
true if the bpc header is valid, false else.

References grk::FileFormat::approx, grk::FileFormat::color, grk::FileFormat::enumcs, GRK_CUSTOM_CIELAB_SPACE, GRK_DEFAULT_CIELAB_SPACE, GRK_ENUM_CLRSPC_CIE, GRK_ENUM_CLRSPC_CMYK, GRK_ENUM_CLRSPC_EYCC, GRK_ENUM_CLRSPC_GRAY, GRK_ENUM_CLRSPC_SRGB, GRK_ENUM_CLRSPC_SYCC, GRK_ENUM_CLRSPC_UNKNOWN, GRK_ERROR(), GRK_WARN(), _grk_jp2_color::has_colour_specification_box, _grk_jp2_color::icc_profile_buf, _grk_jp2_color::icc_profile_len, grk::FileFormat::meth, and grk::FileFormat::precedence.

◆ jp2_read_component_mapping()

static bool grk::jp2_read_component_mapping ( FileFormat fileFormat,
uint8_t *  component_mapping_header_data,
uint32_t  component_mapping_header_size 
)
static

Collect component mapping data.

Parameters
fileFormatJP2 file format
component_mapping_header_datacomponent_mapping header data
component_mapping_header_sizecomponent_mapping header data size
Returns
true if successful

References grk::FileFormat::color, _grk_palette_data::component_mapping, GRK_ERROR(), _grk_palette_data::num_channels, and _grk_jp2_color::palette.

◆ jp2_read_ftyp()

static bool grk::jp2_read_ftyp ( FileFormat fileFormat,
uint8_t *  p_header_data,
uint32_t  header_size 
)
static

Reads a a FTYP box - File type box.

Parameters
fileFormatJPEG 2000 code stream.
p_header_datathe data contained in the FTYP box.
header_sizethe size of the data contained in the FTYP box.
Returns
true if the FTYP box is valid.
Parameters
fileFormatJPEG 2000 code stream.
p_header_datathe data contained in the FTYP box.
header_sizethe size of the data contained in the FTYP box.
Returns
true if the FTYP box is valid.

References grk::FileFormat::brand, grk::FileFormat::cl, grk_calloc(), GRK_ERROR(), grk::FileFormat::jp2_state, JP2_STATE_FILE_TYPE, JP2_STATE_SIGNATURE, grk::FileFormat::minversion, and grk::FileFormat::numcl.

◆ jp2_read_header_procedure()

static bool grk::jp2_read_header_procedure ( FileFormat fileFormat)
static

◆ jp2_read_ihdr()

static bool grk::jp2_read_ihdr ( FileFormat fileFormat,
uint8_t *  p_image_header_data,
uint32_t  image_header_size 
)
static

Reads a IHDR box - Image Header box.

Parameters
p_image_header_datapointer to actual data (already read from file)
fileFormatJPEG 2000 code stream.
image_header_sizethe size of the image header
Returns
true if the image header is valid, false else.

References grk::FileFormat::bpc, grk::FileFormat::C, grk::FileFormat::comps, GRK_ENUM_CLRSPC_CIE, GRK_ERROR(), GRK_WARN(), grk::FileFormat::h, grk::FileFormat::IPR, max_num_components, max_supported_precision, grk::FileFormat::numcomps, grk::FileFormat::UnkC, and grk::FileFormat::w.

◆ jp2_read_jp()

static bool grk::jp2_read_jp ( FileFormat fileFormat,
uint8_t *  p_header_data,
uint32_t  header_size 
)
static

Reads a JPEG 2000 file signature box.

Parameters
fileFormatJPEG 2000 code stream.
p_header_datathe data contained in the signature box.
header_sizethe size of the data contained in the signature box.
Returns
true if the file signature box is valid.
Parameters
fileFormatJPEG 2000 code stream.
p_header_datathe data contained in the signature box.
header_sizethe size of the data contained in the signature box.
Returns
true if the file signature box is valid.

References GRK_ERROR(), grk::FileFormat::jp2_state, JP2_STATE_NONE, and JP2_STATE_SIGNATURE.

◆ jp2_read_jp2h()

static bool grk::jp2_read_jp2h ( FileFormat fileFormat,
uint8_t *  p_header_data,
uint32_t  header_size 
)
static

Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).

Parameters
fileFormatJPEG 2000 code stream.
p_header_datathe data contained in the file header box.
header_sizethe size of the data contained in the file header box.
Returns
true if the JP2 Header box was successfully recognized.
Parameters
fileFormatJPEG 2000 code stream.
p_header_datathe data contained in the file header box.
header_sizethe size of the data contained in the file header box.
Returns
true if the JP2 Header box was successfully recognized.

References GRK_ERROR(), JP2_IHDR, jp2_img_find_handler(), grk::FileFormat::jp2_img_state, JP2_IMG_STATE_NONE, JP2_IMG_STATE_UNKNOWN, jp2_read_box(), grk::FileFormat::jp2_state, JP2_STATE_FILE_TYPE, JP2_STATE_HEADER, grk::grk_jp2_box::length, and grk::grk_jp2_box::type.

◆ jp2_read_palette_clr()

static bool grk::jp2_read_palette_clr ( FileFormat fileFormat,
uint8_t *  p_pclr_header_data,
uint32_t  pclr_header_size 
)
static

Collect palette data.

Parameters
fileFormatJP2 file format
p_pclr_header_datapclr header data
pclr_header_sizepclr header data size
Returns
true if successful

References grk::FileFormat::alloc_palette(), grk::FileFormat::color, GRK_ERROR(), and _grk_jp2_color::palette.

◆ jp2_read_res()

static bool grk::jp2_read_res ( FileFormat fileFormat,
uint8_t *  p_resolution_data,
uint32_t  resolution_size 
)
static

Reads a Resolution box.

Parameters
p_resolution_datapointer to actual data (already read from file)
fileFormatJPEG 2000 code stream.
resolution_sizethe size of the image header
Returns
true if the image header is valid, false else.

References calc_res(), grk::FileFormat::capture_resolution, grk::FileFormat::display_resolution, GRK_ERROR(), GRK_RESOLUTION_BOX_SIZE, grk::FileFormat::has_capture_resolution, grk::FileFormat::has_display_resolution, JP2_CAPTURE_RES, JP2_DISPLAY_RES, and jp2_read_res_box().

◆ jp2_read_res_box()

static bool grk::jp2_read_res_box ( uint32_t *  id,
uint32_t *  num,
uint32_t *  den,
uint32_t *  exponent,
uint8_t **  p_resolution_data 
)
static

Referenced by jp2_read_res().

◆ jp2_read_uuid()

static bool grk::jp2_read_uuid ( FileFormat fileFormat,
uint8_t *  p_header_data,
uint32_t  header_data_size 
)
static

Read a UUID box.

Parameters
fileFormatJPEG 2000 file codec.
p_header_datapointer to actual data (already read from file)
header_data_sizesize of data
Returns
true if the image header is valid, false else.

References GRK_WARN(), JP2_MAX_NUM_UUIDS, grk::FileFormat::numUuids, and grk::FileFormat::uuids.

◆ jp2_read_xml()

static bool grk::jp2_read_xml ( FileFormat fileFormat,
uint8_t *  p_xml_data,
uint32_t  xml_size 
)
static

Read XML box.

Parameters
fileFormatJPEG 2000 file codec.
p_xml_datapointer to actual data (already read from file)
xml_sizesize of the xml data
Returns
true if the image header is valid, false else.

References grk::grk_jp2_buffer::alloc(), grk::grk_jp2_buffer::buffer, grk::grk_jp2_buffer::len, and grk::FileFormat::xml.

◆ jp2_skip_jp2c()

static bool grk::jp2_skip_jp2c ( FileFormat fileFormat)
static

◆ jp2_write_bpc()

static uint8_t * grk::jp2_write_bpc ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

Writes the Bit per Component box.

Parameters
fileFormatJPEG 2000 file codec.
p_nb_bytes_writtenpointer to store the nb of bytes written by the function.
Returns
the data being copied.

References grk::grk_jp2_comps::bpc, grk::FileFormat::comps, grk_calloc(), grk_write(), JP2_BPCC, and grk::FileFormat::numcomps.

Referenced by jp2_write_jp2h().

◆ jp2_write_buffer()

static uint8_t * grk::jp2_write_buffer ( uint32_t  boxId,
grk_jp2_buffer buffer,
uint32_t *  p_nb_bytes_written 
)
static

Write buffer box.

Parameters
boxIdbox id.
bufferbuffer with data
p_nb_bytes_writtenpointer to store the nb of bytes written by the function.
Returns
the data being copied.

References grk::grk_jp2_buffer::buffer, grk_calloc(), and grk::grk_jp2_buffer::len.

Referenced by jp2_write_xml().

◆ jp2_write_channel_definition()

static uint8_t * grk::jp2_write_channel_definition ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

Writes the Channel Definition box.

Parameters
fileFormatJPEG 2000 file codec.
p_nb_bytes_writtenpointer to store the nb of bytes written by the function.
Returns
the data being copied.

References _grk_channel_description::asoc, _grk_jp2_color::channel_definition, _grk_channel_description::cn, grk::FileFormat::color, _grk_channel_definition::descriptions, grk_malloc(), JP2_CDEF, _grk_channel_definition::num_channel_descriptions, and _grk_channel_description::typ.

Referenced by jp2_write_jp2h().

◆ jp2_write_colr()

static uint8_t * grk::jp2_write_colr ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

Writes the Colour Specification box.

Parameters
fileFormatJPEG 2000 file codec.
p_nb_bytes_writtenpointer to store the nb of bytes written by the function.
Returns
the data being copied.

References grk::FileFormat::approx, grk::FileFormat::color, grk::FileFormat::enumcs, grk_calloc(), _grk_jp2_color::icc_profile_buf, _grk_jp2_color::icc_profile_len, JP2_COLR, grk::FileFormat::meth, and grk::FileFormat::precedence.

Referenced by jp2_write_jp2h().

◆ jp2_write_component_mapping()

static uint8_t * grk::jp2_write_component_mapping ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

◆ jp2_write_ftyp()

static bool grk::jp2_write_ftyp ( FileFormat fileFormat)
static

Writes a FTYP box - File type box.

Parameters
fileFormatJPEG 2000 code stream.
Returns
true if writing was successful.

References grk::FileFormat::brand, grk::FileFormat::cl, grk::FileFormat::codeStream, grk::CodeStream::getStream(), GRK_ERROR(), JP2_FTYP, grk::FileFormat::minversion, and grk::FileFormat::numcl.

Referenced by jp2_init_header_writing().

◆ jp2_write_ihdr()

static uint8_t * grk::jp2_write_ihdr ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

Writes the Image Header box - Image Header box.

Parameters
fileFormatJPEG 2000 file codec.
p_nb_bytes_writtenpointer to store the nb of bytes written by the function.
Returns
the data being copied.

References grk::FileFormat::bpc, grk::FileFormat::C, grk_calloc(), grk::FileFormat::h, grk::FileFormat::IPR, JP2_IHDR, grk::FileFormat::numcomps, grk::FileFormat::UnkC, and grk::FileFormat::w.

Referenced by jp2_write_jp2h().

◆ jp2_write_jp()

static bool grk::jp2_write_jp ( FileFormat fileFormat)
static

Writes a JPEG 2000 file signature box.

Parameters
fileFormatJPEG 2000 code stream.
Returns
true if writing was successful.

References grk::FileFormat::codeStream, grk::CodeStream::getStream(), and JP2_JP.

Referenced by jp2_init_header_writing().

◆ jp2_write_jp2c()

static bool grk::jp2_write_jp2c ( FileFormat fileFormat)
static

Writes the Jpeg2000 code stream Header box - JP2C Header box.

This function must be called AFTER the coding has been done.

Parameters
fileFormatJPEG 2000 code stream.
Returns
true if writing was successful.

References grk::FileFormat::codeStream, grk::CodeStream::getStream(), GRK_ERROR(), grk::FileFormat::j2k_codestream_offset, JP2_JP2C, and grk::FileFormat::needs_xl_jp2c_box_length.

Referenced by jp2_init_end_header_writing().

◆ jp2_write_jp2h()

static bool grk::jp2_write_jp2h ( FileFormat fileFormat)
static

◆ jp2_write_palette_clr()

static uint8_t * grk::jp2_write_palette_clr ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

◆ jp2_write_res()

static uint8_t * grk::jp2_write_res ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

Writes the Resolution box.

Parameters
fileFormatJPEG 2000 file codec.
p_nb_bytes_writtenpointer to store the nb of bytes written by the function.
Returns
the data being copied.

References grk::FileFormat::capture_resolution, grk::FileFormat::display_resolution, grk_calloc(), GRK_RESOLUTION_BOX_SIZE, JP2_CAPTURE_RES, JP2_DISPLAY_RES, JP2_RES, and jp2_write_res_box().

Referenced by jp2_write_jp2h().

◆ jp2_write_res_box()

static void grk::jp2_write_res_box ( double  resx,
double  resy,
uint32_t  box_id,
uint8_t **  current_res_ptr 
)
static

References find_cf(), and GRK_RESOLUTION_BOX_SIZE.

Referenced by jp2_write_res().

◆ jp2_write_uuids()

static bool grk::jp2_write_uuids ( FileFormat fileFormat)
static

◆ jp2_write_xml()

static uint8_t * grk::jp2_write_xml ( FileFormat fileFormat,
uint32_t *  p_nb_bytes_written 
)
static

Write XML box.

Parameters
fileFormatJPEG 2000 file codec.
p_nb_bytes_writtenpointer to store the nb of bytes written by the function.
Returns
the data being copied.

References jp2_write_buffer(), JP2_XML, and grk::FileFormat::xml.

Referenced by jp2_write_jp2h().

◆ log()

template<typename ... Args>
void grk::log ( grk_msg_callback  msg_handler,
void *  l_data,
char const *const  format,
Args &...  args 
)
noexcept

◆ lupDecompose()

static bool grk::lupDecompose ( float *  matrix,
uint32_t *  permutations,
float *  p_swap_area,
uint32_t  nb_compo 
)
static

LUP decomposition.

Referenced by matrix_inversion_f().

◆ lupInvert()

static void grk::lupInvert ( float *  pSrcMatrix,
float *  pDestMatrix,
uint32_t  nb_compo,
uint32_t *  pPermutations,
float *  p_src_temp,
float *  p_dest_temp,
float *  p_swap_area 
)
static

LUP inversion (call with the result of lupDecompose)

References lupSolve().

Referenced by matrix_inversion_f().

◆ lupSolve()

static void grk::lupSolve ( float *  pResult,
float *  pMatrix,
float *  pVector,
uint32_t *  pPermutations,
uint32_t  nb_compo,
float *  p_intermediate_data 
)
static

LUP solving.

Referenced by lupInvert().

◆ makeDecompress97()

static Decompress97 grk::makeDecompress97 ( dwt_data< vec4f > *  dwt,
bool  low 
)
static

◆ matrix_inversion_f()

static bool grk::matrix_inversion_f ( float *  pSrcMatrix,
float *  pDestMatrix,
uint32_t  n 
)
static

Calculate a n x n double matrix inversion with a LUP method.

Matrix inversion.

Data is aligned, rows after rows (or columns after columns). The function does not take ownership of any memory block, data must be freed by the user.

Parameters
pSrcMatrixthe matrix to invert.
pDestMatrixdata to store the inverted matrix.
nsize of the matrix
Returns
true if the inversion is successful, false if the matrix is singular.

References grk_free(), grk_malloc(), lupDecompose(), and lupInvert().

Referenced by grk::CodeStream::init_compress().

◆ max_resolution()

uint32_t grk::max_resolution ( Resolution *GRK_RESTRICT  r,
uint32_t  i 
)

◆ mem_map_free()

static void grk::mem_map_free ( void *  user_data)
static

◆ minpf_cleanup_plugin_manager()

void grk::minpf_cleanup_plugin_manager ( void  )

◆ minpf_get_dynamic_library_extension()

const char * grk::minpf_get_dynamic_library_extension ( void  )

◆ minpf_get_full_path()

bool grk::minpf_get_full_path ( const char *  path,
void *  addr,
dynamic_handle_t  handle,
char *  fullPath,
size_t  fullPathLen 
)

References ojph::error.

Referenced by minpf_load().

◆ minpf_get_plugin_manager()

minpf_plugin_manager * grk::minpf_get_plugin_manager ( void  )

◆ minpf_get_symbol()

void * grk::minpf_get_symbol ( minpf_dynamic_library library,
const char *  symbol 
)

◆ minpf_init_plugin()

PLUGIN_API minpf_exit_func grk::minpf_init_plugin ( const char *  pluginPath,
const minpf_platform_services params 
)

◆ minpf_initialize_plugin_manager()

void grk::minpf_initialize_plugin_manager ( minpf_plugin_manager manager)

◆ minpf_is_valid_plugin()

static uint32_t grk::minpf_is_valid_plugin ( const char *  id,
const minpf_register_params params 
)
static

◆ minpf_load()

static int32_t grk::minpf_load ( const char *  path)
static

◆ minpf_load_dynamic_library()

minpf_dynamic_library * grk::minpf_load_dynamic_library ( const char *  path,
char *  error 
)

◆ minpf_load_from_dir()

int32_t grk::minpf_load_from_dir ( const char *  directory_path,
minpf_invoke_service_func  func 
)

◆ minpf_load_from_path()

int32_t grk::minpf_load_from_path ( const char *  path,
minpf_invoke_service_func  func 
)

◆ minpf_post_load_plugin()

static int32_t grk::minpf_post_load_plugin ( const char *  pluginPath,
minpf_post_load_func  initFunc 
)
static

◆ minpf_register_object()

int32_t grk::minpf_register_object ( const char *  id,
const minpf_register_params params 
)

◆ minpf_unload_dynamic_library()

bool grk::minpf_unload_dynamic_library ( minpf_dynamic_library library)

◆ mqc_bypass_enc()

void grk::mqc_bypass_enc ( mqcoder mqc,
uint32_t  d 
)

◆ mqc_bypass_flush_enc()

void grk::mqc_bypass_flush_enc ( mqcoder mqc,
bool  erterm 
)

◆ mqc_bypass_get_extra_bytes_enc()

uint32_t grk::mqc_bypass_get_extra_bytes_enc ( mqcoder mqc,
bool  erterm 
)

◆ mqc_bypass_init_enc()

void grk::mqc_bypass_init_enc ( mqcoder mqc)

◆ mqc_byteout()

void grk::mqc_byteout ( mqcoder mqc)

◆ mqc_codelps_enc()

static void grk::mqc_codelps_enc ( mqcoder mqc)
static

◆ mqc_codemps_enc()

static void grk::mqc_codemps_enc ( mqcoder mqc)
static

◆ mqc_encode()

void grk::mqc_encode ( mqcoder mqc,
uint32_t  d 
)

◆ mqc_erterm_enc()

void grk::mqc_erterm_enc ( mqcoder mqc)

◆ mqc_finish_dec()

void grk::mqc_finish_dec ( mqcoder mqc)

Terminate RAW/MQC decoding.

This restores the bytes temporarily overwritten by mqc_init_dec()/ mqc_raw_init_dec()

Parameters
mqcMQC handle

References grk::mqcoder::backup, grk::mqcoder::end, and grk_cblk_dec_compressed_data_pad_right.

Referenced by grk::T1::decompress_cblk().

◆ mqc_flush_enc()

void grk::mqc_flush_enc ( mqcoder mqc)

◆ mqc_init_dec()

void grk::mqc_init_dec ( mqcoder mqc,
uint8_t *  bp,
uint32_t  len 
)

Initialize the decoder for MQ decoding.

mqc_finish_dec() must be absolutely called after finishing the decoding passes, so as to restore the bytes temporarily overwritten.

Parameters
mqcMQC handle
bpPointer to the start of the buffer from which the bytes will be read Note that OPJ_COMMON_CBLK_DATA_EXTRA bytes at the end of the buffer will be temporarily overwritten with an artificial 0xFF 0xFF marker. (they will be backuped in the mqc structure to be restored later) So bp must be at least len + OPJ_COMMON_CBLK_DATA_EXTRA large, and writable.
lenLength of the input buffer

References grk::mqcoder::a, A_MIN, grk::mqcoder::bp, grk::mqcoder::c, grk::mqcoder::ct, grk::mqcoder::end_of_byte_stream_counter, mqc_bytein(), mqc_init_dec_common(), and mqc_setcurctx.

Referenced by grk::T1::decompress_cblk().

◆ mqc_init_dec_common()

static void grk::mqc_init_dec_common ( mqcoder mqc,
uint8_t *  bp,
uint32_t  len 
)
static

◆ mqc_init_enc()

void grk::mqc_init_enc ( mqcoder mqc,
uint8_t *  bp 
)

◆ mqc_next_plane()

void grk::mqc_next_plane ( grk_plugin_debug_mqc mqc)

◆ mqc_numbytes_enc()

uint32_t grk::mqc_numbytes_enc ( mqcoder mqc)

◆ mqc_raw_init_dec()

void grk::mqc_raw_init_dec ( mqcoder mqc,
uint8_t *  bp,
uint32_t  len 
)

Initialize the decoder for RAW decoding.

mqc_finish_dec() must be absolutely called after finishing the decoding passes, so as to restore the bytes temporarily overwritten.

Parameters
mqcMQC handle
bpPointer to the start of the buffer from which the bytes will be read Note that OPJ_COMMON_CBLK_DATA_EXTRA bytes at the end of the buffer will be temporarily overwritten with an artificial 0xFF 0xFF marker. (they will be backuped in the mqc structure to be restored later) So bp must be at least len + OPJ_COMMON_CBLK_DATA_EXTRA large, and writable.
lenLength of the input buffer

References grk::mqcoder::c, grk::mqcoder::ct, and mqc_init_dec_common().

Referenced by grk::T1::decompress_cblk().

◆ mqc_renorm_enc()

static void grk::mqc_renorm_enc ( mqcoder mqc)
static

◆ mqc_resetstates()

void grk::mqc_resetstates ( mqcoder mqc)

◆ mqc_restart_init_enc()

void grk::mqc_restart_init_enc ( mqcoder mqc)

◆ mqc_segmark_enc()

void grk::mqc_segmark_enc ( mqcoder mqc)

References mqc_encode(), and mqc_setcurctx.

Referenced by grk::T1::compress_cblk().

◆ mqc_setbits_enc()

static void grk::mqc_setbits_enc ( mqcoder mqc)
static

References grk::mqcoder::a, and grk::mqcoder::c.

Referenced by mqc_flush_enc().

◆ mult64_will_overflow()

bool grk::mult64_will_overflow ( uint64_t  a,
uint64_t  b 
)
inline

Referenced by grk::Resolution::init().

◆ mult_will_overflow()

bool grk::mult_will_overflow ( uint32_t  a,
uint32_t  b 
)
inline

◆ nextCXD()

void grk::nextCXD ( grk_plugin_debug_mqc mqc,
uint32_t  d 
)

◆ open_fd()

static grk_handle grk::open_fd ( const char *  fname,
const char *  mode 
)
static

◆ pi_check_next_level()

static bool grk::pi_check_next_level ( int32_t  pos,
CodingParams cp,
uint16_t  tileno,
uint32_t  pino,
const char *  prog 
)
static

Check packet iterator's nexxt level.

References GRK_LRCP, GRK_RLCP, grk::TileCodingParams::pocs, and grk::CodingParams::tcps.

Referenced by pi_enable_tile_part_generation().

◆ pi_create()

static PacketIter * grk::pi_create ( const grk_image p_image,
const CodingParams p_cp,
uint16_t  tileno,
std::vector< uint8_t * > *  include 
)
static

Allocates memory for a packet iterator.

Data and data sizes are set by this operation. No other data is set. The include section of the packet iterator is not allocated.

Parameters
p_imagethe image used to initialize the packet iterator (in fact only the number of components is relevant.
p_cpthe coding parameters.
tilenothe index of the tile from which creating the packet iterator.

References grk::PacketIter::comps, grk_calloc(), _grk_image::numcomps, grk::TileCodingParams::numpocs, grk::grk_pi_comp::numresolutions, pi_destroy(), grk::grk_pi_comp::resolutions, grk::CodingParams::t_grid_height, and grk::CodingParams::tcps.

Referenced by pi_create_compress(), and pi_create_decompress().

◆ pi_create_compress()

PacketIter * grk::pi_create_compress ( const grk_image image,
CodingParams cp,
uint16_t  tileno,
J2K_T2_MODE  t2_mode,
std::vector< uint8_t * > *  include 
)

Creates a packet iterator for compressing.

Parameters
imagethe image being encoded.
cpthe coding parameters.
tilenoindex of the tile being encoded.
t2_modethe type of pass for generating the packet iterator
includevector of include buffers, one per layer
Returns
a list of packet iterator that points to the first packet of the tile (not true).

References _grk_image::comps, _grk_image_comp::dx, FINAL_PASS, grk_free(), grk_get_all_encoding_parameters(), GRK_IS_CINEMA, GRK_J2K_MAXRLVLS, grk_malloc(), grk::CodingParams::m_coding_params, grk::CodingParams::m_enc, grk::EncodingParams::m_tp_on, _grk_image::numcomps, grk::TileCodingParams::numpocs, pi_create(), pi_update_encode_no_poc(), pi_update_encode_poc_and_final(), grk::CodingParams::rsiz, grk::CodingParams::t_grid_height, and grk::CodingParams::tcps.

Referenced by grk::T2Compress::compress_packets(), and grk::T2Compress::compress_packets_simulate().

◆ pi_create_decompress()

PacketIter * grk::pi_create_decompress ( grk_image image,
CodingParams cp,
uint16_t  tileno,
std::vector< uint8_t * > *  include 
)

Create a packet iterator for Decoder.

Parameters
imageRaw image for which the packets will be listed
cpCoding parameters
tilenoNumber that identifies the tile for which to list the packets
includevector of include buffers, one per layer
Returns
a packet iterator that points to the first packet of the tile
See also
pi_destroy

References _grk_image::comps, _grk_image_comp::dx, grk_free(), grk_get_all_encoding_parameters(), GRK_J2K_MAXRLVLS, grk_malloc(), _grk_image::numcomps, grk::TileCodingParams::numpocs, pi_create(), pi_update_decode_no_poc(), pi_update_decode_poc(), grk::CodingParams::t_grid_height, and grk::CodingParams::tcps.

Referenced by grk::T2Decompress::decompress_packets().

◆ pi_destroy()

void grk::pi_destroy ( PacketIter p_pi)

Destroys a packet iterator array.

Parameters
p_pithe packet iterator array to destroy.

References grk::PacketIter::destroy_include().

Referenced by grk::T2Compress::compress_packets(), grk::T2Compress::compress_packets_simulate(), grk::T2Decompress::decompress_packets(), and pi_create().

◆ pi_enable_tile_part_generation()

void grk::pi_enable_tile_part_generation ( PacketIter pi,
CodingParams cp,
uint16_t  tileno,
uint32_t  pino,
bool  first_poc_tile_part,
uint32_t  tppos,
J2K_T2_MODE  t2_mode 
)

Modify the packet iterator for enabling tile part generation.

Parameters
piHandle to the packet iterator generated in pi_initialise_encode
cpCoding parameters
tilenoNumber that identifies the tile for which to list the packets
pinopacket iterator number
first_poc_tile_parttrue for first POC tile part
tpposThe position of the tile part flag in the progression order
t2_modeT2 mode

References _grk_poc::compno0, _grk_poc::compno1, FINAL_PASS, grk::PacketIter::first, GRK_IS_CINEMA, GRK_IS_IMF, GRK_LRCP, GRK_RLCP, j2k_convert_progression_order(), _grk_poc::layno0, _grk_poc::layno1, grk::CodingParams::m_coding_params, grk::CodingParams::m_enc, grk::EncodingParams::m_tp_on, pi_check_next_level(), grk::PacketIter::poc, grk::TileCodingParams::pocs, _grk_poc::precno0, _grk_poc::precno1, _grk_poc::prg, _grk_poc::resno0, _grk_poc::resno1, grk::CodingParams::rsiz, grk::CodingParams::tcps, _grk_poc::tx0, _grk_poc::tx1, _grk_poc::ty0, and _grk_poc::ty1.

Referenced by grk::T2Compress::compress_packets(), and grk::T2Compress::compress_packets_simulate().

◆ pi_next()

bool grk::pi_next ( PacketIter pi)

Modify the packet iterator to point to the next packet.

Parameters
piPacket iterator to modify
Returns
false if pi pointed to the last packet or else returns true

References GRK_CPRL, GRK_LRCP, GRK_PCRL, GRK_RLCP, GRK_RPCL, pi_next_cprl(), pi_next_lrcp(), pi_next_pcrl(), pi_next_rlcp(), pi_next_rpcl(), grk::PacketIter::poc, and _grk_poc::prg.

Referenced by grk::T2Compress::compress_packets(), grk::T2Compress::compress_packets_simulate(), and grk::T2Decompress::decompress_packets().

◆ pi_next_cprl()

static bool grk::pi_next_cprl ( PacketIter pi)
static

◆ pi_next_l()

static uint8_t grk::pi_next_l ( PacketIter pi)
static

◆ pi_next_lrcp()

static bool grk::pi_next_lrcp ( PacketIter pi)
static

◆ pi_next_pcrl()

static bool grk::pi_next_pcrl ( PacketIter pi)
static

◆ pi_next_rlcp()

static bool grk::pi_next_rlcp ( PacketIter pi)
static

◆ pi_next_rpcl()

static bool grk::pi_next_rpcl ( PacketIter pi)
static

◆ pi_update_decode_no_poc()

static void grk::pi_update_decode_no_poc ( PacketIter p_pi,
TileCodingParams p_tcp,
uint64_t  max_precincts,
uint8_t  max_res 
)
static

◆ pi_update_decode_poc()

static void grk::pi_update_decode_poc ( PacketIter p_pi,
TileCodingParams p_tcp,
uint64_t  max_precincts 
)
static

Upgrade decompress packet iterator with POC.

References grk::TileCodingParams::numlayers, grk::TileCodingParams::numpocs, grk::TileCodingParams::pocs, and _grk_poc::prg.

Referenced by pi_create_decompress().

◆ pi_update_encode_no_poc()

static void grk::pi_update_encode_no_poc ( CodingParams p_cp,
uint16_t  num_comps,
uint16_t  tileno,
uint32_t  tx0,
uint32_t  tx1,
uint32_t  ty0,
uint32_t  ty1,
uint64_t  max_precincts,
uint8_t  max_res,
uint32_t  dx_min,
uint32_t  dy_min 
)
static

Updates the coding parameters if the compressing is not used with Progression order changes and final (and cinema parameters are used).

Parameters
p_cpthe coding parameters to modify
num_compsthe number of components
tilenothe tile index being concerned.
tx0X0 parameter for the tile
tx1X1 parameter for the tile
ty0Y0 parameter for the tile
ty1Y1 parameter for the tile
max_precinctsthe maximum number of precincts for all the bands of the tile
max_resthe maximum number of resolutions for all the poc inside the tile.
dx_minthe minimum dx of all the components of all the resolutions for the tile.
dy_minthe minimum dy of all the components of all the resolutions for the tile.

References grk::TileCodingParams::numpocs, grk::CodingParams::t_grid_height, and grk::CodingParams::tcps.

Referenced by pi_create_compress(), and pi_update_encoding_parameters().

◆ pi_update_encode_poc_and_final()

static void grk::pi_update_encode_poc_and_final ( CodingParams p_cp,
uint16_t  tileno,
uint32_t  tx0,
uint32_t  tx1,
uint32_t  ty0,
uint32_t  ty1,
uint64_t  max_precincts,
uint32_t  dx_min,
uint32_t  dy_min 
)
static

Updates the coding parameters if the compressing is used with Progression order changes and final (or cinema parameters are used).

Parameters
p_cpthe coding parameters to modify
tilenothe tile index being concerned.
tx0X0 parameter for the tile
tx1X1 parameter for the tile
ty0Y0 parameter for the tile
ty1Y1 parameter for the tile
max_precinctsthe maximum number of precincts for all the bands of the tile
dx_minthe minimum dx of all the components of all the resolutions for the tile.
dy_minthe minimum dy of all the components of all the resolutions for the tile.

References grk::TileCodingParams::numpocs, grk::CodingParams::t_grid_height, and grk::CodingParams::tcps.

Referenced by pi_create_compress(), and pi_update_encoding_parameters().

◆ pi_update_encoding_parameters()

void grk::pi_update_encoding_parameters ( const grk_image p_image,
CodingParams p_cp,
uint16_t  tile_no 
)

Updates the compressing parameters of the codec.

Parameters
p_imagethe image being encoded.
p_cpthe coding parameters.
tile_noindex of the tile being encoded.

References grk_get_encoding_parameters(), _grk_image::numcomps, pi_update_encode_no_poc(), pi_update_encode_poc_and_final(), grk::CodingParams::t_grid_height, and grk::CodingParams::tcps.

Referenced by j2k_calculate_tp().

◆ prepareBlockForFirstLayer()

static void grk::prepareBlockForFirstLayer ( CompressCodeblock cblk)
static

◆ read_from_mem()

static size_t grk::read_from_mem ( void *  p_buffer,
size_t  nb_bytes,
MemStream p_source_buffer 
)
static

◆ sat_add() [1/2]

template<typename T >
T grk::sat_add ( int64_t  lhs,
int64_t  rhs 
)

◆ sat_add() [2/2]

template<typename T >
T grk::sat_add ( lhs,
rhs 
)

◆ sat_sub() [1/2]

template<typename T >
T grk::sat_sub ( int64_t  lhs,
int64_t  rhs 
)

◆ sat_sub() [2/2]

template<typename T >
T grk::sat_sub ( lhs,
rhs 
)

◆ seek_from_mem()

static bool grk::seek_from_mem ( uint64_t  nb_bytes,
MemStream src 
)
static

◆ set_context_stream()

void grk::set_context_stream ( TileProcessor p_tileProcessor)

◆ set_up_mem_stream()

void grk::set_up_mem_stream ( grk_stream l_stream,
size_t  len,
bool  is_read_stream 
)

◆ size_proc()

static uint64_t grk::size_proc ( grk_handle  fd)
static

◆ tile_equals()

bool grk::tile_equals ( grk_plugin_tile plugin_tile,
grk_tile p_tile 
)

◆ transfer_image_data()

static void grk::transfer_image_data ( grk_image src,
grk_image dest 
)
static

Transfer data from src to dest for each component, and null out src data.

Assumption: src and dest have the same number of components

References _grk_image::comps, grk_image_single_component_data_free(), and _grk_image::numcomps.

Referenced by grk::CodeStream::do_decompress().

◆ uint64_ceildivpow2()

static uint32_t grk::uint64_ceildivpow2 ( uint64_t  a,
uint32_t  b 
)
inlinestatic

Divide a 64-bit integer by a power of 2 and round upwards.

Parameters
a64-bit integer
bpower of two
Returns
a divided by 2^b

◆ uint_floordivpow2()

static uint32_t grk::uint_floordivpow2 ( uint32_t  a,
uint32_t  b 
)
inlinestatic

◆ unmap()

static int32_t grk::unmap ( void *  ptr,
size_t  len 
)
static

Referenced by mem_map_free().

◆ update_flags()

static INLINE void grk::update_flags ( grk_flag flagsp,
uint32_t  ci,
uint32_t  s,
uint32_t  stride,
uint32_t  vsc 
)
static

◆ update_image_dimensions()

static bool grk::update_image_dimensions ( grk_image image,
uint32_t  reduce 
)
static

◆ update_pi_dxy()

static void grk::update_pi_dxy ( PacketIter pi)
static

◆ update_pi_dxy_for_comp()

static void grk::update_pi_dxy_for_comp ( PacketIter pi,
grk_pi_comp comp 
)
static

◆ usage()

void grk::usage ( void  )

Referenced by grk::GrokOutput::usage().

◆ write_to_mem()

static size_t grk::write_to_mem ( void *  dest,
size_t  nb_bytes,
MemStream src 
)
static

◆ zero_copy_read_from_mem()

static size_t grk::zero_copy_read_from_mem ( void **  p_buffer,
size_t  nb_bytes,
MemStream p_source_buffer 
)
static

Variable Documentation

◆ A_MIN

const uint32_t grk::A_MIN = 0x8000

Referenced by mqc_init_dec().

◆ available_packet_len_bytes_per_plt

const uint32_t grk::available_packet_len_bytes_per_plt = USHRT_MAX - 1 - 4

◆ BAND_RES_ZERO_INDEX_LL

const uint32_t grk::BAND_RES_ZERO_INDEX_LL = 0

◆ c13318

const float grk::c13318 = 1.625732422f
static

Referenced by decompress_step_97().

◆ cod_coc_len

const uint32_t grk::cod_coc_len = 5U

Referenced by j2k_read_cod(), and j2k_write_coc().

◆ default_align

const size_t grk::default_align = 64

◆ default_header_size

const uint32_t grk::default_header_size = 1000

◆ default_number_mcc_records

const uint32_t grk::default_number_mcc_records = 10

◆ default_number_mct_records

const uint32_t grk::default_number_mct_records = 10

◆ default_numbers_segments

const uint32_t grk::default_numbers_segments = 10

◆ dwt_alpha

const float grk::dwt_alpha = 1.586134342f
static

Referenced by decompress_step_97().

◆ dwt_beta

const float grk::dwt_beta = 0.052980118f
static

Referenced by decompress_step_97().

◆ dwt_delta

const float grk::dwt_delta = -0.443506852f
static

Referenced by decompress_step_97().

◆ dwt_gamma

const float grk::dwt_gamma = -0.882911075f
static

Referenced by decompress_step_97().

◆ grk_alignment

const uint32_t grk::grk_alignment = 32

Referenced by grk_make_aligned_width().

◆ GRK_COMP_PARAM_DEFAULT_CBLOCKH

const uint32_t grk::GRK_COMP_PARAM_DEFAULT_CBLOCKH = 64

◆ GRK_COMP_PARAM_DEFAULT_CBLOCKW

const uint32_t grk::GRK_COMP_PARAM_DEFAULT_CBLOCKW = 64

◆ GRK_COMP_PARAM_DEFAULT_NUMRESOLUTION

const uint32_t grk::GRK_COMP_PARAM_DEFAULT_NUMRESOLUTION = 6

◆ GRK_COMP_PARAM_DEFAULT_PROG_ORDER

const GRK_PROG_ORDER grk::GRK_COMP_PARAM_DEFAULT_PROG_ORDER = GRK_LRCP

◆ grk_marker_length

const uint32_t grk::grk_marker_length = 4U

◆ invScale

const double grk::invScale = log(2) / 256

◆ IPTC_UUID

const uint8_t grk::IPTC_UUID[16]
Initial value:
= { 0x33, 0xC7, 0xA4, 0xD2, 0xB8, 0x1D, 0x47, 0x23,
0xA0, 0xBA, 0xF1, 0xA3, 0xE0, 0x97, 0xAD, 0x38 }

Referenced by grk::FileFormat::init_compress(), and grk::FileFormat::read_header().

◆ j2k_mct_read_functions_to_float

const j2k_mct_function grk::j2k_mct_read_functions_to_float[]
static

◆ j2k_mct_read_functions_to_int32

const j2k_mct_function grk::j2k_mct_read_functions_to_int32[]
static

◆ j2k_mct_write_functions_from_float

const j2k_mct_function grk::j2k_mct_write_functions_from_float[]
static

◆ j2k_prog_order_list

j2k_prog_order grk::j2k_prog_order_list[]
static
Initial value:
= { { GRK_CPRL, "CPRL" }, {
GRK_LRCP, "LRCP" }, { GRK_PCRL, "PCRL" }, { GRK_RLCP, "RLCP" }, {
GRK_RPCL, "RPCL" }, { (GRK_PROG_ORDER) -1, "" } }

Referenced by j2k_convert_progression_order().

◆ jp2_header

const grk_jp2_header_handler grk::jp2_header[]
static

◆ jp2_img_header

const grk_jp2_header_handler grk::jp2_img_header[]
static

◆ K

const float grk::K = 1.230174105f
static

◆ k_max_bit_planes

const uint32_t grk::k_max_bit_planes = 31-T1_NMSEDEC_FRACBITS

◆ managerInstance

minpf_plugin_manager* grk::managerInstance

◆ max_num_components

const uint32_t grk::max_num_components = 16384

◆ max_num_tile_parts

const uint32_t grk::max_num_tile_parts = 65535

Referenced by j2k_calculate_tp().

◆ max_num_tile_parts_per_tile

const uint32_t grk::max_num_tile_parts_per_tile = 255

◆ max_num_tiles

const uint32_t grk::max_num_tiles = 65535

◆ max_passes_per_segment

const uint32_t grk::max_passes_per_segment = (max_precision_jpeg_2000-1) * 3 +1

◆ max_precision_jpeg_2000

const uint32_t grk::max_precision_jpeg_2000 = 38

◆ max_supported_precision

const uint32_t grk::max_supported_precision = 16

◆ max_tile_part_size

const uint32_t grk::max_tile_part_size = UINT_MAX

◆ MCT_ELEMENT_SIZE

const uint32_t grk::MCT_ELEMENT_SIZE[] = { 2, 4, 4, 8 }

◆ mct_norms_irrev

const double grk::mct_norms_irrev[3] = { 1.732, 1.805, 1.573 }
static

◆ mct_norms_rev

const double grk::mct_norms_rev[3] = { 1.732, .8292, .8292 }
static

Referenced by grk::mct::get_norms_rev().

◆ min_packets_per_full_plt

const uint32_t grk::min_packets_per_full_plt = available_packet_len_bytes_per_plt / 5

◆ mqc_states [1/2]

const mqc_state grk::mqc_states[47 *2]
static

Referenced by mqc_resetstates().

◆ mqc_states [2/2]

const mqc_state grk::mqc_states[47 *2]
static

◆ plugin_debug_mqc_next_cxd_method_name

const char* grk::plugin_debug_mqc_next_cxd_method_name
static
Initial value:
=
"plugin_debug_mqc_next_cxd"

Referenced by nextCXD().

◆ plugin_debug_mqc_next_plane_method_name

const char* grk::plugin_debug_mqc_next_plane_method_name
static
Initial value:
=
"plugin_debug_mqc_next_plane"

Referenced by mqc_next_plane().

◆ scale

const double grk::scale = 256 / log(2)

◆ shift

const double grk::shift = 1 << 16

◆ slopeCutoff

const double grk::slopeCutoff = pow(2, 64)

◆ sot_marker_segment_len

const uint32_t grk::sot_marker_segment_len = 12U

◆ SPCod_SPCoc_len

const uint32_t grk::SPCod_SPCoc_len = 5U

◆ tabMaxSubLevelFromMainLevel

const uint16_t grk::tabMaxSubLevelFromMainLevel[]
static
Initial value:
= { 15,
1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9 }

Referenced by grk::Profile::is_imf_compliant().

◆ tag_tree_uninitialized_node_value

const uint32_t grk::tag_tree_uninitialized_node_value = 999

◆ tlm_len_per_tile_part

const uint32_t grk::tlm_len_per_tile_part = 5

◆ tlm_marker_start_bytes

const uint32_t grk::tlm_marker_start_bytes = 6

◆ XMP_UUID

const uint8_t grk::XMP_UUID[16]
Initial value:
= { 0xBE, 0x7A, 0xCF, 0xCB, 0x97, 0xA9, 0x42, 0xE8,
0x9C, 0x71, 0x99, 0x94, 0x91, 0xE3, 0xAF, 0xAC }

Referenced by grk::FileFormat::init_compress(), and grk::FileFormat::read_header().

grk::jp2_read_ftyp
static bool jp2_read_ftyp(FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_size)
Reads a a FTYP box - File type box.
Definition: FileFormat.cpp:2211
JP2_PCLR
#define JP2_PCLR
Palette box.
Definition: FileFormat.h:41
grk::j2k_read_float32_to_int32
void j2k_read_float32_to_int32(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:78
grk::jp2_read_channel_definition
static bool jp2_read_channel_definition(FileFormat *fileFormat, uint8_t *p_cdef_header_data, uint32_t cdef_header_size)
Definition: FileFormat.cpp:1025
JP2_FTYP
#define JP2_FTYP
File type box.
Definition: FileFormat.h:36
grk::jp2_read_xml
static bool jp2_read_xml(FileFormat *fileFormat, uint8_t *p_xml_data, uint32_t xml_size)
Read XML box.
Definition: FileFormat.cpp:635
GRK_LRCP
@ GRK_LRCP
layer-resolution-component-precinct order
Definition: grok.h:291
JP2_CDEF
#define JP2_CDEF
Channel Definition box.
Definition: FileFormat.h:43
JP2_BPCC
#define JP2_BPCC
Bits per component box.
Definition: FileFormat.h:45
grk::j2k_read_float64_to_int32
void j2k_read_float64_to_int32(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:82
grk::j2k_read_int32_to_int32
void j2k_read_int32_to_int32(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:74
grk::j2k_read_int16_to_int32
void j2k_read_int16_to_int32(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:70
grk::j2k_read_int16_to_float
void j2k_read_int16_to_float(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:54
grk::j2k_read_int32_to_float
void j2k_read_int32_to_float(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:58
grk::jp2_read_jp2h
static bool jp2_read_jp2h(FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_size)
Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).
Definition: FileFormat.cpp:2281
grk::j2k_write_float_to_int16
void j2k_write_float_to_int16(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:86
JP2_IHDR
#define JP2_IHDR
Image header box.
Definition: FileFormat.h:38
GRK_PROG_ORDER
enum _GRK_PROG_ORDER GRK_PROG_ORDER
Progression order.
GRK_RPCL
@ GRK_RPCL
resolution-precinct-component-layer order
Definition: grok.h:293
JP2_UUID
#define JP2_UUID
UUID box.
Definition: FileFormat.h:54
grk::jp2_read_uuid
static bool jp2_read_uuid(FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_data_size)
Read a UUID box.
Definition: FileFormat.cpp:653
grk::jp2_read_jp
static bool jp2_read_jp(FileFormat *fileFormat, uint8_t *p_header_data, uint32_t header_size)
Reads a JPEG 2000 file signature box.
Definition: FileFormat.cpp:2173
GRK_PCRL
@ GRK_PCRL
precinct-component-resolution-layer order
Definition: grok.h:294
JP2_COLR
#define JP2_COLR
Colour specification box.
Definition: FileFormat.h:39
grk::jp2_read_palette_clr
static bool jp2_read_palette_clr(FileFormat *fileFormat, uint8_t *p_pclr_header_data, uint32_t pclr_header_size)
Collect palette data.
Definition: FileFormat.cpp:1637
JP2_JP
#define JP2_JP
JPEG 2000 signature box.
Definition: FileFormat.h:35
grk::jp2_read_bpc
static bool jp2_read_bpc(FileFormat *fileFormat, uint8_t *p_bpc_header_data, uint32_t bpc_header_size)
Reads a Bit per Component box.
Definition: FileFormat.cpp:896
grk::jp2_read_colr
static bool jp2_read_colr(FileFormat *fileFormat, uint8_t *p_colr_header_data, uint32_t colr_header_size)
Reads the Color Specification box.
Definition: FileFormat.cpp:1176
grk::jp2_read_ihdr
static bool jp2_read_ihdr(FileFormat *fileFormat, uint8_t *p_image_header_data, uint32_t image_header_size)
Reads a IHDR box - Image Header box.
Definition: FileFormat.cpp:473
grk::j2k_read_float32_to_float
void j2k_read_float32_to_float(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:62
grk::j2k_write_float_to_float64
void j2k_write_float_to_float64(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:98
grk::jp2_read_component_mapping
static bool jp2_read_component_mapping(FileFormat *fileFormat, uint8_t *component_mapping_header_data, uint32_t component_mapping_header_size)
Collect component mapping data.
Definition: FileFormat.cpp:1519
grk::jp2_read_res
static bool jp2_read_res(FileFormat *fileFormat, uint8_t *p_resolution_data, uint32_t resolution_size)
Reads a Resolution box.
Definition: FileFormat.cpp:712
GRK_CPRL
@ GRK_CPRL
component-precinct-resolution-layer order
Definition: grok.h:295
grk::j2k_write_float_to_int32
void j2k_write_float_to_int32(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:90
JP2_CMAP
#define JP2_CMAP
Component Mapping box.
Definition: FileFormat.h:42
grk::j2k_write_float_to_float
void j2k_write_float_to_float(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:94
JP2_JP2H
#define JP2_JP2H
JP2 header box (super-box)
Definition: FileFormat.h:37
JP2_XML
#define JP2_XML
XML box.
Definition: FileFormat.h:53
JP2_RES
#define JP2_RES
Resolution box (super-box)
Definition: FileFormat.h:48
GRK_RLCP
@ GRK_RLCP
resolution-layer-component-precinct order
Definition: grok.h:292
grk::j2k_read_float64_to_float
void j2k_read_float64_to_float(const void *p_src_data, void *p_dest_data, uint64_t nb_elem)
Definition: markers.cpp:66