diff options
| author | Yannick Verschueren <unknown@unknown> | 2004-02-13 09:47:40 +0000 |
|---|---|---|
| committer | Yannick Verschueren <unknown@unknown> | 2004-02-13 09:47:40 +0000 |
| commit | bb349b2ceee6027ab19f9fe20ed6d8c6a18a15a2 (patch) | |
| tree | 5771c73a3198f3d5f9276f67d8a31028ef27c95a /libopenjpeg/tcd.h | |
| parent | 4be829988a6423a4ca9582e0ec6948837b529a1b (diff) | |
Update for version 0.8
Diffstat (limited to 'libopenjpeg/tcd.h')
| -rw-r--r-- | libopenjpeg/tcd.h | 136 |
1 files changed, 76 insertions, 60 deletions
diff --git a/libopenjpeg/tcd.h b/libopenjpeg/tcd.h index e8e87727..9401e968 100644 --- a/libopenjpeg/tcd.h +++ b/libopenjpeg/tcd.h @@ -33,101 +33,116 @@ #include "tgt.h" typedef struct { - int numpasses; - int len; - unsigned char *data; - int maxpasses; - int numnewpasses; - int newlen; + int numpasses; + int len; + unsigned char *data; + int maxpasses; + int numnewpasses; + int newlen; } tcd_seg_t; typedef struct { - int rate; - double distortiondec; - int term, len; + int rate; + double distortiondec; + int term, len; } tcd_pass_t; typedef struct { - int numpasses; - int len; - double disto; /* add for index (Cfr. Marcela) */ - unsigned char *data; + int numpasses; /* Number of passes in the layer */ + int len; /* len of information */ + double disto; /* add for index (Cfr. Marcela) */ + unsigned char *data; /* data */ } tcd_layer_t; typedef struct { - int x0, y0, x1, y1; - int numbps; - int numlenbits; - int len; - int numpasses; - int numnewpasses; - int numsegs; - tcd_seg_t segs[100]; - unsigned char data[8192]; - int numpassesinlayers; - tcd_layer_t layers[100]; - int totalpasses; - tcd_pass_t passes[100]; + 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 */ + int numpasses; /* number of pass already done for the code-blocks */ + int numnewpasses; /* number of pass added to the code-blocks */ + int numsegs; /* number of segments */ + tcd_seg_t segs[100]; /* segments informations */ + unsigned char data[8192]; /* Data */ + int numpassesinlayers; /* number of passes in the layer */ + tcd_layer_t layers[100]; /* layer information */ + int totalpasses; /* total number of passes */ + tcd_pass_t passes[100]; /* information about the passes */ } tcd_cblk_t; typedef struct { - int x0, y0, x1, y1; - int cw, ch; - tcd_cblk_t *cblks; - tgt_tree_t *incltree; - tgt_tree_t *imsbtree; + 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 */ + tcd_cblk_t *cblks; /* code-blocks informations */ + tgt_tree_t *incltree; /* inclusion tree */ + tgt_tree_t *imsbtree; /* IMSB tree */ } tcd_precinct_t; typedef struct { - int x0, y0, x1, y1; - int bandno; - tcd_precinct_t *precincts; - int numbps; - int stepsize; + int x0, y0, x1, y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */ + int bandno; + tcd_precinct_t *precincts; /* precinct information */ + int numbps; + int stepsize; } tcd_band_t; typedef struct { - int x0, y0, x1, y1; - int previous_x0, previous_y0, previous_x1, previous_y1; /* usefull for the DWT */ - int cas_col, cas_row; /* usefull for the DWT */ - int pw, ph; /* , old_pw,old_ph, old_pw_max,old_ph_max; */ - int numbands; - tcd_band_t bands[3]; + 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 */ + tcd_band_t bands[3]; /* subband information */ } tcd_resolution_t; typedef struct { - int x0, y0, x1, y1; - int previous_row, previous_col; /* usefull for the DWT */ - int numresolutions; - tcd_resolution_t *resolutions; - int *data; + int x0, y0, x1, y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */ + int numresolutions; /* number of resolutions level */ + tcd_resolution_t *resolutions; /* resolutions information */ + int *data; /* data of the component */ } tcd_tilecomp_t; typedef struct { - int x0, y0, x1, y1; - int numcomps; - /* int PPT; */ - /* int len_ppt; */ - tcd_tilecomp_t *comps; + 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 */ + tcd_tilecomp_t *comps; /* Components information */ } tcd_tile_t; typedef struct { - int tw, th; - tcd_tile_t *tiles; + int tw, th; /* number of tiles in width and heigth */ + tcd_tile_t *tiles; /* Tiles information */ } tcd_image_t; /* - * Initialize the tile coder/decoder + * Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode) * img: raw image * cp: coding parameters - * info_IM: creation of index file + * curtileno : number that identifies the tile that will be encoded */ void tcd_init_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno); + +/* + * Initialize the tile coder (allocate the memory) + * img: raw image + * cp: coding parameters + * curtileno : number that identifies the tile that will be encoded + */ void tcd_malloc_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno); + +/* + * Initialize the tile decoder + * img: raw image + * cp: coding parameters + */ void tcd_init(j2k_image_t * img, j2k_cp_t * cp); + +/* + * Free the memory allocated for encoding + * img: raw image + * cp: coding parameters + * curtileno : number that identifies the tile that will be encoded + */ void tcd_free_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno); /* @@ -135,18 +150,19 @@ void tcd_free_encode(j2k_image_t * img, j2k_cp_t * cp, int curtileno); * tileno: number that identifies one of the tiles to be encoded * dest: destination buffer * len: length of destination buffer + * info_IM: creation of index file */ -int tcd_encode_tile_pxm(int tileno, unsigned char *dest, int len, - info_image * info_IM); +int tcd_encode_tile_pxm(int tileno, unsigned char *dest, int len, info_image * info_IM); + /* * Encode a tile from the raw image into a buffer, format pgx * tileno: number that identifies one of the tiles to be encoded * dest: destination buffer * len: length of destination buffer + * info_IM: creation of index file */ -int tcd_encode_tile_pgx(int tileno, unsigned char *dest, int len, - info_image * info_IM); +int tcd_encode_tile_pgx(int tileno, unsigned char *dest, int len, info_image * info_IM); /* * Decode a tile from a buffer into a raw image |
