Pattern-based image data compression
By dividing image data blocks into sub-blocks and encoding them based on patterns, the problems of high memory bandwidth requirements and high power consumption in graphics processing units are solved, achieving more efficient image data compression and decompression, which is suitable for mobile/embedded devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- IMAGINATION TECH LTD
- Filing Date
- 2021-03-26
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies for compressing image data in graphics processing units suffer from problems such as high memory bandwidth requirements, high power consumption, and low random access efficiency. Especially on mobile/embedded devices, existing methods struggle to efficiently compress and decompress small blocks of image data.
A pattern-based compression method is adopted to divide the two-dimensional image element value block into multiple sub-blocks. The image data is compressed by identifying the pattern and encoding the image element values of the sub-blocks. The pattern information and sub-block matching relationship are used for encoding, which reduces the memory bandwidth requirements and power consumption.
It effectively reduces memory bandwidth requirements and power consumption, while improving the random access efficiency of image data, making it particularly suitable for low-budget graphics processing units.
Smart Images

Figure CN113473121B_ABST
Abstract
Description
Technical Field
[0001] This application relates to a method and compression unit for compressing image data, which is, for example, but not limited to, pixel data. Background Technology
[0002] Data compression, whether lossless or lossy, is desirable in many applications that store and / or retrieve data from memory. By compressing data before storing it in memory, the amount of data transferred to memory can be reduced. An example of data for which data compression is particularly useful is image data. The term "image data" is used herein to refer to two-dimensional data having values corresponding to each pixel or sample location in an image generated as part of a rasterization process on a graphics processing unit (GPU). Image data includes, but is not limited to: depth data stored in a depth buffer, pixel data (e.g., color data) stored in a frame buffer, texture data stored in a texture buffer, and surface normal data stored in a surface normal buffer. These buffers can be any suitable type of memory, such as cache memory, a separate memory subsystem, a storage region in a shared memory system, or some combination thereof.
[0003] GPUs can be used to process data to generate image data. For example, a GPU can determine the pixel values (e.g., color values) of an image stored in a frame buffer, which can then be output to a display. GPUs typically have a highly parallelized architecture for processing large blocks of data in parallel. There is significant commercial pressure to run GPUs (especially those intended for mobile / embedded devices) at low power levels. Conversely, there is a desire to use higher-quality rendering algorithms on fast GPUs, which puts pressure on relatively limited resources (memory bandwidth). However, increasing the bandwidth of the memory subsystem may not be an attractive solution, as moving data in and out of the GPU, and even within the GPU itself, consumes a significant portion of the GPU's power budget. The same problem may exist for both the central processing unit (CPU) and the GPU.
[0004] Figure 1An example graphics rendering system 100 is shown that can be implemented in an electronic device such as a mobile / embedded device. The graphics rendering system 100 includes a host CPU 102, a GPU 104, memory 106 (e.g., graphics memory), and a display 108. The CPU 102 is configured to communicate with the GPU 104. Data, which may be compressed data, can be transferred between the GPU 104 and the memory 106 in either direction. Images rendered by the GPU 104 (e.g., pixel data) can be stored in the memory 106 and displayed on the display 108 via a display interface 116.
[0005] GPU 104 includes a rendering unit 110, a compression / decompression unit 112, and a memory interface 114. The graphics rendering system 100 is arranged such that data can be transferred in either direction between (i) CPU 102 and rendering unit 110; (ii) CPU 102 and memory interface 114; (iii) memory interface 114 and memory 106; (iv) rendering unit 110 and compression / decompression unit 112; (v) compression / decompression unit 112 and memory interface 114; and (vi) memory 106 and display interface 116. In some examples, the graphics rendering system 100 may be further arranged such that data can be transferred round trip between compression / decompression unit 112 and display interface 116, and that data can be transferred from display interface 116 to display 108.
[0006] In operation, GPU 104 processes regions of image data one by one. Each region may, for example, represent a rectangular (including square) portion of the rendering space (i.e., a two-dimensional space representing, for example, an area of the image to be rendered). Rendering unit 110 may perform scan transformations and rasterization of graphics primitives (e.g., but not limited to, triangles and lines) using known techniques such as Z-testing and texture mapping. Rendering unit 110 may include a cache unit to reduce memory traffic. Some data is read from or written to memory 106 by rendering unit 110 via memory interface 114 (which may include a cache), but for other data, such as data to be stored in a buffer (e.g., a frame buffer), data is preferably transferred from rendering unit 110 to memory interface 114 via compression / decompression unit 112. Compression / decompression unit 112 reduces the amount of data to be transferred to memory 106 via an external memory bus by compressing the data.
[0007] Display interface 116 sends data defining the complete image to display 108. The uncompressed image can be accessed directly from memory 106. Compressed data can be decompressed via compression / decompression unit 112 and sent to display 108 as uncompressed data. In an alternative example, compressed data can be read directly by display interface 116, and display interface 116 may include logic for decompressing compressed data in a manner equivalent to decompression by compression / decompression unit 112. Although shown as a single entity, compression / decompression unit 112 may comprise multiple parallel compression and / or decompression units for performance enhancement.
[0008] As those skilled in the art will recognize, rendering unit 110 may generate color values (e.g., RGB or RGBA color values) for each pixel in the rendering space and store these color values in a frame buffer. The collection of color values for a frame may be referred to herein as color data, image data, frame buffer data, or simply frame data. Rendering unit 110 may also generate other image data, such as depth data, surface normal data, lighting data, etc., and may store those image data values in one or more buffers in memory 106. In some cases, these buffers may be referred to as frame buffers, while in other cases, the term "frame buffer" may be reserved for a buffer that stores color values or data to be sent to the display.
[0009] In some graphics rendering systems, image data values stored in a buffer for a specific rendering can be used by the rendering unit 110 to render one or more subsequent frames. For example, color values generated in a single rendering can be used as texture values when rendering one or more subsequent frames, and surface normal values generated for a geometric model in a single rendering can be used to apply lighting effects to the same model during the rendering of one or more subsequent frames.
[0010] Since image data (e.g., color data) can be quite large, the memory bandwidth associated with writing image data to and reading image data from the buffer in memory can be a significant portion of the total memory bandwidth of the graphics processing system and / or the GPU. Therefore, image data is typically compressed by compression / decompression unit 112 before being stored in the buffer and decompressed by compression / decompression unit 112 after being read from the buffer. Because image data typically includes color data, compression methods can be designed to suit the specific characteristics of the color data. In other examples, compression methods can be designed for different characteristics of depth data or surface normal data.
[0011] Known lossless methods for compressing color data, such as those described in the applicant's UK patents 2451911, 2530312 and 2530311, are configured to divide the color data into blocks and compress each block individually in a manner that requires decompression of the entire block together. For example, in these compression methods, the color values of an 8x8 pixel block can be compressed together. Then, in order to access any specific color value in that block, the entire compressed 8x8 pixel block must be decompressed.
[0012] However, rendering unit 110 typically does not need all the data (e.g., color values) in a block to render subsequent frames. For example, rendering unit 110 may only need color values in the block that relate to a few pixels. Therefore, having to decompress the entire block just to access a small number of color values in the block may make it inefficient for rendering unit 110 to access color data in the frame buffer.
[0013] An attempt has been made to address this issue by caching decompressed blocks, but in many cases, having a cache does not significantly improve the efficiency of accessing data (e.g., color values) in the frame buffer.
[0014] The embodiments described below are provided by way of example only and do not constitute a limitation on the implementation methods that address any or all of the drawbacks of known image data compression and / or decompression methods. Summary of the Invention
[0015] This summary is provided to introduce some concepts that are further described in the following detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter.
[0016] This document describes a method and compression unit for compressing a two-dimensional image element value block. The method includes: dividing the two-dimensional image element value block into a plurality of image element value sub-blocks; identifying which of a plurality of patterns is formed by the image element values of a first sub-block among the plurality of sub-blocks; and forming a compressed image element value block by encoding the first sub-block in the compressed image element value block using: (i) information identifying the pattern, and (ii) the image element values of the first sub-block forming the pattern.
[0017] A first aspect provides a method for compressing a two-dimensional image element value block, the method comprising: dividing the two-dimensional image element value block into a plurality of image element value sub-blocks; identifying which of a plurality of patterns is formed by the image element values of a first sub-block among the plurality of sub-blocks; and forming a compressed image element value block by encoding the first sub-block of the compressed image element value block using: (i) information identifying the pattern, and (ii) the image element values of the first sub-block forming the pattern.
[0018] The method may further include: identifying which of the plurality of patterns is formed by the image element values of another sub-block among the plurality of sub-blocks; and encoding the other sub-block in the compressed image element value block using: (i) information identifying the pattern of the other sub-block, and (ii) the image element values of the other sub-block that form the pattern of the other sub-block.
[0019] The method may further include: determining whether a second sub-block among the plurality of sub-blocks matches a first sub-block; and in response to determining that the second sub-block matches the first sub-block, encoding the second sub-block in the compressed image element value block using information indicating that the second sub-block matches the first sub-block.
[0020] Multiple sub-blocks can be sorted, and a decision can be made if the second sub-block immediately follows the first sub-block in the order.
[0021] Multiple sub-blocks can be sorted, and determination can be performed if the first and second sub-blocks are separated by individual sub-blocks in the order.
[0022] The method may further include: determining whether each sub-block in one or more sub-block sets matches the first sub-block, the one or more sub-blocks in the sets having one or more predetermined relationships with the first sub-block; and in response to determining that each sub-block in the one or more sub-block sets matches the first sub-block, encoding each sub-block in the one or more sub-block sets of the compressed image element value block using information identifying that the sub-block belongs to a sub-block set that matches the first sub-block.
[0023] If the set of sub-blocks and the first sub-block form a row of sub-blocks, then the set of sub-blocks and the first sub-block have a predetermined relationship.
[0024] If the set of sub-blocks and the first sub-block form a sub-block column, then the set of sub-blocks and the first sub-block have a predetermined relationship.
[0025] If the set of sub-blocks and the first sub-block form a block of AxB sub-blocks, where A and B are integers greater than or equal to one, then the set of sub-blocks and the first sub-block have a predetermined relationship.
[0026] The method may further include determining, from a mask, a set of one or more sub-blocks that have one or more predetermined relationships with the first sub-block.
[0027] Forming a compressed image element value block may include forming a header for the compressed image element value block, wherein the header includes information identifying the pattern formed by the image element values of the first sub-block.
[0028] Forming a compressed image element value block may include a body that forms the compressed image element value block, wherein the body includes the image element values of a first sub-block that forms the pattern.
[0029] Each of the multiple patterns can define the number of image element values in the defined sub-block and the position of the image element values.
[0030] Each image element value can be a color value.
[0031] Each image element value can be a compressed value representing a color value.
[0032] Each compressed value may include sub-values for each of the multiple color channels.
[0033] A two-dimensional image element value block may include image element values generated by a rasterization process on a graphics processing unit.
[0034] Each sub-block may include N x M blocks of image element values, where N and M are integers greater than or equal to one.
[0035] N and M can be equal to two.
[0036] The method may further include storing compressed image element value blocks in a memory.
[0037] Multiple patterns may not include all possible patterns of image element values in a sub-block. In other words, multiple patterns may include fewer patterns than all possible patterns of image element values in a sub-block. A compressed image element value block may include an encoding format field for each of the multiple sub-blocks. Each encoding format field may have a fixed length. The encoding format field of a sub-block may identify (i) one of the multiple patterns or (ii) another sub-block that matches the sub-block. For each sub-block whose corresponding encoding format field identifies a pattern, the compressed image element value block may include image element value units that include one or more image element values forming the identified pattern. Image element value units may be packed into the body of the compressed image element value block.
[0038] A second aspect provides a compression unit for compressing a two-dimensional image element value block, the two-dimensional image element value block being divisible into a plurality of image element value sub-blocks, the compression unit comprising: a pattern selection unit configured to identify which of a plurality of patterns is formed by the image element values of a first sub-block among the plurality of sub-blocks; an image element value selection unit configured to identify the image element values of the first sub-block forming the identified pattern; and a compressed block generation unit configured to form a compressed image element value block by encoding the first sub-block in the compressed image element value block using: (i) information identifying the identified pattern, and (ii) the identified image element values.
[0039] The compression unit may further include a matching unit configured to: determine from a mask a set of one or more sub-blocks that have one or more predetermined relationships with the first sub-block; determine whether each sub-block in the set of one or more sub-blocks matches the first sub-block; and, in response to determining that each sub-block in the set of one or more sub-blocks matches the first sub-block, encode each sub-block in the set of one or more sub-blocks in the compressed image element value block with information identifying that the sub-block belongs to the set of sub-blocks that match the first sub-block.
[0040] The third aspect provides a compression unit configured to perform the method of the first aspect.
[0041] The compression unit, decompression unit, and compression / decompression unit described herein can be implemented in hardware on an integrated circuit. A method for manufacturing the compression unit, decompression unit, or compression / decompression unit described herein in an integrated circuit manufacturing system can be provided. An integrated circuit definition dataset can be provided, which, when processed in an integrated circuit manufacturing system, configures the system to manufacture the compression unit, decompression unit, or compression / decompression unit. A non-transitory computer-readable storage medium can be provided storing a computer-readable description of the compression unit, decompression unit, or compression / decompression unit, which, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit embodying the compression unit, decompression unit, or compression / decompression unit.
[0042] An integrated circuit manufacturing system may be provided, comprising: a non-transitory computer-readable storage medium storing a computer-readable description thereon of a compression unit, decompression unit, or compression / decompression unit as described herein; a layout processing system configured to process the computer-readable description to generate a circuit layout description of an integrated circuit embodying the compression unit, decompression unit, or compression / decompression unit; and an integrated circuit generation system configured to manufacture the compression unit, decompression unit, or compression / decompression unit according to the circuit layout description.
[0043] Computer program code for performing the methods described herein may be provided. A non-transitory computer-readable storage medium having computer-readable instructions stored thereon may be provided, which, when executed at a computer system, cause the computer system to perform the methods described herein.
[0044] As will be apparent to those skilled in the art, the above features can be appropriately combined, and can be combined with any aspect of the examples described herein. Attached Figure Description
[0045] The example will now be described in detail with reference to the accompanying drawings, in which:
[0046] Figure 1 This is a block diagram of an example graphics rendering system;
[0047] Figure 2 This is a flowchart of a pattern-based example method for compressing image data blocks;
[0048] Figure 3 This is a schematic diagram of a sample image data block;
[0049] Figure 4 It is divided into multiple sub-blocks Figure 3 A schematic diagram of an example image data block;
[0050] Figure 5 This is a schematic diagram of a set of example patterns for 2×2 sub-blocks;
[0051] Figure 6 This is a schematic diagram illustrating the compression of image data blocks using the pattern-based compression method of the first example;
[0052] Figure 7 This demonstrates the use of a pattern-based compression method, as shown in the second example, for compression. Figure 6 A schematic diagram of the image data blocks;
[0053] Figure 8 This is a schematic diagram illustrating an example set of sub-blocks that form a sub-block row;
[0054] Figure 9 This is a schematic diagram illustrating an example set of sub-blocks that form a sub-block column;
[0055] Figure 10 This is a schematic diagram showing an example set of sub-blocks that form a 2×2 block;
[0056] Figure 11 This demonstrates the use of a pattern-based compression method, as shown in the third example, for compression. Figure 6 A schematic diagram of the image data blocks;
[0057] Figure 12 This shows the use of multiple benchmarks. Figure 5 A graph showing the frequency of a 2×2 pattern;
[0058] Figure 13 This is a schematic diagram illustrating an example format for compressed image data blocks;
[0059] Figure 14 It is shown Figure 6 An example of a compressed image data block;
[0060] Figure 15 This is a schematic diagram illustrating an example format used for compressed super-image data blocks;
[0061] Figure 16 This is a block diagram of an example compression unit;
[0062] Figure 17 This is a block diagram of an example decompression unit;
[0063] Figure 18 According to Figure 2 A flowchart illustrating an example method for decompressing compressed image data blocks;
[0064] Figure 19 This is a flowchart of an example method for identifying patterns associated with sub-blocks;
[0065] Figure 20 This is a flowchart of an example method for identifying image element values associated with a sub-block;
[0066] Figure 21 This shows when multiple benchmarks are used. Figure 2 A graph showing the compression ratio when compressing color data using this method;
[0067] Figure 22 This is a block diagram of an example computer system in which the compression unit, decompression unit, and / or compression / decompression unit described herein can be implemented; and
[0068] Figure 23 This is a block diagram of an example integrated circuit manufacturing system used to generate integrated circuits that embody the compression unit, decompression unit, or compression / decompression unit described herein.
[0069] The accompanying drawings illustrate various examples. Those skilled in the art will understand that the element boundaries (e.g., boxes, groups of boxes, or other shapes) shown in the drawings represent one example of a boundary. In some examples, it may be that one element can be designed as multiple elements, or multiple elements can be designed as one element. Where appropriate, common reference numerals are used throughout the drawings to indicate similar features. Detailed Implementation
[0070] The following description is given by way of example to enable those skilled in the art to make and use the invention. The invention is not limited to the embodiments described herein, and various modifications to the disclosed embodiments will be readily apparent to those skilled in the art. Embodiments are described by way of example only.
[0071] As stated above, compressing image data on a block-by-block basis, requiring the decompression of the entire block to access individual values, makes it difficult for logic that randomly accesses image data (such as rendering logic) to access the data efficiently. The applicant's UK patent applications 1912183.9, 1912184.7, 1912795.0 and 1912800.8 describe a lossless method for compressing image data that allows random access to compressed data (i.e., access to individual values within a compressed block without having to decompress the entire block), the entire contents of which are incorporated herein by reference.
[0072] Specifically, the identified UK patent application describes a method and compression unit for compressing image data blocks comprising a plurality of image element values (e.g., color values), which can be divided into at least first values and second values (e.g., first channel color values and second channel color values), such that the image data includes at least two-dimensional blocks of first values (e.g., two-dimensional blocks for color values of the first color channel) and two-dimensional blocks of second values (e.g., two-dimensional blocks for color values of the second color channel). Each two-dimensional value block is compressed separately using one or more fixed-length compression algorithms.
[0073] Specifically, one or more two-dimensional value blocks are compressed by using a fixed-length compression algorithm to compress all or part of the two-dimensional value blocks. The values in the two-dimensional block (or a portion thereof) are represented by common basis information and a fixed-length parameter for each value in the block (or portion thereof), the fixed-length parameter having a length of zero, one, or more bits. The compressed image data block is then formed from the common basis information and the fixed-length parameter. By using a fixed-length compression algorithm to compress a two-dimensional block (or a portion thereof) of values, all values in the two-dimensional block (or that portion thereof) are represented using the same number of bits, thus making it easy to identify portions of compressed data associated with specific values.
[0074] However, tests have shown that some graphics processing systems can access or retrieve small blocks of image element values (e.g., color values) from memory at a time, rather than individual image element values. The size of these small blocks may be referred to herein as the minimum image element value retrieval size. For example, some graphics processing systems can access 2×2 blocks of image element values (e.g., color values) at a time. The minimum image element value retrieval size can be selected based on the memory burst size (i.e., the amount of memory that can be accessed via a single memory access request). In these systems, instead of compressing the image element values in a manner that allows access to individual image element values, it may be more efficient to compress blocks of the minimum image element value retrieval size (e.g., 2×2 blocks). The inventors have recognized that such small blocks can be efficiently compressed using a pattern-based compression method, where instead of storing each image element value in the block, the blocks are encoded based on a pattern of image element value distribution. Specifically, the blocks can be encoded by identifying a pattern of image element values within the block and information about the unique image element values. Each pattern identifies the number and location of unique image element values within the pattern.
[0075] Therefore, this document describes a method, compression unit, and graphics processing unit for compressing image data blocks comprising blocks of two-dimensional image element values. The method includes (i) dividing the two-dimensional image element value block into multiple image element value sub-blocks; and (ii) encoding one or more of the sub-blocks based on a pattern of image element values in the block and image element values of the sub-blocks forming the pattern. In some cases, the method may further include matching encoding, wherein if a set of sub-blocks having one or more predetermined relationships matches, one of the sub-blocks can be encoded as described above (using a pattern and image element values of the sub-blocks forming the pattern), and the remaining sub-blocks in the set can be encoded by identifying the matching sub-blocks. The method described herein is simple and flexible, and therefore particularly suitable for graphics processing units with very low budgets.
[0076] Now for reference Figure 2 This illustrates a pattern-based example method 200 for compressing blocks of image data. Method 200 begins at step 202, in which the block of image data to be compressed is received.
[0077] An image data block is a portion of image data corresponding to a two-dimensional block or sample of pixels in an image. Therefore, an image data block comprises blocks of two-dimensional image element values. The term "image element value" is used here to refer to a unit of image data. Thus, the image element value depends on the type of image data. For example, for color data, an image element value can be a pixel value or a pixel color value (e.g., it can be defined by a set of channel color values), or a channel color value; for depth data, an image element value can be a depth value; for surface normal data, an image element value can be a surface normal direction (e.g., it can be defined by a set of values representing a unit vector or one or more angles); and for texture data, an image element value can be a texture pixel value (e.g., it can be defined by a color value or a set of color values). In some cases, instead of image data corresponding to the original image data produced as part of the rasterization process, the image data can be a compressed version of the original image data. For example, in some cases, the image data can include compressed pixel color values, compressed texture pixel values, etc. In these cases, each image element value can be a compressed color value, a compressed texture pixel value, etc.
[0078] An image data block can be any D×E block of image element values, where D and E are integers greater than or equal to 1. D and E can be the same, or they can be different. For example, an image data block can include image element values of a 32×32 pixel block, a 16×16 pixel block, or an 8×8 pixel block. When compression is used to compress image data in a graphics processing system that implements tile-based rendering, the image data block can correspond to a tile (e.g., a 32×32 pixel block corresponding to a 32×32 pixel tile), a set of tiles (e.g., a 32×32 pixel block corresponding to four 16×16 pixel tiles), or a portion of a tile (e.g., a 16×16 pixel block corresponding to a quarter of a 32×32 pixel tile). Figure 3 An example 8×8 block 300 is shown, which includes an image element value (Vx, y) for each of the sixty-four pixels in the block, where x and y represent the row and column numbers, respectively.
[0079] Once the image data block has been received, method 200 proceeds to step 204.
[0080] In step 204, the image data block is divided into multiple sub-blocks. Each sub-block comprises an N×M block of image element values, where N and M are integers greater than or equal to 1. N and M can be the same, or they can be different. Any suitable criteria can be used to select N and M, although it is desirable to keep N and M small to reduce the number of possible patterns of image element values in the sub-block. In some cases, N and M can be selected such that the sub-block corresponds to the smallest block size fetched from memory. For example, where the graphics processing system is configured to fetch 2×2 blocks of image element values from memory, N and M can be set to 2, such that each sub-block comprises a 2×2 block of image element values. Other example sub-block sizes include, but are not limited to, 2×4, 4×2, and 4×4.
[0081] For example, such as Figure 4 As shown, Figure 3 An 8×8 block of image element values 300 can be divided into sixteen 2×2 sub-blocks of image element values 4020-402. 15 Therefore, each sub-block 4020-402 15 It includes four image element values. For example, sub-block 0 (SB0) 4020 includes the first two rows (V) of an 8x8 block 300 containing image element values. 0,0 V 0,1 V 1,0 and V 1,1 The first two image element values in each of the blocks. Once the image data block has been subdivided into multiple sub-blocks of image element values, method 200 proceeds to step 206.
[0082] In step 206, a sub-block of image element values is selected for encoding. Then, method 200 proceeds to step 208. In some cases, it may be necessary to process the sub-blocks in a specific order, such as Z-line order or scan order. It will be apparent to those skilled in the art that these are merely example orders, and the sub-blocks can be processed in any suitable order.
[0083] In step 208, it is determined which of the multiple image element patterns matches the pattern formed by the image element values of the selected sub-block. Each pattern has multiple image element values in the pattern and defines the positions of one or more of those image element values in the sub-block. Therefore, the sub-block can be reconstructed from: (i) the pattern; and (ii) the image element values that form the pattern.
[0084] For example, Figure 5 Fifteen possible patterns 5020-502 are shown for the image element values in a 2×2 block. 14The patterns have been grouped according to the number of unique image element values in the pattern. Specifically, there exists a pattern 5020, called pattern 1 (P1), which is formed by a single image element value (V1). Therefore, if all image element values in a sub-block are identical, the image element values of that sub-block form the P1 pattern. Note that color data typically does not contain many identical pixel color values, except for areas with constant colors (e.g., background or transparent colors). There are seven patterns 5021-5027, which are formed by two image element values (V1, V2), referred to here as pattern 2 (P2). Pattern 2 can be divided into patterns 5021, 5022, and 5027, where each image element value (V1, V2) appears twice in the pattern; and patterns 5023-5026, where one image element value (V1) appears once in the pattern, and the other image element value (V2) appears three times. There are six patterns 5028-5029. 13 This can be referred to here as pattern 3 (P3), which is formed by three image element values (V1, V2, V3). In the P3 pattern, one of the image element values (V1, V2, or V3) appears twice in the pattern. There is only one pattern 502. 14 This is called Pattern 4 (P4), which is formed by four image element values (V1, V2, V3, and V4). Therefore, if all image element values in a sub-block are different, the image element values of the sub-block form the P4 pattern.
[0085] In some cases, the multiple possible patterns that can be associated with or matched with a sub-block include all possible patterns of image element values within the sub-block (e.g., Figure 5 All patterns shown are 5020-502 14 However, as described in more detail below, in some cases, the multiple possible patterns that can be associated with a sub-block may include fewer than all possible patterns with fewer than the image element values. For example, the multiple possible patterns may not include, for instance, patterns such as... Figure 5 The example shows an uncommon P2G pattern. In these cases, if the image element values of a sub-block do not match any of the other multiple patterns, the sub-block is identified as a Pk pattern, where k is the number of image element values in the sub-block (e.g., k = 4 for a 2×2 sub-block).
[0086] Now for reference Figure 6 This illustrates an example of a pattern among multiple patterns that identifies a pattern that matches a pattern formed by the image element values of a sub-block. Specifically, Figure 6 An example 4×8 block 600 is shown, comprising image data of eight 2×2 sub-blocks 6020-6027, wherein the plurality of patterns include Figure 5 All fifteen patterns shown are 5020-502. 14In this example, the image element values are between 0 and 7, but it will be apparent to those skilled in the art that this is merely an example and that image element values can have any range of values.
[0087] It can be seen that, Figure 6 Sub-block 0(SB0)6020 and Figure 5 The pattern P4 is associated because sub-block 0 (SB0) 6020 contains four unique image element values (i.e., all image element values in the sub-block are different); sub-blocks 1 and 4 (SB1 and SB4) 6021 and 6024 are associated with... Figure 5 The patterns P3C are associated because they each have three unique image element values, and the image element values repeat in positions 1,0 and 1,1 of the sub-blocks, where the position format x,y represents the row x and column y of the sub-block; sub-blocks 2, 3, 6 and 7 (SB2, SB3, SB6 and SB7) 6022, 6023, 6026 and 6027 are associated with... Figure 5 The pattern P2B is associated because each of these sub-blocks has two unique image element values, with the same image element values at positions 0,0 and 1,0, and the same image element values at positions 0,1 and 1,1; and sub-block 5(SB5)6025 is associated with... Figure 5 The pattern P3B is associated because subblock 5 (SB5) 6025 contains three unique image element values, and the repeated image element values are in subblock positions 0,0 and 1,0.
[0088] return Figure 2 Once a pattern among multiple patterns that matches the pattern formed by the image element values of the selected sub-block has been identified, method 200 proceeds to step 210.
[0089] In step 210, a compressed block is formed or updated such that the selected sub-block is encoded in a compressed image element value block by (i) identifying information of the pattern selected in step 208 and (ii) forming the image element values of the selected sub-block of the pattern.
[0090] In some cases, the information identifying a pattern associated with a sub-block can be an index. Specifically, each of multiple patterns can be associated with a unique index or value. For example, Table 1 shows example four-digit indices and their values to uniquely identify patterns. Figure 5 Each of the fifteen patterns.
[0091] Table 1
[0092]
[0093]
[0094] The number of image element values stored in a compressed block to enable the reconstruction of a sub-block from its associated pattern is based on the number of image element values forming the pattern. For example, pattern P1 is formed by a single image element value, so the sub-block associated with pattern P1 can be reconstructed from a single image element value (V1); pattern P2 is formed by two image element values (V1, V2), so the sub-block associated with pattern P2 can be reconstructed from two image element values; pattern P3 is formed by three image element values (V1, V2, V3), so the sub-block associated with pattern P3 can be reconstructed from three image element values; and pattern P4 is formed by four image element values (V1, V2, V3, V4), so the sub-block associated with pattern P4 can be reconstructed from four image element values. Therefore, if a sub-block is associated with a pattern having fewer image element values than the number of image element values in the sub-block (e.g., ...), ... Figure 5 If a sub-block is associated with a pattern (such as pattern P1, pattern P2, or pattern P3 in the 2×2 sub-block example), the sub-block can be compressed by storing only that number of image element values in the compressed block. However, if a sub-block is associated with a pattern having the same number of image element values as the sub-block (e.g., pattern P4 in the 2×2 sub-block example), the sub-block is not compressed, and each image element value of the sub-block is stored in the compressed block.
[0095] The multiple possible patterns that can be associated with or matched with a sub-block include all possible patterns of image element values in the sub-block (e.g., Figure 5 All fifteen patterns shown are 5020-502. 14 In the case of a sub-block, the number of image element values forming a pattern associated with the sub-block will be equal to the number of unique image element values in the sub-block. Therefore, in these cases, only the unique image element values of the sub-block can be stored in the compressed block. In other words, any image element value that appears multiple times in the sub-block can be stored only once in the compressed block. However, if the multiple possible patterns that can be associated with the sub-block include fewer than all possible image element value patterns, and if the image element values of the sub-block do not match any of the other multiple patterns, the sub-block is identified as pattern Pk, where k is the number of image element values in the sub-block (e.g., k = 4 for a 2×2 sub-block), even if the sub-block does not include k unique image element values. In these cases, even if the sub-block includes fewer than k unique image element values, k image element values can be stored in the compressed block of the sub-block.
[0096] Now for reference Figure 6 This indicates which image element values can be stored in the compressed block for each of the multiple sub-block pattern pairs. Specifically, as described above, Figure 6 The example shown is a 4×8 image data block 600, which includes eight 2×2 sub-blocks 6020-6027, wherein the plurality of patterns include Figure 5All fifteen patterns shown are 5020-502. 14 As shown at position 604, each sub-block has been associated with... Figure 5 One of the fifteen patterns is matched. Specifically, it can be seen that sub-blocks 6020-6027 have been mapped to graphics P4, P3C, P2B, P2B, P3C, P3B, P2B, and P2B, respectively.
[0097] At position 606, the image element values that can be stored in the compressed block of each sub-block are generally shown. Specifically, sub-block 0 (SB0) 6020 has been associated with... Figure 5 The pattern P4, formed by four image element values (V1, V2, V3, V4), is associated with the sub-block 0 (SB0) 6020, therefore each of the four image element values (1, 0, 7, 4) is stored in the compressed block; sub-block 1 (SB1) 6021 is already associated with... Figure 5 The pattern P3C, formed by three image element values (V1, V2, V3), is associated with this pattern, therefore the three image element values (1, 3, and 5) are stored in the compressed block; and sub-block 2 (SB2) 6022 is already associated with... Figure 5 The pattern P2B, formed by two image element values (V1, V2), is associated, therefore the two image element values (V1, V2) are stored in the compressed block. In this example, only twenty-one image element values are stored in the compressed block, instead of the thirty-two image element values stored in the original uncompressed block 600. Therefore, this reduces the number of image element values by 34%.
[0098] return Figure 2 In some cases, method 200 may end after step 210. However, in other cases, one or more other sub-blocks may be encoded in a similar manner. If one or more other sub-blocks will also be encoded, method 200 may proceed to step 212.
[0099] In step 212, it is determined whether there is another sub-block to be encoded or compressed. If at least one more sub-block needs to be encoded or compressed, method 200 proceeds to step 214. However, if no more sub-blocks need to be encoded, method 200 may proceed to step 216, where the compressed block is output and / or stored in memory (e.g., a frame buffer).
[0100] In step 214, one of the remaining sub-blocks to be encoded is selected. Method 200 then returns to steps 208 and 210, where pattern identification and sub-block encoding are performed on the selected sub-block. Once all desired sub-blocks have been encoded, method 200 can proceed to step 216, where the compressed block is output and / or stored in memory.
[0101] The following will refer to Figure 13 Description based on Figure 2 Example format of compressed blocks generated by method 200.
[0102] Correlation between sub-blocks
[0103] In many cases, not only do common image element values exist within sub-blocks, but common sub-blocks often exist within blocks, especially closely adjacent sub-blocks. Therefore, in some cases, in addition to compressing image data blocks based on patterns within the blocks of image data, compression can also utilize the similarity or correlation between sub-blocks.
[0104] Specifically, in some cases... Figure 2 The method may further include determining whether a sub-block is identical or matches one or more other sub-blocks in the block. Two sub-blocks are considered identical or matched if they include the same image element values at every position within the sub-block. If a sub-block is determined to be identical or matches one or more other sub-blocks in the block, the sub-block is encoded in a compressed block not by identifying the pattern and the image element values forming the pattern, but by identifying information about the matching sub-blocks. The information identifying the matching sub-blocks acts as pointers to the patterns and image element values that can be used to reconstruct the sub-block. Therefore, it is not necessary to store the image element values in a compressed block for that sub-block, as they are already stored in the compressed block. This can significantly increase the compression ratio of the block when many repeating or matching sub-blocks exist within it.
[0105] In some cases, Figure 2 The method may further include comparing two sub-blocks that have a predetermined relationship to determine whether they are identical or match. Then, if they are identical or match, one of the sub-blocks may be encoded as described above (e.g., using a pattern and image element values that form the pattern), and the other sub-block may be encoded as a match with the other sub-block.
[0106] For example, sub-blocks can be sorted (e.g., by Morton (or Z) order, such as... Figure 4 (as shown), in scan line order or in another manner, and Figure 2 The method may further include determining whether a sub-block matches a previous sub-block in the order. If a sub-block matches a previous sub-block in the order, the sub-block is encoded in the compressed block using information indicating that the sub-block matches the previous sub-block. For example, if Figure 4 sub-blocks 4020-402 15If subblock 1 (SB1) 4021 is received for encoding and ordered from 0 to 15 in Morton (or Z) sequence, it can be determined whether subblock 1 (SB1) 4021 matches subblock 0 (SB0) 4020 (the preceding subblock in this sequence). If it is determined that subblock 1 (SB1) 4021 matches subblock 0 (SB0) 4020, then subblock 1 (SB1) 4021 can be encoded in the compressed block using information indicating that the subblock matches the preceding block. Subblocks that are identical to or match the preceding subblock in this sequence can be called match-1 (M-1) subblocks. Information indicating that a subblock is an M-1 subblock serves as a pointer to the pattern and image element values associated with the preceding subblock, so that during decompression, the pattern and image element values associated with the preceding subblock are retrieved and used to reconstruct the subblock.
[0107] Now for reference Figure 7 This demonstrates how identifying sub-blocks that match previous sub-blocks (based on the order of sub-blocks within the block) can increase the block's compression ratio. Specifically, Figure 7 Show Figure 6 Example block 600 of the image data (i.e., image element values). Figure 6 In this context, each sub-block 6020-6027 is associated with a pattern (shown at 604), and the image element values of the sub-blocks forming the pattern are stored in a compressed block (shown at 606). Therefore, in... Figure 6 In this approach, each sub-block is compressed based on the pattern associated with it, independent of other sub-blocks, resulting in at least one image element value being stored in the compressed block for each sub-block. In contrast, in... Figure 7In the compression block, the relationship between sub-blocks is considered. That is, any sub-block that matches the previous block (according to the order of sub-blocks) is simply identified as a match-1 (M-1) sub-block in the compression block, and no image element value is stored in the compression block of that sub-block. Specifically, sub-block 3 (SB3) 6023 matches the previous sub-block (sub-block 2 (SB2) 6022). Therefore, instead of using the pattern (P2B) and the image element values forming the pattern to encode sub-block 3 (SB3) 6023 in the compression block, sub-block 3 (SB3) is simply identified as a match-1 (M-1) sub-block (shown at 702). Therefore, no image element value (SB3) of sub-block 3 is stored (shown at 704). As mentioned above, match-1 (M-1) specifies a pointer used as a pointer to the pattern and image element values of the previous sub-block (sub-block 2 (SB2) 6022). The pattern and image element values of the previous sub-block can then be retrieved and used to reconstruct sub-block 3 (SB3) 6023. Similarly, sub-block 7 (SB7) 6027 matches the previous sub-block (sub-block 6 (SB6) 6026). Therefore, instead of encoding sub-block 7 (SB7) 6027 using a pattern (P2B) and the image element values forming that pattern, sub-block 7 (SB7) 6027 is simply identified as a match-1 (M-1) sub-block (shown at 702). This reduces the number of image element values stored in the compressed block to 17, which is a 47% reduction compared to the uncompressed block 600.
[0108] When sub-blocks are sorted (e.g., by Morton (or Z) order) Figure 4 In other cases (as shown), in scan line order or in another manner, Figure 2 The method may additionally or alternatively include determining whether sub-block J matches a sub-block that precedes the preceding sub-block in sequence (i.e., a sub-block that follows in sequence). If it is determined that sub-block J matches a sub-block that precedes the preceding sub-block in that sequence, then sub-block J is encoded in a compressed block using the information indicating that the sub-block matches a sub-block that precedes the preceding sub-block in that sequence. For example, if Figure 4 sub-blocks 4020-402 15Sort by Morton (or Z) order from 0 to 15, and receiving sub-block 2 (SB2) 4022 for encoding, it can be determined whether sub-block 2 (SB2) 4022 matches sub-block 0 (SB0) 4020 (the sub-block preceding the previous sub-block in this order). If it is determined that sub-block 2 (SB2) 4022 matches sub-block 0 (SB0) 4020, information indicating that the sub-block matches the sub-block preceding the previous sub-block in this order can be used to encode sub-block 2 (SB2) 4022 in the compressed block. Sub-blocks that are the same as or match the sub-block preceding the previous sub-block in this order can be called match-2 (M-2) sub-blocks. Similar to the case of match-1 (M-1), information indicating that a sub-block is an M-2 sub-block is used as a pointer to the pattern and image element values associated with the sub-block preceding the previous sub-block in this order, so that during decompression, the pattern and image element values associated with the sub-block preceding the previous sub-block are retrieved from the compressed block and used to reconstruct the relevant sub-block.
[0109] In other cases, instead of comparing two sub-blocks to see if they match, Figure 2 The method may also include determining whether a set of sub-blocks having one or more predetermined relationships are all identical or all match. If the set of sub-blocks all match, one of the sub-blocks in the set can be encoded as described above (using the pattern and image element values forming the pattern), and each of the remaining sub-blocks in the set can be encoded by information identifying them as part of a matching set having predetermined relationships. The information identifying a sub-block as part of a matching set of sub-blocks having predetermined relationships can act as a pointer to a sub-block in that set that has already been pattern-encoded. Thus, the pattern and image element values stored in the compressed block of that sub-block can then be used to reconstruct any sub-block in that set. Therefore, it is not necessary to store image element values for other sub-blocks in the set in the compressed block.
[0110] A predetermined relationship between sub-blocks can be selected to include potentially identical sets or groups of sub-blocks. For example, if, for instance, a set of sub-blocks forms (i) as... Figure 8 The row of sub-block 802 shown, (ii) as Figure 9 The column of sub-block 902 shown; or (iii) the AxB block of sub-block 1002, where A and B are integers greater than or equal to 1 (e.g., a 2×2 block of the sub-block), such as Figure 10As shown in the diagram, a sub-block in a row of matching sub-blocks can be encoded via a pattern and the image element values that form the pattern, and each of the other sub-blocks in that row can simply be identified as a matching row (MR) sub-block. Similarly, a sub-block in a column of matching sub-blocks can be encoded via a pattern and the image element values that form the pattern, and each of the other sub-blocks in that column can simply be identified as a matching column (MC) sub-block. If a sub-block belongs to two or more matching groups of sub-blocks (e.g., if a sub-block is both a row matching sub-block and a column matching sub-block), then the sub-block can be associated with any of the matching groups (e.g., the sub-block can be identified as an MR sub-block or an MC sub-block). It will be apparent to those skilled in the art that these are merely example sub-block relationships, and other sub-block relationships can be used.
[0111] In some cases, each set of sub-blocks that can be compressed in this way can be identified by a mask. For example, if a row of sub-blocks can be compressed in this way, then... Figure 4 The sub-block rows (SB0, SB1, SB4, SB5) can be identified by the hexadecimal mask 0x0033. Figure 4 The second row of sub-blocks (SB2, SB3, SB6, SB7) can be identified by the hexadecimal mask 0x00CC. Figure 4 The third row of sub-blocks (SB8, SB9, SB12, and SB13) can be identified by the hexadecimal mask 0x3300. Figure 4 The fourth row of sub-blocks (SB10, SB11, SB14, and SB15) can be identified by the hexadecimal mask 0xCC00. Similarly, if the sub-block column can be compressed in this way, then... Figure 4 The first column (SB0, SB2, SB8, SB10) of the sub-block can be identified by the hexadecimal mask 0x0505. Figure 4 The second column (SB1, SB3, SB9, SB11) of the sub-block can be identified by the hexadecimal mask 0x0A0A. Figure 4 The third column (SB4, SB6, SB12, SB14) of the sub-block can be identified by the hexadecimal mask 0x5050, and Figure 4 The fourth column (SB5, SB7, SB13, SB15) of the sub-block can be identified by the hexadecimal mask 0xA0A0.
[0112] Now for reference Figure 11 This demonstrates how identifying matching sub-block groups can increase the compression ratio of image element value blocks. Specifically, Figure 11 Show Figure 6 Example block 600 of the image data (i.e., image element values). Figure 6In this context, each sub-block 6020-6027 is associated with a pattern (shown at 604), and the image element values of the sub-blocks forming the pattern are stored in a compressed block (shown at 606). Therefore, in... Figure 6 In this approach, each sub-block is compressed based on the pattern associated with it, independent of other sub-blocks, resulting in at least one image element value being stored in the compressed block for each sub-block. In contrast, in... Figure 11 In the compression block, the relationship between sub-blocks is considered. That is, for any row of matching sub-blocks, the first sub-block in that row is identified by a pattern and the image element values that form the pattern, and each other sub-block in that row is simply identified as a matching row (MR) sub-block in the compression block, and no image element values are stored in the compression block for those sub-blocks.
[0113] Specifically, the sub-blocks in the second row (6022, 6023, 6026, and 6027) are all identical. Therefore, instead of encoding each sub-block in the row with a P2B pattern and the two image element values forming that pattern (5, 2), the first sub-block in the row (sub-block 2 (SB2) 6022) is encoded with a P2B pattern and the two image element values forming that pattern (5, 2), and each of the other sub-blocks in the row (sub-blocks 3, 6, and 7 (SB3, SB6, SB7) 6023, 6026, and 6027) is simply identified as a Matching Row (MR) sub-block (shown at 1102). Therefore, image element values are not stored for the last three sub-blocks in the row (6023, 6026, and 6027) (shown at 1104). As described above, the Matching Row (MR) specifies the pattern and image element values used as pointers to the first sub-block in the row (i.e., sub-block 2 (SB2) 6022). Then, the pattern and image element values of the first sub-block in that row can be retrieved and used to reconstruct any sub-blocks in that row (6022, 6023, 6026, and 6027). This reduces the number of image element values stored in the compressed block to 15, which is a 53% reduction compared to the uncompressed block 600.
[0114] Number of patterns
[0115] In some cases, a fixed number of bits can be used in a compressed block to identify the encoding format of a sub-block. When the sub-block is pattern-encoded, this may include identifying the pattern associated with the sub-block; and when the sub-block is match-encoded, this may include identifying the match type. The number of bits used to identify the encoding format of each sub-block can then be based on the number of patterns and match types supported by the compression algorithm. For example, if the compression algorithm only supports pattern encoding and there are fifteen patterns, then each sub-block requires at least four bits to uniquely identify its encoding format. Table 1 above shows an example of how four bits can be used to uniquely identify fifteen patterns. However, if the compression algorithm supports pattern encoding with fifteen patterns and four match types, then each sub-block requires at least five bits to uniquely identify its encoding format. Table 2 shows an example of how five bits can be used to identify fifteen patterns and four match types.
[0116] Table 2
[0117] Encoding format pattern 00000 P1 00001 P2A 00010 P2B 00011 P2C 00100 P2D 00101 P2E 00110 P2F 00111 P2G 01000 P3A 01001 P3B 01010 P3C 01011 P3D 01100 P3E 01101 P3F 01110 P4 01111 M-1 10000 M-2 10001 MR 10010 MC
[0118] In some cases, to reduce the number of bits per sub-block to identify its encoding format, the number of patterns supported by the compression algorithm may not include all possible patterns. For example, instead of supporting... Figure 5 The compression algorithm supports all fifteen patterns, but can also support fewer than fifteen patterns. When a pattern is not supported by the compression algorithm, a sub-block with that pattern can be represented by a Pk pattern, where kP pattern is the number of image element values in the sub-block (i.e., in uncompressed form). Therefore, in some cases, a higher compression ratio can be achieved by using fewer patterns and / or matching types.
[0119] In some cases, compression algorithms may not support minimum common patterns. For example, Figure 12 The diagram illustrates 8x8 color blocks for seven different bases. Figure 5 The 2×2 pattern and frequencies of M-1, M-2, MR, and MC matched types are shown. From Figure 12 As can be seen, the number of 2×2 sub-blocks with a P2G pattern is very limited. This is because in a P2G pattern, identical color values are diagonally opposite each other, rather than adjacent as in other P2 patterns. This might happen when two thin lines intersect each other, but this is rare in color blocks. Similarly, in Figure 12 As can be seen, 2×2 sub-blocks with P3E or P3F patterns are also quite limited. This is likely due to the thin lines passing through one or two primitives. In contrast, Figure 12 It shows that a large number of sub-blocks can be encoded using M-1, M-2, MR, and MC matching types.
[0120] Therefore, in order to keep the number of coded bits for each sub-block to four, P2G, P3E, and P3F patterns may not be supported, but four matching types (e.g., M-1, M-2, MR, MC) may be supported. Table 3 shows an example of how to use four bits to identify twelve patterns and four matching types.
[0121] Table 3
[0122]
[0123]
[0124] Example compressed block format
[0125] Now the description will be based on Figure 2 An example format of the compressed block generated by method 200.
[0126] Now for reference Figure 13 This document illustrates an example format of a compressed image data block 1300, wherein the block is divided into sub-blocks, and one or more sub-blocks are compressed using a pattern-based encoding scheme. In this example, the block is an 8×8 block of image element values, which is divided into sixteen 2×2 sub-blocks of image element values. However, those skilled in the art will understand that this is merely an example, and the methods and techniques described herein can be applied to image data of any size that is divided into sub-blocks of any size.
[0127] Example compressed block 1300 includes a header 1302 and a body 1304. The header 1302 includes information identifying the encoding format (e.g., pattern or match type) of each sub-block. The body 1304 includes image element values that can be used to reconstruct the sub-blocks based on the information in the header 1302.
[0128] exist Figure 13 In the header 1302, fixed-length encoding format fields 13060-1306 are included for each sub-block. 15 Specifically, sub-block 0 encoding format field (SB0 ENC) 13060 identifies the encoding format of sub-block 0, sub-block 1 encoding format field (SB1 ENC) 13061 identifies the encoding format of sub-block 1, sub-block 2 encoding format field (SB2 ENC) 13062 identifies the encoding format of sub-block 2, and so on. When sub-blocks can be encoded using only pattern-based encoding, encoding format fields 13060-1306... 15 Identifies the pattern used to encode the sub-block. If the sub-block is pattern-encoded, the encoding format fields 13060-1306 are used where pattern-based encoding or match encoding can be used. 15It can identify the pattern used to encode sub-blocks, and if the sub-block is matched and encoded, the encoding format field 13060-1306... 15 It can identify the type of match (e.g., column-based match, row-based match, etc.). In some cases, the encoding format field is 13060-1306. 15 Values may be included to indicate the relevant pattern or match type. Example 4-bit and 5-bit values can be used to identify the pattern and / or match type, as described above with reference to Tables 1 to 3.
[0129] Body 1304 includes image element value units 13080-1308 for each sub-block (i.e., each sub-block associated with the pattern in header 1302) for pattern encoding. 15 Each image element value (IEV) unit is 13080-1308. 15 This includes image element values (V1, V2, V3, V4) that form the associated pattern. As described above, the number of image element values stored in any particular sub-block of the compressed block 1300 will be based on the number of image element values that form the associated pattern. For example, the P1 pattern is formed by one image element value (V1), so a sub-block encoded using the P1 pattern may have image element value (IEV) units 13080-1308 in the body 1304 that include one image element value (V1). 15 Similarly, the P3 pattern is formed by three image element values (V1, V2, V3), therefore a sub-block encoded using the P3 pattern can have image element value units 13080-1308 in a body 1304 that include the three image element values (V1, V2, V3). 15 There may be no matching coded sub-block image element value units 13080-1308 in the main body. 15 Because the relevant image element values will already be in the main body 1304.
[0130] Image element value units 13080-1308 15 They can be packaged in the body 1304 in any suitable order. Preferably, the Image Element Value (IEV) units are in the same encoding format as fields 13060-1306. 15 The same order in which they are packed in header 1302 is packed in body 1304. For example, if the first encoding format field 13060 in header 1302 corresponds to sub-block 0 and the second encoding format field 13061 in header 1302 corresponds to sub-block 1, then the image element value (IEV) units of sub-block 0 can be stored in body 1304 first, and then the image element value (IEV) units of sub-block 1 can be stored in body 1304 next.
[0131] Now for reference Figure 14 It shows Figure 11 Example 2×4 block 600 (i.e., image element values) of image data, example compressed block 1400, which has been passed Figure 2 Versions of the method, such as Figure 11 The image data is encoded as shown, where block 600 of image data is divided into multiple 2×2 sub-blocks, and there are twelve possible 2×2 patterns. Figure 5 The P1, P2A, P2B, P2C, P2D, P2E, P2F, P3A, P3B, P3C, P3D, and P4) and four possible matching types (M-1, M-2, MR, and MC) are uniquely identified using the values shown in Table 3. The compressed block 1400 includes a header 1402 and a body 1404.
[0132] Header 1402 includes encoding format fields 14060-14067 for each of the eight sub-blocks 6020-6027. Each encoding format field 14060-14067 identifies the encoding format of the corresponding sub-block. In this example, each encoding format field 14060-14067 includes a value identifying the pattern or match type used to encode the corresponding sub-block according to Table 3. Specifically, sub-block 0 (SB0) 6020 is encoded using the P4 pattern, therefore the encoding format field 14060 of sub-block 0 is set to '1011' according to Table 3; sub-block 1 (SB1) 6021 is encoded using the P3C pattern, therefore the encoding format field 14061 of sub-block 1 (SB1) 6021 is set to '1001' according to Table 3; sub-block 2 (SB2) 6022 is encoded using the P2B pattern, therefore the encoding format field 14062 of sub-block 2 (SB2) 6022 is set to '0010' according to Table 3; sub-block 3 (SB3) 6023 is encoded using line matching (MR), therefore, according to Table 3, the encoding format field 14063 of sub-block 3 (SB3) 6023 is set to '1110'; sub-block 4 (SB2) 6022 6023 ... 4) Sub-block 4 (SB4) 6024 is encoded using the P3C pattern, therefore, according to Table 3, the encoding format field 14064 of sub-block 4 (SB4) 6024 is set to '1001'; sub-block 5 (SB5) 6025 is encoded using the P3B pattern, therefore, the encoding format field 14065 of sub-block 5 (SB5) 6025 is set to '1000' in Table 3; sub-block 6 (SB6) 6026 is encoded using line matching (MR), therefore, according to Table 3, the encoding format field 14066 of sub-block 6 (SB6) 6026 is set to '1110'; and sub-block 7 (SB7) 6027 is encoded using line matching (MR), therefore, according to Table 3, the encoding format field 14067 of sub-block 7 (SB7) 6027 is set to '1110'.
[0133] Body 1404 includes Image Element Value (IEV) units 14080, 14081, 14082, 14084, and 14085 for each sub-block used for pattern coding. In this example, since sub-blocks 0, 1, 2, 4, and 5 are pattern-coded, IEV units 14080, 14081, 14082, 14084, and 14085 exist for each of these sub-blocks in body 1404. Sub-blocks 3, 6, and 7, 6023, 6026, and 6027 are not pattern-coded (i.e., they are match-coded), therefore body 1404 does not include IEV units for these sub-blocks.
[0134] As described above, each IEV unit 14080, 14081, 14082, 14084, and 14085 includes image element values that form a pattern associated with the corresponding sub-block. Therefore, the number of image element values stored in the IEV unit depends on the number of image element values that form the associated pattern. Specifically, sub-block 0 (SB0) 6020 is encoded using a P4 pattern formed by four image element values (V1, V2, V3, V4), so the IEV unit 14080 of sub-block 0 (SB0) 6020 includes four image element values (1, 0, 7, and 4); sub-blocks 1, 4, and 5 6021, 6024, and 6025 are each encoded using a P3 pattern formed by three image element values (V1, V2, V3), so the IEV units 14081, 14084, and 14085 of sub-blocks 1, 4, and 5 each include three image element values (1, 3, 5; 2, 0, 3; and 4, 0, 7); and sub-block 2 (SB2) 6022 is encoded using a P2 pattern formed by two image element values (V1, V2), so the IEV unit 14082 of sub-block 2 (SB2) 6022 includes two image element values (5, 2).
[0135] In some cases, the headers and / or bodies of multiple compressed blocks can be packaged together in memory for more efficient memory use. For example, if each compressed block corresponds to an 8×8 image element value block, the headers and / or bodies of compressed blocks corresponding to a 32×32 image element value block can be packaged together to improve memory usage and bandwidth efficiency.
[0136] Now for reference Figure 15This illustrates an example format of a compressed superblock 1500 comprising multiple compressed blocks of data. In this example, each compressed block corresponds to an 8×8 image element value block, and data corresponding to fifteen compressed blocks are stored together to form a compressed superblock, wherein the fifteen compressed blocks correspond to 32×32 image element value blocks. It will be apparent to those skilled in the art that these are merely examples, and the principles and techniques described herein can be applied to blocks of any size, and any number of compressed blocks can be packaged together to form a compressed superblock.
[0137] Figure 15 The compressed superblock 1500 includes a header 1502 and a body 1504. The header 1502 includes coded segments 15060-1506 for each block of the superblock. 15 For example, in Figure 15 In this code, a superblock comprises sixteen 8×8 image element value blocks, thus resulting in sixteen coding segments, one for each 8×8 block. Each coding segment is 15060-1506. 15 This identifies the encoding format of each sub-block within the corresponding block. Each encoded segment is 15060-1506. 15 Can correspond to Figure 13 The header is 1302. Specifically, each coded segment is 15060-1506. 15 This may include a fixed-length encoding format field “SBjENC”, where j is the number of sub-blocks in each sub-block. Each fixed-length encoding format field may include a value that identifies the encoding format of the corresponding sub-block. As described above, if the sub-block is pattern-encoded, this value may identify the pattern associated with the sub-block, and if the sub-block is match-encoded, this value may identify the match type (e.g., M-1, M-2, MR, and / or MC). Encoding segment 15060-1506 15 They can be packed in header 1502 in any suitable order. In some cases, the encoded segments 15060-1506... 15 It can be packaged in header 1502 in either Z-order or scanline order.
[0138] The body 1504 of the compressed superblock includes image element value segments 15080-1508 for each block of the superblock. 15 For example, in Figure 15 In the superblock, there are sixteen 8×8 image element value blocks, thus there are sixteen image element value ranges 15080-1508. 15 Each image element value ranges from 15080 to 1508. 15 This includes image element values that can be used to reconstruct the corresponding sub-blocks. Each image element value range is 15080-1508. 15 Can correspond to Figure 13The main body is 1304. Specifically, each image element value range is 15080-1508. 15 It may include Image Element Value (IEV) units “SBjIEV Unit”, where j is the number of sub-blocks in each pattern-encoded sub-block. As described above, each IEV unit includes image element values that form the pattern associated with the sub-block. Therefore, the number of image element values in an IEV unit depends on the number of image element values that form the pattern associated with the corresponding sub-block. For example, as described above, if a sub-block is associated with, or encoded using, a P3 pattern formed by three image element values, then the IEV unit of that sub-block may include three image element values.
[0139] Image element value range 15080-1508 15 They can be encapsulated in the body 1504 in any suitable order. However, preferably, the image element value segments 15080-1508... 15 With the corresponding coding segment 15060-1506 15 The same order in which they are packaged in header 1502 is packaged in body 1504.
[0140] Although the decompression unit can calculate the value range 15080-1508 of each image element in the body 1504 based on the information in the header 1502. 15 The header 1502 may specify the starting address or starting position of the superblock, but in some cases, to simplify the decompression process, it may also include a segment 15080-1508 of the corresponding image element value from the body for each block of the superblock (e.g., each 8×8 block). 15 The header may contain information about the address or location of a superblock. For example, for each block of a superblock, the header may include an offset starting from body 1504, from which the address of the corresponding image element value segment can be determined.
[0141] To those skilled in the art, these are obviously based on Figure 2 The example format of the compressed blocks and compressed superblocks generated by method 200 is provided, and the compressed blocks and / or compressed superblocks can take any suitable form. For example, in other compressed superblocks, the encoded and image element value segments for each subblock can be packed together to form a compressed block, and then the compressed blocks can be packed together.
[0142] Compression unit
[0143] Now for reference Figure 16 It shows the use of Figure 2 Method 200 is used to compress image data blocks. Example compression unit 1600 (which can form) Figure 1(As part of the compression / decompression unit 112). The compression unit 1600 includes a pattern selection unit 1602; an image element value (IEV) selection unit 1604; and a compressed block generation unit 1606. In some cases where the compression unit supports matching encoding (e.g., M-1, M-2, MC, and / or MR encoding), the compression unit 1600 may also include a matching unit 1608.
[0144] Pattern selection unit 1602 is configured to receive blocks of image data to be compressed and, for each sub-block (e.g., each sub-block of size N x M), identify a pattern among multiple patterns formed by the image element values of that sub-block. The identified patterns are then output to IEV selection unit 1604. Each pattern defines multiple image element values in the pattern and the position of each of those image element values within the sub-block. (See above reference) Figure 5 Example patterns describing a 2×2 sub-block. As mentioned above, in some cases, multiple patterns can include all possible patterns of image element values in the sub-block. For example, in the case where the sub-block size is 2×2, the multiple patterns can include... Figure 5 All fifteen patterns shown are 5020-502. 14 However, in other cases, multiple patterns may include all possible patterns with fewer than the number of image element values in the sub-block. For example, in the case of a sub-block size of 2×2, multiple patterns may contain fewer than fifteen patterns. As mentioned above, the least frequently observed patterns can be removed from multiple patterns.
[0145] IEV selection unit 1604 is configured to receive image data blocks to be compressed and patterns associated with each of its sub-blocks, and for each sub-block (e.g., each NxM sub-block), identify its associated image element values based on the associated pattern. The identified IEVs for each sub-block are then provided to matching unit 1608 (e.g., if compression unit 1600 has matching unit 1608) or to compression block generation unit 1606 (e.g., if compression unit 1600 does not have matching unit 1608). As described above, each pattern is formed by multiple image element values, therefore the number of associated image element values for a sub-block is based on the pattern associated with the sub-block. For example, if a sub-block is associated with pattern P1 formed by one image element value, IEV selection unit 1604 may be configured to identify a single image element value. Similarly, if a sub-block is associated with pattern P3 formed by three image element values, IEV selection unit 1604 may be configured to identify three image element values.
[0146] Matching unit 1608 is configured to receive, for each sub-block, a pattern identified by pattern selection unit 1602 and one or more IEVs identified by IEV selection unit 1604, and determine whether any set of sub-blocks having one or more predetermined relationships are all identical or all matched. Matching unit 1608 can be configured to determine that a set of sub-blocks is all identical or all matched if it is associated with the same pattern and the same set of IEVs in the same order. If it is determined that sets of sub-blocks with predetermined relationships are all identical, one of the sub-blocks in the set is associated with a common pattern, and the common IEV and other sub-blocks in the set are identified as matching sub-blocks of a specific type and are not associated with any IEV. In other words, if it is determined that sets of sub-blocks with predetermined relationships are all identical, the encoding format of one of the sub-blocks in that set remains the same (i.e., pattern encoding is performed based on the identified pattern and one or more IEVs), and the encoding format of the other sub-blocks in that set is changed to match the encoding. However, if it is determined that the set of sub-blocks with predetermined relationships does not all match, the encoding format of each sub-block in the set remains the same (i.e., each sub-block retains the pattern-coded sub-block associated with one or more IEVs). The final encoding format selected by the matching unit 1608 is output to the compressed block generation unit 1606.
[0147] As mentioned above, a set of sub-blocks with a predetermined relationship can be, for example:
[0148] When the sub-blocks are sorted, the set of sub-blocks includes the sub-blocks in the order and the previous sub-block;
[0149] When the sub-blocks are sorted, the set of sub-blocks includes sub-blocks and sub-blocks that precede the previous sub-block in the order;
[0150] A set of sub-blocks that form a sub-block row;
[0151] A set of sub-blocks forming a sub-block column; and / or
[0152] The set of sub-blocks that form the sub-blocks of the AxB block.
[0153] In some cases, a mask identifying the sub-blocks in each sub-block set may exist. In these cases, compression unit 1600 may include memory 1610 for storing the one or more matching masks, and matching unit 1608 may be configured to read the matching mask from memory 1610.
[0154] The compressed block generation unit 1606 is configured to receive the encoding format of each sub-block and the associated image element values of each sub-block, and generate a compressed image data block from there. If the compression unit 1600 does not include the matching unit 1608, each sub-block may be associated with a pattern and have at least one associated image element value. However, if the compression unit 1600 includes the matching unit 1608, one or more sub-blocks may be matched and encoded, and are not directly associated with any pattern or any IEV. In some cases, the compressed block generation unit 1606 may be configured to generate a header and a body for the compressed image data block, the header identifying the encoding format of each sub-block, and the body including the associated image element values for the block. The header may employ... Figure 13 The header 1302 format. Specifically, the header may include a fixed-length encoding format field for each sub-block, which identifies the encoding format used for that sub-block. As mentioned above, the encoding format field may have a value identifying the pattern or sub-block matching type associated with the corresponding sub-block. The body may adopt... Figure 13 The format of the body 1304. Specifically, the body may include Image Element Value (IEV) units for each sub-block encoded by the pattern. Each IEV unit may include image element values associated with that sub-block. Since the number of associated image element values for a sub-block is based on the pattern associated with it, the number of image element values in the IEV is based on the number of image element values forming the associated pattern. For example, if a sub-block is associated with, or encoded by, a P2 pattern formed by two image element values, then the IEV unit for that sub-block may include two image element values. Similarly, if a sub-block is associated with, or encoded by, a P4 pattern formed by two image element values, then the IEV unit for that sub-block may include two image element values.
[0155] In some cases, the body and header can be combined (by compression block generation unit 1606 or another unit) to form a complete compression block. However, in other cases, the body and header can be output separately.
[0156] The compressed block can be stored in memory 1612. The body and header can be stored together or separately in memory 1612 (e.g., a frame buffer). For example, the body can be stored at a first location in memory 1612, and the body can be stored at a different second location in memory 1612.
[0157] Decompress
[0158] Now for reference Figure 17 It shows the method for decompression according to Figure 2 Method 200 generates compressed image data to provide image element values for selected sub-blocks of image data. Example decompression unit 1700 (which can form...) Figure 1(As part of the compression / decompression unit 112). The decompression unit 1700 includes a pattern identification unit 1702, an image element value (IEV) identification unit 1704, and a sub-block reconstruction unit 1706. The pattern identification unit 1702 is configured to identify the pattern associated with a selected sub-block from the compressed data block. Each sub-block is associated with a pattern directly (if the pattern is encoded) or indirectly (if a match is encoded). The IEV identification unit 1704 is configured to identify the associated IEV of the selected sub-block from the compressed data block. The sub-block reconstruction unit 1706 is used to reconstruct the selected sub-block based on the pattern and its associated IEV, and output the reconstructed sub-block. Reference will now be made to... Figure 18 Describe the operation of the decompression unit 1700 in detail.
[0159] Now for reference Figure 18 It illustrates example method 1800, which can be derived from... Figure 17 The decompression unit 1700 is implemented for decompressing compressed image data blocks generated according to the method described herein to produce selected sub-blocks of image data. As described above, the compressed image data block includes information identifying a pattern among a plurality of patterns associated with each sub-block of image data, and image element values associated with reconstructing the sub-block according to the pattern.
[0160] Method 1800 begins at step 1804, where pattern identification unit 1702 identifies a pattern associated with or related to the selected sub-block. In the compression algorithm described herein, each sub-block is directly (if the pattern is encoded) or indirectly (if a match is encoded) associated with one of a plurality of patterns. In either case, the associated pattern can be determined from the encoding format field used for the selected sub-block. Specifically, the encoding format field identifies the pattern associated with the sub-block or points to the sub-block associated with the associated pattern. If the encoding format field is stored in the header of the compressed block, pattern identification unit 1702 can read the header of the compressed block from memory to identify the pattern associated with or related to the selected sub-block.
[0161] If the compressed block is generated according to a compression algorithm that only supports pattern encoding, each sub-block will be directly associated with one of a plurality of patterns. In these cases, the compressed block may include information for each sub-block that directly identifies the pattern associated with said sub-block. For example, as described above, the compressed block may include an encoding format field for each sub-block that identifies the pattern associated with that sub-block. Therefore, in these cases, identifying the pattern associated with a selected sub-block may include reading the encoding format field of the selected sub-block and identifying the pattern thereby identified as the associated pattern of the selected sub-block. When the encoding format fields of the sub-blocks are of fixed length and are encapsulated in a predetermined order within the compressed block (e.g., a header), the pattern identification unit 1702 may be configured to determine the position of a particular encoding format field based on the length of each encoding format field and the order of the encoding format fields in the compressed block. For example, if each encoding format field is four bits, then the encoding format field of the nth sub-block (SBn) will be located in the n*4th bit of the header.
[0162] For example, if each encoding format field is four bits and the encoding format fields of sub-blocks are stored sequentially by sub-block, then if sub-block 5 (SB5) is selected, the pattern identification unit 1702 can be configured to determine that bits 20 to 23 of the header correspond to the encoding format field (SB5) of sub-block 5. The pattern identification unit can then read the encoding format field (SB5) of sub-block 5 at the identified location in the compressed block. For example, if the encoding format field of sub-block 5 (SB5) indicates that sub-block 5 (SB5) is associated with a P3C style, then the style identification unit 1702 can be configured to identify the P3C style as the associated style of sub-block 5 (SB5).
[0163] However, if the compressed blocks are generated according to a compression algorithm that supports both pattern encoding and match encoding, each sub-block can be either pattern-encoded or match-encoded. If a sub-block is pattern-encoded, the encoding format field can identify the pattern used to encode the sub-block. However, if the sub-block is match-encoded, the encoding format field can identify the match type pointing to the match sub-block. Therefore, in these cases, identifying the pattern associated with a selected sub-block may first involve determining whether the sub-block is pattern-encoded or match-encoded from the encoding format field used for the selected sub-block.
[0164] For example, now refer to Figure 19This illustrates an example method for identifying patterns associated with sub-blocks when generating compressed blocks according to compression algorithms that support pattern encoding and match encoding. The method begins at step 1902, where the encoding type of the selected sub-block is identified from an encoding format field of the selected sub-block. As described above, each encoding format field may include a value identifying a pattern or match type among multiple patterns. If the encoding format field of the selected sub-block indicates that the selected sub-block has been pattern-encoded (e.g., it identifies a pattern) (step 1904), then the pattern identified by the encoding format field is identified as the associated pattern of the selected sub-block (step 1906). For example, if the compressed block is... Figure 14 If the selected sub-block is sub-block 5 (SB5), then the pattern identification unit 1702 can be configured to read the encoding format field 14065 associated with sub-block 5 (SB5). The encoding format field 14065 of sub-block 5 (SB5) includes the binary value '1000', which, according to Table 3, identifies the pattern P3B. Therefore, sub-block 5 (SB5) is pattern-encoded, and the associated pattern is P3B.
[0165] However, if the encoding format field of the selected sub-block indicates that the selected sub-block is matched (e.g., it identifies the match type) (step 1904), then the matching sub-block is determined according to the match type (step 1908). The encoding format field of the matching sub-block is then read, and the pattern identified therefrom is identified as the relevant pattern for the selected sub-block (step 1910). For example, if the compressed block is... Figure 14 If the compressed block 1400 is selected and the chosen sub-block is sub-block 3 (SB3), then the pattern identification unit 1702 can be configured to read the encoding format field 14063 associated with sub-block 3 (SB3). The encoding format field 14063 of sub-block 3 (SB3) includes the binary value '1110', which, according to Table 3, identifies the match type, specifically a match line (MR). Therefore, sub-block 3 (SB3) is matched and encoded. Then, the pattern identification unit 1702 determines from the match type that the matching sub-block is the first sub-block in the line (i.e., sub-block 2 (SB2) in block 600). Then, the pattern identification unit 1702 reads the encoding format field 14062 of sub-block 2 (SB2). The encoding format field 14062 of sub-block 2 (SB2) has the binary value '0010', which identifies pattern P2B according to Table 3, therefore the pattern identification unit 1702 identifies pattern P2B as the associated pattern of sub-block 3 (SB3).
[0166] return Figure 18 Once the pattern identification unit 1702 identifies a pattern associated with or related to the selected sub-block, method 1800 proceeds to step 1806.
[0167] In step 1806, the IEV identification unit 1704 identifies image element values in the compressed image data block that are associated with or related to the selected sub-block. In the compression algorithm described herein, each sub-block is associated with one or more image element values, either directly (if pattern-coded) or indirectly (if match-coded), which, when combined with the associated pattern, can be used to reconstruct the sub-block.
[0168] In some cases, identifying the image element values in a compressed image data block associated with a selected sub-block may include identifying the number of associated image element values (e.g., from a pattern associated with the selected sub-block) and the location of the associated image element values (e.g., from an encoding format field of a previous sub-block in the compressed block).
[0169] Now for reference Figure 20 This illustrates an example method that can be implemented by IEV identification unit 1704 to identify image element values associated with or related to a selected sub-block. The method begins at step 2002, where IEV identification unit 1704 determines the number of image element values associated with the selected sub-block from the patterns associated with it (as identified in step 1804). As described above, each pattern is formed by a specific number of image element values, thus the pattern itself indicates the number of associated image element values in the compressed block. For example, pattern P1 is formed by one image element value, therefore the sub-block associated with pattern P1 will have one associated image element value. Similarly, pattern P3 is formed by three image element values, therefore the sub-block associated with pattern P3 will have three associated image element values.
[0170] Once the number of relevant image element values is determined, the method proceeds to step 2004, where IEV identification unit 1704 determines the location of the relevant IEVs in the compressed block. As described above, in some cases, the compressed block may contain IEV units for each pattern-coded sub-block. Each IEV unit includes a relevant IEV for the associated sub-block. The number of IEVs in each IEV unit is based on the pattern associated with the corresponding sub-block. For example, an IEV unit for a sub-block associated with pattern P3, formed by three IEVs, will have three IEVs. In contrast, an IEV unit for a sub-block associated with pattern P2, formed by two IEVs, will have two IEVs. The IEV units can be packed in the compressed block in a specific order.
[0171] In these cases, identifying the location of the relevant IEV may include determining the relevant IEV unit and then determining the number of IEVs in the compressed block preceding that IEV unit. If the sub-block is pattern-coded (as indicated in the encoding format field), the relevant IEV will be the IEV of that sub-block. In contrast, if the sub-block is match-coded (as indicated in the encoding format field), the relevant IEV will be the IEV of the matching sub-block. For example, if the compressed block is Figure 14 If the compressed block is 1400 and the selected sub-block is pattern-coded sub-block 5 (SB5), then the associated IEV unit is IEV unit 14085 associated with sub-block 5 (SB5). However, if the compressed block is... Figure 14 If the selected sub-block is a sub-block 3 (SB3) of the matching encoding (i.e., MR encoding), then the associated IEV unit is IEV unit 14082 associated with the matching sub-block (i.e., sub-block 2 (SB2)).
[0172] Then, the number of IEVs preceding the relevant IEV unit can be determined from the encoding format of the sub-blocks preceding the relevant sub-blocks in this sequence. Specifically, if there are two sub-blocks preceding the relevant sub-blocks in the sequence, one being a pattern encoded using the P2 pattern and the other using the P3 pattern, then there will be five IEVs preceding the relevant IEV. Therefore, the position of the relevant IEV unit can be determined as the body start address + 5 * (size IEV).
[0173] For example, if the compressed block is Figure 14 If the compressed block 1400 is selected and the chosen sub-block is sub-block 5 (SB5), then the associated IEV unit is IEV unit 14085 associated with sub-block 5 (SB5). In this example, the associated sub-block (sub-block 5) precedes sub-blocks 0-4 in sequence. Therefore, the IEV identification unit 1704 can be configured to read the encoding format fields 14060-14064 of sub-blocks 0-4 to determine how many IEVs precede the associated IEV unit in the compressed block. In this example, sub-block 0 is pattern-encoded using the P4 pattern (therefore there are 4 IEVs in this IEV unit), sub-block 1 is pattern-encoded using the P3 pattern (therefore there are 3 IEVs in this IEV unit), sub-block 2 is pattern-encoded using the P2 pattern (therefore there are 2 IEVs in this IEV unit), sub-block 3 is matched-coded (therefore there are no IEV units), and sub-block 4 is pattern-encoded using the P3 pattern (therefore there are 3 IEVs in this IEV unit). Therefore, there are 12 (4+3+2+3) IEVs before the relevant IEV unit in the main body. Therefore, the address of this IEV unit is the starting address of the object + (12 * (IEV size)).
[0174] Once the location of the relevant IEV has been determined (in step 2004), the IEV identification unit 1704 reads a certain number of IEVs from the determined location (e.g., reads a certain number of IEVs from the determined location in memory) (in step 2006), and then outputs the read IEVs as the relevant IEVs for the selected sub-block (in step 2008).
[0175] return Figure 18Once the relevant IEV of the sub-block has been identified, method 1800 proceeds to step 1808.
[0176] In step 1808, the sub-block reconstruction unit 1706 generates the selected sub-block based on the relevant pattern (identified in step 1804) and the relevant IEV (identified in step 1806). Specifically, the pattern identifies the position of the relevant IEV in the sub-block.
[0177] Therefore, it can be seen that the described pattern-based compression method allows any sub-block within a block to be decompressed without having to decompress the entire block. This thus reduces the waste of unnecessary IEV memory bandwidth.
[0178] Combining pattern-based compression and fixed-length compression methods
[0179] Tests have shown that, in some cases, the compression ratio can be further improved by using an alternative method, such as the fixed-length compression algorithm described in the applicant’s UK patent applications 1912183.9, 1912184.7, 1912795.0 and 1912800.8, to compress the original image element values (e.g., color values), rather than directly compressing the image element values (e.g., color values) generated by the rasterizer, and then using the pattern-based compression method described herein to compress the image element values.
[0180] Specifically, the identified UK patent application describes a method and system for compressing image data blocks comprising a plurality of image element values (e.g., color values), which can be divided into at least first values and second values (e.g., first channel color values and second channel color values), such that the image data includes at least two-dimensional blocks of first values (e.g., two-dimensional blocks for color values of the first color channel) and two-dimensional blocks of second values (e.g., two-dimensional blocks for color values of the second color channel). Each two-dimensional value block is compressed separately using one or more fixed-length compression algorithms.
[0181] Specifically, one or more two-dimensional value blocks are compressed by using a fixed-length compression algorithm to compress all or part of the two-dimensional value blocks. The values in the two-dimensional block (or a portion thereof) are represented by common basis information and a fixed-length parameter for each value in the block (or portion thereof), the fixed-length parameter having a length of zero, one, or more bits. The compressed image data block is then formed from the common basis information and the fixed-length parameter. By using a fixed-length compression algorithm to compress a two-dimensional block (or a portion thereof) of values, all values in the two-dimensional block (or that portion thereof) are represented using the same number of bits, thus making it easy to identify portions of compressed data associated with specific values.
[0182] Test Results
[0183] Now for reference Figure 21 It shows the encoding format of Table 3, which uses 8×8 blocks and 2×2 sub-blocks. Figure 2 The compression ratio of the method, for multiple benchmarks (TRex, Manhattan 3.0, Manhattan 3.2, CarChase, PUBG medium settings, Angry Birds, Leanback), in Figure 21 In Chinese, it is referred to as a "pattern". Figure 21 Also shown are compression ratios for the same benchmark using the random access compression method of UK patent applications 1912183.9, 1912184.7, 1912795.0 and 1912800.8, referred to as "Delta 8x8"; and compression ratios for the same benchmark using the pattern-based compression method described herein for 8×8 blocks compressed according to the random access compression method, which have... Figure 21 It is referred to as "Delta+Patterns".
[0184] from Figure 21 As can be seen, color values in complex 3D benchmarks with medium image quality, such as Manhattan 3.0, Manhattan 3.1, CarChase, and PUBG, can be compressed to 50% to 70% of their original size using the pattern-based compression method described here. Figure 21 It can also be seen that color values in less sophisticated 3D benchmarks such as Angry Birds and Leanback can be compressed to 30% of their original size using the pattern-based compression method described in this paper.
[0185] Figure 21 It is also shown that the compression ratio can be further improved by performing pattern-based compression on compressed data generated by a compression method based on image element values (such as a random accessible compression method described in the applicant's prior patent application).
[0186] Figure 22 A computer system is shown that can implement the compression unit, decompression unit, and compression / decompression unit described herein. The computer system includes a CPU 2202, a GPU 2204, a memory 2206, and other devices 2214, such as a display 2216, a speaker 2218, and a camera 2220. A processing block 2210 (which may be the compression unit, decompression unit, or compression / decompression unit described herein) is implemented on the GPU 2204. In other examples, the processing block 2210 may be implemented on the CPU 2202. Components of the computer system can communicate with each other via a communication bus 2222.
[0187] Figure 16-17The compression and decompression units are shown as comprising multiple functional blocks or units. This is merely illustrative and not intended to define a strict division between different logical elements of such entities. Each functional block or unit may be provided in any suitable manner. It should be understood that intermediate values described herein as being formed by blocks or units do not need to be physically generated by the compression or decompression unit at any point, and may merely represent logical values that conveniently describe the processing performed by the compression or decompression unit between its inputs and outputs.
[0188] The compression unit, decompression unit, and / or compression / decompression unit described herein can be implemented in hardware on an integrated circuit. The compression unit, decompression unit, and / or compression / decompression unit described herein can be configured to perform any of the methods described herein. Generally, any of the functions, methods, techniques, or components described above can be implemented in software, firmware, hardware (e.g., a fixed logic circuit system), or any combination thereof. The terms “module,” “function,” “component,” “element,” “unit,” “block,” and “logic” are used herein to generally denote software, firmware, hardware, or any combination thereof. In the case of a software implementation, a module, function, component, element, unit, block, or logic represents program code that, when executed on a processor, performs a specified task. The algorithms and methods described herein can be executed by one or more processors that execute code that causes the processor to perform the algorithm / method. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disk, flash memory, hard disk storage, and other memory devices that can store instructions or other data using magnetic, optical, and other techniques and are accessible by a machine.
[0189] As used herein, the terms computer program code and computer-readable instructions refer to any kind of executable code for a processor, comprising code expressed in machine language, interpreted language, or scripting language. Executable code includes binary code, machine code, bytecode, code defining integrated circuits (e.g., hardware description languages or netlists), and code expressed in programming languages such as C, Java, or OpenCL. Executable code can be, for example, any kind of software, firmware, script, module, or library that, when properly executed, processed, interpreted, compiled, or run in a virtual machine or other software environment, causes the processor of a computer system that supports the executable code to perform tasks specified by said code.
[0190] A processor, computer, or computer system can be any kind of device, machine, or special-purpose circuit, or a collection or part thereof, that has the processing power to execute instructions. A processor can be any kind of general-purpose or special-purpose processor, such as a CPU, GPU, system-on-a-chip, state machine, media processor, application-specific integrated circuit (ASIC), programmable logic array, field-programmable gate array (FPGA), etc. A computer or computer system may include one or more processors.
[0191] This invention also intends to encompass software, such as hardware description language (HDL) software, that defines the configuration of hardware as described herein for designing integrated circuits or for configuring programmable chips to perform desired functions. That is, a computer-readable storage medium may be provided on which computer-readable program code in the form of an integrated circuit definition dataset is encoded, which, when processed (i.e., executed) in an integrated circuit manufacturing system, configures the system to manufacture compression units, decompression units, or compression / decompression units configured to perform any of the methods described herein, or to manufacture a processor comprising any of the means described herein. The integrated circuit definition dataset may, for example, be an integrated circuit description.
[0192] Therefore, a method for manufacturing the system, compression unit, decompression unit, and / or compression / decompression unit as described herein in an integrated circuit manufacturing system can be provided. Furthermore, an integrated circuit definition dataset can be provided, which, when processed in the integrated circuit manufacturing system, causes the method for manufacturing the compression unit, decompression unit, and / or compression / decompression unit to be executed.
[0193] Integrated circuit definition datasets can be in the form of computer code, such as netlists, code for configuring programmable chips, or hardware description languages suitable for manufacturing at any level in integrated circuits, including register-transfer level (RTL) code, high-level circuit representations (such as Verilog or VHDL), and low-level circuit representations (such as OASIS(RTM) and GDSII). Higher-level representations (such as RTL) that logically define hardware suitable for manufacturing in integrated circuits can be processed on a computer system configured to generate manufacturing definitions of integrated circuits within the context of a software environment that includes definitions of circuit elements and rules for combining these elements to generate the manufacturing definition of the integrated circuit defined by that representation. As is typically the case where software executes at a computer system to define a machine, one or more intermediate user steps (e.g., providing commands, variables, etc.) may be required to configure the computer system to generate the manufacturing definition of the integrated circuit, executing code that defines the integrated circuit to generate the manufacturing definition of the integrated circuit.
[0194] Now refer to Figure 23 This describes an example of processing integrated circuit definition datasets at an integrated circuit manufacturing system in order to configure the system to manufacture compression units, decompression units, and / or compression / decompression units.
[0195] Figure 23 An example of an integrated circuit (IC) manufacturing system 2302 is shown, configured to manufacture compression units, decompression units, and / or compression / decompression units as described in any of the examples herein. Specifically, the IC manufacturing system 2302 includes a layout processing system 2304 and an integrated circuit generation system 2306. The IC manufacturing system 2302 is configured to receive an IC definition dataset (e.g., defining compression units, decompression units, and / or compression / decompression units as described in any of the examples herein), process the IC definition dataset, and generate an IC (e.g., embodying a compression unit, decompression unit, or compression / decompression unit as described in any of the examples herein) based on the IC definition dataset. The processing of the IC definition dataset configures the IC manufacturing system 2302 to manufacture an integrated circuit containing compression units, decompression units, or compression / decompression units as described in any of the examples herein.
[0196] The layout processing system 2304 is configured to receive and process an IC definition dataset to determine a circuit layout. Methods for determining a circuit layout based on an IC definition dataset are known in the art and may involve, for example, synthesizing RTL code to determine the gate-level representation of the circuit to be generated, for example, in relation to logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining the location information of the logic components, the circuit layout can be determined based on the gate-level representation of the circuit. This can be done automatically or with user intervention to optimize the circuit layout. Once the layout processing system 2304 has determined the circuit layout, it can output the circuit layout definition to the IC generation system 2306. The circuit layout definition may be, for example, a circuit layout description.
[0197] As is known in the art, IC generation system 2306 generates ICs according to a circuit layout definition. For example, IC generation system 2306 can implement a semiconductor device manufacturing process for generating ICs, which may involve a multi-step sequence of photolithography and chemical processing steps, during which electronic circuits are gradually formed on a wafer made of semiconductor material. The circuit layout definition may be in the form of a mask, which can be used in the photolithography process to generate ICs according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 2306 may be in the form of computer-readable code, which IC generation system 2306 can use to form a suitable mask for generating ICs.
[0198] The various processes performed by the IC manufacturing system 2302 may all be implemented in one location, for example, by one party. Alternatively, the IC manufacturing system 2302 may be a distributed system, allowing some processes to be performed in different locations and by different parties. For example, some of the following stages may be performed in different locations and / or by different parties: (i) synthesizing RTL code representing an IC definition dataset to form a gate-level representation of the circuit to be generated; (ii) generating a circuit layout based on the gate-level representation; (iii) forming a mask based on the circuit layout; and (iv) using the mask to manufacture the integrated circuit.
[0199] In other examples, processing of an integrated circuit definition dataset at an integrated circuit manufacturing system can configure the system to manufacture compression, decompression, or compression / decompression units without processing the IC definition dataset to determine circuit layout. For example, an integrated circuit definition dataset can define the configuration of a reconfigurable processor, such as an FPGA, and processing of the dataset can configure the IC manufacturing system (e.g., by loading configuration data into the FPGA) to generate a reconfigurable processor with the defined configuration.
[0200] In some implementations, when processed in an integrated circuit manufacturing system, an integrated circuit manufacturing definition dataset can enable the integrated circuit manufacturing system to generate devices as described herein. For example, using an integrated circuit manufacturing definition dataset, as described above regarding... Figure 23 The configuration of the integrated circuit manufacturing system described herein enables the production of devices as described in this document.
[0201] In some examples, an integrated circuit definition dataset may include software running on hardware defined at the dataset, or software running in combination with hardware defined at the dataset. Figure 23 In the example shown, the IC generation system can also be additionally configured by the integrated circuit definition dataset to load firmware onto the integrated circuit according to the program code defined in the integrated circuit definition dataset during the manufacturing of the integrated circuit, or otherwise provide the integrated circuit with program code for use with the integrated circuit.
[0202] Compared to known implementations, the implementation of the concepts set forth in this application in devices, apparatuses, modules, and / or systems (and in the methods implemented herein) can lead to performance improvements. Performance improvements may include one or more of increased computational performance, reduced latency, increased throughput, and / or reduced power consumption. During the manufacture of such devices, apparatuses, modules, and systems (e.g., in integrated circuits), trade-offs can be made between performance improvements and physical implementation methods, thereby improving manufacturing methods. For example, a trade-off can be made between performance improvements and layout area to match the performance of known implementations but using less silicon. This can be accomplished, for example, by reusing functional blocks serially or sharing functional blocks among elements of a device, apparatus, module, and / or system. Conversely, the concepts set forth in this application that lead to improvements in the physical implementation of devices, apparatuses, modules, and systems (such as reduced silicon area) can be traded off for performance improvements. This can be accomplished, for example, by manufacturing multiple instances of a module within a predefined area budget.
[0203] The applicant has independently disclosed each individual feature described herein, as well as any combination of two or more such features, to the extent that such features or combinations can be implemented based on the specification as a whole, in accordance with the common knowledge of those skilled in the art, regardless of whether such features or combinations of features solve any problem disclosed herein. In view of the foregoing description, those skilled in the art will understand that various modifications can be made within the scope of this invention.
Claims
1. A method for compressing a block of element values in a two-dimensional image, the method comprising: The two-dimensional image element value block is divided into multiple image element value sub-blocks; The image element values of the first sub-block among the multiple patterns are used to identify which of the multiple patterns is formed by the pattern of the first sub-block. The compressed image element value block is formed by encoding the first sub-block in the compressed image element value block using the following: (i) information identifying the pattern, and (ii) the image element value of the first sub-block forming the pattern; Determine a set of one or more sub-blocks that have one or more predetermined relationships with the first sub-block from the plurality of sub-blocks using the mask; Determine whether each sub-block in the one or more sub-block sets matches the first sub-block; as well as In response to determining that each sub-block in the set of one or more sub-blocks matches the first sub-block, each sub-block in the set of one or more sub-blocks in the compressed image element value block is encoded with information identifying that the sub-block belongs to the set of sub-blocks that match the first sub-block.
2. The method according to claim 1, further comprising: Identify which of the multiple patterns is formed by the image element values of another sub-block among the multiple sub-blocks; as well as The other sub-block in the compressed image element value block is encoded using the following: (i) information identifying the pattern of the other sub-block, and (ii) the image element values of the other sub-block that form the pattern of the other sub-block.
3. The method according to claim 1, further comprising: Determine whether the second sub-block among the plurality of sub-blocks matches the first sub-block; as well as In response to determining that the second sub-block matches the first sub-block, the second sub-block in the compressed image element value block is encoded using information indicating that the second sub-block matches the first sub-block.
4. The method of claim 3, wherein the plurality of sub-blocks are ordered, and the determination is performed if the second sub-block immediately follows the first sub-block in the order.
5. The method of claim 3, wherein the plurality of sub-blocks are sorted, and the determination is performed if the first sub-block and the second sub-block are separated in sequence by a single sub-block.
6. The method according to claim 1, wherein if the sub-block set and the first sub-block form a sub-block row, then the sub-block set and the first sub-block have a predetermined relationship.
7. The method according to claim 1, wherein if the sub-block set and the first sub-block form a sub-block column, then the sub-block set and the first sub-block have a predetermined relationship.
8. The method of claim 1, wherein if the set of sub-blocks and the first sub-block form a sub-block... x If a block is defined as a set of sub-blocks, then the set of sub-blocks has a predetermined relationship with the first sub-block, wherein... and It is an integer greater than or equal to one.
9. The method according to any one of claims 1 to 8, wherein forming the compressed image element value block includes forming a header of the compressed image element value block, wherein the header includes information identifying the pattern formed by the image element values of the first sub-block; and / or forming a body of the compressed image element value block, wherein the body includes the image element values of the first sub-block forming the pattern.
10. The method according to any one of claims 1 to 8, wherein each of the plurality of patterns defines the number of image element values in a sub-block and the position of the image element values.
11. The method according to any one of claims 1 to 8, wherein each image element value is a color value.
12. The method according to any one of claims 1 to 8, wherein each image element value is a compressed value representing a color value.
13. The method according to any one of claims 1 to 8, wherein the two-dimensional image element value block comprises image element values generated by a rasterization process on a graphics processing unit.
14. The method according to any one of claims 1 to 8, wherein each sub-block comprises x Image element value blocks, where and It is an integer greater than or equal to one.
15. The method according to any one of claims 1 to 8, further comprising storing the compressed image element value block in a memory.
16. A compression unit for compressing a two-dimensional image element value block, wherein the two-dimensional image element value block can be divided into multiple image element value sub-blocks, the compression unit comprising: A pattern selection unit is configured to identify which of a plurality of patterns is formed by the image element values of the first sub-block among the plurality of sub-blocks; An image element value selection unit is configured to identify the image element values of the first sub-block that forms the identified pattern; A compressed block generation unit is configured to form a compressed image element value block by encoding the first sub-block in the compressed image element value block using the following: (i) information identifying the identified pattern, and (ii) the identified image element value. as well as The matching unit is configured as follows: Determine a set of one or more sub-blocks that have one or more predetermined relationships with the first sub-block from the plurality of sub-blocks using the mask; Determine whether each sub-block in the one or more sub-block sets matches the first sub-block; as well as In response to determining that each sub-block in the set of one or more sub-blocks matches the first sub-block, each sub-block in the set of one or more sub-blocks in the compressed image element value block is encoded with information identifying that the sub-block belongs to the set of sub-blocks that match the first sub-block.
17. A computer-readable storage medium having stored thereon computer-readable instructions that, when executed at a computer system, cause the computer system to perform the method according to any one of claims 1 to 15.
18. A computer-readable storage medium storing a computer-readable description of a compression unit as claimed in claim 16, wherein when processed in an integrated circuit manufacturing system, the computer-readable description causes the integrated circuit manufacturing system to manufacture an integrated circuit embodying the compression unit.
Citation Information
Patent Citations
Random accessible image data compression
GB201912183D0
Methods and decompression units for decompressing a compressed block of image data
GB201912184D0
Random accessible image data compression
GB201912795D0
Data compression
GB2530311A
Methods and decompression units for decompressing a compressed block of image data
GB2586517B