Squeeze

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Format details)
(2 intermediate revisions by one user not shown)
Line 2: Line 2:
 
|formattype=electronic
 
|formattype=electronic
 
|subcat=Compression
 
|subcat=Compression
|extensions={{ext|?q?}}, {{ext|qqq}}
+
|extensions={{ext|?q?}}, {{ext|qqq}}, {{ext|sq}}
 
|wikidata={{wikidata|Q34745668}}
 
|wikidata={{wikidata|Q34745668}}
 
|released=ca. 1981
 
|released=ca. 1981
Line 10: Line 10:
 
[[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]] combined with [[run-length encoding]].
 
[[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]] combined with [[run-length encoding]].
  
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. Some software for other platforms (e.g. squprt33.ark) appends a .SQ extension instead.
  
 
The <tt>/usr/share/misc/magic</tt> file on Linux systems suggests that it was perhaps also in use on the [[Apple II|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 (compression format)|ARC]] caught on as the dominant archiver.
 
The <tt>/usr/share/misc/magic</tt> file on Linux systems suggests that it was perhaps also in use on the [[Apple II|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 (compression format)|ARC]] caught on as the dominant archiver.
Line 33: Line 33:
  
 
== Format details ==
 
== Format details ==
Multi-byte integers are little-endian.
+
Note:
 +
* Multi-byte integers are little-endian.
 +
* Some Squeeze software limits the length of a Huffman code to at most 16 bits.
  
 +
=== File structure ===
 
{| class="wikitable"
 
{| class="wikitable"
 
! Field !! Size in bytes !! Description
 
! Field !! Size in bytes !! Description
Line 42: Line 45:
 
|checksum || 2 || Low 16 bits of the sum of the decompressed byte values.
 
|checksum || 2 || Low 16 bits of the sum of the decompressed byte values.
 
|-
 
|-
|original filename || variable || Terminated by a NUL byte.
+
|filename || variable || Original filename, terminated by a NUL byte. (TODO: Find a specification for this field. Some software interprets it in the same way as [[Crunch]], but that might be overkill.)
 
|-
 
|-
 
|compressed data || variable || See below.
 
|compressed data || variable || See below.
Line 73: Line 76:
 
| 0 ... 255 || Pointer to a child node
 
| 0 ... 255 || Pointer to a child node
 
|}
 
|}
 
Some Squeeze software limits the length of a Huffman code to at most 16 bits.
 
  
 
=== Timestamp extension ===
 
=== Timestamp extension ===
Line 98: Line 99:
 
== Specifications ==
 
== Specifications ==
 
* 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]].
 
 
* {{CdTextfiles|simtel/simtel/DISK1/DISC2/COMPRESS/SQDATE.DOC|SQDATE.DOC}} - Information about the timestamp extension
 
* {{CdTextfiles|simtel/simtel/DISK1/DISC2/COMPRESS/SQDATE.DOC|SQDATE.DOC}} - Information about the timestamp extension
  
Line 108: Line 108:
 
** The original tools were SQ/USQ. See for instance the [http://www.classiccmp.org/cpmarchives/cpm/mirrors/oak.oakland.edu/pub/cpm/squsq/ SQUSQ] directory of the Oakland CP/M archive.
 
** The original tools were SQ/USQ. See for instance the [http://www.classiccmp.org/cpmarchives/cpm/mirrors/oak.oakland.edu/pub/cpm/squsq/ 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. [http://www.classiccmp.org/cpmarchives/cpm/mirrors/oak.oakland.edu/pub/cpm/arc-lbr/lt31.lbr LT31.LBR]
 
** The later LT31 deals with extracting from all of [[Squeeze]], [[Crunch]], [[CrLZH]] and [[LBR]] formats. Widely available in CP/M archives, e.g. [http://www.classiccmp.org/cpmarchives/cpm/mirrors/oak.oakland.edu/pub/cpm/arc-lbr/lt31.lbr LT31.LBR]
 +
* [http://www.classiccmp.org/cpmarchives/cpm/mirrors/oak.oakland.edu/pub/cpm/squsq/squprt33.ark squprt33.ark] - Portable sq/usq, version "3.3 10/29/86"
 
* {{CdTextfiles|carousel/013B/NSQUSQ.ZIP|NSQUSQ.ZIP}} - Contains NUSQ v1.10 (1984-10-21; By Dave Rand, Paul Homchick and Cliff Sharp) and NSQ v2.01 (1984-10-20; "Originally by Richard Greenlaw") (DOS Software)
 
* {{CdTextfiles|carousel/013B/NSQUSQ.ZIP|NSQUSQ.ZIP}} - Contains NUSQ v1.10 (1984-10-21; By Dave Rand, Paul Homchick and Cliff Sharp) and NSQ v2.01 (1984-10-20; "Originally by Richard Greenlaw") (DOS Software)
 
* {{CdTextfiles|simtel/simtel20/MSDOS/COMPRESS/SQPC131.ZIP|SQPC131.ZIP}} - SQPC v1.31 (1986-03-02) and UNSQPC v1.36, by Vernon D. Buerg (DOS Software)
 
* {{CdTextfiles|simtel/simtel20/MSDOS/COMPRESS/SQPC131.ZIP|SQPC131.ZIP}} - SQPC v1.31 (1986-03-02) and UNSQPC v1.36, by Vernon D. Buerg (DOS Software)

Revision as of 13:35, 27 September 2020

File Format
Name Squeeze
Ontology
Extension(s) .?q?, .qqq, .sq
Wikidata ID Q34745668
Released ca. 1981
Distinct from Squeeze It (SQZ). See the disambiguation section for more similarly-named formats.

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 combined with run-length encoding.

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. Some software for other platforms (e.g. squprt33.ark) appends a .SQ extension instead.

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

Disambiguation

Not to be confused with:

  • Squeeze It (SQZ) - A compression-and-archival format for DOS released around 1992.
  • SQUEEZE (AJP Systems) - A Windows 3.x file compression program and format.
  • Squeez [1] - A compression/archiving application for 32-bit Windows, with internal support for several standard formats. By Sven Ritter and SpeedProject.
  • Squeez, UnSqueez - Terms used for software and technology associated with SQX format, by Sven Ritter and SpeedProject.
  • SQWEZ - Compressed archive format and software for DOS, with an emphasis on self-extracting archives.
  • Vidfern Squeezer - Executable compression software for 32-bit Windows. (Maybe also transparent file compression for Mac?)
  • ARC "squeezed" compression - Related, but distinct

See also

Format details

Note:

  • Multi-byte integers are little-endian.
  • Some Squeeze software limits the length of a Huffman code to at most 16 bits.

File structure

Field Size in bytes Description
signature 2 0x76 0xff
checksum 2 Low 16 bits of the sum of the decompressed byte values.
filename variable Original filename, terminated by a NUL byte. (TODO: Find a specification for this field. Some software interprets it in the same way as Crunch, but that might be overkill.)
compressed data variable See below.
timestamp extension 8 Optional timestamp. See below.

Compressed data section

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. The data should end with 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

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.

Note that this does not distinguish them from CODEC (Telvox).

Specifications

  • See the SQUSQ directory on CP/M archives for various source code and documentation (much of it, unfortunately, itself squeezed/crunched).
  • SQDATE.DOC - Information about the timestamp extension

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
  • squprt33.ark - Portable sq/usq, version "3.3 10/29/86"
  • NSQUSQ.ZIP - Contains NUSQ v1.10 (1984-10-21; By Dave Rand, Paul Homchick and Cliff Sharp) and NSQ v2.01 (1984-10-20; "Originally by Richard Greenlaw") (DOS Software)
  • SQPC131.ZIP - SQPC v1.31 (1986-03-02) and UNSQPC v1.36, by Vernon D. Buerg (DOS Software)
  • The Unarchiver

Sample files

  • OAK CP/M archive → .../*.?q?
  • Found in many LBR files. Note that you may have to tell your LBR utility not to decompress them (e.g. lbrate -n).

References

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox