! : changed
+ : added
+February 19, 2007
++ [FOD] Added OPJ_LIMIT_DECODING enabling us to limit the decoding to main header (modified openjpeg.c, openjpeg.h, j2k.c and j2k.h)
+
February 13, 2007
! [FOD] David Fries suggestions. In image_to_j2k and j2k_to_image, strncpy() functions: instead of specifying the path size macro, let the compiler read the length out of the array entry.
! [FOD] David Fries suggestions. Makefile modified. -fPIC flag used for 64-bit compilation. Move operation (rather than copy) for the dist library creation, and -p flag added.
opj_cp_t *cp = (opj_cp_t*)opj_malloc(sizeof(opj_cp_t));
cp->reduce = parameters->cp_reduce;
cp->layer = parameters->cp_layer;
+ cp->limit_decoding = parameters->cp_limit_decoding;
/* UniPG>> */
#ifdef USE_JPWL
cp->correct = parameters->jpwl_correct;
return 0;
}
e = j2k_dec_mstab_lookup(id);
+ // Check if the marker is known
if (!(j2k->state & e->states)) {
opj_image_destroy(image);
opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id);
return 0;
}
+ // Check if the decoding is limited to the main header
+ if (e->id == J2K_MS_SOT && j2k->cp->limit_decoding == LIMIT_TO_MAIN_HEADER) {
+ opj_event_msg(cinfo, EVT_INFO, "Main Header decoded.\n");
+ return image;
+ }
+
if (e->handler) {
(*e->handler)(j2k);
}
int reduce;
/** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
int layer;
+ /** if == NO_LIMITATION, decode entire codestream; if == LIMIT_TO_MAIN_HEADER then only decode the main header */
+ OPJ_LIMIT_DECODING limit_decoding;
/** 0 = no index || 1 = index */
int index_on;
/** XTOsiz */
/* default decoding parameters */
parameters->cp_layer = 0;
parameters->cp_reduce = 0;
+ parameters->cp_limit_decoding = NO_LIMITATION;
parameters->decod_format = -1;
parameters->cod_format = -1;
CODEC_JP2 = 2 /**< JPEG-2000 file format : read/write */
} OPJ_CODEC_FORMAT;
+/**
+Limit decoding to certain portions of the codestream.
+*/
+typedef enum LIMIT_DECODING {
+ NO_LIMITATION = 0, /**< No limitation for the decoding. The entire codestream will de decoded */
+ LIMIT_TO_MAIN_HEADER = 1 /**< The decoding is limited to the Main Header */
+} OPJ_LIMIT_DECODING;
+
/*
==========================================================
event manager typedef definitions
*/
int cp_layer;
+ /**
+ Specify whether the decoding should be done on the entire codestream, or be limited to the main header
+ Limiting the decoding to the main header makes it possible to extract the characteristics of the codestream
+ if == NO_LIMITATION, the entire codestream is decoded;
+ if == LIMIT_TO_MAIN_HEADER, only the main header is decoded;
+ */
+ OPJ_LIMIT_DECODING cp_limit_decoding;
+
/**@name command line encoder parameters (not used inside the library) */
/*@{*/
/** input file name */