[trunk] Adding more tests. tte5.j2k looks as if the tile compression is broken

This commit is contained in:
Mathieu Malaterre 2012-05-29 14:25:23 +00:00
parent 0d0e7a1008
commit 426ad6e3a3
2 changed files with 11 additions and 14 deletions

View File

@ -44,8 +44,11 @@ TARGET_LINK_LIBRARIES(test_tile_encoder ${OPENJPEG_LIBRARY_NAME})
# Let's try a couple of possibilities: # Let's try a couple of possibilities:
ADD_TEST(tte0 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder) ADD_TEST(tte0 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder)
ADD_TEST(tte1 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 tte1.j2k) ADD_TEST(tte1 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 1 tte1.j2k)
ADD_TEST(tte2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 tte1.jp2) ADD_TEST(tte2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 8 1 tte2.jp2)
ADD_TEST(tte3 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 2048 2048 1024 1024 8 1 tte3.j2k)
ADD_TEST(tte4 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 256 256 128 128 8 0 tte4.j2k)
ADD_TEST(tte5 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 512 512 256 256 8 0 tte5.j2k)
ADD_EXECUTABLE(test_tile_decoder test_tile_decoder.c) ADD_EXECUTABLE(test_tile_decoder test_tile_decoder.c)
TARGET_LINK_LIBRARIES(test_tile_decoder ${OPENJPEG_LIBRARY_NAME}) TARGET_LINK_LIBRARIES(test_tile_decoder ${OPENJPEG_LIBRARY_NAME})

View File

@ -29,15 +29,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <strings.h>
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
#endif /* _WIN32 */
#include "opj_config.h" #include "opj_config.h"
#include "openjpeg.h" #include "openjpeg.h"
#include "stdlib.h" #include "stdlib.h"
@ -119,10 +110,11 @@ int main (int argc, char *argv[])
int tile_width; int tile_width;
int tile_height; int tile_height;
int comp_prec; int comp_prec;
int irreversible;
char output_file[64]; char output_file[64];
/* should be test_tile_encoder 3 2000 2000 1000 1000 8 tte1.j2k */ /* should be test_tile_encoder 3 2000 2000 1000 1000 8 tte1.j2k */
if( argc == 8 ) if( argc == 9 )
{ {
num_comps = atoi( argv[1] ); num_comps = atoi( argv[1] );
image_width = atoi( argv[2] ); image_width = atoi( argv[2] );
@ -130,7 +122,8 @@ int main (int argc, char *argv[])
tile_width = atoi( argv[4] ); tile_width = atoi( argv[4] );
tile_height = atoi( argv[5] ); tile_height = atoi( argv[5] );
comp_prec = atoi( argv[6] ); comp_prec = atoi( argv[6] );
strcpy(output_file, argv[7] ); irreversible = atoi( argv[7] );
strcpy(output_file, argv[8] );
} }
else else
{ {
@ -140,6 +133,7 @@ int main (int argc, char *argv[])
tile_width = 1000; tile_width = 1000;
tile_height = 1000; tile_height = 1000;
comp_prec = 8; comp_prec = 8;
irreversible = 1;
strcpy(output_file, "test.j2k" ); strcpy(output_file, "test.j2k" );
} }
if( num_comps > NUM_COMPS_MAX ) if( num_comps > NUM_COMPS_MAX )
@ -178,7 +172,7 @@ int main (int argc, char *argv[])
l_param.cp_tdy = tile_height; l_param.cp_tdy = tile_height;
/* use irreversible encoding ?*/ /* use irreversible encoding ?*/
l_param.irreversible = 1; l_param.irreversible = irreversible;
/* do not bother with mct, the rsiz is set when calling opj_set_MCT*/ /* do not bother with mct, the rsiz is set when calling opj_set_MCT*/
/*l_param.cp_rsiz = STD_RSIZ;*/ /*l_param.cp_rsiz = STD_RSIZ;*/