EP-3896656-B1 - IMAGE DATA COMPRESSION
Inventors
- YANG, XILE
Dates
- Publication Date
- 20260506
- Application Date
- 20210322
Claims (12)
- A computer-implemented method of performing lossy compression on a plurality of blocks of image data in accordance with a multi-level difference table, wherein the blocks of image data relate to respective channels of multi-channel image data, wherein each block of image data comprises a plurality of image element values, wherein image element values are one of: pixel values, texel values, surface normal values or lighting values, and wherein each level of the multi-level difference table comprises a plurality of entries, which represent differences from an origin value, and wherein a size of a range of values represented by the entries in a level is different for different levels of the multi-level difference table, the method comprising compressing the block of image data for each of the different channels of the multi-channel image data independently by: determining (S316), based on the image element values in the block of image data, an origin value for the block of image data; determining (S318) a level within the multi-level difference table for the block of image data, wherein said determining a level comprises: determining (S406) a maximum difference between the determined origin value and any one of the image element values in the block of image data; and selecting, from the multi-level difference table, the level whose largest entry most closely represents the determined maximum difference; for each image element value in the block of image data, selecting (S320) one of the entries at the determined level within the multi-level difference table, wherein said selecting one of the entries comprises: determining (S506) a difference value for the image element value by determining a difference between the determined origin value and the image element value; and selecting, from the determined level of the multi-level difference table, the entry which most closely represents the determined difference value; and forming (S322) a compressed block of data (600) for the block of image data, the compressed block of data comprising: (i) data representing the determined origin value (602), (ii) an indication of the determined level (604), and (iii) for each image element value in the block of image data, an indication of the selected entry for that image element value (606).
- The method of claim 1, wherein said determining (S316) an origin value for the block of image data comprises identifying a minimum image element value in the block of image data.
- The method of any preceding claim wherein the image element values are in an integer format, and wherein the block of image data is compressed by performing operations including one or more of addition operations, subtraction operations and compare operations on the image element values in the integer format, but the method of compressing the block of image data does not involve performing any multiplication operations or division operations.
- The method of any preceding claim, wherein the block of multi-channel image data is colour data for a block of colour values, comprising: (i) a first block of image data relating to a red channel of the block of colour values, (ii) a second block of image data relating to a green channel of the block of colour values, and (iii) a third block of image data relating to a blue channel of the block of colour values, and wherein before the three blocks of image data are compressed independently, colour decorrelation is performed on the colour values.
- The method of any preceding claim, wherein the multi-channel image data is colour data in an RGB format such that each colour value comprises a red value (R), a green value (G) and a blue value (B), and the method comprises converting the colour data to a luma-chroma format which comprises: (i) a first block of image data relating to a luma channel (Y) for a block of colour values, (ii) a second block of image data relating to a first chroma channel (Cb) for the block of colour values, and (iii) a third block of image data relating to a second chroma channel (Cr) for the block of colour values, wherein after the colour data has been converted to the luma-chroma format, the three blocks of image data are compressed independently.
- A method of compressing a block of image data, comprising: determining (S1004) whether a lossless compression of the block of image data will satisfy a target compression ratio for the block of image data, wherein a target compression ratio is a targeted ratio given by dividing a size of uncompressed image data by a size of the compressed data; and in response to determining that the lossless compression of the block of image data will not satisfy the target compression ratio, performing (S1006) the lossy compression method of any preceding claim on the block of image data, wherein a compression ratio of the lossy compression is guaranteed to satisfy the target compression ratio for the block of image data.
- The method of any preceding claim wherein the multi-level difference table is predetermined.
- A compression unit (302) configured to perform lossy compression on a plurality of blocks of image data in accordance with a multi-level difference table, wherein the blocks of image data relate to respective channels of multi-channel image data, wherein each block of image data comprises a plurality of image element values, wherein image element values are one of: pixel values, texel values, surface normal values or lighting values, and wherein each level of the multi-level difference table comprises a plurality of entries, which represent differences from an origin value, and wherein a size of a range of values represented by the entries in a level is different for different levels of the multi-level difference table, the compression unit being configured to compress the block of image data for each of the different channels of the multi-channel image data independently by: origin value determination logic (304) determining an origin value for the block of image data, said determining based on the image element values in the block of image data; level determination logic (306) determining a level within the multi-level difference table for the block of image data, wherein said determining a level comprises: determining a maximum difference between the determined origin value and any one of the image element values in the block of image data; and selecting, from the multi-level difference table, the level whose largest entry most closely represents the determined maximum difference; entry selection logic (308) selecting, for each image element value in the block of image data, one of the entries at the determined level within the multi-level difference table, wherein said selecting one of the entries comprises: determining a difference value for the image element value by determining a difference between the determined origin value and the image element value; and selecting, from the determined level of the multi-level difference table, the entry which most closely represents the determined difference value; and compressed block formation logic (310) forming a compressed block of data for the block of image data, the compressed block of data comprising: (i) data representing the determined origin value, (ii) an indication of the determined level, and (iii) for each image element value in the block of image data, an indication of the selected entry for that image element value.
- A compression unit (902) configured to compress a block of image data, the compression unit comprising: a first compression unit (904) configured to perform lossless compression on a block of image data; a second compression unit (302) according to claim 8 configured to perform lossy compression on a block of image data; and compression technique determination logic (906) configured to determine (S1004) whether a lossless compression of the block of image data performed by the first compression unit will satisfy a target compression ratio for the block of image data, wherein a target compression ratio is a targeted ratio given by dividing a size of uncompressed image data by a size of the compressed data; wherein the compression technique determination logic is configured to: if it determines that the lossless compression of the block of image data will not satisfy the target compression ratio, cause the second compression unit to perform (S1006) lossy compression on the block of image data, wherein a compression ratio of the lossy compression is guaranteed to satisfy the target compression ratio for the block of image data; and if it determines that the lossless compression of the block of image data will satisfy the target compression ratio, cause the first compression unit to perform (S1012) the lossless compression on the block of image data to form a compressed block of data.
- A compression unit configured to perform the method of any of claims 1 to 7.
- Computer readable code configured to cause the method of any of claims 1 to 7 to be performed when the code is run.
- A computer readable storage medium having stored thereon an integrated circuit definition dataset that, when processed in an integrated circuit manufacturing system (1302), configures the integrated circuit manufacturing system to manufacture a compression unit as claimed in any of claims 8 to 10.
Description
FIELD This disclosure relates to data compression and data decompression. BACKGROUND Data compression, both lossless and lossy, is desirable in many applications in which data is to be stored in, and/or read from memory. By compressing data before storage of the data in memory, the amount of data transferred to the memory may 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 that has values corresponding to respective pixel or sample locations of an image. For example, the image may be produced as part of a rendering process on a Graphics Processing Unit (GPU). Image data includes, but is not limited to, depth data to be stored in a depth buffer, pixel data (e.g. colour data) to be stored in a frame buffer, texture data to be stored in a texture buffer and surface normal data to be stored in a surface normal buffer. These buffers may be any suitable type of memory, such as cache memory, separate memory subsystems, memory areas in a shared memory system or some combination thereof. A GPU may be used to process data in order to generate image data. For example, a GPU may determine pixel values (e.g. colour values) of an image to be stored in a frame buffer which may be output to a display. GPUs usually have highly parallelised structures for processing large blocks of data in parallel. There is significant commercial pressure to make GPUs (especially those intended to be implemented on mobile/embedded devices) operate with reduced latency, reduced power consumption and with a reduced physical size, e.g. a reduced silicon area. Competing against these aims is a desire to use higher quality rendering algorithms to produce higher quality images. Reducing the memory bandwidth (i.e. reducing the amount of data transferred between the GPU and a memory can significantly reduce the latency and the power consumption of the system, which is why compressing the data before transferring the data can be particularly useful. The same is true, to a lesser extent, when considering data being moved around within the GPU itself. Furthermore, the same issues may be relevant for other processing units, e.g. central processing units (CPUs), as well as GPUs. FIG. 1 shows an example computing system 100 which may be implemented in an electronic device, such as a mobile/embedded device. The computing system 100 comprises a host CPU 102, a GPU 104, a memory 106 (e.g. graphics memory) and a display 108. The CPU 102 is configured to communicate with the GPU 104. Data, which may be compressed data, can be transferred in either direction, between the GPU 104 and the memory 106. Images (e.g. represented with pixel values) which are rendered by the GPU 104 may be stored in memory 106 and displayed on the display 108 via a display interface 116. The GPU 104 comprises rendering logic 110, a compression/decompression unit 112, and a memory interface 114. The graphics rendering system 100 is arranged such that data can pass, in either direction, between: (i) the CPU 102 and the rendering logic 110; (ii) the CPU 102 and the memory interface 114; (iii) the memory interface 114 and the memory 106; (iv) the rendering logic 110 and the compression/decompression unit 112; (v) the compression/decompression unit 112 and the memory interface 114; and (vi) the memory 106 and the display interface 116. In some examples, the graphics rendering system 100 may be further arranged such that data can pass, in either direction between the compression/decompression unit 112 and the display interface 116, and such that data can pass from the display interface 116 to the display 108. In operation, the GPU 104 may process regions of image data individually. The regions may for example represent rectangular (including square) portions (or "tiles") of the render space (i.e. the two-dimensional space representing, for example, an image area to be rendered). The rendering logic 110 may perform scan conversion and rasterization of graphics primitives, such as, but not limited to, triangles and lines, using known techniques such as depth test and texture mapping. The rendering logic 110 may contain cache units to reduce memory traffic. Some data is read or written by the rendering logic 110, from or to the memory 106 via the memory interface 114 (which may include a cache) but for other data, such as data to be stored in a buffer, such as the frame buffer, the data preferably goes from the rendering logic 110 to the memory interface 114 via the compression/decompression unit 112. The compression/decompression unit 112 reduces the amount of data that is to be transferred across the external memory bus to the memory 106 by compressing the data. The display interface 116 sends data defining a completed image to the display 108. An uncompressed image may be accessed directly from the memory 106. Compressed data may be decompressed via the compression/decompres