1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <title>ctr_compress</title>
7    <style type="text/css">
8    <!--
9    body {
10    /*
11        font-size       : 10pt;
12    */
13        font-weight     : normal;
14        color           : #000000;
15        margin          : 8px;
16    }
17
18    div {
19        width           : 98%;
20        white-space     : nowrap;
21    }
22
23    div.title {
24        text-align      : left;
25        font-weight     : bold;
26    /*
27        font-size       : 16pt;
28    */
29        font-size       : 150%;
30        color           : #202020;
31        border-style    : double;
32        border-width    : 8px;
33        /* タイトルを囲む枠線の色を指定 */
34        border-color    : #FF6600;
35
36        /* RVLプラットフォーム系列 */
37    /*
38        border-color    : #34beed;
39    */
40
41        /* TWLプラットフォーム系列 */
42    /*
43        border-color    : #ff458f;
44    */
45
46        margin          : 4px;
47        padding         : 4px;
48    }
49    H1 {
50      font-size		: 150%;
51      font-family		: Arial;
52      border-bottom-width	: 5px;
53      border-bottom-style	: solid;
54      border-bottom-color	: #FF6600;
55      padding-bottom		: 1px;
56      margin-bottom		: 20px;
57      letter-spacing		: normal;
58      font-weight		: bold;
59    }
60
61    h2 {
62        font-weight     : bold;
63    /*
64        font-size       : 16pt;
65    */
66        font-size       : 150%;
67        border-style    : none none solid double;
68        border-width    : 0px 0px 2px 8px;
69        /* 見出しの線の色を指定 */
70        border-color    : #FF6600;
71
72        /* RVLプラットフォーム系列 */
73    /*
74        border-color    : #34beed;
75    */
76
77        /* TWLプラットフォーム系列 */
78    /*
79        border-color    : #ff458f;
80    */
81
82        margin-left     : 2px;
83        padding-left    : 4px;
84    }
85    CODE {
86      font-family		: "Courier New", monospace;
87      position		: normal;
88      left			: 12px;
89      font-size		: 10pt;
90    }
91    table {
92      margin-top        : 2pt;
93      margin-bottom     : 2pt;
94      margin-left       : 0pt;
95      margin-right      : 0pt;
96      padding-left      : 0pt;
97      padding-right     : 0pt;
98      position          : relative;
99      left              : 12px;
100      font-family       : Arial;
101      font-size         : 10pt;
102      border-style      : none none none none;
103    }
104    td,th {
105      padding           : 2pt;
106      border-width      : 2pt;
107      border-style      : none none none none;
108      font-style        : normal;
109      text-align        : left;
110    }
111    td {
112      background        : #e8f4f4;
113      font-weight       : normal;
114    }
115    th {
116      background        : #c0d8d8;
117      font-weight       : bold;
118    }
119
120    p {
121        margin-left     : 4px;
122    }
123    p.code {
124      font-family		: "Courier New", monospace;
125      position		: normal;
126      left			: 12px;
127      font-size		: 10pt;
128      background            : #e8f4f4;
129    }
130
131    -->
132    </style>
133
134  </head>
135  <body>
136    <h1>ctr_compress</h1>
137    <h2>Description</h2>
138    <p>
139      The ctr_compress tool creates compressed data in a format that can be handled by the cx library of the CTR-SDK.
140    </p>
141    <h2>How to Use</h2>
142    <h3>Command</h3>
143
144    <p class="code">
145      % ntrcomp &lt;-d(8|16)|r|l|lex|h(4|8)&gt; [-s] [-&lt;t|T&gt;[width]] [-H] [-A(4|8|16|32)] [-o outputFile] &lt;inputFile&gt;
146    </p>
147    <p class="code">
148      % ntrcomp -x [-o outputFile] [-s] &lt;inputFile&gt;
149    </p>
150
151    <p>
152      Compresses and converts the input file that is designated by inputFile into a designated format. Run-length compression, LZ77 extended compression, Huffman compression, and difference filter conversion are all possible.
153    </p>
154    <p>
155      With the <code>-s</code> option, the message indicating successful compression will not be displayed.
156    </p>
157    <p>
158      With the -H option, the data size is also appended to the data after expansion occurs. This is because header information is added to the data and compressed.
159    </p>
160    <p>
161      With the <code>-A</code> option, the end of the output file is padded with zeros so that the file size is in alignment with the byte size of the <B>n</B> argument.
162    </p>
163    <p>
164      With the -o option, the file name of the output file can be designated. If nothing is designated, the output file is created with the name (<EM>main portion of the input file name</EM>)_(<EM>compression method</EM>).bin.
165    </p>
166    <p>
167      With the -t or -T option, the output file can be created as a C format text file. By adding (1 | 2 | 4) to the option, you can choose between the u8, u16, and u32 types. (The default is u8.) The output is little-endian with -t and big-endian with -T when u16 or u32 has been specified.
168    </p>
169    <p>
170      With the -x option, ctr_compress is used and the compressed file is decompressed on the PC.
171    </p>
172
173    <h3>Format of Options for Designating the Compression Method</h3>
174
175    <p>
176      The following formats can be specified for the compression method:
177    </p>
178    <p>
179      <table class="table"><tbody>
180        <tr><th>Options</th><th>Compression Method</th><th>Parameters</th></tr>
181        <tr><td><code>-d</code></td><td>Difference filtering.</td><td>Specifies the bit size of the comparison unit  { 8 | 16 }</td></tr>
182        <tr><td><CODE>-r</CODE></td><td>Run-length compression.</td><td>None.</td></tr>
183        <tr><td>-h</td><td>Huffman compression.</td><td>Specifies the bit size to encode  { 4 | 8 }</td></tr>
184        <tr><td><CODE>-lex</CODE></td><td>LZ77 extended compression</td><td>None.</td></tr>
185        <tr><td><code>-l</code></td><td>LZ77 compression (for backward compatibility).</td><td>None.</td></tr>
186      </tbody></table>
187    </p>
188    <p>
189      Although you can expect a higher compression ratio with LZ77 extended compression (lex) as compared to LZ77 compression (-l), the -l option is preserved for backward compatibility. Either format can be decompressed using the same nn:cx::UncomrpessLZ* functions.
190    </p>
191    <p>
192      Although extended LZ compression (<CODE>-lex</CODE>) may have a worst-case compression time several times greater than when using conventional LZ compression (<CODE>-l</CODE>), and although you can expect compression at more consistent speeds with the conventional version regardless of the data when compressing data at runtime, decompression speed is about the same for both methods.
193    </p>
194
195    <h2>Revision History</h2>
196    <dl class="history">
197      <dt>2010/09/17</dt>
198      <dd>Initial version.<br /></dd>
199    </dl>
200  <hr><p>CONFIDENTIAL</p></body>
201</html>
202