bug fixed when asking for an index with more than (layer*resolutions*100) packets...
[openjpeg.git] / codec / readme.txt
1 List of parameters for the coder JPEG 2000 :
2
3 Date : June the 25th, 2003
4 Author : Yannick Verschueren
5 Contact : verschueren@tele.ucl.ac.be 
6
7 - the option -help displays the readme.txt file on screen
8
9 - The markers COD and QCD are writed both of two in the main_header and never appear in the tile_header.  The markers in the main header are : SOC SIZ COD QCD COM.
10
11 - This coder can encode mega image, a test was made on a 24000x24000 pixels color image.  You need enough disk space memory (twice the original) to encode the image. (i.e. for a 1.5 Gb image you need a minimum of 3Gb of disk memory) 
12
13 REMARKS :
14 ---------
15
16 * the value of rate enter in the code line is the compression factor !
17 exemple :
18
19 -r 20,10,1 means quality 1 : compress 20x, quality 2 : compress 10x and quality 3 : compress 1x = lossless  
20
21 * The number of resolution can be modified by the program in view to respect profile-0 conditions (Taubman, Marcelin (2002), "JPEG2000, image compression fundamentals, standards and practice", p700)
22
23 By default :
24 ------------
25
26  * lossless
27  * 1 tile
28  * size of precinct 2^15 x 2^15 (means 1 precinct)
29  * size of code-block 64 x 64
30  * Number of resolution : 6
31  * No SOP marker in the codestream
32  * No EPH marker in the codestream
33  * No sub-sampling in x and y direction
34  * No mode switch activated
35  * progression order : LRCP
36  * No index file
37  * No ROI upshifted
38  * No offset of the origin of the image
39  * No offset of the origin of the tiles
40  * Reversible DWT 5-3
41
42 Parameters :
43 ------------
44
45 -i             : source file  (-i source.pnm also *.pgm, *.ppm) "required"
46
47 -o             : destination file (-o dest.j2k) "required"
48
49 -r             : different rates (-r 20,10,5) "optional" 
50
51 -n             : Number of resolution (-n 3) "optional"
52
53 -b             : size of code block (-b 32,32) "optional"
54
55 -c             : size of precinct (-c 128,128) "optional"
56
57 -t             : size of tile (-t 512,512) "optional"
58
59 -p             : progression order (-p LRCP) [LRCP, RLCP, RPCL, PCRL, CPRL] "optional"
60
61 -s             : subsampling factor (-s 2,2) [-s X,Y] "optional"
62
63 -SOP           : write SOP marker before each packet "optional"
64
65 -EPH           : write EPH marker after each header packet "optional"
66
67 -M             : mode switch (-M 3) [1= BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL) 8=VSC 16=ERTERM(SEGTERM) 32=SEGMARK(SEGSYM)]  "optional"
68                     for several mode switch you have to add the value of each mode you want
69                     ex : RESTART(4) + RESET(2) + SEGMARK(32) = -M 38 
70
71 -x             : Create an index file *.Idx (-x index_name.Idx) "optional"
72
73 -ROI:c=%d,U=%d : quantization indices upshifted for component c=%d [%d = 0,1,2] 
74                  with a value of U=%d [0 <= %d <= 37] (i.e. -ROI:c=0,U=25) "optional"
75
76 -d             : offset of the origin of the image (-d 150,300) "optional"
77
78 -T             : offset of the origin of the tiles (-T 100,75) "optional"
79
80 -I             : Use the irreversible DWT 9-7 (-I) "optional"
81
82 IMPORTANT : 
83 -----------
84
85 * subsampling bigger than 2 can produce error
86
87 The index file respect the structure below :
88 ---------------------------------------------
89
90 Image_height Image_width
91 progression order
92 Tiles_size_X Tiles_size_Y
93 Components_nb
94 Layers_nb
95 decomposition_levels
96 Precincts_size_X Precincts_size_Y
97 Main_header_end_position
98 Codestream_size
99 Tile0 start_pos end_Theader end_pos
100 Tile1  "         "           "
101 ...
102 TileN  "         "           "
103 Tpacket_0 Tile layer res. comp. prec. start_pos end_pos
104 ...
105 Tpacket_M "    "     "    "     "     "         "