Image data decompression

The image data is represented by the origin value and the difference value, and the channel difference is represented by the first digit and the second digit, which solves the complexity of image data compression and decompression in small devices, and realizes efficient compression and decompression, which is suitable for Small low-cost and low-power systems.

CN112422980BActive Publication Date: 2024-12-06IMAGINATION TECH LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202010846903.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-03-31
Filing Date
2020-08-21
Publication Date
2024-12-06
Estimated Expiration
2040-08-21

AI Technical Summary

Technical Problem

The prior art is difficult to achieve lossless compression and lossy compression in small, low-cost and low-power computing systems, and traditional high-end lossy compression algorithms are complex and not suitable for small devices, and cannot effectively reduce memory bandwidth and power consumption.

Method used

Using a method, the image data is represented by the origin value and the difference value, and the difference value of the channel is represented by the first and second digits, ensuring that the compressed data meets the target compression level, achieving lossless or lossy compression and decompression, reducing Hardware requirements.

Benefits of technology

Efficient image data compression and decompression is achieved in small, low-cost and low-power systems, reducing hardware requirements and power consumption, ensuring data quality, and suitable for scenarios such as mobile devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112422980B_ABST
    Figure CN112422980B_ABST
Patent Text Reader

Abstract

The present disclosure relates to image data decompression. The present invention provides a computer-implemented method, comprising: reading an indication of an origin value for each of one or more channels from compressed data. For each of the one or more channels, reading an indication of a first bit number for representing a difference value from the compressed data, the difference value representing the difference between the data value and the origin value of the channel. Obtaining a second bit number for each of the one or more channels, including a representation of the difference value for each of the one or more channels in the compressed data using the second bit number of the channel. Using the second bit number obtained for the one or more channels, reading a representation of the difference value for one or more image element values ​​to be decompressed from the compressed data. Based on the representation of the difference value read from the compressed data, for each of the one or more channels and for each of the one or more image element values ​​to be decompressed, determining a difference value according to the first bit number of the channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to data compression and data decompression. Background Art

[0002] Data compression, whether lossless or lossy, is desirable in many applications where data is stored in and / or read 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 corresponding pixels or sampling positions of an image. For example, an image may be generated as part of a rendering process on a graphics processing unit (GPU). Image data may include, but is not limited to, depth data to be stored in a depth buffer, pixel data (e.g., color data) to be stored in a frame buffer, texture data to be stored in a texture buffer, surface normal data to be stored in a surface normal buffer, and illumination data to be stored in an illumination buffer. These buffers may be any suitable type of memory, such as a cache memory, a separate memory subsystem, a storage area in a shared memory system, or some combination thereof.

[0003] GPU can be used to process data in order to generate image data. For example, GPU can determine the pixel value (for example, color value) of the image to be stored in the frame buffer, and this pixel value can be output to the display. GPU usually has a highly parallelized structure for parallel processing of large data blocks. There is great commercial pressure to operate GPU (especially those GPUs intended to be implemented on mobile / embedded devices) with reduced latency, reduced power consumption and reduced physical size (for example, reduced silicon area). Competition for these goals expects to use higher quality rendering algorithms to produce higher quality images. Reducing memory bandwidth (that is, reducing the amount of data transmitted between GPU and memory) can significantly reduce the latency and power consumption of the system, which is the reason why compressing data before transmitting data may be particularly useful. When considering the data moving around in the GPU itself, this is also applicable to a lesser extent. Moreover, the same problem may be related to other processing units, such as central processing units (CPUs) and GPUs.

[0004] Figure 1 An exemplary graphics processing system 100 that can be implemented in an electronic device such as a mobile / embedded device is shown. Graphics processing system 100 includes a GPU 102 and a memory 104 (eg, graphics memory). Data (which can be compressed data) can be transferred between GPU 102 and memory 104 in either direction.

[0005] GPU 102 includes processing logic 106, memory interface 108, compression unit 110, and decompression unit 112. In some examples, the compression unit and the decompression unit may be combined into a single unit that may perform both compression and decompression.

[0006] In operation, GPU 102 may process regions of image data individually. The regions may represent, for example, rectangular (including square) portions (or "tiles") of a rendering space (i.e., a two-dimensional space representing, for example, an image region to be rendered). Processing logic 106 may perform rasterization of graphics primitives (e.g., but not limited to, triangles and lines) using known techniques such as depth testing and texture mapping. Processing logic 106 may include a cache unit to reduce memory traffic. Some data is read from or written to memory 104 by processing logic 106 via memory interface 108. In Figure 1 In the example shown, data being written from processing logic 106 to memory 104 is passed from processing logic 106 to memory interface 108 via compression unit 110. Compression unit 110 may compress the data before passing it to the memory interface. Figure 1 In the example shown, data being read from memory 104 by processing logic 106 is passed from memory interface 108 to processing logic 106 via decompression unit 112. Decompression unit 112 may decompress the data (if it has been compressed) before passing it to processing logic 106. The use of compression unit 110 and decompression unit 112 means that compressed data may be passed between memory interface 108 and memory 104, thereby reducing the amount of data to be transferred to memory 104 over the external memory bus.

[0007] As known to those skilled in the art, the processing logic 106 of the GPU 102 can generate a set of one or more color values ​​(e.g., RGB or RGBA) for each pixel in the rendering space, and store the color values ​​in a frame buffer (e.g., in the memory 104). The set of color values ​​for a frame may be referred to as color data or image data in this article. The processing logic 106 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 the memory. In some cases, these buffers may be referred to as frame buffers, while in other cases, the term "frame buffer" may be reserved for buffers that store color values ​​or store data to be sent to a display. In some graphics rendering systems, when performing one or more subsequent renderings, the processing logic 106 may use the image data values ​​stored in the buffer for a particular rendering. For example, the color values ​​generated by one rendering may represent a texture that may be stored in the memory 104 (e.g., in compressed form), and the texture may be read from the memory 104 (e.g., and decompressed) to be applied to the surface as a texture in one or more subsequent renderings. Similarly, the surface normal values ​​generated for a geometric model in one rendering can be used to apply lighting effects to the same model during rendering one or more subsequent renderings. In addition, the surface depth values ​​generated and stored in one rendering can be read back to be used to render one or more subsequent renderings of the same model.

[0008] Because image data (e.g., color data) can be quite large, the memory bandwidth associated with writing the image data to and reading the image data from the buffer in memory can be a significant portion of the total memory bandwidth of the graphics processing system and / or GPU. Therefore, the image data is typically compressed via compression unit 110 before being stored in the buffer and decompressed via decompression unit 112 after being read from the buffer.

[0009] When data is compressed using a lossless compression technique and then decompressed using a complementary lossless decompression technique, the original data can be recovered without losing data (assuming no errors occurred during the compression or decompression process). The degree to which the data is compressed can be expressed as a compression ratio, where the compression ratio is obtained by dividing the size of the uncompressed data by the size of the compressed data. The compression ratio achieved by a lossless compression technique generally depends on the data being compressed. For example, lossless compression techniques are often able to achieve relatively high compression ratios when compressing highly correlated data; while lossless compression techniques are often able to achieve relatively low compression ratios when compressing unrelated (e.g., random) data. Therefore, it is difficult to guarantee that a lossless compression technique will achieve a specific compression ratio (e.g., a compression ratio of 2:1). Therefore, if only lossless compression techniques are used, the system must generally be able to handle situations where the desired compression ratio (e.g., 2:1) cannot be achieved, as well as situations where, for example, no compression can be produced at all using lossless compression techniques.

[0010] In some cases, guaranteeing a compression ratio may be considered more important than guaranteeing that no data is lost during compression. For example, guaranteeing a compression ratio allows a memory footprint to be reduced, which is necessary to ensure that compressed data blocks can be stored. Guaranteeing a compression ratio may allow the size (e.g., silicon area) of memory 104 to be reduced. In these cases, lossy compression techniques may be used, which may achieve a guaranteed compression ratio, but some data may be lost during the compression process. Summary of the invention

[0011] This Summary is provided to introduce some concepts that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

[0012] A computer-implemented method of performing decompression to determine one or more image element values ​​from compressed data, wherein the compressed data represents a block of image data including a plurality of image element values, each image element value including one or more data values ​​associated with a corresponding one or more channels, the method comprising:

[0013] reading from the compressed data an indication of an origin value for each of the one or more channels;

[0014] for each of the one or more channels, reading from the compressed data an indication of a first bit number representing a difference value, the difference value representing a difference between the data value and an origin value for the channel;

[0015] for each of the one or more channels, obtaining a second bit number, wherein a representation of a difference value for each of the one or more channels is included in the compressed data using the second bit number for the channel;

[0016] reading from the compressed data a representation of the difference for decompressed one or more image element values ​​using the one or more second bit numbers obtained for the corresponding one or more channels;

[0017] determining, for each of the one or more channels and for each of the one or more image element values ​​being decompressed, a difference value according to the first number of bits of the channel based on a representation of the difference value read from the compressed data; and

[0018] For each of the one or more channels, a data value associated with the channel is determined for each of the one or more image element values ​​being decompressed using: (i) an origin value for the channel, and (ii) a difference value for the channel determined for the image element value.

[0019] The difference value of a channel determined for a picture element value may have the first number of bits of the channel.

[0020] Determining, for each of the one or more channels and for each of the one or more image element values ​​being decompressed, a difference value based on the first bit number of the channel may include adding zero, one or more least significant bits to a representation of the difference value read from the compressed data, thereby determining a difference value having the first bit number for each of the one or more channels.

[0021] The zero, one or more least significant bits added to the representation of the difference value read from the compressed data may be all zero.

[0022] The zero, one or more least significant bits added to the representation of the difference value read from the compressed data may be all ones.

[0023] The zero, one or more least significant bits added to the representation of the difference value of a channel read from the compressed data may be equal to the corresponding zero, one or more most significant bits of the origin value of the channel.

[0024] The zero, one or more least significant bits added to the representation of the difference value read from the compressed data may be random bits or pseudo-random bits.

[0025] The zero, one or more least significant bits added to the difference representation of the channels read from the compressed data may be different for different ranges of origin values ​​or for different ranges of different values.

[0026] The one or more second bit numbers may be determined to ensure that the compressed data meets a target compression level for compressing the block of image data.

[0027] Obtaining the second bit number for each of the one or more channels may include using the first bit number of each of the one or more channels to determine the second bit number of the channel according to a predetermined scheme.

[0028] Using the first bit number of each of the one or more channels to determine the second bit number of the channel according to a predetermined scheme may include determining whether the difference of the one or more channels represented by the corresponding determined one or more first bits meets the target compression level, wherein, if it is determined that the difference of the one or more channels represented by the corresponding determined one or more first bits meets the target compression level, then for each of the one or more channels, the second bit number may be equal to the first bit number of the channel; and wherein, if it is determined that the difference of the one or more channels represented by the corresponding determined one or more first bits does not meet the target compression level, then for at least one of the one or more channels, the second bit number may be less than the first bit number of the channel.

[0029] There may be a threshold number of bits for each of the one or more channels, wherein if a first number of bits for a channel is less than or equal to the threshold number of bits for the channel, then the second number of bits for the channel may be equal to the first number of bits for the channel, and wherein if the first number of bits for a channel is greater than the threshold number of bits for the channel, then the second number of bits for the channel may be within the range from the threshold number of bits for the channel to the first number of bits for the channel.

[0030] The threshold number of bits may be the same for each of the one or more channels. Alternatively, it may be the case that the threshold number of bits is not the same for each of the one or more channels.

[0031] Obtaining, for each of the one or more channels, a second number of bits may include reading an indication of the second number of bits for the channel from the compressed data.

[0032] Determining, for each of the one or more channels, a data value associated with the channel for each of the one or more decompressed image element values ​​may comprise summing an origin value of the channel and a difference value of the channel determined for the image element value.

[0033] Determining, for each of the one or more channels, a data value associated with the channel for each of the one or more decompressed image element values ​​may include subtracting a difference value for the channel determined for the image element value from an origin value for the channel.

[0034] Determining, for each of the one or more channels, a data value associated with the channel for each of the one or more decompressed image element values ​​may include combining, using a modulo operation, an origin value for the channel and a difference value for the channel determined for the image element value.

[0035] The compressed data may include multiple origin values ​​for at least one of the one or more channels, wherein an indication may be included in the compressed data to indicate from which of the multiple origin values ​​each difference value of the at least one of the one or more channels has been determined; wherein, for the at least one of the one or more channels, determining a channel-related data value for each of the one or more image element values ​​being decompressed may include using: (i) an origin value for the channel, the origin value being indicated by a difference value for the channel determined for the image element value; and (ii) a difference value for the channel determined for the image element value.

[0036] The compressed data may be in a compressed data block comprising: a header portion having a fixed size and comprising an indication of the origin value and an indication of the first number of bits for each of the one or more channels; and a body portion having a variable size and comprising a representation of the difference value for each of the one or more channels.

[0037] The compressed data block may have a base address, and wherein the header portion may start at a first address defined by the base address, wherein data of the header portion runs from the first address in a first direction, and wherein the body portion may start at a second address defined by the base address, wherein data of the body portion runs from the second address in a second direction, wherein, in the address space, the first direction is opposite to the second direction.

[0038] The one or more channels may include a plurality of channels. The plurality of channels may include a red channel, a green channel, a blue channel, and an alpha channel.

[0039] The method may further comprise performing a re-correlation of data values ​​associated with a plurality of channels determined for each of the one or more image element values ​​being decompressed, thereby introducing correlation between different data values ​​associated with different channels of the image element values.

[0040] The one or more channels may consist of a single channel.

[0041] The method may also include determining one or more error correction indicators based on the determined data values ​​of the one or more image element values ​​being decompressed; reading one or more error correction indicators from the compressed data; and comparing the determined one or more error correction indicators with the one or more error correction indicators read from the compressed data to determine whether there is an error in the determined data values ​​of the one or more image element values ​​being decompressed.

[0042] An image element value may be a pixel value, a texel value, a depth value, a surface normal, or a lighting value.

[0043] The method may further comprise outputting the determined data values ​​of the decompressed one or more image element values ​​for further processing.

[0044] Dedicated hardware may be used to perform the method.

[0045] There is provided a decompression unit configured to perform decompression to determine one or more image element values ​​from compressed data, wherein the compressed data represents a block of image data comprising a plurality of image element values, each image element value comprising one or more data values ​​associated with a corresponding one or more channels, the decompression unit comprising:

[0046] data value determination logic configured to read from the compressed data an indication of an origin value for each of the one or more channels; and

[0047] A difference determination logic configured to:

[0048] for each of the one or more channels, reading from the compressed data an indication of a first bit number representing a difference value, the difference value representing a difference between the data value and an origin value for the channel;

[0049] for each of the one or more channels, obtaining a second bit number, wherein a representation of a difference value for each of the one or more channels is included in the compressed data using the second bit number for the channel;

[0050] reading from the compressed data a representation of a difference in one or more image element values ​​being decompressed using the one or more second bit numbers obtained for the corresponding one or more channels; and

[0051] determining, for each of the one or more channels and for each of the one or more image element values ​​being decompressed, a difference value according to the first number of bits of the channel based on a representation of the difference value read from the compressed data;

[0052] The data value determination logic is further configured to determine, for each of the one or more channels, a data value associated with the channel for each of the decompressed one or more image element values ​​using: (i) an origin value for the channel, and (ii) a difference value for the channel determined for the image element value.

[0053] There may be provided a decompression unit configured to perform any of the decompression methods described herein.

[0054] A method for manufacturing a decompression unit as described herein using an integrated circuit manufacturing system may be provided, the method comprising: processing a computer-readable description of a compression unit using a layout processing system to generate a circuit layout description of an integrated circuit embodying the decompression unit; and manufacturing the decompression unit according to the circuit layout description using an integrated circuit generation system.

[0055] A computer-implemented method of compressing a block of image data to meet a target compression level may be provided, wherein the block of image data comprises a plurality of image element values, each image element value comprising one or more data values ​​associated with a corresponding one or more channels, the method comprising:

[0056] For each of the one or more channels:

[0057] determining an origin value of the channel for the block;

[0058] determining a difference value representing a difference between the data value and an origin value of the channel determined for the block; and

[0059] determining, for the block, a first number of bits for losslessly representing a maximum difference value among the difference values ​​of the channels;

[0060] determining, using the first bit number determined for each of the one or more channels, corresponding one or more second bit numbers for each of the one or more channels, the one or more second bit numbers being determined such that each difference value of the one or more channels represented by the corresponding one or more second bit numbers satisfies a target compression level for compressing the block of image data; and

[0061] forming compressed data, wherein for each channel of the one or more channels, the compressed data comprises:

[0062] an indication of an origin value determined for said channel;

[0063] an indication of the first bit number determined for the channel; and

[0064] Representations of the difference values ​​determined for the channels, wherein each of the representations of the difference values ​​determined for the channels uses the second number of bits determined for the channels such that the target compression level is met.

[0065] There may be provided a compression unit configured to compress a block of image data to meet a target compression level, wherein the block of image data comprises a plurality of image element values, each image element value comprising one or more data values ​​associated with a respective one or more channels, the compression unit comprising:

[0066] and analyzer logic configured to determine, for each of the one or more channels:

[0067] an origin value for the channel of the block; and

[0068] a first bit number for losslessly representing a maximum difference value for the channel for the block;

[0069] difference determination logic configured to determine, for each of the one or more channels, a difference value representing a difference between the data value and an origin value for the channel determined for the block;

[0070] difference magnitude determination logic configured to determine, using the first number of bits determined for each of the one or more channels, corresponding one or more second number of bits for each of the one or more channels, the one or more second number of bits such that each difference value representing the difference values ​​of the one or more channels using the corresponding one or more second number of bits satisfies a target compression level for compressing a block of image data; and

[0071] compressed data forming logic configured to form compressed data, wherein for each channel of the one or more channels, the compressed data comprises:

[0072] an indication of an origin value determined for said channel;

[0073] an indication of the first bit number determined for the channel; and

[0074] Representations of the difference values ​​determined for the channels, wherein each of the representations of the difference values ​​determined for the channels uses the second number of bits determined for the channels such that the target compression level is met.

[0075] The compression unit and / or the decompression unit may be implemented in hardware on an integrated circuit. A method of manufacturing a compression unit and / or a decompression unit in an integrated circuit manufacturing system may be provided. An integrated circuit definition data set may be provided, which, when processed in the integrated circuit manufacturing system, configures the system to manufacture the compression unit and / or the decompression unit. A non-transitory computer-readable storage medium may be provided, having stored thereon a computer-readable description of an integrated circuit, which, when processed in the integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit including the compression unit and / or the decompression unit.

[0076] An integrated circuit manufacturing system can be provided, the integrated circuit manufacturing system comprising: a non-temporary computer-readable storage medium on which a computer-readable integrated circuit description describing a compression unit and / or a decompression unit is stored; a layout processing system, the layout processing system being configured to process the integrated circuit description so as to generate a circuit layout description of an integrated circuit embodying the compression unit and / or the decompression unit; and an integrated circuit generation system, the integrated circuit generation system being configured to manufacture the compression unit and / or the decompression unit based on the circuit layout description.

[0077] A computer program code for performing a method as described herein may be provided. In other words, a computer readable code may be provided, which is configured to cause any of the methods described herein to be performed when the code is run. A non-transitory computer readable storage medium having computer readable instructions stored thereon may be provided, which when executed at a computer system causes the computer system to perform a method as described herein.

[0078] As will be apparent to those skilled in the art, the above-described features may be combined as appropriate and may be combined with any aspects of the examples described herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] The present invention will now be described by way of example with reference to the accompanying drawings, in which:

[0080] Figure 1 A graphics processing system is shown wherein a compression unit and a decompression unit are implemented within a graphics processing unit;

[0081] Figure 2 An image data array comprising blocks of image data is shown;

[0082] Figure 3 A compression unit is shown;

[0083] Figure 4 is a flow chart of a method of compressing a block of image data to meet a target compression level;

[0084] Figure 5a An exemplary format for storing four compressed data blocks is shown;

[0085] Figure 5b An exemplary format for data within a header portion of a compressed data block is shown;

[0086] Figure 6 A decompression unit is shown;

[0087] Figure 7 is a flow chart of a method of performing decompression to determine one or more image element values ​​from compressed data;

[0088] Figure 8 A computer system implementing a graphics processing unit is shown; and

[0089] Fig. 9 An integrated circuit manufacturing system for producing an integrated circuit embodying a compression unit or a decompression unit as described herein is shown.

[0090] The accompanying drawings show various examples. It will be appreciated by the skilled person that the element boundaries (e.g., boxes, groups of boxes, or other shapes) shown in the accompanying drawings represent an example of boundaries. In some examples, it may be the case that an 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 accompanying drawings to indicate similar features. DETAILED DESCRIPTION

[0091] The following description is given by way of example to enable a person 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 apparent to a person skilled in the art. The embodiments are described by way of example only.

[0092] As described above, compression techniques (and complementary decompression techniques) that guarantee that a target compression level is met (e.g., guarantee that a compression ratio, e.g., 2:1, is met) may be useful without excessive loss of data quality, e.g., without visually perceptible artifacts introduced into the image due to the loss caused by the compression. The target compression level is met if the compression ratio achieved is equal to or greater than the compression ratio of the target level. Some previous high-end lossy compression algorithms can achieve a fixed compression ratio without excessive loss of data quality, but these previous high-end lossy compression algorithms involve performing complex operations (e.g., filtering, multiplication, and division operations) on floating-point or fixed-point values ​​and may require internal buffering of values ​​during the compression process. Therefore, these previous high-end lossy compression algorithms are generally considered unsuitable for use in small, low-cost and / or low-power computing systems, such as may be implemented in mobile devices (such as smart phones and tablets or other devices where size, cost, and / or power are particularly limited).

[0093] Examples of compression and decompression techniques are described herein that ensure that a target compression level is met (e.g., a fixed compression ratio, such as 2:1, is met) without excessive loss of data quality (e.g., no significant visually perceptible artifacts are introduced into the image due to the loss caused by compression), and can be implemented in small, low-cost and low-power computing systems. The examples described herein are easy to implement. For example, these examples can operate on image element values ​​in integer format rather than floating point format, and can be performed by performing simple operations (e.g., addition, subtraction, and comparison operations) instead of performing more complex operations (which may be large and / or expensive, for example, in terms of the amount of data required to represent the value or the size of the hardware logic required to implement the value), such as multiplication or division operations, and do not require as much internal buffering of values ​​during the compression or decompression process as in the previous high-end compression and decompression algorithms described above. In these examples, these simple operations (e.g., addition, subtraction, and comparison operations) are "integer operations", meaning that they operate on integers, such as image element values ​​in integer format.

[0094] The compression techniques described herein can be implemented in a compression unit implemented with dedicated hardware (e.g., using fixed function circuits). Similarly, the decompression techniques described herein can be implemented in a decompression unit implemented with dedicated hardware (e.g., using fixed function circuits). In these examples, the compression unit and the decompression unit can be smaller in physical size (e.g., silicon area) when compared to previous high-end compression and decompression units implemented with hardware. The compression unit and the decompression unit described herein are suitable for implementation in a small, low-cost processing unit (e.g., GPU or CPU) with a small silicon area and low power consumption and low latency. This is achieved without reducing data quality (e.g., image quality) too much.

[0095] In addition, the compression techniques described herein allow compression to be lossless if this will meet the target compression level for compressing the image data block. However, if the lossless compression of the image data block does not meet the target compression level, the compression becomes lossy in order to ensure that the target compression level is met. In the examples described herein, instead of having separate lossless compression units and lossy compression units, a single compression unit can be used to perform lossless compression or lossy compression to compress the image data block. Using a single compression unit to perform lossless compression and lossy compression can reduce the total hardware implemented in the device (e.g., the silicon area implemented in the device can be reduced), and the power consumption of the device can be reduced. Similarly, in the examples described herein, instead of having separate lossless and lossy decompression units, a single decompression unit can be used to perform lossless decompression or lossy decompression to compress the image data block. Using a single decompression unit to perform lossless decompression and lossy decompression may reduce the overall hardware implemented in a device (eg, may reduce the silicon area implemented in a device) and may reduce power consumption of the device, compared to implementing separate units for lossless decompression and for lossy decompression.

[0096] The image data to be compressed may be represented as a 2D array of image element values ​​(e.g., pixel values). Each image element value includes one or more data values ​​associated with a corresponding one or more channels. For example, there may be multiple channels, such as red (R), green (G), blue (B), and alpha (A) channels. Figure 2 An image data array 200 comprising image data blocks is shown. In this example, the image data array 200 represents an image represented by pixel values, wherein the image data blocks are Figure 2 4x4 pixel value blocks represented as 2020, 2021, 2022 and 2023 in the image data array. In other examples, the image data blocks may have different sizes and / or shapes. In addition, in other examples, there may be more than (or less than) four image data blocks in the image data array.

[0097] The examples described herein relate to compressing and decompressing blocks of pixel values, where the pixel values ​​represent an image. However, it should be understood that a pixel value is only one example of an image element value that can be compressed using the techniques described herein. More generally, a block of image data can be compressed to form a compressed data block, and a compressed data block can be decompressed to form an image data block, where the image data includes multiple image element values. To give some examples, an image element value can be: (i) a texel value representing a texture; (ii) a pixel value representing an image; (iii) a depth value representing the depth of a surface at different sampling positions within a scene; (iv) a surface normal value representing the direction of a normal vector of a surface at different sampling positions within a scene; or (v) an illumination value representing the illumination on a surface at different sampling positions within a scene. The illumination value represents a "light map". A light map can be considered a texture, so that a light map can be used and processed in the same manner as a texture. Pixel values ​​and texel values ​​are examples of color values ​​(where pixel values ​​represent an image and texel values ​​represent a texture). These color values ​​can be monochrome, that is, they have a monochrome channel. However, in some examples, the color values ​​can be multi-channel values. For example, the color value can be in RGB format, where there is a red channel (R), a green channel (G), and a blue channel (B). In other examples, the color value can be in RGBA format, where there is a red channel (R), a green channel (G), a blue channel (B), and an alpha channel (A). In other examples, the color value can be in YCbCr format, where the color value has a brightness (luma) channel (Y), a first chroma channel (Cb), and a second chroma channel (Cr). As known in the art, multi-channel color values ​​can have many other formats. Each channel of a multi-channel color value includes a value related to that particular channel. In the examples described herein, when we mention "pixel value", we can refer to the value of one channel of a multi-channel color value.

[0098] In the examples described herein, the compressed data is stored as compressed data blocks. For example, the header and the difference can be stored in the same continuous compressed data block. However, more generally, it should be understood that the compressed data need not be stored as data blocks, for example, as continuous data blocks. For example, the header and the difference can be stored separately, such as in different sections of a memory.

[0099] compression

[0100] As an overview of the compression techniques described herein, an image data block is compressed to meet a target compression level. The image data block includes a plurality of image element values, each image element value including one or more data values ​​associated with a corresponding one or more channels. Data values ​​within a block for a channel can be represented using an origin value and a difference value, wherein the origin value is common to all data values ​​within a block for a channel, and the difference value is specific to each data value. The difference values ​​of the data values ​​within a block for a channel can each be represented by a first digit. This first digit is selected so that the maximum difference value for the channel of the block can be losslessly represented using the first digit without any leading zeros. An indication of the origin value and the first digit for each channel of the channel of the block is included in a header portion of a compressed data block. The header portion of the compressed data block has a fixed size. A representation of the difference value is included in a body portion of the compressed data block. The body portion of the compressed data block does not have a fixed size (i.e., the size of the body portion of the compressed data block depends on the actual data being compressed), but the body portion of the compressed data block has a maximum size that will not be exceeded by the representation of the difference value stored in the body portion of the compressed data block. The maximum size of the body portion depends on the target compression level. For each of the one or more channels, a second number of bits is determined based on the first number of bits of all channels of the one or more channels. For each of the one or more channels, each representation of the representation of the difference value of the channel is stored in the compressed data block using the second number of bits of the channel. If the difference value in the compressed data block is represented using the first number of bits, the difference value in the compressed data block is represented using the first number of bits, that is, for each of the one or more channels, the second number of bits is determined to be equal to the first number of bits of the channel. However, if the difference value in the compressed data block is not represented using the first number of bits, the second number of bits of at least one of the one or more channels is determined to be less than the first number of bits of the channel, thereby ensuring that the representation of the difference value stored in the compressed data block using the second number of bits will meet the target compression level.

[0101] Reference now Figure 3 and Figure 4 Describe an example of a compression technique. Figure 3 FIG. 3 shows a compression unit 302 configured to perform compression on an image data block. The compression unit 302 may be implemented as Figure 1. Compression unit 302 includes analyzer logic 304, difference determination logic 306, difference size determination logic 308, and compressed data formation logic 310. Each of the logic blocks 304 to 310 implemented in compression unit 302 may be implemented in hardware (e.g., dedicated hardware implemented with fixed function circuits), software (e.g., as a software module executed on a processor), or a combination thereof. Implementing logic blocks in hardware generally provides lower operational latency than implementing logic blocks in software. However, implementing logic blocks in software allows for more flexibility in changing the functionality of logic blocks after manufacturing compression unit 302. Therefore, in some systems, hardware implementation may be more appropriate than software implementation (e.g., when compression needs to be performed quickly), while in some other systems, software implementation may be more appropriate than hardware implementation (e.g., when the functionality of the compression unit needs to be variable).

[0102] Figure 4 A flow chart showing a method of compressing a block of image data using the compression unit 302 to meet a target compression level.

[0103] In step S402, an image data block is received at the compression unit 302. As described above, the image data block includes a plurality of image element values, each image element value including one or more data values ​​related to corresponding one or more channels.

[0104] In step S404, the analyzer logic 304 determines, for each of the one or more channels, an origin value for the channel of the image data block. For example, the origin value for the channel may be determined by identifying a minimum value among the data values ​​associated with the channel of the block.

[0105] In step S406, the analyzer logic 304 determines a maximum difference value for the block for each of the one or more channels. The difference value (also referred to as a "delta value") for a channel of a block represents a difference between a data value and an origin value of the channel determined for the block. The maximum difference value for a channel of a block may be determined by identifying a minimum data value and a maximum data value associated with the channel for the block, and then subtracting the identified minimum data value from the identified maximum data value.

[0106] In step S408, the analyzer logic 304 determines a first digit for each of the one or more channels. The first digit of the determined channel is a number. Specifically, the first digit of the determined channel is the number of digits used to losslessly represent the maximum difference of the channel. In the example described herein, the first digit of the determined channel is the minimum number of digits that can be used to losslessly represent the maximum difference of the determined channel. The term "compressed format" can be used to refer to an indication of one or more first digits determined for one or more channels. The first digit is determined for each of the one or more channels by determining how many bits are available to represent the maximum difference of the channel obtained for the block without any leading zeros, wherein the determined number of digits is the first digit. Note that the first digit for a channel for a block is relevant for all data values ​​associated with the channel for the block, and is independent of different data values ​​associated with the channel in the block, and the channel has different first digits determined for different data values.

[0107] The first bit number determined for each of the one or more channels is passed to the difference size determination logic 308. In step S410, the difference size determination logic 308 uses (e.g., analyzes) the first bit number determined for each of the one or more channels to determine corresponding one or more second bit numbers for each of the one or more channels. The one or more second bit numbers are determined so that (e.g., to ensure) each difference value of the difference values ​​of the one or more channels represented by the corresponding one or more second bit numbers meets the target compression level for the compressed image data block. The second bit number is a number. In the example described herein, each of the one or more second bit numbers is determined for the corresponding one or more channels of the block in dependence on all one or more first bit numbers for the corresponding one or more channels of the block. Note that the second bit number for a channel of a block is relevant for all data values ​​associated with the channel for the block, and is independent of different data values ​​associated with the channels in the block, and the channels have different second bit numbers determined for different data values.

[0108] Step S410 may include the difference magnitude determination logic 308 determining whether the difference of the one or more channels represented by the corresponding determined one or more first digits satisfies the target compression level. If it is determined that the difference of the one or more channels represented by the corresponding determined one or more first digits will satisfy the target compression level, then for each of the one or more channels, the second digit is equal to the first digit of the channel. In other words, if the lossless compression of the image element values ​​in the block satisfies the target compression level, then the image element values ​​are losslessly compressed. However, if it is determined that the difference of the one or more channels represented by the corresponding determined one or more first digits does not satisfy the target compression level, then for at least one of the one or more channels, the second digit is less than the first digit of the channel. In other words, if the lossless compression of the image element values ​​in the block does not satisfy the target compression level, then the data value of at least one of the one or more channels is compressed in a lossy manner to ensure that the target compression level is met. For example, the amount of loss introduced into the data value of the compressed image element value may not be greater than the amount required to meet the target compression level.

[0109] In the examples described herein, the first number of bits determined for one or more channels is used to determine one or more second numbers of one or more channels according to a predetermined scheme. Determining the second number of bits from the first number of bits according to a predetermined scheme means determining the second number of bits in a deterministic manner. In these examples, the same predetermined scheme is used by the compression unit 302 and the decompression unit 602 (as described below with reference to Figure 6 and Figure 7 302 and the decompression unit 602. The first digits are used to determine the second digits ...

[0110] In step S412, the difference determination logic 306 determines, for each of the one or more channels, a difference value representing the difference between the data value and the origin value of the channel determined for the block. For example, if the origin value is the minimum value among the data values ​​of the channels in the block, the difference value may be determined by subtracting the origin value from the data values ​​of the channels in the block.

[0111] exist Figure 3 and Figure 4In the example shown, the difference is determined after determining the first digit and the second digit. In some other examples, the difference can be determined before determining the first digit and the second digit. Specifically, in these other examples, the determined difference can be used to determine the first digit, for example, by identifying the maximum difference.

[0112] For each of the one or more channels, the compressed data formation logic 310 receives the origin value, the first digit, the second digit, and the difference value. In step S414, the compressed data formation logic 310 forms compressed data, for example, as a compressed data block, wherein for each of the one or more channels, the compressed data includes:

[0113] - an indication of an origin value determined for said channel;

[0114] - an indication of a first number of bits determined for said channel; and

[0115] - representations of the difference values ​​determined for the channels, wherein each of the representations of the difference values ​​determined for the channels uses a second number of bits determined for the channels such that a target compression level is met.

[0116] Compressed data (e.g., compressed data blocks) are output from compression unit 302 and may be passed to memory 104, for example, via memory interface 108. The compressed data may then be stored in memory 104. Alternatively, the compressed data may be stored in a memory other than memory 104, for example, the compressed data may be stored in a local memory on GPU 102.

[0117] The target compression level corresponds to a target compressed block size. For an image data block having a fixed size, the target compression level for compressing the image data block means that the compressed data block does not exceed the target compressed block size. If the compression of the image data block "satisfies the target compression level", this means that the resulting compressed data block does not exceed the target compressed block size. For example, if the lossless compression of the image data block causes the compressed block to be smaller than the target compressed block size, the compressed data block may be smaller than the target compressed block size. In this sense, the target compressed block size represents the maximum size of the compressed block. The compression unit 302 may have a set of fixed target compression levels. For example, the set of target compression levels may include:

[0118] (i) a lossless compression level, where all image element values ​​are compressed losslessly, even if this does not result in any reduction in the size of the data (this may be considered equivalent to a target compression ratio of 1:1, which may be referred to as a target compressed block size being 100% of the uncompressed image data block size);

[0119] (ii) 75% compression level, where the target compressed block size is 75% of the size of the uncompressed image data block. This corresponds to a compression ratio of 4:3;

[0120] (iii) a 50% compression level, where the target compressed block size is 50% of the size of the uncompressed image data block. This corresponds to a compression ratio of 2:1; and

[0121] (iv) A compression level of 25%, where the target compressed block size is 25% of the size of the uncompressed image data block. This corresponds to a compression ratio of 4:1.

[0122] In the examples described herein, the target compression level refers to the amount of data used to store the difference values. The size of the data used to store the indication of the origin value and the indication of the first digit is fixed and does not depend on the target compression level used by the compression unit 102, and is not included in determining the compression ratios of "1:1", "4:3", "2:1", and "4:1" in the examples listed above.

[0123] If the compression unit is implemented in dedicated hardware (e.g., as a fixed function circuit), the compression unit 302 may be configured in hardware to be able to perform compression according to any one of a set of target compression levels. A selection of a target compression level may be made from the set of target compression levels to be used by the compression unit 302 when compressing an image data block. For example, the target compression level implemented by the compression unit 302 may be configured prior to runtime, such as by firmware instructions executed at GPU initialization. In this way, the compression unit 302 will compress all image data blocks according to the same target compression level unless the configuration of the compression unit 302 is subsequently changed. Alternatively, when an image data block is provided to the compression unit 302 to be compressed, an indication may be provided to the compression unit 302 along with the image data block to indicate which target compression level is used to compress the image data block. This would allow the compression unit 302 to compress different image data blocks according to different target compression levels without having to be reconfigured, but would add a little extra complexity to the system since the indication of the target compression level would be sent to the compression unit 302 along with the image data block. During decompression, a driver for the GPU sends an indication of a target compression level to a decompression unit. This can be relatively simple if the target compression levels for different blocks of image data do not change at runtime. However, if the target compression levels for different blocks of image data may change at runtime, the driver can keep track of the target compression levels for different compressed data blocks and indicate these target compression levels to the decompression unit so that the decompression unit can correctly decompress the compressed data blocks according to their target compression levels. In some other examples, the indication of the target compression level for the block can be included in the header portion of the compressed data block, so that when the compressed data block is decompressed, the decompression unit can read the indication of the target compression level from the header portion of the compressed data block to determine the target compression level for the block, rather than the driver tracking the target compression level.

[0124] In different examples, in step S410, one or more second digits can be determined in different ways based on one or more first digits. For example, in order to determine one or more second digits, one or more first digits can be reduced by zero, one or more values, so that by removing zero, one or more least significant bits (LSBs) from the representation of the difference with the determined first digit, each difference in the difference of one or more channels represented by the corresponding one or more second digits satisfies the target compression level for compressing the image data block. The amount by which one or more first digits are reduced can be defined by a predetermined scheme to thereby determine one or more second digits. If the first digit of a channel is reduced by zero, this means that the second digit of the channel will be equal to the first digit of the channel. Similarly, if zero LSBs are removed from the representation of the difference with the first digit, the representation of the difference will not be changed. Remove the LSBs (rather than other bits) from the representation of the difference because these are the least significant bits in terms of the value of the difference, so that removing the LSBs will lose less information than removing other bits from the difference. In this way, although some information loss is introduced into the compression process by removing the LSBs from the difference, the information loss is small, and for example, only reaches the extent of ensuring that the target compression level is met.

[0125] As described above, in different examples, the predetermined scheme for determining one or more second digits from one or more first digits may be different. In addition, in the examples described herein, there is a threshold number of bits for each of one or more channels, wherein if the second number of bits for each of the one or more channels is equal to the threshold number of bits, the target compression level for compressing the image data block will be met. In these examples, if the first number of bits of the channel is less than or equal to the threshold number of bits of the channel, the first number of bits of the channel is reduced by zero so that the second number of bits of the channel is equal to the first number of bits of the channel; and if the first number of bits of the channel is greater than the threshold number of bits of the channel, the amount of the first number of bits reduction will not make the second number of bits of the channel less than the threshold number of bits. Using the threshold number of bits for each of the one or more channels can prevent the number of bits for the difference of any particular channel from being reduced too much. For example, if the difference of the channel already has a small number of bits (e.g., 2 bits), then compared to the case where the LSB is lost from the difference of different channels with more bits (e.g., 6 bits), losing the LSB from those differences is a relatively significant information loss. For example, if the target compression level is 50% (i.e., if the size of one or more difference values ​​of the image element values ​​cannot exceed 50% of the size of one or more data values ​​of the image element values), the threshold number of bits for each channel can be set to half the number of bits used for each data value, or can be set to less than half the number of bits used for each data value, to name just two examples. The threshold number of bits can be the same for each of the one or more channels. Alternatively, it may be the case that the threshold number of bits is different for each of the one or more channels. For example, if the image element value represents a color value having data values ​​in the red, green, blue, and alpha channels, the threshold number of bits for the alpha channel can be different from the threshold number of bits for the red, green, and blue channels. In some examples, one or more selected channels can be prioritized over other channels, for example, by setting the threshold number of bits for one or more selected channels to a higher value than the threshold number of bits for other channels.

[0126] In addition to using a threshold number of bits for each of the one or more channels, the predetermined scheme may be intended to uniformly reduce each of the one or more channels, e.g., by the same or similar amount. For example, according to the predetermined scheme, the least significant bits may be sequentially dropped from individual channels until a target compression level is met. In other words, one bit is sequentially removed from each of the above threshold channels until the total number of bits meets the target compression level. The order in which the LSBs are dropped from the different channels is defined by the predetermined scheme.

[0127] In the example described above, in step S406, the analyzer logic 304 obtains the maximum difference value for the channels of the block by identifying the minimum data value and the maximum data value associated with the channels for the block and subtracting the identified minimum data value from the identified maximum data value. However, in other examples, the maximum difference value for the channels can be determined for the block by all the difference values ​​for the channels determined for the block and then identifying the maximum value of those determined difference values. In these other examples, the analyzer logic can obtain the maximum difference value for the channels of the block by receiving the difference values ​​for the channels determined for the block and determining which determined difference value is the largest.

[0128] Note that if all data values ​​for a channel in a block have the same value, then no difference value for that channel is stored in the compressed data block. In this case, the first digit of the channel and the second digit of the channel are both zero, and the origin value of the channel stored in the header indicates the single value that each data value has for the channel in the block.

[0129] As described above, in some examples, an origin value for a channel of a block is determined by identifying a minimum value among the data values ​​associated with the channel for the block, and a maximum difference value of difference values ​​for the channel of the block is determined by identifying a maximum value among the data values ​​associated with the channel for the block and subtracting the minimum value among the data values ​​associated with the channel for the block from the identified maximum value among the data values ​​associated with the channel for the block. In these examples, the difference value of the channel is determined by subtracting the origin value of the channel from the data values ​​associated with the channel. In these examples, the origin value of the channel represents a lower limit (i.e., a minimum value) of the data values ​​associated with the channel for the block, and the difference value of the channel represents the addition made to the origin value of the channel when decompressing the compressed data block.

[0130] However, in other examples, the origin value for the channel of the block is determined by identifying a maximum value among the data values ​​associated with the channel for the block, and the maximum difference value of the difference values ​​for the channel of the block is determined by identifying a minimum value among the data values ​​associated with the channel for the block and subtracting the minimum value among the identified data values ​​associated with the channel for the block from the maximum value of the data values ​​associated with the channel for the block. In these examples, the difference value of the channel is determined by subtracting the data value associated with the channel from the origin value of the channel. In these examples, the origin value of the channel represents an upper limit (i.e., a maximum value) of the data values ​​associated with the channel for the block, and the difference value of the channel represents the subtraction made from the origin value of the channel when decompressing the compressed data block.

[0131] In some examples, the origin value of the channel can be set within the range of data values ​​for the channel for the block (e.g., a value in the middle of the range of data values ​​for the channel for the block, e.g., a value halfway between the maximum data value and the minimum data value associated with the channel for the block), where the difference value can be a signed value.

[0132] In some examples, the origin value and the difference value for each of the one or more channels of the block can be determined according to a modulo operation. In these examples, when the difference value is determined relative to the origin value according to the modulo operation, the origin value for each of the one or more channels can be determined as one of the data values ​​of the block associated with the channel that produces the smallest maximum difference value. For example, the difference value can be determined as modulo 2 n , where n is the number of bits for each data value. For example, if the data values ​​are 8-bit values, the difference values ​​may be determined as modulo 256. For example, if the data values ​​associated with the channels for the block are 8-bit values ​​representing the values ​​of 251, 255, 7, and 16 in decimal (i.e., in binary, the data values ​​are 11111011, 11111111, 00000111, and 00010000), then the origin value may be determined as 251 (which may be considered to represent the value -5 when represented modulo 256). Using 251 as the origin value for these four data values, the difference values ​​may be determined as 0, 4, 12, and 21, such that the first bit determined for these difference values ​​is five, i.e., the maximum difference value (21) may be represented losslessly using five bits (as 10101). Note that if modulo operations were not used to compress this block of four data values, then the difference values ​​would each need to have eight bits, for example, if the origin value was determined to be the minimum value in the block (i.e., 7), then the maximum difference value would be 248, requiring eight bits to represent losslessly (which is 11111000).

[0133] In the examples described above, a single origin value is determined for each of the one or more channels of the block. In some other examples, multiple origin values ​​may be determined for at least one of the one or more channels. In these other examples, each difference value is determined for at least one of the one or more channels (which has multiple origin values) relative to an origin value in the multiple origin values, and an indication of each of the difference values ​​is included in the compressed block to indicate which origin value in the multiple origin values ​​is used to determine the difference value. This can be useful if the data values ​​associated with the channels within the block form multiple groups of data values, each of which has a small range. For example, if the image element values ​​within the image data block are associated with multiple different objects in the scene, this situation may occur relatively frequently. For example, if the data values ​​associated with the channels for the block are 3, 5, 3, 4, 6, 132, 132, 133, then the first origin value may be determined to be 3 and the second origin value may be determined to be 132, and then the difference values ​​for the first five data values ​​may be determined to be 0, 2, 0, 1, and 3 relative to the first origin value, and the difference values ​​for the last three data values ​​may be determined to be 0, 0, and 1 relative to the second origin value. In this case, the first number of bits determined for these difference values ​​is two, i.e., the largest difference value (3) can be losslessly represented using two bits (which is 11). Note that if this block of data values ​​is compressed using a single origin value, the difference values ​​each need to have eight bits, for example, if the origin value is determined to be the minimum value (i.e., 3), then the largest difference value will be 130, requiring eight bits to be losslessly represented (which is 10000010).

[0134] As mentioned above, in the examples described herein, the compressed data is stored as compressed data blocks, e.g., the header and the difference may be stored in the same contiguous compressed data block. However, more generally, it should be understood that the compressed data need not be stored as data blocks, e.g., as contiguous data blocks. For example, the header and the difference may be stored separately, e.g., in different sections of a memory.

[0135] Figure 5a and 5b represents an exemplary format for compressing a data block. Specifically, Figure 5a shows a method for storing four compressed data blocks (in Figure 5a 0, Block 1, Block 2, and Block 3 in FIG. 5 . Each compressed data block includes a header portion (stored in section 502) having a fixed size and including an indication of the determined origin value and an indication of the first bit number determined for each of one or more channels of the block. Each compressed data block also includes a body portion (stored in section 504) having a variable size and including an indication of the difference value determined for each of the one or more channels. Figure 5aIn the example shown, multiple (i.e., four) compressed data blocks are stored together such that the header portions of the compressed data blocks are stored together in section 502, and the body portions of the compressed data blocks are stored together in section 504. In other examples, each compressed data block may be stored separately, i.e., in a different address space, such that the header portion and the body portion of each compressed data block are stored in a continuous address range.

[0136] Figure 5a The four compressed blocks represented in can correspond to Figure 2 The corresponding four image data blocks 2020, 2021, 2022 and 2023 shown in the figure are such that each image data block includes sixteen image element values. In this example, each image element value includes four 8-bit data values ​​related to the red, green, blue and alpha channels, respectively, so that each image element value is represented by 32 bits. Therefore, each uncompressed image data block is represented by 512 bits. The target compression level in this example is 50%. This means that, in this example, the maximum total number of bits that can represent the difference value of each compressed data block is 256 (i.e., sixteen bits per image element value to be distributed among the four channels). Figure 5a In the example shown, each of the header parts of the compressed data block comprises 64 bits. Figure 5a In the example shown, each row of the address space represents 128 bits, so the header portions of two compressed blocks can be on the same row, and a maximum memory footprint corresponding to two rows of the address space (i.e., 256 bits) is provided for each of the body portions of the different compressed data blocks. Because the compression techniques described herein are guaranteed to meet the target compression level (e.g., a 50% compression target), the body portion of the compressed data block will not exceed Figure 5a 256 bits are provided for it in the example shown in . Each compressed data block has a fixed storage allocation (ie, a fixed memory footprint) that is not exceeded and is determined by the target compression level.

[0137] Taking the example of n channels (channel 0 to channel (n-1)), the difference values ​​associated with m data values ​​(data value 0 to data value (m-1)) are stored in the body of the compressed data block in the following order: data value 0, channel 0; data value 0, channel 1; ... data value 0, channel (n-1); data value 1, channel 0; ... data value 1, channel (n-1); ... data value (m-1), channel 0; ... data value (m-1), channel (n-1). In other words, the difference values ​​associated with a particular data value are stored for each of the different channels, and then the difference values ​​associated with the next data value are stored for each of the different channels, and so on. This allows the difference values ​​associated with a particular data value for each of the different channels to be read from a compressed data block in one chunk. This can be useful if some but not all of the data values ​​in the compressed data block are to be decompressed.

[0138] Figure 5b An exemplary format 510 of data within a header portion of a compressed data block is shown. In this example, 64 bits of data are included in the header portion of the compressed data block. Specifically, the header portion includes indications of origin values ​​for four channels 512. In this example, 32 bits are used for the indications of these origin values, so that 8 bits are used for each indication of the origin value of a channel. In this way, for each of one or more channels, the indication of the origin value of the channel has the same number of bits as one of the data values ​​associated with the channel of one image element value in the image data block. In this way, the precision of the origin value is not reduced, so that even if lossy compression is being implemented, no data is lost in the origin value. The header portion also includes three reserved bits 514, which can be used for different purposes in different examples. In different examples, the reserved bits allow a certain flexibility in the data stored in the compressed block. The header portion also includes some error correction indications 516, such as cyclic redundancy check (CRC) bits, which are described below. In Figure 5b In the example shown in , 13 bits are used for the error correction indication. The header portion also includes an indication of the first digit of each of the channels 518. In this example, there are four channels, and each indication of the first digit has four bits, so that there are sixteen bits for the indication of the first digit. Using four bits to indicate the first digit allows values ​​from 0 to 15 to be represented by each first digit.

[0139] In the examples described herein, a compressed data block has a base address, and a header portion begins at a first address defined by the base address, wherein data for the header portion runs from the first address in a first direction, and wherein a body portion begins at a second address defined by the base address, wherein data for the body portion runs from the second address in a second direction, wherein the first direction is opposite to the second direction in the address space. For example, if each compressed data block is stored separately, the base address may point to the beginning of the body portion of the compressed data block, and the address of the body portion increases from that point, and the header portion may begin at the base address minus 1, and the address of the header portion decreases from that point. Figure 5a The example shown in is slightly more complicated because four compressed data blocks are stored together. However, even in this case, the starting address of the header portion of each of the different compressed data blocks is defined by the base address, and the starting address of the body portion of each of the different compressed data blocks is defined by the base address.

[0140] In the examples described above, the compressed data block does not include an indication of the second number of bits determined for each of the one or more channels. Instead, an indication of the first number of bits for each of the one or more channels is included in the compressed data block, and the same predetermined scheme for determining the second number of bits from the first number of bits may be used in the decompression unit 112 to determine the second number of bits, as described in more detail below.

[0141] However, in other examples, for each of the one or more channels, the compressed data block may further include (e.g., in a header portion of the compressed data block) an indication of the second number of bits determined for the channel. For example, the header portion of the compressed data block may not include the reserved bits 514 or the error correction indication 516, in which case these bits (e.g., sixteen bits) may be used to store an indication of the second number of bits for the corresponding channel.

[0142] In some examples, where there are multiple channels, compression unit 302 may perform decorrelation (e.g., color decorrelation) on the multiple channels to reduce or remove correlation between different data values ​​associated with different channels of image element values. Figure 4 Between steps S402 and S404 in the method shown in the flowchart of , the compression unit 302 may perform color decorrelation. Methods for performing color decorrelation are known in the art, but as a simple example, when the image data is in RGB format, a color decorrelation technique may be used so that each image element value includes a red data value (R), a green data value (G), and a blue data value (B). The color decorrelation process may include:

[0143] Calculate the data value of the red channel (R') according to the equation R'=RG;

[0144] Determining a data value of a green channel (G') according to the equation G'=G; and

[0145] The data value of the blue channel (B') is calculated according to the equation B'=BG.

[0146] The R', G' and B' values ​​can then be used in the rest of the compression process, e.g. Figure 4 The flowchart shows steps S404 onwards.

[0147] As mentioned above, in some examples, one or more error correction indicators may be included in the compressed data block. These error correction indicators may be determined by the compression unit 302 by determining the image element values ​​that will be obtained by correctly decompressing the compressed data block. The error correction indicators may be CRC bits that may be calculated in a known manner. If the difference values ​​are losslessly represented in the compressed data block, for example, if the first digit is equal to the second digit of each of the one or more channels, the CRC bits may be calculated from the original data values ​​of the image data block, because these are the values ​​that should be obtained by correctly decompressing the compressed data block. However, if any of the difference values ​​are lossily represented in the compressed data block, for example, if the first digit is not equal to the second digit of any of the one or more channels, the compression unit 302 may determine the data value that the decompression unit 602 should obtain by correctly decompressing the compressed data block, and then the CRC bits may be calculated from the data values ​​determined by the compression unit 302. The compression unit may, for example, determine the data value that the decompression unit should obtain by analyzing the input data block and various determinations made during the compression process. Alternatively, the compression unit may decompress the compressed data block to determine the data value that the decompression unit should obtain. In this way, even when lossy compression is being performed, error correction techniques may be used to determine whether there are any errors in the transmission of data representing the compressed data block, for example, from the compression unit 110 to the memory 104 via the memory interface 108, and from the memory 104 back to the decompression unit 112 via the memory interface 108.

[0148] Example Compression

[0149] An example is now described in which each image element value has data values ​​associated with four color channels, red channel (R), green channel (G), blue channel (B), and alpha channel (A). In this example, a block of four pixel values ​​is compressed. Each pixel value is represented by 32 bits in the format R8G8B8A8 (i.e., each data value is represented by 8 bits), so the uncompressed image data block is represented by 128 bits. The target compression level is 50%, so the main part of the compressed data block cannot exceed 64 bits. The red, green, blue, and alpha values ​​in the block can be represented as separate data sets. In this example, the values ​​of the four pixels in the block in different channels are:

[0150] R = [16, 24, 9, 45]

[0151] G = [89, 89, 94, 84]

[0152] B = [240, 215, 204, 228]

[0153] A = [255, 255, 250, 255]

[0154] In this example, for each channel the origin value is determined as the minimum value in the block. Therefore, the origin value and the difference are:

[0155] R: origin = 9, difference = [7, 15, 0, 36]. The lossless difference of the red channel can be represented by 6 bits in binary (ie, the first bit of the red channel is 6), that is, they can be represented as: [000111, 001111, 000000, 100100].

[0156] G: origin = 84, increment value = [5, 5, 10, 0]. The lossless difference of the green channel can be represented by 4 bits in binary (ie, the first bit of the green channel is 4), that is, they can be represented as: [0101, 0101, 1010, 0000].

[0157] B: origin = 204, increment value = [36, 11, 0, 24]. The lossless difference of the blue channel can be represented by 6 bits in binary (ie, the first bit of the blue channel is 6), that is, they can be represented as: [100100, 001011, 000000, 011000].

[0158] A: Origin = 250, incremental value = [5, 5, 0, 5]. The lossless difference of the alpha channel can be represented by 3 bits in binary (ie, the first bit of the alpha channel is 3), that is, they can be represented as: [101, 101, 000, 101].

[0159] A compression target of 50% allows for 16 bits per pixel value for the difference, but if all channels were losslessly compressed in this example, then each pixel value for the difference would be 19 bits (i.e., 6+4+6+3=19). In this example, the per-channel threshold for each difference magnitude is 4 bits, so we will not reduce the number of bits for the difference of the green or alpha channel in the above example. According to a predetermined scheme, the second number of bits for the channels is determined to be: R=4 bits, G=4 bits, B=5 bits, and A=3 bits. The indication of the origin value for each channel includes 8 bits, and the indication of the first number of bits for each channel includes 4 bits.

[0160] Therefore, in the compressed block, we store the indication of the origin value, the indication of the first digit and the difference of the different channels in binary as:

[0161] R: Origin value = 00001001, first digit = 0110, difference: [0001, 0011, 0000, 1001]

[0162] G: Origin value = 01010100, first digit = 0100, difference: [0101, 0101, 1010, 0000]

[0163] B: Origin value = 11001100, first digit = 0110, difference: [10010, 00101, 00000, 01100]

[0164] A: Origin value = 11111010, first digit = 0011, difference: [101, 101, 000, 101]

[0165] Unzip

[0166] As an overview of the decompression techniques described herein, decompression can be performed on compressed data (e.g., a compressed data block) to determine one or more image element values ​​of an image data block represented by the compressed data. As described above, the image data block includes a plurality of image element values, each of which includes one or more data values ​​associated with a corresponding one or more channels. For each of the one or more channels, the compressed data includes an indication of an origin value, an indication of a first digit for losslessly representing a difference value, and a representation of the difference value. A second digit is obtained for each of the one or more channels, wherein the second digit is the digit used to include a representation of the difference value in the compressed data. If the second digit is less than the first digit of the channel, one or more LSBs are added (i.e., appended) to the difference value from the compressed data to determine the difference value having the first digit. Then, for each channel, the data value associated with the channel can be determined by combining the origin value of the channel and the difference value of the channel (having the first digit of the channel).

[0167] The compressed data may be stored in a format as described above (e.g., Figure 5a and Figure 5b As mentioned above, in the examples described herein, the compressed data is stored as compressed data blocks, for example, the header and the difference value may be stored in the same continuous compressed data block. However, more generally, it should be understood that the compressed data need not be stored as data blocks, for example, as continuous data blocks. For example, the header and the difference value may be stored separately, for example, in different segments of the memory. Figure 5a and Figure 5b In the exemplary format of the compressed data block shown, the header portion of the compressed data block has a fixed size. In addition, the second digit can be determined based on the information in the header portion without reading any data from the main body of the compressed data block. When the second digit has been determined, the position of each difference value can be determined. For example, the second digit of one or more channels is summed to obtain the overall compressed size of the difference value related to the data value of an image element value, and the overall compressed size of the difference value can be used to determine the offset of the required difference value for the decompressed image element value. Therefore, the difference values ​​of some data values ​​can be read, but not necessarily all the difference values. This means that the decompression unit 112 can determine the decompressed value of one or more image element values ​​in the image data block, without necessarily decompressing the entire compressed data block. For example, the image data block may include sixteen texel values, and the bilinear texture filtering operation may need to determine only four texel values ​​from the compressed data block. Using the decompression technique described in the example of this article, the decompression unit 112 can determine four expected texel values ​​without decompressing the other 12 texel values ​​in the compressed data block. In this way, the compressed data block is "randomly accessible". Furthermore, even individual data values ​​associated with individual channels may be decompressed from the compressed data block without having to decompress other data values ​​(even data values ​​associated with different channels of the same picture element value) from the compressed data block.

[0168] Now refer to Figure 6 and Figure 7 An example of a decompression technique is described. Figure 6 A decompression unit 602 is shown that is configured to perform decompression to determine one or more image element values ​​from compressed data (eg, a compressed data block). The decompression unit 602 may be implemented as Figure 1Decompression unit 112 in the graphics processing system shown. Decompression unit 602 includes difference determination logic 604 and data value determination logic 606. Difference determination logic 604 includes difference size determination logic 608 and unpacker logic 610. Each of the logic blocks 604 to 610 implemented in decompression unit 602 can be implemented in hardware (e.g., dedicated hardware implemented with fixed function circuits), software (e.g., as a software module executed on a processor), or a combination thereof. Implementing logic blocks in hardware generally provides lower operation latency than implementing logic blocks in software. However, implementing logic blocks in software allows for more flexibility in changing the functionality of logic blocks after manufacturing decompression unit 602. Therefore, in some systems, hardware implementation may be more appropriate than software implementation (e.g., when compression needs to be performed quickly), while in some other systems, software implementation may be more appropriate than hardware implementation (e.g., when the functionality of the compression unit needs to be variable).

[0169] Figure 7 A flow chart of a method of performing decompression to determine one or more image element values ​​from a compressed data block that has been compressed as described above to meet a target compression level is shown. In this example, the compressed data is in the compressed data block, but in other examples, the compressed data is not necessarily in the compressed data block.

[0170] In step S702, a compressed data block is received at the decompression unit 602. For example, if the decompression unit 602 is implemented as Figure 1 The decompression unit 112 in the graphics processing system shown may then receive the compressed data blocks from the memory 104 via the memory interface 108 .

[0171] In step S704, the difference size determination logic 608 reads an indication of the first bit number from the compressed data block for each channel of the one or more channels. As described above, the first bit number of a channel is the number of bits that can be used to losslessly represent the difference value for the channel of the block.

[0172] In step S706, the difference size determination logic 608 obtains a difference size of the difference value stored in the compressed block for each of the one or more channels. In other words, in step S706, the difference size determination logic 608 obtains (e.g., determines) a second bit number for each of the one or more channels, wherein the second bit number of the channel is used to include a representation of the difference value for each of the one or more channels in the compressed data block. As described above, the one or more second bit numbers are determined to ensure that the compressed data block meets the target compression level for the compressed image data block. The determined difference size (i.e., the second bit number) and an indication of the first bit number of the one or more channels are provided to the unpacker logic 610.

[0173] In the example described herein where an indication of a second bit number is not included in the compressed data block, step S706 involves determining a second bit number for each of the one or more channels according to a predetermined scheme using the first bit number for the channel. Specifically, the predetermined scheme is the same scheme as the scheme used in the compression unit 302 described above, such that given the same set of one or more first bits, the decompression unit 602 will determine the same set of one or more second bits as determined in the compression unit 302. In other words, both the compression unit 302 and the decompression unit 602 use a common function to determine how many LSBs to discard from the difference value of each of the one or more channels.

[0174] Specifically, similar to as described above with respect to the compression process, step S706 may involve determining whether the difference of the one or more channels represented by the corresponding determined one or more first digits satisfies the target compression level. If it is determined that the difference of the one or more channels represented by the corresponding determined one or more first digits will satisfy the target compression level, then for each of the one or more channels, the second digit is equal to the first digit of the channel. However, if it is determined that the difference of the one or more channels represented by the corresponding determined one or more first digits does not satisfy the target compression level, then for at least one of the one or more channels, the second digit is less than the first digit of the channel.

[0175] In addition, as described above with respect to the decompression process, in some examples, there is a threshold number of digits for each channel in one or more channels. If the first number of digits of a channel is less than or equal to the threshold number of digits of the channel, then the second number of digits of the channel is equal to the first number of digits of the channel. If the first number of digits of a channel is greater than the threshold number of digits of the channel, then the second number of digits of the channel is within the range of the threshold number of digits of the channel to the first number of digits of the channel. As described above, in some examples, the threshold number of digits is the same for each channel in one or more channels; and in some other examples, the situation is that the threshold number of digits is not the same for each channel in one or more channels.

[0176] Additionally, as described above, in some examples, an indication of the second bit number for each of the one or more channels may be included in the compressed data block. In these examples, there is no need to implement the difference magnitude determination logic 608 in the decompression unit. In these examples, the second bit number is obtained by the difference determination logic 604 for each of the one or more channels by reading the indication of the second bit number for the channel from the compressed data block.

[0177] In step S708, the unpacker logic 610 reads a representation of the difference value for the one or more image element values ​​being decompressed from the compressed data block using the one or more second bit numbers of the corresponding one or more channels.

[0178] In step S710, based on the representation of the difference value read from the compressed data block, the depacketizer logic 610 determines a difference value for each of the one or more channels and for each of the one or more image element values ​​being decompressed according to the first bit number of the channel. For example, the difference value determined for a channel has a first bit number indicated for the channel. The difference value determined for the corresponding channel with the appropriate first bit number is provided to the data value determination logic 606.

[0179] In the examples described herein, in step S710, for each of the one or more channels and for each of the one or more image element values ​​being decompressed, determining the difference value based on the first number of bits for the channel includes adding (i.e., appending) zero, one or more least significant bits (LSBs) to a representation of the difference value read from the compressed data block, thereby determining the difference value having the first number of bits for each of the one or more channels. If the first number of bits is the same as the second number of bits for the channel, then adding zero LSBs to the representation of the difference value read from the compressed data block. If the first number of bits is greater than the second number of bits for the channel, then adding one or more LSBs to the representation of the difference value read from the compressed data block to determine the difference value having the first number of bits for the channel.

[0180] In different examples, the value of the added bit can be different. In a simple example, zero, one or more LSBs added to the representation of the difference value read from the compressed data block are all zero. Using zero as the added LSB means that when the difference value is added to the origin value, the result is guaranteed not to overflow, so that a simpler (e.g., smaller in silicon area) adder can be used to add the difference value to the origin value compared to other values ​​for the added LSB. In addition, using zero as the added LSB means that the data value that is zero that is compressed and then decompressed will still be zero. This can be useful, for example, for representing red, blue, and green channel values, so that a completely black area (e.g., it has a red value, a green value, and a blue value of zero) will remain completely black after compressing and decompressing the image element value. This can also be useful for representing alpha channel values, so that completely transparent image element values ​​(i.e., image element values ​​with an alpha value of zero) will remain completely transparent after compressing and decompressing the image element value.

[0181] In another example, zero, one, or more LSBs added to the representation of the difference value read from the compressed data block are all ones. Using one as the LSB added means that the maximum data value (e.g., a value of 255 for an 8-bit data value) that is compressed and then decompressed will still be the maximum data value. This can be useful, for example, to represent red, blue, and green channel values ​​so that a completely white area (e.g., having the maximum red, green, and blue values ​​(e.g., a value of 255 for an 8-bit value)) will remain completely white after compressing and decompressing the image element value. This can also be useful to represent alpha channel values ​​so that completely opaque image element values ​​(i.e., image element values ​​having the maximum alpha value (e.g., an alpha value of 255 for an 8-bit value)) will remain completely opaque after compressing and decompressing the image element value. If one is used as the LSB added to the difference value, precautions can be taken to ensure that the sum of the difference value and the origin value does not overflow. For example, when summing the difference value and the origin value, the corresponding LSB of the origin value can be masked.

[0182] In another example, zero, one or more LSBs added to the representation of the difference value read from the compressed data block are random bits or pseudo-random bits. Using random bits or pseudo-random bits as the added LSBs can help reduce visually perceptible banding effects introduced into the image element values ​​by compressing and decompressing the image element values.

[0183] In yet another example, the zero, one or more LSBs added to the representation of the difference value read from the compressed data block are different for different ranges of origin values ​​or for different ranges of different values. For example, for low origin values, e.g., for origin values ​​below a threshold, the zero, one or more LSBs added to the representation of the difference value are zero; and for high origin values, e.g., for origin values ​​above a threshold, the zero, one or more LSBs added to the representation of the difference value are one. The threshold value can be any suitable value, such as 1 and (2 n -1). This can help maintain true black (represented by zero) and maintain true white (represented by one). As another example, for a difference whose MSB is zero, zero, one, or more LSBs added to the representation of the difference are zero; and for a difference whose MSB is one, zero, one, or more LSBs added to the representation of the difference are one.

[0184] In various examples, zero, one or more LSBs added to the representation of the difference value of the channel read from the compressed data block are equal to the corresponding zero, one or more most significant bits of the origin value of the channel. This can be useful so that for a block of generally high values ​​(MSB of the origin value is one), one is added as the LSB to the representation of the difference value, and for a block of generally low values ​​(MSB of the origin value is zero), zero is added as the LSB to the representation of the difference value. This compression / decompression technique tends to: (i) compress zero values ​​in a way that zero values ​​are decompressed to obtain zero, and (ii) compress the maximum value in a way that the maximum value is decompressed to obtain the maximum value. Similar to what is described above, if the LSB added to the representation of the difference value includes one or more ones, then precautions can be taken to ensure that the sum of the difference value and the origin value does not overflow. For example, when the difference value and the origin value are summed, the corresponding LSB of the origin value can be masked.

[0185] The method may include: performing a left shift of zero, one or more bit positions on the bits of the representation of the difference value read from the compressed data block; and then adding zero, one or more LSBs in the LSB position after the shift, wherein the zero, one or more LSBs are determined as described above to determine the difference value having the first number of bits for each of the one or more channels.

[0186] In step S712 , the data value determination logic 606 reads an indication of an origin value for each of the one or more channels from the compressed data block.

[0187] In step S714, the data value determination logic 606 determines, for each of the one or more channels, a data value associated with the channel for each of the one or more image element values ​​being decompressed using (i) the origin value for the channel, and (ii) the difference value for the channel determined for the image element value. The manner in which the data value is determined using the difference value and the origin value for the channel matches the manner in which the difference value and the origin value are determined in the compression unit 302 based on the data value. As described above, the compression unit 302 may use the data value to determine the origin value and the difference value differently in different examples. For example, if the origin value is the minimum data value within the block, then for each of the one or more channels, the data value associated with the channel is determined for each of the one or more image element values ​​being decompressed by summing the origin value for the channel and the difference value for the channel determined for the image element value. As another example, if the origin value is the maximum data value within the block, then for each of the one or more channels, a data value associated with the channel is determined for each of the one or more image element values ​​that are decompressed by subtracting the difference value of the channel determined for the image element value from the origin value of the channel. In both examples given in the above paragraphs, precautions may be taken to ensure that there is no carry from the LSB that has been added to the difference value to the most significant bit of the decompressed data value. For example, if the origin value and the difference value are added together, then the corresponding zero, one or more LSBs of the origin value (corresponding to the zero, one or more LSBs added to the difference value) are padded with zeros before being added to the difference value. As another example, if the difference value is subtracted from the origin value, then the corresponding zero, one or more LSBs of the origin value (corresponding to the zero, one or more LSBs added to the difference value) are padded with ones before the difference value is subtracted. For example, using 8-bit data values, this means that there is no overflow from 00000000 to 11111111, and vice versa.

[0188] In another example, for each of the one or more channels, a data value associated with the channel may be determined for each of the one or more image element values ​​being decompressed by combining the origin value of the channel with the difference value of the channel determined for the image element value using addition or subtraction in a modular operation. In this example, precautions may be taken to ensure that the decompressed value is on the correct side of the modulus of the modular operation. For example, if a block of four 8-bit data values ​​for the channel is 251, 255, 0, and 1, then according to the example using modular operation, the origin value may be set to 251 (i.e., represented as 11111011 in binary), and the difference values ​​may be 0, 4, 5, and 6. These difference values ​​may be represented losslessly using three bits as 000, 100, 101, and 110, so the first digit is three. In this example, the second digit of the channel for the block is determined to be two in order to meet the target compression level. In simple terms, the difference values ​​may be stored as 00, 10, 10, and 11, but may result in decompressed data values ​​of 251, 255, 255, and 1 (if the LSB added to the decompression unit is zero). The data loss in the third data value has been changed from a value of 0 to a value of 255, which may be very obvious. Therefore, when the difference values ​​are compressed, the compression unit may identify whether the rounding of the difference values ​​will cause the resulting decompressed data value to cross the modulus of the modulus operation, and if so, the rounding of the difference values ​​may be modified to avoid crossing the modulus of the modulus operation. It should be noted that the compression unit knows how the compressed data will be decompressed, so it can determine whether the rounding in the difference values ​​will cause the resulting decompressed data value to cross the modulus of the modulus operation. For example, the third difference value in the above example may be rounded up instead of rounded down (but the other three difference values ​​will still be rounded down), so that the three difference values ​​may be stored in the compressed data as 00, 10, 11, and 11. This would result in decompressed values ​​of 251, 255, 1, and 1. The data loss in the third data value has changed from a value of 0 to a value of 1, which is not as obvious as a change from 0 to 255.

[0189] In yet another example, the compressed data block includes a plurality of origin values ​​for at least one of the one or more channels, wherein an indication is included in the compressed data block to indicate from which of the plurality of origin values ​​each difference value of the at least one of the one or more channels has been determined. In this example, for the at least one of the one or more channels, a data value associated with the channel is determined for each of the one or more image element values ​​being decompressed using: (i) an origin value for the channel indicated by the indication of the difference value of the channel determined for the image element value; and (ii) the difference value of the channel determined for the image element value.

[0190] The determined data values ​​represent decompressed image element values. The method may also include outputting the determined data values ​​of the decompressed one or more image element values ​​for further processing. For example, where the decompression unit 602 is implemented as a decompression unit 112 in the graphics processing system 100, the determined data values ​​may be output from the decompression unit 112 to the processing logic 106 of the GPU 102, e.g., to be processed by the processing logic 106.

[0191] As described above, in some examples where there are multiple channels, the compression unit 302 may perform decorrelation (e.g., color decorrelation) on the multiple channels to reduce or remove correlation between different data values ​​associated with different channels of the image element values ​​before compressing the image element values. If this decorrelation is performed in the compression unit 302, the decompression unit 602 performs a corresponding re-correlation process to determine the image element value corresponding to the original image element value provided to the compression unit 302. Specifically, after step S714, the decompression unit 602 may perform re-correlation (e.g., color re-correlation) on the data values ​​associated with the multiple channels determined for each of the one or more image element values ​​that are decompressed, thereby introducing correlation between different data values ​​associated with different channels of the image element values. For example, there may be three color channels (red, green, and blue), and the color re-correlation process may include:

[0192] According to the equation R=R'+G', a red value (R) is calculated using the data value of the red channel (R') determined in step S714 and using the data value of the green channel (G') determined in step S714;

[0193] Determine a green value (G) according to the equation G=G' using the data value of the green channel (G') determined in step S714; and

[0194] According to the equation B=B′+G′, a blue value (B) is calculated using the data value of the blue channel (B′) determined in step S714 and using the data value of the green channel (G′) determined in step S714 .

[0195] As mentioned above, in some examples, one or more error correction indicators may be included in the compressed data block. The decompression unit 602 may determine one or more error correction indicators based on the determined data values ​​of the one or more image element values ​​being decompressed (i.e., based on the data values ​​determined in step S714). The error correction indicator may be a CRC bit that can be calculated in a known manner. The decompression unit 602 may read one or more error correction indicators from the compressed data block. Then, the decompression unit 602 may compare the determined one or more error correction indicators with the one or more error correction indicators read from the compressed data block to determine whether there is an error in the determined data values ​​of the one or more image element values ​​being decompressed. If it is determined that there is no error in the decompressed image element value, the image element value can be trusted and used trustworthy. This is particularly useful in systems that implement functional safety. For example, the graphics processing system 102 may be configured to operate according to a safety standard (such as the ISO 26262 standard) if the graphics processing system 102 is being implemented in an automobile for rendering an image that is considered to be safety-critical (e.g., for rendering an image including a warning symbol displayed on a dashboard of a car). If the decompression unit 602 determines that there is an error in the determined data value, this means that an error occurred in the data transmission between the compression unit 302 and the decompression unit 602 (e.g., when the compressed data has been transmitted to or from the memory). In this case, the decompression unit 602 can output an error signal to indicate that an error has occurred. The rest of the system can respond to this error signal in any suitable manner, such as by discarding the decompressed image data block and / or requesting that the image data block be compressed and transmitted again.

[0196] Example decompression

[0197] In the example of a compressed image data block given above, the values ​​of the four pixels in the block in different channels are:

[0198] R = [16, 24, 9, 45]

[0199] G = [89, 89, 94, 84]

[0200] B = [240, 215, 204, 228]

[0201] A = [255, 255, 250, 255]

[0202] And the resulting compressed data block has the following four channels of data:

[0203] R: Origin value = 00001001, first digit = 0110, difference: [0001, 0011, 0000, 1001]

[0204] G: Origin value = 01010100, first digit = 0100, difference: [0101, 0101, 1010, 0000]

[0205] B: Origin value = 11001100, first digit = 0110, difference: [10010, 00101, 00000, 01100]

[0206] A: Origin value = 11111010, first digit = 0011, difference: [101, 101, 000, 101]

[0207] We now describe the manner in which all of the image element values ​​of this compressed data block may be decompressed by the decompression unit 602. In step S704, the first bit is read from the compressed data block, and these first bits are 6, 4, 6, and 3 for the respective red, green, blue, and alpha channels. In step S706, the decompression unit 602 will determine that if lossless compression is used, then each image element value will have 19 bits for the difference, whereas the target compression level (50%) in this example only allows for a maximum of 16 bits per image element value for the difference. The same algorithm is used in the compression technique described above, so the difference size determination logic 608 determines the difference size (i.e., the second bit) for the channels to be R=4 bits, G=4 bits, B=5 bits, and A=3 bits.

[0208] In step S708, the unpacker logic 610 reads a difference value from the compressed data block based on the determined second bit number. In step S710, the unpacker logic 610 adds the LSB to the difference value, where appropriate, to form a difference value having a first bit number for each of the channels. In this example, the added bits are all zeros, so the difference value will be determined as (where the bold bits have been added to different values ​​in the compressed block by the unpacker logic):

[0209] Red increment value: [000100,001100,000000,100100] (in decimal: [4,12,0,36])

[0210] Green increment value: [0101,0101,1010,0000] (in decimal: [5,5,10,0])

[0211] Blue increment value: [100100,001010,000000,011000] (in decimal: [36,10,0,24])

[0212] α increment value: [101,101,000,101] (in decimal: [5,5,0,5])

[0213] In step S712, the data value determination logic 606 reads the origin value from the compressed data block. In step S714, the data value determination logic 606 adds the difference value to the origin value to determine the data value of the decompressed image element value as:

[0214] The red value is determined as (in binary): 00001001+[000100,001100,000000,100100]=[00001101,00010101,00001001,00101101] (or in decimal: 9+[4,12,0,36]=[13,21,9,45])

[0215] The green value is determined as (in binary): 01010100+[0101,0101,1010,0000]=[01011001,01011001,01011110,01010100] (or in decimal: 84+[5,5,10,0]=[89,89,94,84])

[0216] The blue value is determined as (in binary): 11001100+[100100,001010,000000,011000]=[11110000,11010110,11001100,11100100] (or in decimal: 204+[36,10,0,24]=[240,214,204,228])

[0217] The α value is determined as (in binary): 11111010+[101,101,000,101]=[11111111,11111111,11111010,11111111] (or in decimal: 250+[5,5,0,5]=[255,255,250,255])

[0218] By comparing these decompressed values ​​to the original input values, it can be seen that in this example some small errors have been introduced into the red and blue channels, but not into the green and alpha channels.

[0219] As described above, some examples are described in detail herein with reference to blocks of pixel data comprising pixel values, but more generally, compression and decompression processes may be performed on blocks of image data comprising image element values, where the image element values ​​may be pixel values, texel values, depth values, surface normal values, or illumination values, to name some examples.

[0220] All operations performed by the above-mentioned compression unit 302 and decompression unit 602 are easy to implement in hardware, such as using shifters, adders and comparators. The compression unit 302 and decompression unit 602 do not perform complex operations such as division. In addition, for the operation of the compression unit 302 and the decompression unit 602, no large cache or other types of large local memory are required. For these reasons, the compression unit 302 and the decompression unit 602 are easy to implement in hardware, which can make the hardware smaller (e.g., smaller silicon area), power consumption lower and / or operation delay lower than more complex compression and decompression units. In addition, the same compression unit (e.g., compression unit 302) can perform lossless and lossy compression, so if it is desired to achieve both lossless and lossy compression, then there is no need for two separate compression units. Similarly, the same decompression unit (e.g., decompression unit 602) can perform lossless and lossy decompression on the compressed data block, so if it is desired to achieve both lossless and lossy decompression, then there is no need for two separate decompression units. When both lossless and lossy techniques are desired, having a single compression unit and a single decompression unit configured to operate in both a lossless and lossy manner (as opposed to implementing a lossless compression unit, a separate lossy compression unit, a lossless decompression unit, and a separate lossy decompression element) reduces the amount of silicon area implemented on the compression unit and the decompression unit.

[0221] Figure 8 802, a GPU 102, a memory 804, and other devices 806, such as a display 808, a speaker 810, and a camera 812. The components of the computer system can communicate with each other via a communication bus 814. At least part of the memory 804 can be used as Figure 1 The memory 104 shown in .

[0222] The compression unit and the decompression unit are described herein as comprising a plurality of functional blocks. This is merely illustrative and is not intended to define a strict division between different logical elements of such entities. Each functional block may be provided in any suitable manner. It should be understood that the intermediate values ​​described herein as being formed by the compression unit or the decompression unit do not need to be physically generated by the compression unit or the decompression unit at any point in time, and may simply represent a logical value that conveniently describes the processing performed by the compression unit or the decompression unit between its input and output.

[0223] Compression unit and decompression unit as described herein can be implemented in hardware on integrated circuit.Compression unit and decompression unit as described herein can be configured to perform any method described herein.In general, any one of the functions, methods, techniques or components described above can be implemented in software, firmware, hardware (e.g., fixed logic circuit system) or any combination thereof.Terms "module", "function", "component", "element", "unit", "block" and "logic" can be used herein to generally represent software, firmware, hardware or any combination thereof.In the case of software implementation scheme, module, function, component, element, unit, block or logic represent program code, and the program code performs specified tasks when executed on a processor.Algorithms and methods described herein can be performed by one or more processors of execution code, and the code enables the processor to perform 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 use magnetic, optical and other technologies to store instructions or other data and can be accessed by a machine.

[0224] As used herein, the terms computer program code and computer readable instructions refer to any kind of executable code for a processor, including code expressed in machine language, interpreted language, or scripting language. Executable code includes binary code, machine code, byte code, code that defines an integrated circuit (such as a hardware description language or netlist), and code expressed in programming language code 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, run in a virtual machine or other software environment, causes a processor of a computer system supporting the executable code to perform the tasks specified by the code.

[0225] A processor, computer or computer system may be any kind of device, machine or special purpose circuit, or a collection or part thereof, which has processing capabilities so that instructions can be executed. A processor may be any kind of general 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.

[0226] The present invention is also intended to cover software that defines the configuration of hardware as described herein, such as hardware description language (HDL) software 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 is encoded computer-readable program code in the form of an integrated circuit definition data set, which, when processed (i.e., run) in an integrated circuit manufacturing system, configures the system to manufacture a compression unit and / or a decompression unit configured to perform any of the methods described herein, or to manufacture a compression unit and / or a decompression unit comprising any of the apparatus described herein. The integrated circuit definition data set may be, for example, an integrated circuit description.

[0227] Thus, a method of manufacturing a compression unit and / or a decompression unit as described herein in an integrated circuit manufacturing system may be provided. In addition, an integrated circuit definition data set may be provided, which, when processed in an integrated circuit manufacturing system, enables the method of manufacturing a compression unit and / or a decompression unit to be performed.

[0228] The integrated circuit definition data set may be in the form of computer code, for example as a netlist, code for configuring a programmable chip, as a hardware description language that defines hardware suitable for fabrication at any level in an integrated circuit, including as register transfer level (RTL) code, as a high-level circuit representation such as Verilog or VHDL, and as a low-level circuit representation such as OASIS (RTM) and GDSII. Higher-level representations that logically define hardware suitable for fabrication in an integrated circuit, such as RTL, may be processed on a computer system configured to generate a manufacturing definition of the integrated circuit in the context of a software environment that includes definitions of circuit elements and rules for combining those elements to generate a manufacturing definition of the integrated circuit defined by the representation. As is typically the case with software executed 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 a manufacturing definition of the integrated circuit to execute code that defines the integrated circuit to generate the manufacturing definition of the integrated circuit.

[0229] Now refer to Fig. 9 An example of processing an integrated circuit definition data set at an integrated circuit manufacturing system to configure the system to manufacture a compression unit and / or a decompression unit is described.

[0230] Fig. 9An example of an integrated circuit (IC) manufacturing system 902 is shown, which is configured to manufacture a compression unit and / or a decompression unit as described in any of the examples herein. Specifically, the IC manufacturing system 902 includes a layout processing system 904 and an integrated circuit generation system 906. The IC manufacturing system 902 is configured to receive an IC definition data set (e.g., defining a compression unit and / or a decompression unit as described in any of the examples herein), process the IC definition data set, and generate an IC (e.g., which embodies a compression unit and / or a decompression unit as described in any of the examples herein) based on the IC definition data set. The processing of the IC definition data set configures the IC manufacturing system 902 to manufacture an integrated circuit that embodies a compression unit and / or a decompression unit as described in any of the examples herein.

[0231] The layout processing system 904 is configured to receive and process an IC definition data set to determine a circuit layout. Methods for determining a circuit layout based on an IC definition data set are known in the art and may, for example, involve synthesizing RTL code to determine a gate-level representation of a circuit to be generated, for example, in terms of logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining location information for the logic components, the circuit layout may be determined based on the gate-level representation of the circuit. This may be done automatically or with user involvement in order to optimize the circuit layout. After the layout processing system 904 has determined the circuit layout, it may output the circuit layout definition to the IC generation system 906. The circuit layout definition may be, for example, a circuit layout description.

[0232] As is known in the art, IC generation system 906 generates ICs according to the circuit layout definition. For example, IC generation system 906 can implement a semiconductor device manufacturing process to generate ICs, which can 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 can be in the form of a mask that can be used in a photolithography process to generate ICs according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 906 can be in the form of a computer readable code that the IC generation system 906 can use to form a suitable mask for generating the IC.

[0233] The different processes performed by the IC manufacturing system 902 may all be implemented in one location, such as by one party. Alternatively, the IC manufacturing system 902 may be a distributed system such that some processes may be performed in different locations and may be performed 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 data set to form a gate-level representation of a 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.

[0234] In other examples, processing the integrated circuit definition data set at the integrated circuit manufacturing system may configure the system to manufacture the compression unit and / or the decompression unit without processing the IC definition data set to determine the circuit layout. For example, the integrated circuit definition data set may define a configuration of a reconfigurable processor such as an FPGA, and processing the data set may configure the IC manufacturing system to generate (e.g., by loading the configuration data into the FPGA) a reconfigurable processor having the defined configuration.

[0235] In some embodiments, when processed in an integrated circuit manufacturing system, the integrated circuit manufacturing definition data set may enable the integrated circuit manufacturing system to generate an apparatus as described herein. Fig. 9 The integrated circuit manufacturing system is configured in the described manner to manufacture the device described herein.

[0236] In some examples, the integrated circuit definition data set may include software that runs on, or in combination with, the hardware defined at the data set. Fig. 9 In the example shown, the IC generation system can be further configured by the integrated circuit definition dataset to load firmware onto the integrated circuit according to the program code defined at the integrated circuit definition dataset when manufacturing the integrated circuit, or otherwise provide the integrated circuit with program code for use with the integrated circuit.

[0237] Compared to known implementations, the implementation of the concepts set forth in this application in devices, equipment, modules and / or systems (and in the methods implemented herein) can cause performance improvements. Performance improvements can include one or more of improved computing performance, reduced waiting time, increased throughput and / or reduced power consumption. During the manufacture of such devices, devices, modules and systems (e.g., in integrated circuits), a trade-off can be made between performance improvements and physical implementations to improve 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. For example, this can be accomplished by reusing functional blocks in a serial manner or sharing functional blocks between elements of devices, devices, modules and / or systems. In contrast, the concepts set forth in this application that cause improvements in the physical implementations of devices, devices, modules and systems (e.g., reduced silicon area) can be weighed against performance improvements. For example, this can be accomplished by manufacturing multiple instances of a module within a predefined area budget.

[0238] Applicants hereby independently disclose each individual feature described herein and any combination of two or more such features, to the extent that such feature or combination can be implemented according to the common general knowledge of a person skilled in the art based on the specification as a whole, regardless of whether such feature or combination of features solves any problem disclosed herein. In view of the foregoing description, it will be clear to a person skilled in the art that various modifications can be made within the scope of the invention.

Claims

1. A computer-implemented method of performing decompression to determine one or more image element values ​​from compressed data, wherein the compressed data represents a block of image data comprising a plurality of image element values, each image element value comprising one or more data values ​​associated with a corresponding one or more channels, the method comprising: reading from the compressed data an indication of an origin value for each of the one or more channels; for each of the one or more channels, reading from the compressed data an indication of a first bit number representing a difference value, the difference value representing a difference between the data value and an origin value for the channel; for each of the one or more channels, obtaining a second bit number, wherein a representation of a difference value for each of the one or more channels is included in the compressed data using the second bit number for the channel; reading from the compressed data a representation of the difference for decompressed one or more image element values ​​using the one or more second bit numbers obtained for the corresponding one or more channels; determining, for each of the one or more channels and for each of the one or more image element values ​​being decompressed, a difference value according to the first number of bits of the channel based on a representation of the difference value read from the compressed data; and For each of the one or more channels, a data value associated with the channel is determined for each of the decompressed one or more image element values ​​using: an origin value for the channel; and a difference value for the channel determined for the image element values.

2. The method according to claim 1, wherein: The difference value of a channel determined for a picture element value has the first number of bits of the channel.

3. The method according to claim 1 or claim 2, wherein: Determining, for each of the one or more channels and for each of the one or more image element values ​​being decompressed, a difference value based on the first bit number of the channel comprises adding zero, one or more least significant bits to a representation of the difference value read from the compressed data, thereby determining a difference value having the first bit number for each of the one or more channels.

4. The method according to claim 3, wherein: The zero, one or more least significant bits added to the representation of the difference value read from the compressed data are all zero.

5. The method according to claim 3, wherein: The zero, one, or more least significant bits added to the representation of the difference value read from the compressed data are all ones.

6. The method according to claim 3, wherein: The zero, one or more least significant bits added to the representation of the difference value of a channel read from the compressed data are equal to the corresponding zero, one or more most significant bits of the origin value of the channel.

7. The method according to claim 3, wherein: The zero, one or more least significant bits added to the representation of the difference value read from the compressed data are random bits or pseudo-random bits.

8. The method according to claim 3, wherein: The zero, one or more least significant bits added to the representation of the difference value of a channel read from the compressed data are different for different ranges of origin values ​​or for different ranges of different values.

9. The method according to claim 1 or 2, wherein: The one or more second bit numbers are determined to ensure that the compressed data meets a target compression level for compressing the block of image data.

10. The method according to claim 1 or 2, wherein: For each of the one or more channels, obtaining a second bit number includes using a first bit number of each of the one or more channels to determine a second bit number of the channel according to a predetermined scheme.

11. The method according to claim 10, wherein: determining the one or more second bit numbers to ensure that the compressed data meets a target compression level for compressing the block of image data, and wherein, using the first bit number of each of the one or more channels, determining the second bit number of the channel according to a predetermined scheme comprises determining whether a difference value representing the one or more channels with the corresponding determined one or more first bit numbers meets the target compression level, wherein if it is determined that the difference of the one or more channels represented by the corresponding determined one or more first digits satisfies the target compression level, then for each of the one or more channels, the second digit is equal to the first digit of the channel; and Wherein, if it is determined that the difference of the one or more channels represented by the corresponding determined one or more first digits does not meet the target compression level, then for at least one of the one or more channels, the second digit is smaller than the first digit of the channel.

12. The method according to claim 10, wherein: There is a threshold number of bits for each of the one or more channels, Wherein, if the first number of bits of a channel is less than or equal to the threshold number of bits of the channel, then the second number of bits of the channel is equal to the first number of bits of the channel, and If the first bit number of a channel is greater than the threshold bit number of the channel, the second bit number of the channel is within the range from the threshold bit number of the channel to the first bit number of the channel.

13. The method according to claim 1 or 2, wherein: The obtaining, for each of the one or more channels, a second bit number comprises reading an indication of the second bit number of the channel from the compressed data.

14. The method according to claim 1 or 2, wherein: Determining, for each of the one or more channels, a data value associated with the channel for each of the one or more decompressed image element values ​​comprises: summing the origin value of the channel and the difference value of the channel determined for the image element value; or subtracting the difference value of the channel determined for the image element value from the origin value of the channel.

15. The method according to claim 1 or 2, wherein: Determining, for each of the one or more channels, a data value associated with the channel for each of the one or more decompressed image element values ​​comprises combining, using a modulo operation, an origin value of the channel with a difference value of the channel determined for the image element value.

16. The method according to claim 1 or 2, wherein: the compressed data comprising a plurality of origin values ​​for at least one of the one or more channels, wherein an indication is included in the compressed data to indicate from which of the plurality of origin values ​​each difference value of the at least one of the one or more channels has been determined, Wherein, for at least one of the one or more channels, determining a data value associated with the channel for each of the one or more image element values ​​being decompressed comprises using: an origin value for the channel indicated by an indication of a difference value for the channel determined for the image element value; and a difference value for the channel determined for the image element value.

17. The method according to claim 1 or 2, wherein: The compressed data is in a compressed data block, and the compressed data block includes: a header portion having a fixed size and comprising an indication of the origin value and an indication of a first bit number for each of the one or more channels; and a body portion having a variable size and comprising a representation of a difference value for each of the one or more channels, wherein the compressed data block has a base address, and wherein the header portion starts at a first address defined by the base address, wherein data of the header portion runs from the first address in a first direction, and wherein the body portion starts at a second address defined by the base address, wherein data of the body portion runs from the second address in a second direction, wherein, in the address space, the first direction is opposite to the second direction.

18. The method according to claim 1 or 2, further comprising: determining one or more error correction indicators based on the determined data values ​​of the one or more image element values ​​that were decompressed; reading one or more error correction indicators from the compressed data; as well as The determined one or more error correction indicators are compared to one or more error correction indicators read from the compressed data to determine whether an error exists in the determined data values ​​of the decompressed one or more image element values.

19. A decompression apparatus configured to perform decompression to determine one or more image element values ​​from compressed data, wherein the compressed data represents a block of image data comprising a plurality of image element values, each image element value comprising one or more data values ​​associated with a corresponding one or more channels, the decompression apparatus comprising: data value determination logic configured to read from the compressed data an indication of an origin value for each of the one or more channels; as well as A difference determination logic configured to: for each of the one or more channels, reading from the compressed data an indication of a first bit number representing a difference value, the difference value representing a difference between the data value and an origin value for the channel; for each of the one or more channels, obtaining a second bit number, wherein a representation of a difference value for each of the one or more channels is included in the compressed data using the second bit number for the channel; reading from the compressed data a representation of a difference in one or more image element values ​​being decompressed using the one or more second bit numbers obtained for the corresponding one or more channels; and determining, for each of the one or more channels and for each of the one or more image element values ​​being decompressed, a difference value according to the first number of bits of the channel based on a representation of the difference value read from the compressed data; The data value determination logic is further configured to determine, for each of the one or more channels, a data value associated with the channel for each of the decompressed one or more image element values ​​using: an origin value of the channel; and a difference value of the channel determined for the image element value.

20. A method for manufacturing the decompression device according to claim 19 using an integrated circuit manufacturing system, the method comprising: processing the computer-readable description of the decompression apparatus using a layout processing system to generate a circuit layout description of an integrated circuit embodying the decompression apparatus; as well as The decompression device is manufactured according to the circuit layout description using an integrated circuit generation system.

Citation Information

Cited By

  • Video image compression algorithm based on H.266 / VVC standard

    CN120676160A