summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-10-09 09:45:43 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-10-09 09:45:43 +0000
commit2e30886a0d5b6fa0e03d5dae9948a080253d1b3b (patch)
tree648199c5876ad1e543674fddc3fccebf266fffe4 /src/bin
parentb18ffbd08ab758561b21133c8d7cd1b8e8c4f057 (diff)
[trunk] Fix openmj2/mj2 compilation
As reported on the mailing list, it is better to have a working (compiling) mj2 codec rather than nothing. mj2 uses it own copy of openjpeg 1.5 Update issue 177
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/mj2/CMakeLists.txt2
-rw-r--r--src/bin/mj2/opj_mj2_compress.c5
-rw-r--r--src/bin/mj2/opj_mj2_decompress.c20
-rw-r--r--src/bin/mj2/opj_mj2_wrap.c4
4 files changed, 10 insertions, 21 deletions
diff --git a/src/bin/mj2/CMakeLists.txt b/src/bin/mj2/CMakeLists.txt
index cce60750..8279fb84 100644
--- a/src/bin/mj2/CMakeLists.txt
+++ b/src/bin/mj2/CMakeLists.txt
@@ -34,7 +34,7 @@ endif()
# Headers file are located here:
include_directories(
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
- ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
+ #${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
${OPENJPEG_SOURCE_DIR}/src/lib/openmj2
${OPENJPEG_SOURCE_DIR}/src/bin/common
${LCMS_INCLUDE_DIRNAME}
diff --git a/src/bin/mj2/opj_mj2_compress.c b/src/bin/mj2/opj_mj2_compress.c
index 6754ba03..b17b8f69 100644
--- a/src/bin/mj2/opj_mj2_compress.c
+++ b/src/bin/mj2/opj_mj2_compress.c
@@ -43,9 +43,6 @@ Size of memory first allocated for MOOV box
*/
#define TEMP_BUF 10000
-#define ENUMCS_GRAY 16
-#define ENUMCS_SRGB 17
-#define ENUMCS_SYCC 18
/* -------------------------------------------------------------------------- */
@@ -776,9 +773,7 @@ int main(int argc, char **argv)
cio_write(cio, JP2_JP2C, 4); /* JP2C*/
/* encode the image */
-#if 0 /* MM: FIXME */
bSuccess = opj_encode(cinfo, cio, img, NULL);
-#endif
if (!bSuccess) {
opj_cio_close(cio);
diff --git a/src/bin/mj2/opj_mj2_decompress.c b/src/bin/mj2/opj_mj2_decompress.c
index 1cf05555..d4258ef1 100644
--- a/src/bin/mj2/opj_mj2_decompress.c
+++ b/src/bin/mj2/opj_mj2_decompress.c
@@ -101,7 +101,7 @@ int main(int argc, char *argv[]) {
return 1;
}
- // Checking output file
+ /* Checking output file */
outfile = fopen(argv[2], "w");
if (!file) {
fprintf(stderr, "failed to open %s for writing\n", argv[2]);
@@ -132,10 +132,10 @@ int main(int argc, char *argv[]) {
/* setup the decoder decoding parameters using user parameters */
mj2_setup_decoder(movie, &mj2_parameters);
- if (mj2_read_struct(file, movie)) // Creating the movie structure
+ if (mj2_read_struct(file, movie)) /* Creating the movie structure */
return 1;
- // Decode first video track
+ /* Decode first video track */
for (tnum=0; tnum < (unsigned int)(movie->num_htk + movie->num_stk + movie->num_vtk); tnum++) {
if (movie->tk[tnum].track_type == 0)
break;
@@ -148,7 +148,7 @@ int main(int argc, char *argv[]) {
track = &movie->tk[tnum];
- // Output info on first video tracl
+ /* Output info on first video tracl */
fprintf(stdout,"The first video track contains %d frames.\nWidth: %d, Height: %d \n\n",
track->num_samples, track->w, track->h);
@@ -172,14 +172,12 @@ int main(int argc, char *argv[]) {
};
}
fseek(file,sample->offset+8,SEEK_SET);
- fread(frame_codestream, sample->sample_size-8, 1, file); // Assuming that jp and ftyp markers size do
+ fread(frame_codestream, sample->sample_size-8, 1, file); /* Assuming that jp and ftyp markers size do */
/* open a byte stream */
cio = opj_cio_open((opj_common_ptr)dinfo, frame_codestream, sample->sample_size-8);
-#if 0 /* MM: FIXME */
- img = opj_decode(dinfo, cio); // Decode J2K to image
-#endif
+ img = opj_decode(dinfo, cio); /* Decode J2K to image */
#ifdef WANT_SYCC_TO_RGB
if(img->color_space == CLRSPC_SYCC)
@@ -202,16 +200,16 @@ int main(int argc, char *argv[]) {
&& (img->comps[0].dx == img->comps[2].dx / 2 ) && (img->comps[0].dx == 1))
|| (img->numcomps == 1)) {
- if (!imagetoyuv(img, argv[2])) // Convert image to YUV
+ if (!imagetoyuv(img, argv[2])) /* Convert image to YUV */
return 1;
}
else if ((img->numcomps == 3) &&
(img->comps[0].dx == 1) && (img->comps[1].dx == 1)&&
- (img->comps[2].dx == 1))// If YUV 4:4:4 input --> to bmp
+ (img->comps[2].dx == 1))/* If YUV 4:4:4 input --> to bmp */
{
fprintf(stdout,"The frames will be output in a bmp format (output_1.bmp, ...)\n");
sprintf(outfilename,"output_%d.bmp",snum);
- if (imagetobmp(img, outfilename)) // Convert image to BMP
+ if (imagetobmp(img, outfilename)) /* Convert image to BMP */
return 1;
}
diff --git a/src/bin/mj2/opj_mj2_wrap.c b/src/bin/mj2/opj_mj2_wrap.c
index e73660ae..efc08d3d 100644
--- a/src/bin/mj2/opj_mj2_wrap.c
+++ b/src/bin/mj2/opj_mj2_wrap.c
@@ -45,10 +45,6 @@ Size of memory first allocated for MOOV box
*/
#define TEMP_BUF 10000
-#define ENUMCS_GRAY 16
-#define ENUMCS_SRGB 17
-#define ENUMCS_SYCC 18
-
#define J2K_CODESTREAM_MAGIC "\xff\x4f\xff\x51"
/* -------------------------------------------------------------------------- */