Processor, image compression method, image decompression method, chip and device

By using a method that combines a clearing mask and clearing values ​​with pixel color data in image compression, the problem of insufficient compression ratio in high-frequency signal scenarios in existing technologies is solved, and efficient image block compression and storage optimization are achieved.

CN120602651BActive Publication Date: 2025-11-21MOORE THREADS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511093563.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-11-21
Estimated Expiration
2045-08-06

AI Technical Summary

Technical Problem

Existing image compression technologies, based on wavelet transform and entropy coding, assume that images are mostly low-frequency signals, resulting in poor compression rates in scenarios with many high-frequency signals.

Method used

By obtaining the clearing mask and clearing value of the image block, and combining them with the color data of each pixel, the data is stored as compressed data, while retaining the clearing mask generated during the rendering process, thus achieving effective compression of high-frequency signal scenes.

Benefits of technology

In image blocks with a large number of high-frequency signals, a good compression effect is achieved, and the color data of a small number of rendered pixels can be completely recorded, reducing storage requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602651B_ABST
    Figure CN120602651B_ABST
Patent Text Reader

Abstract

The application discloses a processor, an image compression method, an image decompression method, a chip and equipment, and belongs to the field of processors. The processor comprises an image compression unit. The image compression unit is used for obtaining a screen clearing mask and a screen clearing value of a first image block. The screen clearing mask is used for indicating a first pixel and a second pixel on the first image block. The first pixel is a pixel that is rendered on the first image block, the second pixel is a pixel that is not rendered on the first image block, and the screen clearing value is a default pixel value of the second pixel. The image compression unit is used for obtaining color data of the first pixel. The image compression unit is used for storing the screen clearing mask, the screen clearing value and the color data of each first pixel as compressed data of the first image block. Through the image compression operation performed by the processor, for the first image block in which only a small number of pixels are the first pixels, the first image block can achieve a better compression effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of processors, and in particular to a processor, an image compression method, an image decompression method, a chip and a device. BACKGROUND

[0002] In a graphics processing unit (GPU), image compression technology is often used to reduce the amount of image data, thereby reducing storage and transmission requirements.

[0003] In related technologies, the image data is converted to the frequency domain by using a wavelet transform method, and then the result of the frequency domain conversion is encoded by using an entropy encoding method to achieve the purpose of compressing the image data.

[0004] In related technologies, the wavelet transform and entropy encoding method are designed based on the assumption that images are mostly low-frequency signals. When there are many high-frequency signals on the image, the related technology cannot achieve a good compression rate. SUMMARY

[0005] The present application provides a processor, an image compression method, an image decompression method, a chip and a device. Through the image compression operation performed by the processor, for a first image block in which only a small number of pixels are first pixels, the first pixels are rendered pixels, and the first image block can achieve a good compression effect.

[0006] According to one aspect of the present application, a processor is provided, the processor comprising an image compression unit;

[0007] The image compression unit is configured to obtain a clear mask and a clear value of a first image block, the clear mask being used to indicate first pixels and second pixels on the first image block, the first pixels being rendered pixels on the first image block, the second pixels being unrendered pixels on the first image block, and the clear value being a default pixel value of the second pixels;

[0008] The image compression unit is configured to obtain color data of the first pixels;

[0009] The image compression unit is configured to store the clear mask, the clear value and the color data of each first pixel as compressed data of the first image block.

[0010] According to another aspect of the present application, a processor is provided, the processor comprising an image decompression unit;

[0011] an image decompression unit configured to obtain, from compressed data of the first image block, a clear mask and a clear value, the clear mask being configured to indicate first pixels and second pixels on the first image block, the first pixels being pixels on the first image block that are rendered, the second pixels being pixels on the first image block that are not rendered, the clear value being a default pixel value of the second pixels;

[0012] an image decompression unit configured to obtain color data of the first pixels;

[0013] an image decompression unit configured to restore the first image block based on the clear mask, the clear value, and the color data of each of the first pixels.

[0014] According to an aspect of the present application, there is provided an image compression method, the method comprising the following steps.

[0015] obtaining a clear mask and a clear value of a first image block, the clear mask being configured to indicate first pixels and second pixels on the first image block, the first pixels being pixels on the first image block that are rendered, the second pixels being pixels on the first image block that are not rendered, the clear value being a default pixel value of the second pixels;

[0016] obtaining color data of the first pixels;

[0017] storing the clear mask, the clear value, and the color data of each of the first pixels as compressed data of the first image block.

[0018] According to an aspect of the present application, there is provided an image decompression method, the method comprising the following steps.

[0019] obtaining, from compressed data of the first image block, a clear mask and a clear value, the clear mask being configured to indicate first pixels and second pixels on the first image block, the first pixels being pixels on the first image block that are rendered, the second pixels being pixels on the first image block that are not rendered, the clear value being a default pixel value of the second pixels;

[0020] obtaining color data of the first pixels;

[0021] restoring the first image block based on the clear mask, the clear value, and the color data of each of the first pixels.

[0022] According to an aspect of the present application, there is provided a chip, the chip comprising a processor as described above.

[0023] According to an aspect of the present application, there is provided a server, the server comprising a processor as described above.

[0024] According to an aspect of the present application, an electronic device is provided, which includes a processor as described above. The electronic device can be a terminal device. The terminal device can be a mobile phone, a computer, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc., but is not limited thereto.

[0025] The technical scheme provided by the embodiments of the present application has at least the following beneficial effects.

[0026] According to the scheme provided by the present application, when only a small number of pixels on the first image block are rendered pixels (first pixels), a large number of unrendered pixels (second pixels) on the first image block are represented by a screen clearing mask and a screen clearing value, and the color data of the small number of rendered pixels are recorded completely. Therefore, for the first image block in which only a small number of pixels are rendered pixels, the first image block can achieve a better compression effect, and a large number of high-frequency signals exist on the first image block. Moreover, according to the scheme provided by the present application, the screen clearing mask generated in the rendering process can be preserved. BRIEF DESCRIPTION OF DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0028] Figure 1 is a schematic diagram of a screen clearing mask provided by an embodiment of the present application.

[0029] Figure 2 is a schematic diagram of an edge mask provided by an embodiment of the present application.

[0030] Figure 3 is a schematic diagram of an image compression method provided by the related art.

[0031] Figure 4 is a schematic diagram of an image compression system provided by an embodiment of the present application.

[0032] Figure 5 is a schematic diagram of an image compression method provided by an embodiment of the present application.

[0033] Figure 6 is a schematic diagram of an image compression method provided by another embodiment of the present application.

[0034] Figure 7 is a schematic diagram of an image compression method provided by another embodiment of the present application.

[0035] Figure 8This is a schematic diagram of an image compression method provided in another embodiment of this application.

[0036] Figure 9 This is a schematic diagram of an image decompression system provided in one embodiment of this application.

[0037] Figure 10 This is a schematic diagram of an image decompression method provided in one embodiment of this application.

[0038] Figure 11 This is a schematic diagram of an image decompression method provided in another embodiment of this application.

[0039] Figure 12 This is a schematic diagram of an image decompression method provided in another embodiment of this application.

[0040] Figure 13 This is a schematic diagram of an image decompression method provided in another embodiment of this application.

[0041] Figure 14 This is a structural block diagram of an electronic device provided in one embodiment of this application. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0043] First, a brief introduction to the terms used in the embodiments of this application will be given.

[0044] Clear mask: Used to indicate the first and second pixels on the first image block. The first pixel is a rendered pixel on the first image block, and the second pixel is a non-rendered pixel on the first image block. For example, the clear mask includes n first bits, which correspond one-to-one with n pixels on the first image block. A first bit value of 0 indicates that the corresponding pixel is a pixel rendered by the shader, and a first bit value of 1 indicates that the corresponding pixel is a pixel not rendered by the shader.

[0045] like Figure 1 As shown, Figure 1 A first image patch 100 with a size of 8*8 is shown, and the first image patch 100 contains 64 pixels. Figure 1The pixel region in gray color is used to represent the part of the region rendered by the shader, and the pixel region in white color is used to represent the part of the region not rendered by the shader. Each pixel in the pixel region in white color corresponds to a first bit with a value of 1 in the clear mask 101, and each pixel in the pixel region in gray color corresponds to a first bit with a value of 0 in the clear mask 101. When performing the image compression of the first image block 100, each pixel in the white region can be represented by a clear value and the respective first bit with a value of 1, and each pixel in the gray region can be represented by the respective complete pixel value and the respective first bit with a value of 0.

[0046] Clear value: used to indicate the default pixel value of the pixel not rendered on the first image block.

[0047] Multi-Sample Anti Alias (MSAA): a kind of anti-aliasing technology directly implemented by a graphics processor, which is widely used in various graphics applications. In the original image without using the multi-sample anti-aliasing technology, each pixel on the image contains a center sampling point located at the center position. If the center sampling point of a pixel is covered by a triangle, it is determined that the pixel is covered by the triangle, i.e., it is determined that the pixel is located in the rendering region. When using the multi-sample anti-aliasing technology, the multi-sample anti-aliasing technology uses multiple sampling points (for example, 2, 4, 8) for each pixel to determine the coverage of the triangle, instead of using only the center sampling point to determine. At this time, compared with the image without using the multi-sample anti-aliasing technology, the pixels on the edge of the image using the multi-sample anti-aliasing technology will be determined to fall into the rendering region, and the edge of the whole image will be more smooth.

[0048] In addition, when rendering the image, the multi-sample anti-aliasing technology calculates the pixel values of the multiple sampling points in each pixel on the image, and finally obtains the pixel value of the pixel based on the weighted average of the pixel values of the multiple sampling points. In this way, the edges on the image can be smoothed, and high-quality anti-aliasing effect can be provided.

[0049] Edge mask: used to indicate that each pixel on the first image block belongs to an edge type or a non-edge type. For example, the edge mask includes n second bits, the n second bits correspond to n pixels on the first image block one by one, and the second bit with a value of 0 is used to indicate that the corresponding pixel is a non-edge type pixel, and the second bit with a value of 1 is used to indicate that the corresponding pixel is an edge type pixel.

[0050] For the first image block using the multi-sample anti-aliasing sampling technology, in some actual scenarios, when performing the image compression, the pixel values of the multiple sampling points in the pixel region of each pixel on the first image block need to be recorded.

[0051] As Figure 2 shown, Figure 2 A first image block 200 with a size of 4*4 is shown, the first image block 200 includes 16 pixels, and each pixel includes 2 sampling points in the pixel area. When all the sampling points in the pixel area of a pixel are not covered by the triangle, the value of the corresponding second bit of the pixel in the edge mask 201 is 0; when only part of the sampling points in the pixel area of a pixel are covered by the triangle, the value of the corresponding second bit of the pixel in the edge mask 201 is 1, indicating that all the sampling points in the pixel area of the pixel are not using the same pixel value; when all the sampling points in the pixel area of a pixel are covered by the triangle, and the pixel value of each sampling point is the same, the value of the corresponding second bit of the pixel in the edge mask 201 is 0.

[0052] In another Figure 2 case not shown, when all the sampling points in the pixel area of a pixel are covered by the triangle, and all the sampling points are not using the same pixel value, the value of the corresponding second bit of the pixel in the edge mask is 1.

[0053] Next, the image compression method adopted by the related technology is introduced.

[0054] In the related technology, the method of wavelet transform is usually used to convert the image data to the frequency domain, and then the result of the frequency domain conversion is encoded by the method of entropy encoding, so as to achieve the purpose of compressing the image data. As Figure 3 shown, when the image frame 300 is subjected to image compression, an image block 301 with a size of 4*4 is selected from the image frame 300, and the unit is pixel. By performing wavelet transform on the image block 301, a 4*4 matrix 302 in the frequency domain is obtained. Taking one of the 2*2 sub-matrices 303 as an example, the matrix elements in the 2*2 sub-matrix 303 are 00000111, 00000101, 00000110, and 00000100, respectively. The 2*2 image block corresponding to the 2*2 sub-matrix 303 is obtained by entropy encoding. When entropy encoding, the number of 0s from the first bit and the remaining values are stored. For the above four matrix elements, the number of 0s from the first bit is represented by “101” as 5, and the remaining values of the four matrix elements are recorded by “111”, “101”, “110”, and “100”, respectively. The compression data 304 obtained by the above image compression method contains 15 bits in total, while the 2*2 image block before compression contains 32 bits in total, and obvious compression effect is achieved. When image decompression is performed, only entropy decoding and inverse wavelet transform need to be performed on the compression data 304.

[0055] However, the wavelet transform and the way of entropy coding used by the related art are designed based on the assumption that images are mostly low-frequency signals, and the coding mode of recording the number of first 0 is more suitable for low-frequency signals. For some scenes with more high-frequency signals, the related art cannot achieve a good compression rate.

[0056] Figure 4 A schematic diagram of an image compression system provided by an example embodiment of the present application is shown. The image compression system includes a processor 400 and a graphics memory 401. Optionally, the processor 400 is a graphics processing unit (GPU). Optionally, the graphics memory 401 is a graphic double data rate memory (GDDR). The processor 400 includes a rendering unit 402 and a video coding unit 403. The rendering unit 402 needs to output a render target to the graphics memory 401, and the video coding unit 403 needs to output a video bitstream to the graphics memory 401.

[0057] In order to reduce the interaction bandwidth between the rendering unit 402, the video coding unit 403 and the graphics memory 401, there is also an image compression unit 4021 in the rendering unit 402, and there is also an image compression unit 4031 in the video coding unit 403, both of which are used to perform image compression operations. The image compression unit 4021 in the rendering unit 402 and the image compression unit 403 in the video coding unit 403 can be used to perform the image compression method provided by the present application.

[0058] In the image compression method provided by the present application, the image compression unit obtains a clear screen mask and a clear screen value of a first image block. The clear screen mask is used to indicate a first pixel and a second pixel on the first image block. The first pixel is a pixel on the first image block that has been rendered, and the second pixel is a pixel on the first image block that has not been rendered. The clear screen value is a default pixel value of the second pixel. The image compression unit also obtains color data of each first pixel on the first image block. The color data of the first pixel is related to the color of the first pixel and is used to directly or indirectly represent the pixel value of the first pixel. The image compression unit stores the clear screen mask, the clear screen value and the color data of each first pixel as compressed data of the first image block.

[0059] In an embodiment, the first image block is any one of the rendered images, that is, the image compression method provided by the present application is used for any one of the rendered images.

[0060] In one embodiment, image rendering is performed by a shader on the processor to obtain a first image block. The shader does not need to render all pixels on the first image block during rendering; the first pixel is the pixel on the first image block that has been rendered by the shader, and the second pixel is the pixel on the first image block that has not been rendered by the shader.

[0061] In one embodiment, the image compression unit concatenates a clearing mask, a clearing value, and the color data of each first pixel in a preset order to obtain a concatenated result; the concatenated result is stored as compressed data of the first image block. Optionally, the image compression unit concatenates the clearing mask, the clearing value, and the color data of each first pixel based on the premise that "the clearing mask is located before the color data of each first pixel." In this case, when performing image decompression, the image decompression unit can read the color data of each first pixel according to the number of first pixels indicated by the clearing mask.

[0062] For example, the preset order is "clear screen mask - clear screen value - color data of each first pixel"; or the preset order is "clear screen mask - color data of each first pixel - clear screen value".

[0063] like Figure 4 As shown, the image compression unit acquires the clearing mask 41, clearing value 42, color data 43 of pixel P0, and color data 44 of pixel P16 of the first image block 40. Figure 4 The first image block 40 has a size of 8*8 and includes 64 pixels. Pixels P0 and P16 in the first image block 40 are rendered pixels, while the remaining pixels are unrendered pixels. Therefore, the clear mask 41 identifies pixels P0 and P16 using NC (Not Clear), and the clear value 42 is the same pixel value used by the remaining pixels. The image compression unit stores the clear mask 41, the clear value 42, the color data 43 of pixel P0, and the color data 44 of pixel P16 as compressed data 45 of the first image block.

[0064] In one embodiment, the image compression unit concatenates the clearing mask 41, clearing value 42, color data 43 of pixel P0, and color data 44 of pixel P16 in a preset order to obtain a concatenated result; the concatenated result is stored as compressed data 45 of the first image block. Optionally, the preset order is "clearing mask 41 — clearing value 42 — color data 43 of pixel P0 — color data 44 of pixel P16".

[0065] When there are only a few pixels as the rendered pixels (first pixels) on the first image block, the more un-rendered pixels (second pixels) on the first image block are represented by a clear mask and a clear value, and the color data of the few rendered pixels is recorded completely, so that the first image block can achieve a better compression effect when there are only a few pixels as the rendered pixels. Moreover, the clear mask generated in the rendering process can be reserved.

[0066] Next, two image compression implementations will be introduced.

[0067] First, an image compression method for a first image block not using a multi-sampling anti-aliasing technique;

[0068] An image compression unit acquires a clear mask and a clear value of the first image block, the clear mask being used to indicate the first pixels and the second pixels on the first image block, the first pixels being the rendered pixels on the first image block, the second pixels being the un-rendered pixels on the first image block, and the clear value being the default pixel value of the second pixels. The image compression unit acquires the pixel value of each first pixel on the first image block when the first image block does not use the multi-sampling anti-aliasing technique. The image compression unit stores the clear mask, the clear value, and the pixel value of each first pixel as the compressed data of the first image block.

[0069] In one embodiment, the image compression unit acquires the pixel value of each first pixel on the first image block.

[0070] In one embodiment, the first image block is any one of the rendered images, that is, the image compression method provided in this embodiment is used for any one of the rendered images.

[0071] In one embodiment, the image compression unit performs compression on a compression target of a fixed size. Assuming that the size of the compression target is 256 bytes, for a first image block (8*8 in size) not using the multi-sampling anti-aliasing technique, the compression target includes the pixel value of each pixel on the first image block; for a first image block (8*4 in size) using the two-sampling anti-aliasing technique, the compression target includes the pixel value of two sampling points in the pixel area of each pixel on the first image block, and the pixel value is represented by 32 bits.

[0072] In one embodiment, the image rendering is performed by a shader on a processor to obtain the first image block. The shader does not need to render all the pixels on the first image block when rendering, the first pixels being the pixels on the first image block that have been rendered by the shader, and the second pixels being the pixels on the first image block that have not been rendered by the shader.

[0073] In one embodiment, the image compression unit concatenates the clear screen mask, the clear screen value and the pixel value of each first pixel in a preset order to obtain a concatenation result; and stores the concatenation result as the compressed data of the first image block. Optionally, the image compression unit concatenates the clear screen mask, the clear screen value and the pixel value of each first pixel on the premise that the clear screen mask is located before the pixel value of each first pixel, and in this case, when performing image decompression, the image decompression unit can determine the number of first pixels according to the clear screen mask and then read the pixel value of each first pixel.

[0074] For example, the preset order is "clear screen mask-clear screen value-pixel value of each first pixel"; for another example, the preset order is "clear screen mask-pixel value of each first pixel-clear screen value".

[0075] Optionally, the image compression unit is the image compression unit 4021 or the image compression unit 4031 in the image compression unit 4001 shown in

[0076] As shown in Figure 5 , the clear screen mask 501, the clear screen value 502, the pixel value 503 of the pixel P0 and the pixel value 504 of the pixel P16 of the first image block 500 are obtained. Figure 5 The size of the first image block 500 in the image compression unit 4001 shown in is 8*8, in units of pixels, the first image block 500 includes 64 pixels, the pixel P0 and the pixel P16 in the first image block 500 are rendered pixels, and the remaining pixels are unrendered pixels, so the pixel P0 and the pixel P16 are identified by NC (Not Clear) in the clear screen mask 501, and the clear screen value 502 is the same pixel value adopted by the remaining pixels. The clear screen mask 501, the clear screen value 502, the pixel value 503 of the pixel P0 and the pixel value 504 of the pixel P16 are stored as the compressed data 505 of the first image block.

[0077] In one embodiment, the image compression unit concatenates the clear screen mask 501, the clear screen value 502, the pixel value 503 of the pixel P0 and the pixel value 504 of the pixel P16 in a preset order to obtain a concatenation result, and stores the concatenation result as the compressed data of the first image block 500. Optionally, the preset order is "clear screen mask 501-clear screen value 502-pixel value 503 of the pixel P0-pixel value 504 of the pixel P16".

[0078] Figure 5 For example, the pixel value of each pixel in the first image block 500 is represented by 32 bits, so if no image compression is performed, the first image block 500 needs to be represented by 64*32==2048 bits, i.e. 256 bytes; if the image compression unit 4001 shown in Figure 5The image compression method shown, and the clear screen mask includes 64 first bits, and the 64 first bits correspond to the 64 pixels on the first image block 500 one by one, so the first image block 500 needs to be represented by 160 bits, that is, 20 bytes. It can be seen that, by using the image compression method shown Figure 5 The image compression method shown can achieve better image compression effect compared with 256 bytes required without image compression.

[0079] In addition, by the scheme provided in the above embodiment, when there are only a few pixels as rendered pixels (first pixels) on the first image block, the more unrendered pixels (second pixels) on the first image block will be represented by the clear screen mask and the clear screen value, and the pixel values of the fewer rendered pixels will be recorded completely, so that the first image block can achieve better compression effect when there are only a few pixels as rendered pixels, and there are more high-frequency signals on the first image block. Moreover, by the scheme provided in the above embodiment, the clear screen mask generated in the rendering process can be preserved.

[0080] Second, the image compression method for the first image block using the multi-sampling anti-aliasing technology;

[0081] For the case that the first pixels include first pixels belonging to the edge type, the first pixels of the edge type refer to the first pixels whose pixel values of the multiple sampling points in the pixel region are different. The pixel region refers to the region occupied by a pixel on the first image block in the present application.

[0082] The image compression unit obtains the clear screen mask, the edge mask, and the clear screen value of the first image block, the clear screen mask is used to indicate the first pixels and the second pixels on the first image block, the first pixels are the pixels rendered on the first image block, the second pixels are the pixels unrendered on the first image block, the edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type, and the clear screen value is the default pixel value of the second pixels. In the case that the multi-sampling anti-aliasing technology is used for the first image block, the image compression unit obtains the first data for each first pixel of the edge type on the first image block, the first data includes the pixel values of the multiple sampling points in the pixel region of the first pixel of the edge type. The image compression unit stores the compression data of the first image block based on the clear screen mask, the edge mask, the clear screen value, and the first data. The image compression unit stores the clear screen mask, the edge mask, the clear screen value, and the first data (the pixel values of the multiple sampling points in the pixel region of each first pixel of the edge type on the first image block) as the compression data of the first image block.

[0083] In one embodiment, the image compression unit obtains the pixel values of the multiple sampling points in the pixel region of the first pixel of the edge type for each first pixel of the edge type on the first image block.

[0084] In one embodiment, the first image block is any one of the rendered images, i.e., the image compression method provided in this embodiment is used for any one of the rendered images.

[0085] In one embodiment, the image compression unit compresses a compression target of a fixed size. Assuming that the compression target size is 256 bytes, for the first image block (8*8 in size) without using the multi-sampling anti-aliasing technique, the compression target includes the pixel values of each pixel on the first image block; for the first image block (8*4 in size) using the two-sampling anti-aliasing technique, the compression target includes the pixel values of two sampling points in the pixel area of each pixel on the first image block, and the pixel values are represented by 32 bits.

[0086] In one embodiment, the image rendering is performed by a shader on a processor to obtain the first image block. The shader does not need to render all the pixels on the first image block when rendering, the first pixel is a pixel on the first image block that has been rendered by the shader, and the second pixel is a pixel on the first image block that has not been rendered by the shader.

[0087] In one embodiment, the image compression unit concatenates the clear screen mask, the edge mask, the clear screen value, and the first data in a preset order to obtain a concatenation result; and stores the concatenation result as the compressed data of the first image block.

[0088] Optionally, the image compression unit concatenates the clear screen mask, the edge mask, the clear screen value, and the first data on the premise of satisfying a first condition, and the first condition includes that the clear screen mask is located before the edge mask, and the edge mask is located before the first data. At this time, during image decompression, the image decompression unit can determine the first pixel according to the clear screen mask, and then determine the first pixel belonging to the edge type according to the edge mask, and then read the pixel values of the plurality of sampling points in the pixel area of each first pixel of the edge type from the first data.

[0089] For example, the preset order is "clear screen mask - edge mask - clear screen value - first data"; for another example, the preset order is "clear screen mask - edge mask - first data - clear screen value".

[0090] Optionally, the image compression unit is the image compression unit 4021 or the image compression unit 4031 in the image compression unit 4020 or the image compression unit 4030. Figure 4

[0091] As shown in FIG. 4A, the image compression unit 4021 is configured to perform the image compression method provided in this embodiment. Figure 6 Figure 6 ​​The size of the first image block 600 is 8*4, in pixels, and each pixel includes two sample points in the pixel area, for example, pixel P0 includes sample point P0S0 and sample point P0S1, pixel P1 includes sample point P1S0 and sample point P1S1, and so on.

[0092] As shown in FIG. 1, the image compression unit obtains the clear mask 601, the edge mask 602, the clear value 603, the pixel value 604 of sample point P0S0, the pixel value 605 of sample point P0S1, the pixel value 606 of sample point P16S0, and the pixel value 607 of sample point P16S1 of the first image block 600. Figure 6 As shown in FIG. 1, the image compression unit obtains the clear mask 601, the edge mask 602, the clear value 603, the pixel value 604 of sample point P0S0, the pixel value 605 of sample point P0S1, the pixel value 606 of sample point P16S0, and the pixel value 607 of sample point P16S1 of the first image block 600. Figure 6 In the first image block 600, pixel P0 and pixel P16 are rendered pixels, and the remaining pixels are unrendered pixels, so pixel P0 and pixel P16 are marked by NC (Not Clear) in the clear mask 601, and the clear value 603 is the same pixel value for the remaining pixels. In addition, pixel P0 and pixel P16 are edge type pixels in the first image block 600, so pixel P0 and pixel P16 are marked by OE (On Edge) in the edge mask 602. The image compression unit stores the clear mask 601, the edge mask 602, the clear value 603, the pixel value 604 of sample point P0S0, the pixel value 605 of sample point P0S1, the pixel value 606 of sample point P16S0, and the pixel value 607 of sample point P16S1 as the compressed data 608 of the first image block.

[0093] In one embodiment, the image compression unit concatenates the clear mask 601, the edge mask 602, the clear value 603, the pixel value 604 of sample point P0S0, the pixel value 605 of sample point P0S1, the pixel value 606 of sample point P16S0, and the pixel value 607 of sample point P16S1 in a preset order to obtain a concatenation result, and stores the concatenation result as the compressed data 608 of the first image block. Optionally, the preset order is "clear mask 601—edge mask 602—clear value 603—pixel value 604 of sample point P0S0—pixel value 605 of sample point P0S1—pixel value 606 of sample point P16S0—pixel value 607 of sample point P16S1".

[0094] Suppose that the pixel value of each sample point on the first image block 600 is represented by 32 bits, then if no image compression is performed, the first image block 600 needs to be represented by 32*2*32==2048 bits, i.e., 256 bytes; if the image compression unit performs image compression, the first image block 600 needs to be represented by 32+32+32+32+32+32+32==256 bits, i.e., 32 bytes. Figure 6The image compression method is shown, and the screen clearing mask 601 includes 32 first bits, the 32 first bits correspond to the 32 pixels on the first image block 600 one by one, the edge mask 602 includes 32 second bits, the 32 second bits correspond to the 32 pixels on the first image block 600 one by one, and then the first image block 600 needs to be represented by 28 bytes. It can be seen that, compared with 256 bytes required by not performing image compression, the image compression method can achieve better image compression effect. Figure 6 The image compression method is shown, and the screen clearing mask 601 includes 32 first bits, the 32 first bits correspond to the 32 pixels on the first image block 600 one by one, the edge mask 602 includes 32 second bits, the 32 second bits correspond to the 32 pixels on the first image block 600 one by one, and then the first image block 600 needs to be represented by 28 bytes. It can be seen that, compared with 256 bytes required by not performing image compression, the image compression method can achieve better image compression effect.

[0095] Through the scheme provided in the above embodiment, in addition to being able to achieve better compression effect in the high-frequency scene where the rendered pixels are few, better compression effect can also be achieved in the scene where the rendered pixels include a few pixels of the edge type. At this time, the pixels not rendered will be represented by the screen clearing mask and the screen clearing value, and the pixel values of the multiple sampling points in the pixel region of the few pixels of the edge type will be recorded completely. That is, the scheme provided in the above embodiment can achieve better compression effect for the high-frequency scene where the pixels belonging to the edge type are few. Moreover, through the scheme provided in the above embodiment, the screen clearing mask and the edge mask generated in the rendering process can be preserved.

[0096] For the case that the first pixel includes the first pixel belonging to the non-edge type, the first pixel of the non-edge type refers to the first pixel whose pixel values of the multiple sampling points on the pixel region are the same. The pixel region refers to the region occupied by a pixel on the first image block in the present application.

[0097] The image compression unit acquires the screen clearing mask, the edge mask and the screen clearing value of the first image block. The screen clearing mask is used to indicate the first pixel and the second pixel on the first image block. The first pixel is the pixel rendered on the first image block, and the second pixel is the pixel not rendered on the first image block. The edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type. The screen clearing value is the default pixel value of the second pixel. In the case that the multi-sampling anti-aliasing technology is used for the first image block, the image compression unit acquires the second data for each first pixel of the non-edge type on the first image block. The second data includes the pixel value of any one of the multiple sampling points in the pixel region of the first pixel of the non-edge type.

[0098] The image compression unit stores the compressed data of the first image block based on the screen clearing mask, the edge mask, the screen clearing value and the second data. The image compression unit stores the screen clearing mask, the edge mask, the screen clearing value and the second data (the pixel value of any one of the multiple sampling points in the pixel region of each first pixel of the non-edge type on the first image block) as the compressed data of the first image block.

[0099] In one embodiment, the image compression unit, for each non-edge type first pixel on the first image block, obtains the pixel value of any one of a plurality of sampling points in the pixel region of the non-edge type first pixel.

[0100] In one embodiment, the first image block is any image block in the rendered image; that is, the image compression method provided in this embodiment is used for any image block in the rendered image.

[0101] In one embodiment, the image compression unit compresses a fixed-size compression target. Assuming the compression target size is 256 bytes, for a first image block (8*8) without multisampling anti-aliasing, the compression target includes the pixel value of each pixel in the first image block; for a first image block (8*4) using doublesampling anti-aliasing, the compression target includes the pixel values ​​of two sampling points in the pixel region of each pixel in the first image block, with the pixel values ​​represented using 32 bits.

[0102] In one embodiment, image rendering is performed by a shader on the processor to obtain a first image block. The shader does not need to render all pixels on the first image block during rendering; the first pixel is the pixel on the first image block that has been rendered by the shader, and the second pixel is the pixel on the first image block that has not been rendered by the shader.

[0103] In one embodiment, the image compression unit concatenates a clearing mask, an edge mask, clearing values, and second data in a preset order to obtain a concatenated result; and stores the concatenated result as compressed data of a first image block.

[0104] Optionally, the image compression unit, under the premise of satisfying the second condition, cascades the clearing mask, edge mask, clearing value, and second data. The second condition includes "the clearing mask is located before the edge mask, and the edge mask is located before the second data". In this case, during image decompression, the image decompression unit can determine the first pixel based on the clearing mask, then determine the first pixel belonging to the non-edge type based on the edge mask, and then read the pixel value of any one of the multiple sampling points in the pixel region of each non-edge type first pixel from the second data.

[0105] For example, the preset order is "screen clear mask - edge mask - screen clear value - second data"; or the preset order is "screen clear mask - edge mask - second data - screen clear value".

[0106] Optionally, the image compression unit is Figure 4 Image compression unit 4021 or image compression unit 4031 in the image compression unit.

[0107] like Figure 7 As shown,Figure 7 The first image block 700 shown has a size of 8*4 pixels. Each pixel's pixel region includes two sampling points. For example, pixel P0 includes sampling point P0S0 and sampling point P0S1, pixel P1 includes sampling point P1S0 and sampling point P1S1, and so on.

[0108] like Figure 7 As shown, the clearing mask 701, edge mask 702, clearing value 703, [sampling point P0S0 pixel value 704 or sampling point P0S1 pixel value 705], and [sampling point P16S0 pixel value 706 or sampling point P16S1 pixel value 707] of the first image block 700 are obtained. Figure 7 In the first image block 700, pixels P0 and P16 are rendered pixels, while the remaining pixels are unrendered. Therefore, the clear mask 701 identifies pixels P0 and P16 using NC (Not Clear), and the clear value 703 uses the same pixel value for the remaining pixels. Furthermore, pixels P0 and P16 in the first image block 700 are non-edge type pixels, so the edge mask 702 does not identify pixels P0 and P16 using OE (On Edge). Since pixel P0 is a non-edge type, the pixel value 704 of sampling point P0S0 and the pixel value 705 of sampling point P0S1 are the same. Therefore, either the pixel value 704 of sampling point P0S0 or the pixel value 705 of sampling point P0S1 is used as the pixel value of P0. Similarly, the image compression unit uses the pixel value 706 of sampling point P16S0 or the pixel value 707 of sampling point P16S1 as the pixel value of P16; the image compression unit stores the clearing mask 701, the edge mask 702, the clearing value 703, the pixel value of P0 and the pixel value of P16 as the compressed data 708 of the first image block.

[0109] In one embodiment, the image compression unit concatenates the clearing mask 701, edge mask 702, clearing value 703, P0 pixel value, and P16 pixel value in a preset order to obtain a concatenated result, and stores the concatenated result as compressed data 708 of the first image block. Optionally, the preset order is "clearing mask 701 — edge mask 702 — clearing value 703 — P0 pixel value — P16 pixel value".

[0110] Assuming that the pixel value of each sampling point in the first image block 700 is represented using 32 bits, then without image compression, the first image block 700 requires 64 * 32 = 2048 bits, or 256 bytes, to represent its value; if using... Figure 7The image compression method is shown, and the clear screen mask 701 includes 32 first bits, the 32 first bits correspond to the 32 pixels on the first image block 700 one by one, the edge mask 702 includes 32 second bits, the 32 second bits correspond to the 32 pixels on the first image block 700 one by one, and the first image block 700 needs to be represented by 20 bytes. It can be seen that, compared with 256 bytes required without image compression, the image compression method can achieve better image compression effect. Figure 7 The image compression method is shown, and the clear screen mask 701 includes 32 first bits, the 32 first bits correspond to the 32 pixels on the first image block 700 one by one, the edge mask 702 includes 32 second bits, the 32 second bits correspond to the 32 pixels on the first image block 700 one by one, and the first image block 700 needs to be represented by 20 bytes. It can be seen that, compared with 256 bytes required without image compression, the image compression method can achieve better image compression effect.

[0111] The scheme provided by the above embodiment can achieve better compression effect in the high-frequency scene of fewer rendered pixels, and can also achieve better compression effect in the scene where the rendered pixels include pixels belonging to the non-edge type. At this time, the unrendered pixels are represented by the clear screen mask and the clear screen value, and the pixels belonging to the non-edge type only need to retain the pixel value of one sampling point in the pixel region. Moreover, the scheme provided by the above embodiment can retain the clear screen mask and the edge mask generated in the rendering process.

[0112] For the case that the first pixel includes the first pixel belonging to the edge type and the first pixel belonging to the non-edge type, the pixel of the edge type refers to the pixel whose pixel values of the multiple sampling points in the pixel region are inconsistent, and the pixel of the non-edge type refers to the pixel whose pixel values of the multiple sampling points in the pixel region are consistent. The pixel region refers to the region occupied by a pixel on the first image block in the present application.

[0113] The image compression unit obtains the clear screen mask, the edge mask and the clear screen value of the first image block. The clear screen mask is used to indicate the first pixel and the second pixel on the first image block. The first pixel is the pixel rendered on the first image block, and the second pixel is the pixel unrendered on the first image block. The edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type. The clear screen value is the default pixel value of the second pixel. In the case that the multiple sampling anti-aliasing technology is used on the first image block, the image compression unit obtains the first data for each edge type first pixel and each non-edge type first pixel on the first image block. The first data includes the pixel values of the multiple sampling points in the pixel region of the edge type first pixel. The image compression unit also obtains the second data. The second data includes the pixel value of any one sampling point in the multiple sampling points in the pixel region of the non-edge type first pixel.

[0114] The image compression unit stores the compressed data of the first image block based on the clear mask, the edge mask, the clear value, the first data and the second data. The image compression unit obtains the clear mask, the edge mask, the clear value, the first data (the pixel value of each sampling point in the pixel region of each first pixel of each edge type on the first image block) and the second data (the pixel value of any one sampling point in the plurality of sampling points in the pixel region of each first pixel of each non-edge type on the first image block), and stores the obtained data as the compressed data of the first image block.

[0115] In one embodiment, the image compression unit obtains the pixel value of each sampling point in the pixel region of the first pixel of the edge type and the pixel value of any one sampling point in the plurality of sampling points in the pixel region of the first pixel of the non-edge type for each first pixel of each edge type and each first pixel of each non-edge type on the first image block.

[0116] In one embodiment, the first image block is any one image block in the rendered image, that is, the image compression method provided in the embodiment is used for any one image block in the rendered image.

[0117] In one embodiment, the image compression unit performs compression on a compression target of a fixed size. Assuming that the size of the compression target is 256 bytes, the compression target includes the pixel value of each pixel on the first image block for the first image block (8*8 in size) without using the multi-sampling anti-aliasing technology, and the compression target includes the pixel value of two sampling points in the pixel region of each pixel on the first image block (8*4 in size) using the two-sampling anti-aliasing technology, and the pixel value is represented by 32 bits.

[0118] In one embodiment, the image rendering is performed by a shader on the processor to obtain the first image block. The shader does not need to render all the pixels on the first image block during the rendering, the first pixel is a pixel on the first image block that has been rendered by the shader, and the second pixel is a pixel on the first image block that has not been rendered by the shader.

[0119] In one embodiment, the image compression unit concatenates the clear mask, the edge mask, the clear value, the first data and the second data in a preset order to obtain a concatenation result, and stores the concatenation result as the compressed data of the first image block.

[0120] Optionally, the image compression unit concatenates the clear screen mask, the edge mask, the clear screen value and the first data on the premise of satisfying a third condition, the third condition including "the clear screen mask is located before the edge mask, and the edge mask is located before the first data and the second data", and in this case, when the image is decompressed, the image decompression unit can determine the first pixel according to the clear screen mask, determine the first pixel belonging to the edge type and the first pixel belonging to the non-edge type according to the edge mask, read the pixel value of each sampling point in the pixel region of each non-edge type first pixel from the first data, and read the pixel value of any one sampling point in the pixel region of each non-edge type first pixel from the second data.

[0121] For example, the preset order is "clear screen mask - edge mask - clear screen value - first data - second data"; for another example, the preset order is "clear screen mask - edge mask - first data - second data - clear screen value"; for still another example, the preset order is "clear screen mask - edge mask - clear screen value - second data - first data".

[0122] Optionally, the image compression unit is the image compression unit 4021 or the image compression unit 4031 in the image compression unit 4001. Figure 4

[0123] As shown in Figure 8 , Figure 8 The size of the first image block 800 shown in the figure is 8*4, and the unit is pixel. Each pixel includes two sampling points in the pixel region. For example, the pixel P0 includes the sampling point P0S0 and the sampling point P0S1, the pixel P1 includes the sampling point P1S0 and the sampling point P1S1, and so on.

[0124] The image compression unit acquires the clear screen mask 801, the edge mask 802, the clear screen value 803, the sampling point P0S0 pixel value 804, the sampling point P0S1 pixel value 805, the

sampling point P16S0 pixel value 806 or the sampling point P16S1 pixel value 807

[0125] The image compression unit stores the clear mask 801, the edge mask 802, the clear value 803, the P0S0 pixel value 804, the P0S1 pixel value 805, and the pixel value of P16 as the compressed data 808 of the first image block.

[0126] In one embodiment, the image compression unit concatenates the clear mask 801, the edge mask 802, the clear value 803, the P0S0 pixel value 804, the P0S1 pixel value 805, and the pixel value of P16 in a preset order to obtain a concatenation result; and stores the concatenation result as the compressed data 808 of the first image block. Optionally, the preset order is "clear mask 801 - edge mask 802 - clear value 803 - P0S0 pixel value 804 - P0S1 pixel value 805 - pixel value of P16".

[0127] Suppose that the pixel value of each sampling point on the first image block 800 is represented by 32 bits, then if no image compression is performed, the first image block 800 needs to be represented by 64*32==2048 bits, i.e. 256 bytes; if the image compression method shown in the figure is adopted, and the clear mask 801 includes 32 first bits, the 32 first bits correspond to the 32 pixels on the first image block 800 one by one, the edge mask 802 includes 32 second bits, and the 32 second bits correspond to the 32 pixels on the first image block 800 one by one, then the first image block 800 needs to be represented by 24 bytes. As can be seen, compared with the 256 bytes required if no image compression is performed, the image compression method shown in the figure can achieve better image compression effect. Figure 8 Figure 8

[0128] ​​In addition to achieving good compression effect in the high-frequency scene with few rendered pixels, the scheme provided by the above embodiment can also achieve good compression effect in a scene where the rendered pixels include a few pixels belonging to the edge type and some pixels belonging to the non-edge type. In this case, the pixel values of the multiple sampling points in the pixel region of the few pixels belonging to the edge type are completely recorded, and only the pixel value of any one sampling point in the pixel region of the some pixels belonging to the non-edge type needs to be retained. That is, the scheme provided by the above embodiment can achieve good compression effect for the high-frequency scene with few pixels belonging to the edge type. In addition, the scheme provided by the above embodiment can retain the clear screen mask and the edge mask generated in the rendering process.

[0129] Next, the related content of the image decompression side is introduced.

[0130] Figure 9 A schematic diagram of an image decompression system provided by an example embodiment of the present application is shown. The image decompression system includes a processor 900, a graphics memory 901, and a display 902. Optionally, the processor 900 is a graphics processing unit (GPU), and optionally, the graphics memory 901 is a graphics double data rate memory. The processor 900 includes a rendering unit 903, a video decoding unit 904, and a display unit 905. The rendering unit 903 needs to read a large amount of texture information from the graphics memory 901, and the video decoding unit 904 needs to read a large amount of video bitstream from the graphics memory 901. The display unit 905, which performs a display function, also needs to read a large amount of image data from the graphics memory 901, and the display unit 905 sends the read image data to the display 902.

[0131] In order to reduce the interaction bandwidth between the rendering unit 903, the video decoding unit 904, the display unit 905, and the graphics memory 901, there is an image decompression unit 9031 in the rendering unit 903, an image decompression unit 9041 in the video decoding unit 904, and an image decompression unit 9051 in the display unit 905, and all of these three image decompression units are used to perform image decompression operations. The image decompression unit 9031 in the rendering unit 903, the image decompression unit 9041 in the video decoding unit 904, and the image decompression unit 9051 in the display unit 905 can all be used to perform the image decompression method provided by the present application.

[0132] In the image decompression method provided in this application, the image decompression unit obtains a clearing mask and a clearing value from the compressed data of the first image block. The clearing mask is used to indicate the first pixel and the second pixel on the first image block. The first pixel is a rendered pixel on the first image block, and the second pixel is an unrendered pixel on the first image block. The clearing value is the default pixel value of the second pixel. The image decompression unit also obtains the color data of the first pixel. The color data of the first pixel refers to the data related to the color of the first pixel and is used to directly or indirectly represent the pixel value of the first pixel. The image decompression unit also reconstructs the first image block based on the clearing mask, the clearing value, and the color data of each first pixel.

[0133] In one embodiment, the image decompression unit obtains the clearing mask, clearing value, and color data of each first pixel from the compressed data of the first image block in a preset order.

[0134] Optionally, the image decompression unit reads the clearing mask, clearing value, and color data of each first pixel, provided that "the clearing mask is read before the color data of each first pixel is read." In this case, the image decompression unit can read the color data of each first pixel according to the first pixel indicated by the clearing mask. For example, the preset order is "clearing mask - clearing value - color data of each first pixel"; or, for example, the preset order is "clearing mask - color data of each first pixel - clearing value."

[0135] In one embodiment, the first image block is any image block in the rendered image; that is, the image decompression method provided in this application is used for any image block in the rendered image.

[0136] In one embodiment, the first pixel is a pixel on the first image block that needs to be rendered by the shader, and the second pixel is a pixel on the first image block that does not need to be rendered by the shader.

[0137] like Figure 9 As shown, the image decompression unit obtains a clear mask 91, a clear value 92, color data 93 of pixel P0, and color data 94 of pixel P16 from the compressed data 90 of the first image block. The clear mask 91 identifies pixels P0 and P16 with NC (Not Clear), indicating that pixels P0 and P16 are rendered pixels, while the remaining pixels are unrendered pixels. The clear value 92 is the same pixel value used by the remaining pixels. Based on the clear mask 91, clear value 92, color data 93 of pixel P0, and color data 94 of pixel P16, the image decompression unit reconstructs the first image block 95.

[0138] In one embodiment, the image decompression unit reads out the clear screen mask 91, the clear screen value 92, the color data 93 of the pixel P0, and the color data 94 of the pixel P16 in the order of "the clear screen mask 91-the clear screen value 92-the color data 93 of the pixel P0-the color data 94 of the pixel P16".

[0139] By the image decompression method provided in the present application, only the clear screen mask, the clear screen value, and the color data of each first pixel are needed to restore the first image block, the data required during image decompression is less, and thus the speed of image decompression is faster. Moreover, the image decompression method provided in the present application can also obtain the clear screen mask.

[0140] Next, two image decompression embodiments will be introduced.

[0141] First, the image decompression method for the first image block not using the multi-sampling anti-aliasing technology;

[0142] The image decompression unit obtains the clear screen mask and the clear screen value from the compressed data of the first image block, the clear screen mask is used to indicate the first pixel and the second pixel on the first image block, the first pixel is the pixel rendered on the first image block, the second pixel is the pixel not rendered on the first image block, and the clear screen value is the default pixel value of the second pixel. The image decompression unit obtains the pixel value of each first pixel on the first image block in the case that the first image block does not use the multi-sampling anti-aliasing technology; and restores the first image block based on the clear screen mask, the clear screen value, and the pixel value of each first pixel.

[0143] In one embodiment, the image decompression unit obtains the pixel value of each first pixel on the first image block.

[0144] In one embodiment, the first image block is any one of the rendered images, that is, the image decompression method provided in the present embodiment is used for any one of the rendered images.

[0145] In one embodiment, the first pixel is the pixel that needs to be rendered by the shader on the first image block, and the second pixel is the pixel that does not need to be rendered by the shader on the first image block.

[0146] In one embodiment, the image decompression unit reads out the clear screen mask, the clear screen value, and the pixel value of each first pixel from the compressed data of the first image block in a preset order.

[0147] Optionally, the image decompression unit reads the clearing mask, the clearing value, and the pixel value of each first pixel, provided that "the clearing mask is read before the pixel value of each first pixel is read." In this case, the image decompression unit can read the pixel value of each first pixel according to the first pixel indicated by the clearing mask. For example, the preset order is "clearing mask - clearing value - pixel value of each first pixel"; or, for example, the preset order is "clearing mask - pixel value of each first pixel - clearing value."

[0148] In one embodiment, the image decompression unit may be... Figure 9 Image decompression unit 9031, image decompression unit 9041 or image decompression unit 9051 in the image decompression unit.

[0149] like Figure 10 As shown, the image decompression unit obtains a clearing mask 1001, a clearing value 1002, a pixel value 1003 for pixel P0, and a pixel value 1004 for pixel P16 from the compressed data 1000 of the first image block. The clearing mask 1001 identifies pixels P0 and P16 as NC (Not Clear), indicating that pixels P0 and P16 are rendered pixels, while the remaining pixels are unrendered pixels. The clearing value 1002 is the same pixel value used by the remaining pixels. Based on the clearing mask 1001, the clearing value 1002, the pixel value 1003 for pixel P0, and the pixel value 1004 for pixel P16, the image decompression unit restores the pixel values ​​of all pixels on the first image block 1005.

[0150] In one embodiment, the image decompression unit reads the above data from the compressed data 1000 of the first image block in the order of "screen clearing mask 1001 - screen clearing value 1002 - pixel value of pixel P0 1003 - pixel value of pixel P16 1004".

[0151] The image decompression method provided in this application only requires a clear screen mask, clear screen values, and the pixel values ​​of each first pixel to reconstruct the first image block. This results in less data required for image decompression, leading to faster decompression speeds. Furthermore, the image decompression method provided in this application can also obtain the clear screen mask.

[0152] Second, an image decompression method for the first image block using multisampling anti-aliasing technology;

[0153] The term "first pixel" refers to a first pixel belonging to an edge type, where the pixel values ​​of multiple sampling points in a pixel region are different. In this application, a pixel region refers to the area occupied by a pixel on a first image block.

[0154] The image decompression unit obtains, from the compressed data of the first image block, a clear mask, an edge mask and a clear value, the clear mask is used to indicate first pixels and second pixels on the first image block, the first pixels are pixels on the first image block that are rendered by a shader, the second pixels are pixels on the first image block that are not rendered by the shader, the edge mask is used to indicate that each pixel on the first image block belongs to an edge type or a non-edge type, and the clear value is a default pixel value of the second pixels; the image decompression unit, in a case where the first image block uses a multi-sampling anti-aliasing technique, obtains, for each first pixel of the edge type on the first image block, first data, the first data including respective pixel values of a plurality of sampling points in a pixel region of the first pixel of the edge type; and the image decompression unit restores the first image block based on the clear mask, the edge mask, the clear value and the first data (respective pixel values of the plurality of sampling points in a pixel region of each first pixel of the non-edge type on the first image block).

[0155] In one embodiment, the image decompression unit obtains, for each first pixel of the edge type on the first image block, respective pixel values of a plurality of sampling points in a pixel region of the first pixel of the edge type.

[0156] In one embodiment, the first image block is any one of the image blocks in the rendered image, that is, the image decompression method provided in this embodiment is used for any one of the image blocks in the rendered image.

[0157] In one embodiment, the first pixels are pixels on the first image block that need to be rendered by a shader, and the second pixels are pixels on the first image block that do not need to be rendered by the shader.

[0158] In one embodiment, the image decompression unit reads the clear mask, the edge mask, the clear value and the first data from the compressed data of the first image block in a preset order.

[0159] Optionally, the image decompression unit reads the clear mask, the edge mask, the clear value and the first data on the premise of satisfying a fourth condition, the fourth condition includes “reading the clear mask before reading the edge mask, and reading the edge mask before reading the first data”, at this time, the image decompression unit can determine the first pixels according to the clear mask, determine the first pixels of the edge type according to the edge mask, and read respective pixel values of a plurality of sampling points in a pixel region of each first pixel of the edge type from the first data.

[0160] For example, the preset order is “clear mask—edge mask—clear value—first data”; for another example, the preset order is “clear mask—edge mask—first data—clear value”.

[0161] In one embodiment, the image decompression unit can beFigure 9 the image decompression unit 9031, the image decompression unit 9041, or the image decompression unit 9051.

[0162] As shown in FIG. 11B, the image decompression unit obtains the clear mask 1101, the edge mask 1102, the clear value 1103, the sample point P0S0 pixel value 1104, the sample point P0S1 pixel value 1105, the sample point P16S0 pixel value 1106, and the sample point P16S1 pixel value 1107 from the compressed data 1100 of the first image block. Figure 11 The clear mask 1101 identifies the pixel P0 and the pixel P16 by NC (Not Clear), indicating that the pixel P0 and the pixel P16 are rendered pixels, and the rest of the pixels are unrendered pixels. The clear value 1103 is the same pixel value adopted by the rest of the pixels. The edge mask 1102 identifies the pixel P0 and the pixel P16 by OE (On Edge), indicating that the pixel P0 and the pixel P16 are edge type pixels.

[0163] The image decompression unit restores the pixel values of all the pixels on the first image block 1108 based on the clear mask 1101, the edge mask 1102, the clear value 1103, the sample point P0S0 pixel value 1104, the sample point P0S1 pixel value 1105, the sample point P16S0 pixel value 1106, and the sample point P16S1 pixel value 1107.

[0164] In one embodiment, the image decompression unit reads the above data from the compressed data 1100 of the first image block in the order of “the clear mask 1101 — the edge mask 1102 — the clear value 1103 — the sample point P0S0 pixel value 1104 — the sample point P0S1 pixel value 1105 — the sample point P16S0 pixel value 1106 — the sample point P16S1 pixel value 1107”.

[0165] By the image decompression method provided in the present application, only the clear mask, the edge mask, the clear value, and the pixel values of the multiple sample points in the pixel region of each non-edge type first pixel on the first image block are needed to restore the first image block, the data required for image decompression is less, and the speed of image decompression is faster. Moreover, the image decompression method provided in the present application can also obtain the clear mask and the edge mask.

[0166] The first pixel includes a non-edge type first pixel, which refers to a first pixel with the same pixel values of multiple sample points on the pixel region.

[0167] The image decompression unit obtains a clear mask, an edge mask and a clear value from the compressed data of the first image block, the clear mask is used to indicate first pixels and second pixels on the first image block, the first pixels are pixels on the first image block that are rendered, the second pixels are pixels on the first image block that are not rendered, the edge mask is used to indicate that each pixel on the first image block belongs to an edge type or a non-edge type, and the clear value is a default pixel value of the second pixels; in the case that the first image block uses a multi-sampling anti-aliasing technique, the image decompression unit obtains second data for each first pixel of the non-edge type on the first image block, the second data includes a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type.

[0168] The image decompression unit restores the first image block based on the clear mask, the edge mask, the clear value and the second data (the pixel value of any one of the plurality of sampling points in the pixel region of each first pixel of the non-edge type on the first image block).

[0169] In one embodiment, the image decompression unit obtains the pixel value of any one of the plurality of sampling points in the pixel region of the first pixel of the non-edge type for each first pixel of the non-edge type on the first image block.

[0170] In one embodiment, the first image block is any one of the image blocks in the rendered image, that is, the image decompression method provided in this embodiment is used for any one of the image blocks in the rendered image.

[0171] In one embodiment, the first pixels are pixels on the first image block that need to be rendered by a shader, and the second pixels are pixels on the first image block that do not need to be rendered by the shader.

[0172] In one embodiment, the image decompression unit is configured to read the clear mask, the edge mask, the clear value and the second data from the compressed data of the first image block in a preset order.

[0173] Optionally, the image decompression unit reads the clear mask, the edge mask, the clear value and the second data on the premise of satisfying a fifth condition, the fifth condition includes that the clear mask is read before the edge mask, and the edge mask is read before the second data, at this time, the image decompression unit can determine the first pixels according to the clear mask, determine the first pixels of the non-edge type according to the edge mask, and read the pixel value of any one of the plurality of sampling points in the pixel region of each first pixel of the edge type from the second data.

[0174] For example, the preset order is "screen clear mask - edge mask - screen clear value - second data"; or the preset order is "screen clear mask - edge mask - second data - screen clear value".

[0175] In one embodiment, the image decompression unit may be... Figure 9 Image decompression unit 9031, image decompression unit 9041 or image decompression unit 9051 in the image decompression unit.

[0176] like Figure 12 As shown, the image decompression unit obtains the clearing mask 1201, edge mask 1202, clearing value 1203, P0 pixel value, and P16 pixel value from the compressed data 1200 of the first image block. The P0 pixel value is equivalent to the sampling point P0S0 pixel value 1204 and the sampling point P0S1 pixel value 1205. The P16 pixel value is equivalent to the sampling point P16S0 pixel value 1206 and the sampling point P16S1 pixel value 1207. In the clearing mask 1201, pixels P0 and P16 are identified by NC (Not Clear), indicating that pixels P0 and P16 are rendered pixels, while the remaining pixels are unrendered pixels. The clearing value 1203 is the same pixel value used by the remaining pixels. In the edge mask 1202, pixels P0 and P16 are identified by OE (On Edge), indicating that pixels P0 and P16 are non-edge type pixels.

[0177] The image decompression unit restores the pixel values ​​of all pixels on the first image block 1208 based on the clearing mask 1201, the edge mask 1202, the clearing value 1203, the P0 pixel value, and the P16 pixel value.

[0178] In one embodiment, the image decompression unit reads the clearing mask 1201, edge mask 1202, clearing value 1203, P0 pixel value, and P16 pixel value from the compressed data 1200 of the first image block in the order of "clearing mask 1201 - edge mask 1202 - clearing value 1203 - P0 pixel value - P16 pixel value".

[0179] The image decompression method provided in this application only requires a clear screen mask, an edge mask, clear screen values, and the pixel value of any one of multiple sampling points in the pixel region of each non-edge type first pixel on the first image block to reconstruct the first image block. This method requires less data for image decompression, resulting in faster decompression speeds. Furthermore, the image decompression method provided in this application can also obtain the clear screen mask and the edge mask.

[0180] For the first pixels including the first pixels belonging to the edge type and the first pixels belonging to the non-edge type, the edge type pixel refers to a pixel whose pixel values of multiple sampling points in a pixel region are inconsistent; the non-edge type pixel refers to a pixel whose pixel values of multiple sampling points in a pixel region are consistent. The pixel region refers to a region occupied by a pixel on the first image block in the present application.

[0181] The image decompression unit obtains a clear mask, an edge mask and a clear value from the compressed data of the first image block, the clear mask is used to indicate the first pixels and the second pixels on the first image block, the first pixels are the pixels rendered on the first image block, the second pixels are the pixels not rendered on the first image block, the edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type, and the clear value is a default pixel value of the second pixel. In the case that the first image block uses the multi-sampling anti-aliasing technology, the image decompression unit obtains, for each edge type first pixel and each non-edge type first pixel on the first image block, first data including the pixel values of multiple sampling points in the pixel region of the edge type first pixel, and second data including the pixel value of any one of the multiple sampling points in the pixel region of the non-edge type first pixel. The image decompression unit restores the first image block based on the clear mask, the edge mask, the clear value, the first data (the pixel values of multiple sampling points in the pixel region of each edge type first pixel on the first image block) and the second data (the pixel value of any one of the multiple sampling points in the pixel region of each non-edge type first pixel on the first image block).

[0182] In one embodiment, the image decompression unit obtains, for each edge type first pixel and each non-edge type first pixel on the first image block, the pixel values of multiple sampling points in the pixel region of the edge type first pixel, and the pixel value of any one of the multiple sampling points in the pixel region of the non-edge type first pixel.

[0183] In one embodiment, the first image block is any one of the image blocks in the rendered image, that is, the image decompression method provided in the present embodiment is used for any one of the image blocks in the rendered image.

[0184] In one embodiment, the first pixel is a pixel on the first image block that needs to be rendered by a shader, and the second pixel is a pixel on the first image block that does not need to be rendered by the shader.

[0185] In one embodiment, the image decompression unit reads the clear mask, the edge mask, the clear value, the first data and the second data from the compressed data of the first image block in a preset order.

[0186] Optionally, the image decompression unit reads the clear mask, the edge mask, the clear value, the first data and the second data on the premise of satisfying a sixth condition, the sixth condition comprising "reading the clear mask before reading the edge mask, and reading the edge mask before reading the first data and the second data". At this time, the image decompression unit can determine the first pixel according to the clear mask, determine the first pixel belonging to the edge type and the first pixel belonging to the non-edge type according to the edge mask, and read the pixel value of each sampling point in the pixel region of each edge type first pixel from the first data and read the pixel value of any one sampling point in the pixel region of each non-edge type first pixel from the second data.

[0187] For example, the preset order is "clear mask - edge mask - clear value - first data - second data"; for another example, the preset order is "clear mask - edge mask - first data - second data - clear value"; for still another example, the preset order is "clear mask - edge mask - clear value - second data - first data".

[0188] In one embodiment, the image decompression unit can be the image decompression unit 9031, the image decompression unit 9041 or the image decompression unit 9051 in the image decompression unit 9030, the image decompression unit 9040 or the image decompression unit 9050 in FIG. 9. Figure 9

[0189] As shown in FIG. 13, the image decompression unit obtains the clear mask 1301, the edge mask 1302, the clear value 1303, the P0S0 pixel value 1304, the P0S1 pixel value 1305 and the P16 pixel value from the compressed data 1300 of the first image block. The P16 pixel value is equivalent to the sampling point P16S0 pixel value 1306 and the sampling point P16S1 pixel value 1307. The clear mask 1301 identifies the pixel P0 and the pixel P16 by NC (Not Clear), indicating that the pixel P0 and the pixel P16 are rendered pixels, and the remaining pixels are unrendered pixels. The clear value 1303 is the same pixel value adopted by the remaining pixels. The edge mask 1302 identifies the pixel P0 by OE (On Edge), indicating that the pixel P0 is an edge type pixel, and does not identify the pixel P16, indicating that the pixel P16 is a non-edge type pixel. Figure 13 The image decompression unit restores the pixel values of all pixels on the first image block 1308 based on the clear mask 1301, the edge mask 1302, the clear value 1303, the P0S0 pixel value 1304, the P0S1 pixel value 1305 and the P16 pixel value.

[0190]

[0191] ​​In one embodiment, the image decompression unit reads the above data from the compressed data 1300 of the first image block in the order of "clear screen mask 1301 - edge mask 1302 - clear screen value 1303 - P0S0 pixel value 1304 - P0S1 pixel value 1305 - P16 pixel value".

[0192] By the image decompression method provided in the present application, only the clear screen mask, the edge mask, the clear screen value, the pixel value of each sampling point in the pixel region of the first pixel of each edge type in the first image block, and the pixel value of any one sampling point in the pixel region of the first pixel of each non-edge type in the first image block are needed to restore the first image block, so that the data required in image decompression is less, and the speed of image decompression is faster. Moreover, the image decompression method provided in the present application can also obtain the clear screen mask and the edge mask.

[0193] Figure 14 A structural block diagram of an electronic device 1400 provided in one exemplary embodiment of the present application is shown. The electronic device 1400 can be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a notebook computer, or a desktop computer. The electronic device 1400 can also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0194] Generally, the electronic device 1400 includes a processor 1401 and a memory 1402.

[0195] Optionally, the processor 1400 includes a graphics processor. Optionally, the processor 1401 is configured to be responsible for rendering and drawing of the content required to be displayed on the display screen. The processor 1401 includes the image compression unit and / or the image decompression unit provided in the above embodiments.

[0196] The memory 1402 can include one or more computer-readable storage media that can be non-transitory. The memory 1402 can also include a high-speed random access memory and a nonvolatile memory such as one or more disk storage devices, flash storage devices.

[0197] In some embodiments, the computer device 1400 can also optionally include a peripheral device interface 1403 and at least one peripheral device. Those skilled in the art can understand that the peripheral device interface 1403 is configured to be connected to the at least one peripheral device, and the at least one peripheral device can be connected to the computer device 1400 through the peripheral device interface 1403. Figure 14The structure shown in the figure does not constitute a limitation on the computer device 1400, and can include more or fewer components than shown, or combine certain components, or adopt a different component arrangement.

[0198] The application further provides a processor, which comprises the image compression unit and / or the image decompression unit as introduced in the above embodiments.

[0199] The application further provides a chip, which comprises the processor, and the processor comprises the image compression unit and / or the image decompression unit as introduced in the above embodiments.

[0200] The application further provides a server, which comprises the image compression unit and / or the image decompression unit as introduced in the above embodiments.

[0201] The above-mentioned serial numbers of the embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0202] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.

[0203] The above-mentioned is only the optional embodiment of the application, and does not limit the application, and any modification, equivalent replacement, improvement, etc. within the spirit and principle of the application should be included in the protection scope of the application.

Claims

1. A processor, comprising: The processor comprises an image compression unit; The image compression unit is configured to acquire a clear mask and a clear value of a first image block, the clear mask is used to indicate first pixels and second pixels on the first image block, the first pixels are pixels rendered on the first image block, the second pixels are pixels not rendered on the first image block, and the clear value is a default pixel value of the second pixels; The image compression unit is configured to acquire color data of the first pixels; The image compression unit is configured to store the clear mask, the clear value and the color data of each first pixel as compressed data of the first image block.

2. The processor of claim 1, wherein The image compression unit is configured to acquire pixel values of each first pixel on the first image block in a case where the first image block does not use a multi-sampling anti-aliasing technique; The image compression unit is configured to store the clear mask, the clear value and the pixel values of each first pixel as compressed data of the first image block.

3. The processor of claim 2, wherein The image compression unit is configured to concatenate the clear mask, the clear value and the pixel values of each first pixel in a preset order to obtain a concatenation result, and store the concatenation result as the compressed data of the first image block.

4. The processor of any one of claims 1 to 3, wherein, The first pixels comprise first pixels of an edge type; The image compression unit is configured to acquire, for each first pixel of the edge type on the first image block, first data comprising respective pixel values of a plurality of sampling points in a pixel region of the first pixel of the edge type in a case where the first image block uses the multi-sampling anti-aliasing technique; The image compression unit is configured to acquire an edge mask of the first image block; The image compression unit is configured to store compressed data of the first image block based on the clear mask, the edge mask, the clear value and the first data; The edge mask is used to indicate that each pixel on the first image block belongs to the edge type or a non-edge type.

5. The processor of claim 4, wherein The image compression unit is configured to concatenate the clear mask, the edge mask, the clear value and the first data in a preset order to obtain a concatenation result, and store the concatenation result as the compressed data of the first image block.

6. The processor of any one of claims 1 to 3, wherein, The first pixels comprise first pixels of a non-edge type; The image compression unit is configured to acquire, for each first pixel of the non-edge type on the first image block, second data comprising a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type in a case where the first image block uses the multi-sampling anti-aliasing technique; The image compression unit is configured to acquire an edge mask of the first image block; The image compression unit is configured to store compressed data of the first image block based on the clear mask, the edge mask, the clear value, and the second data. The edge mask is configured to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

7. The processor of claim 6, wherein The image compression unit is configured to concatenate the clear mask, the edge mask, the clear value, and the second data in a preset order to obtain a concatenation result, and store the concatenation result as the compressed data of the first image block.

8. The processor of any one of claims 1 to 3, wherein, The first pixels include first pixels belonging to the edge type and first pixels belonging to the non-edge type. The image compression unit is configured to, in a case where the first image block uses the multi-sampling anti-aliasing technology, obtain, for each first pixel of the edge type on the first image block, first data including respective pixel values of a plurality of sampling points in a pixel region of the first pixel of the edge type. The image compression unit is configured to, in a case where the first image block uses the multi-sampling anti-aliasing technology, obtain, for each first pixel of the non-edge type on the first image block, second data including a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type. The image compression unit is configured to obtain an edge mask of the first image block. The image compression unit is configured to store compressed data of the first image block based on the clear mask, the edge mask, the clear value, the first data, and the second data. The edge mask is configured to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

9. The processor of claim 8, wherein The image compression unit is configured to concatenate the clear mask, the edge mask, the clear value, the first data, and the second data in a preset order to obtain a concatenation result, and store the concatenation result as the compressed data of the first image block.

10. A processor, comprising: The processor includes an image decompression unit. The image decompression unit is configured to obtain, from compressed data of a first image block, a clear mask and a clear value, the clear mask being configured to indicate first pixels and second pixels on the first image block, the first pixels being pixels on the first image block that are rendered, the second pixels being pixels on the first image block that are not rendered, and the clear value being a default pixel value of the second pixels. The image decompression unit is configured to obtain color data of the first pixels. The image decompression unit is configured to restore the first image block based on the clear mask, the clear value, and the color data of each first pixel.

11. The processor of claim 10, wherein The image decompression unit is configured to, in a case where the first image block does not use the multi-sampling anti-aliasing technology, obtain a pixel value of each first pixel on the first image block. The image decompression unit is configured to restore the first image block based on the clear mask, the clear value, and the pixel value of each first pixel.

12. The processor of claim 11, wherein, The image decompression unit is configured to read the clear mask, the clear value, and the pixel value of each first pixel from the compressed data of the first image block in a preset order.

13. The processor of any one of claims 10 to 12, wherein, The first pixels include first pixels of an edge type; The image decompression unit is configured to obtain an edge mask of the first image block; The image decompression unit is configured to, in a case where the first image block uses a multi-sampling anti-aliasing technique, obtain, for each first pixel of the edge type on the first image block, first data including a respective pixel value of each of a plurality of sampling points in a pixel region of the first pixel of the edge type; The image decompression unit is configured to restore the first image block based on the clear mask, the edge mask, the clear value, and the first data. The edge mask is configured to indicate whether each pixel on the first image block is of the edge type or a non-edge type.

14. The processor of claim 13, wherein, The image decompression unit is configured to read the clear mask, the edge mask, the clear value, and the first data from the compressed data of the first image block in a preset order.

15. The processor of any one of claims 10 to 12, wherein, The first pixels include first pixels of a non-edge type; The image decompression unit is configured to obtain an edge mask of the first image block; The image decompression unit is configured to, in a case where the first image block uses a multi-sampling anti-aliasing technique, obtain, for each first pixel of the non-edge type on the first image block, second data including a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type; The image decompression unit is configured to restore the first image block based on the clear mask, the edge mask, the clear value, and the second data. The edge mask is configured to indicate whether each pixel on the first image block is of the edge type or the non-edge type.

16. The processor of claim 15, wherein, The image decompression unit is configured to read the clear mask, the edge mask, the clear value, and the second data from the compressed data of the first image block in a preset order.

17. The processor of any one of claims 10 to 12, wherein, The first pixels include first pixels of an edge type and first pixels of a non-edge type; The image decompression unit is configured to obtain an edge mask of the first image block; The image decompression unit is configured to, in a case where the first image block uses a multi-sampling anti-aliasing technique, obtain, for each first pixel of the edge type on the first image block, first data including a respective pixel value of each of a plurality of sampling points in a pixel region of the first pixel of the edge type; the image decompression unit is configured to, in a case where the first image block uses a multi-sampling anti-aliasing technique, obtain, for each first pixel of the non-edge type on the first image block, second data including a pixel value of any one of a plurality of sampling points in a pixel area of the first pixel of the non-edge type; the image decompression unit is configured to restore the first image block based on the clear mask, the edge mask, the clear value, the first data, and the second data. The edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

18. The processor of claim 17, wherein the image decompression unit is configured to read the clear mask, the edge mask, the clear value, the first data, and the second data from the compressed data of the first image block in a preset order.

19. An image compression method characterized by, The method comprises: obtaining a clear mask and a clear value of a first image block, the clear mask being used to indicate first pixels and second pixels on the first image block, the first pixels being pixels rendered on the first image block, the second pixels being pixels not rendered on the first image block, and the clear value being a default pixel value of the second pixels; obtaining color data of the first pixels; storing the clear mask, the clear value, and the color data of each first pixel as compressed data of the first image block.

20. The method of claim 19, wherein, The obtaining of the color data of the first pixels comprises: in a case where the first image block does not use a multi-sampling anti-aliasing technique, obtaining a pixel value of each first pixel on the first image block; The storing of the clear mask, the clear value, and the color data of each first pixel as compressed data of the first image block comprises: storing the clear mask, the clear value, and the pixel value of each first pixel as compressed data of the first image block.

21. The method of claim 20, wherein, The storing of the clear mask, the clear value, and the pixel value of each first pixel as compressed data of the first image block comprises: concatenating the clear mask, the clear value, and the pixel value of each first pixel in a preset order to obtain a concatenation result, and storing the concatenation result as the compressed data of the first image block.

22. The method of any one of claims 19 to 21, wherein, The first pixels include first pixels of an edge type; The obtaining of the color data of the first pixels comprises: in a case where the first image block uses a multi-sampling anti-aliasing technique, obtaining, for each first pixel of the edge type on the first image block, first data including respective pixel values of a plurality of sampling points in a pixel area of the first pixel of the edge type; The method further comprises: obtaining an edge mask of the first image block; The storing of the clear mask, the clear value, and the color data of each first pixel as compressed data of the first image block comprises: store compressed data of the first image block based on the clear mask, the edge mask, the clear value and the first data; wherein the edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

23. The method of claim 22, wherein, The storing of the compressed data of the first image block based on the clear mask, the edge mask, the clear value and the first data comprises: concatenating the clear mask, the edge mask, the clear value and the first data in a preset order to obtain a concatenation result; and storing the concatenation result as the compressed data of the first image block.

24. The method of any one of claims 19 to 21, wherein, The first pixels include first pixels belonging to the non-edge type; The obtaining of the color data of the first pixels comprises: in the case that the first image block uses a multi-sampling anti-aliasing technique, for each first pixel of the non-edge type on the first image block, obtaining second data, the second data comprising a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type; The method further comprises: obtaining an edge mask of the first image block; The storing of the clear mask, the clear value and the color data of each first pixel as the compressed data of the first image block comprises: storing compressed data of the first image block based on the clear mask, the edge mask, the clear value and the second data; wherein the edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

25. The method of claim 24, wherein, The storing of the compressed data of the first image block based on the clear mask, the edge mask, the clear value and the second data comprises: concatenating the clear mask, the edge mask, the clear value and the second data in a preset order to obtain a concatenation result; and storing the concatenation result as the compressed data of the first image block.

26. The method of any one of claims 19 to 21, wherein, The first pixels include first pixels belonging to the edge type and first pixels belonging to the non-edge type; The obtaining of the color data of the first pixels comprises: in the case that the first image block uses a multi-sampling anti-aliasing technique, for each first pixel of the edge type on the first image block, obtaining first data, the first data comprising respective pixel values of a plurality of sampling points in a pixel region of the first pixel of the edge type; for each first pixel of the non-edge type on the first image block, obtaining second data, the second data comprising a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type; The method further comprises: obtaining an edge mask of the first image block; The storing of the clear mask, the clear value and the color data of each first pixel as the compressed data of the first image block comprises: storing compressed data of the first image block based on the clear mask, the edge mask, the clear value, the first data and the second data; The edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

27. The method of claim 26, wherein, The storing the compressed data of the first image block based on the clear mask, the edge mask, the clear value, the first data and the second data comprises: concatenating the clear mask, the edge mask, the clear value, the first data and the second data in a preset order to obtain a concatenation result; and storing the concatenation result as the compressed data of the first image block.

28. An image decompression method, characterized by, The method comprises: obtaining a clear mask and a clear value from the compressed data of the first image block, the clear mask being used to indicate a first pixel and a second pixel on the first image block, the first pixel being a pixel on the first image block that is rendered, the second pixel being a pixel on the first image block that is not rendered, and the clear value being a default pixel value of the second pixel; obtaining color data of the first pixel; restoring the first image block based on the clear mask, the clear value and the color data of each first pixel.

29. The method of claim 28, wherein, The obtaining the color data of the first pixel comprises: in a case where the first image block does not use a multi-sampling anti-aliasing technique, obtaining a pixel value of each first pixel on the first image block; The restoring the first image block based on the clear mask, the clear value and the color data of each first pixel comprises: restoring the first image block based on the clear mask, the clear value and the pixel value of each first pixel.

30. The method of claim 29, wherein, The obtaining the clear mask, the clear value from the compressed data of the first image block and the obtaining the pixel value of each first pixel on the first image block comprise: reading the clear mask, the clear value and the pixel value of each first pixel from the compressed data of the first image block in a preset order.

31. The method of any one of claims 28 to 30, wherein, The first pixel comprises a first pixel belonging to an edge type; the method further comprises: obtaining an edge mask of the first image block; The obtaining the color data of the first pixel comprises: in a case where the first image block uses a multi-sampling anti-aliasing technique, for each first pixel of the edge type on the first image block, obtaining first data, the first data comprising a respective pixel value of a plurality of sampling points in a pixel area of the first pixel of the edge type; The restoring the first image block based on the clear mask, the clear value and the color data of each first pixel comprises: restoring the first image block based on the clear mask, the edge mask, the clear value and the first data; The edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

32. The method of claim 31, wherein, The obtaining the clear mask and the clear value from the compressed data of the first image block, the obtaining the edge mask of the first image block and the obtaining the first data comprise: reading the clear mask, the edge mask, the clear value and the first data from the compressed data of the first image block in a preset order.

33. The method of any one of claims 28-30, wherein, The first pixels include first pixels belonging to a non-edge type; and the method further comprises: obtaining an edge mask of the first image block; The obtaining of the color data of the first pixels comprises: In a case where the first image block uses a multi-sampling anti-aliasing technique, for each first pixel of the non-edge type on the first image block, obtaining second data, the second data comprising a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type; The restoring of the first image block based on the clear mask, the clear value and the color data of each first pixel comprises: The restoring of the first image block based on the clear mask, the edge mask, the clear value and the second data; The edge mask is used to indicate that each pixel on the first image block belongs to an edge type or the non-edge type.

34. The method of claim 33, wherein, The obtaining of the clear mask and the clear value from the compressed data of the first image block, the obtaining of the edge mask of the first image block, and the obtaining of the second data comprise: The clear mask, the edge mask, the clear value and the second data are read from the compressed data of the first image block in a preset order.

35. The method of any one of claims 28 to 30, wherein, The first pixels include first pixels belonging to an edge type and first pixels belonging to a non-edge type; and the method further comprises: obtaining an edge mask of the first image block; The obtaining of the color data of the first pixels comprises: In a case where the first image block uses a multi-sampling anti-aliasing technique, for each first pixel of the edge type on the first image block, obtaining first data, the first data comprising a respective pixel value of each of a plurality of sampling points in a pixel region of the first pixel of the edge type; for each first pixel of the non-edge type on the first image block, obtaining second data, the second data comprising a pixel value of any one of a plurality of sampling points in a pixel region of the first pixel of the non-edge type; The restoring of the first image block based on the clear mask, the clear value and the color data of each first pixel comprises: The restoring of the first image block based on the clear mask, the edge mask, the clear value, the first data and the second data; The edge mask is used to indicate that each pixel on the first image block belongs to the edge type or the non-edge type.

36. The method of claim 35, wherein, The obtaining of the clear mask and the clear value from the compressed data of the first image block, the obtaining of the edge mask of the first image block, and the obtaining of the first data and the second data comprise: The clear mask, the edge mask, the clear value, the first data and the second data are read from the compressed data of the first image block in a preset order.

37. A chip, characterized by The chip comprises the processor as claimed in any one of claims 1 to 18.

38. A server, comprising: The server comprises the processor as claimed in any one of claims 1 to 18.

39. An electronic device, comprising: The electronic device comprises a processor, and the processor comprises the processor as claimed in any one of claims 1 to 18.

Citation Information

Patent Citations

  • Determination method and device of decoding configuration parameters, equipment and storage medium

    CN116567244A

  • Screen cleaning method and device, electronic equipment and readable medium

    CN120029578A