JP3D Module. Fixed issue when computing the number of elements in an array that leads...
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 18 Feb 2010 16:36:21 +0000 (16:36 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 18 Feb 2010 16:36:21 +0000 (16:36 +0000)
ChangeLog
jp3d/Makefile
jp3d/codec/Makefile [new file with mode: 0644]
jp3d/codec/jp3d_to_volume.c

index 23c8a3c239d575596751fd411d7860a9b5687b83..6969b93618a84fced74047947c6a05363a8491b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ What's New for OpenJPEG
 ! : changed
 + : added
 
+February 18, 2010
+* [FOD] JP3D Module. Fixed issue when computing the number of elements in an array that leads to crash (thanks Kristof). Updated JP3D makefiles.
+
 January 20, 2010
 ! [FOD] Created a new constant in openjpeg.h to differentiate the case when the colorspace is not supported by the library and when it is not specified in the codestream. Suggested by Matteo Italia.
 
index f2b66cf0fbe2a38ae88942e0b6f3b4299d5cbe98..1ee935764c320c15a00275deb7e9228ae62da742 100755 (executable)
@@ -1,72 +1,78 @@
-# Linux makefile for OpenJPEG\r
-\r
-VER_MAJOR = 1\r
-VER_MINOR = 0.0\r
-\r
-SRCS = ./libopenjpeg/bio.c ./libopenjpeg/cio.c ./libopenjpeg/dwt.c ./libopenjpeg/event.c ./libopenjpeg/image.c ./libopenjpeg/j2k.c ./libopenjpeg/j2k_lib.c ./libopenjpeg/jp2.c ./libopenjpeg/jpt.c ./libopenjpeg/mct.c ./libopenjpeg/mqc.c ./libopenjpeg/openjpeg.c ./libopenjpeg/pi.c ./libopenjpeg/raw.c ./libopenjpeg/t1.c ./libopenjpeg/t2.c ./libopenjpeg/tcd.c ./libopenjpeg/tgt.c\r
-INCLS = ./libopenjpeg/bio.h ./libopenjpeg/cio.h ./libopenjpeg/dwt.h ./libopenjpeg/event.h ./libopenjpeg/fix.h ./libopenjpeg/image.h ./libopenjpeg/int.h ./libopenjpeg/j2k.h ./libopenjpeg/j2k_lib.h ./libopenjpeg/jp2.h ./libopenjpeg/jpt.h ./libopenjpeg/mct.h ./libopenjpeg/mqc.h ./libopenjpeg/openjpeg.h ./libopenjpeg/pi.h ./libopenjpeg/raw.h ./libopenjpeg/t1.h ./libopenjpeg/t2.h ./libopenjpeg/tcd.h ./libopenjpeg/tgt.h ./libopenjpeg/opj_includes.h\r
-INCLUDE = -Ilibopenjpeg\r
-\r
-# General configuration variables:\r
-CC = gcc\r
-AR = ar\r
-\r
-INSTALLDIR = /usr/lib\r
-\r
-# Converts cr/lf to just lf\r
-DOS2UNIX = dos2unix\r
-\r
-COMPILERFLAGS = -O3\r
-LIBRARIES = -lstdc++\r
-\r
-MODULES = $(SRCS:.c=.o)\r
-CFLAGS = $(COMPILERFLAGS) $(INCLUDE)\r
-\r
-TARGET  = openjpeg\r
-STATICLIB = lib$(TARGET).a\r
-SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so\r
-LIBNAME = lib$(TARGET).so.$(VER_MAJOR)\r
-\r
-\r
-\r
-default: all\r
-\r
-all: dist\r
-\r
-dist: OpenJPEG\r
-       mkdir dist\r
-       cp *.a dist/\r
-       cp *.so dist/\r
-       cp libopenjpeg/openjpeg.h dist/\r
-\r
-dos2unix:\r
-       @$(DOS2UNIX) $(SRCS) $(INCLS)\r
-\r
-OpenJPEG: $(STATICLIB) $(SHAREDLIB)\r
-\r
-.c.o:\r
-       $(CC) $(CFLAGS) -c $< -o $@\r
-\r
-$(STATICLIB): $(MODULES)\r
-       $(AR) r $@ $(MODULES)\r
-\r
-$(SHAREDLIB): $(MODULES)\r
-       $(CC) -s -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES)\r
-\r
-install:\r
-       install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)\r
-       install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)\r
-       ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)\r
-       ldconfig\r
-\r
-clean:\r
-       rm -rf core dist/ u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)\r
-\r
-osx:\r
-       make -f Makefile.osx\r
-\r
-osxinstall:\r
-       make -f Makefile.osx install\r
-\r
-osxclean:\r
-       make -f Makefile.osx clean\r
+# Linux makefile for JP3DVM
+
+VER_MAJOR = 2
+VER_MINOR = 1.3.0
+
+SRCS = ./libjp3dvm/bio.c ./libjp3dvm/cio.c ./libjp3dvm/dwt.c ./libjp3dvm/event.c ./libjp3dvm/jp3d.c ./libjp3dvm/jp3d_lib.c ./libjp3dvm/volume.c ./libjp3dvm/mct.c ./libjp3dvm/mqc.c ./libjp3dvm/openjpeg.c ./libjp3dvm/pi.c ./libjp3dvm/raw.c ./libjp3dvm/t1.c ./libjp3dvm/t1_3d.c ./libjp3dvm/t2.c ./libjp3dvm/tcd.c ./libjp3dvm/tgt.c
+INCLS = ./libjp3dvm/t1_3d.h ./libjp3dvm/bio.h ./libjp3dvm/cio.h ./libjp3dvm/dwt.h ./libjp3dvm/event.h ./libjp3dvm/fix.h ./libjp3dvm/int.h ./libjp3dvm/jp3d.h ./libjp3dvm/jp3d_lib.h ./libjp3dvm/volume.h ./libjp3dvm/mct.h ./libjp3dvm/mqc.h ./libjp3dvm/openjpeg.h ./libjp3dvm/pi.h ./libjp3dvm/raw.h ./libjp3dvm/t1.h  ./libjp3dvm/t2.h ./libjp3dvm/tcd.h ./libjp3dvm/tgt.h ./libjp3dvm/opj_includes.h
+INCLUDE = -Ilibjp3dvm
+
+# General configuration variables:
+CC = gcc
+AR = ar
+
+PREFIX = /usr
+INSTALL_LIBDIR = $(PREFIX)/lib
+INSTALL_INCLUDE = $(PREFIX)/include
+
+# Converts cr/lf to just lf
+DOS2UNIX = dos2unix
+
+COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99 -fPIC
+LIBRARIES = -lstdc++
+
+MODULES = $(SRCS:.c=.o)
+CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
+
+TARGET  = jp3dvm
+STATICLIB = lib$(TARGET).a
+SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
+LIBNAME = lib$(TARGET).so.$(VER_MAJOR)
+
+
+
+default: all
+
+all: Jp3dVM
+
+dist: Jp3dVM
+       install -d dist
+       install -m 644 $(STATICLIB) dist
+       install -m 755 $(SHAREDLIB) dist
+       ln -sf $(SHAREDLIB) dist/$(LIBNAME)
+       install libjp3dvm/openjpeg.h dist
+
+dos2unix:
+       @$(DOS2UNIX) $(SRCS) $(INCLS)
+
+Jp3dVM: $(STATICLIB) $(SHAREDLIB)
+
+.c.o:
+       $(CC) $(CFLAGS) -c $< -o $@
+
+$(STATICLIB): $(MODULES)
+       $(AR) r $@ $(MODULES)
+
+$(SHAREDLIB): $(MODULES)
+       $(CC) -s -shared -Wl,-soname,$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES)
+
+install: Jp3dVM
+       install -d '$(DESTDIR)$(INSTALL_LIBDIR)' '$(DESTDIR)$(INSTALL_INCLUDE)'
+       install -m 644 -o root -g root $(STATICLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
+       ranlib '$(DESTDIR)$(INSTALL_LIBDIR)/$(STATICLIB)'
+       install -m 755 -o root -g root $(SHAREDLIB) '$(DESTDIR)$(INSTALL_LIBDIR)'
+       ln -sf $(SHAREDLIB) '$(DESTDIR)$(INSTALL_LIBDIR)/$(LIBNAME)'
+       install -m 644 -o root -g root libjp3dvm/openjpeg.h '$(DESTDIR)$(INSTALL_INCLUDE)'
+       -ldconfig
+
+clean:
+       rm -rf core dist/ u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)
+
+osx:
+       make -f Makefile.osx
+
+osxinstall:
+       make -f Makefile.osx install
+
+osxclean:
+       make -f Makefile.osx clean
diff --git a/jp3d/codec/Makefile b/jp3d/codec/Makefile
new file mode 100644 (file)
index 0000000..94221c7
--- /dev/null
@@ -0,0 +1,14 @@
+# Makefile for the main OpenJPEG codecs: jp3d_to_volume and volume_to_jp3d
+
+CFLAGS = -O3 -lstdc++ # -g -p -pg
+
+all: jp3d_to_volume volume_to_jp3d
+
+jp3d_to_volume: jp3d_to_volume.c ../libjp3dvm.a
+       gcc $(CFLAGS) getopt.c convert.c jp3d_to_volume.c -o jp3d_to_volume -L.. -ljp3dvm -I ../libjp3dvm/ -lm -ltiff
+
+volume_to_jp3d: volume_to_jp3d.c ../libjp3dvm.a
+       gcc $(CFLAGS) getopt.c convert.c volume_to_jp3d.c -o volume_to_jp3d -L.. -ljp3dvm -I ../libjp3dvm/ -lm -ltiff
+
+clean:
+       rm -f jp3d_to_volume volume_to_jp3d
index 81dc1c78d0cd37095d2dca417bd6a71cc109b864..caa275bf40d72b1899c7c84edbb93d8409666ba7 100755 (executable)
@@ -177,12 +177,12 @@ void decode_help_display() {
        fprintf(stdout,"    Set the maximum number of quality layers to decode. If there are\n");\r
        fprintf(stdout,"    less quality layers than the specified number, all the quality layers\n");\r
        fprintf(stdout,"    are decoded. \n");\r
-       fprintf(stdout,"  -O original-file \n");
-    fprintf(stdout,"    This option offers the possibility to compute some quality results  \n");
-       fprintf(stdout,"    for the decompressed volume, like the PSNR value achieved or the global SSIM value.  \n");
-       fprintf(stdout,"    Needs the original file in order to compare with the new one.\n");
-    fprintf(stdout,"    NOTE: Only valid when -r option is 0,0,0 (both original and decompressed volumes have same resolutions) \n");
-    fprintf(stdout,"    NOTE: If original file is .BIN file, the volume characteristics file shall be defined with the -m option. \n");
+       fprintf(stdout,"  -O original-file \n");\r
+    fprintf(stdout,"    This option offers the possibility to compute some quality results  \n");\r
+       fprintf(stdout,"    for the decompressed volume, like the PSNR value achieved or the global SSIM value.  \n");\r
+       fprintf(stdout,"    Needs the original file in order to compare with the new one.\n");\r
+    fprintf(stdout,"    NOTE: Only valid when -r option is 0,0,0 (both original and decompressed volumes have same resolutions) \n");\r
+    fprintf(stdout,"    NOTE: If original file is .BIN file, the volume characteristics file shall be defined with the -m option. \n");\r
        fprintf(stdout,"    (i.e. -O original-BIN-file -m original-IMG-file) \n");\r
        fprintf(stdout,"  -BE \n");\r
        fprintf(stdout,"    Define that the recovered volume data will be saved with big endian byte order.\n");\r