! : changed
+ : added
+March 5, 2010
++ [FOD] First import of OPJ_Validate tool
+
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.
--- /dev/null
+OPJ_Validate_Makee: OPJ_Validate.c md5.c
+ gcc -o OPJ_Validate OPJ_Validate.c md5.c -I.
--- /dev/null
+#Version 0.1 - February 9th 2007\r
+#Usage: OPJ_Validate OpenJPEG_command_line\r
+#Example: OPJ_Validate image_to_j2k.exe -i original/Bretagne1.ppm -o original/Bretagne1.j2k -r 200, 50, 10\r
+#Attention: don't forget the *.exe extension for the executable file, and check the paths\r
+\r
+image_to_j2k.exe -i original/Bretagne1.ppm -o temp/Bretagne1_0.j2k -r 200,50,10\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1.ppm\r
+image_to_j2k.exe -i original/Bretagne2.ppm -o temp/Bretagne2_0.j2k -c [128,128],[128,128],[128,128] -r 100,20,2 -t 640,480 -b 32,32\r
+j2k_to_image.exe -i original/Bretagne2.j2k -o temp/Bretagne2.ppm -r 2\r
+image_to_j2k.exe -i original/Cevennes1.bmp -o temp/Cevennes1.j2k -r 10\r
+j2k_to_image.exe -i original/Cevennes1.j2k -o temp/Cevennes1.bmp -l 2\r
+image_to_j2k.exe -i original/Cevennes2.ppm -o temp/Cevennes2.jp2 -r 50\r
+j2k_to_image.exe -i original/Cevennes2.jp2 -o temp/Cevennes2.ppm\r
+image_to_j2k.exe -i original/Rome.bmp -o temp/Rome.jp2 -q 30,35,50 -p LRCP -n 3\r
+j2k_to_image.exe -i original/Rome.jp2 -o temp/Rome.ppm\r
+image_to_j2k.exe -i original/Bretagne1.ppm -o temp/Bretagne1_1.j2k -q 30,35,40 -n 2\r
+image_to_j2k.exe -i original/Bretagne1.ppm -o temp/Bretagne1_2.j2k -q 30,35,40 -b 16,16 -c [101,101]\r
+image_to_j2k.exe -i original/Bretagne2.ppm -o temp/Bretagne2_1.j2k -t 127,127 -p PCRL\r
+image_to_j2k.exe -i original/X_4_2K_24_185_CBR_WB_000.tif -o temp/X_4_2K_24_185_CBR_WB_000.j2k -cinema2K 24\r
+image_to_j2k.exe -i original/X_5_2K_24_235_CBR_STEM24_000.tif -o temp/X_5_2K_24_235_CBR_STEM24_000.j2k -cinema2K 48\r
+image_to_j2k.exe -i original/X_6_2K_24_FULL_CBR_CIRCLE_000.tif -o temp/X_6_2K_24_FULL_CBR_CIRCLE_000.j2k -cinema2K 24\r
+#à remettre\r
+#image_to_j2k.exe -i original/X_16_4K_24_185_CBR_WB_000.tif -o temp/X_16_4K_24_185_CBR_WB_000.j2k -cinema4K\r
+j2k_to_image.exe -i original/A_4_2K_24_185_CBR_WB_000.j2k -o temp/A_4_2K_24_185_CBR_WB_000.tif\r
+j2k_to_image.exe -i original/B_5_2K_24_235_CBR_STEM24_000.j2k -o temp/B_5_2K_24_235_CBR_STEM24_000.tif\r
+j2k_to_image.exe -i original/C_6_2K_24_FULL_CBR_CIRCLE_000.j2k -o temp/C_6_2K_24_FULL_CBR_CIRCLE_000.tif\r
+#à remettre\r
+#j2k_to_image.exe -i original/C_18_4K_24_FULL_CBR_CIRCLE_000.j2k -o temp/C_18_4K_24_FULL_CBR_CIRCLE_000.tif\r
+j2k_to_image.exe -i original/p0_01.j2k -o temp/p0_01.tif\r
+j2k_to_image.exe -i original/p0_02.j2k -o temp/p0_02.tif\r
+j2k_to_image.exe -i original/p0_03.j2k -o temp/p0_03.tif\r
+j2k_to_image.exe -i original/p0_04.j2k -o temp/p0_04.tif\r
+#à remettre\r
+#j2k_to_image.exe -i original/p0_07.j2k -o temp/p0_07.tif\r
+j2k_to_image.exe -i original/p0_08.j2k -o temp/p0_08.tif\r
+j2k_to_image.exe -i original/p0_09.j2k -o temp/p0_09.tif\r
+j2k_to_image.exe -i original/p0_10.j2k -o temp/p0_10.tif\r
+j2k_to_image.exe -i original/p0_11.j2k -o temp/p0_11.tif\r
+j2k_to_image.exe -i original/p0_12.j2k -o temp/p0_12.tif\r
+j2k_to_image.exe -i original/p0_14.j2k -o temp/p0_14.tif\r
+j2k_to_image.exe -i original/p0_15.j2k -o temp/p0_15.tif\r
+j2k_to_image.exe -i original/p0_16.j2k -o temp/p0_16.tif\r
+j2k_to_image.exe -i original/p1_01.j2k -o temp/p1_01.tif\r
+j2k_to_image.exe -i original/p1_02.j2k -o temp/p1_02.tif\r
+j2k_to_image.exe -i original/p1_04.j2k -o temp/p1_04.tif\r
+j2k_to_image.exe -i original/p1_05.j2k -o temp/p1_05.tif\r
+j2k_to_image.exe -i original/p1_06.j2k -o temp/p1_06.tif\r
+image_to_j2k.exe -i original/c0p0_01.pgx -o temp/c0p0_01.j2k\r
+image_to_j2k.exe -i original/c0p0_02.pgx -o temp/c0p0_02.j2k\r
+image_to_j2k.exe -i original/c0p0_03r0.pgx -o temp/c0p0_03r0.j2k\r
+image_to_j2k.exe -i original/c0p0_03r1.pgx -o temp/c0p0_03r1.j2k\r
+image_to_j2k.exe -i original/c0p0_04.pgx -o temp/c00_p04.j2k\r
+image_to_j2k.exe -i original/c0p0_05.pgx -o temp/c0p0_05.j2k\r
+image_to_j2k.exe -i original/c0p0_06.pgx -o temp/c0p0_06.j2k\r
+image_to_j2k.exe -i original/c0p0_07.pgx -o temp/c0p0_07.j2k\r
+image_to_j2k.exe -i original/c0p0_08.pgx -o temp/c0p0_08.j2k\r
+image_to_j2k.exe -i original/c0p0_09.pgx -o temp/c0p0_09.j2k\r
+image_to_j2k.exe -i original/c0p0_10.pgx -o temp/c0p0_10.j2k\r
+image_to_j2k.exe -i original/c0p0_11.pgx -o temp/c0p0_11.j2k\r
+image_to_j2k.exe -i original/c0p0_12.pgx -o temp/c0p0_12.j2k\r
+image_to_j2k.exe -i original/c0p0_13.pgx -o temp/c0p0_13.j2k\r
+image_to_j2k.exe -i original/c0p0_14.pgx -o temp/c0p0_14.j2k\r
+image_to_j2k.exe -i original/c0p0_15r0.pgx -o temp/c0p0_15r0.j2k\r
+image_to_j2k.exe -i original/c0p0_15r1.pgx -o temp/c0p0_15r1.j2k\r
+image_to_j2k.exe -i original/c0p0_16.pgx -o temp/c0p0_16.j2k\r
+image_to_j2k.exe -i original/c0p1_04r0.pgx -o temp/c0p1_04r0.j2k\r
+image_to_j2k.exe -i original/c0p1_05.pgx -o temp/c0p1_05.j2k\r
+image_to_j2k.exe -i original/c1p0_01_0.pgx -o temp/c1p0_01_0.j2k\r
+image_to_j2k.exe -i original/c1p0_02_0.pgx -o temp/c1p0_02_0.j2k\r
+image_to_j2k.exe -i original/c1p0_03_0.pgx -o temp/c1p0_03_0.j2k\r
+image_to_j2k.exe -i original/c1p0_04_0.pgx -o temp/c1p0_04_0.j2k\r
+image_to_j2k.exe -i original/c1p0_05_0.pgx -o temp/c1p0_05_0.j2k\r
+image_to_j2k.exe -i original/c1p0_06_0.pgx -o temp/c1p0_06_0.j2k\r
+image_to_j2k.exe -i original/c1p0_07_0.pgx -o temp/c1p0_07_0.j2k\r
+image_to_j2k.exe -i original/c1p0_08_0.pgx -o temp/c1p0_08_0.j2k\r
+image_to_j2k.exe -i original/c1p0_09_0.pgx -o temp/c1p0_09_0.j2k\r
+image_to_j2k.exe -i original/c1p0_10_0.pgx -o temp/c1p0_10_0.j2k\r
+image_to_j2k.exe -i original/c1p0_11_0.pgx -o temp/c1p0_11_0.j2k\r
+image_to_j2k.exe -i original/c1p0_12_0.pgx -o temp/c1p0_12_0.j2k\r
+image_to_j2k.exe -i original/c1p0_13_0.pgx -o temp/c1p0_13_0.j2k\r
+image_to_j2k.exe -i original/c1p0_14_0.pgx -o temp/c1p0_14_0.j2k\r
+image_to_j2k.exe -i original/c1p0_15_0.pgx -o temp/c1p0_15_0.j2k\r
+image_to_j2k.exe -i original/c1p0_16_0.pgx -o temp/c1p0_16_0.j2k\r
+image_to_j2k.exe -i original/c1p1_02_0.pgx -o temp/c1p1_02_0.j2k\r
+image_to_j2k.exe -i original/c1p1_05_0.pgx -o temp/c1p1_05_0.j2k\r
+image_to_j2k.exe -i original/Bretagne2.ppm -o temp/Bretagne2_2.j2k -s 2,2 -SOP\r
+image_to_j2k.exe -i original/Bretagne2.ppm -o temp/Bretagne2_3.j2k -EPH -M 38\r
+image_to_j2k.exe -i original/Bretagne2.ppm -o temp/Bretagne2_4.j2k -d 150,300 -r 800\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1.bmp\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1r2.bmp -r 2\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1.tga\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1r2.tga -r 2\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1.pnm\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1r2.pnm -r 2\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1r2.ppm -r 2\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1.raw\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1r2.raw -r 2\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1.tif\r
+j2k_to_image.exe -i original/Bretagne1.j2k -o temp/Bretagne1r2.tif -r 2\r
+j2k_to_image.exe -i original/p0_03.j2k -o p0_03.pgx\r
--- /dev/null
+/*\r
+* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium\r
+* Copyright (c) 2002-2007, Professor Benoit Macq\r
+* Copyright (c) 2003-2007, Francois-Olivier Devaux \r
+* All rights reserved.\r
+*\r
+* Redistribution and use in source and binary forms, with or without\r
+* modification, are permitted provided that the following conditions\r
+* are met:\r
+* 1. Redistributions of source code must retain the above copyright\r
+* notice, this list of conditions and the following disclaimer.\r
+* 2. Redistributions in binary form must reproduce the above copyright\r
+* notice, this list of conditions and the following disclaimer in the\r
+* documentation and/or other materials provided with the distribution.\r
+*\r
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\r
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+* POSSIBILITY OF SUCH DAMAGE.\r
+*/\r
+\r
+#ifdef WIN32\r
+#include <windows.h>\r
+#endif\r
+#include <stdio.h>\r
+#include <string.h>\r
+#include "md5.h"\r
+\r
+#define OPJ_Bin_Dir "OPJ_Binaries"\r
+\r
+int doprocess(char programme[4096],char command_line[4096]) {\r
+\r
+#ifdef WIN32\r
+ \r
+ int exit=STILL_ACTIVE;\r
+ STARTUPINFO siStartupInfo;\r
+ PROCESS_INFORMATION piProcessInfo;\r
+ \r
+ memset(&siStartupInfo, 0, sizeof(siStartupInfo));\r
+ memset(&piProcessInfo, 0, sizeof(piProcessInfo));\r
+ siStartupInfo.cb = sizeof(siStartupInfo);\r
+ \r
+ if(CreateProcess(programme, // Application name\r
+ command_line, // Application arguments\r
+ 0,\r
+ 0,\r
+ FALSE,\r
+ CREATE_DEFAULT_ERROR_MODE,\r
+ 0,\r
+ 0, // Working directory\r
+ &siStartupInfo,\r
+ &piProcessInfo) == FALSE) \r
+ return 1;\r
+ \r
+ exit=STILL_ACTIVE;\r
+ while(exit==STILL_ACTIVE) {\r
+ Sleep(1000);\r
+ GetExitCodeProcess(piProcessInfo.hProcess,&exit);\r
+ }\r
+ \r
+ return 0;\r
+\r
+#else // #ifndef WIN32\r
+ printf("\n%s\n", command_line);\r
+ system(command_line);\r
+ return 0;\r
+\r
+#endif\r
+ \r
+}\r
+\r
+char MD5_process(char *input_filename, char *md5_filename) {\r
+ MD5_CTX mdContext;\r
+ int bytes;\r
+ unsigned char data[1024];\r
+ FILE *input_file, *md5_file;\r
+ \r
+ input_file = fopen(input_filename, "rb");\r
+ if (!input_file) {\r
+ printf("Error opening file %s\n", input_filename);\r
+ return 1;\r
+ }\r
+ \r
+ md5_file = fopen(md5_filename, "wb");\r
+ if (!md5_file) {\r
+ printf("Error opening file %s\n", md5_filename);\r
+ return 1;\r
+ }\r
+ \r
+ MD5Init (&mdContext);\r
+ while ((bytes = fread (data, 1, 1024, input_file)) != 0)\r
+ MD5Update (&mdContext, data, bytes);\r
+ MD5Final (&mdContext);\r
+ \r
+ fwrite(mdContext.digest,16,1,md5_file);\r
+ \r
+ fclose(input_file);\r
+ fclose(md5_file);\r
+ \r
+ return 0;\r
+}\r
+\r
+char fcompare(char *input_filename, char *output_filename) {\r
+ FILE *input_file, *output_file;\r
+ unsigned char input_buffer[17], output_buffer[17];\r
+ char comparison;\r
+ \r
+ input_file = fopen(input_filename, "rb");\r
+ if (!input_file) {\r
+ printf("Error opening file %s\n", input_filename);\r
+ return -1;\r
+ }\r
+ \r
+ output_file = fopen(output_filename, "rb");\r
+ if (!output_file) {\r
+ printf("Error opening file %s\n", output_filename);\r
+ return -1;\r
+ }\r
+ \r
+ fread(input_buffer,16,1,input_file);\r
+ fread(output_buffer,16,1,output_file);\r
+ fclose(input_file);\r
+ fclose(output_file);\r
+ input_buffer[16] = 0;\r
+ output_buffer[16] = 0;\r
+ \r
+ comparison = strcmp(input_buffer, output_buffer);\r
+ \r
+ if (comparison)\r
+ return 1;\r
+ return 0;\r
+}\r
+\r
+int main(int argc, char* argv[]) {\r
+ FILE *param_file, *md5_file;\r
+ FILE *report_file;\r
+ char line[4096];\r
+ char md5_filename[4096], tempmd5_filename[4096], temp[4096], report_filename[4096];\r
+ char output_filename[4096];\r
+ char input_cmdline[4096];\r
+ char command_line[4096], exefile[4096];\r
+ int task_counter = 0, word_counter;\r
+ char bin_dir[4096];\r
+ unsigned int word_pointer;\r
+ char ch[4096]; \r
+ char comparison;\r
+ int num_failed = 0;\r
+ int num_inexistant = 0;\r
+ int num_passed = 0;\r
+ \r
+ if (argc != 3) {\r
+ printf("Error with command line. \nExpected: OPJ_Validate parameter_filename bin_directory\n Example: OPJ_Validate parameters_01.txt version1.1.a\n\n");\r
+ return 1;\r
+ }\r
+ \r
+ param_file = fopen(argv[1],"rb");\r
+ if (!param_file) {\r
+ printf("Error opening parameter file %s\n",argv[1]);\r
+ return 1;\r
+ } \r
+ \r
+ sprintf(bin_dir,"%s/%s",OPJ_Bin_Dir,argv[2]);\r
+ sprintf(tempmd5_filename,"temp/tempmd5.txt");\r
+ sprintf(report_filename,"%s/report.txt",bin_dir);\r
+ report_file = fopen(report_filename, "wb");\r
+ if (!report_file) {\r
+ printf("Unable to open report file %s", report_filename);\r
+ return 1;\r
+ }\r
+ \r
+ while (fgets(line, 4096, param_file) != NULL) {\r
+ \r
+ if (line[0] != '#' && line[0] != 0x0d) { // If not a comment line\r
+ sscanf(line, "%s", temp);\r
+ word_pointer = 0;\r
+ sprintf(input_cmdline,""); \r
+ sscanf(line+word_pointer,"%s",ch);\r
+ sprintf(exefile,"%s/%s",bin_dir,ch); \r
+ word_counter = 0;\r
+ while (sscanf(line+word_pointer,"%s",ch) > 0) {\r
+ if (word_counter == 4) \r
+ strcpy(output_filename, ch);\r
+ word_pointer += strlen(ch)+1;\r
+ sprintf(input_cmdline,"%s%s ",input_cmdline, ch); \r
+ word_counter++;\r
+ } \r
+ sprintf(md5_filename,"%s.md5",output_filename);\r
+ task_counter++;\r
+ sprintf(command_line,"%s/%s",bin_dir,input_cmdline);\r
+ printf("Task %d\nMD5 file: %s\nCommand line: \"%s\"\n",task_counter, md5_filename,command_line);\r
+ fprintf(report_file,"Task %d\n MD5 file: %s\n Command line: \"%s\"\n",task_counter, md5_filename,command_line);\r
+ \r
+ if (doprocess(exefile,command_line)) {\r
+ printf("Error executing: \"%s\" \n", command_line);\r
+ fprintf(report_file,"Task %d failed because command line is not valid.\n\n", task_counter);\r
+ }\r
+ else {\r
+ \r
+ // Check if MD5 reference exists\r
+ md5_file = fopen(md5_filename,"rb");\r
+ if (md5_file) {\r
+ fclose(md5_file);\r
+ if (MD5_process(output_filename, tempmd5_filename)) \r
+ return 1;\r
+ \r
+ comparison = fcompare(tempmd5_filename, md5_filename);\r
+ if (comparison == -1)\r
+ return 1;\r
+ else if (comparison) {\r
+ printf("ERROR: %s and %s are different.\nThe codec seems to behave differently.\n\n", tempmd5_filename, md5_filename);\r
+ fprintf(report_file,"ERROR: %s and %s are different.\nThe codec seems to behave differently.\n\n", tempmd5_filename, md5_filename);\r
+ num_failed++;\r
+ }\r
+ else {\r
+ printf("%s and %s are the same.\nTask %d OK\n\n",tempmd5_filename, md5_filename, task_counter);\r
+ fprintf(report_file," %s and %s are the same.\nTask %d OK\n\n",tempmd5_filename, md5_filename, task_counter);\r
+ num_passed++;\r
+ }\r
+ remove(tempmd5_filename);\r
+ } \r
+ else {\r
+ if (MD5_process(output_filename, md5_filename))\r
+ return 1;\r
+ printf("... MD5 of %s was inexistant. It has been created\n\n", output_filename);\r
+ fprintf(report_file,"MD5 of %s was inexistant. It has been created\n\n", output_filename);\r
+ num_inexistant++;\r
+ }\r
+ }\r
+ }\r
+ } \r
+\r
+ printf("\n\REPORT;\n%d tests num_passed\n%d tests num_failed\n%d MD5 were num_inexistant\n", num_passed, num_failed, num_inexistant);\r
+ fprintf(report_file,"\n\REPORT;\n%d tests num_passed\n%d tests num_failed\n%d MD5 were num_inexistant\n", num_passed, num_failed, num_inexistant);\r
+ fclose(param_file);\r
+ fclose(report_file);\r
+ \r
+}\r
--- /dev/null
+# Microsoft Developer Studio Project File - Name="OPJ_Validate" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=OPJ_Validate - Win32 Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "OPJ_Validate.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "OPJ_Validate.mak" CFG="OPJ_Validate - Win32 Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "OPJ_Validate - Win32 Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "OPJ_Validate - Win32 Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF "$(CFG)" == "OPJ_Validate - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release"\r
+# PROP Intermediate_Dir "Release"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD BASE RSC /l 0x80c /d "NDEBUG"\r
+# ADD RSC /l 0x80c /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
+\r
+!ELSEIF "$(CFG)" == "OPJ_Validate - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c\r
+# ADD BASE RSC /l 0x80c /d "_DEBUG"\r
+# ADD RSC /l 0x80c /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "OPJ_Validate - Win32 Release"\r
+# Name "OPJ_Validate - Win32 Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=.\md5.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\OPJ_Validate.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=.\md5.h\r
+# End Source File\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# End Group\r
+# End Target\r
+# End Project\r
--- /dev/null
+Microsoft Developer Studio Workspace File, Format Version 6.00\r
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
+\r
+###############################################################################\r
+\r
+Project: "OPJ_Validate"=".\OPJ_Validate.dsp" - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Global:\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<3>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
--- /dev/null
+cd temp\r
+erase *.ppm\r
+erase *.j2k\r
+erase *.bmp\r
+erase *.tif\r
+erase *.jp2\r
+cd ..\r
+OPJ_Validate.exe OPJ_Param_File_v0_1.txt testv2\r
--- /dev/null
+#!/bin/bash
+cd temp
+erase *.ppm
+erase *.j2k
+erase *.bmp
+erase *.tif
+erase *.jp2
+cd ..
+
+echo
+echo "Type the name of the directory (inside OPJ_Binaries) "
+echo "containing your executables to compared with reference, followed by [ENTER] (example: rev101):"
+read compdir
+
+./OPJ_Validate linux_OPJ_Param_File_v0_1.txt $compdir
+echo
--- /dev/null
+cd temp\r
+erase *.md5\r
+cd ..\r
+OPJ_Validate.exe OPJ_Param_File_v0_1.txt rev490\r
--- /dev/null
+#!/bin/bash
+#Create Reference images and hash
+
+echo
+echo "Type the name of the directory (inside OPJ_Binaries) "
+echo "containing your reference executables, followed by [ENTER] (example: rev100):"
+read refdir
+cd temp
+rm *.md5
+cd ..
+./OPJ_Validate linux_OPJ_Param_File_v0_1.txt $refdir
+echo
+
--- /dev/null
+Initialization\r
+--------------\r
+Download the source images into the /original directory from http://www.openjpeg.org/OPJ_Validate_OriginalImages.7z\r
+\r
+Usage\r
+-----\r
+Usage: OPJ_Validate batch_text_file bin_directory\r
+Example: OPJ_Validate OPJ_Param_File_v0_1.txt v1.1.a\r
+where OPJ_Param_File_v0_1.txt is a file containing a list of compression and decompression parameters\r
+and v1.1.a is a directory inside the directory OPJ_Binaries containing the openjpeg executables (j2k_to_image.exe and image_to_j2k.exe)\r
+\r
+Example with batch file: You consider revision 490 (/rev490) as stable, and would like to compare it a new version, revision 493 (rev493).\r
+\r
+Batch mode\r
+----------\r
+1) Calculate the reference by running the "OPJ_Validate_Create_Ref rev490" file (.sh or .bat depending on your os)\r
+2) Compare the candidate revision with ther reference by running the "OPJ_Validate_Candidate_vs_Ref rev493" file\r
+3) The results of the comparison are given at the end of the processing. They are also available in the bin directory OPJ_Binaries/rev493/report.txt\r
+\r
+Manual mode\r
+-----------\r
+1) Put the j2k_to_image.exe and image_to_j2k.exe binaries of both revisions in the OPJ_Binaries directory (OPJ_Binaries/rev490 and OPJ_Binaries/rev493) \r
+2) Start by initializing the validation with revision 490. \r
+ a) Modify OPJ_Validate_init.bat and set the last line to "OPJ_Validate.exe OPJ_Param_File_v0_1.txt rev490"\r
+ b) Execute OPJ_Validate_init.bat\r
+3) Compare the reference files generated in the previous step with files generated with revision 493\r
+ a) Modify OPJ_Validate_run.bat and set the last line to "OPJ_Validate.exe OPJ_Param_File_v0_1.txt rev493"\r
+ b) Execute OPJ_Validate_run.bat\r
+4) Read the results in the binaries directory of revision 493 (OPJ_Binaries/rev493/report.txt)\r
+ Search for the word "ERROR:" in that file. \r
+ If this word is not present in the report, this means that both codecs of rev490 and rev493 gave the same results.\r
+ Otherwise, it means that for certain encoding/decoding parameters, the codecs behave differently.\r
+\r
+ Example of error\r
+ Task 17\r
+ MD5 file: temp/A_4_2K_24_185_CBR_WB_000.tif.md5\r
+ Command line: "OPJ_Binaries/rev473/j2k_to_image.exe -i original/A_4_2K_24_185_CBR_WB_000.j2k -o temp/A_4_2K_24_185_CBR_WB_000.tif "\r
+ ERROR: temp/tempmd5.txt and temp/A_4_2K_24_185_CBR_WB_000.tif.md5 are different.\r
+ The codec seems to behave differently.\r
+\r
+ This means that the rev490 and rev493 created two different versions of file A_4_2K_24_185_CBR_WB_000.tif with the command line given above.\r
+ An error might have been caused by switching to this new revision.\r
+\r
+ Warning: Do not take the last line of the report.txt file into account ( Cool. All files passed the tests !) as it is a bug. Search for the word "ERROR:" to detect potential errors.\r
+5) If no error is detected, you can commit the changes to the OpenJPEG repository\r
+\r
--- /dev/null
+#OPJ Parameter file\r
+#Version 0.1 - February 9th 2007\r
+#Usage: OPJ_Validate OpenJPEG_command_line\r
+#Example: OPJ_Validate image_to_j2k.exe -i original/Bretagne1.ppm -o original/Bretagne1.j2k -r 200, 50, 10\r
+#Attention: don't forget the *.exe extension for the executable file, and check the paths\r
+#\r
+image_to_j2k -i original/Bretagne1.ppm -o temp/Bretagne1_0.j2k -r 200,50,10\r
+j2k_to_image -i original/Bretagne1.j2k -o temp/Bretagne1.ppm\r
+image_to_j2k -i original/Bretagne2.ppm -o temp/Bretagne2_0.j2k -c [128,128],[128,128],[128,128] -r 100,20,2 -t 640,480 -b 32,32\r
+j2k_to_image -i original/Bretagne2.j2k -o temp/Bretagne2.ppm -r 2\r
+image_to_j2k -i original/Cevennes1.bmp -o temp/Cevennes1.j2k -r 10\r
+j2k_to_image -i original/Cevennes1.j2k -o temp/Cevennes1.bmp -l 2\r
+image_to_j2k -i original/Cevennes2.ppm -o temp/Cevennes2.jp2 -r 50\r
+j2k_to_image -i original/Cevennes2.jp2 -o temp/Cevennes2.ppm\r
+image_to_j2k -i original/Rome.bmp -o temp/Rome.jp2 -q 30,35,50 -p LRCP -n 3\r
+j2k_to_image -i original/Rome.jp2 -o temp/Rome.ppm\r
+image_to_j2k -i original/Bretagne1.ppm -o temp/Bretagne1_1.j2k -q 30,35,40 -n 2\r
+image_to_j2k -i original/Bretagne1.ppm -o temp/Bretagne1_2.j2k -q 30,35,40 -b 16,16 -c [101,101]\r
+image_to_j2k -i original/Bretagne2.ppm -o temp/Bretagne2_1.j2k -t 127,127 -p PCRL\r
+image_to_j2k -i original/X_4_2K_24_185_CBR_WB_000.tif -o temp/X_4_2K_24_185_CBR_WB_000.j2k -cinema2K 24\r
+image_to_j2k -i original/X_5_2K_24_235_CBR_STEM24_000.tif -o temp/X_5_2K_24_235_CBR_STEM24_000.j2k -cinema2K 48\r
+image_to_j2k -i original/X_6_2K_24_FULL_CBR_CIRCLE_000.tif -o temp/X_6_2K_24_FULL_CBR_CIRCLE_000.j2k -cinema2K 24\r
+#à remettre\r
+#image_to_j2k -i original/X_16_4K_24_185_CBR_WB_000.tif -o temp/X_16_4K_24_185_CBR_WB_000.j2k -cinema4K \r
+j2k_to_image -i original/A_4_2K_24_185_CBR_WB_000.j2k -o temp/A_4_2K_24_185_CBR_WB_000.tif\r
+j2k_to_image -i original/B_5_2K_24_235_CBR_STEM24_000.j2k -o temp/B_5_2K_24_235_CBR_STEM24_000.tif\r
+j2k_to_image -i original/C_6_2K_24_FULL_CBR_CIRCLE_000.j2k -o temp/C_6_2K_24_FULL_CBR_CIRCLE_000.tif\r
+#à remettre\r
+#j2k_to_image -i original/C_18_4K_24_FULL_CBR_CIRCLE_000.j2k -o temp/C_18_4K_24_FULL_CBR_CIRCLE_000.tif\r
+j2k_to_image -i original/p0_01.j2k -o temp/p0_01.tif\r
+j2k_to_image -i original/p0_02.j2k -o temp/p0_02.tif\r
+j2k_to_image -i original/p0_03.j2k -o temp/p0_03.tif\r
+j2k_to_image -i original/p0_04.j2k -o temp/p0_04.tif\r
+#a remettre\r
+#j2k_to_image -i original/p0_07.j2k -o temp/p0_07.tif\r
+j2k_to_image -i original/p0_08.j2k -o temp/p0_08.tif\r
+j2k_to_image -i original/p0_09.j2k -o temp/p0_09.tif\r
+j2k_to_image -i original/p0_10.j2k -o temp/p0_10.tif\r
+j2k_to_image -i original/p0_11.j2k -o temp/p0_11.tif\r
+j2k_to_image -i original/p0_12.j2k -o temp/p0_12.tif\r
+j2k_to_image -i original/p0_14.j2k -o temp/p0_14.tif\r
+j2k_to_image -i original/p0_15.j2k -o temp/p0_15.tif\r
+j2k_to_image -i original/p0_16.j2k -o temp/p0_16.tif\r
+j2k_to_image -i original/p1_01.j2k -o temp/p1_01.tif\r
+j2k_to_image -i original/p1_02.j2k -o temp/p1_02.tif\r
+j2k_to_image -i original/p1_04.j2k -o temp/p1_04.tif\r
+j2k_to_image -i original/p1_05.j2k -o temp/p1_05.tif\r
+j2k_to_image -i original/p1_06.j2k -o temp/p1_06.tif\r
+image_to_j2k -i original/c0p0_01.pgx -o temp/c0p0_01.j2k\r
+image_to_j2k -i original/c0p0_02.pgx -o temp/c0p0_02.j2k\r
+image_to_j2k -i original/c0p0_03r0.pgx -o temp/c0p0_03r0.j2k\r
+image_to_j2k -i original/c0p0_03r1.pgx -o temp/c0p0_03r1.j2k\r
+image_to_j2k -i original/c0p0_04.pgx -o temp/c00_p04.j2k\r
+image_to_j2k -i original/c0p0_05.pgx -o temp/c0p0_05.j2k\r
+image_to_j2k -i original/c0p0_06.pgx -o temp/c0p0_06.j2k\r
+image_to_j2k -i original/c0p0_07.pgx -o temp/c0p0_07.j2k\r
+image_to_j2k -i original/c0p0_08.pgx -o temp/c0p0_08.j2k\r
+image_to_j2k -i original/c0p0_09.pgx -o temp/c0p0_09.j2k\r
+image_to_j2k -i original/c0p0_10.pgx -o temp/c0p0_10.j2k\r
+image_to_j2k -i original/c0p0_11.pgx -o temp/c0p0_11.j2k\r
+image_to_j2k -i original/c0p0_12.pgx -o temp/c0p0_12.j2k\r
+image_to_j2k -i original/c0p0_13.pgx -o temp/c0p0_13.j2k\r
+image_to_j2k -i original/c0p0_14.pgx -o temp/c0p0_14.j2k\r
+image_to_j2k -i original/c0p0_15r0.pgx -o temp/c0p0_15r0.j2k\r
+image_to_j2k -i original/c0p0_15r1.pgx -o temp/c0p0_15r1.j2k\r
+image_to_j2k -i original/c0p0_16.pgx -o temp/c0p0_16.j2k\r
+image_to_j2k -i original/c0p1_04r0.pgx -o temp/c0p1_04r0.j2k\r
+image_to_j2k -i original/c0p1_05.pgx -o temp/c0p1_05.j2k\r
+image_to_j2k -i original/c1p0_01_0.pgx -o temp/c1p0_01_0.j2k\r
+image_to_j2k -i original/c1p0_02_0.pgx -o temp/c1p0_02_0.j2k\r
+image_to_j2k -i original/c1p0_03_0.pgx -o temp/c1p0_03_0.j2k\r
+image_to_j2k -i original/c1p0_04_0.pgx -o temp/c1p0_04_0.j2k\r
+image_to_j2k -i original/c1p0_05_0.pgx -o temp/c1p0_05_0.j2k\r
+image_to_j2k -i original/c1p0_06_0.pgx -o temp/c1p0_06_0.j2k\r
+image_to_j2k -i original/c1p0_07_0.pgx -o temp/c1p0_07_0.j2k\r
+image_to_j2k -i original/c1p0_08_0.pgx -o temp/c1p0_08_0.j2k\r
+image_to_j2k -i original/c1p0_09_0.pgx -o temp/c1p0_09_0.j2k\r
+image_to_j2k -i original/c1p0_10_0.pgx -o temp/c1p0_10_0.j2k\r
+image_to_j2k -i original/c1p0_11_0.pgx -o temp/c1p0_11_0.j2k\r
+image_to_j2k -i original/c1p0_12_0.pgx -o temp/c1p0_12_0.j2k\r
+image_to_j2k -i original/c1p0_13_0.pgx -o temp/c1p0_13_0.j2k\r
+image_to_j2k -i original/c1p0_14_0.pgx -o temp/c1p0_14_0.j2k\r
+image_to_j2k -i original/c1p0_15_0.pgx -o temp/c1p0_15_0.j2k\r
+image_to_j2k -i original/c1p0_16_0.pgx -o temp/c1p0_16_0.j2k\r
+image_to_j2k -i original/c1p1_02_0.pgx -o temp/c1p1_02_0.j2k\r
+image_to_j2k -i original/c1p1_05_0.pgx -o temp/c1p1_05_0.j2k\r
+image_to_j2k -i original/Bretagne2.ppm -o temp/Bretagne2_2.j2k -s 2,2 -SOP\r
+image_to_j2k -i original/Bretagne2.ppm -o temp/Bretagne2_3.j2k -EPH -M 38\r
+image_to_j2k -i original/Bretagne2.ppm -o temp/Bretagne2_4.j2k -d 150,300 -r 800\r
--- /dev/null
+/*\r
+ **********************************************************************\r
+ ** md5.c **\r
+ ** RSA Data Security, Inc. MD5 Message Digest Algorithm **\r
+ ** Created: 2/17/90 RLR **\r
+ ** Revised: 1/91 SRD,AJ,BSK,JT Reference C Version **\r
+ **********************************************************************\r
+ */\r
+\r
+/*\r
+ **********************************************************************\r
+ ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **\r
+ ** **\r
+ ** License to copy and use this software is granted provided that **\r
+ ** it is identified as the "RSA Data Security, Inc. MD5 Message **\r
+ ** Digest Algorithm" in all material mentioning or referencing this **\r
+ ** software or this function. **\r
+ ** **\r
+ ** License is also granted to make and use derivative works **\r
+ ** provided that such works are identified as "derived from the RSA **\r
+ ** Data Security, Inc. MD5 Message Digest Algorithm" in all **\r
+ ** material mentioning or referencing the derived work. **\r
+ ** **\r
+ ** RSA Data Security, Inc. makes no representations concerning **\r
+ ** either the merchantability of this software or the suitability **\r
+ ** of this software for any particular purpose. It is provided "as **\r
+ ** is" without express or implied warranty of any kind. **\r
+ ** **\r
+ ** These notices must be retained in any copies of any part of this **\r
+ ** documentation and/or software. **\r
+ **********************************************************************\r
+ */\r
+\r
+/* -- include the following line if the md5.h header file is separate -- */\r
+#include "md5.h" \r
+\r
+/* forward declaration */\r
+static void Transform ();\r
+\r
+static unsigned char PADDING[64] = {\r
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
+};\r
+\r
+/* F, G and H are basic MD5 functions: selection, majority, parity */\r
+#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))\r
+#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))\r
+#define H(x, y, z) ((x) ^ (y) ^ (z))\r
+#define I(x, y, z) ((y) ^ ((x) | (~z))) \r
+\r
+/* ROTATE_LEFT rotates x left n bits */\r
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))\r
+\r
+/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */\r
+/* Rotation is separate from addition to prevent recomputation */\r
+#define FF(a, b, c, d, x, s, ac) \\r
+ {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \\r
+ (a) = ROTATE_LEFT ((a), (s)); \\r
+ (a) += (b); \\r
+ }\r
+#define GG(a, b, c, d, x, s, ac) \\r
+ {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \\r
+ (a) = ROTATE_LEFT ((a), (s)); \\r
+ (a) += (b); \\r
+ }\r
+#define HH(a, b, c, d, x, s, ac) \\r
+ {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \\r
+ (a) = ROTATE_LEFT ((a), (s)); \\r
+ (a) += (b); \\r
+ }\r
+#define II(a, b, c, d, x, s, ac) \\r
+ {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \\r
+ (a) = ROTATE_LEFT ((a), (s)); \\r
+ (a) += (b); \\r
+ }\r
+\r
+void MD5Init (mdContext)\r
+MD5_CTX *mdContext;\r
+{\r
+ mdContext->i[0] = mdContext->i[1] = (UINT4)0;\r
+\r
+ /* Load magic initialization constants.\r
+ */\r
+ mdContext->buf[0] = (UINT4)0x67452301;\r
+ mdContext->buf[1] = (UINT4)0xefcdab89;\r
+ mdContext->buf[2] = (UINT4)0x98badcfe;\r
+ mdContext->buf[3] = (UINT4)0x10325476;\r
+}\r
+\r
+void MD5Update (mdContext, inBuf, inLen)\r
+MD5_CTX *mdContext;\r
+unsigned char *inBuf;\r
+unsigned int inLen;\r
+{\r
+ UINT4 in[16];\r
+ int mdi;\r
+ unsigned int i, ii;\r
+\r
+ /* compute number of bytes mod 64 */\r
+ mdi = (int)((mdContext->i[0] >> 3) & 0x3F);\r
+\r
+ /* update number of bits */\r
+ if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0])\r
+ mdContext->i[1]++;\r
+ mdContext->i[0] += ((UINT4)inLen << 3);\r
+ mdContext->i[1] += ((UINT4)inLen >> 29);\r
+\r
+ while (inLen--) {\r
+ /* add new character to buffer, increment mdi */\r
+ mdContext->in[mdi++] = *inBuf++;\r
+\r
+ /* transform if necessary */\r
+ if (mdi == 0x40) {\r
+ for (i = 0, ii = 0; i < 16; i++, ii += 4)\r
+ in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |\r
+ (((UINT4)mdContext->in[ii+2]) << 16) |\r
+ (((UINT4)mdContext->in[ii+1]) << 8) |\r
+ ((UINT4)mdContext->in[ii]);\r
+ Transform (mdContext->buf, in);\r
+ mdi = 0;\r
+ }\r
+ }\r
+}\r
+\r
+void MD5Final (mdContext)\r
+MD5_CTX *mdContext;\r
+{\r
+ UINT4 in[16];\r
+ int mdi;\r
+ unsigned int i, ii;\r
+ unsigned int padLen;\r
+\r
+ /* save number of bits */\r
+ in[14] = mdContext->i[0];\r
+ in[15] = mdContext->i[1];\r
+\r
+ /* compute number of bytes mod 64 */\r
+ mdi = (int)((mdContext->i[0] >> 3) & 0x3F);\r
+\r
+ /* pad out to 56 mod 64 */\r
+ padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);\r
+ MD5Update (mdContext, PADDING, padLen);\r
+\r
+ /* append length in bits and transform */\r
+ for (i = 0, ii = 0; i < 14; i++, ii += 4)\r
+ in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |\r
+ (((UINT4)mdContext->in[ii+2]) << 16) |\r
+ (((UINT4)mdContext->in[ii+1]) << 8) |\r
+ ((UINT4)mdContext->in[ii]);\r
+ Transform (mdContext->buf, in);\r
+\r
+ /* store buffer in digest */\r
+ for (i = 0, ii = 0; i < 4; i++, ii += 4) {\r
+ mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF);\r
+ mdContext->digest[ii+1] =\r
+ (unsigned char)((mdContext->buf[i] >> 8) & 0xFF);\r
+ mdContext->digest[ii+2] =\r
+ (unsigned char)((mdContext->buf[i] >> 16) & 0xFF);\r
+ mdContext->digest[ii+3] =\r
+ (unsigned char)((mdContext->buf[i] >> 24) & 0xFF);\r
+ }\r
+}\r
+\r
+/* Basic MD5 step. Transform buf based on in.\r
+ */\r
+static void Transform (buf, in)\r
+UINT4 *buf;\r
+UINT4 *in;\r
+{\r
+ UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];\r
+\r
+ /* Round 1 */\r
+#define S11 7\r
+#define S12 12\r
+#define S13 17\r
+#define S14 22\r
+ FF ( a, b, c, d, in[ 0], S11, 3614090360); /* 1 */\r
+ FF ( d, a, b, c, in[ 1], S12, 3905402710); /* 2 */\r
+ FF ( c, d, a, b, in[ 2], S13, 606105819); /* 3 */\r
+ FF ( b, c, d, a, in[ 3], S14, 3250441966); /* 4 */\r
+ FF ( a, b, c, d, in[ 4], S11, 4118548399); /* 5 */\r
+ FF ( d, a, b, c, in[ 5], S12, 1200080426); /* 6 */\r
+ FF ( c, d, a, b, in[ 6], S13, 2821735955); /* 7 */\r
+ FF ( b, c, d, a, in[ 7], S14, 4249261313); /* 8 */\r
+ FF ( a, b, c, d, in[ 8], S11, 1770035416); /* 9 */\r
+ FF ( d, a, b, c, in[ 9], S12, 2336552879); /* 10 */\r
+ FF ( c, d, a, b, in[10], S13, 4294925233); /* 11 */\r
+ FF ( b, c, d, a, in[11], S14, 2304563134); /* 12 */\r
+ FF ( a, b, c, d, in[12], S11, 1804603682); /* 13 */\r
+ FF ( d, a, b, c, in[13], S12, 4254626195); /* 14 */\r
+ FF ( c, d, a, b, in[14], S13, 2792965006); /* 15 */\r
+ FF ( b, c, d, a, in[15], S14, 1236535329); /* 16 */\r
+\r
+ /* Round 2 */\r
+#define S21 5\r
+#define S22 9\r
+#define S23 14\r
+#define S24 20\r
+ GG ( a, b, c, d, in[ 1], S21, 4129170786); /* 17 */\r
+ GG ( d, a, b, c, in[ 6], S22, 3225465664); /* 18 */\r
+ GG ( c, d, a, b, in[11], S23, 643717713); /* 19 */\r
+ GG ( b, c, d, a, in[ 0], S24, 3921069994); /* 20 */\r
+ GG ( a, b, c, d, in[ 5], S21, 3593408605); /* 21 */\r
+ GG ( d, a, b, c, in[10], S22, 38016083); /* 22 */\r
+ GG ( c, d, a, b, in[15], S23, 3634488961); /* 23 */\r
+ GG ( b, c, d, a, in[ 4], S24, 3889429448); /* 24 */\r
+ GG ( a, b, c, d, in[ 9], S21, 568446438); /* 25 */\r
+ GG ( d, a, b, c, in[14], S22, 3275163606); /* 26 */\r
+ GG ( c, d, a, b, in[ 3], S23, 4107603335); /* 27 */\r
+ GG ( b, c, d, a, in[ 8], S24, 1163531501); /* 28 */\r
+ GG ( a, b, c, d, in[13], S21, 2850285829); /* 29 */\r
+ GG ( d, a, b, c, in[ 2], S22, 4243563512); /* 30 */\r
+ GG ( c, d, a, b, in[ 7], S23, 1735328473); /* 31 */\r
+ GG ( b, c, d, a, in[12], S24, 2368359562); /* 32 */\r
+\r
+ /* Round 3 */\r
+#define S31 4\r
+#define S32 11\r
+#define S33 16\r
+#define S34 23\r
+ HH ( a, b, c, d, in[ 5], S31, 4294588738); /* 33 */\r
+ HH ( d, a, b, c, in[ 8], S32, 2272392833); /* 34 */\r
+ HH ( c, d, a, b, in[11], S33, 1839030562); /* 35 */\r
+ HH ( b, c, d, a, in[14], S34, 4259657740); /* 36 */\r
+ HH ( a, b, c, d, in[ 1], S31, 2763975236); /* 37 */\r
+ HH ( d, a, b, c, in[ 4], S32, 1272893353); /* 38 */\r
+ HH ( c, d, a, b, in[ 7], S33, 4139469664); /* 39 */\r
+ HH ( b, c, d, a, in[10], S34, 3200236656); /* 40 */\r
+ HH ( a, b, c, d, in[13], S31, 681279174); /* 41 */\r
+ HH ( d, a, b, c, in[ 0], S32, 3936430074); /* 42 */\r
+ HH ( c, d, a, b, in[ 3], S33, 3572445317); /* 43 */\r
+ HH ( b, c, d, a, in[ 6], S34, 76029189); /* 44 */\r
+ HH ( a, b, c, d, in[ 9], S31, 3654602809); /* 45 */\r
+ HH ( d, a, b, c, in[12], S32, 3873151461); /* 46 */\r
+ HH ( c, d, a, b, in[15], S33, 530742520); /* 47 */\r
+ HH ( b, c, d, a, in[ 2], S34, 3299628645); /* 48 */\r
+\r
+ /* Round 4 */\r
+#define S41 6\r
+#define S42 10\r
+#define S43 15\r
+#define S44 21\r
+ II ( a, b, c, d, in[ 0], S41, 4096336452); /* 49 */\r
+ II ( d, a, b, c, in[ 7], S42, 1126891415); /* 50 */\r
+ II ( c, d, a, b, in[14], S43, 2878612391); /* 51 */\r
+ II ( b, c, d, a, in[ 5], S44, 4237533241); /* 52 */\r
+ II ( a, b, c, d, in[12], S41, 1700485571); /* 53 */\r
+ II ( d, a, b, c, in[ 3], S42, 2399980690); /* 54 */\r
+ II ( c, d, a, b, in[10], S43, 4293915773); /* 55 */\r
+ II ( b, c, d, a, in[ 1], S44, 2240044497); /* 56 */\r
+ II ( a, b, c, d, in[ 8], S41, 1873313359); /* 57 */\r
+ II ( d, a, b, c, in[15], S42, 4264355552); /* 58 */\r
+ II ( c, d, a, b, in[ 6], S43, 2734768916); /* 59 */\r
+ II ( b, c, d, a, in[13], S44, 1309151649); /* 60 */\r
+ II ( a, b, c, d, in[ 4], S41, 4149444226); /* 61 */\r
+ II ( d, a, b, c, in[11], S42, 3174756917); /* 62 */\r
+ II ( c, d, a, b, in[ 2], S43, 718787259); /* 63 */\r
+ II ( b, c, d, a, in[ 9], S44, 3951481745); /* 64 */\r
+\r
+ buf[0] += a;\r
+ buf[1] += b;\r
+ buf[2] += c;\r
+ buf[3] += d;\r
+}\r
+\r
+/*\r
+ **********************************************************************\r
+ ** End of md5.c **\r
+ ******************************* (cut) ********************************\r
+ */\r
--- /dev/null
+/*\r
+ **********************************************************************\r
+ ** md5.h -- Header file for implementation of MD5 **\r
+ ** RSA Data Security, Inc. MD5 Message Digest Algorithm **\r
+ ** Created: 2/17/90 RLR **\r
+ ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **\r
+ ** Revised (for MD5): RLR 4/27/91 **\r
+ ** -- G modified to have y&~z instead of y&z **\r
+ ** -- FF, GG, HH modified to add in last register done **\r
+ ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **\r
+ ** -- distinct additive constant for each step **\r
+ ** -- round 4 added, working mod 7 **\r
+ **********************************************************************\r
+ */\r
+\r
+/*\r
+ **********************************************************************\r
+ ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **\r
+ ** **\r
+ ** License to copy and use this software is granted provided that **\r
+ ** it is identified as the "RSA Data Security, Inc. MD5 Message **\r
+ ** Digest Algorithm" in all material mentioning or referencing this **\r
+ ** software or this function. **\r
+ ** **\r
+ ** License is also granted to make and use derivative works **\r
+ ** provided that such works are identified as "derived from the RSA **\r
+ ** Data Security, Inc. MD5 Message Digest Algorithm" in all **\r
+ ** material mentioning or referencing the derived work. **\r
+ ** **\r
+ ** RSA Data Security, Inc. makes no representations concerning **\r
+ ** either the merchantability of this software or the suitability **\r
+ ** of this software for any particular purpose. It is provided "as **\r
+ ** is" without express or implied warranty of any kind. **\r
+ ** **\r
+ ** These notices must be retained in any copies of any part of this **\r
+ ** documentation and/or software. **\r
+ **********************************************************************\r
+ */\r
+\r
+/* typedef a 32 bit type */\r
+typedef unsigned long int UINT4;\r
+\r
+/* Data structure for MD5 (Message Digest) computation */\r
+typedef struct {\r
+ UINT4 i[2]; /* number of _bits_ handled mod 2^64 */\r
+ UINT4 buf[4]; /* scratch buffer */\r
+ unsigned char in[64]; /* input buffer */\r
+ unsigned char digest[16]; /* actual digest after MD5Final call */\r
+} MD5_CTX;\r
+\r
+void MD5Init ();\r
+void MD5Update ();\r
+void MD5Final ();\r
+\r
+/*\r
+ **********************************************************************\r
+ ** End of md5.h **\r
+ ******************************* (cut) ********************************\r
+ */\r
--- /dev/null
+Download the source images into this directory from http://www.openjpeg.org/OPJ_Validate_OriginalImages.7z