OpenJPEG  2.5.0
Macros | Functions
jp2k_encoder.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include "jp2k_encoder.h"
#include "j2kheader_manager.h"
#include "imgreg_manager.h"
#include "opj_inttypes.h"

Macros

#define FCGI_stdout   stdout
 
#define FCGI_stderr   stderr
 
#define logstream   stderr
 

Functions

message_param_tsearch_message (Byte8_t class_id, Byte8_t in_class_id, Byte8_t csn, message_param_t *msg)
 search a message by class_id More...
 
Byte_trecons_codestream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, int fw, int fh, Byte8_t *codelen)
 reconstruct j2k codestream from JPT- (in future, JPP-) stream More...
 
Byte_trecons_j2k (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, int fw, int fh, Byte8_t *j2klen)
 reconstruct j2k codestream from message queue More...
 
Byte_tadd_emptyboxstream (placeholder_param_t *phld, Byte_t *jp2stream, Byte8_t *jp2len)
 
Byte_tadd_msgstream (message_param_t *message, Byte_t *origstream, Byte_t *j2kstream, Byte8_t *j2klen)
 
Byte_trecons_jp2 (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, Byte8_t *jp2len)
 reconstruct jp2 file codestream from message queue More...
 
OPJ_BOOL isJPPstream (Byte8_t csn, msgqueue_param_t *msgqueue)
 
Byte_trecons_codestream_from_JPTstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, int fw, int fh, Byte8_t *j2klen)
 
Byte_trecons_codestream_from_JPPstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, int fw, int fh, Byte8_t *j2klen)
 
Byte_tadd_EOC (Byte_t *j2kstream, Byte8_t *j2klen)
 
Byte_tadd_mainhead_msgstream (msgqueue_param_t *msgqueue, Byte_t *origstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t *j2klen)
 
Byte8_t get_last_tileID (msgqueue_param_t *msgqueue, Byte8_t csn, OPJ_BOOL isJPPstream)
 
Byte_tadd_emptytilestream (const Byte8_t tileID, Byte_t *j2kstream, Byte8_t *j2klen)
 
Byte_tadd_SOTmkr (Byte_t *j2kstream, Byte8_t *j2klen)
 
Byte_trecons_bitstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int mindeclev, int *max_reslev, Byte8_t *j2klen)
 
Byte_trecons_LRCPbitstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int mindeclev, int *max_reslev, Byte8_t *j2klen)
 
Byte_trecons_RLCPbitstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int mindeclev, int *max_reslev, Byte8_t *j2klen)
 
Byte_trecons_RPCLbitstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int mindeclev, int *max_reslev, Byte8_t *j2klen)
 
Byte_trecons_PCRLbitstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int mindeclev, int *max_reslev, Byte8_t *j2klen)
 
Byte_trecons_CPRLbitstream (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int mindeclev, int *max_reslev, Byte8_t *j2klen)
 
int comp_numOfprcts (Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int r)
 
Byte8_t comp_seqID (Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int r, int p)
 
Byte_trecons_packet (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int *max_reslev, int comp_idx, int res_idx, int prct_idx, int lay_idx, Byte8_t *j2klen)
 
Byte_trecons_precinct (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte_t *j2kstream, Byte8_t csn, Byte8_t tileID, SIZmarker_param_t SIZ, CODmarker_param_t COD, int *max_reslev, int comp_idx, int res_idx, Byte8_t seqID, Byte8_t *j2klen)
 
Byte_tadd_padding (Byte8_t padding, Byte_t *j2kstream, Byte8_t *j2klen)
 
Byte_tgene_msgstream (message_param_t *message, Byte_t *stream, Byte8_t *length)
 
Byte_tgene_emptytilestream (const Byte8_t tileID, Byte8_t *length)
 
Byte_trecons_j2kmainhead (msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, Byte8_t *j2klen)
 reconstruct j2k codestream of mainheader from message queue More...
 

Macro Definition Documentation

◆ FCGI_stderr

#define FCGI_stderr   stderr

◆ FCGI_stdout

#define FCGI_stdout   stdout

◆ logstream

#define logstream   stderr

Function Documentation

◆ add_emptyboxstream()

Byte_t * add_emptyboxstream ( placeholder_param_t phld,
Byte_t jp2stream,
Byte8_t jp2len 
)

◆ add_emptytilestream()

Byte_t * add_emptytilestream ( const Byte8_t  tileID,
Byte_t j2kstream,
Byte8_t j2klen 
)

◆ add_EOC()

Byte_t * add_EOC ( Byte_t j2kstream,
Byte8_t j2klen 
)

◆ add_mainhead_msgstream()

Byte_t * add_mainhead_msgstream ( msgqueue_param_t msgqueue,
Byte_t origstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t j2klen 
)

◆ add_msgstream()

Byte_t * add_msgstream ( message_param_t message,
Byte_t origstream,
Byte_t j2kstream,
Byte8_t j2klen 
)

◆ add_padding()

Byte_t * add_padding ( Byte8_t  padding,
Byte_t j2kstream,
Byte8_t j2klen 
)

References opj_free(), and opj_malloc().

Referenced by recons_packet(), and recons_precinct().

◆ add_SOTmkr()

Byte_t * add_SOTmkr ( Byte_t j2kstream,
Byte8_t j2klen 
)

◆ comp_numOfprcts()

int comp_numOfprcts ( Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  r 
)

◆ comp_seqID()

Byte8_t comp_seqID ( Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  r,
int  p 
)

◆ gene_emptytilestream()

Byte_t * gene_emptytilestream ( const Byte8_t  tileID,
Byte8_t length 
)

References opj_malloc().

Referenced by add_emptytilestream().

◆ gene_msgstream()

Byte_t * gene_msgstream ( message_param_t message,
Byte_t stream,
Byte8_t length 
)

◆ get_last_tileID()

Byte8_t get_last_tileID ( msgqueue_param_t msgqueue,
Byte8_t  csn,
OPJ_BOOL  isJPPstream 
)

◆ isJPPstream()

OPJ_BOOL isJPPstream ( Byte8_t  csn,
msgqueue_param_t msgqueue 
)

◆ recons_bitstream()

Byte_t * recons_bitstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  mindeclev,
int *  max_reslev,
Byte8_t j2klen 
)

◆ recons_codestream()

Byte_t * recons_codestream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte8_t  csn,
int  fw,
int  fh,
Byte8_t codelen 
)

reconstruct j2k codestream from JPT- (in future, JPP-) stream

Parameters
[in]msgqueuemessage queue pointer
[in]jpipstreamoriginal JPT- JPP- stream
[in]csncodestream number
[in]fwreconstructing image frame width
[in]fhreconstructing image frame height
[out]codelencodestream length
Returns
generated reconstructed j2k codestream

References isJPPstream(), recons_codestream_from_JPPstream(), and recons_codestream_from_JPTstream().

Referenced by recons_j2k(), and recons_jp2().

◆ recons_codestream_from_JPPstream()

Byte_t * recons_codestream_from_JPPstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte8_t  csn,
int  fw,
int  fh,
Byte8_t j2klen 
)

◆ recons_codestream_from_JPTstream()

Byte_t * recons_codestream_from_JPTstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte8_t  csn,
int  fw,
int  fh,
Byte8_t j2klen 
)

◆ recons_CPRLbitstream()

Byte_t * recons_CPRLbitstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  mindeclev,
int *  max_reslev,
Byte8_t j2klen 
)

◆ recons_j2k()

Byte_t* recons_j2k ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte8_t  csn,
int  fw,
int  fh,
Byte8_t j2klen 
)

reconstruct j2k codestream from message queue

Parameters
[in]msgqueuemessage queue pointer
[in]jpipstreamoriginal jpt- jpp- stream
[in]csncodestream number
[in]fwreconstructing image frame width
[in]fhreconstructing image frame height
[out]j2klenpointer to the j2k codestream length
Returns
generated reconstructed j2k codestream

References recons_codestream().

Referenced by decode_jpip(), and jpipstream_to_pnm().

◆ recons_j2kmainhead()

Byte_t* recons_j2kmainhead ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte8_t  csn,
Byte8_t j2klen 
)

reconstruct j2k codestream of mainheader from message queue

Parameters
[in]msgqueuemessage queue pointer
[in]jpipstreamoriginal jpt- jpp- stream
[in]csncodestream number
[out]j2klenpointer to the j2k codestream length
Returns
generated reconstructed j2k codestream

References add_mainhead_msgstream().

Referenced by get_SIZ_from_jpipstream().

◆ recons_jp2()

Byte_t* recons_jp2 ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte8_t  csn,
Byte8_t jp2len 
)

reconstruct jp2 file codestream from message queue

Parameters
[in]msgqueuemessage queue pointer
[in]jpipstreamoriginal jpt- jpp- stream
[in]csncodestream number
[out]jp2lenpointer to the jp2 codestream length
Returns
generated reconstructed jp2 codestream

References add_emptyboxstream(), add_msgstream(), msgqueue_param::first, METADATA_MSG, message_param::next, opj_free(), placeholder_param::OrigBH, placeholder_param::OrigBHlen, message_param::phld, recons_codestream(), and search_message().

Referenced by decode_jpip(), and handle_JP2saveMSG().

◆ recons_LRCPbitstream()

Byte_t * recons_LRCPbitstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  mindeclev,
int *  max_reslev,
Byte8_t j2klen 
)

◆ recons_packet()

Byte_t * recons_packet ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int *  max_reslev,
int  comp_idx,
int  res_idx,
int  prct_idx,
int  lay_idx,
Byte8_t j2klen 
)

◆ recons_PCRLbitstream()

Byte_t * recons_PCRLbitstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  mindeclev,
int *  max_reslev,
Byte8_t j2klen 
)

◆ recons_precinct()

Byte_t * recons_precinct ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int *  max_reslev,
int  comp_idx,
int  res_idx,
Byte8_t  seqID,
Byte8_t j2klen 
)

◆ recons_RLCPbitstream()

Byte_t * recons_RLCPbitstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  mindeclev,
int *  max_reslev,
Byte8_t j2klen 
)

◆ recons_RPCLbitstream()

Byte_t * recons_RPCLbitstream ( msgqueue_param_t msgqueue,
Byte_t jpipstream,
Byte_t j2kstream,
Byte8_t  csn,
Byte8_t  tileID,
SIZmarker_param_t  SIZ,
CODmarker_param_t  COD,
int  mindeclev,
int *  max_reslev,
Byte8_t j2klen 
)

◆ search_message()

message_param_t * search_message ( Byte8_t  class_id,
Byte8_t  in_class_id,
Byte8_t  csn,
message_param_t msg 
)

search a message by class_id

Parameters
[in]class_idclass identifiers
[in]in_class_idin-class identifiers, -1 means any
[in]csncodestream number
[in]msgfirst message pointer of the searching list
Returns
found message pointer

References message_param::class_id, message_param::csn, message_param::in_class_id, and message_param::next.

Referenced by add_mainhead_msgstream(), recons_codestream_from_JPPstream(), recons_codestream_from_JPTstream(), recons_jp2(), recons_packet(), and recons_precinct().