Partial decompression for rapid file or sub-file access

Embodiments of the present disclosure provide systems and methods for reverse decompression. According to one embodiment of the present disclosure, the method for reverse decompression includes receiving encoded and compressed input data in a form of one or more data blocks and locating an end of block marker for a last block of the one or more data blocks of the input data. The method also includes traversing the input data, bit by bit, in a reverse direction starting from a last bit of the end of block marker of the last block of the one or more data blocks of the input data towards a beginning of the input data, determining if one block of the one or more blocks of the input data can be designated as a valid block, designating the one block as a valid block and decompressing the valid block in a forward direction.

FIELD OF THE DISCLOSURE

Embodiments of the present disclosure relate generally to methods and systems for decompression of files or sub-files and more particularly to methods and systems for partial decompression of files or sub-files using reverse decompression for rapid file access.

BACKGROUND

Data compression is used in processor-based systems to reduce the size of data. Reducing the size of data can reduce memory needs to store a given amount of data as well as reduce the amount of data transfer bandwidth needed for reading data from and writing data to memory. In the field of compression and decompression, the Lempel-Ziv (LZ)-based compression and decompression algorithms are known. LZ-based compression algorithms are lossless data compression techniques that allow the original data to be perfectly reconstructed from the compressed data.

LZ based compression and decompression algorithms use techniques such as backreferences to a dictionary, which is defined by a moving window, as well as an inbuilt dictionary, and literal strings. A compressed file of input data using an LZ-based compression algorithm contains a series of blocks with each block beginning with a block type marker (e.g., a header which contains 2 bits), followed by the content and then an end-of-block marker. The content is formed using one of the three above-identified techniques. For example, when the content is a literal string, the content includes length information and data information. When the content is a backreference to a dictionary or an inbuilt dictionary, reference is made to that dictionary.

During LZ-based decompression, each block is decompressed sequentially and relies on the previously decompressed blocks to provide the moving window dictionary to decompress the remainder of the data. This decompression method has drawbacks in that it requires an entire file to be read which is inefficient when not all of the information from the file is required to perform a particular task. Thus, there is a need for evaluating data in a reverse manner to reduce the total amount of data decompressed when all of the data is not required to complete a task.

BRIEF SUMMARY

Embodiments of the present disclosure provide systems and methods for reverse decompression. According to one embodiment of the present disclosure, the method for reverse decompression includes receiving encoded and compressed input data in a form of one or more data blocks and locating an end of block marker for a last block of the one or more data blocks of the input data. The method also includes traversing the input data, bit by bit, in a reverse direction starting from a last bit of the end of block marker of the last block of the one or more data blocks of the input data towards a beginning of the input data, determining if one block of the one or more blocks of the input data can be designated as a valid block, designating the one block as a valid block and decompressing the valid block in a forward direction.

The method also includes determining, by the processor, that a maximum data block length has been reached after traversing, bit by bit, at least one of the one or more data blocks of the input data, determining, by the processor, if there is at least one prior designated valid block and if there is at least one prior designated valid block, changing, by the processor, a designation about a previous block being a valid block. The previous block is provided before the at least one prior designated valid block in the forward direction.

The method further includes determining, by the processor, that a maximum data block length has been reached after traversing the input data bit by bit, determining, by the processor, if there is at least one prior designated valid block and if there is not at least one prior designated valid block, terminating, by the processor, the method for reverse decompression.

Additionally, if one block of the one or more blocks of the input data cannot be designated as a valid block, the processor continues to traverse the input data, bit by bit, in the reverse direction towards the beginning of the input data. The one or more data blocks includes a literal string, a static dictionary for decompressing data compressed using static Huffman tables and/or a dynamic dictionary for decompressing data compressed using dynamic Huffman tables. Moreover, the reverse decompression is operative in accordance with a Lempel-Ziv type algorithm.

According to another embodiment, a system can comprise a processor and a memory coupled with and readable by the processor. The memory can store therein a set of instructions which, when executed by the processor, causes the processor to reverse decompress encoded and compressed input data by receiving encoded and compressed input data in a form of one or more data blocks, locating an end of block marker for a last block of the one or more data blocks of the input data, traversing the input data, bit by bit, in a reverse direction starting from a last bit of the end of block marker of the last block of the one or more data blocks of the input data towards a beginning of the input data, determining if one block of the one or more blocks of the input data can be designated as a valid block, designating the one block as a valid block and decompressing the valid block in a forward direction.

The system also includes determining, by the processor, that a maximum data block length has been reached after traversing, bit by bit, at least one of the one or more data blocks of the input data, determining, by the processor, if there is at least one prior designated valid block and if there is at least one prior designated valid block, changing, by the processor, a designation about a previous block being a valid block. The previous block is provided before the at least one prior designated valid block in the forward direction.

The system further includes determining, by the processor, that a maximum data block length has been reached after traversing the input data bit by bit, determining, by the processor, if there is at least one prior designated valid block and if there is not at least one prior designated valid block, terminating, by the processor, the method for reverse decompression.

Additionally, if one block of the one or more blocks of the input data cannot be designated as a valid block, the processor continues to traverse the input data, bit by bit, in the reverse direction towards the beginning of the input data. The one or more data blocks includes a literal string, a static dictionary for decompressing data compressed using static Huffman tables and/or a dynamic dictionary for decompressing data compressed using dynamic Huffman tables. Moreover, the reverse decompression is operative in accordance with a Lempel-Ziv type algorithm.

According to yet another embodiment, a non-transitory, computer-readable medium can comprise a set of instructions stored therein which, when executed by a processor, causes the processor to reverse decompress an encoded and compressed input data by receiving encoded and compressed input data in a form of one or more data blocks, locating an end of block marker for a last block of the one or more data blocks of the input data, traversing the input data, bit by bit, in a reverse direction starting from a last bit of the end of block marker of the last block of the one or more data blocks of the input data towards a beginning of the input data, determining if one block of the one or more blocks of the input data can be designated as a valid block, designating the one block as a valid block and decompressing the valid block in a forward direction.

The non-transitory computer-readable medium when executed by the processor also includes determining, by the processor, that a maximum data block length has been reached after traversing, bit by bit, at least one of the one or more data blocks of the input data, determining, by the processor, if there is at least one prior designated valid block and if there is at least one prior designated valid block, changing, by the processor, a designation about a previous block being a valid block. The previous block is provided before the at least one prior designated valid block in the forward direction.

The non-transitory computer-readable medium when executed by the processor further includes determining, by the processor, that a maximum data Hock length has been reached after traversing the input data bit by bit, determining, by the processor, if there is at least one prior designated valid block and if there is not at least one prior designated valid block, terminating, by the processor, the method for reverse decompression.

Additionally, if one block of the one or more blocks of the input data cannot be designated as a valid block, the processor continues to traverse the input data, bit by bit, in the reverse direction towards the beginning of the input data.

DETAILED DESCRIPTION

In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of various embodiments disclosed herein. It will be apparent, however, to one skilled in the art that various embodiments of the present disclosure may be practiced without some of these specific details. The ensuing description provides exemplary embodiments only and is not intended to limit the scope or applicability of the disclosure. Furthermore, to avoid unnecessarily obscuring the present disclosure, the preceding description omits a number of known structures and devices. This omission is not to be construed as a limitation of the scopes of the claims. Rather, the ensuing description of the exemplary embodiments will provide those skilled in the art with an enabling description for implementing an exemplary embodiment. It should however be appreciated that the present disclosure may be practiced in a variety of ways beyond the specific detail set forth herein.

While the exemplary aspects, embodiments, and/or configurations illustrated herein show the various components of the system collocated, certain components of the system can be located remotely, at distant portions of a distributed network, such as a Local-Area Network (LAN) and/or Wide-Area Network (WAN) such as the Internet, or within a dedicated system. Thus, it should be appreciated, that the components of the system can be combined in to one or more devices or collocated on a particular node of a distributed network, such as an analog and/or digital telecommunications network, a packet-switch network, or a circuit-switched network. It will be appreciated from the following description, and for reasons of computational efficiency, that the components of the system can be arranged at any location within a distributed network of components without affecting the operation of the system.

The term “computer-readable medium” as used herein refers to any tangible storage and/or transmission medium that participate in providing instructions to a processor for execution. Such a medium may take many forms, including hut not limited to, non-volatile media, volatile media, and transmission media. Non-volatile media includes, for example, Non-Volatile Random-Access Memory (NVRAM), or magnetic or optical disks. Volatile media includes dynamic memory, such as main memory. Common forms of computer-readable media include, for example, a floppy disk, a flexible disk, hard disk, magnetic tape, or any other magnetic medium, magneto-optical medium, a Compact Disk Read-Only Memory (CD-ROM), any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, a Random-Access Memory (RAM), a Programmable Read-Only Memory (PROM), and Erasable Programmable Read-Only Memory (EPROM), a Flash-EPROM, a solid state medium like a memory card, any other memory chip or cartridge, a carrier wave as described hereinafter, or any other medium from which a computer can read. A digital file attachment to e-mail or other self-contained information archive or set of archives is considered a distribution medium equivalent to a tangible storage medium. When the computer-readable media is configured as a database, it is to be understood that the database may be any type of database, such as relational, hierarchical, object-oriented, and/or the like. Accordingly, the disclosure is considered to include a tangible storage medium or distribution medium and prior art-recognized equivalents and successor media, in which the software implementations of the present disclosure are stored.

The terms “determine,” “calculate,” and “compute,” and variations thereof, as-used herein, are used interchangeably and include any type of methodology, process, mathematical operation or technique.

Various additional details of embodiments of the present disclosure will be described below with reference to the figures. While the flowcharts will be discussed and illustrated in relation to a particular sequence of events, it should be appreciated that changes, additions, and omissions to this sequence can occur without materially affecting the operation of the disclosed embodiments, configuration, and aspects.

According to embodiments of the present disclosure, reverse decompression is disclosed. Reverse decompression requires decompressing input data of a file starting from the end of the file instead of starting from the beginning of the file and working backwards towards the beginning of the file. As discussed in greater detail below, with reverse decompression, the end of a file is known and thus where a block of a plurality of blocks of the input data ends is also known. Each block is traversed in a backwards or reverse direction until a position where the block could begin (e.g., a valid block type marker-header marker, valid data after this until the end of the valid data, and an end of block marker) is determined. The valid data or content is then parsed to potentially uncover backreferences to prior blocks.

If previous blocks (e.g., blocks towards the beginning of the input data) are needed to assist in decompressing the input data, an attempt is made to identify, the location of these previous blocks as it is known where the present block is located, and the previous blocks can be located in a similar manner. If at any point an inconsistency is discovered (e.g., valid data has been incorrectly assumed), the method backtracks to that decision point that led to the inconsistency and another path is taken. According to embodiments of the present disclosure, another path includes selecting a different content type that includes the valid data. The content type includes data having a literal string, data having a static dictionary and data having a dynamic dictionary. Each of these content types has a different format.

The benefits of reverse decompression include only decompressing data of the input data which is necessary for a user to obtain information about a file without having to decompress the entire file. This is beneficial when the most important information about a file is provided at the end of the file instead of at the beginning of the file. According to embodiments of the present disclosure, when file type detection is the main purposed for decompression of data, reverse decompression is beneficial. For example, when reading data at the beginning of a file indicates that data at or near the end of the file is required to obtain a positive match for file type detection, reverse decompression is beneficial since the entire file does not have to be decompressed for verification. As another example, when a document object model (e.g., the bit in the data input that indicates the location of literal strings) is provided at the end of the input data of a file and the initial text of a literal string is stored at the beginning of the file, reverse decompression along with conventional decompression techniques are used to decompress data. from the beginning of the file and the end of the file without decompressing the middle of the file. Again, reverse decompression is beneficial since the entire file does not have to be decompressed.

FIG.1is a block diagram illustrating elements of an exemplary computing environment in which embodiments of the present disclosure may be implemented. More specifically, this example illustrates a computing environment100that may function as the servers, user computers, or other systems provided and described herein. The environment100includes one or more user computers, or computing devices, such as a computing device104, a communication device108, and/or more other computing devices112. The computing devices104,108,112may include general purpose personal computers (including, merely by way of example, personal computers, and/or laptop computers running various versions of Microsoft Corp.'s Windows® and/or Apple Corp.'s Macintosh® operating systems) and/or workstation computers running any of a variety of commercially available UNIX® or UNIX-like operating systems. These computing devices104,108,112may also have any of a variety of applications, including for example, database client and/or server applications, and web browser applications. Alternatively, the computing devices104,108,112may be any other electronic device, such as a thin-client computer, Internet-enabled mobile telephone, and/or personal digital assistant, capable of communicating via a network110and/or displaying and navigating web pages or other types of electronic documents. Although the exemplary computer environment100is shown with two computing devices, any number of user computers or computing devices may be supported.

The environment100also include one or more servers114,116. In this example, server114is shown as a data server and server116is shown as an application server. The data server114, which may be used to process requests for web pages or other electronic documents from computing devices104,108,112. The data server114can be running an operating system including any of those discussed above, as well as any commercially available server operating systems. The data server114can also run a variety of server applications, including SIP servers, HyperText Transfer Protocol (secure) (HTTP(s)) servers, FTP servers, CGI servers, database servers, Java servers, and the like. In some instances, the data server114may publish operations available operations as one or more web services.

The environment100may also include one or more file and or/application servers116, which can, in addition to an operating system, include one or more applications accessible by a client running on one or more of the computing devices104,108,112. The server(s)116and/or114may be one or more general purpose computers capable of executing programs or scripts in response to the computing devices104,108,112. As one example, the server116,114may execute one or more web applications. The web application may be implemented as one or more scripts or programs written in any programming language, such as Java™, C, C#®, or C++, and/or any scripting language, such as Perl, Python, or Tool Command Language (TCL), as well as combinations of any programming/scripting languages. The application server(s)116may also include database servers, including without limitation those commercially available from Oracle®, Microsoft®, Sybase®, IBM® and the like, which can process requests from database clients running on a computing device104,108,112.

Web pages created by the server114and/or116may be forwarded to a computing device104,108,112via a web (file) server114,116. Similarly, the data server114may be able to receive web page requests, web services invocations, and/or input data from a computing device104,108,112(e.g., a user computer, etc.) and can forward the web page requests and/or input data to the web (application) server116. In further embodiments, the server116may function as a file server. Although for ease of description,FIG.1illustrates a separate data server114and file/application server116, those skilled in the art will recognize that the functions described with respect to servers114,116may be performed by a single server and/or a plurality of specialized servers, depending on implementation-specific needs and parameters. The computer systems104,108,112, web (data) server114and/or web (application) server116may function as the system, devices, or components described herein.

The environment100may also include a database118. The database118may reside in a variety of locations. By way of example, database118may reside on a storage medium local to (and/or resident in) one or more of the computers104,108,112,114,116. Alternatively, it may be remote from any or all of the computers104,108,112,114,116, and in communication (e.g., via the network110) with one or more of these. The database118may reside in a Storage-Area Network (SAN) familiar to those skilled in the art. Similarly, any necessary files for performing the functions attributed to the computers104,108,112,114,116may be stored locally on the respective computer and/or remotely, as appropriate. The database118may be a relational database, such as Oracle 20i®, that is adapted to store, update, and retrieve data in response to Structured Query Language (SQL) formatted commands.

The environment100may also include compression/reverse decompression systems120aand120b. As illustrated inFIG.1, compression/reverse decompression systems120aand120bare provided as separate components, but according to an alternative embodiment of the present disclosure, the compression/reverse decompression systems120aand120bmay be provided in two or more of the computers104,108,112,114,116. According to one embodiment of the present disclosure, various scenarios are shown within environment100. In a first scenario, the data server114contains data intended for use by computer104. Data server114sends the data to the compression/reverse decompression system120a.The compression/reverse decompression system120aencodes and compresses the data prior to transmitting the encoded data to the network110. The compression/reverse decompression system120breceives the encoded data from the network110. The compression/reverse decompression system120breverse decodes and decompresses the data and provides the data to the computer104.

Conversely, in a second scenario, the computer104has data that is to be sent to the application server116. The computer104sends the data to the compression/reverse decompression system120b. The compression/reverse decompression system120bencodes and compresses the data prior to it being sent to the network110. The compression/reverse decompression system120areceives the data from the network110. The compression/reverse decompression system120areverse decodes and decompresses the data and provides the data to the application server116.

FIG.2is a block diagram illustrating elements of an exemplary computing device in which embodiments of the present disclosure may be implemented. More specifically, this example illustrates one embodiment of a computer system200upon which the servers, user computers, computing devices, or other systems or components described above may be deployed or executed. The computer system200is shown comprising hardware elements that may be electrically coupled via a bus204. The hardware elements may include one or more Central Processing Units (CPUs)208; one or more input devices212(e.g., a mouse, a keyboard, etc.); and one or more output devices216(e.g., a display device, a printer, etc.). The computer system200may also include one or more storage devices220. By way of example, storage device(s)220may be disk drives, optical storage devices, solid-state storage devices such as a Random-Access Memory (RAM) and/or a Read-Only Memory (ROM), which can be programmable, flash-updateable and/or the like.

The computer system200may additionally include a computer-readable storage media. reader224; a communications system228(e.g., a modem, a network card (wireless or wired), an infra-red communication device, etc.); and working memory236, which may include RAM and ROM devices as described above. The computer system200may also include a processing acceleration unit232, which can include a Digital Signal Processor (DSP), a special-purpose processor, and/or the like. The computer system200may further include a compression/reverse decompression system120.

The computer-readable storage media reader224can further be connected to a computer-readable storage medium, together (and, optionally, in combination with storage device(s)220) comprehensively representing remote, local, fixed, and/or removable storage devices plus storage media for temporarily and/or more permanently containing computer-readable information. The communications system228may permit data to be exchanged with a network and/or any other computer described above with respect to the computer environments described herein. Moreover, as disclosed herein, the term “storage medium” may represent one or more devices for storing data, including ROM, RAM, magnetic RAM, core memory, magnetic disk storage mediums, optical storage mediums, flash memory devices and/or other machine-readable mediums for storing information.

The computer system200may also comprise software elements, shown as being currently located within a working memory236, including an operating system240and/or other code244. It should be appreciated that alternate embodiments of a computer system200may have numerous variations from that described above. For example, customized hardware might also be used and/or particular elements might be implemented in hardware, software (including portable software, such as applets), or both. Further, connection to other computing devices such as network input/output devices may be employed.

The compression/reverse decompression system120includes a compression engine250, a reverse decompression engine254, an input port258, and an output port262. According to an embodiment of the present disclosure, input data may be received by the input port258. The input port258directs the input data, if in a raw uncompressed form, to the compression engine250. Wherein if the input data is encoded and compressed input data, the input port258directs the encoded and compressed input data to the reverse decompression engine254. In a scenario where the input data is aw input data, the input port258provides the raw input data to the compression engine250. The compression engine250encodes and compresses the raw input data in accordance with the LZ-based protocols as discussed in greater detail below. The compression engine250outputs encoded and compressed input data to the output port262which is presented as encoded and compressed output data.

In a scenario where encoded and compressed input data is received as the input data, the input port258receives encoded and compressed input data and provides it to the reverse decompression engine254. The reverse decompression engine254decodes and decompresses the encoded and compressed input data according to the LZ-based protocols in a reverse manner. The reverse decompression engine254first tries to identify valid blocks (e.g., blocks the fit a particular format based on the LZ-based protocols) from the encoded and compressed input data starting from the end of the input data. After successful identification of valid block(s), the reverse decompression engine254decodes and decompresses the encoded and compressed input data starting from the beginning of the identified valid block into a decoded and decompressed input data and provides it to the output port262which is outputted as output data.

FIG.3is a block diagram illustrating an exemplary uncompressed data block300and an exemplary compressed data block330after being compressed using Lempel-ZIV (LZ)-based data compression according to an embodiment of the present disclosure. As illustrated inFIG.3, the LZ-based compression captures a repeated data pattern304R (e.g., AABC) of data304in the input data block300to be compressed. The captured repeated data pattern304R in the input data block300is reduced to a reduced size length and distance block308(e.g., [4, 15]) from the current point that the repeated data pattern304R appeared elsewhere in the input data block300. In this manner, when the output data block330is decompressed, the length and distance block308can be replaced with the true pattern (e.g., AABC) at the distance and length in the output data block330to recreate the uncompressed input data block300.

FIG.4represent a flow diagram of a method400for reverse decompression according to an embodiment of the present disclosure. While a general order of the steps of method400is shown inFIG.4, method400can include more or fewer steps or can arrange the order of the steps differently than those shown inFIG.4. Further, two or more steps may be combined into one step. Generally, method400starts with a START operation at step404and ends with an END operation at step444. Method400can be executed as a set of computer-executable instructions executed by a data-processing system and encoded or stored on a computer readable medium. Hereinafter, method400shall be explained with reference to systems, components, modules, software, data structures, user interfaces, etc. described in conjunction withFIGS.1and2.

Method400may begin at step404and proceed to step408, where the reverse decompression engine254and the processor208receives encoded and compressed input data. According to one embodiment of the present disclosure, the encoded and compressed input data is in the form of transmitted encoded and compressed input data. According to an alternative embodiment of the present disclosure, the encoded and compressed input data is in the form of stored encoded and compressed input data. As illustrated inFIGS.5A-5C, the encoded and compressed input data500a-500cinclude blocks504a-504c,respectively. Although only one block is illustrated for each of the input data500a-500c, more than one block may be included in each of the input data500a-500cwithout departing from the spirit and scope of the present disclosure. Each block504a-504cincludes a header marker508a-508c,content512a-512cand an end of block marker516a-516c,respectively. According to one embodiment of the present disclosure, the header markers508a-508crepresent the compression type for the content512a-512cfor each of the blocks540a-540cand includes two bits. For example, when the content512aincludes a compressed literal string, the header marker is represented by the bits “00”. When the content512bis compressed using static Huffman tables, the header marker is represented by the bits “01”. Furthermore, when the content512cis compressed using dynamic Huffman tables, the header marker is presented by the bits “10”. As illustrated inFIGS.5A-5C, header marker508aindicates the content includes a literal string, header marker508bindicates the content is compressed using static Huffman tables, and header marker508cindicates the content is compressed using dynamic Huffman tables.

Referring back toFIG.4, after receiving the encoded and compressed input data at step408, method400proceeds to step412, where the reverse decompression engine254and processor208traverse encoded and compressed the input data, bit by bit, in a reverse direction starting from a last bit of the end of block marker of the last block of the input data towards the beginning of the input data. This end of block marker identifies the end of the data for each of the blocks. According to one embodiment of the present disclosure, when the encoded and compressed input data is initially sent, the last bit of the end of block marker is easily identified since this is the last bit of data for a block of data. At all other times, it may be assumed that the reverse decompression engine254and processor208are at the end of block marker. According to embodiments of the present disclosure as illustrated inFIGS.6A-6C, the end of block markers616a-616cinclude four bits. For example purposes only, the four bits is represented by the bits “1101.” Although a four-bit marker is illustrated, an end of block marker having more or less than four bits or an end of block marker being different for each type of block604a-604ccan be used without departing from the spirit and scope of the present disclosure.

According to embodiments of the present disclosure as illustrated inFIGS.6A-6C, the letter “P” (at locations601a-601c) indicates the last bit for each of the blocks604a-604c.The reverse decompression engine254and the processor208shift the input data one bit to the left as indicated by the arrow650a-650c.For example, the blocks604a-604care traversed to the left moving from bit “1” to bit “0.” According to embodiments of the present disclosure, the blocks604a-604care traversed to the left, bit by bit, in an attempt to identify a valid block.

After traversing the end of blocks516a-516c,the reverse decompression engine254and the processor208, proceed to the next portion of the input data for each block504a-504cwhich includes the content512a-512c.Referring back toFIGS.5A-5C, the type of content can include one of a literal string, compressed data from a static dictionary and compressed data from a dynamic dictionary and each of these types of content has a different content format as discussed below. For example, as illustrated inFIG.5A, the type of content represented by the literal string includes length information and data information. The length information includes the length (LEN)520of the uncompressed data528, followed by the 1's complement of the length (NLEN)524. The data information includes the data528.

As illustrated inFIG.5B, the type of content represented by compressed data from a static dictionary includes a Huffman code dictionary540(this is for optimal Huffman encoding only), a repeating data block which includes a literal length code544and an optional distance code548). The first repeating symbol in the repeating data block is a literal or length code. If a literal is present, the repeating data block can be followed with another repeating data block. If a length code is present, the length code is followed by the optional distance code548. According to an alternative embodiment of the present disclosure, the type of content represented by compressed data from a static dictionary simply includes the compressed data since the static Huffman tables are known in advance. Therefore, immediately following the header marker508b, is the compressed data itself.

As illustrated inFIG.5C, the type of content represented by compressed data from a dynamic dictionary includes a plurality of repeating data blocks that include literal/distance code560, length code564and optional distance code568which are 9-bit, 2-bit to infinite-bit, and 9-bit to 13-bit, respectively. According to an alternative embodiment of the present disclosure, the repeating data block includes either the literal code560or a distance code568followed by the length code564that may be repeating. According to a further alternative embodiment of the present disclosure, information for recreating the dynamic Huffman tables is compressed and then embedded into the content itself. Accordingly, before decompression of the actual data can commence, the information for creating the dynamic Huffman tables is decompressed and used. to establish the dynamic Huffman tables used to decompress the remainder of the content that contains the actual data. In order to recreate the dynamic Huffman tables used to decode the data, a couple of well-known rules are followed. The length of each code used to encode a character or element of the uncompressed dataset is included in the compressed dataset. This length value is referred to as a “codelength.” Since dynamic Huffman coding compresses the information for creating the dynamic Huffman tables, which in turn contains the information for decompressing the dataset itself, a number of Huffman code information fields are embedded at the beginning of the content. These fields are discussed below. The Huffman code information is immediately followed by the actual data which is followed by the end of block marker516c.

In the case of dynamic Huffman coding, the following information is included within the content immediately following the header marker508c.HLIT indicating the number of length/literal codes less 257; HDIST indicating the number of distance codes less one; HCLEN indicating the number of codelength codes less four (for creating the codelength Huffman table); CLENC indicating the code lengths for each codelength alphabet (of the codelength Huffman table); CLENLL indicating the code lengths for the length/literal alphabet of the Length/Literal Huffman table; CLEND indicating the code lengths for the distance alphabet of the Distance Huffman table. Again it is restated, because the dynamic Huffman encoding compresses the information for creating the dynamic Huffman tables, which in turn are used to decode the actual data, the HCLEN and CLENC: fields contain information for creating the codelength Huffman table, while the CLENLL and CLEND fields contain information for creating the length/literals Huffman table and the Distance Huffman table.

Referring back toFIG.4, after traversing the input data, bit by bit, in a reverse direction starting from a last bit of the end of block marker of the last block of the input data towards a beginning of the input at step412, method400proceeds to decision step416where the reverse decompression engine254and the processor208determine if a maximum length has been reached. If a maximum length has not been reached (NO) at decision step420, method400proceeds to decision step432where the reverse decompression engine254and the processor208determine if the block could be a valid block. According to embodiments of the present disclosure, maximum lengths are determined for each of the blocks504a-504c.These maximum lengths can be the same length, or these lengths can be different lengths.

A block is determined to be a valid block if the block has the correct format and the correct length as discussed in greater detail below. If the block could not be a valid block (NO) at decision step432, method400returns to step412where the reverse decompression engine254and the processor208traverse the input data. If the block could be a valid block (YES) at decision step432, the reverse decompression engine254and the processor208proceed to step436where the block is designated as a valid block. Designating the block as a valid block does not mean the block is actually a valid block. Designating the block as a valid block means that by traversing the block in the reverse direction, the block has the correct format and the correct length to potentially be a valid block.

For example, referring back toFIG.6A, block604acould be considered to be a valid block after traversing the block in the reverse direction and reaching location603a.At location603a,the header marker could be determined to decode the type of content. Also, the value for the length and the complement to the length can be determined. With this information the length of the data could be determined as well as the end of block information. At this point, the block could be decompressed and decoded to determine if the assumptions about the block are correct. On the other hand, if block604ais only traversed in the reverse direction up to location602a(location P-x), an assumption that this is a valid block up to location602awould be incorrect if the header marker indicating the type of content and the other parameters within the content (LEN, NLEN and Data) are not in the correct format and do not have the correct length.

After designating the block as a valid block at step436, method400proceeds to decision step440where the reverse decompression engine254and the processor208determine if this is the end of data. If this is the end of data (YES) at decision step440, method400ends at END operation444. If this is not the end of the data (NO) at decision block440, method400returns to step412where the reverse decompression engine254and the processor208method400returns to step412where the reverse decompression engine254and the processor208traverse the input data.

If a maximum length has been reached (YES) at decision step416, method400proceeds to decision step420where the reverse decompression engine254and the processor208determine if there is at least one designated valid block. According to one embodiment of the present disclosure, the determination of at least one designated valid block indicates the one of the previous blocks has been correctly designated as a valid block. According to embodiments of the present disclosure, this determination can be made by decoding and decompressing the previous block(s). If there is not at least one designated valid block (NO) at decision step420, method400ends at END operation444. If there is at least one designated valid block (YES) at decision step420, method400proceeds to step424where the reverse decompression engine254and the processor208change the designation about the previous block being a valid block and backtrack to this point. After changing the designation about the previous block being a valid block and backtracking to this point at step424, method400returns to step412where the reverse decompression engine254and the processor208traverse the input data.