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><CODE>ctr_compress</CODE></h1> 137<h2>Description</h2> 138 <p> 139The <CODE>ctr_compress</CODE> tool creates compressed data in a format that can be handled by the <CODE>cx</CODE> library of the CTR-SDK. 140 </p> 141<h2>How to Use</h2> 142<h3>Command</h3> 143 144 <p class="code"> 145% ctr_compress <-d(8|16)|r|l|lex|lb|h(4|8)|lh|lrc> [-s] [-<t|T>[width]] [-H] [-A(4|8|16|32)] [-o outputFile] <inputFile> 146 </p> 147 <p class="code"> 148% ctr_compress <-x|xlb> [-o outputFile] [-s] <inputFile> 149 </p> 150 151 <p> 152Compresses and converts the input file that is designated by <CODE>inputFile</CODE> into a designated format. Run-length compression, LZ77 extended compression, LZ77 backward compression, Huffman compression, and difference filter conversion are all possible. 153 </p> 154 <p> 155With the <code>-s</code> option, the message indicating successful compression will not be displayed. 156 </p> 157 <p> 158With the <CODE>-H</CODE> 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> 161With the <code>-A</code> option, the end of the output file is padded with zeroes so that the file size is in alignment with the byte size of the <SPAN class="argument">n</SPAN> argument. 162 </p> 163 <p> 164With the <CODE>-o</CODE> 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> 167With the <CODE>-t</CODE> or <CODE>-T</CODE> 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 <CODE>-t</CODE> and big-endian with <CODE>-T</CODE> when u16 or u32 has been specified. 168 </p> 169 <p> 170With the <CODE>-x</CODE> option, files that were compressed using <CODE>ctr_compress</CODE> (with the exception of LZ77 backward compression files ) can be decompressed on the PC. For files that have been compressed with LZ77 backward compression, use the <CODE>-xlb</CODE> option. 171 </p> 172 173<h3>Format of Options for Designating the Compression Method</h3> 174 175 <p> 176The 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<tr><td>-lb</td><td>LZ77 backward compression</td><td>None.</td></tr> 187<tr><td>-lh</td><td>LZ77 + Huffman combined compression</td><td>None.</td></tr> 188<tr><td>-lrc</td><td>LZ77 + Range Coder combined compression</td><td>None.</td></tr> 189 </tbody></table> 190 </p> 191 <p> 192Although you can expect a higher compression ratio with LZ77 extended compression (<CODE>-lex</CODE>) as compared to LZ77 compression (<CODE>-l</CODE>), the <CODE>-l</CODE> option is preserved for backward compatibility. Either format can be decompressed using the same <CODE>nn:cx::UncomrpessLZ*</CODE> functions. 193 </p> 194 <p> 195Although 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. 196 </p> 197 198<h2>Revision History</h2> 199 <dl class="history"> 200 <dt>2011/06/02</dt> 201<dd>Added the <CODE>-lb</CODE> and <CODE>-xlb</CODE> options.</dd> 202 <dt>2010/09/17</dt> 203<dd>Initial version.<br /></dd> 204 </dl> 205 <hr><p>CONFIDENTIAL</p></body> 206</html> 207