Squeeze

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
|subcat=Compression
 
|subcat=Compression
 
|extensions={{ext|?q?}}, {{ext|qqq}}
 
|extensions={{ext|?q?}}, {{ext|qqq}}
 +
|wikidata={{wikidata|Q34745668}}
 
|released=ca. 1981
 
|released=ca. 1981
 
}}
 
}}
 
:''Not to be confused with [[Squeeze It]], a compression-and-archival format for [[DOS]] released around 1992.''
 
:''Not to be confused with [[Squeeze It]], a compression-and-archival format for [[DOS]] released around 1992.''
[[Squeeze]] was a method of compressing single files popular on [[CP/M]], devised by Richard (Dick) Greenlaw(?) circa 1981. It was superseded by [[Crunch]] and later [[CrLZH]]. Squeezed files were common in [[LBR]] archives. It uses [[Huffman coding|Huffman compression]].
+
[[Squeeze]] was a method of compressing single files popular on [[CP/M]], devised by Richard Greenlaw circa 1981. It was superseded by [[Crunch]] and later [[CrLZH]]. Squeezed files were common in [[LBR]] archives. It uses [[Huffman coding|Huffman compression]].
  
 
Squeezed files were signified in CP/M's 8.3 filename format by replacing the middle letter of the extension with Q (.?Q? -- so FOO.TXT became FOO.TQT), with the extension .QQQ used for corner cases such as a blank extension.
 
Squeezed files were signified in CP/M's 8.3 filename format by replacing the middle letter of the extension with Q (.?Q? -- so FOO.TXT became FOO.TQT), with the extension .QQQ used for corner cases such as a blank extension.
Line 25: Line 26:
 
|-
 
|-
 
|compressed data || variable || See below.
 
|compressed data || variable || See below.
 +
|-
 +
|timestamp extension || 8 || Optional timestamp. See below.
 
|}
 
|}
  
Line 52: Line 55:
  
 
Some Squeeze software limits the length of a Huffman code to at most 16 bits.
 
Some Squeeze software limits the length of a Huffman code to at most 16 bits.
 +
 +
=== Timestamp extension ===
 +
Format of timestamp extension, taken from SQDATE.DOC (see below). It starts at the first byte boundary after the Stop code. It is present if the signature and checksum are correct.
 +
 +
{| class="wikitable"
 +
! Field !! Size in bytes !! Description
 +
|-
 +
|signature || 2 || <code>0xff77</code> (<code>0x77 0xff</code>)
 +
|-
 +
|date || 2 ||rowspan="2"| [[MS-DOS date/time]] format
 +
|-
 +
|time || 2
 +
|-
 +
|checksum || 2 || Low 16 bits of the sum of the first three fields, interpreted as little-endian integers.
 +
|}
  
 
== Identification ==
 
== Identification ==
Line 68: Line 86:
 
* See the [http://www.classiccmp.org/cpmarchives/cpm/mirrors/oak.oakland.edu/pub/cpm/squsq/ SQUSQ] directory on CP/M archives for various source code and documentation (much of it, unfortunately, itself squeezed/crunched).
 
* See the [http://www.classiccmp.org/cpmarchives/cpm/mirrors/oak.oakland.edu/pub/cpm/squsq/ SQUSQ] directory on CP/M archives for various source code and documentation (much of it, unfortunately, itself squeezed/crunched).
 
* The file header follows a similar/compatible structure to [[Crunch]] and [[CrLZH]].
 
* The file header follows a similar/compatible structure to [[Crunch]] and [[CrLZH]].
 +
* {{CdTextfiles|simtel/simtel/DISK1/DISC2/COMPRESS/SQDATE.DOC|SQDATE.DOC}}
 
* [[Wikipedia:SQ (program)]]
 
* [[Wikipedia:SQ (program)]]
  
 
[[Category:File formats with too many extensions]]
 
[[Category:File formats with too many extensions]]
 
[[Category:CP/M]]
 
[[Category:CP/M]]

Revision as of 19:58, 3 August 2020

File Format
Name Squeeze
Ontology
Extension(s) .?q?, .qqq
Wikidata ID Q34745668
Released ca. 1981
Not to be confused with Squeeze It, a compression-and-archival format for DOS released around 1992.

Squeeze was a method of compressing single files popular on CP/M, devised by Richard Greenlaw circa 1981. It was superseded by Crunch and later CrLZH. Squeezed files were common in LBR archives. It uses Huffman compression.

Squeezed files were signified in CP/M's 8.3 filename format by replacing the middle letter of the extension with Q (.?Q? -- so FOO.TXT became FOO.TQT), with the extension .QQQ used for corner cases such as a blank extension.

The /usr/share/misc/magic file on Linux systems suggests that it was perhaps also in use on the Apple ][ platform, and in fact Binary II files are often found squeezed (as .bqy instead of .bny). Versions for PC/MS-DOS were also in use in the early 1980s before ARC caught on as the dominant archiver.

Contents

Format details

Multi-byte integers are little-endian.

Field Size in bytes Description
signature 2 0x76 0xff
checksum 2 Low 16 bits of the sum of the decompressed byte values.
original filename variable Terminated by a NUL byte.
compressed data variable See below.
timestamp extension 8 Optional timestamp. See below.

The "compressed data" section. This part is equivalent to ARC compression method 4.

Field Size in bytes Description
node_count 2 Number of nodes in the table. Valid values are 0 through 256, inclusive.
node table 4 × node_count The encoded Huffman tree. See below.
data variable Huffman-encoded data. Least-significant bit first. After Huffman decoding, the data is RLE90-compressed. Generally speaking, the data is terminated by a special "stop" code. However, this compression format could be used in situations where it could also be terminated by other means.

A table node contains two encoded values. Each is a signed 16-bit integer interpreted as follows:

Encoded value Meaning
−257 Stop
−256 ... −1 Byte value 255 ... 0
0 ... 255 Pointer to a child node

Some Squeeze software limits the length of a Huffman code to at most 16 bits.

Timestamp extension

Format of timestamp extension, taken from SQDATE.DOC (see below). It starts at the first byte boundary after the Stop code. It is present if the signature and checksum are correct.

Field Size in bytes Description
signature 2 0xff77 (0x77 0xff)
date 2 MS-DOS date/time format
time 2
checksum 2 Low 16 bits of the sum of the first three fields, interpreted as little-endian integers.

Identification

Files begin with bytes 76 ff.

Tools

  • CFX (DOS/Unix)
  • lbrate by Russell Marks, c. 2001 (Unix, GPL2)
  • On CP/M (or emulators):
    • The original tools were SQ/USQ. See for instance the SQUSQ directory of the Oakland CP/M archive.
    • The later LT31 deals with extracting from all of Squeeze, Crunch, CrLZH and LBR formats. Widely available in CP/M archives, e.g. LT31.LBR

References

  • See the SQUSQ directory on CP/M archives for various source code and documentation (much of it, unfortunately, itself squeezed/crunched).
  • The file header follows a similar/compatible structure to Crunch and CrLZH.
  • SQDATE.DOC
  • Wikipedia:SQ (program)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox