+ : added
September 19, 2011
++ [mickael] WIP: create a new framework to output file information
+ [mickael] WIP: remove a piece of code copy by the merge op at the wrong place
+ [mickael] WIP: begin to clean j2k_dump and some other small things
+ [mickael] WIP: enchance the new version with some bug fixes from v1 and from me
\r
return EXIT_SUCCESS;\r
}\r
+\r
+/* ------------------------------------------------------------------------------------ */\r
+\r
+/**\r
+Dump the file info structure into a file\r
+@param stream output stream\r
+@param file_info informations read into the JPG2000 file\r
+@return Returns 0 if successful, returns 1 otherwise\r
+*/\r
+int dump_file_info(FILE* stream, opj_file_info_t *file_info)\r
+{\r
+ /* IMAGE HEADER */\r
+ if ( file_info->file_info_flag & OPJ_IMG_INFO ) {\r
+ opj_image_header_t img_header = file_info->img_info;\r
+ int compno;\r
+\r
+ fprintf(stream, "Image info {\n");\r
+ fprintf(stream, "\t x0=%d, y0=%d\n",img_header.x0, img_header.y0);\r
+ fprintf(stream, "\t x1=%d, y1=%d\n",img_header.x1, img_header.y1);\r
+ fprintf(stream, "\t numcomps=%d\n", img_header.numcomps);\r
+ for (compno = 0; compno < img_header.numcomps; compno++) {\r
+ opj_image_comp_header_t comp = img_header.comps[compno];\r
+\r
+ fprintf(stream, "\t component %d {\n", compno);\r
+ fprintf(stream, "\t\t dx=%d, dy=%d\n", comp.dx, comp.dy);\r
+ fprintf(stream, "\t\t prec=%d\n", comp.prec);\r
+ fprintf(stream, "\t\t sgnd=%d\n", comp.sgnd);\r
+ fprintf(stream, "\t}\n");\r
+ }\r
+ fprintf(stream, "}\n");\r
+ }\r
+\r
+ /* CODESTREAM INFO */\r
+ if ( file_info->file_info_flag & OPJ_J2K_INFO ) {\r
+ opj_codestream_info_v2_t cstr_info = file_info->codestream_info;\r
+ int tileno, compno, layno, bandno, resno, numbands;\r
+\r
+ fprintf(stream, "Codestream info {\n");\r
+ fprintf(stream, "\t tx0=%d, ty0=%d\n", cstr_info.tx0, cstr_info.ty0);\r
+ fprintf(stream, "\t tdx=%d, tdy=%d\n", cstr_info.tdx, cstr_info.tdy);\r
+ fprintf(stream, "\t tw=%d, th=%d\n", cstr_info.tw, cstr_info.th);\r
+\r
+ for (tileno = 0; tileno < cstr_info.tw * cstr_info.th; tileno++) {\r
+ opj_tile_info_v2_t tile_info = cstr_info.tile[tileno];\r
+\r
+ fprintf(stream, "\t tile %d {\n", tileno);\r
+ fprintf(stream, "\t\t csty=%x\n", tile_info.csty);\r
+ fprintf(stream, "\t\t prg=%d\n", tile_info.prg);\r
+ fprintf(stream, "\t\t numlayers=%d\n", tile_info.numlayers);\r
+ fprintf(stream, "\t\t mct=%d\n", tile_info.mct);\r
+ fprintf(stream, "\t\t rates=");\r
+\r
+ for (layno = 0; layno < tile_info.numlayers; layno++) {\r
+ fprintf(stream, "%.1f ", tile_info.rates[layno]);\r
+ }\r
+ fprintf(stream, "\n");\r
+\r
+ for (compno = 0; compno < cstr_info.numcomps; compno++) {\r
+ opj_tccp_info_t tccp_info = tile_info.tccp_info[compno];\r
+\r
+ fprintf(stream, "\t\t comp %d {\n", compno);\r
+ fprintf(stream, "\t\t\t csty=%x\n", tccp_info.csty);\r
+ fprintf(stream, "\t\t\t numresolutions=%d\n", tccp_info.numresolutions);\r
+ fprintf(stream, "\t\t\t cblkw=%d\n", tccp_info.cblkw);\r
+ fprintf(stream, "\t\t\t cblkh=%d\n", tccp_info.cblkh);\r
+ fprintf(stream, "\t\t\t cblksty=%x\n", tccp_info.cblksty);\r
+ fprintf(stream, "\t\t\t qmfbid=%d\n", tccp_info.qmfbid);\r
+ fprintf(stream, "\t\t\t qntsty=%d\n", tccp_info.qntsty);\r
+ fprintf(stream, "\t\t\t numgbits=%d\n", tccp_info.numgbits);\r
+ fprintf(stream, "\t\t\t roishift=%d\n", tccp_info.roishift);\r
+\r
+#ifdef TODO_MSD\r
+ fprintf(stream, "\t\t\t stepsizes=");\r
+ numbands = tccp_info->qntsty == J2K_CCP_QNTSTY_SIQNT ? 1 : tccp_info->numresolutions * 3 - 2;\r
+ for (bandno = 0; bandno < numbands; bandno++) {\r
+ fprintf(stream, "(%d,%d) ", tccp_info->stepsizes[bandno].mant,\r
+ tccp_info->stepsizes[bandno].expn);\r
+ }\r
+ fprintf(stream, "\n");\r
+\r
+ if (tccp_info->csty & J2K_CCP_CSTY_PRT) {\r
+ fprintf(stream, " prcw=");\r
+ for (resno = 0; resno < tccp_info->numresolutions; resno++) {\r
+ fprintf(stream, "%d ", tccp_info->prcw[resno]);\r
+ }\r
+ fprintf(stream, "\n");\r
+\r
+ fprintf(stream, " prch=");\r
+ for (resno = 0; resno < tccp_info->numresolutions; resno++) {\r
+ fprintf(stream, "%d ", tccp_info->prch[resno]);\r
+ }\r
+ fprintf(stream, "\n");\r
+ }\r
+#endif\r
+ fprintf(stream, "\t\t\t }\n");\r
+ } /*end of component*/\r
+ fprintf(stream, "\t\t }\n");\r
+ } /*end of tile */\r
+ fprintf(stream, "\t }\n");\r
+ }\r
+\r
+ if ( file_info->file_info_flag & OPJ_JP2_INFO ) {\r
+ // not yet coded\r
+ }\r
+ return EXIT_SUCCESS;\r
+}\r
*/\r
int write_index_file(opj_codestream_info_t *cstr_info, char *index);\r
\r
+int dump_file_info(FILE* stream, opj_file_info_t *file_info);\r
+\r
#ifdef __cplusplus\r
}\r
#endif\r
opj_option_t long_option[]={
{"ImgDir",REQ_ARG, NULL ,'y'},
};
- const char optlist[] = "i:o:h";
+ const char optlist[] = "i:o:d:h";
totlen=sizeof(long_option);
img_fol->set_out_format = 0;
break;
/* ----------------------------------------------------- */
+ case 'd': /* Input decode ROI */
+ {
+ int size_optarg = (int)strlen(optarg) + 1;
+ char *ROI_values = (char*) malloc(size_optarg);
+ ROI_values[0] = '\0';
+ strncpy(ROI_values, optarg, strlen(optarg));
+ ROI_values[strlen(optarg)] = '\0';
+ printf("ROI_values = %s [%d / %d]\n", ROI_values, strlen(ROI_values), size_optarg );
+ parse_ROI_values( ROI_values, ¶meters->ROI_x0, ¶meters->ROI_y0, ¶meters->ROI_x1, ¶meters->ROI_y1);
+ }
+ break;
+ /* ----------------------------------------------------- */
default:
fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, opj_optarg);
break;
return 0;
}
+/*******************************************************************************
+ * Parse ROI input values
+ * separator = ","
+ *******************************************************************************/
+int parse_ROI_values( char* inArg, unsigned int *ROI_x0, unsigned int *ROI_y0, unsigned int *ROI_x1, unsigned int *ROI_y1)
+{
+ int it = 0;
+ int values[4];
+ char delims[] = ",";
+ char *result = NULL;
+ result = strtok( inArg, delims );
+
+ while( (result != NULL) && (it < 4 ) ) {
+ values[it] = atoi(result);
+ result = strtok( NULL, delims );
+ it++;
+ }
+
+ if (it != 4) {
+ return EXIT_FAILURE;
+ }
+ else{
+ *ROI_x0 = values[0]; *ROI_y0 = values[1];
+ *ROI_x1 = values[2]; *ROI_y1 = values[3];
+ return EXIT_SUCCESS;
+ }
+}
+
/* -------------------------------------------------------------------------- */
/**
img_fol_t img_fol;
opj_event_mgr_t event_mgr; /* event manager */
opj_image_header_t* image = NULL;
+ opj_file_info_t file_info;
FILE *fsrc = NULL, *fout = NULL;
int num_images;
int i,imageno;
/* Read the header of each image one by one */
for(imageno = 0; imageno < num_images ; imageno++){
- image = NULL;
+
fprintf(stderr,"\n");
if(img_fol.set_imgdir==1){
}
}
- /*NEW V2 STYLE*/
/* read the input file and put it in memory */
/* ---------------------------------------- */
fsrc = fopen(parameters.infile, "rb");
}
cio = opj_stream_create_default_file_stream(fsrc,1);
+ if (!cio){
+ fprintf(stderr, "ERROR -> failed to create the stream from the file\n");
+ return EXIT_FAILURE;
+ }
/* decode the code-stream */
/* ---------------------- */
/* setup the decoder decoding parameters using user parameters */
opj_setup_decoder_v2(dinfo, ¶meters, &event_mgr);
- if(! opj_read_header(cio, dinfo, &image, &cstr_info)){
+ if(! opj_read_header(cio, dinfo, &file_info, OPJ_IMG_INFO | OPJ_J2K_INFO)){
fprintf(stderr, "ERROR -> j2k_dump: failed to read the header\n");
opj_stream_destroy(cio);
fclose(fsrc);
return EXIT_FAILURE;
}
- /* Dump file informations from header */
+ printf("Setting decoding area to %d,%d,%d,%d\n",
+ parameters.ROI_x0, parameters.ROI_y0, parameters.ROI_x1, parameters.ROI_x1);
+ opj_set_decode_area(dinfo,
+ parameters.ROI_x0, parameters.ROI_y0,
+ parameters.ROI_x1, parameters.ROI_x1);
+ /* Dump file informations from header */
+ dump_file_info(fout, &file_info);
/* close the byte stream */
opj_stream_destroy(cio);
opj_image_header_destroy(image);
+ //FIXME opj_file_info_destroy(file_info);
}
-/*NEW V2 STYLE*/
+
/* Close the output file */
fclose(fout);
fprintf(fd, " sgnd=%d\n", comp->sgnd);
fprintf(fd, " }\n");
}
- fprintf(fd, " XTOsiz=%d, YTOsiz=%d, XTsiz=%d, YTsiz=%d\n", img->tile_x0, img->tile_y0, img->tile_width, img->tile_height);
- fprintf(fd, " Nb of tiles in x direction=%d, Nb of tiles in y direction=%d\n", img->nb_tiles_x, img->nb_tiles_y);
+ //fprintf(fd, " XTOsiz=%d, YTOsiz=%d, XTsiz=%d, YTsiz=%d\n", img->tile_x0, img->tile_y0, img->tile_width, img->tile_height);
+ //fprintf(fd, " Nb of tiles in x direction=%d, Nb of tiles in y direction=%d\n", img->nb_tiles_x, img->nb_tiles_y);
fprintf(fd, "}\n");
}
}
}
+void opj_initialise_file_info(opj_file_info_t *file_info, OPJ_INT32 file_info_flag, OPJ_INT32 codec_format) {
+
+ file_info->file_info_flag = file_info_flag;
+ file_info->file_format = codec_format;
+}
/* Index */
if (p_j2k->cstr_info) {
- //opj_codestream_info_t *cstr_info = p_j2k->cstr_info;
+ int it_tile = 0;
+
p_j2k->cstr_info->image_w = l_image->x1 - l_image->x0;
p_j2k->cstr_info->image_h = l_image->y1 - l_image->y0;
p_j2k->cstr_info->numcomps = l_image->numcomps;
p_j2k->cstr_info->tw = l_cp->tw;
p_j2k->cstr_info->th = l_cp->th;
- p_j2k->cstr_info->tile_x = l_cp->tdx;
- p_j2k->cstr_info->tile_y = l_cp->tdy;
- p_j2k->cstr_info->tile_Ox = l_cp->tx0;
- p_j2k->cstr_info->tile_Oy = l_cp->ty0;
- p_j2k->cstr_info->tile = (opj_tile_info_t*) opj_calloc(l_nb_tiles, sizeof(opj_tile_info_t));
- if (p_j2k->cstr_info->tile == 00) {
- opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
+ p_j2k->cstr_info->tdx = l_cp->tdx;
+ p_j2k->cstr_info->tdy = l_cp->tdy;
+ p_j2k->cstr_info->tx0 = l_cp->tx0;
+ p_j2k->cstr_info->ty0 = l_cp->ty0;
+
+ p_j2k->cstr_info->tile = (opj_tile_info_v2_t*) opj_calloc(l_nb_tiles, sizeof(opj_tile_info_v2_t));
+ if (! p_j2k->cstr_info->tile) {
+ opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory [SIZ marker]\n");
return OPJ_FALSE;
}
- memset(p_j2k->cstr_info->tile,0,l_nb_tiles * sizeof(opj_tile_info_t));
+
+ for (it_tile = 0; it_tile < l_nb_tiles; it_tile++ ) {
+ p_j2k->cstr_info->tile[it_tile].tccp_info =
+ (opj_tccp_info_t*) opj_calloc( l_image->numcomps, sizeof(opj_tccp_info_t));
+ if (! p_j2k->cstr_info->tile[it_tile].tccp_info) {
+ opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory [SIZ marker]\n");
+ return OPJ_FALSE;
+ }
+ }
}
+
return OPJ_TRUE;
}
opj_tcp_v2_t *l_tcp = 00;
opj_image_header_t *l_image = 00;
- // preconditions
+ /* preconditions */
assert(p_header_data != 00);
assert(p_j2k != 00);
assert(p_manager != 00);
l_image = p_j2k->m_image_header;
l_cp = &(p_j2k->m_cp);
- // If we are in a tile-part header
+
+ /* If we are in the first tile-part header of the current tile */
l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ? /*FIXME J2K_DEC_STATE_TPH)*/
&l_cp->tcps[p_j2k->m_current_tile_number] :
p_j2k->m_specific_param.m_decoder.m_default_tcp;
-
- // Make sure room is sufficient
+ /* Make sure room is sufficient */
if (p_header_size < 5) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading COD marker\n");
return OPJ_FALSE;
)
{
OPJ_UINT32 l_current_read_size;
- opj_codestream_info_t * l_cstr_info = 00;
+ opj_codestream_info_v2_t * l_cstr_info = 00;
OPJ_BYTE ** l_current_data = 00;
opj_tcp_v2_t * l_tcp = 00;
OPJ_UINT32 * l_tile_len = 00;
*/
opj_bool j2k_read_header( struct opj_stream_private *p_stream,
opj_j2k_v2_t* p_j2k,
- struct opj_image_header** image_header,
- struct opj_codestream_info** cstr_info,
+ opj_file_info_t* p_file_info,
struct opj_event_mgr* p_manager )
{
- // preconditions
+ /* preconditions */
assert(p_j2k != 00);
assert(p_stream != 00);
assert(p_manager != 00);
- //p_image_header = NULL;
-
/* create an empty image header */
p_j2k->m_image_header = opj_image_header_create0();
if (! p_j2k->m_image_header) {
return OPJ_FALSE;
}
- *cstr_info = p_j2k->cstr_info;
+ /* If necessary copy j2k header information into the output structure */
+ if (p_file_info->file_info_flag & OPJ_J2K_INFO){
+ fill_cstr_info( &(p_file_info->codestream_info), p_j2k, p_manager);
+ }
+
+ /* If necessary copy image header information into the output structure */
+ if (p_file_info->file_info_flag & OPJ_IMG_INFO){
+ fill_img_info( &(p_file_info->img_info), p_j2k, p_manager);
+ }
- *image_header = p_j2k->m_image_header;
- (*image_header)->tile_x0 = p_j2k->m_cp.tx0;
- (*image_header)->tile_y0 = p_j2k->m_cp.ty0;
- (*image_header)->tile_width = p_j2k->m_cp.tdx;
- (*image_header)->tile_height = p_j2k->m_cp.tdy;
- (*image_header)->nb_tiles_x = p_j2k->m_cp.tw;
- (*image_header)->nb_tiles_y = p_j2k->m_cp.th;
+ return OPJ_TRUE;
+}
+
+/**
+ * Fill the image info struct from information read from main header.
+ */
+opj_bool fill_img_info(opj_image_header_t* img_info, opj_j2k_v2_t* p_j2k, struct opj_event_mgr* p_manager)
+{
+ opj_image_header_t* l_image_header = p_j2k->m_image_header;
+
+ img_info->x0 = l_image_header->x0;
+ img_info->y0 = l_image_header->y0;
+ img_info->x1 = l_image_header->x1;
+ img_info->y1 = l_image_header->y1;
+ img_info->numcomps = l_image_header->numcomps;
+
+ if (img_info->numcomps) {
+ img_info->comps = (opj_image_comp_header_t*)opj_malloc(img_info->numcomps * sizeof(opj_image_comp_header_t));
+ if (!img_info->comps){
+ opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory\n");
+ return OPJ_FALSE;
+ }
+
+ memcpy(img_info->comps, l_image_header->comps, img_info->numcomps * sizeof(opj_image_comp_header_t) );
+ }
+
+
+ img_info->icc_profile_len = l_image_header->icc_profile_len;
+ if (img_info->icc_profile_len) {
+ img_info->icc_profile_buf = (unsigned char*)opj_malloc(img_info->icc_profile_len * sizeof(unsigned char));
+ if (!img_info->icc_profile_buf){
+ opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory\n");
+ return OPJ_FALSE;
+ }
+
+ memcpy(img_info->icc_profile_buf, l_image_header->icc_profile_buf, img_info->icc_profile_len);
+ }
return OPJ_TRUE;
}
+/**
+ * Fill the codestream info struct from information read from main header.
+ */
+opj_bool fill_cstr_info(opj_codestream_info_v2_t* cstr_info, opj_j2k_v2_t* p_j2k, struct opj_event_mgr* p_manager)
+{
+
+ //opj_cp_v2_t l_cp = p_j2k->m_cp;
+ opj_image_header_t* l_image_header = p_j2k->m_image_header;
+ int it_tile, it_comp;
+ int nb_tiles, nb_comps;
+
+ cstr_info->image_w = l_image_header->x1 - l_image_header->x0;
+ cstr_info->image_h = l_image_header->y1 - l_image_header->y0;
+ cstr_info->numcomps = l_image_header->numcomps;
+ cstr_info->tw = p_j2k->m_cp.tw;
+ cstr_info->th = p_j2k->m_cp.th;
+ cstr_info->tdx = p_j2k->m_cp.tdx;
+ cstr_info->tdy = p_j2k->m_cp.tdy;
+ cstr_info->tx0 = p_j2k->m_cp.tx0;
+ cstr_info->ty0 = p_j2k->m_cp.ty0;
+
+ nb_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.th;
+ nb_comps = l_image_header->numcomps;
+
+ cstr_info->tile = (opj_tile_info_v2_t*) opj_calloc(nb_tiles, sizeof(opj_tile_info_v2_t));
+ if (! p_j2k->cstr_info->tile) {
+ opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory\n");
+ return OPJ_FALSE;
+ }
+
+ for (it_tile=0; it_tile < nb_tiles; it_tile++){
+ cstr_info->tile[it_tile].tileno = it_tile;
+ cstr_info->tile[it_tile].csty = p_j2k->m_cp.tcps[it_tile].csty;
+ cstr_info->tile[it_tile].prg = p_j2k->m_cp.tcps[it_tile].prg;
+ cstr_info->tile[it_tile].mct = p_j2k->m_cp.tcps[it_tile].mct;
+ cstr_info->tile[it_tile].numlayers = p_j2k->m_cp.tcps[it_tile].numlayers;
+ // FIXME Number of tile part l_cstr_info->tile[it_tile].num_tps = ;
+
+ cstr_info->tile[it_tile].tccp_info =
+ (opj_tccp_info_t*) opj_calloc(nb_comps, sizeof(opj_tccp_info_t));
+ if (! p_j2k->cstr_info->tile[it_tile].tccp_info) {
+ opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory\n");
+ return OPJ_FALSE;
+ }
+
+ for (it_comp=0; it_comp < nb_comps; it_comp++){
+ cstr_info->tile[it_tile].tccp_info[it_comp].compno = it_comp;
+ cstr_info->tile[it_tile].tccp_info[it_comp].cblkh = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].cblkh;
+ cstr_info->tile[it_tile].tccp_info[it_comp].cblkw = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].cblkw;
+ cstr_info->tile[it_tile].tccp_info[it_comp].cblksty = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].cblksty;
+ cstr_info->tile[it_tile].tccp_info[it_comp].csty = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].csty;
+ cstr_info->tile[it_tile].tccp_info[it_comp].numgbits = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].numgbits;
+ cstr_info->tile[it_tile].tccp_info[it_comp].numresolutions = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].numresolutions;
+ cstr_info->tile[it_tile].tccp_info[it_comp].qmfbid = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].qmfbid;
+ cstr_info->tile[it_tile].tccp_info[it_comp].qntsty = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].qntsty;
+ cstr_info->tile[it_tile].tccp_info[it_comp].roishift = p_j2k->m_cp.tcps[it_tile].tccps[it_comp].roishift;
+ }
+ }
+
+ return OPJ_TRUE;
+}
+
+
+
/**
* Sets up the procedures to do on reading header. Developpers wanting to extend the library can add their own reading procedures.
*/
l_j2k->m_specific_param.m_decoder.m_header_data_size = J2K_DEFAULT_HEADER_SIZE;
// codestream info creation
- l_j2k->cstr_info = (opj_codestream_info_t*) opj_malloc(sizeof(opj_codestream_info_t));
+ l_j2k->cstr_info = (opj_codestream_info_v2_t*) opj_malloc(sizeof(opj_codestream_info_v2_t));
if (!l_j2k->cstr_info){
opj_free(l_j2k);
return NULL;
opj_tccp_t *l_tccp = NULL;
OPJ_BYTE * l_current_ptr = NULL;
- // preconditions
+ /* preconditions */
assert(p_j2k != 00);
assert(p_manager != 00);
assert(p_header_data != 00);
&l_cp->tcps[p_j2k->m_current_tile_number] :
p_j2k->m_specific_param.m_decoder.m_default_tcp;
- // precondition again
+ /* precondition again */
assert(compno < p_j2k->m_image_header->numcomps);
l_tccp = &l_tcp->tccps[compno];
l_current_ptr = p_header_data;
- // make sure room is sufficient
+ /* make sure room is sufficient */
if (*p_header_size < 5) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading SPCod SPCoc element\n");
return OPJ_FALSE;
}
+
opj_read_bytes(l_current_ptr, &l_tccp->numresolutions ,1); /* SPcox (D) */
++l_tccp->numresolutions; /* tccp->numresolutions = read() + 1 */
++l_current_ptr;
- // If user wants to remove more resolutions than the codestream contains, return error
+ /* If user wants to remove more resolutions than the codestream contains, return error */
if (l_cp->m_specific_param.m_dec.m_reduce >= l_tccp->numresolutions) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
*p_header_size = *p_header_size - 5;
- // use custom precinct size ?
+ /* use custom precinct size ? */
if (l_tccp->csty & J2K_CCP_CSTY_PRT) {
if (*p_header_size < l_tccp->numresolutions) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading SPCod SPCoc element\n");
return OPJ_FALSE;
}
+
for (i = 0; i < l_tccp->numresolutions; ++i) {
opj_read_bytes(l_current_ptr,&l_tmp ,1); /* SPcoc (I_i) */
++l_current_ptr;
l_tccp->prcw[i] = l_tmp & 0xf;
l_tccp->prch[i] = l_tmp >> 4;
}
+
*p_header_size = *p_header_size - l_tccp->numresolutions;
}
else {
/* INDEX >> */
if (p_j2k->cstr_info && compno == 0) {
OPJ_UINT32 l_data_size = l_tccp->numresolutions * sizeof(OPJ_UINT32);
+
+ p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblkh = l_tccp->cblkh;
+ p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblkw = l_tccp->cblkw;
+ p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].numresolutions = l_tccp->numresolutions;
+ p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblksty = l_tccp->cblksty;
+ p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].qmfbid = l_tccp->qmfbid;
+
+
memcpy(p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].pdx,l_tccp->prcw, l_data_size);
memcpy(p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].pdy,l_tccp->prch, l_data_size);
}
opj_tccp_t *l_ref_tccp = NULL, *l_copied_tccp = NULL;
OPJ_UINT32 l_prc_size;
- // preconditions
+ /* preconditions */
assert(p_j2k != 00);
l_cp = &(p_j2k->m_cp);
struct opj_procedure_list * m_validation_list;
/** helper used to write the index file */
- opj_codestream_info_t *cstr_info;
+ opj_codestream_info_v2_t *cstr_info;
/** the current tile coder/decoder **/
struct opj_tcd_v2 * m_tcd;
*/
opj_bool j2k_read_header( struct opj_stream_private *p_stream,
opj_j2k_v2_t* p_j2k,
- struct opj_image_header** image_header,
- struct opj_codestream_info** cstr_info,
+ opj_file_info_t * p_file_info,
struct opj_event_mgr* p_manager );
*/
opj_bool jp2_read_header( struct opj_stream_private *p_stream,
opj_jp2_v2_t *jp2,
- opj_image_header_t ** p_image_header,
- struct opj_codestream_info** p_cstr_info,
+ opj_file_info_t * p_file_info,
struct opj_event_mgr * p_manager
)
{
return j2k_read_header( p_stream,
jp2->j2k,
- p_image_header,
- p_cstr_info,
+ p_file_info,
p_manager);
}
*/
opj_bool jp2_read_header( struct opj_stream_private *p_stream,
opj_jp2_v2_t *jp2,
- opj_image_header_t ** p_image_header,
- struct opj_codestream_info** p_cstr_info,
+ opj_file_info_t * p_file_info,
struct opj_event_mgr * p_manager
);
typedef struct opj_decompression
{
- opj_bool (* opj_read_header) (
- struct opj_stream_private * cio,
- void * p_codec,
- opj_image_header_t ** image_header,
- opj_codestream_info_t ** cstr_info,
- struct opj_event_mgr * p_manager);
- opj_image_t* (* opj_decode) (void * p_codec, struct opj_stream_private *p_cio, struct opj_event_mgr * p_manager);
- opj_bool (*opj_read_tile_header)(
- void * p_codec,
- OPJ_UINT32 * p_tile_index,
- OPJ_UINT32* p_data_size,
- OPJ_INT32 * p_tile_x0,
- OPJ_INT32 * p_tile_y0,
- OPJ_INT32 * p_tile_x1,
- OPJ_INT32 * p_tile_y1,
- OPJ_UINT32 * p_nb_comps,
- opj_bool * p_should_go_on,
- struct opj_stream_private *p_cio,
- struct opj_event_mgr * p_manager);
- opj_bool (*opj_decode_tile_data)(void * p_codec,OPJ_UINT32 p_tile_index,OPJ_BYTE * p_data,OPJ_UINT32 p_data_size,struct opj_stream_private *p_cio,struct opj_event_mgr * p_manager);
- opj_bool (* opj_end_decompress) (void *p_codec,struct opj_stream_private *cio,struct opj_event_mgr * p_manager);
+ opj_bool (* opj_read_header) ( struct opj_stream_private * cio,
+ void * p_codec,
+ opj_file_info_t * file_info,
+ struct opj_event_mgr * p_manager);
+
+ opj_image_t* (* opj_decode) ( void * p_codec,
+ struct opj_stream_private *p_cio,
+ struct opj_event_mgr * p_manager);
+
+ opj_bool (*opj_read_tile_header)( void * p_codec,
+ OPJ_UINT32 * p_tile_index,
+ OPJ_UINT32* p_data_size,
+ OPJ_INT32 * p_tile_x0, OPJ_INT32 * p_tile_y0,
+ OPJ_INT32 * p_tile_x1, OPJ_INT32 * p_tile_y1,
+ OPJ_UINT32 * p_nb_comps,
+ opj_bool * p_should_go_on,
+ struct opj_stream_private *p_cio,
+ struct opj_event_mgr * p_manager);
+
+ opj_bool (*opj_decode_tile_data)( void * p_codec,
+ OPJ_UINT32 p_tile_index,
+ OPJ_BYTE * p_data,
+ OPJ_UINT32 p_data_size,
+ struct opj_stream_private *p_cio,
+ struct opj_event_mgr * p_manager);
+
+ opj_bool (* opj_end_decompress) ( void *p_codec,
+ struct opj_stream_private *cio,
+ struct opj_event_mgr * p_manager);
+
void (* opj_destroy) (void * p_codec);
- void (*opj_setup_decoder) (void * p_codec, opj_dparameters_t * p_param);
- opj_bool (*opj_set_decode_area) (void * p_codec,OPJ_INT32 p_start_x,OPJ_INT32 p_end_x,OPJ_INT32 p_start_y,OPJ_INT32 p_end_y,struct opj_event_mgr * p_manager);
+ void (*opj_setup_decoder) (void * p_codec, opj_dparameters_t * p_param);
+ opj_bool (*opj_set_decode_area) ( void * p_codec,
+ OPJ_INT32 p_start_x, OPJ_INT32 p_end_x,
+ OPJ_INT32 p_start_y, OPJ_INT32 p_end_y,
+ struct opj_event_mgr * p_manager);
}opj_decompression_t;
typedef struct opj_compression
typedef struct opj_codec_private
{
- union
- { /* code-blocks informations */
- opj_decompression_t m_decompression;
- opj_compression_t m_compression;
+ /* code-blocks informations */
+ union {
+ opj_decompression_t m_decompression;
+ opj_compression_t m_compression;
} m_codec_data;
void * m_codec;
opj_event_mgr_t* m_event_mgr;
OPJ_SIZE_T opj_skip_from_file (OPJ_SIZE_T p_nb_bytes, FILE * p_user_data)
{
- if
- (fseek(p_user_data,p_nb_bytes,SEEK_CUR))
- {
+ if (fseek(p_user_data,p_nb_bytes,SEEK_CUR)) {
return -1;
}
+
return p_nb_bytes;
}
opj_bool opj_seek_from_file (OPJ_SIZE_T p_nb_bytes, FILE * p_user_data)
{
- if
- (fseek(p_user_data,p_nb_bytes,SEEK_SET))
- {
+ if (fseek(p_user_data,p_nb_bytes,SEEK_SET)) {
return EXIT_FAILURE;
}
+
return EXIT_SUCCESS;
}
switch (p_format) {
case CODEC_J2K:
- l_info->m_codec_data.m_decompression.opj_decode = (opj_image_t* (*) (void *, struct opj_stream_private *, struct opj_event_mgr * ))j2k_decode; // TODO MSD
- l_info->m_codec_data.m_decompression.opj_end_decompress = (opj_bool (*) (void *,struct opj_stream_private *,struct opj_event_mgr *))j2k_end_decompress;
- l_info->m_codec_data.m_decompression.opj_read_header = (opj_bool (*) (
- struct opj_stream_private *,
- void *,
- opj_image_header_t **,
- opj_codestream_info_t**,
- struct opj_event_mgr * )) j2k_read_header;
+ l_info->m_codec_data.m_decompression.opj_decode =
+ (opj_image_t* (*) (void *, struct opj_stream_private *, struct opj_event_mgr * ))j2k_decode; // TODO MSD
+
+ l_info->m_codec_data.m_decompression.opj_end_decompress =
+ (opj_bool (*) (void *, struct opj_stream_private *, struct opj_event_mgr *))j2k_end_decompress;
+
+ l_info->m_codec_data.m_decompression.opj_read_header =
+ (opj_bool (*) ( struct opj_stream_private *,
+ void *,
+ opj_file_info_t *,
+ struct opj_event_mgr * )) j2k_read_header;
+
l_info->m_codec_data.m_decompression.opj_destroy = (void (*) (void *))j2k_destroy;
- l_info->m_codec_data.m_decompression.opj_setup_decoder = (void (*) (void * ,opj_dparameters_t * )) j2k_setup_decoder_v2;
- l_info->m_codec_data.m_decompression.opj_read_tile_header = (opj_bool (*) (
- void *,
- OPJ_UINT32*,
- OPJ_UINT32*,
- OPJ_INT32 * ,
- OPJ_INT32 * ,
- OPJ_INT32 * ,
- OPJ_INT32 * ,
- OPJ_UINT32 * ,
- opj_bool *,
- struct opj_stream_private *,
- struct opj_event_mgr * )) j2k_read_tile_header;
- l_info->m_codec_data.m_decompression.opj_decode_tile_data = (opj_bool (*) (void *,OPJ_UINT32,OPJ_BYTE*,OPJ_UINT32,struct opj_stream_private *, struct opj_event_mgr * )) j2k_decode_tile;
- l_info->m_codec_data.m_decompression.opj_set_decode_area = (opj_bool (*) (void *,OPJ_INT32,OPJ_INT32,OPJ_INT32,OPJ_INT32, struct opj_event_mgr * )) j2k_set_decode_area;
+
+ l_info->m_codec_data.m_decompression.opj_setup_decoder = (void (*) (void * , opj_dparameters_t * )) j2k_setup_decoder_v2;
+
+ l_info->m_codec_data.m_decompression.opj_read_tile_header =
+ (opj_bool (*) ( void *,
+ OPJ_UINT32*,
+ OPJ_UINT32*,
+ OPJ_INT32*, OPJ_INT32*,
+ OPJ_INT32*, OPJ_INT32*,
+ OPJ_UINT32*,
+ opj_bool*,
+ struct opj_stream_private *,
+ struct opj_event_mgr * )) j2k_read_tile_header;
+
+ l_info->m_codec_data.m_decompression.opj_decode_tile_data =
+ (opj_bool (*) (void *, OPJ_UINT32, OPJ_BYTE*, OPJ_UINT32, struct opj_stream_private *, struct opj_event_mgr *)) j2k_decode_tile;
+
+ l_info->m_codec_data.m_decompression.opj_set_decode_area =
+ (opj_bool (*) (void *, OPJ_INT32, OPJ_INT32, OPJ_INT32, OPJ_INT32, struct opj_event_mgr *)) j2k_set_decode_area;
+
l_info->m_codec = j2k_create_decompress_v2();
if (! l_info->m_codec) {
case CODEC_JP2:
/* get a JP2 decoder handle */
l_info->m_codec_data.m_decompression.opj_decode = (opj_image_t* (*) (void *, struct opj_stream_private *, struct opj_event_mgr * ))opj_jp2_decode; // TODO MSD
+
l_info->m_codec_data.m_decompression.opj_end_decompress = (opj_bool (*) (void *,struct opj_stream_private *,struct opj_event_mgr *)) jp2_end_decompress;
+
l_info->m_codec_data.m_decompression.opj_read_header = (opj_bool (*) (
struct opj_stream_private *,
void *,
- opj_image_header_t **,
- opj_codestream_info_t**,
+ opj_file_info_t *,
struct opj_event_mgr * )) jp2_read_header;
- l_info->m_codec_data.m_decompression.opj_read_tile_header = (
- opj_bool (*) (
+ l_info->m_codec_data.m_decompression.opj_read_tile_header = ( opj_bool (*) (
void *,
OPJ_UINT32*,
OPJ_UINT32*,
l_info->m_codec_data.m_decompression.opj_decode_tile_data = (opj_bool (*) (void *,OPJ_UINT32,OPJ_BYTE*,OPJ_UINT32,struct opj_stream_private *, struct opj_event_mgr * )) opj_jp2_decode_tile;
l_info->m_codec_data.m_decompression.opj_destroy = (void (*) (void *))jp2_destroy;
+
l_info->m_codec_data.m_decompression.opj_setup_decoder = (void (*) (void * ,opj_dparameters_t * )) jp2_setup_decoder_v2;
+
l_info->m_codec_data.m_decompression.opj_set_decode_area = (opj_bool (*) (void *,OPJ_INT32,OPJ_INT32,OPJ_INT32,OPJ_INT32, struct opj_event_mgr * )) jp2_set_decode_area;
l_info->m_codec = jp2_create(OPJ_TRUE);
parameters->cod_format = -1;
parameters->tcp_rates[0] = 0;
parameters->tcp_numlayers = 0;
- parameters->cp_disto_alloc = 0;
+ parameters->cp_disto_alloc = 0;
parameters->cp_fixed_alloc = 0;
parameters->cp_fixed_quality = 0;
parameters->jpip_on = OPJ_FALSE;
}
}
+
+
#ifdef OLD_WAY_MS
opj_bool OPJ_CALLCONV opj_read_header (
opj_codec_t *p_codec,
opj_bool OPJ_CALLCONV opj_read_header ( opj_stream_t *p_cio,
opj_codec_t *p_codec,
- opj_image_header_t **p_image_header,
- opj_codestream_info_t **p_cstr_info )
+ opj_file_info_t* p_file_info,
+ OPJ_INT32 file_info_flag)
{
+ /* Initialize the output structure */
+ opj_initialise_file_info(p_file_info, file_info_flag, CODEC_J2K);
+
if (p_codec && p_cio) {
opj_codec_private_t* l_info = (opj_codec_private_t*) p_codec;
opj_stream_private_t* l_cio = (opj_stream_private_t*) p_cio;
return l_info->m_codec_data.m_decompression.opj_read_header(
l_cio,
l_info->m_codec,
- p_image_header,
- p_cstr_info,
+ p_file_info,
l_info->m_event_mgr);
}
return OPJ_FALSE;
opj_free(l_info);
}
}
+
+/**
+ * Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.
+ *
+ * @param p_codec the jpeg2000 codec.
+ * @param p_start_x the left position of the rectangle to decode (in image coordinates).
+ * @param p_end_x the right position of the rectangle to decode (in image coordinates).
+ * @param p_start_y the up position of the rectangle to decode (in image coordinates).
+ * @param p_end_y the bottom position of the rectangle to decode (in image coordinates).
+ *
+ * @return true if the area could be set.
+ */
+opj_bool OPJ_CALLCONV opj_set_decode_area( opj_codec_t *p_codec,
+ OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
+ OPJ_INT32 p_end_x, OPJ_INT32 p_end_y
+ )
+{
+ if (p_codec) {
+ opj_codec_private_t * l_info = (opj_codec_private_t *) p_codec;
+ if (! l_info->is_decompressor) {
+ return OPJ_FALSE;
+ }
+
+ return l_info->m_codec_data.m_decompression.opj_set_decode_area(
+ l_info->m_codec,
+ p_start_x,
+ p_start_y,
+ p_end_x,
+ p_end_y,
+ &(l_info->m_event_mgr));
+
+ }
+ return OPJ_FALSE;
+}
#define JPWL_MAXIMUM_EPB_ROOM 65450 /**< Expect this maximum number of bytes for composition of EPBs */
/* <<UniPG */
+/**
+Supported options about file information
+*/
+#define OPJ_NO_INFO 0x0 /**< No information provied to the user */
+#define OPJ_IMG_INFO 0x1 /**< Basic image information provided to the user */
+#define OPJ_J2K_INFO 0x2 /**< J2K codestream information provided to the user */
+#define OPJ_JP2_INFO 0x4 /**< JP2 file information provided to the user */
+
+
/*
==========================================================
enum definitions
DECODE_ALL_BUT_PACKETS = 2 /**< Decode everything except the JPEG 2000 packets */
} OPJ_LIMIT_DECODING;
+
+
+
/*
==========================================================
event manager typedef definitions
*/
OPJ_LIMIT_DECODING cp_limit_decoding;
+
+ /* V2 */
+ OPJ_UINT32 ROI_x0;
+ OPJ_UINT32 ROI_x1;
+ OPJ_UINT32 ROI_y0;
+ OPJ_UINT32 ROI_y1;
+
+
} opj_dparameters_t;
/** Common fields between JPEG-2000 compression and decompression master structs. */
/** image components */
opj_image_comp_header_t *comps;
+#ifdef TODO_MSD
/** XTOsiz */
OPJ_UINT32 tile_x0;
/** YTOsiz */
OPJ_UINT32 nb_tiles_x;
/** number of tiles in height */
OPJ_UINT32 nb_tiles_y;
+#endif
/** 'restricted' ICC profile */
unsigned char *icc_profile_buf;
// NEW codestream
+/**
+Tile-component coding parameters
+*/
+typedef struct opj_tccp_info
+{
+ /** component index */
+ OPJ_UINT32 compno;
+ /** coding style */
+ OPJ_UINT32 csty;
+ /** number of resolutions */
+ OPJ_UINT32 numresolutions;
+ /** code-blocks width */
+ OPJ_UINT32 cblkw;
+ /** code-blocks height */
+ OPJ_UINT32 cblkh;
+ /** code-block coding style */
+ OPJ_UINT32 cblksty;
+ /** discrete wavelet transform identifier */
+ OPJ_UINT32 qmfbid;
+ /** quantisation style */
+ OPJ_UINT32 qntsty;
+ /** stepsizes used for quantization */
+ //FIXME opj_stepsize_t stepsizes[J2K_MAXBANDS];
+ /** number of guard bits */
+ OPJ_UINT32 numgbits;
+ /** Region Of Interest shift */
+ OPJ_INT32 roishift;
+ /** precinct width */
+ OPJ_UINT32 prcw[J2K_MAXRLVLS];
+ /** precinct height */
+ OPJ_UINT32 prch[J2K_MAXRLVLS];
+}
+opj_tccp_info_t;
+
typedef struct opj_tile_v2_info {
- /** number of tile */
+ /** number (index) of tile */
int tileno;
/** start position */
/** add fixed_quality */
double distotile;
+ /** coding style */
+ OPJ_UINT32 csty;
+ /** progression order */
+ OPJ_PROG_ORDER prg;
+ /** number of layers */
+ OPJ_UINT32 numlayers;
+ /** multi-component transform identifier */
+ OPJ_UINT32 mct;
+ /** rates of layers */
+ OPJ_FLOAT32 rates[100];
+
/** precinct number for each resolution level (width) */
int pw[33];
/** precinct number for each resolution level (height) */
/** information concerning tile parts */
opj_tp_info_t *tp;
+ /** information concerning tile component parameters*/
+ opj_tccp_info_t *tccp_info;
+
/** value of thresh for each layer by tile cfr. Marcela */
- double *thresh;
+ double *thresh;
} opj_tile_info_v2_t;
/**
Index structure of the codestream
*/
-typedef struct opj_codestream_v2_info {
+typedef struct opj_codestream_info_v2 {
+ /* Basic image info */
/** image width */
int image_w;
/** image height */
/** numbers of component */
int numcomps;
+ /* Codestream Info */
/** progression order */
OPJ_PROG_ORDER prog;
/** number of layer */
int numlayers;
- /** */
+ /** tile origin in x */
int tx0;
- /** */
+ /** tile origin in y */
int ty0;
/** tile size in x */
int tdx;
opj_tile_info_v2_t *tile;
} opj_codestream_info_v2_t;
+
+/*
+==========================================================
+ Metadata from the JP2file
+==========================================================
+*/
+
+/**
+Info structure of the file
+*/
+typedef struct opj_jp2_metadata {
+ /** */
+ OPJ_INT32 empty_fields;
+
+} opj_jp2_metadata_t;
+
+/*
+==========================================================
+ Information on the JPEG2000 file
+==========================================================
+*/
+
+/**
+Info structure of the file
+*/
+typedef struct opj_file_info {
+ /** file format */
+ OPJ_INT32 file_format;
+ /** file info level*/
+ OPJ_INT32 file_info_flag;
+ /** image info*/
+ opj_image_header_t img_info;
+ /** codestream info */
+ opj_codestream_info_v2_t codestream_info;
+ /** file info */
+ opj_jp2_metadata_t jp2_metadata;
+
+} opj_file_info_t;
+
+
+
#ifdef __cplusplus
extern "C" {
#endif
*/
OPJ_API opj_bool OPJ_CALLCONV opj_read_header ( opj_stream_t *p_cio,
opj_codec_t *p_codec,
- opj_image_header_t **p_image_header,
- opj_codestream_info_t **p_cstr_info );
+ opj_file_info_t * p_file_info,
+ OPJ_INT32 file_info_flag);
/**
Destroy a decompressor handle
*/
OPJ_API void OPJ_CALLCONV opj_destroy_codec(opj_codec_t * p_codec);
+/**
+ * Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.
+ *
+ * @param p_codec the jpeg2000 codec.
+ * @param p_start_x the left position of the rectangle to decode (in image coordinates).
+ * @param p_end_x the right position of the rectangle to decode (in image coordinates).
+ * @param p_start_y the up position of the rectangle to decode (in image coordinates).
+ * @param p_end_y the bottom position of the rectangle to decode (in image coordinates).
+ *
+ * @return true if the area could be set.
+ */
+OPJ_API opj_bool OPJ_CALLCONV opj_set_decode_area( opj_codec_t *p_codec,
+ OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
+ OPJ_INT32 p_end_x, OPJ_INT32 p_end_y );
+
#ifdef __cplusplus
}
#endif
#endif /* OPENJPEG_H */
+
+
OPJ_BYTE *p_src,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_len,
- struct opj_codestream_info *p_cstr_info)
+ struct opj_codestream_info_v2 *p_cstr_info)
{
OPJ_BYTE *l_current_data = p_src;
opj_pi_iterator_t *l_pi = 00;
/* INDEX >> */
if(p_cstr_info) {
- opj_tile_info_t *info_TL = &p_cstr_info->tile[p_tile_no];
+ opj_tile_info_v2_t *info_TL = &p_cstr_info->tile[p_tile_no];
opj_packet_info_t *info_PK = &info_TL->packet[p_cstr_info->packno];
if (!p_cstr_info->packno) {
info_PK->start_pos = info_TL->end_header + 1;
@param tileno number that identifies the tile for which to decode the packets
@param tile tile for which to decode the packets
*/
-opj_bool t2_decode_packets_v2(opj_t2_v2_t *t2, OPJ_UINT32 tileno,struct opj_tcd_tile *tile, OPJ_BYTE *src, OPJ_UINT32 * p_data_read, OPJ_UINT32 len, struct opj_codestream_info *cstr_info);
+opj_bool t2_decode_packets_v2( opj_t2_v2_t *t2,
+ OPJ_UINT32 tileno,
+ struct opj_tcd_tile *tile,
+ OPJ_BYTE *src, OPJ_UINT32 * p_data_read,
+ OPJ_UINT32 len,
+ struct opj_codestream_info_v2 *cstr_info);
/**
* Creates a Tier 2 handle
OPJ_BYTE * p_src_data,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_src_size,
- opj_codestream_info_t *p_cstr_info
+ opj_codestream_info_v2_t *p_cstr_info
);
opj_bool tcd_t1_decode (
OPJ_BYTE *p_src,
OPJ_UINT32 p_max_length,
OPJ_UINT32 p_tile_no,
- opj_codestream_info_t *p_cstr_info)
+ opj_codestream_info_v2_t *p_cstr_info)
{
OPJ_UINT32 l_data_read;
p_tcd->tcd_tileno = p_tile_no;
// FIXME _ProfStart(PGROUP_T2);
l_data_read = 0;
if
- (! tcd_t2_decode(p_tcd,p_src,&l_data_read,p_max_length,p_cstr_info))
+ (! tcd_t2_decode(p_tcd, p_src, &l_data_read, p_max_length, p_cstr_info))
{
return OPJ_FALSE;
}
OPJ_BYTE * p_src_data,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_src_size,
- opj_codestream_info_t *p_cstr_info
+ opj_codestream_info_v2_t *p_cstr_info
)
{
opj_t2_v2_t * l_t2;
@param len Length of source buffer
@param tileno Number that identifies one of the tiles to be decoded
*/
-opj_bool tcd_decode_tile_v2(opj_tcd_v2_t *tcd, OPJ_BYTE *src, OPJ_UINT32 len, OPJ_UINT32 tileno, struct opj_codestream_info *cstr_info);
+opj_bool tcd_decode_tile_v2(opj_tcd_v2_t *tcd,
+ OPJ_BYTE *src,
+ OPJ_UINT32 len,
+ OPJ_UINT32 tileno,
+ struct opj_codestream_info_v2 *cstr_info);
/**