diff --git a/codec/j2k_to_image.c b/codec/j2k_to_image.c index 62a9b718..fca88f84 100644 --- a/codec/j2k_to_image.c +++ b/codec/j2k_to_image.c @@ -43,9 +43,8 @@ int main(int argc, char **argv) char *src, *src_name; char *dest, S1, S2, S3; int len; - j2k_image_t *img; - j2k_cp_t *cp; - j2k_option_t option; + j2k_image_t img; + j2k_cp_t cp; int w, wr, wrr, h, hr, hrr, max; int i, image_type = -1, compno, pad,j; int adjust; @@ -66,8 +65,8 @@ int main(int argc, char **argv) dest = argv[2]; - option.reduce_on = 0; - option.reduce_value = 0; + cp.reduce_on = 0; + cp.reduce_value = 0; /* OPTION REDUCE IS ACTIVE */ if (argc == 5) { @@ -77,8 +76,8 @@ int main(int argc, char **argv) " where n is the factor of reduction [%s]\n", argv[3]); return 1; } - option.reduce_on = 1; - sscanf(argv[4], "%d", &option.reduce_value); + cp.reduce_on = 1; + sscanf(argv[4], "%d", &cp.reduce_value); } while (*dest) { @@ -139,7 +138,7 @@ int main(int argc, char **argv) /* J2K format */ if ((S1 == 'j' && S2 == '2' && S3 == 'k') || (S1 == 'J' && S2 == '2' && S3 == 'K')) { - if (!j2k_decode(src, len, &img, &cp, option)) { + if (!j2k_decode(src, len, &img, &cp)) { fprintf(stderr, "j2k_to_image: failed to decode image!\n"); return 1; } @@ -147,11 +146,11 @@ int main(int argc, char **argv) /* JP2 format */ else if ((S1 == 'j' && S2 == 'p' && S3 == '2') || (S1 == 'J' && S2 == 'P' && S3 == '2')) { jp2_struct = (jp2_struct_t *) malloc(sizeof(jp2_struct_t)); - if (jp2_decode(src,len,jp2_struct,&cp, option)) { + jp2_struct->image=&img; + if (jp2_decode(src,len,jp2_struct,&cp)) { fprintf(stderr, "j2k_to_image: failed to decode image!\n"); return 1; } - img = jp2_struct->image; } /* JPT format */ else if ((S1 == 'j' && S2 == 'p' && S3 == 't') || (S1 == 'J' && S2 == 'P' && S3 == 'T')){ @@ -178,103 +177,103 @@ int main(int argc, char **argv) switch (image_type) { case 1: /* PNM PGM PPM */ - if (img->numcomps == 3 && img->comps[0].dx == img->comps[1].dx - && img->comps[1].dx == img->comps[2].dx - && img->comps[0].dy == img->comps[1].dy - && img->comps[1].dy == img->comps[2].dy - && img->comps[0].prec == img->comps[1].prec - && img->comps[1].prec == img->comps[2].prec) { + if (img.numcomps == 3 && img.comps[0].dx == img.comps[1].dx + && img.comps[1].dx == img.comps[2].dx + && img.comps[0].dy == img.comps[1].dy + && img.comps[1].dy == img.comps[2].dy + && img.comps[0].prec == img.comps[1].prec + && img.comps[1].prec == img.comps[2].prec) { f = fopen(argv[2], "wb"); - w = ceildiv(img->x1 - img->x0, img->comps[0].dx); - // wr = ceildiv(int_ceildivpow2(img->x1 - img->x0,img->factor),img->comps[0].dx); - wr = img->comps[0].w; - wrr = int_ceildivpow2(img->comps[0].w, img->comps[0].factor); + w = ceildiv(img.x1 - img.x0, img.comps[0].dx); + // wr = ceildiv(int_ceildivpow2(img.x1 - img.x0,img.factor),img.comps[0].dx); + wr = img.comps[0].w; + wrr = int_ceildivpow2(img.comps[0].w, img.comps[0].factor); - h = ceildiv(img->y1 - img->y0, img->comps[0].dy); - // hr = ceildiv(int_ceildivpow2(img->y1 - img->y0,img->factor), img->comps[0].dy); - hr = img->comps[0].h; - hrr = int_ceildivpow2(img->comps[0].h, img->comps[0].factor); + h = ceildiv(img.y1 - img.y0, img.comps[0].dy); + // hr = ceildiv(int_ceildivpow2(img.y1 - img.y0,img.factor), img.comps[0].dy); + hr = img.comps[0].h; + hrr = int_ceildivpow2(img.comps[0].h, img.comps[0].factor); - max = img->comps[0].prec > 8 ? 255 : (1 << img->comps[0].prec) - 1; + max = img.comps[0].prec > 8 ? 255 : (1 << img.comps[0].prec) - 1; - img->comps[0].x0 = - int_ceildivpow2(img->comps[0].x0 - - int_ceildiv(img->x0, img->comps[0].dx), - img->comps[0].factor); - img->comps[0].y0 = - int_ceildivpow2(img->comps[0].y0 - - int_ceildiv(img->y0, img->comps[0].dy), - img->comps[0].factor); + img.comps[0].x0 = + int_ceildivpow2(img.comps[0].x0 - + int_ceildiv(img.x0, img.comps[0].dx), + img.comps[0].factor); + img.comps[0].y0 = + int_ceildivpow2(img.comps[0].y0 - + int_ceildiv(img.y0, img.comps[0].dy), + img.comps[0].factor); fprintf(f, "P6\n# %d %d %d %d %d\n%d %d\n%d\n", - cp->tcps[cp->tileno[0]].tccps[0].numresolutions, w, h, - img->comps[0].x0, img->comps[0].y0, wrr, hrr, max); - adjust = img->comps[0].prec > 8 ? img->comps[0].prec - 8 : 0; + cp.tcps[cp.tileno[0]].tccps[0].numresolutions, w, h, + img.comps[0].x0, img.comps[0].y0, wrr, hrr, max); + adjust = img.comps[0].prec > 8 ? img.comps[0].prec - 8 : 0; for (i = 0; i < wrr * hrr; i++) { char r, g, b; - r = img->comps[0].data[i / wrr * wr + i % wrr]; - r += (img->comps[0].sgnd ? 1 << (img->comps[0].prec - 1) : 0); + r = img.comps[0].data[i / wrr * wr + i % wrr]; + r += (img.comps[0].sgnd ? 1 << (img.comps[0].prec - 1) : 0); r = r >> adjust; - g = img->comps[1].data[i / wrr * wr + i % wrr]; - g += (img->comps[1].sgnd ? 1 << (img->comps[1].prec - 1) : 0); + g = img.comps[1].data[i / wrr * wr + i % wrr]; + g += (img.comps[1].sgnd ? 1 << (img.comps[1].prec - 1) : 0); g = g >> adjust; - b = img->comps[2].data[i / wrr * wr + i % wrr]; - b += (img->comps[2].sgnd ? 1 << (img->comps[2].prec - 1) : 0); + b = img.comps[2].data[i / wrr * wr + i % wrr]; + b += (img.comps[2].sgnd ? 1 << (img.comps[2].prec - 1) : 0); b = b >> adjust; fprintf(f, "%c%c%c", r, g, b); } fclose(f); } else { - for (compno = 0; compno < img->numcomps; compno++) { + for (compno = 0; compno < img.numcomps; compno++) { char name[256]; - if (img->numcomps > 1) { + if (img.numcomps > 1) { sprintf(name, "%d.%s", compno, argv[2]); } else { sprintf(name, "%s", argv[2]); } f = fopen(name, "wb"); - w = ceildiv(img->x1 - img->x0, img->comps[compno].dx); - // wr = ceildiv(int_ceildivpow2(img->x1 - img->x0,img->factor),img->comps[compno].dx); - wr = img->comps[compno].w; + w = ceildiv(img.x1 - img.x0, img.comps[compno].dx); + // wr = ceildiv(int_ceildivpow2(img.x1 - img.x0,img.factor),img.comps[compno].dx); + wr = img.comps[compno].w; wrr = - int_ceildivpow2(img->comps[compno].w, img->comps[compno].factor); + int_ceildivpow2(img.comps[compno].w, img.comps[compno].factor); - h = ceildiv(img->y1 - img->y0, img->comps[compno].dy); - // hr = ceildiv(int_ceildivpow2(img->y1 - img->y0,img->factor), img->comps[compno].dy); - hr = img->comps[compno].h; + h = ceildiv(img.y1 - img.y0, img.comps[compno].dy); + // hr = ceildiv(int_ceildivpow2(img.y1 - img.y0,img.factor), img.comps[compno].dy); + hr = img.comps[compno].h; hrr = - int_ceildivpow2(img->comps[compno].h, img->comps[compno].factor); + int_ceildivpow2(img.comps[compno].h, img.comps[compno].factor); max = - img->comps[compno].prec > - 8 ? 255 : (1 << img->comps[compno].prec) - 1; + img.comps[compno].prec > + 8 ? 255 : (1 << img.comps[compno].prec) - 1; - img->comps[compno].x0 = - int_ceildivpow2(img->comps[compno].x0 - - int_ceildiv(img->x0, - img->comps[compno].dx), - img->comps[compno].factor); - img->comps[compno].y0 = - int_ceildivpow2(img->comps[compno].y0 - - int_ceildiv(img->y0, - img->comps[compno].dy), - img->comps[compno].factor); + img.comps[compno].x0 = + int_ceildivpow2(img.comps[compno].x0 - + int_ceildiv(img.x0, + img.comps[compno].dx), + img.comps[compno].factor); + img.comps[compno].y0 = + int_ceildivpow2(img.comps[compno].y0 - + int_ceildiv(img.y0, + img.comps[compno].dy), + img.comps[compno].factor); fprintf(f, "P5\n# %d %d %d %d %d\n%d %d\n%d\n", - cp->tcps[cp->tileno[0]].tccps[compno]. - numresolutions, w, h, img->comps[compno].x0, - img->comps[compno].y0, wrr, hrr, max); + cp.tcps[cp.tileno[0]].tccps[compno]. + numresolutions, w, h, img.comps[compno].x0, + img.comps[compno].y0, wrr, hrr, max); adjust = - img->comps[compno].prec > 8 ? img->comps[compno].prec - 8 : 0; + img.comps[compno].prec > 8 ? img.comps[compno].prec - 8 : 0; for (i = 0; i < wrr * hrr; i++) { char l; - l = img->comps[compno].data[i / wrr * wr + i % wrr]; - l += (img->comps[compno]. - sgnd ? 1 << (img->comps[compno].prec - 1) : 0); + l = img.comps[compno].data[i / wrr * wr + i % wrr]; + l += (img.comps[compno]. + sgnd ? 1 << (img.comps[compno].prec - 1) : 0); l = l >> adjust; fprintf(f, "%c", l); } @@ -289,27 +288,27 @@ int main(int argc, char **argv) /* / / */ /* /----------------------- / */ case 0: /* PGX */ - for (compno = 0; compno < img->numcomps; compno++) { - j2k_comp_t *comp = &img->comps[compno]; + for (compno = 0; compno < img.numcomps; compno++) { + j2k_comp_t *comp = &img.comps[compno]; char name[256]; int nbytes=0; - //if (img->numcomps > 1) + //if (img.numcomps > 1) sprintf(name, "%s-%d.pgx", argv[2], compno); //else //sprintf(name, "%s.pgx", argv[2]); f = fopen(name, "wb"); - // w = ceildiv(img->x1 - img->x0, comp->dx); - // wr = ceildiv(int_ceildivpow2(img->x1 - img->x0,img->factor), comp->dx); - w = img->comps[compno].w; - wr = int_ceildivpow2(img->comps[compno].w, - img->comps[compno].factor); + // w = ceildiv(img.x1 - img.x0, comp->dx); + // wr = ceildiv(int_ceildivpow2(img.x1 - img.x0,img.factor), comp->dx); + w = img.comps[compno].w; + wr = int_ceildivpow2(img.comps[compno].w, + img.comps[compno].factor); - // h = ceildiv(img->y1 - img->y0, comp->dy); - // hr = ceildiv(int_ceildivpow2(img->y1 - img->y0,img->factor), comp->dy); - h = img->comps[compno].h; - hr = int_ceildivpow2(img->comps[compno].h, - img->comps[compno].factor); + // h = ceildiv(img.y1 - img.y0, comp->dy); + // hr = ceildiv(int_ceildivpow2(img.y1 - img.y0,img.factor), comp->dy); + h = img.comps[compno].h; + hr = int_ceildivpow2(img.comps[compno].h, + img.comps[compno].factor); fprintf(f, "PG ML %c %d %d %d\n", comp->sgnd ? '-' : '+', comp->prec, wr, hr); @@ -317,7 +316,7 @@ int main(int argc, char **argv) else if (comp->prec <= 16) nbytes=2; else nbytes=4; for (i = 0; i < wr * hr; i++) { - int v = img->comps[compno].data[i / wr * w + i % wr]; + int v = img.comps[compno].data[i / wr * w + i % wr]; for (j=nbytes-1 ; j>=0 ; j--) { char byte=(char)(v>>(j*8)); fwrite(&byte, 1, 1, f); @@ -334,12 +333,12 @@ int main(int argc, char **argv) /* /----------------------- / */ case 2: /* BMP */ - if (img->numcomps == 3 && img->comps[0].dx == img->comps[1].dx - && img->comps[1].dx == img->comps[2].dx - && img->comps[0].dy == img->comps[1].dy - && img->comps[1].dy == img->comps[2].dy - && img->comps[0].prec == img->comps[1].prec - && img->comps[1].prec == img->comps[2].prec) { + if (img.numcomps == 3 && img.comps[0].dx == img.comps[1].dx + && img.comps[1].dx == img.comps[2].dx + && img.comps[0].dy == img.comps[1].dy + && img.comps[1].dy == img.comps[2].dy + && img.comps[0].prec == img.comps[1].prec + && img.comps[1].prec == img.comps[2].prec) { /* -->> -->> -->> -->> 24 bits color @@ -347,15 +346,15 @@ int main(int argc, char **argv) <<-- <<-- <<-- <<-- */ f = fopen(argv[2], "wb"); - // w = ceildiv(img->x1 - img->x0, img->comps[0].dx); - // wr = ceildiv(int_ceildivpow2(img->x1 - img->x0,img->factor), img->comps[0].dx); - w = img->comps[0].w; - wr = int_ceildivpow2(img->comps[0].w, img->comps[0].factor); + // w = ceildiv(img.x1 - img.x0, img.comps[0].dx); + // wr = ceildiv(int_ceildivpow2(img.x1 - img.x0,img.factor), img.comps[0].dx); + w = img.comps[0].w; + wr = int_ceildivpow2(img.comps[0].w, img.comps[0].factor); - // h = ceildiv(img->y1 - img->y0, img->comps[0].dy); - // hr = ceildiv(int_ceildivpow2(img->y1 - img->y0,img->factor), img->comps[0].dy); - h = img->comps[0].h; - hr = int_ceildivpow2(img->comps[0].h, img->comps[0].factor); + // h = ceildiv(img.y1 - img.y0, img.comps[0].dy); + // hr = ceildiv(int_ceildivpow2(img.y1 - img.y0,img.factor), img.comps[0].dy); + h = img.comps[0].h; + hr = int_ceildivpow2(img.comps[0].h, img.comps[0].factor); fprintf(f, "BM"); @@ -412,12 +411,12 @@ int main(int argc, char **argv) for (i = 0; i < wr * hr; i++) { unsigned char R, G, B; /* a modifier */ - // R = img->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; - R = img->comps[0].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; - // G = img->comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; - G = img->comps[1].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; - // B = img->comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; - B = img->comps[2].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; + // R = img.comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; + R = img.comps[0].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; + // G = img.comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; + G = img.comps[1].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; + // B = img.comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; + B = img.comps[2].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; fprintf(f, "%c%c%c", B, G, R); if ((i + 1) % wr == 0) { @@ -434,15 +433,15 @@ int main(int argc, char **argv) <<-- <<-- <<-- <<-- */ f = fopen(argv[2], "wb"); - // w = ceildiv(img->x1 - img->x0, img->comps[0].dx); - // wr = ceildiv(int_ceildivpow2(img->x1 - img->x0,img->factor), img->comps[0].dx); - w = img->comps[0].w; - wr = int_ceildivpow2(img->comps[0].w, img->comps[0].factor); + // w = ceildiv(img.x1 - img.x0, img.comps[0].dx); + // wr = ceildiv(int_ceildivpow2(img.x1 - img.x0,img.factor), img.comps[0].dx); + w = img.comps[0].w; + wr = int_ceildivpow2(img.comps[0].w, img.comps[0].factor); - // h = ceildiv(img->y1 - img->y0, img->comps[0].dy); - // hr = ceildiv(int_ceildivpow2(img->y1 - img->y0,img->factor), img->comps[0].dy); - h = img->comps[0].h; - hr = int_ceildivpow2(img->comps[0].h, img->comps[0].factor); + // h = ceildiv(img.y1 - img.y0, img.comps[0].dy); + // hr = ceildiv(int_ceildivpow2(img.y1 - img.y0,img.factor), img.comps[0].dy); + h = img.comps[0].h; + hr = int_ceildivpow2(img.comps[0].h, img.comps[0].factor); fprintf(f, "BM"); @@ -502,9 +501,9 @@ int main(int argc, char **argv) for (i = 0; i < wr * hr; i++) { /* a modifier !! */ - // fprintf(f, "%c", img->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]); + // fprintf(f, "%c", img.comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]); fprintf(f, "%c", - img->comps[0].data[w * hr - ((i) / (wr) + 1) * w + + img.comps[0].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]); /*if (((i + 1) % w == 0 && w % 2)) fprintf(f, "%c", 0); */ diff --git a/indexer_JPIP/index_create.c b/indexer_JPIP/index_create.c index 2d8304da..0dfee7f8 100644 --- a/indexer_JPIP/index_create.c +++ b/indexer_JPIP/index_create.c @@ -1096,7 +1096,7 @@ j2k_dec_mstabent_t *j2k_dec_mstab_lookup(int id) { return e; } -int j2k_decode(unsigned char *src, int len, j2k_image_t **image, j2k_cp_t **cp) { +int j2k_decode(unsigned char *src, int len, j2k_image_t *image, j2k_cp_t *cp) { if (setjmp(j2k_error)) { if (j2k_state != J2K_STATE_MT) { fprintf(stderr, "WARNING: incomplete bitstream\n"); @@ -1104,10 +1104,8 @@ int j2k_decode(unsigned char *src, int len, j2k_image_t **image, j2k_cp_t **cp) } return cio_numbytes(); } - j2k_img = (j2k_image_t*)calloc(1, sizeof(j2k_image_t)); - j2k_cp = (j2k_cp_t*)calloc(1, sizeof(j2k_cp_t)); - *image = j2k_img; - *cp = j2k_cp; + j2k_img = img; + j2k_cp = cp; j2k_state = J2K_STATE_MHSOC; cio_init(src, len); for (;;) { @@ -1195,7 +1193,7 @@ int main(int argc, char **argv) /* decode */ - if (!j2k_decode(j2kfile, totlen, &imgg, &cp)) { + if (!j2k_decode(j2kfile, totlen, imgg, cp)) { fprintf(stderr, "Index_creator: failed to decode image!\n"); return 1; } diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index 93d3001c..e510dac6 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -1408,8 +1408,9 @@ j2k_dec_mstabent_t *j2k_dec_mstab_lookup(int id) return e; } -LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t ** img, - j2k_cp_t ** cp, j2k_option_t option) + +LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t * img, + j2k_cp_t * cp) { if (setjmp(j2k_error)) { @@ -1420,13 +1421,8 @@ LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t ** img, return cio_numbytes(); } - j2k_img = (j2k_image_t *) malloc(sizeof(j2k_image_t)); - j2k_cp = (j2k_cp_t *) malloc(sizeof(j2k_cp_t)); - *img = j2k_img; - *cp = j2k_cp; - /* Option */ - j2k_cp->reduce_on = option.reduce_on; - j2k_cp->reduce_value = option.reduce_value; + j2k_img = img; + j2k_cp = cp; j2k_state = J2K_STATE_MHSOC; cio_init(src, len); @@ -1460,8 +1456,8 @@ LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t ** img, * Read a JPT-stream and decode file * */ -int j2k_decode_jpt_stream(unsigned char *src, int len, j2k_image_t ** img, - j2k_cp_t ** cp) +int j2k_decode_jpt_stream(unsigned char *src, int len, j2k_image_t * img, + j2k_cp_t * cp) { jpt_msg_header_struct_t header; int position; @@ -1474,10 +1470,8 @@ int j2k_decode_jpt_stream(unsigned char *src, int len, j2k_image_t ** img, return cio_numbytes(); } - j2k_img = (j2k_image_t *) malloc(sizeof(j2k_image_t)); - j2k_cp = (j2k_cp_t *) malloc(sizeof(j2k_cp_t)); - *img = j2k_img; - *cp = j2k_cp; + j2k_img = img; + j2k_cp = cp; j2k_state = J2K_STATE_MHSOC; cio_init(src, len); diff --git a/libopenjpeg/j2k.h b/libopenjpeg/j2k.h index a4c4a52f..06343f1b 100644 --- a/libopenjpeg/j2k.h +++ b/libopenjpeg/j2k.h @@ -58,11 +58,6 @@ #define J2K_CCP_QNTSTY_SIQNT 1 #define J2K_CCP_QNTSTY_SEQNT 2 -typedef struct { - int reduce_on; /* option reduce is used if reduce = 1 */ - int reduce_value; /* if option reduce is used -> original dimension divided by 2^value */ -} j2k_option_t; - typedef struct { int dx, dy; /* XRsiz, YRsiz */ int w, h; /* width and height of data */ @@ -207,8 +202,9 @@ LIBJ2K_API int j2k_encode(j2k_image_t * i, j2k_cp_t * cp, char *output, * i: decode image * cp: coding parameters that were used to encode the image */ -LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t ** img, - j2k_cp_t ** cp, j2k_option_t option); + +LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t * img, + j2k_cp_t * cp); /* @@ -219,7 +215,7 @@ LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t ** img, * cp: coding parameters that were used to encode the image * */ -int j2k_decode_jpt_stream(unsigned char *src, int len, j2k_image_t ** img, - j2k_cp_t ** cp); +int j2k_decode_jpt_stream(unsigned char *src, int len, j2k_image_t * img, + j2k_cp_t * cp); #endif diff --git a/libopenjpeg/jp2.c b/libopenjpeg/jp2.c index d6d5c139..6f13f4d7 100644 --- a/libopenjpeg/jp2.c +++ b/libopenjpeg/jp2.c @@ -445,7 +445,7 @@ int jp2_write_jp2c(j2k_image_t * img, j2k_cp_t * cp, char *jp2_buffer, } int jp2_read_jp2c(unsigned char *src, int len, jp2_struct_t * jp2_struct, - j2k_cp_t ** cp, j2k_option_t option) + j2k_cp_t * cp) { jp2_box_t box; @@ -457,7 +457,7 @@ int jp2_read_jp2c(unsigned char *src, int len, jp2_struct_t * jp2_struct, src += cio_tell(); - if (j2k_decode(src, len, &jp2_struct->image, cp, option) == 0) { + if (j2k_decode(src, len, jp2_struct->image, cp) == 0) { fprintf(stderr, "JP2F box: failed to decode J2K bitstream image!\n"); return 1; } @@ -509,7 +509,7 @@ int jp2_read_jp() } int jp2_decode(unsigned char *src, int len, jp2_struct_t * jp2_struct, - j2k_cp_t ** cp, j2k_option_t option) + j2k_cp_t * cp) { cio_init(src, len); @@ -519,7 +519,7 @@ int jp2_decode(unsigned char *src, int len, jp2_struct_t * jp2_struct, return 1; if (jp2_read_jp2h(jp2_struct)) return 1; - if (jp2_read_jp2c(src, len, jp2_struct, cp, option)) + if (jp2_read_jp2c(src, len, jp2_struct, cp)) return 1; return 0; } diff --git a/libopenjpeg/jp2.h b/libopenjpeg/jp2.h index 87b8d75e..867c45ae 100644 --- a/libopenjpeg/jp2.h +++ b/libopenjpeg/jp2.h @@ -74,6 +74,6 @@ int jp2_encode(jp2_struct_t * jp2_struct, j2k_cp_t * cp, char *output, char *index); int jp2_decode(unsigned char *src, int len, jp2_struct_t * jp2_struct, - j2k_cp_t ** cp, j2k_option_t option); + j2k_cp_t * cp); #endif