.CSO

Last updated
Compressed ISO
Filename extension
.cso
Internet media type
application/x-compressed-iso
Magic number 'CISO'
Developed byBooster
Type of format Disk image
Container for ISO images

.CSO is a compression method for the ISO image format. It is used to compress dumped PlayStation Portable UMD games, and is an alternative to the .DAX compression method. It is also sometimes called "CISO".

Contents

It was the first compression method for ISO. It was created so that more memory space can be saved. Booster created the first code; it was later optimized for better compression. Other formats tried to replace it by fixing up certain issues such as lag in games, such as .DAX and .JSO. However at the time, the popular application homebrew "DevHook" used CSO. .DAX needed another loader, and .JSO was basically unused.

CSO uses Deflate compression with nine levels of presets, usually with 2 KiB blocks handled individually (they could be uncompressed). While the highest levels of compression can introduce slowdown and lengthy load-times in software which relies heavily on disc streaming, even the lower levels are capable of substantial compression. [1] This is partially due to the data layout of a UMD, though more frequently due to the use of Dummy Files as both an anti-piracy tool and a means to more optimally lay the data out physically on the disc.

In addition to being used for compressing PlayStation Portable UMD games, the PSP port of PicoDrive supports compressed Sega Mega-CD disc images in the CSO format. [2]

Other formats

CSO are known to have received later extensions in the form of CSO "v2" and ZSO ("ZISO"), using LZ4 compression for faster decompression.

DAX is a competing format, it uses 8 KiB blocks which aims to increase the data compression ratio, and it also allows uncompressed areas just like CSO. JSO ("JISO") was another now unpopular competing format that was overall similar to CSO, with the difference of added option for LZO compression and a block size tweakable in the official compressor. While CSO allows a tweakable block size, the official compressor does not allow changing it.

File structure

The file format consists of a 24-byte header, an index table, and data blocks. Little-endian is assumed for fields larger than a byte, following the architecture endianness of PlayStation Portable.

Offset (bytes)NameSize (bytes)Purpose
0x0Magic4Always CISO, or 0x4F534943 when read as a 32-bit integer. This field is used to identify a CSO file. Note that this field can be different for the other derivatives of CSO, for example ZSO used the magic code ZISO.
0x4Header size4For the original CSO "v1" file format, this field is ignored and therefore not required to be accurate. However, the "v2" and ZSO format require this field to always be 0x18 (24 bytes).
0x8Uncompressed size8The size of the original uncompressed ISO in bytes.
0x10Block size4The size of each data block in bytes before compression. Usually 2048 bytes, same as the size of each ISO 9660 sector.
0x14Version1The version of the file format in use. For the "v1" format, the value can be either 0 or 1. For the "v2" format, this must be 2. Additionally, the ZSO format requires this to be 1.
0x15Index alignment1The alignment of each index entry, specified in bits.
0x16Reserved2This field is unused. In the "v1" format, this field is ignored and may contain arbitrary values. In the "v2" format, this field must be zero.

Index table

The index table consists of multiple 4-byte entries, which indicate the position of each data block within the file. There is an additional, last entry which points to the end of file. The number of entries in the table can be calculated using the formula: .

The content of each entry is as follows:

BitLengthMaskNamePurpose
0310x7FFFFFFFPositionThis field, when shifted left by the index alignment given in the header, gives off the position where the data block starts.
3110x80000000Compression typeIn CSO "v1" format, the meaning of the field is as follows:
Value Compression method
0 Deflate is used.
1 The block is uncompressed.

The ZSO format has similar semantics, only that 0 represents LZ4 instead of Deflate.

In the "v2" format, the meaning of the field is as follows:

Value Compression method
0 Deflate is used.
1 LZ4 is used.

The block is implicitly considered to be uncompressed if the block size is equal to or larger than the block size specified in the file header.

Data blocks

Each data block contains uncompressed or compressed data. The actual size of each block is calculated by taking its position, and then subtracting it from the position of the following block. If the index alignment is greater than zero, it is possible that the block size is larger than the data it holds, necessitating the use of padding.

Related Research Articles

An audio file format is a file format for storing digital audio data on a computer system. The bit layout of the audio data is called the audio coding format and can be uncompressed, or compressed to reduce the file size, often using lossy compression. The data can be a raw bitstream in an audio coding format, but it is usually embedded in a container format or an audio data format with defined storage layer.

<span class="mw-page-title-main">PNG</span> Family of lossless compression file formats for image files

Portable Network Graphics is a raster-graphics file format that supports lossless data compression. PNG was developed as an improved, non-patented replacement for Graphics Interchange Format (GIF)—unofficially, the initials PNG stood for the recursive acronym "PNG's not GIF".

PCX, standing for PiCture eXchange, was an image file format developed by the now-defunct ZSoft Corporation of Marietta, Georgia, United States. It was the native file format for PC Paintbrush and became one of the first widely accepted DOS imaging standards, although it has since been succeeded by more sophisticated image formats, such as BMP, JPEG, and PNG. PCX files commonly stored palette-indexed images ranging from 2 or 4 colors to 16 and 256 colors, although the format has been extended to record true-color (24-bit) images as well.

bzip2 File compression software

bzip2 is a free and open-source file compression program that uses the Burrows–Wheeler algorithm. It only compresses single files and is not a file archiver. It relies on separate external utilities for tasks such as handling multiple files, encryption, and archive-splitting.

Audio Interchange File Format (AIFF) is an audio file format standard used for storing sound data for personal computers and other electronic audio devices. The format was developed by Apple Inc. in 1988 based on Electronic Arts' Interchange File Format and is most commonly used on Apple Macintosh computer systems.

Tag Image File Format, abbreviated TIFF or TIF, is an image file format for storing raster graphics images, popular among graphic artists, the publishing industry, and photographers. TIFF is widely supported by scanning, faxing, word processing, optical character recognition, image manipulation, desktop publishing, and page-layout applications. The format was created by the Aldus Corporation for use in desktop publishing. It published the latest version 6.0 in 1992, subsequently updated with an Adobe Systems copyright after the latter acquired Aldus in 1994. Several Aldus or Adobe technical notes have been published with minor extensions to the format, and several specifications have been based on TIFF 6.0, including TIFF/EP, TIFF/IT, TIFF-F and TIFF-FX.

In computing, tar is a computer software utility for collecting many files into one archive file, often referred to as a tarball, for distribution or backup purposes. The name is derived from "tape archive", as it was originally developed to write data to sequential I/O devices with no file system of their own. The archive data sets created by tar contain various file system parameters, such as name, timestamps, ownership, file-access permissions, and directory organization. POSIX abandoned tar in favor of pax, yet tar sees continued widespread use.

ZIP is an archive file format that supports lossless data compression. A ZIP file may contain one or more files or directories that may have been compressed. The ZIP file format permits a number of compression algorithms, though DEFLATE is the most common. This format was originally created in 1989 and was first implemented in PKWARE, Inc.'s PKZIP utility, as a replacement for the previous ARC compression format by Thom Henderson. The ZIP format was then quickly supported by many software utilities other than PKZIP. Microsoft has included built-in ZIP support in versions of Microsoft Windows since 1998 via the "Plus! 98" addon for Windows 98. Native support was added as of the year 2000 in Windows ME. Apple has included built-in ZIP support in Mac OS X 10.3 and later. Most free operating systems have built in support for ZIP in similar manners to Windows and Mac OS X.

The BMP file format or bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device, especially on Microsoft Windows and OS/2 operating systems.

The Lempel–Ziv–Markov chain algorithm (LZMA) is an algorithm used to perform lossless data compression. It has been under development since either 1996 or 1998 by Igor Pavlov and was first used in the 7z format of the 7-Zip archiver. This algorithm uses a dictionary compression scheme somewhat similar to the LZ77 algorithm published by Abraham Lempel and Jacob Ziv in 1977 and features a high compression ratio and a variable compression-dictionary size, while still maintaining decompression speed similar to other commonly used compression algorithms.

<span class="mw-page-title-main">Smacker video</span> Digital video file format

Smacker video is a video file format developed by RAD Game Tools, and primarily used for full-motion video in video games. Smacker uses an adaptive 8-bit RGB palette. RAD's format for video at higher color depths is Bink Video. The Smacker format specifies a container format, a video compression format, and an audio compression format. Since its release in 1994, Smacker has been used in over 2300 games. Blizzard used this format for the cinematic videos seen in its games Warcraft II, StarCraft and Diablo I.

<span class="mw-page-title-main">Universal Media Disc</span> Optical disc medium for PlayStation Portable

The Universal Media Disc (UMD) is a discontinued optical disc medium developed by Sony for use on its PlayStation Portable handheld gaming and multimedia platform. It can hold up to 1.8 gigabytes of data and is capable of storing video games, feature-length films, and music. UMD was the trademark of Sony Computer Entertainment for their optical disk cartridge (ODC).

Executable compression is any means of compressing an executable file and combining the compressed data with decompression code into a single executable. When this compressed executable is executed, the decompression code recreates the original code from the compressed code before executing it. In most cases this happens transparently so the compressed executable can be used in exactly the same way as the original. Executable compressors are often referred to as "runtime packers", "software packers", "software protectors".

Snappy is a fast data compression and decompression library written in C++ by Google based on ideas from LZ77 and open-sourced in 2011. It does not aim for maximum compression, or compatibility with any other compression library; instead, it aims for very high speeds and reasonable compression. Compression speed is 250 MB/s and decompression speed is 500 MB/s using a single core of a circa 2011 "Westmere" 2.26 GHz Core i7 processor running in 64-bit mode. The compression ratio is 20–100% lower than gzip.

An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be compressed or uncompressed. If the data is compressed, it may be done so using lossy compression or lossless compression. For graphic design applications, vector formats are often used. Some image file formats support transparency.

The Calgary corpus is a collection of text and binary data files, commonly used for comparing data compression algorithms. It was created by Ian Witten, Tim Bell and John Cleary from the University of Calgary in 1987 and was commonly used in the 1990s. In 1997 it was replaced by the Canterbury corpus, based on concerns about how representative the Calgary corpus was, but the Calgary corpus still exists for comparison and is still useful for its originally intended purpose.

An NRG file is a proprietary optical disc image file format originally created by Nero AG for the Nero Burning ROM utility. It is used to store disc images. Other than Nero Burning ROM, however, a variety of software titles can use these image files. For example, Alcohol 120%, or Daemon Tools can mount NRG files onto virtual drives for reading.

In computing, a bitmap is a mapping from some domain to bits. It is also called a bit array or bitmap index.

ZPAQ is an open source command line archiver for Windows and Linux. It uses a journaling or append-only format which can be rolled back to an earlier state to retrieve older versions of files and directories. It supports fast incremental update by adding only files whose last-modified date has changed since the previous update. It compresses using deduplication and several algorithms depending on the data type and the selected compression level. To preserve forward and backward compatibility between versions as the compression algorithm is improved, it stores the decompression algorithm in the archive. The ZPAQ source code includes a public domain API, libzpaq, which provides compression and decompression services to C++ applications. The format is believed to be unencumbered by patents.

Compact File Set (CFS) is an open archive file format and software distribution container file format.

References

  1. "CSO compression". Archived from the original on 23 February 2008. Retrieved 2008-02-28.
  2. "PicoDrive for PSP v1.35b - bugfixes and major feature added". Archived from the original on 2007-12-12. Retrieved 2007-12-11.