US-12621457-B2 - Data compression and packing
Abstract
Input pixel data having first, second and third channel data for each pixel of a block of data is received in raster scan order and is compressed in raster scan order using a block-based encoding scheme. The compressed pixel data is then output in raster scan order.
Inventors
- Jeffery Thomas Bond
- Gregory Alan Clark
- Selina Hopton
- Simon Fenney
Assignees
- IMAGINATION TECHNOLOGIES LIMITED
Dates
- Publication Date
- 20260505
- Application Date
- 20211201
- Priority Date
- 20201201
Claims (19)
- 1 . A method of data compression comprising: receiving input pixel data for a block of data in raster scan order, the pixel data comprises at least first, second and third channel data for each pixel; compressing the pixel data substantially in raster scan order using a block-based encoding scheme; and outputting compressed pixel data substantially in raster scan order; wherein the first, second and third channel data for each pixel comprises red, green and blue channel data for each channel.
- 2 . The method according to claim 1 , wherein compressing the pixel data substantially in raster scan order using a block-based encoding scheme comprises: sub-dividing the input block of pixels into part-blocks, each part-block comprising more than one row of pixels; and compressing the pixel data substantially in raster scan order using a block-based encoding scheme and the sub-division.
- 3 . The method according to claim 2 , wherein compressing the pixel data substantially in raster scan order using a block-based encoding scheme and the sub-division comprises: for each part-block, analysing pixel data for pixels in the part-block to identify an encoding pattern for use on the pixels in the part-block; and encoding the pixel data substantially in raster scan order using the selected patterns.
- 4 . The method according to claim 3 , wherein a part-block comprises 2×2 pixels and wherein analysing pixel data to identify an encoding pattern for use on pixels in the part-block comprises, for each part-block: calculating differences for each pixel pair in the part-block; in response to determining that a smallest difference does not exceed a pre-defined threshold, selecting one of a set of three-value encoding patterns based on the pixel pair having the smallest difference and calculating and storing in a buffer average pixel data for the pixels in the pixel pair having the smallest difference; and in response to determining that the smallest difference does exceed a pre-defined threshold, selecting a four-value encoding mode.
- 5 . The method according to claim 4 , wherein analysing pixel data to identify an encoding pattern for use on pixels in the part-block further comprises, for each part-block: in response to determining that the smallest difference does not exceed a pre-defined threshold and that the pixel pair having the smallest difference is the pair of pixels in a first row of the part-block, storing in the buffer pixel data for a first pixel in a second row of the part-block.
- 6 . The method according to claim 3 , wherein encoding the pixel data substantially in raster scan order using the selected patterns comprises: encoding the pixel data substantially in raster scan order using the selected patterns such that each pixel or pair of adjacent pixels from the same part-block is compressed into a sequence of a multiple of P bits, where P is an integer.
- 7 . The method according to claim 6 , wherein encoding the pixel data substantially in raster scan order using the selected patterns such that each pixel or pair of adjacent pixels from the same part-block is compressed into a sequence of a multiple of P bits comprises: encoding the pixel data substantially in raster scan order using the selected patterns; and where a pixel or pair of adjacent pixels from the same part-block is compressed into a sequence that is less than a multiple of P bits, embedding one or more control and/or padding bits to increase the sequence length to a multiple of P bits.
- 8 . The method according to claim 7 , wherein a part-block comprises 2×2 pixels and wherein encoding the pixel data substantially in raster scan order using the selected patterns comprises: for a pair of adjacent pixels from a first row in a part-block and where a three-value encoding pattern is used, outputting a sequence comprising two encoded pixel values; and for a pair of adjacent pixels from a second row in a part-block and where a three-value encoding pattern is used, outputting a sequence comprising one encoded pixel value.
- 9 . The method according to claim 8 , wherein: the sequence comprising two encoded pixel values comprises either: average pixel data for a pixel pair in the part-block read from a buffer and converted pixel data for one of the pair of adjacent pixels from the first row of the part-block; or converted pixel data for each of the pair of adjacent pixels from the first row of the part-block; and the sequence comprising one encoded pixel value comprises either: average pixel data for a pixel pair in the part-block read from a buffer; or converted pixel data for one of the pair of adjacent pixels from the second row of the part-block.
- 10 . The method according to claim 1 , wherein outputting compressed pixel data substantially in raster scan order comprises: packing the compressed pixel data into a data structure substantially in raster scan order; and outputting the data structure.
- 11 . The method according to claim 10 , wherein packing the compressed pixel data into a data structure substantially in raster scan order comprises: concatenating the compressed pixel data substantially in raster scan order to form a block of compressed pixel data; and concatenating the block of compressed pixel data and a block of control data.
- 12 . The method according to claim 11 , wherein concatenating the block of compressed pixel data and a block of control data comprises: appending or prepending the block of control data to the block of compressed pixel data.
- 13 . The method according to claim 11 , further comprising, prior to concatenating the compressed pixel data: embedding one or more bits of control data within the pixel data.
- 14 . A non-transitory computer readable storage medium having stored thereon computer readable code configured to cause the method as set forth in claim 1 to be performed when the code is run.
- 15 . Data compression hardware comprising: an input for receiving input pixel data for a block of data in raster scan order, the pixel data comprises at least first, second and third channel data for each pixel; hardware logic arranged to compress the pixel data substantially in raster scan order using a block-based encoding scheme; and an output for outputting compressed pixel data substantially in raster scan order; wherein the first, second and third channel data for each pixel comprises red, green and blue channel data for each channel.
- 16 . The data compression hardware according to claim 15 , wherein the hardware logic comprises: an analysis pipeline arranged to sub-divide the input block of pixels into part-blocks, each part-block comprising more than one row of pixels; and encoding hardware arranged to compress the pixel data substantially in raster scan order using a block-based encoding scheme and the sub-division.
- 17 . The data compression hardware according to claim 16 , further comprising a buffer, wherein the analysis pipeline is further arranged to store data in the buffer for use by the encoding hardware and wherein the encoding hardware is arranged to read the stored data from the buffer when encoding the pixel data.
- 18 . A non-transitory computer readable storage medium having stored thereon a computer readable dataset description of an integrated circuit that, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture data compression hardware as set forth in claim 15 .
- 19 . An integrated circuit manufacturing system comprising: a non-transitory computer readable storage medium having stored thereon a computer readable dataset description of an integrated circuit that describes data compression hardware as set forth in claim 15 ; a layout processing system configured to process the integrated circuit dataset description so as to generate a circuit layout description of an integrated circuit embodying the data compression hardware; and an integrated circuit generation system configured to manufacture the data compression hardware according to the circuit layout description.
Description
BACKGROUND Data compression, either lossless or lossy, is desirable in many applications in which data is to be stored in, and/or read from, a memory. By compressing data before storage of the data in a 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, such as depth data to be stored in a depth buffer, pixel data to be stored in a frame buffer and texture data to be stored in a texture 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 Graphics Processing Unit (GPU) may be used to process image data in order to determine pixel values of an image to be stored in a frame buffer for 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 devices) operate at lower power levels. Competing against this is the desire to use higher quality rendering algorithms on faster GPUs, which thereby puts pressure on a relatively limited resource: memory bandwidth. However, increasing the bandwidth of the memory subsystem might not be an attractive solution because moving data to and from, and even within, the GPU consumes a significant portion of the power budget of the GPU. The same issues may be relevant for other processing units, such as central processing units (CPUs), as well as GPUs. The embodiments described below are provided by way of example only and are not limiting of implementations which solve any or all of the disadvantages of known methods of data compression and decompression. SUMMARY This Summary is provided to introduce a selection of concepts in a simplified form 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. A method of data compression is described. The method comprises receiving input pixel data for a block of data in raster scan order where the pixel data comprises at least red, green and blue channel data for each pixel. The pixel data is compressed using a block-based encoding scheme and then the compressed pixel data is output substantially in raster scan order. A method of data decompression is described. The method comprises receiving compressed pixel data substantially in raster scan order and determining a number of bits of compressed data that corresponds to one row of pixels. Then, for each group of pixels in the row, the method identifies a block-based decoding scheme for the group of pixels and decodes the group of pixels using the identified scheme. A first aspect provides a method of data compression comprising: receiving input pixel data for a block of data in raster scan order, the pixel data comprises at least first, second and third channel data for each pixel; compressing the pixel data substantially in raster scan order using a block-based encoding scheme; and outputting compressed pixel data substantially in raster scan order. A second aspect provides data compression hardware comprising: an input for receiving input pixel data for a block of data in raster scan order, the pixel data comprises at least first, second and third channel data for each pixel; hardware logic arranged to compress the pixel data substantially in raster scan order using a block-based encoding scheme; and an output for outputting compressed pixel data substantially in raster scan order. A third aspect provides a method of data decompression comprising: receiving compressed pixel data substantially in raster scan order; determining a number of bits of compressed data that corresponds to one row of pixels; and for each group of pixels in the row, identifying a block-based decoding scheme for the group of pixels and decoding the group of pixels using the identified scheme. A fourth aspect provides data decompression hardware comprising: an input for receiving compressed image data substantially in raster scan order; control hardware arranged to determine a number of bits of compressed data that corresponds to one row of pixels; and decoding hardware arranged to decode groups of pixels, wherein either the control hardware or the decoding hardware is further arranged, for each group of pixels in the row, to identify a block-based decoding scheme for the group of pixels and wherein the decoding hardware is arranged to decode a group of pixels using the identified scheme. The data compression and/or decompression unit as described herein may be embodied in hardware on an integrated circuit. There may be provided a method of manufacturing, at an integrated circuit manufacturing system, a data compression and/or decompressi