https://wiki.multimedia.cx/index.php?title=PACo&feed=atom&action=historyPACo - Revision history2024-03-28T15:09:31ZRevision history for this page on the wikiMediaWiki 1.39.5https://wiki.multimedia.cx/index.php?title=PACo&diff=15673&oldid=prevKostya: add a mention of another Paco format2022-10-24T15:56:21Z<p>add a mention of another Paco format</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:56, 24 October 2022</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Company: The Company of Science and Art</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Company: The Company of Science and Art</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This is a format used in animations at least in [https://www.mobygames.com/game/iron-helix Iron Helix] game.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This is a format used in animations at least in [https://www.mobygames.com/game/iron-helix Iron Helix] game<ins style="font-weight: bold; text-decoration: none;">. It should not be confused with [[Cydonia Paco]]</ins>.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Container format ==</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Container format ==</div></td></tr>
</table>Kostyahttps://wiki.multimedia.cx/index.php?title=PACo&diff=15613&oldid=prevKostya: /* Video compression */2022-03-09T14:06:40Z<p><span dir="auto"><span class="autocomment">Video compression</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 07:06, 9 March 2022</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l75">Line 75:</td>
<td colspan="2" class="diff-lineno">Line 75:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Compact mode opcodes:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Compact mode opcodes:</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* <code>0x</code> - low nibble is the actual operation, the following byte is operation length. Operations are: 0 - copy, 1 - run (colour index is in low nibble), 2 - pair run, 3 - quad run, 4 - skip, 5 - end of line;</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <code>0x</code> - low nibble is the actual operation, the following byte is operation length. Operations are: 0 - copy, 1 - run (colour index is in low nibble), 2 - pair run, 3 - quad run, 4 - skip, 5 - end of line <ins style="font-weight: bold; text-decoration: none;">(plus skipping additional lines)</ins>;</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* <code>1x</code>-<code>7x</code> - copy 1-7 colours with the corresponding nibble indexes from the stream, low nibble of opcode byte is the first index. If the number of colours is even it is padded to the byte with zero nibble.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* <code>1x</code>-<code>7x</code> - copy 1-7 colours with the corresponding nibble indexes from the stream, low nibble of opcode byte is the first index. If the number of colours is even it is padded to the byte with zero nibble.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* <code>8x</code>-<code>Dx</code> - repeat colour with low nibble index <code>16 - (op >> 4)</code> times</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* <code>8x</code>-<code>Dx</code> - repeat colour with low nibble index <code>16 - (op >> 4)</code> times</div></td></tr>
</table>Kostyahttps://wiki.multimedia.cx/index.php?title=PACo&diff=15583&oldid=prevKostya: Created page with "* Company: The Company of Science and Art This is a format used in animations at least in [https://www.mobygames.com/game/iron-helix Iron Helix] game. == Container format ==..."2021-08-24T17:02:17Z<p>Created page with "* Company: The Company of Science and Art This is a format used in animations at least in [https://www.mobygames.com/game/iron-helix Iron Helix] game. == Container format ==..."</p>
<p><b>New page</b></p><div>* Company: The Company of Science and Art<br />
<br />
This is a format used in animations at least in [https://www.mobygames.com/game/iron-helix Iron Helix] game.<br />
<br />
== Container format ==<br />
The format comes from Macintosh so all values are big-endian.<br />
<br />
Container header:<br />
<br />
2 bytes - 0x0001<br />
2 bytes - 0x0026<br />
2 bytes - width<br />
2 bytes - height<br />
2 bytes - framerate (negative means there's no audio stream)<br />
2 bytes - flags?<br />
4 bytes - maximum chunk size<br />
4 bytes - always zero?<br />
4 bytes - something audio-related<br />
2 bytes - number of chunks<br />
2 bytes - number of chunks repeated<br />
2 bytes - always 8?<br />
2 bytes - always 0x600?<br />
4 bytes - some flags<br />
2 bytes - always 0?<br />
<br />
The header is followed by 32-bit chunk sizes. After that actual chunks data is present.<br />
<br />
Each chunk consists of several records with 4-byte header (1 byte - record type, 3 bytes - record size including the header). Known record types are:<br />
* 0 - nop<br />
* 1 - old initialisation data?<br />
* 2 - new initialisation data (usually <code>0x30 0x00 0x00 ...</code> meaning 8-bit with default QuickTime palette)<br />
* 3 - delay information<br />
* 4 - audio data (8-bit unsigned PCM)<br />
* 5 - should not be present<br />
* 6 - should not be present<br />
* 7 - unknown<br />
* 8 - video frame<br />
* 9 - unknown<br />
* 10 - dummy?<br />
* 11 - end of chunk marker<br />
<br />
== Video compression ==<br />
<br />
Video compression is an enhanced RLE scheme.<br />
<br />
Frame data starts with the following header:<br />
2 bytes - x offset of the updated area<br />
2 bytes - y offset of the updated area<br />
2 bytes - updated area width<br />
2 bytes - updated area height<br />
1 byte - compression method and flags<br />
1 byte - padding<br />
<br />
Compression method should be 1 or 2, known flags are <code>0x20</code> - frame uses compact RLE and <code>0x40</code> - delta frame.<br />
<br />
Compression methods 1 and 2 are the same except that the latter codes picture in interlaced manner (i.e. first it decodes all even lines of the updated area and then all odd lines). RLE compresses each line separately so no run/copy/skip should go past the line end.<br />
<br />
Compression format uses the following opcodes:<br />
* <code>0x00</code> - long operation<br />
* <code>0x01</code>-<code>0x7F</code> - copy the same amount of pixels<br />
* <code>0x80</code>-<code>0xFD</code> - repeat the following value <code>256 - op</code> times<br />
* <code>0xFE</code> - next byte is either the number of pixels to skip (if non-zero) or a signal of compact RLE mode<br />
* <code>0xFF</code> - pair or quad run. Read the next byte and if it is below 128 then read and repeat a pair of pixels <code>len</code> times, otherwise read and repeat four pixels (but <code>256 - len</code> times)<br />
<br />
Long operation (opcode <code>0x00</code>) has 16-bit word specifying the actual operation (top nibble) and operation length (bottom 12 bits). Known operations are:<br />
* 0 - raw copy pixels<br />
* 1 - RLE<br />
* 2 - pair RLE (read a pair of pixels and repeat it the specified number of times)<br />
* 3 - quad RLE (read four pixels and repeat it the specified number of times)<br />
* 4 - skip<br />
* 5 - end current line and skip additional <code>len</code> lines<br />
* 15 - not real opcode but <code>00 F0 00 00</code> is often seen at the end of frame and can serve as an end marker<br />
<br />
Compact RLE mode works until the current line end but using nibbles to code lengths and operations and maintaining a set of 16 colours that should be used and transmitting their indices instead. Right after <code>FE 00</code> there is 16-bit mask telling which colours in the set should be updated (least significant bit - first colour, top significant bit - last colour). After the mask and optional update colours actual compact opcodes follow.<br />
<br />
Compact mode opcodes:<br />
* <code>0x</code> - low nibble is the actual operation, the following byte is operation length. Operations are: 0 - copy, 1 - run (colour index is in low nibble), 2 - pair run, 3 - quad run, 4 - skip, 5 - end of line;<br />
* <code>1x</code>-<code>7x</code> - copy 1-7 colours with the corresponding nibble indexes from the stream, low nibble of opcode byte is the first index. If the number of colours is even it is padded to the byte with zero nibble.<br />
* <code>8x</code>-<code>Dx</code> - repeat colour with low nibble index <code>16 - (op >> 4)</code> times<br />
* <code>Ex</code> - skip the number of pixels in low nibble<br />
* <code>Fx</code> - pair or quad run (if low nibble is less than eight then it's a pair run, otherwise it's a quad run for <code>16 - (op & 0xF)</code> times).<br />
<br />
[[Category:Game Formats]]<br />
[[Category:Video Codecs]]</div>Kostya