Reformat: apply reformattin on .h files (#128)

This commit is contained in:
Even Rouault 2017-05-15 12:21:30 +02:00
parent 28d2eabca7
commit 3c2972f924
129 changed files with 7459 additions and 7139 deletions

View File

@ -47,7 +47,7 @@ set -e
# determine changed files
MODIFIED=$(git status --porcelain| ${GP}sed -ne "s/^ *[MA] *//p" | sort -u)
#MODIFIED=$(find src -name "*.c")
#MODIFIED=$(find src -name "*.h")
if [ -z "$MODIFIED" ]; then
echo nothing was modified

View File

@ -3,8 +3,7 @@
#ifndef _GETOPT_H_
#define _GETOPT_H_
typedef struct opj_option
{
typedef struct opj_option {
const char *name;
int has_arg;
int *flag;

View File

@ -71,14 +71,18 @@ void clip_component(opj_image_comp_t* component, OPJ_UINT32 precision);
void scale_component(opj_image_comp_t* component, OPJ_UINT32 precision);
/* planar / interleaved conversions */
typedef void (* convert_32s_CXPX)(const OPJ_INT32* pSrc, OPJ_INT32* const* pDst, OPJ_SIZE_T length);
typedef void (* convert_32s_CXPX)(const OPJ_INT32* pSrc, OPJ_INT32* const* pDst,
OPJ_SIZE_T length);
extern const convert_32s_CXPX convert_32s_CXPX_LUT[5];
typedef void (* convert_32s_PXCX)(OPJ_INT32 const* const* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length, OPJ_INT32 adjust);
typedef void (* convert_32s_PXCX)(OPJ_INT32 const* const* pSrc, OPJ_INT32* pDst,
OPJ_SIZE_T length, OPJ_INT32 adjust);
extern const convert_32s_PXCX convert_32s_PXCX_LUT[5];
/* bit depth conversions */
typedef void (* convert_XXx32s_C1R)(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length);
typedef void (* convert_XXx32s_C1R)(const OPJ_BYTE* pSrc, OPJ_INT32* pDst,
OPJ_SIZE_T length);
extern const convert_XXx32s_C1R convert_XXu32s_C1R_LUT[9]; /* up to 8bpp */
typedef void (* convert_32sXXx_C1R)(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length);
typedef void (* convert_32sXXx_C1R)(const OPJ_INT32* pSrc, OPJ_BYTE* pDst,
OPJ_SIZE_T length);
extern const convert_32sXXx_C1R convert_32sXXu_C1R_LUT[9]; /* up to 8bpp */
@ -108,12 +112,15 @@ int imagetopnm(opj_image_t *image, const char *outfile, int force_split);
/* RAW conversion */
int imagetoraw(opj_image_t * image, const char *outfile);
int imagetorawl(opj_image_t * image, const char *outfile);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
opj_image_t* rawltoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters,
raw_cparameters_t *raw_cp);
opj_image_t* rawltoimage(const char *filename, opj_cparameters_t *parameters,
raw_cparameters_t *raw_cp);
/* PNG conversion*/
extern int imagetopng(opj_image_t *image, const char *write_idf);
extern opj_image_t* pngtoimage(const char *filename, opj_cparameters_t *parameters);
extern opj_image_t* pngtoimage(const char *filename,
opj_cparameters_t *parameters);
#endif /* __J2K_CONVERT_H */

View File

@ -365,8 +365,7 @@ static DIR *opendir(const char *dirname)
strcpy(dirp->dirname, dirname);
p = strchr(dirp->dirname, '\0');
if (dirp->dirname < p &&
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':')
{
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') {
strcpy(p++, "\\");
}
# ifdef DIRENT_WIN32_INTERFACE
@ -520,7 +519,9 @@ closedir (DIR *dirp)
}
/* free directory name and search handles */
if (dirp->dirname != NULL) free (dirp->dirname);
if (dirp->dirname != NULL) {
free(dirp->dirname);
}
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
@ -619,8 +620,7 @@ _initdir (DIR *dirp)
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findfirst(dirp->dirname,
_A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN,
&dirp->current.data) != 0)
{
&dirp->current.data) != 0) {
/* _dos_findfirst and findfirst will set errno to ENOENT when no
* more entries could be retrieved. */
return 0;
@ -656,7 +656,8 @@ _getdirname (const struct dirent *dp)
* Copy name of implementation dependent directory entry to the d_name field.
*/
static void
_setdirname (struct DIR *dirp) {
_setdirname(struct DIR *dirp)
{
/* make sure that d_name is long enough */
assert(strlen(_getdirname(&dirp->current)) <= NAME_MAX);

3
src/bin/jp3d/convert.h Executable file → Normal file
View File

@ -41,7 +41,8 @@ opj_volume_t* pgxtovolume(char *filename, opj_cparameters_t *parameters);
int volumetopgx(opj_volume_t *volume, char *outfile);
opj_volume_t* bintovolume(char *filename,char *fileimg, opj_cparameters_t *parameters);
opj_volume_t* bintovolume(char *filename, char *fileimg,
opj_cparameters_t *parameters);
int volumetobin(opj_volume_t *volume, char *outfile);

0
src/bin/jp3d/getopt.h Executable file → Normal file
View File

View File

@ -364,8 +364,7 @@ static DIR *opendir(const char *dirname)
strcpy(dirp->dirname, dirname);
p = strchr(dirp->dirname, '\0');
if (dirp->dirname < p &&
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':')
{
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') {
strcpy(p++, "\\");
}
# ifdef DIRENT_WIN32_INTERFACE
@ -519,7 +518,9 @@ closedir (DIR *dirp)
}
/* free directory name and search handles */
if (dirp->dirname != NULL) free (dirp->dirname);
if (dirp->dirname != NULL) {
free(dirp->dirname);
}
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
@ -618,8 +619,7 @@ _initdir (DIR *dirp)
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findfirst(dirp->dirname,
_A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN,
&dirp->current.data) != 0)
{
&dirp->current.data) != 0) {
/* _dos_findfirst and findfirst will set errno to ENOENT when no
* more entries could be retrieved. */
return 0;
@ -655,7 +655,8 @@ _getdirname (const struct dirent *dp)
* Copy name of implementation dependent directory entry to the d_name field.
*/
static void
_setdirname (struct DIR *dirp) {
_setdirname(struct DIR *dirp)
{
/* make sure that d_name is long enough */
assert(strlen(_getdirname(&dirp->current)) <= NAME_MAX);

View File

@ -78,11 +78,13 @@ int imagetopnm(opj_image_t *image, const char *outfile);
/* RAW conversion */
int imagetoraw(opj_image_t * image, const char *outfile);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters,
raw_cparameters_t *raw_cp);
/* PNG conversion*/
extern int imagetopng(opj_image_t *image, const char *write_idf);
extern opj_image_t* pngtoimage(const char *filename, opj_cparameters_t *parameters);
extern opj_image_t* pngtoimage(const char *filename,
opj_cparameters_t *parameters);
#endif /* __J2K_CONVERT_H */

View File

@ -365,8 +365,7 @@ static DIR *opendir(const char *dirname)
strcpy(dirp->dirname, dirname);
p = strchr(dirp->dirname, '\0');
if (dirp->dirname < p &&
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':')
{
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') {
strcpy(p++, "\\");
}
# ifdef DIRENT_WIN32_INTERFACE
@ -520,7 +519,9 @@ closedir (DIR *dirp)
}
/* free directory name and search handles */
if (dirp->dirname != NULL) free (dirp->dirname);
if (dirp->dirname != NULL) {
free(dirp->dirname);
}
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
@ -619,8 +620,7 @@ _initdir (DIR *dirp)
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findfirst(dirp->dirname,
_A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN,
&dirp->current.data) != 0)
{
&dirp->current.data) != 0) {
/* _dos_findfirst and findfirst will set errno to ENOENT when no
* more entries could be retrieved. */
return 0;
@ -656,7 +656,8 @@ _getdirname (const struct dirent *dp)
* Copy name of implementation dependent directory entry to the d_name field.
*/
static void
_setdirname (struct DIR *dirp) {
_setdirname(struct DIR *dirp)
{
/* make sure that d_name is long enough */
assert(strlen(_getdirname(&dirp->current)) <= NAME_MAX);

View File

@ -9,5 +9,6 @@
void xml_write_init(BOOL n, BOOL t, BOOL r, BOOL d);
int xml_write_struct(FILE *file, FILE *xmlout, opj_mj2_t * movie, unsigned int sampleframe, char* stringDTD, opj_event_mgr_t *event_mgr);
int xml_write_struct(FILE *file, FILE *xmlout, opj_mj2_t * movie,
unsigned int sampleframe, char* stringDTD, opj_event_mgr_t *event_mgr);

View File

@ -184,13 +184,23 @@ class OPJViewerApp: public wxApp
public:
// class constructor
OPJViewerApp() { m_showImages = true; m_showButtons = false; }
OPJViewerApp()
{
m_showImages = true;
m_showButtons = false;
}
// other methods
bool OnInit(void);
int OnExit(void);
void SetShowImages(bool show) { m_showImages = show; }
bool ShowImages() const { return m_showImages; }
void SetShowImages(bool show)
{
m_showImages = show;
}
bool ShowImages() const
{
return m_showImages;
}
void ShowCmdLine(const wxCmdLineParser& parser);
// all the threads currently alive - as soon as the thread terminates, it's
@ -205,7 +215,8 @@ class OPJViewerApp: public wxApp
// the last exiting thread should post to m_semAllDone if this is true
// (protected by the same m_critsect)
bool m_deco_waitingUntilAllDone, m_parse_waitingUntilAllDone, m_enco_waitingUntilAllDone;
bool m_deco_waitingUntilAllDone, m_parse_waitingUntilAllDone,
m_enco_waitingUntilAllDone;
// the list of all filenames written in the command line
wxArrayString m_filelist;
@ -225,8 +236,10 @@ class OPJViewerApp: public wxApp
// encoding engine parameters
wxString m_subsampling, m_origin, m_rates, m_comment, m_index, m_quality;
wxString m_cbsize, m_prsize, m_tsize, m_torigin, m_poc;
bool m_enablecomm, m_enableidx, m_multicomp, m_irreversible, m_enablesop, m_enableeph;
bool m_enablebypass, m_enablereset, m_enablerestart, m_enablevsc, m_enableerterm;
bool m_enablecomm, m_enableidx, m_multicomp, m_irreversible, m_enablesop,
m_enableeph;
bool m_enablebypass, m_enablereset, m_enablerestart, m_enablevsc,
m_enableerterm;
bool m_enablesegmark, m_enablepoc;
bool m_enablequality;
int m_resolutions, m_progression;
@ -261,11 +274,13 @@ class OPJCanvas: public wxScrolledWindow
public:
// class constructor
OPJCanvas(wxFileName fname, wxWindow *parent, const wxPoint& pos, const wxSize& size);
OPJCanvas(wxFileName fname, wxWindow *parent, const wxPoint& pos,
const wxSize& size);
virtual void OnDraw(wxDC& dc);
void OnEvent(wxMouseEvent& event);
void WriteText(const wxString& text) {
void WriteText(const wxString& text)
{
#ifndef __WXGTK__
wxMutexGuiEnter();
#endif //__WXGTK__
@ -299,11 +314,23 @@ class OPJMarkerData : public wxTreeItemData
public:
// class constructor
OPJMarkerData(const wxString& desc, const wxString& fname = wxT(""), wxFileOffset start = 0, wxFileOffset length = 0) : m_desc(desc), m_filestring(fname) { m_start = start; m_length = length; }
OPJMarkerData(const wxString& desc, const wxString& fname = wxT(""),
wxFileOffset start = 0, wxFileOffset length = 0) : m_desc(desc),
m_filestring(fname)
{
m_start = start;
m_length = length;
}
void ShowInfo(wxTreeCtrl *tree);
const wxChar *GetDesc1() const { return m_desc.c_str(); }
const wxChar *GetDesc2() const { return m_filestring.c_str(); }
const wxChar *GetDesc1() const
{
return m_desc.c_str();
}
const wxChar *GetDesc2() const
{
return m_filestring.c_str();
}
wxFileOffset m_start, m_length;
wxString m_desc;
@ -316,8 +343,7 @@ class OPJMarkerData : public wxTreeItemData
class OPJMarkerTree : public wxTreeCtrl
{
public:
enum
{
enum {
TreeCtrlIcon_File,
TreeCtrlIcon_FileSelected,
TreeCtrlIcon_Folder,
@ -326,12 +352,19 @@ public:
};
OPJMarkerTree() { };
OPJMarkerTree(wxWindow *parent, OPJChildFrame *subframe, wxFileName fname, wxString name, const wxWindowID id,
OPJMarkerTree(wxWindow *parent, OPJChildFrame *subframe, wxFileName fname,
wxString name, const wxWindowID id,
const wxPoint& pos, const wxSize& size,
long style);
virtual ~OPJMarkerTree() {};
OPJParseThread *CreateParseThread(wxTreeItemId parentid = 0x00, OPJChildFrame *subframe = NULL);
void WriteText(const wxString& text) { wxMutexGuiEnter(); wxLogMessage(text); wxMutexGuiLeave(); }
OPJParseThread *CreateParseThread(wxTreeItemId parentid = 0x00,
OPJChildFrame *subframe = NULL);
void WriteText(const wxString& text)
{
wxMutexGuiEnter();
wxLogMessage(text);
wxMutexGuiLeave();
}
wxFileName m_fname;
wxTextCtrl *m_peektextCtrl;
@ -372,9 +405,15 @@ public:
/*void DoToggleIcon(const wxTreeItemId& item);*/
/*void ShowMenu(wxTreeItemId id, const wxPoint& pt);*/
int ImageSize(void) const { return m_imageSize; }
int ImageSize(void) const
{
return m_imageSize;
}
void SetLastItem(wxTreeItemId id) { m_lastItem = id; }
void SetLastItem(wxTreeItemId id)
{
m_lastItem = id;
}
protected:
/*virtual int OnCompareItems(const wxTreeItemId& i1, const wxTreeItemId& i2);*/
@ -408,17 +447,20 @@ private:
};
// this hash map stores all the trees of currently opened images, with an integer key
WX_DECLARE_HASH_MAP(int, OPJMarkerTree*, wxIntegerHash, wxIntegerEqual, OPJMarkerTreeHash);
WX_DECLARE_HASH_MAP(int, OPJMarkerTree*, wxIntegerHash, wxIntegerEqual,
OPJMarkerTreeHash);
// this hash map stores all the children of currently opened images, with an integer key
WX_DECLARE_HASH_MAP(int, OPJChildFrame*, wxIntegerHash, wxIntegerEqual, OPJChildFrameHash);
WX_DECLARE_HASH_MAP(int, OPJChildFrame*, wxIntegerHash, wxIntegerEqual,
OPJChildFrameHash);
// Define a new frame
class OPJFrame: public wxMDIParentFrame
{
public:
OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, const long style);
~OPJFrame(void);
void OnSize(wxSizeEvent& WXUNUSED(event));
@ -486,7 +528,9 @@ class OPJChildFrame: public wxMDIChildFrame
{
public:
OPJCanvas *m_canvas;
OPJChildFrame(OPJFrame *parent, wxFileName fname, int winnumber, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
OPJChildFrame(OPJFrame *parent, wxFileName fname, int winnumber,
const wxString& title, const wxPoint& pos, const wxSize& size,
const long style);
~OPJChildFrame(void);
void OnActivate(wxActivateEvent& event);
/*void OnQuit(wxCommandEvent& WXUNUSED(event));*/
@ -541,8 +585,7 @@ enum {
// menu and control ids
enum
{
enum {
TreeTest_Quit = wxID_EXIT,
TreeTest_About = wxID_ABOUT,
TreeTest_TogButtons = wxID_HIGHEST,
@ -646,17 +689,21 @@ public:
// write something to the text control
void WriteText(const wxString& text);
void LoadFile(wxFileName fname);
void ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOffset length, wxTreeItemId parentid);
void ParseJP2File(wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit, wxTreeItemId parentid);
void ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOffset length,
wxTreeItemId parentid);
void ParseJP2File(wxFile *fileid, wxFileOffset filepoint,
wxFileOffset filelimit, wxTreeItemId parentid);
unsigned m_count;
OPJMarkerTree *m_tree;
wxTreeItemId m_parentid;
private:
int jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit,
int jpeg2000parse(wxFile *fileid, wxFileOffset filepoint,
wxFileOffset filelimit,
wxTreeItemId parentid, int level, char *scansign, unsigned long int *scanpoint);
int box_handler_function(int boxtype, wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit,
int box_handler_function(int boxtype, wxFile *fileid, wxFileOffset filepoint,
wxFileOffset filelimit,
wxTreeItemId parentid, int level, char *scansign, unsigned long int *scanpoint);
};
@ -666,7 +713,10 @@ private:
class OPJDnDFile: public wxFileDropTarget
{
public:
OPJDnDFile(OPJFrame *pOwner) { m_pOwner = pOwner; }
OPJDnDFile(OPJFrame *pOwner)
{
m_pOwner = pOwner;
}
virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
private:
@ -711,12 +761,14 @@ public:
wxTextCtrl *m_subsamplingCtrl, *m_originCtrl, *m_rateCtrl, *m_commentCtrl;
wxRadioButton *m_rateRadio, *m_qualityRadio;
wxTextCtrl *m_indexCtrl, *m_qualityCtrl, *m_cbsizeCtrl, *m_prsizeCtrl, *m_pocCtrl;
wxTextCtrl *m_indexCtrl, *m_qualityCtrl, *m_cbsizeCtrl, *m_prsizeCtrl,
*m_pocCtrl;
wxTextCtrl *m_tsizeCtrl, *m_toriginCtrl;
wxRadioBox *progressionBox;
wxCheckBox *m_enablecommCheck, *m_enableidxCheck, *m_mctCheck, *m_irrevCheck;
wxCheckBox *m_sopCheck, *m_ephCheck, *m_enablebypassCheck, *m_enableresetCheck,
*m_enablerestartCheck, *m_enablevscCheck, *m_enableertermCheck, *m_enablesegmarkCheck;
*m_enablerestartCheck, *m_enablevscCheck, *m_enableertermCheck,
*m_enablesegmarkCheck;
wxCheckBox *m_enablepocCheck, *m_enablejpwlCheck;
wxSpinCtrl *m_resolutionsCtrl;

View File

@ -35,7 +35,9 @@ wxT("<font size=-2 color=green>JPSEC</font> ")
#endif // USE_JPSEC
wxT(")</font><br>")
#ifdef USE_MXF
wxT("<font size=-2 color=red>* MXFLib " MXFLIB_VERSION_MAJOR "." MXFLIB_VERSION_MINOR "." MXFLIB_VERSION_TWEAK " (" MXFLIB_VERSION_BUILD ")</font><br>")
wxT("<font size=-2 color=red>* MXFLib " MXFLIB_VERSION_MAJOR "."
MXFLIB_VERSION_MINOR "." MXFLIB_VERSION_TWEAK " (" MXFLIB_VERSION_BUILD
")</font><br>")
#endif // USE_MXF
wxT("</td>"
"</tr>"

View File

@ -165,8 +165,10 @@ public:
wxString m_poc;
#if wxUSE_STREAMS
virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1);
virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true);
virtual bool LoadFile(wxImage *image, wxInputStream& stream,
bool verbose = true, int index = -1);
virtual bool SaveFile(wxImage *image, wxOutputStream& stream,
bool verbose = true);
protected:
virtual bool DoCanRead(wxInputStream& stream);
#endif

View File

@ -86,8 +86,10 @@ public:
#endif // USE_JPWL
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
virtual bool LoadFile(wxImage *image, wxInputStream& stream,
bool verbose = true, int index = -1);
virtual bool SaveFile(wxImage *image, wxOutputStream& stream,
bool verbose = true);
protected:
virtual bool DoCanRead(wxInputStream& stream);
#endif

View File

@ -50,7 +50,8 @@
* @param[in] j2klen length of j2k codestream
* @return length of cidx box
*/
int opj_write_cidx( int offset, opj_stream_private_t *cio, opj_codestream_info_t cstr_info, int j2klen,
int opj_write_cidx(int offset, opj_stream_private_t *cio,
opj_codestream_info_t cstr_info, int j2klen,
opj_event_mgr_t * p_manager);
/*
@ -62,7 +63,8 @@ int opj_write_cidx( int offset, opj_stream_private_t *cio, opj_codestream_info_t
* @param[in] cio file output handle
* @return true if EPH is used
*/
OPJ_BOOL opj_check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_stream_private_t *cio,
OPJ_BOOL opj_check_EPHuse(int coff, opj_marker_info_t *markers, int marknum,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
#endif /* !CIDX_MANAGER_H_ */

View File

@ -78,8 +78,7 @@ The functions in CIO.C have for goal to realize a byte input / output process.
/**
Byte input-output stream.
*/
typedef struct opj_stream_private
{
typedef struct opj_stream_private {
/**
* User data, be it files, ... The actual data depends on the type of the stream.
*/
@ -132,12 +131,14 @@ typedef struct opj_stream_private
/**
* FIXME DOC.
*/
OPJ_OFF_T (* m_opj_skip)(struct opj_stream_private * ,OPJ_OFF_T , struct opj_event_mgr *);
OPJ_OFF_T(* m_opj_skip)(struct opj_stream_private *, OPJ_OFF_T,
struct opj_event_mgr *);
/**
* FIXME DOC.
*/
OPJ_BOOL (* m_opj_seek) (struct opj_stream_private * , OPJ_OFF_T , struct opj_event_mgr *);
OPJ_BOOL(* m_opj_seek)(struct opj_stream_private *, OPJ_OFF_T,
struct opj_event_mgr *);
/**
* number of bytes containing in the buffer.
@ -172,7 +173,8 @@ opj_stream_private_t;
* @param p_value the value to write
* @param p_nb_bytes the number of bytes to write
*/
void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);
void opj_write_bytes_BE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value,
OPJ_UINT32 p_nb_bytes);
/**
* Reads some bytes from the given data buffer, this function is used in Big Endian cpus.
@ -181,7 +183,8 @@ void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
* @param p_nb_bytes the nb bytes to read.
* @return the number of bytes read or -1 if an error occurred.
*/
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value,
OPJ_UINT32 p_nb_bytes);
/**
* Write some bytes to the given data buffer, this function is used in Little Endian cpus.
@ -190,7 +193,8 @@ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT
* @param p_nb_bytes the number of bytes to write
* @return the number of bytes written or -1 if an error occurred
*/
void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);
void opj_write_bytes_LE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value,
OPJ_UINT32 p_nb_bytes);
/**
* Reads some bytes from the given data buffer, this function is used in Little Endian cpus.
@ -199,7 +203,8 @@ void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
* @param p_nb_bytes the nb bytes to read.
* @return the number of bytes read or -1 if an error occurred.
*/
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value,
OPJ_UINT32 p_nb_bytes);
/**
@ -266,7 +271,8 @@ void opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value);
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes read, or -1 if an error occurred or if the stream is at the end.
*/
OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_SIZE_T opj_stream_read_data(opj_stream_private_t * p_stream,
OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Writes some bytes to the stream.
@ -276,7 +282,9 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes writtent, or -1 if an error occurred.
*/
OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_SIZE_T opj_stream_write_data(opj_stream_private_t * p_stream,
const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Writes the content of the stream buffer to the stream.
@ -284,7 +292,8 @@ OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE
* @param p_event_mgr the user event manager to be notified of special events.
* @return true if the data could be flushed, false else.
*/
OPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_flush(opj_stream_private_t * p_stream,
struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -293,7 +302,8 @@ OPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, struct opj_event_mgr
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_OFF_T opj_stream_skip(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Tells the byte offset on the stream (similar to ftell).
@ -312,7 +322,8 @@ OPJ_OFF_T opj_stream_tell (const opj_stream_private_t * p_stream);
*
* @return Number of bytes left before the end of the stream.
*/
OPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream);
OPJ_OFF_T opj_stream_get_number_byte_left(const opj_stream_private_t *
p_stream);
/**
* Skips a number of bytes from the stream.
@ -321,7 +332,8 @@ OPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_OFF_T opj_stream_write_skip(opj_stream_private_t * p_stream,
OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -330,7 +342,8 @@ OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_si
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_OFF_T opj_stream_read_skip(opj_stream_private_t * p_stream,
OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -339,7 +352,8 @@ OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
* @param p_event_mgr the user event manager to be notified of special events.
* @return OPJ_TRUE if success, or OPJ_FALSE if an error occurred.
*/
OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_read_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -348,7 +362,8 @@ OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_write_seek(opj_stream_private_t * p_stream,
OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Seeks a number of bytes from the stream.
@ -357,7 +372,8 @@ OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
* @param p_event_mgr the user event manager to be notified of special events.
* @return true if the stream is seekable.
*/
OPJ_BOOL opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Tells if the given stream is seekable.
@ -367,12 +383,14 @@ OPJ_BOOL opj_stream_has_seek (const opj_stream_private_t * p_stream);
/**
* FIXME DOC.
*/
OPJ_SIZE_T opj_stream_default_read (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);
OPJ_SIZE_T opj_stream_default_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
void * p_user_data);
/**
* FIXME DOC.
*/
OPJ_SIZE_T opj_stream_default_write (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);
OPJ_SIZE_T opj_stream_default_write(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
void * p_user_data);
/**
* FIXME DOC.

View File

@ -67,7 +67,8 @@ Apply a reversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode
*/
OPJ_BOOL opj_dwt_decode(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres);
OPJ_BOOL opj_dwt_decode(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec,
OPJ_UINT32 numres);
/**
Get the gain of a subband for the reversible 5-3 DWT.
@ -94,7 +95,8 @@ Apply an irreversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode
*/
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec, OPJ_UINT32 numres);
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec,
OPJ_UINT32 numres);
/**
Get the gain of a subband for the irreversible 9-7 DWT.

View File

@ -47,8 +47,7 @@ used for
<li>Debugging messages
</ul>
*/
typedef struct opj_event_mgr
{
typedef struct opj_event_mgr {
/** Data to call the event manager upon */
void * m_error_data;
/** Data to call the event manager upon */
@ -87,7 +86,8 @@ typedef struct opj_event_mgr
*
* @return Returns true if successful, returns false otherwise
*/
OPJ_BOOL opj_event_msg(opj_event_mgr_t* event_mgr, OPJ_INT32 event_type, const char *fmt, ...);
OPJ_BOOL opj_event_msg(opj_event_mgr_t* event_mgr, OPJ_INT32 event_type,
const char *fmt, ...);
/* ----------------------------------------------------------------------- */
/**

View File

@ -54,8 +54,7 @@ typedef void (*opj_procedure)(void);
/**
* A list of procedures.
*/
typedef struct opj_procedure_list
{
typedef struct opj_procedure_list {
/**
* The number of validation procedures.
*/
@ -95,7 +94,8 @@ void opj_procedure_list_destroy(opj_procedure_list_t * p_list);
*
* @return OPJ_TRUE if the procedure could be added.
*/
OPJ_BOOL opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure, opj_event_mgr_t* p_manager);
OPJ_BOOL opj_procedure_list_add_procedure(opj_procedure_list_t *
p_validation_list, opj_procedure p_procedure, opj_event_mgr_t* p_manager);
/**
* Gets the number of validation procedures.
@ -104,7 +104,8 @@ OPJ_BOOL opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_l
*
* @return the number of validation procedures.
*/
OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list);
OPJ_UINT32 opj_procedure_list_get_nb_procedures(opj_procedure_list_t *
p_validation_list);
/**
* Gets the pointer on the first validation procedure. This function is similar to the C++
@ -115,7 +116,8 @@ OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_valida
*
* @return a pointer to the first procedure.
*/
opj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list);
opj_procedure* opj_procedure_list_get_first_procedure(opj_procedure_list_t *
p_validation_list);
/**

View File

@ -58,9 +58,11 @@ opj_image_t* opj_image_create0(void);
* @param p_image_header the image header to update.
* @param p_cp the coding parameters from which to update the image.
*/
void opj_image_comp_header_update(opj_image_t * p_image, const struct opj_cp* p_cp);
void opj_image_comp_header_update(opj_image_t * p_image,
const struct opj_cp* p_cp);
void opj_copy_image_header(const opj_image_t* p_image_src, opj_image_t* p_image_dest);
void opj_copy_image_header(const opj_image_t* p_image_src,
opj_image_t* p_image_dest);
/*@}*/

View File

@ -65,7 +65,8 @@
* @param[in] cio file output handle
* @return length of tpix box
*/
int opj_write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_stream_private_t *cio,
int opj_write_tpix(int coff, opj_codestream_info_t cstr_info, int j2klen,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
@ -77,7 +78,8 @@ int opj_write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_s
* @param[in] cio file output handle
* @return length of thix box
*/
int opj_write_thix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio, opj_event_mgr_t * p_manager );
int opj_write_thix(int coff, opj_codestream_info_t cstr_info,
opj_stream_private_t *cio, opj_event_mgr_t * p_manager);
/*
@ -90,7 +92,8 @@ int opj_write_thix( int coff, opj_codestream_info_t cstr_info, opj_stream_privat
* @param[in] cio file output handle
* @return length of ppix box
*/
int opj_write_ppix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
int opj_write_ppix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused,
int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
@ -104,7 +107,8 @@ int opj_write_ppix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused,
* @param[in] cio file output handle
* @return length of ppix box
*/
int opj_write_phix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
int opj_write_phix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused,
int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
/*
@ -130,19 +134,24 @@ void opj_write_manf(int second,
* @param[in] cio file output handle
* @return length of mainmhix box
*/
int opj_write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio,
int opj_write_mainmhix(int coff, opj_codestream_info_t cstr_info,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
int opj_write_phixfaix(int coff, int compno, opj_codestream_info_t cstr_info,
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_ppixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
int opj_write_ppixfaix(int coff, int compno, opj_codestream_info_t cstr_info,
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_stream_private_t *cio,
int opj_write_tilemhix(int coff, opj_codestream_info_t cstr_info, int tileno,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j2klen, opj_stream_private_t *cio,
int opj_write_tpixfaix(int coff, int compno, opj_codestream_info_t cstr_info,
int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
#endif /* !INDEXBOX_MANAGER_H_ */

View File

@ -132,8 +132,7 @@ typedef enum J2K_STATUS {
/**
* Type of elements storing in the MCT data
*/
typedef enum MCT_ELEMENT_TYPE
{
typedef enum MCT_ELEMENT_TYPE {
MCT_TYPE_INT16 = 0, /** MCT data is stored as signed shorts*/
MCT_TYPE_INT32 = 1, /** MCT data is stored as signed integers*/
MCT_TYPE_FLOAT = 2, /** MCT data is stored as floats*/
@ -143,8 +142,7 @@ typedef enum MCT_ELEMENT_TYPE
/**
* Type of MCT array
*/
typedef enum MCT_ARRAY_TYPE
{
typedef enum MCT_ARRAY_TYPE {
MCT_TYPE_DEPENDENCY = 0,
MCT_TYPE_DECORRELATION = 1,
MCT_TYPE_OFFSET = 2
@ -173,8 +171,7 @@ typedef struct opj_stepsize {
/**
Tile-component coding parameters
*/
typedef struct opj_tccp
{
typedef struct opj_tccp {
/** coding style */
OPJ_UINT32 csty;
/** number of resolutions */
@ -209,8 +206,7 @@ opj_tccp_t;
/**
* FIXME DOC
*/
typedef struct opj_mct_data
{
typedef struct opj_mct_data {
J2K_MCT_ELEMENT_TYPE m_element_type;
J2K_MCT_ARRAY_TYPE m_array_type;
OPJ_UINT32 m_index;
@ -222,8 +218,7 @@ opj_mct_data_t;
/**
* FIXME DOC
*/
typedef struct opj_simple_mcc_decorrelation_data
{
typedef struct opj_simple_mcc_decorrelation_data {
OPJ_UINT32 m_index;
OPJ_UINT32 m_nb_comps;
opj_mct_data_t * m_decorrelation_array;
@ -232,8 +227,7 @@ typedef struct opj_simple_mcc_decorrelation_data
}
opj_simple_mcc_decorrelation_data_t;
typedef struct opj_ppx_struct
{
typedef struct opj_ppx_struct {
OPJ_BYTE* m_data; /* m_data == NULL => Zppx not read yet */
OPJ_UINT32 m_data_size;
} opj_ppx;
@ -243,8 +237,7 @@ Tile coding parameters :
this structure is used to store coding/decoding parameters common to all
tiles (information like COD, COC in main header)
*/
typedef struct opj_tcp
{
typedef struct opj_tcp {
/** coding style */
OPJ_UINT32 csty;
/** progression order */
@ -316,8 +309,7 @@ typedef struct opj_tcp
typedef struct opj_encoding_param
{
typedef struct opj_encoding_param {
/** Maximum rate for each component. If == 0, component size limitation is not considered */
OPJ_UINT32 m_max_comp_size;
/** Position of tile part flag in progression order*/
@ -337,8 +329,7 @@ typedef struct opj_encoding_param
}
opj_encoding_param_t;
typedef struct opj_decoding_param
{
typedef struct opj_decoding_param {
/** if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the full resolution */
OPJ_UINT32 m_reduce;
/** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
@ -350,8 +341,7 @@ opj_decoding_param_t;
/**
* Coding parameters
*/
typedef struct opj_cp
{
typedef struct opj_cp {
/** Size of the image in bits*/
/*int img_size;*/
/** Rsiz*/
@ -399,8 +389,7 @@ typedef struct opj_cp
/** tile coding parameters */
opj_tcp_t *tcps;
union
{
union {
opj_decoding_param_t m_dec;
opj_encoding_param_t m_enc;
}
@ -460,8 +449,7 @@ typedef struct opj_cp
} opj_cp_t;
typedef struct opj_j2k_dec
{
typedef struct opj_j2k_dec {
/** locate in which part of the codestream the decoder is (main header, tile header, end) */
OPJ_UINT32 m_state;
/**
@ -506,8 +494,7 @@ typedef struct opj_j2k_dec
} opj_j2k_dec_t;
typedef struct opj_j2k_enc
{
typedef struct opj_j2k_enc {
/** Tile part number, regardless of poc, for each new poc, tp is reset to 1*/
OPJ_UINT32 m_current_poc_tile_part_number; /* tp_num */
@ -553,14 +540,12 @@ struct opj_tcd;
/**
JPEG-2000 codestream reader/writer
*/
typedef struct opj_j2k
{
typedef struct opj_j2k {
/* J2K codestream is decoded*/
OPJ_BOOL m_is_decoder;
/* FIXME DOC*/
union
{
union {
opj_j2k_dec_t m_decoder;
opj_j2k_enc_t m_encoder;
}
@ -765,7 +750,8 @@ void j2k_dump (opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream);
*@param dev_dump_flag flag to describe if we are in the case of this function is use outside j2k_dump function
*@param out_stream output stream where dump the elements.
*/
void j2k_dump_image_header(opj_image_t* image, OPJ_BOOL dev_dump_flag, FILE* out_stream);
void j2k_dump_image_header(opj_image_t* image, OPJ_BOOL dev_dump_flag,
FILE* out_stream);
/**
* Dump a component image header structure.
@ -774,7 +760,8 @@ void j2k_dump_image_header(opj_image_t* image, OPJ_BOOL dev_dump_flag, FILE* out
*@param dev_dump_flag flag to describe if we are in the case of this function is use outside j2k_dump function
*@param out_stream output stream where dump the elements.
*/
void j2k_dump_image_comp_header(opj_image_comp_t* comp, OPJ_BOOL dev_dump_flag, FILE* out_stream);
void j2k_dump_image_comp_header(opj_image_comp_t* comp, OPJ_BOOL dev_dump_flag,
FILE* out_stream);
/**
* Get the codestream info from a JPEG2000 codec.

View File

@ -70,8 +70,7 @@
/* ----------------------------------------------------------------------- */
typedef enum
{
typedef enum {
JP2_STATE_NONE = 0x0,
JP2_STATE_SIGNATURE = 0x1,
JP2_STATE_FILE_TYPE = 0x2,
@ -82,8 +81,7 @@ typedef enum
}
JP2_STATE;
typedef enum
{
typedef enum {
JP2_IMG_STATE_NONE = 0x0,
JP2_IMG_STATE_UNKNOWN = 0x7fffffff
}
@ -92,16 +90,14 @@ JP2_IMG_STATE;
/**
Channel description: channel index, type, association
*/
typedef struct opj_jp2_cdef_info
{
typedef struct opj_jp2_cdef_info {
OPJ_UINT16 cn, typ, asoc;
} opj_jp2_cdef_info_t;
/**
Channel descriptions and number of descriptions
*/
typedef struct opj_jp2_cdef
{
typedef struct opj_jp2_cdef {
opj_jp2_cdef_info_t *info;
OPJ_UINT16 n;
} opj_jp2_cdef_t;
@ -109,8 +105,7 @@ typedef struct opj_jp2_cdef
/**
Component mappings: channel index, mapping type, palette index
*/
typedef struct opj_jp2_cmap_comp
{
typedef struct opj_jp2_cmap_comp {
OPJ_UINT16 cmp;
OPJ_BYTE mtyp, pcol;
} opj_jp2_cmap_comp_t;
@ -118,8 +113,7 @@ typedef struct opj_jp2_cmap_comp
/**
Palette data: table entries, palette columns
*/
typedef struct opj_jp2_pclr
{
typedef struct opj_jp2_pclr {
OPJ_UINT32 *entries;
OPJ_BYTE *channel_sign;
OPJ_BYTE *channel_size;
@ -131,8 +125,7 @@ typedef struct opj_jp2_pclr
/**
Collector for ICC profile, palette, component mapping, channel description
*/
typedef struct opj_jp2_color
{
typedef struct opj_jp2_color {
OPJ_BYTE *icc_profile_buf;
OPJ_UINT32 icc_profile_len;
@ -153,8 +146,7 @@ typedef struct opj_jp2_comps {
/**
JPEG-2000 file format reader/writer
*/
typedef struct opj_jp2
{
typedef struct opj_jp2 {
/** handle to the J2K codec */
opj_j2k_t *j2k;
/** list of validation procedures */
@ -207,8 +199,7 @@ typedef struct opj_jp2_box {
OPJ_INT32 init_pos;
} opj_jp2_box_t;
typedef struct opj_jp2_header_handler
{
typedef struct opj_jp2_header_handler {
/* marker value */
OPJ_UINT32 id;
/* action linked to the marker */
@ -220,8 +211,7 @@ typedef struct opj_jp2_header_handler
opj_jp2_header_handler_t;
typedef struct opj_jp2_img_header_writer_handler
{
typedef struct opj_jp2_img_header_writer_handler {
/* action to perform */
OPJ_BYTE* (*handler)(opj_jp2_t *jp2, OPJ_UINT32 * p_data_size);
/* result of the action : data */

View File

@ -60,7 +60,8 @@ Apply a reversible multi-component transform to an image
@param c2 Samples blue component
@param n Number of samples for each component
*/
void opj_mct_encode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_encode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Apply a reversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@ -68,7 +69,8 @@ Apply a reversible multi-component inverse transform to an image
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void opj_mct_decode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_decode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Get norm of the basis function used for the reversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)
@ -83,7 +85,8 @@ Apply an irreversible multi-component transform to an image
@param c2 Samples blue component
@param n Number of samples for each component
*/
void opj_mct_encode_real(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_encode_real(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Apply an irreversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@ -91,7 +94,8 @@ Apply an irreversible multi-component inverse transform to an image
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void opj_mct_decode_real(OPJ_FLOAT32* OPJ_RESTRICT c0, OPJ_FLOAT32* OPJ_RESTRICT c1, OPJ_FLOAT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_decode_real(OPJ_FLOAT32* OPJ_RESTRICT c0,
OPJ_FLOAT32* OPJ_RESTRICT c1, OPJ_FLOAT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Get norm of the basis function used for the irreversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)

View File

@ -117,7 +117,8 @@ Set the state of a particular context
@param msb The MSB of the new state of the context
@param prob Number that identifies the probability of the symbols for the new state of the context
*/
void opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb, OPJ_INT32 prob);
void opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb,
OPJ_INT32 prob);
/**
Initialize the encoder
@param mqc MQC handle

View File

@ -43,7 +43,8 @@ FIXME DOC
@param mqc MQC handle
@return
*/
static INLINE OPJ_INT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc) {
static INLINE OPJ_INT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc)
{
OPJ_INT32 d;
if (mqc->a < (*mqc->curctx)->qeval) {
d = (OPJ_INT32)(1 - (*mqc->curctx)->mps);
@ -61,7 +62,8 @@ FIXME DOC
@param mqc MQC handle
@return
*/
static INLINE OPJ_INT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc) {
static INLINE OPJ_INT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc)
{
OPJ_INT32 d;
if (mqc->a < (*mqc->curctx)->qeval) {
mqc->a = (*mqc->curctx)->qeval;
@ -81,14 +83,16 @@ Input a byte
@param mqc MQC handle
*/
#ifdef MQC_PERF_OPT
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc) {
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc)
{
unsigned int i = *((unsigned int *) mqc->bp);
mqc->c += i & 0xffff00;
mqc->ct = i & 0x0f;
mqc->bp += (i >> 2) & 0x04;
}
#else
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc) {
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc)
{
if (mqc->bp != mqc->end) {
OPJ_UINT32 c;
if (mqc->bp + 1 != mqc->end) {
@ -121,7 +125,8 @@ static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc) {
Renormalize mqc->a and mqc->c while decoding
@param mqc MQC handle
*/
static INLINE void opj_mqc_renormd(opj_mqc_t *const mqc) {
static INLINE void opj_mqc_renormd(opj_mqc_t *const mqc)
{
do {
if (mqc->ct == 0) {
opj_mqc_bytein(mqc);
@ -137,7 +142,8 @@ Decode a symbol
@param mqc MQC handle
@return Returns the decoded symbol (0 or 1)
*/
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc) {
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc)
{
OPJ_INT32 d;
mqc->a -= (*mqc->curctx)->qeval;
if ((mqc->c >> 16) < (*mqc->curctx)->qeval) {

View File

@ -590,22 +590,26 @@ typedef void * opj_codec_t;
/*
* Callback function prototype for read function
*/
typedef OPJ_SIZE_T (* opj_stream_read_fn) (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_SIZE_T(* opj_stream_read_fn)(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
void * p_user_data) ;
/*
* Callback function prototype for write function
*/
typedef OPJ_SIZE_T (* opj_stream_write_fn) (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_SIZE_T(* opj_stream_write_fn)(void * p_buffer,
OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;
/*
* Callback function prototype for skip function
*/
typedef OPJ_OFF_T (* opj_stream_skip_fn) (OPJ_OFF_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_OFF_T(* opj_stream_skip_fn)(OPJ_OFF_T p_nb_bytes,
void * p_user_data) ;
/*
* Callback function prototype for seek function
*/
typedef OPJ_BOOL (* opj_stream_seek_fn) (OPJ_OFF_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_BOOL(* opj_stream_seek_fn)(OPJ_OFF_T p_nb_bytes,
void * p_user_data) ;
/*
* Callback function prototype for free user data function
@ -855,8 +859,7 @@ typedef struct opj_codestream_info {
/**
* Tile-component coding parameters information
*/
typedef struct opj_tccp_info
{
typedef struct opj_tccp_info {
/** component index */
OPJ_UINT32 compno;
/** coding style */
@ -1068,7 +1071,8 @@ OPJ_API const char * OPJ_CALLCONV opj_version(void);
* @param clrspc image color space
* @return returns a new image structure if successful, returns NULL otherwise
* */
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts,
opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/**
* Deallocate any resources associated with an image
@ -1086,7 +1090,8 @@ OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);
*
* @return a new image structure if successful, NULL otherwise.
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts,
opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/*
==========================================================
@ -1101,7 +1106,8 @@ OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj
*
* @return a stream object.
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(OPJ_BOOL p_is_input);
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(
OPJ_BOOL p_is_input);
/**
* Creates an abstract stream. This function does nothing except allocating memory and initializing the abstract stream.
@ -1111,7 +1117,8 @@ OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(OPJ_BOOL p_is_input
*
* @return a stream object.
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size, OPJ_BOOL p_is_input);
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size,
OPJ_BOOL p_is_input);
/**
* Destroys a stream created by opj_create_stream. This function does NOT close the abstract stream. If needed the user must
@ -1126,28 +1133,32 @@ OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);
* @param p_stream the stream to modify
* @param p_function the function to use a read function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream,
opj_stream_read_fn p_function);
/**
* Sets the given function to be used as a write function.
* @param p_stream the stream to modify
* @param p_function the function to use a write function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream, opj_stream_write_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream,
opj_stream_write_fn p_function);
/**
* Sets the given function to be used as a skip function.
* @param p_stream the stream to modify
* @param p_function the function to use a skip function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_stream_skip_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream,
opj_stream_skip_fn p_function);
/**
* Sets the given function to be used as a seek function, the stream is then seekable.
* @param p_stream the stream to modify
* @param p_function the function to use a skip function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, opj_stream_seek_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream,
opj_stream_seek_fn p_function);
/**
* Sets the given data to be used as a user data for the stream.
@ -1155,7 +1166,8 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, o
* @param p_data the data to set.
* @param p_function the function to free p_data when opj_stream_destroy() is called.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream,
void * p_data, opj_stream_free_user_data_fn p_function);
/**
* Sets the length of the user data for the stream.
@ -1163,21 +1175,24 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void
* @param p_stream the stream to modify
* @param data_length length of the user_data.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream, OPJ_UINT64 data_length);
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(
opj_stream_t* p_stream, OPJ_UINT64 data_length);
/**
* Create a stream from a file identified with its filename with default parameters (helper function)
* @param fname the filename of the file to stream
* @param p_is_read_stream whether the stream is a read stream (true) or not (false)
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream);
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream(
const char *fname, OPJ_BOOL p_is_read_stream);
/** Create a stream from a file identified with its filename with a specific buffer size
* @param fname the filename of the file to stream
* @param p_buffer_size size of the chunk used to stream
* @param p_is_read_stream whether the stream is a read stream (true) or not (false)
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (const char *fname,
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream(
const char *fname,
OPJ_SIZE_T p_buffer_size,
OPJ_BOOL p_is_read_stream);
@ -1226,7 +1241,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec,
*
* @return Returns a handle to a decompressor if successful, returns NULL otherwise
* */
OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(
OPJ_CODEC_FORMAT format);
/**
* Destroy a decompressor handle
@ -1248,7 +1264,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress ( opj_codec_t *p_codec,
* Set decoding parameters to default values
* @param parameters Decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(
opj_dparameters_t *parameters);
/**
* Setup the decoder with decompression parameters provided by the user and with the message handler
@ -1345,7 +1362,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile( opj_codec_t *p_codec,
*
* @return true if success, otherwise false
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_codec, OPJ_UINT32 res_factor);
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(
opj_codec_t *p_codec, OPJ_UINT32 res_factor);
/**
* Writes a tile with the given data.
@ -1443,7 +1461,8 @@ Set encoding parameters to default values, that means :
</ul>
@param parameters Compression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(
opj_cparameters_t *parameters);
/**
* Setup the encoder parameters using the current image and using user parameters.
@ -1493,7 +1512,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_encode(opj_codec_t *p_codec,
Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure
*/
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t **cstr_info);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t
**cstr_info);
/**
@ -1516,7 +1536,8 @@ OPJ_API void OPJ_CALLCONV opj_dump_codec( opj_codec_t *p_codec,
* @return a pointer to a codestream information structure.
*
*/
OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_codec);
OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(
opj_codec_t *p_codec);
/**
* Get the codestream index from the codec
@ -1526,9 +1547,11 @@ OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_
* @return a pointer to a codestream index structure.
*
*/
OPJ_API opj_codestream_index_t * OPJ_CALLCONV opj_get_cstr_index(opj_codec_t *p_codec);
OPJ_API opj_codestream_index_t * OPJ_CALLCONV opj_get_cstr_index(
opj_codec_t *p_codec);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr_index);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t
**p_cstr_index);
/**
@ -1539,7 +1562,8 @@ OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr
* @return a pointer to a JP2 metadata structure.
*
*/
OPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata(opj_codec_t *p_codec);
OPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata(
opj_codec_t *p_codec);
/**
* Get the JP2 file index from the codec FIXME

View File

@ -39,16 +39,13 @@
/**
* Main codec handler used for compression or decompression.
*/
typedef struct opj_codec_private
{
typedef struct opj_codec_private {
/** FIXME DOC */
union
{
union {
/**
* Decompression handler.
*/
struct opj_decompression
{
struct opj_decompression {
/** Main header reading function handler */
OPJ_BOOL(*opj_read_header)(struct opj_stream_private * cio,
void * p_codec,
@ -119,8 +116,7 @@ typedef struct opj_codec_private
/**
* Compression handler. FIXME DOC
*/
struct opj_compression
{
struct opj_compression {
OPJ_BOOL(* opj_start_compress)(void *p_codec,
struct opj_stream_private * cio,
struct opj_image * p_image,
@ -155,7 +151,8 @@ typedef struct opj_codec_private
opj_event_mgr_t m_event_mgr;
/** Flag to indicate if the codec is used to decode or encode*/
OPJ_BOOL is_decompressor;
void (*opj_dump_codec) (void * p_codec, OPJ_INT32 info_flag, FILE* output_stream);
void (*opj_dump_codec)(void * p_codec, OPJ_INT32 info_flag,
FILE* output_stream);
opj_codestream_info_v2_t* (*opj_get_codec_info)(void* p_codec);
opj_codestream_index_t* (*opj_get_codec_index)(void* p_codec);

View File

@ -135,7 +135,8 @@
/* MSVC before 2013 and Borland C do not have lrintf */
#if defined(_MSC_VER)
#include <intrin.h>
static INLINE long opj_lrintf(float f){
static INLINE long opj_lrintf(float f)
{
#ifdef _M_X64
return _mm_cvt_ss2si(_mm_load_ss(&f));
@ -154,7 +155,8 @@ static INLINE long opj_lrintf(float f){
#endif
}
#elif defined(__BORLANDC__)
static INLINE long opj_lrintf(float f) {
static INLINE long opj_lrintf(float f)
{
#ifdef _M_X64
return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
#else
@ -169,7 +171,8 @@ static INLINE long opj_lrintf(float f) {
#endif
}
#else
static INLINE long opj_lrintf(float f) {
static INLINE long opj_lrintf(float f)
{
return lrintf(f);
}
#endif

View File

@ -53,7 +53,8 @@ The functions in OPJ_INTMATH.H have for goal to realize operations on integers.
Get the minimum of two integers
@return Returns a if a < b else b
*/
static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b)
{
return a < b ? a : b;
}
@ -61,7 +62,8 @@ static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b) {
Get the minimum of two integers
@return Returns a if a < b else b
*/
static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b)
{
return a < b ? a : b;
}
@ -69,7 +71,8 @@ static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b) {
Get the maximum of two integers
@return Returns a if a > b else b
*/
static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b)
{
return (a > b) ? a : b;
}
@ -77,7 +80,8 @@ static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b) {
Get the maximum of two integers
@return Returns a if a > b else b
*/
static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b)
{
return (a > b) ? a : b;
}
@ -85,7 +89,8 @@ static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b) {
Get the saturated sum of two unsigned integers
@return Returns saturated sum of a+b
*/
static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b)
{
OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
}
@ -99,24 +104,30 @@ Clamp an integer inside an interval
<li>Returns min if (a < min)
</ul>
*/
static INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min, OPJ_INT32 max) {
if (a < min)
static INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min,
OPJ_INT32 max)
{
if (a < min) {
return min;
if (a > max)
}
if (a > max) {
return max;
}
return a;
}
/**
@return Get absolute value of integer
*/
static INLINE OPJ_INT32 opj_int_abs(OPJ_INT32 a) {
static INLINE OPJ_INT32 opj_int_abs(OPJ_INT32 a)
{
return a < 0 ? -a : a;
}
/**
Divide an integer and round upwards
@return Returns a divided by b
*/
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)
{
assert(b);
return (a + b - 1) / b;
}
@ -125,7 +136,8 @@ static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b) {
Divide an integer and round upwards
@return Returns a divided by b
*/
static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b)
{
assert(b);
return (a + b - 1) / b;
}
@ -134,7 +146,8 @@ static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b) {
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b)
{
return (OPJ_INT32)((a + ((OPJ_INT64)1 << b) - 1) >> b);
}
@ -142,7 +155,8 @@ static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b) {
Divide a 64bits integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b)
{
return (OPJ_INT32)((a + ((OPJ_INT64)1 << b) - 1) >> b);
}
@ -150,7 +164,8 @@ static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b) {
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b)
{
return (OPJ_UINT32)((a + ((OPJ_UINT64)1U << b) - 1U) >> b);
}
@ -158,14 +173,16 @@ static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b) {
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b)
{
return a >> b;
}
/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a) {
static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a)
{
OPJ_INT32 l;
for (l = 0; a > 1; l++) {
a >>= 1;
@ -176,10 +193,10 @@ static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a) {
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static INLINE OPJ_UINT32 opj_uint_floorlog2(OPJ_UINT32 a) {
OPJ_UINT32 l;
for (l = 0; a > 1; ++l)
static INLINE OPJ_UINT32 opj_uint_floorlog2(OPJ_UINT32 a)
{
OPJ_UINT32 l;
for (l = 0; a > 1; ++l) {
a >>= 1;
}
return l;
@ -191,7 +208,8 @@ Multiply two fixed-precision rational numbers.
@param b
@return Returns a * b
*/
static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
OPJ_INT64 temp = __emul(a, b);
#else
@ -203,7 +221,8 @@ static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b) {
return (OPJ_INT32)(temp >> 13);
}
static INLINE OPJ_INT32 opj_int_fix_mul_t1(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_fix_mul_t1(OPJ_INT32 a, OPJ_INT32 b)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
OPJ_INT64 temp = __emul(a, b);
#else
@ -211,7 +230,8 @@ static INLINE OPJ_INT32 opj_int_fix_mul_t1(OPJ_INT32 a, OPJ_INT32 b) {
#endif
temp += 4096;
assert((temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) <= (OPJ_INT64)0x7FFFFFFF);
assert((temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) >= (-(OPJ_INT64)0x7FFFFFFF - (OPJ_INT64)1));
assert((temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) >= (-(OPJ_INT64)0x7FFFFFFF -
(OPJ_INT64)1));
return (OPJ_INT32)(temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) ;
}

View File

@ -90,11 +90,13 @@ typedef struct opj_tcd_cblk_enc {
OPJ_BYTE* data; /* Data */
opj_tcd_layer_t* layers; /* layer information */
opj_tcd_pass_t* passes; /* information about the passes */
OPJ_INT32 x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numbps;
OPJ_UINT32 numlenbits;
OPJ_UINT32 data_size; /* Size of allocated data buffer */
OPJ_UINT32 numpasses; /* number of pass already done for the code-blocks */
OPJ_UINT32
numpasses; /* number of pass already done for the code-blocks */
OPJ_UINT32 numpassesinlayers; /* number of passes in the layer */
OPJ_UINT32 totalpasses; /* total number of passes */
} opj_tcd_cblk_enc_t;
@ -103,7 +105,8 @@ typedef struct opj_tcd_cblk_enc {
typedef struct opj_tcd_cblk_dec {
OPJ_BYTE * data; /* Data */
opj_tcd_seg_t* segs; /* segments information */
OPJ_INT32 x0, y0, x1, y1; /* position of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* position of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numbps;
OPJ_UINT32 numlenbits;
OPJ_UINT32 data_max_size; /* Size of allocated data buffer */
@ -118,7 +121,8 @@ typedef struct opj_tcd_cblk_dec {
FIXME DOC
*/
typedef struct opj_tcd_precinct {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 cw, ch; /* number of precinct in width and height */
union { /* code-blocks information */
opj_tcd_cblk_enc_t* enc;
@ -134,7 +138,8 @@ typedef struct opj_tcd_precinct {
FIXME DOC
*/
typedef struct opj_tcd_band {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 bandno;
opj_tcd_precinct_t *precincts; /* precinct information */
OPJ_UINT32 precincts_data_size; /* size of data taken by precincts */
@ -146,7 +151,8 @@ typedef struct opj_tcd_band {
FIXME DOC
*/
typedef struct opj_tcd_resolution {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 pw, ph;
OPJ_UINT32 numbands; /* number sub-band for the resolution level */
opj_tcd_band_t bands[3]; /* subband information */
@ -155,16 +161,19 @@ typedef struct opj_tcd_resolution {
/**
FIXME DOC
*/
typedef struct opj_tcd_tilecomp
{
OPJ_INT32 x0, y0, x1, y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
typedef struct opj_tcd_tilecomp {
OPJ_INT32 x0, y0, x1,
y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numresolutions; /* number of resolutions level */
OPJ_UINT32 minimum_num_resolutions; /* number of resolutions level to decode (at max)*/
OPJ_UINT32
minimum_num_resolutions; /* number of resolutions level to decode (at max)*/
opj_tcd_resolution_t *resolutions; /* resolutions information */
OPJ_UINT32 resolutions_size; /* size of data for resolutions (in bytes) */
OPJ_UINT32
resolutions_size; /* size of data for resolutions (in bytes) */
OPJ_INT32 *data; /* data of the component */
OPJ_BOOL ownsData; /* if true, then need to free after usage, otherwise do not free */
OPJ_UINT32 data_size_needed; /* we may either need to allocate this amount of data, or re-use image data and ignore this value */
OPJ_UINT32
data_size_needed; /* we may either need to allocate this amount of data, or re-use image data and ignore this value */
OPJ_UINT32 data_size; /* size of the data of the component */
OPJ_INT32 numpix; /* add fixed_quality */
} opj_tcd_tilecomp_t;
@ -174,7 +183,8 @@ typedef struct opj_tcd_tilecomp
FIXME DOC
*/
typedef struct opj_tcd_tile {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numcomps; /* number of components in tile */
opj_tcd_tilecomp_t *comps; /* Components information */
OPJ_INT32 numpix; /* add fixed_quality */
@ -186,8 +196,7 @@ typedef struct opj_tcd_tile {
/**
FIXME DOC
*/
typedef struct opj_tcd_image
{
typedef struct opj_tcd_image {
opj_tcd_tile_t *tiles; /* Tiles information */
}
opj_tcd_image_t;
@ -196,8 +205,7 @@ opj_tcd_image_t;
/**
Tile coder/decoder
*/
typedef struct opj_tcd
{
typedef struct opj_tcd {
/** Position of the tilepart flag in Progression order*/
OPJ_INT32 tp_pos;
/** Tile part number*/
@ -270,9 +278,11 @@ OPJ_BOOL opj_tcd_init( opj_tcd_t *p_tcd,
*
* @return true if the remaining data is sufficient.
*/
OPJ_BOOL opj_tcd_init_decode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, opj_event_mgr_t* p_manager);
OPJ_BOOL opj_tcd_init_decode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
opj_event_mgr_t* p_manager);
void opj_tcd_makelayer_fixed(opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final);
void opj_tcd_makelayer_fixed(opj_tcd_t *tcd, OPJ_UINT32 layno,
OPJ_UINT32 final);
void opj_tcd_rateallocate_fixed(opj_tcd_t *tcd);

View File

@ -64,8 +64,7 @@ typedef struct opj_tgt_node {
/**
Tag tree
*/
typedef struct opj_tgt_tree
{
typedef struct opj_tgt_tree {
OPJ_UINT32 numleafsh;
OPJ_UINT32 numleafsv;
OPJ_UINT32 numnodes;
@ -83,7 +82,8 @@ Create a tag-tree
@param numleafsv Height of the array of leafs of the tree
@return Returns a new tag-tree if successful, returns NULL otherwise
*/
opj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv, opj_event_mgr_t *manager);
opj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv,
opj_event_mgr_t *manager);
/**
* Reinitialises a tag-tree from an exixting one.

View File

@ -183,7 +183,8 @@ typedef void (*opj_tls_free_func)(void* value);
* @param free_func function to call currently installed value.
* @return OPJ_TRUE if successful.
*/
OPJ_BOOL opj_tls_set(opj_tls_t* tls, int key, void* value, opj_tls_free_func free_func);
OPJ_BOOL opj_tls_set(opj_tls_t* tls, int key, void* value,
opj_tls_free_func free_func);
/*@}*/
@ -221,7 +222,8 @@ typedef void (*opj_job_fn)(void* user_data, opj_tls_t* tls);
* @param user_data User data provided to thread_fn.
* @return OPJ_TRUE if the job was successfully submitted.
*/
OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t* tp, opj_job_fn job_fn, void* user_data);
OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t* tp, opj_job_fn job_fn,
void* user_data);
/** Wait that no more than max_remaining_jobs jobs are remaining in the queue of
* the thread pool. The aim of this function is to avoid submitting too many
@ -232,7 +234,8 @@ OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t* tp, opj_job_fn job_fn, vo
* @param tp the thread pool handle
* @param max_remaining_jobs maximum number of jobs allowed to be queued without waiting.
*/
void opj_thread_pool_wait_completion(opj_thread_pool_t* tp, int max_remaining_jobs);
void opj_thread_pool_wait_completion(opj_thread_pool_t* tp,
int max_remaining_jobs);
/** Return the number of threads associated with the thread pool.
*

View File

@ -57,7 +57,8 @@ Multiply two fixed-precision rational numbers.
@param b
@return Returns a * b
*/
static int fix_mul(int a, int b) {
static int fix_mul(int a, int b)
{
int64 temp = (int64) a * (int64) b >> 12;
return (int)((temp >> 1) + (temp & 1)) ;
}

View File

@ -51,14 +51,16 @@ The functions in INT.H have for goal to realize operations on integers.
Get the minimum of two integers
@return Returns a if a < b else b
*/
static int int_min(int a, int b) {
static int int_min(int a, int b)
{
return a < b ? a : b;
}
/**
Get the maximum of two integers
@return Returns a if a > b else b
*/
static int int_max(int a, int b) {
static int int_max(int a, int b)
{
return (a > b) ? a : b;
}
/**
@ -70,49 +72,58 @@ Clamp an integer inside an interval
<li>Returns min if (a < min)
</ul>
*/
static int int_clamp(int a, int min, int max) {
if (a < min)
static int int_clamp(int a, int min, int max)
{
if (a < min) {
return min;
if (a > max)
}
if (a > max) {
return max;
}
return a;
}
/**
@return Get absolute value of integer
*/
static int int_abs(int a) {
static int int_abs(int a)
{
return a < 0 ? -a : a;
}
static double dbl_abs(double a) {
static double dbl_abs(double a)
{
return a < 0 ? -a : a;
}
/**
Divide an integer and round upwards
@return Returns a divided by b
*/
static int int_ceildiv(int a, int b) {
static int int_ceildiv(int a, int b)
{
return (a + b - 1) / b;
}
/**
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static int int_ceildivpow2(int a, int b) {
static int int_ceildivpow2(int a, int b)
{
return (a + (1 << b) - 1) >> b;
}
/**
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static int int_floordivpow2(int a, int b) {
static int int_floordivpow2(int a, int b)
{
return a >> b;
}
/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static int int_floorlog2(int a) {
static int int_floorlog2(int a)
{
int l;
for (l = 0; a > 1; l++) {
a >>= 1;

View File

@ -505,7 +505,8 @@ Coding parameters are returned in j3d->cp.
@param parameters compression parameters
@param volume input filled volume
*/
void j3d_setup_encoder(opj_j3d_t *j3d, opj_cparameters_t *parameters, opj_volume_t *volume);
void j3d_setup_encoder(opj_j3d_t *j3d, opj_cparameters_t *parameters,
opj_volume_t *volume);
/**
Encode an volume into a JPEG-2000 codestream
@param j3d J3D compressor handle
@ -514,7 +515,8 @@ Encode an volume into a JPEG-2000 codestream
@param index Name of the index file if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
bool j3d_encode(opj_j3d_t *j3d, opj_cio_t *cio, opj_volume_t *volume, char *index);
bool j3d_encode(opj_j3d_t *j3d, opj_cio_t *cio, opj_volume_t *volume,
char *index);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -580,7 +580,8 @@ Create an volume
@param clrspc volume color space
@return returns a new volume structure if successful, returns NULL otherwise
*/
OPJ_API opj_volume_t* OPJ_CALLCONV opj_volume_create(int numcmpts, opj_volume_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_volume_t* OPJ_CALLCONV opj_volume_create(int numcmpts,
opj_volume_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/**
Deallocate any resources associated with an volume
@ -605,7 +606,8 @@ to contain encoded data.
@param length Reading: buffer length. Writing: 0
@return Returns a CIO handle if successful, returns NULL otherwise
*/
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo,
unsigned char *buffer, int length);
/**
Close and free a CIO handle
@ -632,7 +634,8 @@ OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
==========================================================
*/
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo,
opj_event_mgr_t *event_mgr, void *context);
/*
==========================================================
@ -644,7 +647,8 @@ Creates a J3D decompression structure
@param format Decoder to select
@return Returns a handle to a decompressor if successful, returns NULL otherwise
*/
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(
OPJ_CODEC_FORMAT format);
/**
Destroy a decompressor handle
@param dinfo decompressor handle to destroy
@ -654,21 +658,24 @@ OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo);
Set decoding parameters to default values
@param parameters Decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(
opj_dparameters_t *parameters);
/**
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in j3d->cp.
@param dinfo decompressor handle
@param parameters decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo,
opj_dparameters_t *parameters);
/**
Decode an volume from a JPEG-2000 codestream
@param dinfo decompressor handle
@param cio Input buffer stream
@return Returns a decoded volume if successful, returns NULL otherwise
*/
OPJ_API opj_volume_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
OPJ_API opj_volume_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo,
opj_cio_t *cio);
/**
Creates a J3D/JP2 compression structure
@param format Coder to select
@ -701,14 +708,16 @@ Set encoding parameters to default values, that means :
</ul>
@param parameters Compression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(
opj_cparameters_t *parameters);
/**
Setup the encoder parameters using the current volume and using user parameters.
@param cinfo compressor handle
@param parameters compression parameters
@param volume input filled volume
*/
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_volume_t *volume);
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo,
opj_cparameters_t *parameters, opj_volume_t *volume);
/**
Encode an volume into a JPEG-2000 codestream
@param cinfo compressor handle
@ -717,7 +726,8 @@ Encode an volume into a JPEG-2000 codestream
@param index Name of the index file if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_volume_t *volume, char *index);
OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio,
opj_volume_t *volume, char *index);
#ifdef __cplusplus
}

View File

@ -168,7 +168,8 @@ Get weigths of MSE decoding
@param dwtid
returns MSE associated to decoding pass
*/
double t1_getwmsedec(int nmsedec, int compno, int level[3], int orient, int bpno, double stepsize, int numcomps, int dwtid[3]);
double t1_getwmsedec(int nmsedec, int compno, int level[3], int orient,
int bpno, double stepsize, int numcomps, int dwtid[3]);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -71,7 +71,8 @@ Encode the packets of a tile to a destination buffer
@param volume_info structure to create an index file
@return Number of bytes written from packets
*/
int t2_encode_packets(opj_t2_t* t2, int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_volume_info_t *volume_info);
int t2_encode_packets(opj_t2_t* t2, int tileno, opj_tcd_tile_t *tile,
int maxlayers, unsigned char *dest, int len, opj_volume_info_t *volume_info);
/**
Decode the packets of a tile from a source buffer
@ -82,7 +83,8 @@ Decode the packets of a tile from a source buffer
@param tile tile for which to decode the packets
@return Number of bytes read from packets
*/
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile);
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno,
opj_tcd_tile_t *tile);
/**
Create a T2 handle

View File

@ -281,7 +281,8 @@ Initialize the tile coder (allocate the memory)
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_malloc_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp, int curtileno);
void tcd_malloc_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp,
int curtileno);
/**
Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)(for 3D-DWT)
@param tcd TCD handle
@ -289,7 +290,8 @@ Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)(for
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_init_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp, int curtileno);
void tcd_init_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp,
int curtileno);
/**
Free the memory allocated for encoding
@param tcd TCD handle
@ -306,7 +308,8 @@ void tcd_malloc_decode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp);
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
void tcd_rateallocate_fixed(opj_tcd_t *tcd);
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_volume_info_t * volume_info);
bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len,
opj_volume_info_t * volume_info);
/**
Encode a tile from the raw volume into a buffer
@param tcd TCD handle
@ -316,7 +319,8 @@ Encode a tile from the raw volume into a buffer
@param volume_info Creation of index file
@return
*/
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_volume_info_t * volume_info);
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len,
opj_volume_info_t * volume_info);
/**
Decode a tile from a buffer into a raw volume
@param tcd TCD handle

View File

@ -111,7 +111,8 @@ Encode the value of a leaf of the tag-tree up to a given threshold
@param leafno Number that identifies the leaf to encode
@param threshold Threshold to use when encoding value of the leaf
*/
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno,
int threshold);
/**
Decode the value of a leaf of the tag-tree up to a given threshold
@param bio Pointer to a BIO handle

View File

@ -68,6 +68,7 @@ void close_aux_transport( auxtrans_param_t auxtrans);
* @param[in] length length of data
* @param[in] maxlenPerFrame maximum data length to send per frame
*/
void send_responsedata_on_aux( OPJ_BOOL istcp, auxtrans_param_t auxtrans, const char cid[], void *data, OPJ_SIZE_T length, OPJ_SIZE_T maxlenPerFrame);
void send_responsedata_on_aux(OPJ_BOOL istcp, auxtrans_param_t auxtrans,
const char cid[], void *data, OPJ_SIZE_T length, OPJ_SIZE_T maxlenPerFrame);
#endif /* !AUXTRANS_MANAGER_H_ */

View File

@ -97,7 +97,8 @@ box_param_t * gene_boxbyOffinStream( Byte_t *stream, OPJ_OFF_T offset);
* @param[in] TBox Box Type
* @return pointer to the structure of generate/found box parameters
*/
box_param_t * gene_boxbyType( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length, const char TBox[]);
box_param_t * gene_boxbyType(int fd, OPJ_OFF_T offset, OPJ_SIZE_T length,
const char TBox[]);
/**
* generate(search) box from code stream
@ -108,7 +109,8 @@ box_param_t * gene_boxbyType( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length, const
* @param[in] TBox Box Type
* @return pointer to the structure of generate/found box parameters
*/
box_param_t * gene_boxbyTypeinStream( Byte_t *stream, OPJ_OFF_T offset, OPJ_SIZE_T length, const char TBox[]);
box_param_t * gene_boxbyTypeinStream(Byte_t *stream, OPJ_OFF_T offset,
OPJ_SIZE_T length, const char TBox[]);
/**
* generate child box from JP2 file at the given offset
@ -127,7 +129,8 @@ box_param_t * gene_childboxbyOffset( box_param_t *superbox, OPJ_OFF_T offset);
* @param[in] TBox Box Type
* @return pointer to the structure of generate/found box parameters
*/
box_param_t * gene_childboxbyType( box_param_t *superbox, OPJ_OFF_T offset, const char TBox[]);
box_param_t * gene_childboxbyType(box_param_t *superbox, OPJ_OFF_T offset,
const char TBox[]);
/**
* get DBox offset

View File

@ -60,7 +60,8 @@ boxheader_param_t * gene_boxheader( int fd, OPJ_OFF_T offset);
* @param[in] offset offset from DBox first byte of superbox
* @return pointer to the structure of generate box header parameters
*/
boxheader_param_t * gene_childboxheader( box_param_t *superbox, OPJ_OFF_T offset);
boxheader_param_t * gene_childboxheader(box_param_t *superbox,
OPJ_OFF_T offset);
/**
* print box header parameters

View File

@ -76,7 +76,8 @@ void delete_cachelist(cachelist_param_t **cachelist);
* @param[in] cid channel identifier
* @return pointer to the generated cache
*/
cache_param_t * gene_cache( const char *targetname, int csn, char *tid, char *cid);
cache_param_t * gene_cache(const char *targetname, int csn, char *tid,
char *cid);
/**
* delete a cache
@ -101,7 +102,8 @@ void insert_cache_into_list( cache_param_t *cache, cachelist_param_t *cachelist)
* @param[in] cachelist cache list pointer
* @return found cache pointer
*/
cache_param_t * search_cache( const char targetname[], cachelist_param_t *cachelist);
cache_param_t * search_cache(const char targetname[],
cachelist_param_t *cachelist);
/**
@ -121,7 +123,8 @@ cache_param_t * search_cacheBycsn( int csn, cachelist_param_t *cachelist);
* @param[in] cachelist cache list pointer
* @return found cache pointer
*/
cache_param_t * search_cacheBycid( const char cid[], cachelist_param_t *cachelist);
cache_param_t * search_cacheBycid(const char cid[],
cachelist_param_t *cachelist);
/**
@ -131,7 +134,8 @@ cache_param_t * search_cacheBycid( const char cid[], cachelist_param_t *cachelis
* @param[in] cachelist cache list pointer
* @return found cache pointer
*/
cache_param_t * search_cacheBytid( const char tid[], cachelist_param_t *cachelist);
cache_param_t * search_cacheBytid(const char tid[],
cachelist_param_t *cachelist);
/**
* add cid into a cache

View File

@ -66,7 +66,8 @@ cachemodellist_param_t * gene_cachemodellist(void);
* @param[in] reqJPP if JPP-stream is desired true, JPT-stream false
* @return pointer to the generated cache model
*/
cachemodel_param_t * gene_cachemodel( cachemodellist_param_t *cachemodellist, target_param_t *target, OPJ_BOOL reqJPP);
cachemodel_param_t * gene_cachemodel(cachemodellist_param_t *cachemodellist,
target_param_t *target, OPJ_BOOL reqJPP);
/**
@ -84,7 +85,8 @@ void print_cachemodel( cachemodel_param_t cachemodel);
* @param[in] cachemodellist cache model list
* @return found cache model pointer
*/
cachemodel_param_t * search_cachemodel( target_param_t *target, cachemodellist_param_t *cachemodellist);
cachemodel_param_t * search_cachemodel(target_param_t *target,
cachemodellist_param_t *cachemodellist);
/**

View File

@ -74,7 +74,9 @@ channellist_param_t * gene_channellist(void);
* @param[in] channellist channel list pointer
* @return pointer to the generated channel
*/
channel_param_t * gene_channel( query_param_t query_param, auxtrans_param_t auxtrans, cachemodel_param_t *cachemodel, channellist_param_t *channellist);
channel_param_t * gene_channel(query_param_t query_param,
auxtrans_param_t auxtrans, cachemodel_param_t *cachemodel,
channellist_param_t *channellist);
/**
* set channel variable parameters
@ -82,7 +84,8 @@ channel_param_t * gene_channel( query_param_t query_param, auxtrans_param_t auxt
* @param[in] query_param query parameters
* @param[in,out] channel pointer to the modifying channel
*/
void set_channel_variable_param( query_param_t query_param, channel_param_t *channel);
void set_channel_variable_param(query_param_t query_param,
channel_param_t *channel);
/**
* delete a channel
@ -90,7 +93,8 @@ void set_channel_variable_param( query_param_t query_param, channel_param_t *cha
* @param[in] channel address of the deleting channel pointer
* @param[in,out] channellist channel list pointer
*/
void delete_channel( channel_param_t **channel, channellist_param_t *channellist);
void delete_channel(channel_param_t **channel,
channellist_param_t *channellist);
/**
@ -116,5 +120,6 @@ void print_allchannel( channellist_param_t *channellist);
* @param[in] channellist channel list pointer
* @return found channel pointer
*/
channel_param_t * search_channel( const char cid[], channellist_param_t *channellist);
channel_param_t * search_channel(const char cid[],
channellist_param_t *channellist);
#endif /* !CHANNEL_MANAGER_H_ */

View File

@ -60,7 +60,8 @@ codestream_param_t set_codestream( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
* @param[in] size Byte length
* @return pointer to the fetched data
*/
Byte_t * fetch_codestreambytes( codestream_param_t *cs, OPJ_OFF_T offset, OPJ_SIZE_T size);
Byte_t * fetch_codestreambytes(codestream_param_t *cs, OPJ_OFF_T offset,
OPJ_SIZE_T size);
/**
* fetch Codestream 1-byte Byte code in file stream
@ -78,7 +79,8 @@ Byte_t fetch_codestream1byte( codestream_param_t *cs, OPJ_OFF_T offset);
* @param[in] offset start Byte position in codestream
* @return fetched code
*/
Byte2_t fetch_codestream2bytebigendian( codestream_param_t *cs, OPJ_OFF_T offset);
Byte2_t fetch_codestream2bytebigendian(codestream_param_t *cs,
OPJ_OFF_T offset);
/**
* fetch Codestream 4-byte big endian Byte codes in file stream
@ -87,7 +89,8 @@ Byte2_t fetch_codestream2bytebigendian( codestream_param_t *cs, OPJ_OFF_T offset
* @param[in] offset start Byte position in codestream
* @return fetched code
*/
Byte4_t fetch_codestream4bytebigendian( codestream_param_t *cs, OPJ_OFF_T offset);
Byte4_t fetch_codestream4bytebigendian(codestream_param_t *cs,
OPJ_OFF_T offset);
/**

View File

@ -46,7 +46,8 @@
* @param[in,out] streamlen address of stream length
* @param[in,out] msgqueue message queue pointer
*/
void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist, Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue);
void handle_JPIPstreamMSG(SOCKET connected_socket, cachelist_param_t *cachelist,
Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue);
/**
* handle PNM request message
@ -56,7 +57,8 @@ void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist
* @param[in] msgqueue message queue pointer
* @param[in] cachelist cache list pointer
*/
void handle_PNMreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
void handle_PNMreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
/**
* handle XML request message
@ -65,7 +67,8 @@ void handle_PNMreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_par
* @param[in] jpipstream address of caching jpipstream pointer
* @param[in] cachelist cache list pointer
*/
void handle_XMLreqMSG( SOCKET connected_socket, Byte_t *jpipstream, cachelist_param_t *cachelist);
void handle_XMLreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
cachelist_param_t *cachelist);
/**
* handle TargetID request message
@ -99,7 +102,8 @@ void handle_dstCIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist)
* @param[in] msgqueue message queue pointer
* @param[in,out] cachelist cache list pointer
*/
void handle_SIZreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
void handle_SIZreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
/**
* handle saving JP2 file request message
@ -109,7 +113,8 @@ void handle_SIZreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_par
* @param[in] msgqueue message queue pointer
* @param[in] jpipstream address of caching jpipstream pointer
*/
void handle_JP2saveMSG( SOCKET connected_socket, cachelist_param_t *cachelist, msgqueue_param_t *msgqueue, Byte_t *jpipstream);
void handle_JP2saveMSG(SOCKET connected_socket, cachelist_param_t *cachelist,
msgqueue_param_t *msgqueue, Byte_t *jpipstream);
#endif /* !DEC_CLIENTMSG_HANDLER_H_ */

View File

@ -66,8 +66,10 @@ typedef struct subfaixbox8_param{
/** variable sized parameters in fragment array index box*/
typedef union subfaixbox_param {
subfaixbox4_param_t *byte4_params; /**< parameters with 4byte codes for version 0 or 2*/
subfaixbox8_param_t *byte8_params; /**< parameters with 8byte codes for version 1 or 3*/
subfaixbox4_param_t
*byte4_params; /**< parameters with 4byte codes for version 0 or 2*/
subfaixbox8_param_t
*byte8_params; /**< parameters with 8byte codes for version 1 or 3*/
} subfaixbox_param_t;
/** fragment array index box parameters*/

View File

@ -50,7 +50,8 @@ typedef struct ihdrbox_param{
* @param[in] jpipstream JPT/JPP stream
* @return pointer to generated ihdr box
*/
ihdrbox_param_t * gene_ihdrbox( metadatalist_param_t *metadatalist, Byte_t *jpipstream);
ihdrbox_param_t * gene_ihdrbox(metadatalist_param_t *metadatalist,
Byte_t *jpipstream);
#endif /* !IHDRBOX_MANAGER_H_ */

View File

@ -76,7 +76,8 @@ imgreg_param_t map_viewin2imgreg( const int fx, const int fy,
* @param[in,out] xmax horizontal image size pointer
* @param[in,out] ymax vertical image size pointer
*/
void find_level( int maxlev, int *lev, int *fx, int *fy, int *xmin, int *ymin, int *xmax, int *ymax);
void find_level(int maxlev, int *lev, int *fx, int *fy, int *xmin, int *ymin,
int *xmax, int *ymax);
/**
* compute decomposition level (only to get the level

View File

@ -56,7 +56,8 @@ msgtype_t identify_clientmsg( SOCKET connected_socket);
* @param [out] streamlen length of the received codestream
* @return JPT- JPP- codestream
*/
Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid, char **cid, OPJ_SIZE_T *streamlen);
Byte_t * receive_JPIPstream(SOCKET connected_socket, char **target, char **tid,
char **cid, OPJ_SIZE_T *streamlen);
/**
* send PGM/PPM image stream to the client
@ -68,7 +69,8 @@ Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid,
* @param [in] numofcomp number of components of the image
* @param [in] maxval maximum value of the image (only 255 supported)
*/
void send_PNMstream( SOCKET connected_socket, Byte_t *pnmstream, unsigned int width, unsigned int height, unsigned int numofcomp, Byte_t maxval);
void send_PNMstream(SOCKET connected_socket, Byte_t *pnmstream,
unsigned int width, unsigned int height, unsigned int numofcomp, Byte_t maxval);
/**
* send XML data stream to the client
@ -77,7 +79,8 @@ void send_PNMstream( SOCKET connected_socket, Byte_t *pnmstream, unsigned int wi
* @param [in] xmlstream xml data stream
* @param [in] length legnth of the xml data stream
*/
void send_XMLstream( SOCKET connected_socket, Byte_t *xmlstream, OPJ_SIZE_T length);
void send_XMLstream(SOCKET connected_socket, Byte_t *xmlstream,
OPJ_SIZE_T length);
/**
* send TID data stream to the client
@ -86,7 +89,8 @@ void send_XMLstream( SOCKET connected_socket, Byte_t *xmlstream, OPJ_SIZE_T leng
* @param [in] tid tid string
* @param [in] tidlen legnth of the tid string
*/
void send_TIDstream( SOCKET connected_socket, const char *tid, OPJ_SIZE_T tidlen);
void send_TIDstream(SOCKET connected_socket, const char *tid,
OPJ_SIZE_T tidlen);
/**
* send CID data stream to the client
@ -95,7 +99,8 @@ void send_TIDstream( SOCKET connected_socket, const char *tid, OPJ_SIZE_T tidlen
* @param [in] cid cid string
* @param [in] cidlen legnth of the cid string
*/
void send_CIDstream( SOCKET connected_socket, const char *cid, OPJ_SIZE_T cidlen);
void send_CIDstream(SOCKET connected_socket, const char *cid,
OPJ_SIZE_T cidlen);
/**
* send SIZ data stream to the client
@ -104,7 +109,8 @@ void send_CIDstream( SOCKET connected_socket, const char *cid, OPJ_SIZE_T cidlen
* @param [in] width original width of the image
* @param [in] height original height of the image
*/
void send_SIZstream( SOCKET connected_socket, unsigned int width, unsigned int height);
void send_SIZstream(SOCKET connected_socket, unsigned int width,
unsigned int height);
/**
* send response signal to the client

View File

@ -91,8 +91,10 @@ typedef struct index_param{
SIZmarker_param_t SIZ; /**< SIZ marker information*/
CODmarker_param_t COD; /**< COD marker information*/
faixbox_param_t *tilepart; /**< tile part information from tpix box*/
mhixbox_param_t **tileheader; /**< dynamic array of tile header information from thix box*/
faixbox_param_t **precpacket; /**< dynamic array of precint packet information from ppix box*/
mhixbox_param_t
**tileheader; /**< dynamic array of tile header information from thix box*/
faixbox_param_t
**precpacket; /**< dynamic array of precint packet information from ppix box*/
} index_param_t;
@ -155,7 +157,8 @@ typedef struct range_param{
* @param[in] level decomposition level
* @return structured range parameter
*/
range_param_t get_tile_Xrange( SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
range_param_t get_tile_Xrange(SIZmarker_param_t SIZ, Byte4_t tile_id,
int level);
/**
* get vertical range of the tile in reference grid
@ -165,7 +168,8 @@ range_param_t get_tile_Xrange( SIZmarker_param_t SIZ, Byte4_t tile_id, int level
* @param[in] level decomposition level
* @return structured range parameter
*/
range_param_t get_tile_Yrange( SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
range_param_t get_tile_Yrange(SIZmarker_param_t SIZ, Byte4_t tile_id,
int level);
/**

View File

@ -43,7 +43,8 @@
* @param[out] COD COD marker pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL get_mainheader_from_j2kstream( Byte_t *j2kstream, SIZmarker_param_t *SIZ, CODmarker_param_t *COD);
OPJ_BOOL get_mainheader_from_j2kstream(Byte_t *j2kstream,
SIZmarker_param_t *SIZ, CODmarker_param_t *COD);
/**
* modify main header in j2k codestream to fit with the new number of decompositions
@ -55,7 +56,8 @@ OPJ_BOOL get_mainheader_from_j2kstream( Byte_t *j2kstream, SIZmarker_param_t *SI
* @param[out] j2klen pointer to the length of j2k code stream
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL modify_mainheader( Byte_t *j2kstream, int numOfdecomp, SIZmarker_param_t SIZ, CODmarker_param_t COD, Byte8_t *j2klen);
OPJ_BOOL modify_mainheader(Byte_t *j2kstream, int numOfdecomp,
SIZmarker_param_t SIZ, CODmarker_param_t COD, Byte8_t *j2klen);
/**
* modify tile header in j2k codestream to fit with the tile part length, and new number of decompositions for multi-componet images
@ -67,6 +69,7 @@ OPJ_BOOL modify_mainheader( Byte_t *j2kstream, int numOfdecomp, SIZmarker_param_
* @param[out] j2klen pointer to the length of j2k code stream
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL modify_tileheader( Byte_t *j2kstream, Byte8_t SOToffset, int numOfdecomp, Byte2_t Csiz, Byte8_t *j2klen);
OPJ_BOOL modify_tileheader(Byte_t *j2kstream, Byte8_t SOToffset,
int numOfdecomp, Byte2_t Csiz, Byte8_t *j2klen);
#endif /* !J2KHEADER_MANAGER_H_ */

View File

@ -46,7 +46,8 @@
* @param[out] j2klen pointer to the j2k codestream length
* @return generated reconstructed j2k codestream
*/
Byte_t * recons_j2k( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, int fw, int fh, Byte8_t *j2klen);
Byte_t * recons_j2k(msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn,
int fw, int fh, Byte8_t *j2klen);
/**
@ -58,7 +59,8 @@ Byte_t * recons_j2k( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn
* @param[out] jp2len pointer to the jp2 codestream length
* @return generated reconstructed jp2 codestream
*/
Byte_t * recons_jp2( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, Byte8_t *jp2len);
Byte_t * recons_jp2(msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn,
Byte8_t *jp2len);
/**
* reconstruct j2k codestream of mainheader from message queue
@ -69,6 +71,7 @@ Byte_t * recons_jp2( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn
* @param[out] j2klen pointer to the j2k codestream length
* @return generated reconstructed j2k codestream
*/
Byte_t * recons_j2kmainhead( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, Byte8_t *j2klen);
Byte_t * recons_j2kmainhead(msgqueue_param_t *msgqueue, Byte_t *jpipstream,
Byte8_t csn, Byte8_t *j2klen);
#endif /* !JP2K_ENCODER_H_ */

View File

@ -46,7 +46,8 @@
* @param[out] target address of target pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL identify_target( query_param_t query_param, targetlist_param_t *targetlist, target_param_t **target);
OPJ_BOOL identify_target(query_param_t query_param,
targetlist_param_t *targetlist, target_param_t **target);
/**
* REQUEST: channel association

View File

@ -32,10 +32,13 @@
#include "msgqueue_manager.h"
#include "ihdrbox_manager.h"
Byte_t * update_JPIPstream( Byte_t *newstream, OPJ_SIZE_T newstreamlen, Byte_t *cache_stream, OPJ_SIZE_T *streamlen);
Byte_t * update_JPIPstream(Byte_t *newstream, OPJ_SIZE_T newstreamlen,
Byte_t *cache_stream, OPJ_SIZE_T *streamlen);
void save_codestream(Byte_t *codestream, OPJ_SIZE_T streamlen, const char *fmt);
Byte_t * jpipstream_to_pnm( Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte8_t csn, int fw, int fh, ihdrbox_param_t **ihdrbox);
Byte_t * jpipstream_to_pnm(Byte_t *jpipstream, msgqueue_param_t *msgqueue,
Byte8_t csn, int fw, int fh, ihdrbox_param_t **ihdrbox);
ihdrbox_param_t * get_SIZ_from_jpipstream( Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte8_t csn);
ihdrbox_param_t * get_SIZ_from_jpipstream(Byte_t *jpipstream,
msgqueue_param_t *msgqueue, Byte8_t csn);

View File

@ -52,7 +52,8 @@ typedef struct marker_param{
* @param[in] length marker segment length
* @return structure of generated marker parameters
*/
marker_param_t set_marker( codestream_param_t cs, Byte2_t code, OPJ_OFF_T offset, Byte2_t length);
marker_param_t set_marker(codestream_param_t cs, Byte2_t code, OPJ_OFF_T offset,
Byte2_t length);
/**

View File

@ -44,8 +44,10 @@ typedef struct metadata_param{
Byte8_t idx; /**< index number*/
boxlist_param_t *boxlist; /**< box list*/
placeholderlist_param_t *placeholderlist; /**< placeholder box list*/
boxcontents_param_t *boxcontents; /**< box contens in case of no boxlist and placeholderlist*/
struct metadata_param *next; /**< pointer to the next metadata-bin*/
boxcontents_param_t
*boxcontents; /**< box contens in case of no boxlist and placeholderlist*/
struct metadata_param
*next; /**< pointer to the next metadata-bin*/
} metadata_param_t;
/** metadata-bin list parameters*/
@ -89,7 +91,8 @@ void delete_metadatalist( metadatalist_param_t **list);
* @param[in] boxcontents boxcontents pointer
* @return pointer to the generated metadata bin
*/
metadata_param_t * gene_metadata( Byte8_t idx, boxlist_param_t *boxlist, placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents);
metadata_param_t * gene_metadata(Byte8_t idx, boxlist_param_t *boxlist,
placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents);
/**
* delete a metadata bin
@ -146,6 +149,7 @@ Byte8_t search_metadataidx( char boxtype[4], metadatalist_param_t *list);
* @param[in] metabin metadata-bin pointer
* @param[in] metadatalist metadata list pointer
*/
void insert_metadata_into_list( metadata_param_t *metabin, metadatalist_param_t *metadatalist);
void insert_metadata_into_list(metadata_param_t *metabin,
metadatalist_param_t *metadatalist);
#endif /* !METADATA_MANAGER_H_ */

View File

@ -46,7 +46,8 @@
/** message parameters */
typedef struct message_param {
OPJ_BOOL last_byte; /**< if message contains the last byte of the data-bin*/
OPJ_BOOL
last_byte; /**< if message contains the last byte of the data-bin*/
Byte8_t in_class_id; /**< in-class identifier A.2.3*/
Byte8_t class_id; /**< class identifiers */
Byte8_t csn; /**< index of the codestream*/
@ -73,7 +74,8 @@ typedef struct msgqueue_param{
* @param[in] cachemodel cachemodel pointer
* @return generated message queue pointer
*/
msgqueue_param_t * gene_msgqueue( OPJ_BOOL stateless, cachemodel_param_t *cachemodel);
msgqueue_param_t * gene_msgqueue(OPJ_BOOL stateless,
cachemodel_param_t *cachemodel);
/**
* delete message queue
@ -88,7 +90,8 @@ void delete_msgqueue( msgqueue_param_t **msgqueue);
* @param[in] message address of the deleting message pointer
* @param[in] msgqueue message queue pointer
*/
void delete_message_in_msgqueue( message_param_t **message, msgqueue_param_t *msgqueue);
void delete_message_in_msgqueue(message_param_t **message,
msgqueue_param_t *msgqueue);
/**
* print message queue
@ -131,7 +134,8 @@ void enqueue_tile( Byte4_t tile_id, int level, msgqueue_param_t *msgqueue);
* @param[in] layers num of layers
* @param[in,out] msgqueue message queue
*/
void enqueue_precinct( int seq_id, int tile_id, int comp_id, int layers, msgqueue_param_t *msgqueue);
void enqueue_precinct(int seq_id, int tile_id, int comp_id, int layers,
msgqueue_param_t *msgqueue);
/**
@ -160,7 +164,8 @@ void recons_stream_from_msgqueue( msgqueue_param_t *msgqueue, int tmpfd);
* @param[in] offset offset of the stream from the whole beginning
* @param[in,out] msgqueue adding message queue pointer
*/
void parse_JPIPstream( Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset, msgqueue_param_t *msgqueue);
void parse_JPIPstream(Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset,
msgqueue_param_t *msgqueue);
/**
* parse JPT- JPP- stream to message queue
@ -170,7 +175,8 @@ void parse_JPIPstream( Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset,
* @param[in] streamlen stream length
* @param[in] metadatalist adding metadata list pointer
*/
void parse_metamsg( msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t streamlen, metadatalist_param_t *metadatalist);
void parse_metamsg(msgqueue_param_t *msgqueue, Byte_t *stream,
Byte8_t streamlen, metadatalist_param_t *metadatalist);
/**
* compute precinct ID A.3.2.1
@ -182,6 +188,7 @@ void parse_metamsg( msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t streamle
* @param[in] num_tiles total number of tiles
* @return precicnt id
*/
Byte8_t comp_precinct_id( int t, int c, int s, int num_components, int num_tiles);
Byte8_t comp_precinct_id(int t, int c, int s, int num_components,
int num_tiles);
#endif /* !MSGQUEUE_MANAGER_H_ */

View File

@ -140,7 +140,8 @@ void end_QRprocess( server_record_t *rec, QR_t **qr);
* @param[in] qr query/response data pointer
* @param[in] rec server static record pinter
*/
void local_log( OPJ_BOOL query, OPJ_BOOL messages, OPJ_BOOL sessions, OPJ_BOOL targets, QR_t *qr, server_record_t *rec);
void local_log(OPJ_BOOL query, OPJ_BOOL messages, OPJ_BOOL sessions,
OPJ_BOOL targets, QR_t *qr, server_record_t *rec);
#endif /*SERVER*/
@ -195,7 +196,8 @@ OPJ_API client_t OPJ_CALLCONV accept_connection( dec_server_record_t *rec);
* @param[in] rec decoding server static record pointer
* @return true if succeed
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV handle_clientreq( client_t client, dec_server_record_t *rec);
OPJ_API OPJ_BOOL OPJ_CALLCONV handle_clientreq(client_t client,
dec_server_record_t *rec);
#endif /*SERVER*/
@ -244,7 +246,8 @@ OPJ_API void OPJ_CALLCONV destroy_jpipdecoder( jpip_dec_param_t **dec);
* @param[in] dec JPIP decoding parameters pointer
* @return true if succeed
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV fread_jpip( const char fname[], jpip_dec_param_t *dec);
OPJ_API OPJ_BOOL OPJ_CALLCONV fread_jpip(const char fname[],
jpip_dec_param_t *dec);
/**
* Decode jpip codestream
@ -260,7 +263,8 @@ OPJ_API void OPJ_CALLCONV decode_jpip( jpip_dec_param_t *dec);
* @param[in] dec JPIP decoding parameters pointer
* @return true if succeed
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV fwrite_jp2k( const char fname[], jpip_dec_param_t *dec);
OPJ_API OPJ_BOOL OPJ_CALLCONV fwrite_jp2k(const char fname[],
jpip_dec_param_t *dec);
/**
* Option; print out parameter values to stderr
@ -270,7 +274,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV fwrite_jp2k( const char fname[], jpip_dec_param_t
* @param[in] ihdrbox true if image header data is to be printed out
* @param[in] dec JPIP decoding parameters pointer
*/
OPJ_API void OPJ_CALLCONV output_log( OPJ_BOOL messages, OPJ_BOOL metadata, OPJ_BOOL ihdrbox, jpip_dec_param_t *dec);
OPJ_API void OPJ_CALLCONV output_log(OPJ_BOOL messages, OPJ_BOOL metadata,
OPJ_BOOL ihdrbox, jpip_dec_param_t *dec);
/*
* test the format of index (cidx) box in JP2 file

View File

@ -94,7 +94,8 @@ placeholder_param_t * gene_placeholder( box_param_t *box, Byte8_t origID);
*/
void delete_placeholder(placeholder_param_t **placeholder);
void insert_placeholder_into_list( placeholder_param_t *phld, placeholderlist_param_t *phldlist);
void insert_placeholder_into_list(placeholder_param_t *phld,
placeholderlist_param_t *phldlist);
/**

View File

@ -53,7 +53,8 @@ typedef struct query_param{
int lastcomp; /**< last component number */
OPJ_BOOL *comps; /**< components (dynamic array) for jpp-stream, null means all components */
char *cid; /**< channel identifier */
cnew_transport_t cnew; /**< transport name if there is new channel request, else non */
cnew_transport_t
cnew; /**< transport name if there is new channel request, else non */
char *cclose; /**< list of closing channel identifiers, separated by '\\0' */
int numOfcclose; /**< number of closing channels */
char box_type[MAX_NUMOFBOX][4]; /**< interested box-types */

View File

@ -84,7 +84,8 @@ OPJ_BOOL search_session_and_channel( char cid[],
* @param[in] session session pointer
* @param[in] cachemodel cachemodel pointer
*/
void insert_cachemodel_into_session( session_param_t *session, cachemodel_param_t *cachemodel);
void insert_cachemodel_into_session(session_param_t *session,
cachemodel_param_t *cachemodel);
/**
@ -94,7 +95,8 @@ void insert_cachemodel_into_session( session_param_t *session, cachemodel_param_
* @param[in] sessionlist session list pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL delete_session( session_param_t **session, sessionlist_param_t *sessionlist);
OPJ_BOOL delete_session(session_param_t **session,
sessionlist_param_t *sessionlist);
/**

View File

@ -92,7 +92,8 @@ void * receive_stream( SOCKET connected_socket, OPJ_SIZE_T length);
* @param [in] stream data stream
* @param [in] length length of data stream
*/
void send_stream( SOCKET connected_socket, const void *stream, OPJ_SIZE_T length);
void send_stream(SOCKET connected_socket, const void *stream,
OPJ_SIZE_T length);
/**
* close socket

View File

@ -45,11 +45,13 @@ typedef struct target_param{
char *tmpfname; /**< temporal file name to download a remote target file*/
#endif
int csn; /**< codestream number */
index_param_t *codeidx; /**< index information of codestream */
index_param_t
*codeidx; /**< index information of codestream */
int num_of_use; /**< numbers of sessions referring to this target */
OPJ_BOOL jppstream; /**< if this target can return JPP-stream */
OPJ_BOOL jptstream; /**< if this target can return JPP-stream */
struct target_param *next; /**< pointer to the next target */
struct target_param
*next; /**< pointer to the next target */
} target_param_t;
@ -109,7 +111,8 @@ void delete_target( target_param_t **target);
* @param[in,out] target address of the deleting target pointer
* @param[in] targetlist target list pointer
*/
void delete_target_in_list( target_param_t **target, targetlist_param_t *targetlist);
void delete_target_in_list(target_param_t **target,
targetlist_param_t *targetlist);
/**
@ -142,7 +145,8 @@ void print_alltarget( targetlist_param_t *targetlist);
* @param[in] targetlist target list pointer
* @return found target pointer
*/
target_param_t * search_target( const char targetname[], targetlist_param_t *targetlist);
target_param_t * search_target(const char targetname[],
targetlist_param_t *targetlist);
/**
@ -152,7 +156,8 @@ target_param_t * search_target( const char targetname[], targetlist_param_t *tar
* @param[in] targetlist target list pointer
* @return found target pointer
*/
target_param_t * search_targetBytid( const char tid[], targetlist_param_t *targetlist);
target_param_t * search_targetBytid(const char tid[],
targetlist_param_t *targetlist);
#endif /* !TARGET_MANAGER_H_ */

View File

@ -287,7 +287,8 @@ void j2k_read_red(opj_j2k_t *j2k);
@param post_len length of post-protected data
@return returns the freshly created EPB
*/
jpwl_epb_ms_t *jpwl_epb_create(opj_j2k_t *j2k, opj_bool latest, opj_bool packed, int tileno, int idx, int hprot,
jpwl_epb_ms_t *jpwl_epb_create(opj_j2k_t *j2k, opj_bool latest, opj_bool packed,
int tileno, int idx, int hprot,
unsigned long int pre_len, unsigned long int post_len);
/** add a number of EPB marker segments
@ -334,14 +335,18 @@ int jpwl_esds_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num,
@param jwmarker_num number of JPWL markers
@return returns true in case of success
*/
opj_bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int jwmarker_num);
opj_bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker,
int jwmarker_num);
opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf);
opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark,
unsigned char *buf);
opj_bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf, unsigned char *post_buf);
opj_bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark,
unsigned char *buf, unsigned char *post_buf);
opj_bool j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len);
opj_bool j2k_add_marker(opj_codestream_info_t *cstr_info,
unsigned short int type, int pos, int len);
/** corrects the data in the JPWL codestream
@param j2k J2K compressor handle
@ -359,7 +364,8 @@ opj_bool jpwl_correct(opj_j2k_t *j2k);
@param L4_bufp is a pointer to the buffer pointer of redundancy data
@return returns true if correction could be successfully performed
*/
opj_bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type, int pre_len, int post_len, int *conn,
opj_bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type,
int pre_len, int post_len, int *conn,
unsigned char **L4_bufp);
/** check that a tile and its children have valid data

View File

@ -76,7 +76,8 @@ Write some bytes
@param n Number of bytes to write
@return Returns the number of bytes written or 0 if an error occurred
*/
OPJ_API unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned int64 v, int n);
OPJ_API unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned int64 v,
int n);
/**
Read some bytes
@param cio CIO handle

View File

@ -54,7 +54,8 @@ Write formatted data to a string and send the string to a user callback.
@param fmt Format-control string (plus optionnal arguments)
@return Returns true if successful, returns false otherwise
*/
opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...);
opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt,
...);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -59,7 +59,8 @@ Multiply two fixed-precision rational numbers.
@param b
@return Returns a * b
*/
static INLINE int fix_mul(int a, int b) {
static INLINE int fix_mul(int a, int b)
{
int64 temp = (int64) a * (int64) b ;
temp += temp & 4096;
return (int)(temp >> 13) ;

View File

@ -53,14 +53,16 @@ The functions in INT.H have for goal to realize operations on integers.
Get the minimum of two integers
@return Returns a if a < b else b
*/
static INLINE int int_min(int a, int b) {
static INLINE int int_min(int a, int b)
{
return a < b ? a : b;
}
/**
Get the maximum of two integers
@return Returns a if a > b else b
*/
static INLINE int int_max(int a, int b) {
static INLINE int int_max(int a, int b)
{
return (a > b) ? a : b;
}
/**
@ -72,45 +74,53 @@ Clamp an integer inside an interval
<li>Returns min if (a < min)
</ul>
*/
static INLINE int int_clamp(int a, int min, int max) {
if (a < min)
static INLINE int int_clamp(int a, int min, int max)
{
if (a < min) {
return min;
if (a > max)
}
if (a > max) {
return max;
}
return a;
}
/**
@return Get absolute value of integer
*/
static INLINE int int_abs(int a) {
static INLINE int int_abs(int a)
{
return a < 0 ? -a : a;
}
/**
Divide an integer and round upwards
@return Returns a divided by b
*/
static INLINE int int_ceildiv(int a, int b) {
static INLINE int int_ceildiv(int a, int b)
{
return (a + b - 1) / b;
}
/**
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE int int_ceildivpow2(int a, int b) {
static INLINE int int_ceildivpow2(int a, int b)
{
return (a + (1 << b) - 1) >> b;
}
/**
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static INLINE int int_floordivpow2(int a, int b) {
static INLINE int int_floordivpow2(int a, int b)
{
return a >> b;
}
/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static INLINE int int_floorlog2(int a) {
static INLINE int int_floorlog2(int a)
{
int l;
for (l = 0; a > 1; l++) {
a >>= 1;

View File

@ -402,7 +402,8 @@ Decode an image from a JPEG-2000 codestream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio,
opj_codestream_info_t *cstr_info);
/**
Decode an image form a JPT-stream (JPEG 2000, JPIP)
@param j2k J2K decompressor handle
@ -410,7 +411,8 @@ Decode an image form a JPT-stream (JPEG 2000, JPIP)
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio,
opj_codestream_info_t *cstr_info);
/**
Creates a J2K compression structure
@param cinfo Codec context info
@ -429,7 +431,8 @@ Coding parameters are returned in j2k->cp.
@param parameters compression parameters
@param image input filled image
*/
void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image);
void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters,
opj_image_t *image);
/**
Converts an enum type progression order to string type
*/
@ -442,7 +445,8 @@ Encode an image into a JPEG-2000 codestream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image,
opj_codestream_info_t *cstr_info);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -60,16 +60,14 @@
/**
Channel description: channel index, type, association
*/
typedef struct opj_jp2_cdef_info
{
typedef struct opj_jp2_cdef_info {
unsigned short cn, typ, asoc;
} opj_jp2_cdef_info_t;
/**
Channel descriptions and number of descriptions
*/
typedef struct opj_jp2_cdef
{
typedef struct opj_jp2_cdef {
opj_jp2_cdef_info_t *info;
unsigned short n;
} opj_jp2_cdef_t;
@ -77,8 +75,7 @@ typedef struct opj_jp2_cdef
/**
Component mappings: channel index, mapping type, palette index
*/
typedef struct opj_jp2_cmap_comp
{
typedef struct opj_jp2_cmap_comp {
unsigned short cmp;
unsigned char mtyp, pcol;
} opj_jp2_cmap_comp_t;
@ -86,8 +83,7 @@ typedef struct opj_jp2_cmap_comp
/**
Palette data: table entries, palette columns
*/
typedef struct opj_jp2_pclr
{
typedef struct opj_jp2_pclr {
unsigned int *entries;
unsigned char *channel_sign;
unsigned char *channel_size;
@ -98,8 +94,7 @@ typedef struct opj_jp2_pclr
/**
Collector for ICC profile, palette, component mapping, channel description
*/
typedef struct opj_jp2_color
{
typedef struct opj_jp2_color {
unsigned char *icc_profile_buf;
int icc_profile_len;
@ -197,7 +192,8 @@ Decode an image from a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* opj_jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
opj_image_t* opj_jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio,
opj_codestream_info_t *cstr_info);
/**
Creates a JP2 compression structure
@param cinfo Codec context info
@ -216,7 +212,8 @@ Coding parameters are returned in jp2->j2k->cp.
@param parameters compression parameters
@param image input filled image
*/
void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image);
void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters,
opj_image_t *image);
/**
Encode an image into a JPEG-2000 file stream
@param jp2 JP2 compressor handle
@ -225,7 +222,8 @@ Encode an image into a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image,
opj_codestream_info_t *cstr_info);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -75,6 +75,7 @@ Read the message header for a JPP/JPT - stream
@param cio CIO handle
@param header Message header structure
*/
void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header);
void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio,
opj_jpt_msg_header_t *header);
#endif

View File

@ -329,7 +329,8 @@ Decoding parameters are returned in mj2->j2k->cp.
@param movie MJ2 decompressor handle
@param mj2_parameters decompression parameters
*/
OPJ_API void OPJ_CALLCONV mj2_setup_decoder(opj_mj2_t *movie, mj2_dparameters_t *mj2_parameters);
OPJ_API void OPJ_CALLCONV mj2_setup_decoder(opj_mj2_t *movie,
mj2_dparameters_t *mj2_parameters);
/**
Decode an image from a JPEG-2000 file stream
@param movie MJ2 decompressor handle
@ -353,7 +354,8 @@ Coding parameters are returned in mj2->j2k->cp.
@param movie MJ2 compressor handle
@param parameters compression parameters
*/
OPJ_API void OPJ_CALLCONV mj2_setup_encoder(opj_mj2_t *movie, mj2_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV mj2_setup_encoder(opj_mj2_t *movie,
mj2_cparameters_t *parameters);
/**
Encode an image into a JPEG-2000 file stream
@param movie MJ2 compressor handle
@ -362,7 +364,8 @@ Encode an image into a JPEG-2000 file stream
@param index Name of the index file if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
opj_bool mj2_encode(opj_mj2_t *movie, opj_cio_t *cio, opj_image_t *image, char *index);
opj_bool mj2_encode(opj_mj2_t *movie, opj_cio_t *cio, opj_image_t *image,
char *index);
/**
Init a Standard MJ2 movie

View File

@ -35,9 +35,11 @@ OPJ_API int OPJ_CALLCONV imagetoyuv(opj_image_t * img, char *outfile);
OPJ_API int OPJ_CALLCONV imagetobmp(opj_image_t * img, char *outfile);
OPJ_API opj_image_t * OPJ_CALLCONV mj2_image_create(mj2_tk_t * tk, opj_cparameters_t *parameters);
OPJ_API opj_image_t * OPJ_CALLCONV mj2_image_create(mj2_tk_t * tk,
opj_cparameters_t *parameters);
OPJ_API char OPJ_CALLCONV yuvtoimage(mj2_tk_t * tk, opj_image_t * img, int frame_num, opj_cparameters_t *parameters, char* infile);
OPJ_API char OPJ_CALLCONV yuvtoimage(mj2_tk_t * tk, opj_image_t * img,
int frame_num, opj_cparameters_t *parameters, char* infile);
OPJ_API unsigned int OPJ_CALLCONV yuv_num_frames(mj2_tk_t * tk, char *infile);

View File

@ -754,7 +754,8 @@ Create an image
@param clrspc image color space
@return returns a new image structure if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts,
opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/**
Deallocate any resources associated with an image
@ -779,7 +780,8 @@ to contain encoded data.
@param length Reading: buffer length. Writing: 0
@return Returns a CIO handle if successful, returns NULL otherwise
*/
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo,
unsigned char *buffer, int length);
/**
Close and free a CIO handle
@ -806,7 +808,8 @@ OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
==========================================================
*/
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo,
opj_event_mgr_t *event_mgr, void *context);
/*
==========================================================
@ -818,7 +821,8 @@ Creates a J2K/JPT/JP2 decompression structure
@param format Decoder to select
@return Returns a handle to a decompressor if successful, returns NULL otherwise
*/
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(
OPJ_CODEC_FORMAT format);
/**
Destroy a decompressor handle
@param dinfo decompressor handle to destroy
@ -828,21 +832,24 @@ OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo);
Set decoding parameters to default values
@param parameters Decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(
opj_dparameters_t *parameters);
/**
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in j2k->cp.
@param dinfo decompressor handle
@param parameters decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo,
opj_dparameters_t *parameters);
/**
Decode an image from a JPEG-2000 codestream
@param dinfo decompressor handle
@param cio Input buffer stream
@return Returns a decoded image if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo,
opj_cio_t *cio);
/**
Decode an image from a JPEG-2000 codestream and extract the codestream information
@ -851,7 +858,8 @@ Decode an image from a JPEG-2000 codestream and extract the codestream informati
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo,
opj_cio_t *cio, opj_codestream_info_t *cstr_info);
/**
Creates a J2K/JP2 compression structure
@param format Coder to select
@ -884,14 +892,16 @@ Set encoding parameters to default values, that means :
</ul>
@param parameters Compression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(
opj_cparameters_t *parameters);
/**
Setup the encoder parameters using the current image and using user parameters.
@param cinfo Compressor handle
@param parameters Compression parameters
@param image Input filled image
*/
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image);
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo,
opj_cparameters_t *parameters, opj_image_t *image);
/**
Encode an image into a JPEG-2000 codestream
3@param cinfo compressor handle
@ -900,7 +910,8 @@ Encode an image into a JPEG-2000 codestream
@param index Depreacted -> Set to NULL. To extract index, used opj_encode_wci()
@return Returns true if successful, returns false otherwise
*/
OPJ_API opj_bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index);
OPJ_API opj_bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio,
opj_image_t *image, char *index);
/**
Encode an image into a JPEG-2000 codestream and extract the codestream information
@param cinfo compressor handle
@ -909,12 +920,14 @@ Encode an image into a JPEG-2000 codestream and extract the codestream informati
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
OPJ_API opj_bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
OPJ_API opj_bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo,
opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
/**
Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure
*/
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr_info);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t
*cstr_info);
#ifdef __cplusplus

View File

@ -93,7 +93,8 @@ Most compilers implement their own version of this keyword ...
/* MSVC and Borland C do not have lrintf */
#if defined(_MSC_VER) || defined(__BORLANDC__)
static INLINE long lrintf(float f){
static INLINE long lrintf(float f)
{
#ifdef _M_X64
return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
#else

View File

@ -114,7 +114,8 @@ Allocate memory aligned to a 16 byte boundary
#undef opj_aligned_malloc
extern int posix_memalign(void**, size_t, size_t);
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
static INLINE void* __attribute__((malloc)) opj_aligned_malloc(size_t size)
{
void* mem = NULL;
posix_memalign(&mem, 16, size);
return mem;

View File

@ -115,7 +115,8 @@ Create a packet iterator for Encoder
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno,J2K_T2_MODE t2_mode);
opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp,
int tileno, J2K_T2_MODE t2_mode);
/**
Modify the packet iterator for enabling tile part generation
@param pi Handle to the packet iterator generated in pi_initialise_encode
@ -128,7 +129,8 @@ Modify the packet iterator for enabling tile part generation
@param cur_totnum_tp The total number of tile parts in the current tile
@return Returns true if an error is detected
*/
opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp);
opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno,
int pino, int tpnum, int tppos, J2K_T2_MODE t2_mode, int cur_totnum_tp);
/**
Create a packet iterator for Decoder
@param image Raw image for which the packets will be listed
@ -137,7 +139,8 @@ Create a packet iterator for Decoder
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp, int tileno);
opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp,
int tileno);
/**
Destroy a packet iterator

View File

@ -77,7 +77,9 @@ Encode the packets of a tile to a destination buffer
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
@param cur_totnum_tp The total number of tile parts in the current tile
*/
int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_codestream_info_t *cstr_info,int tpnum, int tppos,int pino,J2K_T2_MODE t2_mode,int cur_totnum_tp);
int t2_encode_packets(opj_t2_t* t2, int tileno, opj_tcd_tile_t *tile,
int maxlayers, unsigned char *dest, int len, opj_codestream_info_t *cstr_info,
int tpnum, int tppos, int pino, J2K_T2_MODE t2_mode, int cur_totnum_tp);
/**
Decode the packets of a tile from a source buffer
@param t2 T2 handle
@ -87,7 +89,8 @@ Decode the packets of a tile from a source buffer
@param tile tile for which to decode the packets
@param cstr_info Codestream information structure
*/
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile, opj_codestream_info_t *cstr_info);
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno,
opj_tcd_tile_t *tile, opj_codestream_info_t *cstr_info);
/**
Create a T2 handle

View File

@ -86,7 +86,8 @@ typedef struct opj_tcd_cblk_enc {
unsigned char* data; /* Data */
opj_tcd_layer_t* layers; /* layer information */
opj_tcd_pass_t* passes; /* information about the passes */
int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int numbps;
int numlenbits;
int numpasses; /* number of pass already done for the code-blocks */
@ -97,7 +98,8 @@ typedef struct opj_tcd_cblk_enc {
typedef struct opj_tcd_cblk_dec {
unsigned char* data; /* Data */
opj_tcd_seg_t* segs; /* segments informations */
int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int numbps;
int numlenbits;
int len; /* length */
@ -109,7 +111,8 @@ typedef struct opj_tcd_cblk_dec {
FIXME: documentation
*/
typedef struct opj_tcd_precinct {
int x0, y0, x1, y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
int cw, ch; /* number of precinct in width and heigth */
union { /* code-blocks informations */
opj_tcd_cblk_enc_t* enc;
@ -123,7 +126,8 @@ typedef struct opj_tcd_precinct {
FIXME: documentation
*/
typedef struct opj_tcd_band {
int x0, y0, x1, y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
int bandno;
opj_tcd_precinct_t *precincts; /* precinct information */
int numbps;
@ -134,7 +138,8 @@ typedef struct opj_tcd_band {
FIXME: documentation
*/
typedef struct opj_tcd_resolution {
int x0, y0, x1, y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
int pw, ph;
int numbands; /* number sub-band for the resolution level */
opj_tcd_band_t bands[3]; /* subband information */
@ -144,7 +149,8 @@ typedef struct opj_tcd_resolution {
FIXME: documentation
*/
typedef struct opj_tcd_tilecomp {
int x0, y0, x1, y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
int numresolutions; /* number of resolutions level */
opj_tcd_resolution_t *resolutions; /* resolutions information */
int *data; /* data of the component */
@ -155,7 +161,8 @@ typedef struct opj_tcd_tilecomp {
FIXME: documentation
*/
typedef struct opj_tcd_tile {
int x0, y0, x1, y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
int numcomps; /* number of components in tile */
opj_tcd_tilecomp_t *comps; /* Components information */
int numpix; /* add fixed_quality */
@ -232,7 +239,8 @@ Initialize the tile coder (allocate the memory)
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
int curtileno);
/**
Free the memory allocated for encoding
@param tcd TCD handle
@ -245,7 +253,8 @@ Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
int curtileno);
/**
Initialize the tile decoder
@param tcd TCD handle
@ -253,11 +262,13 @@ Initialize the tile decoder
@param cp Coding parameters
*/
void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp);
void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int tileno, opj_codestream_info_t *cstr_info);
void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
int tileno, opj_codestream_info_t *cstr_info);
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
void tcd_rateallocate_fixed(opj_tcd_t *tcd);
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len,
opj_codestream_info_t *cstr_info);
/**
Encode a tile from the raw image into a buffer
@param tcd TCD handle
@ -267,7 +278,8 @@ Encode a tile from the raw image into a buffer
@param cstr_info Codestream information structure
@return
*/
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len,
opj_codestream_info_t *cstr_info);
/**
Decode a tile from a buffer into a raw image
@param tcd TCD handle
@ -276,7 +288,8 @@ Decode a tile from a buffer into a raw image
@param tileno Number that identifies one of the tiles to be decoded
@param cstr_info Codestream information structure
*/
opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info);
opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len,
int tileno, opj_codestream_info_t *cstr_info);
/**
Free the memory allocated for decoding
@param tcd TCD handle

View File

@ -102,7 +102,8 @@ Encode the value of a leaf of the tag-tree up to a given threshold
@param leafno Number that identifies the leaf to encode
@param threshold Threshold to use when encoding value of the leaf
*/
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno,
int threshold);
/**
Decode the value of a leaf of the tag-tree up to a given threshold
@param bio Pointer to a BIO handle