Katz also designed the original algorithm used to construct Deflate streams. This algorithm was patented as U.S. patent 5,051,745, and assigned to PKWARE, Inc.[4][5] As stated in the RFC document, an algorithm producing Deflate files was widely thought to be implementable in a manner not covered by patents.[3] This led to its widespread use – for example, in gzip compressed files and PNG image files, in addition to the ZIP file format for which Katz originally designed it. The patent has since expired.
Stream format
A Deflate stream consists of a series of blocks. Each block is preceded by a 3-bit header:
First bit: Last-block-in-stream marker:
1: This is the last block in the stream.
0: There are more blocks to process after this one.
Second and third bits: Encoding method used for this block type:
00: A stored (a.k.a. raw or literal) section, between 0 and 65,535 bytes in length
01: A static Huffman compressed block, using a pre-agreed Huffman tree defined in the RFC
10: A dynamic Huffman compressed block, complete with the Huffman table supplied
11: Reserved—don't use.
The stored block option adds minimal overhead and is used for data that is incompressible.
Most compressible data will end up being encoded using method 10, the dynamic Huffman encoding, which produces an optimized Huffman tree customized for each block of data individually. Instructions to generate the necessary Huffman tree immediately follow the block header. The static Huffman option is used for short messages, where the fixed saving gained by omitting the tree outweighs the percentage compression loss due to using a non-optimal (thus, not technically Huffman) code.
Compression is achieved through two steps:
The matching and replacement of duplicate strings with pointers.
Replacing symbols with new, weighted symbols based on the frequency of use.
Within compressed blocks, if a duplicate series of bytes is spotted (a repeated string), then a back-reference is inserted, linking to the previous location of that identical string instead. An encoded match to an earlier string consists of an 8-bit length (3–258 bytes) and a 15-bit distance (1–32,768 bytes) to the beginning of the duplicate. Relative back-references can be made across any number of blocks, as long as the distance appears within the last 32 KiB of uncompressed data decoded (termed the sliding window).
If the distance is less than the length, the duplicate overlaps itself, indicating repetition. For example, a run of 10 identical bytes can be encoded as one byte, followed by a duplicate of length 9, beginning with the previous byte.
Searching the preceding text for duplicate substrings is the most computationally expensive part of the DEFLATE algorithm, and the operation which compression level settings affect.
The second compression stage consists of replacing commonly used symbols with shorter representations and less commonly used symbols with longer representations. The method used is Huffman coding which creates an unprefixed tree of non-overlapping intervals, where the length of each sequence is inversely proportional to the logarithm of the probability of that symbol needing to be encoded. The more likely it is that a symbol has to be encoded, the shorter its bit-sequence will be.
A tree is created, containing space for 288 symbols:
0–255: represent the literal bytes/symbols 0–255.
256: end of block – stop processing if last block, otherwise start processing next block.
257–285: combined with extra-bits, a match length of 3–258 bytes.
286, 287: not used, reserved and illegal but still part of the tree.
A match length code will always be followed by a distance code. Based on the distance code read, further "extra" bits may be read in order to produce the final distance. The distance tree contains space for 32 symbols:
0–3: distances 1–4
4–5: distances 5–8, 1 extra bit
6–7: distances 9–16, 2 extra bits
8–9: distances 17–32, 3 extra bits
...
26–27: distances 8,193–16,384, 12 extra bits
28–29: distances 16,385–32,768, 13 extra bits
30–31: not used, reserved and illegal but still part of the tree.
Note that for the match distance symbols 2–29, the number of extra bits can be calculated as .
The two codes (the 288-symbol length/literal tree and the 32-symbol distance tree) are themselves encoded as canonical Huffman codes by giving the bit length of the code for each symbol. The bit lengths are themselves run-length encoded to produce as compact a representation as possible. As an alternative to including the tree representation, the "static tree" option provides standard fixed Huffman trees. The compressed size using the static trees can be computed using the same statistics (the number of times each symbol appears) as are used to generate the dynamic trees, so it is easy for a compressor to choose whichever is smaller.
Encoder/compressor
During the compression stage, it is the encoder that chooses the amount of time spent looking for matching strings. The zlib/gzip reference implementation allows the user to select from a sliding scale of likely resulting compression-level vs. speed of encoding. Options range from 0 (do not attempt compression, just store uncompressed) to 9 representing the maximum capability of the reference implementation in zlib/gzip.
Other Deflate encoders have been produced, all of which will also produce a compatible bitstream capable of being decompressed by any existing Deflate decoder. Differing implementations will likely produce variations on the final encoded bit-stream produced. The focus with non-zlib versions of an encoder has normally been to produce a more efficiently compressed and smaller encoded stream.
Deflate64/Enhanced Deflate
Deflate64, specified by PKWARE, is a proprietary variant of Deflate. It's fundamentally the same algorithm. What has changed is the increase in dictionary size from 32 KB to 64 KB, an extension of the distance codes to 16 bits so that they may address a range of 64 KB, and the length code, which is extended to 16 bits so that it may define lengths of three to 65,538 bytes.[6] This leads to Deflate64 having a longer compression time, and potentially a slightly higher compression ratio, than Deflate.[7] Several free and/or open source projects support Deflate64, such as 7-Zip,[8] while others, such as zlib, do not, as a result of the proprietary nature of the procedure[9] and the very modest performance increase over Deflate.[10]
Using Deflate in new software
Implementations of Deflate are freely available in many languages. Apps written in C typically use the zlib library (under the permissive zlib License). Apps in Borland Pascal (and compatible languages) can use paszlib. Apps in C++ can take advantage of the improved Deflate library in 7-Zip. Both Java and .NET Framework offer out-of-the-box support for Deflate in their libraries (respectively, java.util.zip and System.IO.Compression). Apps in Ada can use Zip-Ada (pure) or ZLib-Ada.
Encoder implementations
PKZIP: the first implementation, originally done by Phil Katz as part of PKZip
zlib: standard reference implementation adopted in many apps because of its open-source, permissive license. See Zlib § Forks for higher-performance forks.
Crypto++: contains a public-domain implementation in C++ aimed at reducing potential security vulnerabilities. The author, Wei Dai states "This code is less clever, but hopefully more understandable and maintainable [than zlib]".
7-Zip: written by Igor Pavlov in C++, this version is freely licensed and achieves higher compression than zlib at the expense of CPU usage. Has an option to use the DEFLATE64 storage format.
PuTTY 'sshzlib.c': a standalone implementation under the MIT License by Simon Tatham, it has full decoding capability, but only supports static tree only creation
Hyperbac: uses its own proprietary compression library (in C++ and Assembly) with an option to implement the DEFLATE64 storage format
Zopfli: C implementation under the Apache License by Google; achieves higher compression at the expense of CPU usage. ZopfliPNG is a variation of Zopfli for use with PNG files.
libdeflate:[13] a library for fast, whole-buffer DEFLATE-based compression and decompression. Libdeflate is heavily optimized and especially on x86 processors.
AdvanceCOMP uses the higher compression ratio versions of Deflate in 7-Zip, libdeflate, and Zopfli to enable recompression of gzip, PNG, MNG and ZIP files with the possibility of smaller file sizes than zlib is able to achieve at maximum settings.[14]
Hardware encoders
AHA361-PCIX/AHA362-PCIX from Comtech AHAArchived 2006-12-08 at the Wayback Machine. Comtech produced a PCI-X card (PCI-ID: 193f:0001) capable of compressing streams using Deflate at a rate of up to 3.0 Gbit/s (375 MB/s) for incoming uncompressed data. Accompanying the Linux kerneldriver for the AHA361-PCIX is an "ahagzip" utility and customised "mod_deflate_aha" capable of using the hardware compression from Apache. The hardware is based on a XilinxVirtexFPGA and four custom AHA3601 ASICs. The AHA361/AHA362 boards are limited to only handling static Huffman blocks and require software to be modified to add support — the cards were not able to support the full Deflate specification, meaning they could only reliably decode their own output (a stream that did not contain any dynamic Huffman type 2 blocks).
StorCompress 300/MX3 from Indra Networks. This is a range of PCI (PCI-ID: 17b4:0011) or PCI-X cards featuring between one and six compression engines with claimed processing speeds of up to 3.6 Gbit/s (450 MB/s). A version of the cards are available with the separate brand WebEnhance specifically designed for web-serving use rather than SAN or backup use; a PCIe revision, the MX4E is also produced.
AHA363-PCIe/AHA364-PCIe/AHA367-PCIe. In 2008, Comtech started producing two PCIe cards (PCI-ID: 193f:0363/193f:0364) with a new hardware AHA3610 encoder chip. The new chip was designed to be capable of a sustained 2.5 Gbit/s. Using two of these chips, the AHA363-PCIe board can process Deflate at a rate of up to 5.0 Gbit/s (625 MB/s) using the two channels (two compression and two decompression). The AHA364-PCIe variant is an encode-only version of the card designed for out-going load balancers and instead has multiple register sets to allow 32 independent virtual compression channels feeding two physical compression engines. Linux, Microsoft Windows, and OpenSolaris kernel device drivers are available for both of the new cards, along with a modified zlib system library so that dynamically linked applications can automatically use the hardware support without internal modification. The AHA367-PCIe board (PCI-ID: 193f:0367) is similar to the AHA363-PCIe but uses four AHA3610 chips for a sustained compression rate of 10 Gbit/s (1250 MB/s). Unlike the AHA362-PCIX, the decompression engines on the AHA363-PCIe and AHA367-PCIe boards are fully deflate compliant.
Nitrox and Octeon[permanent dead link] processors from Cavium, Inc. contain high-speed hardware deflate and inflate engines compatible with both ZLIB and GZIP with some devices able to handle multiple simultaneous data streams.
ZipAccel-C from CAST Inc. This is a Silicon IP core supporting Deflate, Zlib and Gzip compression. ZipAccel-C can be implemented in ASIC or FPGAs, supports both Dynamic and Static Huffman tables, and can provide throughputs in excess of 100 Gbps. The company offers compression/decompression accelerator board reference designs for Intel FPGA (ZipAccel-RD-INT) and Xilinx FPGAs (ZipAccel-RD-XIL).
Intel Communications Chipset 89xx Series (Cave Creek) for the IntelXeon E5-2600 and E5-2400 Processor Series (Sandy Bridge-EP/EN) supports hardware compression and decompression using QuickAssist Technology. Depending on the chipset, compression and decompression rates of 5 Gbit/s, 10 Gbit/s, or 20 Gbit/s are available.[15]
IBM z15 CPUs incorporate an improved version of the Nest Accelerator Unit (NXU) hardware acceleration from the zEDC Express I/O expansion cards used in z14 systems for hardware Deflate compression and decompression as specified by RFC1951.[16][17]
Beginning with the POWER9 architecture, IBM added hardware support for compressing and decompressing Deflate (as specified by RFC 1951) to the formerly crypto-centric Nest accelerator (NX) core introduced with POWER7+. This support is available to programs running with AIX 7.2 Technology Level 4 Expansion Pack or AIX 7.2 Technology Level 5 Service Pack 2 through the zlibNX library.[18][19]
Decoder/decompressor
Inflate is the decoding process that takes a Deflate bitstream for decompression and correctly produces the original full-size data or file.
Inflate-only implementations
The normal intent with an alternative Inflate implementation is highly optimized decoding speed, or extremely predictable RAM usage for micro-controller embedded systems.
SAMflate, written by Andrew Collier in Z80 assembly language with optional memory paging support for the SAM Coupé, and made available under the BSD/GPL/LGPL/DFSG licenses.
gunzip, written by Laurens Holst in Z80 assembly language for the MSX, licensed under BSD.
inflate.asm, a fast and efficient implementation in M68000 machine language, written by Keir Fraser and released into the Public Domain.
inflate.s7i/gzip.s7i, a pure-Seed7 implementation of Deflate and gzip decompression, by Thomas Mertes. Made available under the GNU LGPL license.
pyflate, a pure-Python stand-alone Deflate (gzip) and bzip2 decoder by Paul Sladen. Written for research/prototyping and made available under the BSD/GPL/LGPL/DFSG licenses.
deflatelua, a pure-Lua implementation of Deflate and gzip/zlib decompression, by David Manura.
inflate a pure-Javascript implementation of Inflate by Chris Dickinson
pako: JavaScript speed-optimized port of zlib. Contains separate build with inflate only.
Hardware decoders
Serial Inflate GPU from BitSim. Hardware implementation of Inflate. Part of BitSim's BADGE (Bitsim Accelerated Display Graphics Engine) controller offering for embedded systems.
ZipAccel-D from CAST Inc. This is a Silicon IP core supporting decompression of Deflate, Zlib and Gzip files. The ZipAccel-D IP core that can be implemented in ASIC or FPGAs. The company offers compression/decompression accelerator board reference designs for Intel FPGA (ZipAccel-RD-INT) and Xilinx FPGAs (ZipAccel-RD-XIL).
IBM z15 CPUs incorporate an improved version of the Nest Accelerator Unit (NXU) hardware acceleration from the zEDC Express I/O expansion cards used in z14 systems for hardware Deflate compression and decompression as specified by RFC1951.[16][17]
Beginning with the POWER9 architecture, IBM added hardware support for compressing and decompressing Deflate (as specified by RFC 1951) to the formerly crypto-centric Nest accelerator (NX) core introduced with POWER7+. This support is available to programs running with AIX 7.2 Technology Level 4 Expansion Pack or AIX 7.2 Technology Level 5 Service Pack 2 through the zlibNX library.[18][19]
^The Go Authors. "flate package - compress/flate - Go Packages". The Go Programming Language. Google. Retrieved 5 September 2023. Package flate implements the DEFLATE compressed data format, described in RFC issue 1951.
Royal Pump Rooms and Baths, sebuah rumah boneka di Royal Leamington Spa Leamington Spa (nama lengkap Royal Leamington Spa atau hanya Leamington dengarkanⓘ) ialah sebuah kota di Warwickshire, Inggris. Pada tahun 2001 kota ini berpenduduk 45.300 jiwa. Hingga tahun 1784 tempat ini masih berupa desa. Pada tahun inilah 2 penduduk setempat bernama Benjamin Satchwell dan William Abbotts menemukan sumber mata air di desa ini. Kedua lelaki ini dan kawan-kawannya dari kota, mulai menggunakan air itu ...
Juan Carlos Olaria Información personalNacimiento 6 de abril de 1942 (81 años)Zaragoza, España Nacionalidad EspañolaInformación profesionalOcupación Director, guionistaSeudónimo John Meison, Frederic Juyols[editar datos en Wikidata] Juan Carlos Olaria Puyoles (Zaragoza, 6 de abril de 1942) es un director de cine y guionista español. En 1976 rodó la película de ciencia ficción El hombre perseguido por un O.V.N.I.. protagonizada por Richard Kolin, Lynn Endersson, Juan ...
Provinz Santa ElenaProvincia de Santa Elena Flagge Wappen Lage Lage in EcuadorDie Provinz Santa Elena in Ecuador Koordinaten 2° 7′ S, 80° 35′ W-2.1166666666667-80.583333333333Koordinaten: 2° 7′ S, 80° 35′ W Basisdaten Hauptstadt Santa Elena Eingerichtet 7. November 2007 Gliederung 3 Kantone Einwohnerzahl 385.735 (2022)[1] – Anteil an Ecuador ca. 2,3 % Fläche 3.690 km² (2010)[2] – Anteil an Ecuador ca. 1,4 % Be...
Selada IsraelNama lainSelada Palestina, Selada ArabJenisSeladaBahan utamaTomat, mentimun, bawang bombay, pterseli, paprika atau cabai)Variasidaun bawang, radish, wortel, kubis, mint Media: Selada Israel Selada Israel (Ibrani: סָלָט יְרָקוֹת יִשְׂרְאֵלִי, salat yerakot yisraeli, selada sayur Israel, yang juga dikenal sebagai selada Palestina atau selada Arab) adalah sebuah selada yang terdiri dari potongan tomat, mentimun, bawang bombay, dan paprika atau ...
العلاقات البوسنية النيجرية البوسنة والهرسك النيجر البوسنة والهرسك النيجر تعديل مصدري - تعديل العلاقات البوسنية النيجرية هي العلاقات الثنائية التي تجمع بين البوسنة والهرسك والنيجر.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية...
Prohibits the U.S. Congress from prohibiting freedom of religion Constitutional lawof the United States Overview Articles Amendments History Judicial review Principles Separation of powers Individual rights Rule of law Federalism Republicanism Equal footing Strict scrutiny Government structure Legislative branch Executive branch Judicial branch State government Local government Individual rights Freedom of religion Freedom of speech Freedom of the press Freedom of assembly Right to petition F...
Tulang ramalan Dinasti Shang Tulang ramalan (Hanzi: 甲骨; Pinyin: jiǎgǔpiàn) adalah kepingan tulang atau cangkang kura-kura yang dipanaskan dan dipecahkan dengan menggunakan tongkat perunggu, sewaktu peramalan, terutama pada akhir Dinasti Shang, dan umumnya diukir dengan tulisan. Tulang ramalan adalah peninggalan aksara Tionghoa kuno tertua yang diketahui dan mengandung informasi sejarah penting seperti genealogi lengkap Dinasti Shang. Catatan-catatan ini membuktikan adanya dinas...
This article is an orphan, as no other articles link to it. Please introduce links to this page from related articles; try the Find link tool for suggestions. (November 2016) In mathematics, topological recursion is a recursive definition of invariants of spectral curves. It has applications in enumerative geometry, random matrix theory, mathematical physics, string theory, knot theory. Introduction The topological recursion is a construction in algebraic geometry.[1] It takes as init...
Title in the Peerage of Scotland For the boxing rules, see Marquess of Queensberry Rules. Marquessate of QueensberryArms: Quarterly: 1st & 4th, Argent, a Human's Heart Gules, imperially crowned Or, on a Chief Azure, three Mullets of the field (for Douglas); 2nd & 3rd, Azure, a bend between six Crosses-Crosslet fitchée Or (for Mar); all within a Bordure Or, charged with a Double Tressure flory counterflory Gules (for Scotland). Crest: A Human Heart Gules, imperially crowned proper, wi...
Shopping mall in Dongguan, China South China Mall 华南MallLocationDongguan, ChinaOpening date2005OwnerFounder GroupTotal retail floor area659,611 m2 (7.1 million sq ft) South China Mall (Chinese: 华南Mall; pinyin: Huá nán) in Dongguan, China (formerly New South China Mall) is the third largest shopping mall in the world in both gross leasable area and total area. South China Mall opened in 2005 and for more than 10 years it was mostly vacant as few merchants ...
The Downfall of Capitalism and Communism Second edition (1990)AuthorRavi BatraOriginal titleThe Downfall of Capitalism and CommunismA New Study of HistoryCountryUnited StatesLanguageEnglishSubjectSocio-political evolutionPublishedMay 1978 Venus Books (1st Ed.)January 1990 Macmillan Publishers (2nd Ed.)Media typePrint (Hardback)Pages350 (1990)ISBN0-333-21645-8 (1st Ed.)0-939352-09-5 (2nd Ed.) The Downfall of Capitalism and Communism is a book by Ravi Batra in the field of historical ...
Football clubCloppenburgFull nameBallspielverein Cloppenburg e.V. von 1919Founded2008; 15 years ago (2008)GroundStadion an der Friesoyther Strasse, CloppenburgCapacity5,000ChairmanJörg-Uwe KlützManagerTanja SchulteLeague2. Bundesliga2020–2110th (relegated)WebsiteClub website Home colours Away colours BV Cloppenburg Frauen is a German women's football team. It represents BV Cloppenburg. The team has its origins in Regionalliga side SV Höltinghausen, which was absorbed by...
1957 film by Joseph Kane The Lawless EightiesTheatrical release posterDirected byJoseph KaneScreenplay byKenneth GametProduced byRudy RalstonStarringBuster CrabbeJohn SmithMarilyn SarisTed de CorsiaAnthony CarusoJohn DoucetteCinematographyJack A. MartaEdited byJoseph HarrisonMusic byJerry RobertsProductioncompanyVentura Pictures CorporationDistributed byRepublic PicturesRelease date May 31, 1957 (1957-05-31) Running time70 minutesCountryUnited StatesLanguageEnglish The Lawless ...
1992 personal computer A1200 redirects here. For the Motorola mobile phone, see Motorola MING A1200i. Amiga 1200ManufacturerCommodore International, Amiga Technologies GmbHTypePersonal computerRelease date21 October 1992; 31 years ago (1992-10-21)Discontinued1996Units sold95,500 units in Germany[1]Operating systemAmigaOS 3.0/3.1CPUMotorola 68EC020 @ 14 MHzMemory2 MBPredecessorAmiga 500, Amiga 500 PlusRelatedAmiga 600 The Amiga 1200, or A1200 (code-named Channel ...
العلاقات الآيسلندية الهندية آيسلندا الهند آيسلندا الهند تعديل مصدري - تعديل العلاقات الآيسلندية الهندية هي العلاقات الثنائية التي تجمع بين آيسلندا والهند.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدولتين: وجه المقارنة آي...
National personification of Serbia For other uses, see Serbia (disambiguation). Mother Serbia and son Serb, a 19th-century lithography Mother Serbia (Serbian: Мајка Србија / Majka Srbija, Србија мати / Srbija mati; ), Serb Mother (Serbian: Српска мајка / Srpska majka) or Mother of All Serbs[1] (Serbian: Мајка свих Срба / Majka svih Srba), is a female national personification of Serbia, which is the nation-state of Serbs. The nation of Serbi...
Para otros usos de este término, véase Castrillón (desambiguación). Castrillón concejoBanderaEscudo Casa consistorial CastrillónUbicación de Castrillón en España. CastrillónUbicación de Castrillón en Asturias. Mapa interactivo — CastrillónPaís España• Com. autónoma Asturias• Provincia Asturias• Comarca Avilés• Partido judicial Avilés[1]• Capital Piedras BlancasUbicación 43°32′45...
Yondu Michael Rooker personificado como Yondu en la Comic-Con de San Diego 2016Primera aparición Marvel Super-Heroes (vol. 1) #18 (enero de 1969) Marvel ComicsCreado por Gene ColanArnold DrakeInterpretado por Michael Rooker (2014-2023)Doblador en España Carlos Ysbert (2014-2023)Información personalEstatus actual FallecidoNombre de nacimiento Yondu UdontaEdad 64Características físicasRaza CenturianoSexo masculinoInformación profesionalEspecialidad Experto arquero, relación empática con...