Image data storage, write-out and read methods and devices, equipment and storage medium

By using an image data storage method based on color consistency identifiers in multisampling antialiasing (MSAA), the storage space and bandwidth consumption problems caused by MSAA are solved, and efficient image data storage and retrieval are achieved.

CN121000983AActive Publication Date: 2025-11-21MOORE THREAD INTELLIGENT TECHNOLOGY (HANGZHOU) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511518780.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2025-11-21
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Multisampling anti-aliasing (MSAA) technology improves image resolution but also leads to a significant increase in storage space and read/write bandwidth consumption, thus increasing the load on computer equipment.

Method used

By determining the consistency identifier of a pixel based on the color consistency of multiple sampling points, and storing the colors of sampling points with the same sampling point identifier in the same color storage area, a correspondence between pixel coordinates, consistency identifiers, and color blocks is established, thus optimizing the storage and retrieval process.

Benefits of technology

It effectively reduces the consumption of read and write bandwidth, improves read and write efficiency and resource utilization, and reduces the load on computer equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121000983A_ABST
    Figure CN121000983A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image data storage, write-out and reading method and device, equipment and a storage medium, and the method comprises the steps: obtaining the colors of a plurality of sampling points corresponding to a to-be-processed first pixel; determining a consistency identifier of the first pixel based on the color consistency of the plurality of sampling points corresponding to the first pixel; based on a plurality of sampling point identifiers corresponding to each first pixel, colors of sampling points of the same sampling point identifier corresponding to different first pixels are stored in the same color storage area, and a first color block is obtained; different first pixels correspond to the same sampling point identification generation mode; and establishing a corresponding relationship among the coordinates of the first pixels, the consistency identifiers of the first pixels and the first color blocks to obtain a first corresponding relationship. Therefore, the colors of all the sampling points corresponding to the pixels can be read and written to the maximum extent by using the extremely small read-write bandwidth, and the read-write efficiency and the resource utilization rate are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to, but is not limited to, the field of computer technology, and in particular to a method, apparatus, device, and storage medium for storing, writing, and reading image data. Background Technology

[0002] Multi-Sample Anti-Aliasing (MSAA) is a technique used to reduce image jaggedness. In MSAA, the color of a pixel is determined by image data such as color and depth collected from multiple samples within the region containing that pixel.

[0003] Although MSAA improves image resolution and makes images smoother, the data acquisition from multiple sampling points requires significantly more storage space to store the acquired image data and also consumes significantly more read / write bandwidth. Summary of the Invention

[0004] In view of this, the present disclosure provides at least one method, apparatus, device, and storage medium for storing, writing, and reading image data.

[0005] The technical solution of this disclosure embodiment is implemented as follows: On one hand, embodiments of this disclosure provide an image data storage method, which includes: Obtain the colors of multiple sampling points corresponding to the first pixel to be processed; Based on the color consistency of multiple sampling points corresponding to the first pixel, the consistency identifier of the first pixel is determined; Based on multiple sampling point identifiers corresponding to each first pixel, the colors of sampling points with the same sampling point identifier corresponding to different first pixels are stored in the same color storage area to obtain the first color block; different first pixels correspond to the same sampling point identifier generation method; Establish the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block to obtain the first correspondence.

[0006] On one hand, embodiments of this disclosure provide an image data writing method, which includes: Based on the coordinates of the second pixel to be written and the second correspondence, the consistency identifier of the second pixel is determined; the second correspondence represents the correspondence between the coordinates of the second pixel, the consistency identifier of the second pixel, and the second color block corresponding to the second pixel; the consistency identifier of the second pixel is determined based on the color consistency of multiple sampling points corresponding to the second pixel, and the second color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area. Based on the coordinates of the second pixel and the second correspondence, the second color block and the storage location of the second color of the second pixel in the second color block are determined; If the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are completely the same, write out the consistency identifier of the second pixel and the color at the second color storage position in any color storage area of ​​the second color block.

[0007] On one hand, embodiments of this disclosure provide an image data reading method, which includes: Based on the coordinates of the third pixel to be read and the third correspondence, the consistency identifier of the third pixel is determined; the third correspondence represents the correspondence between the coordinates of the third pixel, the consistency identifier of the third pixel, and the third color block corresponding to the third pixel; the consistency identifier of the third pixel is determined based on the color consistency of multiple sampling points corresponding to the third pixel, and the third color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area. Based on the coordinates of the third pixel and the third correspondence, the third color block and the storage location of the third color of the third pixel in the third color block are determined. If the consistency identifier of the third pixel indicates that the colors of multiple sampling points corresponding to the third pixel are completely the same, read the color of the third color storage location and the coordinates of multiple sampling points in any color storage area of ​​the third color block.

[0008] On the other hand, embodiments of this disclosure provide an image data storage device, which includes: The module is configured to obtain the colors of multiple sampling points corresponding to the first pixel to be processed. The first processing module is configured to determine the consistency identifier of the first pixel based on the color consistency of multiple sampling points corresponding to the first pixel. The storage module is configured to store the colors of sampling points with the same sampling point identifier corresponding to different first pixels in the same color storage area based on multiple sampling point identifiers corresponding to each first pixel, thus obtaining a first color block; different first pixels correspond to the same sampling point identifier generation method; The first processing module is also configured to establish a correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block, thereby obtaining a first correspondence.

[0009] On the other hand, embodiments of this disclosure provide an image data writing device, which includes: The second processing module is configured to determine the consistency identifier of the second pixel based on the coordinates of the second pixel to be written and the second correspondence; the second correspondence represents the correspondence between the coordinates of the second pixel, the consistency identifier of the second pixel, and the second color block corresponding to the second pixel; the consistency identifier of the second pixel is determined based on the color consistency of multiple sampling points corresponding to the second pixel, and the second color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area. The second processing module is also configured to determine the second color block and the storage location of the second color of the second pixel in the second color block based on the coordinates of the second pixel and the second correspondence. The write module is configured to write out the consistency identifier of the second pixel and the color at the second color storage position in any color storage area of ​​the second color block when the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are completely the same.

[0010] On the other hand, embodiments of this disclosure provide an image data reading device, which includes: The third processing module is configured to determine the consistency identifier of the third pixel based on the coordinates of the third pixel to be read and the third correspondence relationship; the third correspondence relationship represents the correspondence between the coordinates of the third pixel, the consistency identifier of the third pixel, and the third color block corresponding to the third pixel; the consistency identifier of the third pixel is determined based on the color consistency of multiple sampling points corresponding to the third pixel, and the third color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area. The third processing module is also configured to determine the third color block and the storage location of the third color of the third pixel in the third color block based on the coordinates of the third pixel and the third correspondence. The reading module is configured to read the color at the third color storage location and the coordinates of multiple sampling points in any color storage area of ​​the third color block when the consistency identifier of the third pixel indicates that the colors of multiple sampling points corresponding to the third pixel are completely the same.

[0011] In another aspect, embodiments of this disclosure provide a computer device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the program to implement some or all of the steps in the above-described method.

[0012] In another aspect, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above-described method.

[0013] In another aspect, embodiments of this disclosure provide a computer program including computer-readable code, which, when executed in a computer device, causes a processor in the computer device to perform some or all of the steps in the above-described method.

[0014] In another aspect, embodiments of this disclosure provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method.

[0015] In this embodiment, a consistency identifier for the first pixel is determined based on the color consistency of multiple sampling points corresponding to the first pixel. Thus, the consistency identifier allows for quick determination of whether the colors of multiple sampling points corresponding to the first pixel are completely identical. Based on the multiple sampling identifiers corresponding to each first pixel, the colors of sampling points with the same sampling identifier corresponding to different first pixels are stored in the same color storage area, resulting in a first color block. This grouping and storing sampling points of multiple pixels according to their sampling identifiers allows for storing the colors of sampling points corresponding to multiple pixels in a single color block. Furthermore, when the consistency identifier indicates that the colors of sampling points corresponding to any first pixel are completely identical, the colors of all sampling points corresponding to the first pixel can be determined simply by reading and writing the colors of the sampling points corresponding to that pixel stored in the first color storage area of ​​the first color block. Similarly, when the consistency identifier indicates that the colors of the sampling points corresponding to each of the first pixels stored in the first color block are only one (the colors of sampling points corresponding to different pixels can be the same or different), the colors of all sampling points corresponding to each of the first pixels can be determined simply by reading and writing the colors of all sampling points stored in the first color storage area of ​​the first color block. Thus, by utilizing minimal read / write bandwidth, the color of all sampled points corresponding to a pixel can be read and written to the maximum extent, thereby improving read / write efficiency and resource utilization.

[0016] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this disclosure. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.

[0018] Figure 1 A schematic diagram of an image texture without MSAA provided for an embodiment of this disclosure; Figure 2 A schematic diagram of an image texture using MSAA provided for an embodiment of this disclosure; Figure 3 A schematic diagram of the implementation process of an image data storage method provided in this embodiment of the present disclosure. Figure 1 ; Figure 4 A schematic diagram of the implementation process of an image data storage method provided in this embodiment of the present disclosure. Figure 2 ; Figure 5 A schematic diagram of a color block in an image data storage method provided in an embodiment of this disclosure; Figure 6 A schematic diagram of an identifier block in an image data storage method provided in an embodiment of this disclosure; Figure 7 A schematic diagram of the implementation flow of an image data writing method provided in this embodiment of the disclosure. Figure 1 ; Figure 8 A schematic diagram of the implementation flow of an image data writing method provided in this embodiment of the disclosure. Figure 2 ; Figure 9 A schematic diagram illustrating the implementation flow of an image data reading method provided in this embodiment of the disclosure; Figure 10 This is a schematic diagram illustrating the implementation of an image data writing method provided in this embodiment of the present disclosure when applied to MSAA. Figure 11 This is a schematic diagram illustrating the implementation of an image data reading method provided in this disclosure when applied to MSAA. Figure 12 This is a schematic diagram of the composition structure of an image data storage device provided in an embodiment of the present disclosure; Figure 13 This is a schematic diagram of the composition structure of an image data writing device provided in an embodiment of the present disclosure; Figure 14 This is a schematic diagram of the composition structure of an image data reading device provided in an embodiment of the present disclosure; Figure 15 This is a schematic diagram of the hardware entity of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this disclosure clearer, the technical solutions of this disclosure are further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on this disclosure. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0020] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0021] The terms “first / second / third” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first / second / third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this disclosure described herein can be implemented in an order other than that illustrated or described herein.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. The terminology used herein is for descriptive purposes only and is not intended to limit the scope of this disclosure.

[0023] To better understand the methods provided in the embodiments of this disclosure, the innovative ideas of the embodiments of this disclosure will be explained below.

[0024] like Figure 1 As shown, Figure 1 This is a schematic diagram of an image texture that does not employ MSAA, provided as an embodiment of the present disclosure. Figure 1 In this context, a "cross" represents one pixel. Figure 2 This is a schematic diagram of an image texture using MSAA provided for an embodiment of this disclosure. Figure 2 In the image, "dots" represent sampling points, "dots" filled with different patterns represent sampling points for different image data, and "rectangles" filled with different patterns represent pixels of different colors. Figure 1 As can be seen, without MSAA, the pixels occupied by the triangles are all the same color. From... Figure 2 As can be seen, when using MSAA, the pixels occupied by the triangle edges will appear in different colors depending on the image data acquired at the sampling points. Clearly, Figure 2 The triangle in the text consumes resources during reading and writing. Figure 1 The triangle in the diagram has four times the bandwidth during read and write operations, increasing the load on computer equipment.

[0025] like Figure 2 As shown, if multiple sampling points are all inside the triangle, then all sampling points will have the same color. Furthermore, the number of sampling points on the edges is smaller compared to those inside the triangle. Therefore, most sampling points (i.e., pixels) should be inside the triangle. This characteristic is utilized in embodiments of the present disclosure to compress the bandwidth of the entire path.

[0026] This disclosure provides an image data storage method, which can be executed by a processor of a computer device. The computer device refers to a device with data processing capabilities, such as a server, laptop, tablet, desktop computer, smart TV, set-top box, or mobile device (e.g., mobile phone, portable video player, personal digital assistant, dedicated messaging device, portable gaming device). Figure 3 As shown, the method includes the following steps 301 to 304: Step 301: Obtain the colors of multiple sampling points corresponding to the first pixel to be processed.

[0027] The first pixel can be one or more pixels to be processed; for example, the first pixel could refer to a pixel in the image to be rendered. A pixel can correspond to multiple sampling points; it should be noted that the number of sampling points corresponding to a pixel can be determined based on the performance of the computer device and the desired rendering effect.

[0028] In some implementations, step 301 can be implemented by directly obtaining the color value calculated for each sampling point during the MSAA rendering process.

[0029] Step 302: Determine the consistency identifier of the first pixel based on the color consistency of multiple sampling points corresponding to the first pixel.

[0030] Color consistency across multiple sampling points indicates whether the colors of multiple sampling points corresponding to the first pixel are completely identical.

[0031] In some implementations, step 302 can be specifically implemented as follows: when the colors of multiple sampling points corresponding to the first pixel are completely the same, the consistency identifier of the first pixel is set to a first identifier; when the colors of multiple sampling points corresponding to the first pixel are not completely the same, the consistency identifier of the first pixel is set to a second identifier.

[0032] The first identifier indicates that multiple sampling points corresponding to the first pixel (any pixel) have the same color. The second identifier indicates that multiple sampling points corresponding to the first pixel have different colors. For example, the first identifier can be 0, and the second identifier can be 1. Multiple sampling points corresponding to the first pixel having the same color can mean that the first pixel corresponds to sampling points of only one color. Multiple sampling points having different colors can mean that the first pixel corresponds to sampling points of two or more colors.

[0033] For example, if a pixel consists of four sample points and all four sample points are exactly the same color, then the consistency flag of this pixel is set to 0; if the four sample points are not exactly the same color, then the consistency flag of this pixel is set to 1.

[0034] Step 303: Based on the multiple sampling point identifiers corresponding to each first pixel, store the colors of sampling points with the same sampling point identifier corresponding to different first pixels in the same color storage area to obtain the first color block.

[0035] Among them, different first pixels correspond to the same sampling point identifier generation method.

[0036] The color storage area can be a storage area consisting of multiple cache areas with contiguous addresses, or it can be a storage area consisting of multiple non-contiguous cache areas, and can be set according to the cache allocation method of the computer device.

[0037] In some implementations, the sampling point identifier can be generated as follows: for each first pixel, multiple sampling points are encoded based on their positions in the first pixel to obtain an identifier for each sampling point.

[0038] Specifically, the sampling point identifier generation method can be as follows: For each first pixel, based on the positions of multiple sampling points within the first pixel, the multiple sampling points are encoded in a top-to-bottom and left-to-right order to obtain the identifier for each sampling point. Alternatively, the multiple sampling points corresponding to each first pixel can be encoded according to the generation order of the sampling points, or the multiple sampling points corresponding to each first pixel can be encoded according to the distance between the sampling points and the pixel center.

[0039] For example, for a pixel A that includes four sampling points, it is encoded in order from left to right and from top to bottom to obtain sampling point 1, sampling point 2, sampling point 3 and sampling point 4.

[0040] Storing the colors of sample points with the same sampling point identifier corresponding to different first pixels in the same color storage area can be achieved by grouping the sample points of multiple pixels according to their sampling point identifiers, with the colors of sample points with the same sampling point identifier stored in the same group's color storage area. More specifically, the colors of sample points with the same sampling point identifier are stored in contiguous storage areas within the same group. For example, if pixels A and B both include sampling point 1, sampling point 2, and sampling point 3, then sampling point 1 of pixel A and sampling point 1 of pixel B are stored in one area, sampling point 2 of pixel A and sampling point 2 of pixel B are stored in another area, and sampling point 3 of pixel A and sampling point 3 of pixel B are stored in yet another area.

[0041] Step 304: Establish the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block to obtain the first correspondence.

[0042] The first correspondence can be the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block.

[0043] The purpose of establishing the first correspondence is to facilitate the determination of the consistency identifier of the first pixel and the color of all sampling points corresponding to the pixel when the coordinates of any first pixel are obtained, based on the first correspondence.

[0044] In some implementations, step 304 can be specifically implemented as follows: using the coordinates of the first pixel as the key information item, and using the consistency identifier of the first pixel, the first color block, and the storage location of the color of the sampling point corresponding to the first pixel in the color block as the value information item, to obtain the first correspondence. Alternatively, the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block can be established in the form of a relationship graph.

[0045] In this embodiment, a consistency identifier for the first pixel is determined based on the color consistency of multiple sampling points corresponding to the first pixel. Thus, the consistency identifier allows for quick determination of whether the colors of multiple sampling points corresponding to the first pixel are completely identical. Based on the multiple sampling identifiers corresponding to each first pixel, the colors of sampling points with the same sampling identifier corresponding to different first pixels are stored in the same color storage area, resulting in a first color block. This grouping and storing sampling points of multiple pixels according to their sampling identifiers allows for storing the colors of sampling points corresponding to multiple pixels in a single color block. Furthermore, when the consistency identifier indicates that the colors of sampling points corresponding to any first pixel are completely identical, the colors of all sampling points corresponding to the first pixel can be determined simply by reading and writing the colors of the sampling points corresponding to that pixel stored in the first color storage area of ​​the first color block. Similarly, when the consistency identifier indicates that the colors of the sampling points corresponding to each of the first pixels stored in the first color block are only one (the colors of sampling points corresponding to different pixels can be the same or different), the colors of all sampling points corresponding to each of the first pixels can be determined simply by reading and writing the colors of all sampling points stored in the first color storage area of ​​the first color block. Thus, by utilizing minimal read / write bandwidth, the color of all sampled points corresponding to a pixel can be read and written to the maximum extent, thereby improving read / write efficiency and resource utilization.

[0046] This disclosure provides an image data storage method, which can be executed by a processor of a computer device. For example... Figure 4 As shown, the method includes the following steps 401 to 405: Step 401: Obtain the colors of multiple sampling points corresponding to the first pixel to be processed.

[0047] Step 402: Determine the consistency identifier of the first pixel based on the color consistency of multiple sampling points corresponding to the first pixel.

[0048] Here, steps 401 to 402 correspond to steps 301 to 302 mentioned above, and can be implemented with reference to the specific implementation of steps 301 to 302 mentioned above.

[0049] Step 403: Determine the number N of pixels corresponding to a single color storage area; N is a positive integer.

[0050] The number of pixels corresponding to a single color storage area can be the maximum number of pixels that a single color storage area can store. N can be preset, specifically set to 2*2, 4*4, or 8*8 according to actual business needs.

[0051] Step 404: Based on the multiple sampling point identifiers corresponding to each first pixel, store the colors of the sampling points with the same sampling point identifier corresponding to each N first pixels in the same color storage area to obtain the first color block corresponding to each N first pixels.

[0052] Among them, different first pixels correspond to the same sampling point identifier generation method.

[0053] In some implementations, step 404 can be specifically implemented as follows: based on the coordinates of each N first pixels, determine the first color storage location for each N first pixels; based on the multiple sampling point identifiers corresponding to each first pixel, store the colors of the sampling points with the same sampling point identifier corresponding to each N first pixels in the same color storage area according to the first color storage location, to obtain the first color block corresponding to each N first pixels.

[0054] The first color storage location can be the storage location of the color of the sampling point corresponding to every N first pixels. The coordinates of the first pixel can be the position of the first pixel in the image.

[0055] In one feasible implementation, the specific method for "determining the first color storage position of every N first pixels based on the coordinates of every N first pixels" can be: determining the first color storage position of every N first pixels based on the distance between the coordinates of every N first pixels and a preset origin. Alternatively, the first color storage position of every N first pixels can also be determined according to the coordinates of every N first pixels and the distance between each pixel and the image center.

[0056] In one feasible implementation, the specific implementation of "based on the multiple sampling point identifiers corresponding to each first pixel, according to the first color storage position, storing the colors of sampling points with the same sampling point identifier corresponding to every N first pixels in the same color storage area to obtain the first color block corresponding to every N first pixels" can be as follows: Based on the multiple sampling point identifiers corresponding to each first pixel, determine the color of the sampling point with identifier i corresponding to every N first pixels; i is a positive integer; according to the first color storage position, sequentially store the colors of the sampling points with identifier i corresponding to every N first pixels in the i-th color storage area; based on the multiple sampling point identifiers corresponding to each first pixel, determine the color of the sampling point with identifier i+1 corresponding to every N first pixels; according to the first color storage position, sequentially store the colors of the sampling points with identifier i+1 corresponding to every N first pixels in the (i+1)-th color storage area; based on the i-th color storage area and the (i+1)-th color storage area, determine the first color block corresponding to every N first pixels.

[0057] For example, if both pixel A and pixel B include sampling point 1, sampling point 2, and sampling point 3, then sampling point 1 of pixel A and sampling point 1 of pixel B are stored in the first color storage area, sampling point 2 of pixel A and sampling point 2 of pixel B are stored in the second color storage area, and sampling point 3 of pixel A and sampling point 3 of pixel B are stored in the third color storage area.

[0058] like Figure 5 As shown, if the sampling point identifier starts from 0 and the sequence can only start from 1, then the color of the sampling point identified as i is stored in the (i+1)th color storage area, and the color of the sampling point identified as i+1 is stored in the (i+2)th color storage area.

[0059] See Figure 5 The size of a sample color block can be 256 bytes. One color block can correspond to four 4x4 pixels. Therefore, a color block is divided into four color storage areas: 4x4 sample point 0, 4x4 sample point 1, 4x4 sample point 2, and 4x4 sample point 3. Each color storage area is 64 bytes in size. Each color storage area stores one sample point corresponding to 16 pixels. For example, for the 4x4 sample point 3 color storage area... Figure 5 In the diagram, 0 to 15 represent the sampling points 3 corresponding to each of the 16 pixels, and these 16 pixels are sorted according to their pixel coordinates.

[0060] Or see Figure 5A color block can also correspond to eight 2x2 pixels. In this case, a color block is divided into eight color storage areas: 2x2 sampling point 0, 2x2 sampling point 1, 2x2 sampling point 2, 2x2 sampling point 3, 2x2 sampling point 4, 2x2 sampling point 5, 2x2 sampling point 6, and 2x2 sampling point 7. Each color storage area is 32 bytes in size. Each color storage area stores one sampling point corresponding to four pixels. For example, for the color storage area of ​​2x2 sampling point 7... Figure 5 In the diagram, 0 to 3 represent the sampling points 7 corresponding to the four pixels, and these four pixels are sorted according to their pixel coordinates.

[0061] It should be noted that, based on the coordinates of every N first pixels, the storage location of the color of the sampling point corresponding to every N first pixels (the first color storage location) is determined. The coordinates of the pixels are associated with the storage location of the color of the sampling point, which makes it easy to locate the storage location of the color of the sampling point based on the coordinates of the pixels, and to know the coordinates of the corresponding pixels based on the storage location of the color of the sampling point. Based on the multiple sampling point identifiers corresponding to each first pixel, according to the first color storage location, the colors of the sampling points with the same sampling point identifier corresponding to every N first pixels are stored in the same color storage area, resulting in the first color block corresponding to every N first pixels. This allows the colors of the sampling points corresponding to multiple pixels to be stored in one color block, which facilitates reading and writing the colors of the sampling points corresponding to pixels.

[0062] Step 405: Establish the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block to obtain the first correspondence.

[0063] Since the colors of sampling points with the same sampling point identifier corresponding to different first pixels are stored in a single color storage area, and are stored according to the coordinates of the first pixel, establishing the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block includes: establishing the correspondence between the coordinates of the first pixel and the color storage position of each first pixel in each color storage area (i.e., the correspondence between pixel coordinates and color storage positions). Since every N first pixels correspond to one first color block, establishing the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block also includes: establishing the correspondence between the coordinates of the first pixel and the first color block (the correspondence between pixel coordinates and color blocks).

[0064] It should be noted that since the maximum number of pixels that a single color storage area can store is N, storing the colors of the sampling points with the same sampling point identifier corresponding to each first pixel in the same color storage area based on the multiple sampling point identifiers corresponding to each first pixel can maximize the use of the storage space of the color storage area and improve resource utilization.

[0065] In some embodiments, the image data storage method provided in this disclosure may further include the following steps 405 to 407: Step 405: Determine the number M of pixels corresponding to a single identifier block; M is a positive integer.

[0066] M can be preset, and can be set to 16*16 or 8*8 according to actual business needs.

[0067] Step 406: Based on the coordinates of each M first pixels, determine the first identifier storage location for each M first pixels.

[0068] The storage location of the first identifier can be the storage order of the identifiers of every M first pixels.

[0069] In one feasible implementation, step 406 can be implemented by: determining the first identifier storage location of each M first pixels based on the distance between the coordinates of each M first pixels and a preset origin. Alternatively, the first identifier storage location of each M first pixels can be determined according to the coordinates of each M first pixels and the distance between each pixel and the image center.

[0070] Step 407: According to the first identifier storage location, store the consistency identifiers of every M first pixels in the same storage area to obtain the first identifier block.

[0071] Each M first-level pixel consistency identifier corresponds to a first identifier block.

[0072] like Figure 6 As shown, the size of a flag block can be 32 bytes. One flag block can correspond to 16*16 pixels, that is, one flag block can store 16*16 pixels of flags.

[0073] Since the consistency identifiers of every M first pixels are stored in one storage area and are stored according to the coordinates of the first pixels, establishing the correspondence between the coordinates of the first pixels, the consistency identifiers of the first pixels, and the first color block includes: establishing the correspondence between the coordinates of the first pixels and the identifier storage position of each first pixel in the identifier block (i.e., the correspondence between pixel coordinates and identifier storage positions). Since every M first pixels correspond to one first identifier block, establishing the correspondence between the coordinates of the first pixels, the consistency identifiers of the first pixels, and the first color block also includes: establishing the correspondence between the coordinates of the first pixels and the first identifier block (the correspondence between pixel coordinates and identifier blocks).

[0074] In this embodiment, a consistency identifier for the first pixel is determined based on the color consistency of multiple sampling points corresponding to the first pixel. Thus, the consistency identifier allows for quick determination of whether the colors of multiple sampling points corresponding to the first pixel are completely identical. Based on the multiple sampling identifiers corresponding to each first pixel, the colors of sampling points with the same sampling identifier corresponding to different first pixels are stored in the same color storage area, resulting in a first color block. This grouping and storing sampling points of multiple pixels according to their sampling identifiers allows for storing the colors of sampling points corresponding to multiple pixels in a single color block. Furthermore, when the consistency identifier indicates that the colors of sampling points corresponding to any first pixel are completely identical, the colors of all sampling points corresponding to the first pixel can be determined simply by reading and writing the colors of the sampling points corresponding to that pixel stored in the first color storage area of ​​the first color block. Similarly, when the consistency identifier indicates that the colors of the sampling points corresponding to each of the first pixels stored in the first color block are only one (the colors of sampling points corresponding to different pixels can be the same or different), the colors of all sampling points corresponding to each of the first pixels can be determined simply by reading and writing the colors of all sampling points stored in the first color storage area of ​​the first color block. Thus, by utilizing minimal read / write bandwidth, the color of all sampled points corresponding to a pixel can be read and written to the maximum extent, thereby improving read / write efficiency and resource utilization.

[0075] This disclosure provides an image data storage method, which can be executed by a processor of a computer device. For example... Figure 7 As shown, the method includes the following steps 701 to 703: Step 701: Based on the coordinates of the second pixel to be written and the second correspondence, determine the consistency identifier of the second pixel.

[0076] Wherein, the second correspondence represents the correspondence between the coordinates of the second pixel, the consistency identifier of the second pixel, and the second color block corresponding to the second pixel; the consistency identifier of the second pixel is determined based on the color consistency of multiple sampling points corresponding to the second pixel, and the second color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area.

[0077] The second correspondence can be the first correspondence obtained according to the image data storage method described above. The second pixel can be one or more pixels that need to be written to memory; the second pixel can be one or more first pixels.

[0078] In some implementations, step 701 can be specifically implemented as follows: using the coordinates of the second pixel as the matching basis, obtain the identifier block corresponding to the second pixel from the second correspondence; and determine the consistency identifier of the second pixel from the identifier block corresponding to the second pixel.

[0079] Step 702: Based on the coordinates of the second pixel and the second correspondence, determine the second color block and the second color storage position of the second pixel in the second color block.

[0080] The second color storage location can be the storage order of the color of the sampling point corresponding to the second pixel in the second color block, that is, the storage location of the color of the sampling point corresponding to the second pixel in the second color block.

[0081] In some implementations, step 702 can be specifically implemented as follows: using the coordinates of the second pixel as the matching basis, obtain the second color block corresponding to the second pixel from the second correspondence; using the coordinates of the second pixel as the matching basis, obtain the second color storage position of the second pixel in the second color block from the second correspondence.

[0082] Step 703: When the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are completely the same, write out the consistency identifier of the second pixel and the color in the second color storage position in any color storage area of ​​the second color block.

[0083] The color located at the second color storage position in any color storage area of ​​the second color block can be the color of the sampling point corresponding to the second pixel.

[0084] Since each color storage area of ​​the second color block stores a sampling point corresponding to the second pixel, when the colors of multiple sampling points corresponding to the second pixel are completely the same, the colors of the sampling points corresponding to the second pixel stored in each color storage area of ​​the second color block are the same. At this time, the colors of all sampling points corresponding to the second pixel can be represented by the color of the sampling point corresponding to the second pixel stored in any color storage area and the consistency identifier of the second pixel.

[0085] In some implementations, when the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are not completely the same, the color in the second color storage location in all color storage areas of the second color block is written out.

[0086] Write down the colors in all color storage regions of the second color block that are located at the second color storage position. Alternatively, write down the colors of all sampling points corresponding to the second pixel.

[0087] In this embodiment of the present disclosure, when the colors of multiple sampling points corresponding to the second pixel are completely identical, only the color of the sampling point corresponding to the second pixel stored in any color storage area of ​​the second color block and the consistency identifier of the second pixel are written out. Compared with writing out the colors of multiple sampling points corresponding to the second pixel, the transmission bandwidth during writing is reduced to the greatest extent, the performance and resource utilization of the computer device are improved, and the power consumption of the computer device is reduced.

[0088] This disclosure provides an image data writing method, which can be executed by a processor of a computer device. For example... Figure 8 As shown, the method includes the following steps 801 to 806: Step 801: From the second correspondence, determine the first sub-correspondence between pixel coordinates and identifier blocks, and the second sub-correspondence between pixel coordinates and identifier storage locations.

[0089] The second correspondence may include a first sub-correspondence between pixel coordinates and identifier blocks, and a second sub-correspondence between pixel coordinates and identifier storage locations. The first sub-correspondence may refer to the correspondence between pixel coordinates and identifier block addresses.

[0090] Step 802: Determine the consistency identifier of the second pixel based on the first sub-correspondence, the second sub-correspondence, and the coordinates of the second pixel.

[0091] Wherein, the second correspondence represents the correspondence between the coordinates of the second pixel, the consistency identifier of the second pixel, and the second color block corresponding to the second pixel; the consistency identifier of the second pixel is determined based on the color consistency of multiple sampling points corresponding to the second pixel, and the second color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area.

[0092] In some implementations, when the first correspondence is a direct association between pixel coordinates and identifier block addresses, step 802 can be implemented as follows: using the coordinates of the second pixel as the matching basis, determine the second identifier block that matches the coordinates of the second pixel from the first sub-correspondence; using the coordinates of the second pixel as the matching basis, determine the storage location of the consistency identifier of the second pixel in the second identifier block from the second sub-correspondence; and based on the storage location of the consistency identifier of the second pixel in the second identifier block, obtain the consistency identifier of the second pixel from the second identifier block.

[0093] In some implementations, step 802 may be specifically implemented as follows: based on the first sub-correspondence and the coordinates of the second pixel, determine the second identifier block corresponding to the second pixel; based on the second sub-correspondence and the coordinates of the second pixel, determine the second identifier storage location of the second pixel in the second identifier block; based on the second identifier block and the second identifier storage location, determine the consistency identifier of the second pixel.

[0094] The second identifier storage location can be the storage order of the consistency identifier of the second pixel in the second identifier block, that is, it represents the storage location of the consistency identifier of the second pixel in the second identifier block.

[0095] In one feasible implementation, when the first sub-correspondence is a conversion relationship between pixel coordinates and identifier block addresses, the specific implementation of "determining the second identifier block corresponding to the second pixel based on the first sub-correspondence and the coordinates of the second pixel" can be as follows: convert the coordinates of the second pixel according to the first sub-correspondence to obtain the address of the second identifier block; obtain the second identifier block based on the address of the second identifier block.

[0096] In one feasible implementation, when the second sub-correspondence refers to the conversion relationship between pixel coordinates and identifier storage location, the specific implementation of "determining the second identifier storage location of the second pixel in the second identifier block based on the second sub-correspondence and the coordinates of the second pixel" can be: transforming the coordinates of the second pixel according to the second sub-correspondence to obtain the second identifier storage location.

[0097] It should be noted that, based on the coordinates of the second pixel, the second identifier block corresponding to the second pixel can be determined from the first sub-correspondence between the pixel coordinates and the identifier block; based on the coordinates of the second pixel, the second identifier storage position of the second pixel in the second identifier block can be determined from the second sub-correspondence between the pixel coordinates and the identifier storage position; furthermore, based on the second identifier block and the second identifier storage position, the consistency identifier of the second pixel is determined, which facilitates the subsequent writing of the color of the sampling point of the second pixel.

[0098] Step 803: From the second correspondence, determine the third sub-correspondence between pixel coordinates and color blocks, and the fourth sub-correspondence between pixel coordinates and color storage locations.

[0099] The second correspondence may also include a third sub-correspondence between pixel coordinates and color blocks, and a fourth sub-correspondence between pixel coordinates and color storage locations. The third sub-correspondence may refer to the correspondence between pixel coordinates and color block addresses.

[0100] Step 804: Based on the third sub-correspondence and the coordinates of the second pixel, determine the second color block corresponding to the second pixel.

[0101] In some implementations, when the third sub-correspondence is a direct association between pixel coordinates and color block addresses, step 804 can be implemented as follows: using the coordinates of the second pixel as the matching basis, determine the second color block that matches the coordinates of the second pixel from the third sub-correspondence.

[0102] In some implementations, when the third sub-correspondence can be a conversion relationship between pixel coordinates and color block addresses, step 804 can be implemented as follows: convert the coordinates of the second pixel according to the third sub-correspondence to obtain the address of the second color block; obtain the second color block based on the address of the second color block.

[0103] Step 805: Determine the storage location of the second color based on the fourth sub-correspondence and the coordinates of the second pixel.

[0104] In some implementations, when the fourth sub-correspondence can be a direct association between pixel coordinates and color storage location, step 805 can be implemented as follows: using the coordinates of the second pixel as the matching basis, determine the second color storage location that matches the coordinates of the second pixel from the fourth sub-correspondence.

[0105] In some implementations, when the fourth sub-correspondence can be a conversion relationship between pixel coordinates and color storage location, step 805 can be specifically implemented as follows: the coordinates of the second pixel are converted according to the fourth sub-correspondence to obtain the second color storage location.

[0106] Step 806: When the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are completely the same, write out the consistency identifier of the second pixel and the color in the second color storage position in any color storage area of ​​the second color block.

[0107] Here, step 806 corresponds to step 703 mentioned above, and the specific implementation of step 703 can be referred to during implementation.

[0108] In some embodiments, the image data writing method provided in this disclosure further includes the following steps 807 to 808: Step 807: When the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are not completely the same, the colors of all sampling points in the second color block are compressed to obtain the compressed color.

[0109] Step 808: Write down the consistency identifier of the second pixel and the compressed color.

[0110] It should be noted that since the consistency identifier occupies a small amount of storage space, while the color occupies a large amount of storage space, the color of all sampling points corresponding to the second pixel can be compressed only.

[0111] Based on the foregoing embodiments, the image data writing method provided in this disclosure further includes the following steps 809 to 810: Step 809: Before writing, add the consistency identifier of each second pixel to the target identifier block.

[0112] Step 810: If the target identifier block already contains a first preset number of consistency identifiers of the second pixel, write out the target identifier block.

[0113] The first preset quantity can be the number of pixels M corresponding to a single identifier block.

[0114] It should be noted that writing when the target identifier block has a first preset number of second pixels of consistency identifier can reduce the transmission bandwidth during writing and improve resource utilization.

[0115] Based on the foregoing embodiments, the image data writing method provided in this disclosure further includes the following steps 811 to 812: Step 811: Before writing, add the color of each sampling point of the second pixel to be written to the target color block.

[0116] Step 812: If the target color block already contains the colors of the sampling points corresponding to the second preset number of the second pixels, write out the target color block.

[0117] The second preset quantity can be the number of pixels N corresponding to a single color block.

[0118] It should be noted that writing when the target color block has a second preset number of second pixels of color can further reduce the transmission bandwidth during writing, thereby improving resource utilization.

[0119] In this embodiment of the present disclosure, when the colors of multiple sampling points corresponding to the second pixel are completely identical, only the color of the sampling point corresponding to the second pixel stored in any color storage area of ​​the second color block and the consistency identifier of the second pixel are written out. Compared with writing out the colors of multiple sampling points corresponding to the second pixel, the transmission bandwidth during writing is reduced to the greatest extent, the performance and resource utilization of the computer device are improved, and the power consumption of the computer device is reduced.

[0120] This disclosure provides an image data reading method, which can be executed by a processor of a computer device. For example... Figure 9 As shown, the method includes the following steps 901 to 903: Step 901: Determine the consistency identifier of the third pixel based on the coordinates of the third pixel to be read and the third correspondence.

[0121] The third correspondence represents the correspondence between the coordinates of the third pixel, the consistency identifier of the third pixel, and the third color block corresponding to the third pixel; the consistency identifier of the third pixel is determined based on the color consistency of multiple sampling points corresponding to the third pixel, and the third color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area.

[0122] The third correspondence can be the first correspondence obtained according to the image data storage method described above. The third pixel can be one or more pixels that need to be read from memory; the third pixel can be one or more first pixels.

[0123] Here, the implementation of step 901 is similar to that of step 701 above. When implementing it, you can refer to the specific implementation of step 701 above, as well as the detailed description in steps 801 to 802 corresponding to step 701.

[0124] Specifically, step 901 can be implemented as follows: using the coordinates of the third pixel as the matching basis, obtain the identifier block corresponding to the third pixel from the third correspondence; and determine the consistency identifier of the third pixel from the identifier block corresponding to the third pixel.

[0125] Step 902: Based on the coordinates of the third pixel and the third correspondence, determine the third color block and the third color storage position of the third pixel in the third color block.

[0126] The third color storage location can be the storage order of the color of the sampling point corresponding to the third pixel in the third color block, that is, the storage location of the color of the sampling point corresponding to the third pixel in the third color block.

[0127] Here, the implementation of step 902 is similar to that of step 702 above. When implementing it, you can refer to the specific implementation of step 702 above, as well as the detailed description in steps 803 to 805 corresponding to step 702.

[0128] Specifically, step 902 can be implemented as follows: using the coordinates of the third pixel as the matching basis, obtain the third color block corresponding to the third pixel from the third correspondence relationship; using the coordinates of the third pixel as the matching basis, obtain the storage position of the third color of the third pixel in the third color block from the third correspondence relationship.

[0129] Step 903: If the consistency identifier of the third pixel indicates that the colors of multiple sampling points corresponding to the third pixel are completely the same, read the color of the third color storage location in any color storage area of ​​the third color block and the coordinates of the multiple sampling points.

[0130] The color at the third color storage position in any color storage area of ​​the third color block can be the color of the sampling point corresponding to the third pixel.

[0131] Since each color storage area of ​​the third color block stores a sampling point corresponding to the third pixel, when the colors of multiple sampling points corresponding to the third pixel are exactly the same, the colors of the sampling points corresponding to the third pixel stored in each color storage area of ​​the third color block are the same. At this time, the colors of all sampling points corresponding to the third pixel can be represented by the colors of the sampling points corresponding to the third pixel stored in any color storage area and the consistency identifier of the third pixel.

[0132] In some implementations, when the consistency identifier of the third pixel indicates that the colors of multiple sampling points corresponding to the third pixel are not completely identical, the color at the third color storage position in all color storage areas of the third color block is read.

[0133] Read the color at the third color storage location in all color storage areas of the third color block. This can be done by reading the color of all sampling points corresponding to the third pixel.

[0134] In some embodiments, the image data reading method provided in this disclosure further includes the following steps 904 to 905: Step 904: If the consistency identifier of the third pixel indicates that the colors of the multiple sampling points corresponding to the third pixel are not completely the same, determine whether there are at least two sampling points with the same color among the multiple sampling points.

[0135] Step 905: If there are at least two sampling points with the same color among the multiple sampling points corresponding to the third pixel, read the color of any one of the at least two sampling points with the same color and the coordinates of the at least two sampling points from the third color block.

[0136] It should be noted that when the colors of multiple sampling points corresponding to the third pixel are not completely the same, but there are at least two sampling points with the same color, the color of any one of the at least two sampling points with the same color and the coordinates of the at least two sampling points are used to represent the at least two sampling points with the same color. In other words, by using the color of any one of the at least two sampling points with the same color and the coordinates of the at least two sampling points, the merged reading of at least two sampling points with the same color is achieved. Compared with directly reading the color of all sampling points, this reduces the transmission bandwidth during reading, improves the performance and resource utilization of computer equipment, and reduces the power consumption of computer equipment.

[0137] In this embodiment of the disclosure, when the colors of multiple sampling points corresponding to the third pixel are completely identical, only the color of the sampling point corresponding to the third pixel and the consistency identifier of the third pixel stored in any color storage area of ​​the third color block are read. Compared with reading the colors of multiple sampling points corresponding to the third pixel, the transmission bandwidth during reading is reduced to the greatest extent, the performance and resource utilization of the computer device are improved, and the power consumption of the computer device is reduced.

[0138] The following describes the application of the image data processing method provided in the embodiments of this disclosure in real-world scenarios.

[0139] This disclosure embodiment designs a flag buffer for storing consistency flags of pixels. For example... Figure 6 As shown, each bit in the identifier block means whether the colors of all sample points of its corresponding pixel are consistent; if they are inconsistent, the colors of all sample points are read; if they are consistent, only the color of the first sample point (i.e., sample point 0) is read.

[0140] In practical applications, given pixel coordinates (u, v), the corresponding identifier block can be read and written. Specifically, the formula for calculating the address of the 32B identifier block is: (v+15) / 16*(width+15) / 16*32+(u+15) / 16*32; the formula for calculating the bit offset (identifier storage location) in the 32B identifier block is: assuming the lower four bits of u are U3U2U1U0, and each Ui is either 0 or 1; assuming the lower four bits of v are V3V2V1V0, and each Vi is either 0 or 1; then, the bit offset is U3V3U2V2U1V1U0V0.

[0141] like Figure 5 As shown, in a 4x Multi-Sample Anti-Aliasing (4x MSAA) scene, "4x" means that each pixel generates 4 sampling points, and each sampling point occupies 4 bits of storage. Therefore, a color block can be divided into 4 color storage areas: 4×4 sampling point 0, 4×4 sampling point 1, 4×4 sampling point 2, and 4×4 sampling point 3, with each color storage area being 64 bytes in size.

[0142] In an 8x Multi-Sample Anti-Aliasing (8x MSAA) scene, "8x" means that each pixel generates 8 sampling points, and each sampling point occupies 8 bits of storage. Therefore, a color block can be divided into 8 color storage areas: 2×2 sampling point 0, 2×2 sampling point 1, 2×2 sampling point 2, 2×2 sampling point 3, 2×2 sampling point 4, 2×2 sampling point 5, 2×2 sampling point 6, and 2×2 sampling point 7, with each color storage area being 32 bytes in size.

[0143] In practical applications, given pixel coordinates (u,v) and the storage location of the sampling point (sample index(s)), the corresponding color block (color buffer) is read and written. Specifically, the formula for calculating the dimension of a 256B color block can be as follows: Assuming MSAA is N times, where N times means each pixel contains N sampling points and each sampling point is M bytes, the dimension I of the 256B color block is I = SQRT(256 / N / M), I^2 = 256 / N / M; then calculate the address of the 256B color block: (v+I-1) / I*(texture_width+I-1) / I*256+(u+I-1) / I*256; where (u,v) represents the pixel coordinates, I is the dimension of the color block, texture_width is the width of the color block, (v+I-1) / I*(texture_width+I-1) / I*256 represents the address offset of the current color block relative to the first block in the v direction (i.e., the row direction), and (u+I-1) / I*256 represents the address offset of the current color block relative to the first block of its row in the u direction (i.e., the column direction). Assume J = log2(I), and that the lower J bits of u are Uj-1Uj-2…U0, where each Ui is either 0 or 1; and that the lower J bits of v are Vj-1Vj-2…V0, where each Vi is either 0 or 1. The formula for calculating the bit offset of the sampling point in 256B can be: 256 / N*s + Uj-1Vj-1Uj-2Vj-2…U0V0*M.

[0144] based on Figure 5 The storage method of the color of the sample point corresponding to the pixel shown and Figure 6 The diagram illustrates the storage method for pixel consistency identifiers, and how to read and write the color of the sample point corresponding to the pixel. For example... Figure 10 and Figure 11 As shown, a shader is a program that runs on the Graphics Processing Unit (GPU) and performs various calculations during the graphics rendering process, such as vertex transformation, rasterization, and texture mapping. A shader thread is a single execution unit that performs these calculations. One execution unit in a shader can process one pixel and its four corresponding sample points. A texture writer is used to create, edit, or write image textures. A sample combiner is used to merge sample points of the same color. A texture compressor is used to reduce the size of the image texture while maintaining image quality as much as possible. A texture reader is used to read and parse the image texture.

[0145] See Figure 10 The specific process of applying the image data writing method provided in this embodiment to MSAA is as follows: 1. The software initializes the flag buffer to all zeros via GPU DMA.

[0146] 2. The texture writer collects the colors of all sample points on a color block (256B).

[0147] a) If all sampling points of a color block have the same color, the texture writer only needs to write the sub-block of sampling point 0, that is, only 1 / 2 to 1 / 8 of 256B needs to be written. For example, if a marker block corresponds to 4*4 pixels, then only 1 / 4 of 256B needs to be written; if a marker block corresponds to 2*2 pixels, then only 1 / 8 of 256B needs to be written.

[0148] b. If two or more sampling points have inconsistent colors, the texture writer needs to write out the sub-blocks of all sampling points, and set the bit corresponding to the identifier block to 1.

[0149] c. After processing the 16x16 pixel color block, the identifier block is completed into 32 bytes, which can be written out.

[0150] 3. The sample color buffer is treated as a normal non-MSAA texture and written out after being processed by the texture compressor.

[0151] 4. The identifier block is written directly without any compression, because 1 bit of consistency identifier is already a very high compression rate, and a cache-resident strategy can be used for reading and writing consistency identifier, so that it is cached most of the time.

[0152] See Figure 11 The specific process of the image data reading method provided in this embodiment of the present disclosure when applied to MSAA is as follows: 1. When the MSAA texture is completely written to memory, after a certain period of time, the GPU will need to read it again and use it. The texture reader will calculate the storage address of the consistency identifier of the pixel in the identifier block according to the pixel coordinates and the conversion relationship between the identifier block and the pixel coordinates provided by the renderer, read the 32B identifier block, and cache the read identifier block inside the texture reader.

[0153] 2. If the consistency identifier bit of the required pixel is 0, the texture reader only needs to read the sub-block of sample point 0 of the color block (256B).

[0154] a) In this case, only one sample color and one sample bit mask need to be returned to the renderer. The sample bit mask is used to indicate multiple sample points corresponding to a pixel, for example: sample color + full set bit mask (0xf / 0xff / etc). Among them, 0xf is used to indicate that a pixel corresponds to 4 sample points; 0xff is used to indicate that a pixel corresponds to 8 sample points; and the full set bit mask is used to indicate all sample points corresponding to a pixel.

[0155] 3. If the consistency flag bit of the required pixel is 1, the texture reader needs to read the entire color block (256B).

[0156] a) In this case, the texture reader can merge the colors of identical sample points and add the corresponding sample bit mask. For example, if sample point 0 and sample point 1 have the same color, then it returns the color of a sample point plus bit mask 0b11 (used to indicate that sample point 0 and sample point 1 have the same color).

[0157] It should be noted that a cache-resident strategy can be adopted for reading and writing consistency identifiers, ensuring that they spend most of their time in the cache. When writing, the user can set the write priority; when reading, the cache's internal mechanism can determine the read priority. For example, to ensure read efficiency, the initial read priority can be set to the highest, and if there are no read operations for a period of time, the read priority can be reduced to the lowest to remove the read operation from the cache.

[0158] The difference between the sampling point color storage format and related technologies is as follows: 1. A consistency identifier storage area (flag buffer) is added; 2. Previously, the colors of multiple sampling points of the same pixel were stored together, that is, grouped by pixel. However, in this embodiment, sampling points corresponding to different pixels are stored together (e.g., for 4*4, 4 sampling points 1 are stored together, 4 sampling points 2 are stored together, 4 sampling points 3 are stored together, and 4 sampling points 4 are stored together), that is, grouped by sampling point.

[0159] Let's take a 1080p, 4xMSAA, 4B per sample MSAA texture as an example. Here, 1080p refers to the resolution, which is 1920x1080 pixels, meaning 1920 pixels horizontally and 1080 pixels vertically. 4xMSAA: This indicates that each pixel has 4 sampling points, used for anti-aliasing. 4B per sample MSAA texture: Each sampling point in an MSAA texture occupies 4 bytes.

[0160] a. The color block is 4x4 pixels * 4 sampling points * 4B.

[0161] b. The width of the color block is 1920 / 4 = 480 blocks, and the height of the color block is 1080 / 4 = 270 blocks.

[0162] c. The width of the marker block is 1920 / 16=120 blocks, and the height of the marker block is (1080+15) / 16=68 blocks.

[0163] d. The texture writer will collect 4x4 pixels = 256B color blocks and write them out together.

[0164] e. If all sample points of all pixels within a 4x4 area have the same color, write only the sample point of the 4x4 pixel = 64B.

[0165] f. If more than two sampling points of all pixels within a 4x4 area have inconsistent colors, write down all sampling points of the 4x4 pixel: 0 / 1 / 2 / 3 = 256B.

[0166] g. Simultaneously, set half of the 8x4 storage area corresponding to the consistency identifier of the 4x4 pixel block to 1.

[0167] h. After processing 16 4x4 pixel blocks, the storage area for the consistency identifier is formed into a 16x16 identifier block, which can be written out together.

[0168] Taking 1080p, 4xMSAA, 4B per sample MSAA texture reading as an example.

[0169] a. If the renderer provides pixel coordinates (2,2), I want to read the colors of all 4 sample points at pixel coordinates (2,2).

[0170] b. The identifier block corresponding to pixel coordinate (2,2) is the (2 / 16,2 / 16) = (0,0)th 32B.

[0171] c. The bit position of the consistency identifier corresponding to pixel coordinate (2,2) is bit 12 in 32B or 256bit.

[0172] d, 4xMSAA, 4B per sample MSAA texture, the corresponding color block size is 4x4.

[0173] e. The color block corresponding to pixel coordinate (2,2) is the (2 / 4,2 / 4) = (0,0)th 256B.

[0174] f. If the consistency flag bit is 1, all 4x4x4 samples (256B) need to be read.

[0175] g. Obtain the 12th sampling point from each 4x4sample 64B.

[0176] h. Each time, return all identical sample points and their corresponding sample point identifiers to the renderer, up to four times and at least two times.

[0177] i. If the consistency flag bit is 0, the first 4x4 sample point (64B) needs to be read.

[0178] j. Returns the color of sample point 0 and the sample point bit mask (0xf) to the renderer.

[0179] It should be noted that, in this embodiment, the sampling point identifier of any pixel and the color of any sampling point (color + mask) are used instead of the form of color being copied four times; furthermore, a concise consistency identifier and a storage area for the sample point color that has been compressed twice are used. This saves internal and external transmission bandwidth of the GPU, reduces the computational load of the renderer threads, improves device performance, and reduces device power consumption.

[0180] Based on the foregoing embodiments, this disclosure provides an image data storage device, which includes the included units and the modules included in each unit, which can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0181] Figure 12 This is a schematic diagram of the composition structure of an image data storage device provided in an embodiment of the present disclosure, such as... Figure 12 As shown, the image data storage device 1200 includes: an acquisition module 1210, a first processing module 1220, and a storage module 1230, wherein: The module 1210 is configured to obtain the colors of multiple sampling points corresponding to the first pixel to be processed; The first processing module 1220 is configured to determine the consistency identifier of the first pixel based on the color consistency of multiple sampling points corresponding to the first pixel. Storage module 1230 is configured to store the colors of sampling points with the same sampling point identifier corresponding to different first pixels in the same color storage area based on multiple sampling point identifiers corresponding to each first pixel, thereby obtaining a first color block; different first pixels correspond to the same sampling point identifier generation method; The first processing module 1220 is further configured to establish a correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block to obtain a first correspondence.

[0182] In some embodiments, the storage module 1230 is further configured to: set the consistency identifier of the first pixel to a first identifier when the colors of multiple sampling points corresponding to the first pixel are completely the same; and set the consistency identifier of the first pixel to a second identifier when the colors of multiple sampling points corresponding to the first pixel are not completely the same.

[0183] In some embodiments, the storage module 1230 is further configured to: determine the number N of pixels corresponding to a single color storage area; N is a positive integer; based on multiple sampling point identifiers corresponding to each first pixel, store the colors of sampling points with the same sampling point identifier corresponding to N first pixels in the same color storage area to obtain a first color block corresponding to each N first pixels.

[0184] In some embodiments, the storage module 1230 is further configured to: determine a first color storage location for each N first pixels based on the coordinates of each N first pixels; and, based on multiple sampling point identifiers corresponding to each first pixel, store the colors of sampling points with the same sampling point identifier corresponding to each N first pixels in the same color storage area according to the first color storage location, thereby obtaining a first color block corresponding to each N first pixels.

[0185] In some embodiments, the storage module 1230 is further configured to: determine the color of a sampling point identified as i for every N first pixels based on a plurality of sampling point identifiers corresponding to each first pixel; i is a positive integer; store the colors of the sampling points identified as i for every N first pixels in the i-th color storage area according to the first color storage location; determine the color of a sampling point identified as i+1 for every N first pixels based on a plurality of sampling point identifiers corresponding to each first pixel; store the colors of the sampling points identified as i+1 for every N first pixels in the (i+1)-th color storage area according to the first color storage location; and determine a first color block corresponding to every N first pixels based on the i-th color storage area and the (i+1)-th color storage area.

[0186] In some embodiments, the storage module 1230 is further configured to: determine the number M of pixels corresponding to a single identifier block; M is a positive integer; determine a first identifier storage location for each M first pixels based on the coordinates of each M first pixels; and store the consistency identifiers of each M first pixels in the same storage area according to the first identifier storage location to obtain a first identifier block.

[0187] Based on the foregoing embodiments, this disclosure provides an image data writing device, which includes various units and modules included in each unit. It can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0188] Figure 13 This is a schematic diagram of the composition structure of an image data writing device provided in an embodiment of the present disclosure, such as... Figure 13 As shown, the image data writing device 1300 includes: a second processing module 1310 and a writing module 1320, wherein: The second processing module 1310 is configured to determine the consistency identifier of the second pixel based on the coordinates of the second pixel to be written and the second correspondence; the second correspondence represents the correspondence between the coordinates of the second pixel, the consistency identifier of the second pixel, and the second color block corresponding to the second pixel; the consistency identifier of the second pixel is determined based on the color consistency of multiple sampling points corresponding to the second pixel, and the second color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area; The second processing module 1310 is further configured to determine the second color block and the second color storage position of the second pixel in the second color block based on the coordinates of the second pixel and the second correspondence. The write-out module 1320 is configured to write out the consistency identifier of the second pixel and the color at the second color storage position in any color storage area of ​​the second color block when the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are completely the same.

[0189] In some embodiments, the write-out module 1320 is further configured to: compress the colors of all sampling points in the second color block when the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are not completely the same, to obtain the compressed color; and write out the consistency identifier of the second pixel and the compressed color.

[0190] In some embodiments, the second processing module 1310 is further configured to: determine a first sub-correspondence between pixel coordinates and an identifier block, and a second sub-correspondence between pixel coordinates and an identifier storage location, from the second correspondence; and determine a consistency identifier of the second pixel based on the first sub-correspondence, the second sub-correspondence, and the coordinates of the second pixel.

[0191] In some embodiments, the second processing module 1310 is further configured to: determine a second identifier block corresponding to the second pixel based on the first sub-correspondence and the coordinates of the second pixel; determine a second identifier storage location of the second pixel in the second identifier block based on the second sub-correspondence and the coordinates of the second pixel; and determine a consistency identifier of the second pixel based on the second identifier block and the second identifier storage location.

[0192] In some embodiments, the second processing module 1310 is further configured to: determine a third sub-correspondence between pixel coordinates and color blocks, and a fourth sub-correspondence between pixel coordinates and color storage locations from the second correspondence; determine a second color block corresponding to the second pixel based on the third sub-correspondence and the coordinates of the second pixel; and determine the second color storage location based on the fourth sub-correspondence and the coordinates of the second pixel.

[0193] In some embodiments, the write module 1320 is further configured to: add the consistency identifier of each second pixel to the target identifier block before writing; and write the target identifier block if the target identifier block already contains a first preset number of consistency identifiers of the second pixels.

[0194] In some embodiments, the write-out module 1320 is further configured to: before writing out, add the color of the sampling point to be written out for each second pixel to the target color block; and write out the target color block when the target color block already contains the colors of the sampling points corresponding to each of the second pixels in a second preset number.

[0195] Based on the foregoing embodiments, this disclosure provides an image data reading device, which includes various units and modules included in each unit. It can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0196] Figure 14 This is a schematic diagram of the composition structure of an image data reading device provided in an embodiment of this disclosure, as shown below. Figure 14 As shown, the image data reading device 1400 includes: a third processing module 1410 and a reading module 1420, wherein: The third processing module 1410 is configured to determine the consistency identifier of the third pixel based on the coordinates of the third pixel to be read and the third correspondence relationship; the third correspondence relationship represents the correspondence between the coordinates of the third pixel, the consistency identifier of the third pixel, and the third color block corresponding to the third pixel; the consistency identifier of the third pixel is determined based on the color consistency of multiple sampling points corresponding to the third pixel, and the third color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area; The third processing module 1410 is further configured to determine the third color block and the third color storage position of the third pixel in the third color block based on the coordinates of the third pixel and the third correspondence. The reading module 1420 is configured to read the color at the third color storage location and the coordinates of the multiple sampling points in any color storage area of ​​the third color block when the consistency identifier of the third pixel indicates that the colors of the multiple sampling points corresponding to the third pixel are completely the same.

[0197] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided in this disclosure can be used to perform the methods described in the method embodiments above. For technical details not disclosed in the apparatus embodiments of this disclosure, please refer to the descriptions of the method embodiments of this disclosure for understanding.

[0198] It should be noted that, in the embodiments of this disclosure, if the above methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this disclosure, or the parts that contribute to related technologies, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this disclosure are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.

[0199] This disclosure provides a computer device including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method.

[0200] This disclosure provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium may be transient or non-transient.

[0201] This disclosure provides a computer program including computer-readable code, wherein when the computer-readable code is executed in a computer device, a processor in the computer device performs some or all of the steps in the above-described method.

[0202] This disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0203] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referenced interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this disclosure, please refer to the descriptions of the method embodiments of this disclosure for understanding.

[0204] It should be noted that, Figure 15 This is a schematic diagram of a hardware entity of a computer device in an embodiment of this disclosure, such as... Figure 15 As shown, the hardware entity of the computer device 1500 includes: a processor 1501, a communication interface 1502, and a memory 1503, wherein: Processor 1501 typically controls the overall operation of computer device 1500.

[0205] Communication interface 1502 enables computer devices to communicate with other terminals or servers via a network.

[0206] The memory 1503 is configured to store instructions and applications executable by the processor 1501, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data, and video communication data) in the processor 1501 and various modules in the computer device 1500. It can be implemented using flash memory or random access memory (RAM). Data transfer between the processor 1501, the communication interface 1502, and the memory 1503 can be performed via bus 1504.

[0207] It should be understood that the phrase "an embodiment" or "one embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this disclosure. Therefore, "in one embodiment" or "one embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this disclosure, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure. The sequence numbers of the above embodiments of this disclosure are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0208] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0209] In the several embodiments provided in this disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0210] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0211] In addition, each functional unit in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0212] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0213] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.

[0214] The above description is merely an embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An image data storage method, characterized in that, The image data storage method includes: Obtain the colors of multiple sampling points corresponding to the first pixel to be processed; Based on the color consistency of multiple sampling points corresponding to the first pixel, the consistency identifier of the first pixel is determined; Based on multiple sampling point identifiers corresponding to each first pixel, the colors of sampling points with the same sampling point identifier corresponding to different first pixels are stored in the same color storage area to obtain a first color block; different first pixels correspond to the same sampling point identifier generation method; Establish the correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block to obtain the first correspondence.

2. The image data storage method according to claim 1, characterized in that, The step of determining the consistency identifier of the first pixel based on the color consistency of multiple sampling points corresponding to the first pixel includes: If the colors of multiple sampling points corresponding to the first pixel are exactly the same, the consistency flag of the first pixel is set as the first flag; If the colors of multiple sampling points corresponding to the first pixel are not completely the same, the consistency flag of the first pixel is set as the second flag.

3. The image data storage method according to claim 1, characterized in that, The step of storing the colors of sampling points with the same sampling point identifier corresponding to different first pixels in the same color storage area based on multiple sampling point identifiers corresponding to each first pixel to obtain a first color block includes: Determine the number N of pixels corresponding to a single color storage region; N is a positive integer. Based on the multiple sampling point identifiers corresponding to each first pixel, the colors of the sampling points with the same sampling point identifier corresponding to each N first pixels are stored in the same color storage area to obtain the first color block corresponding to each N first pixels.

4. The image data storage method according to claim 3, characterized in that, The step of storing the colors of sampling points with the same sampling point identifier corresponding to N first pixels in the same color storage area based on multiple sampling point identifiers corresponding to each first pixel to obtain a first color block corresponding to each N first pixels includes: Based on the coordinates of every N first pixels, determine the storage location of the first color for every N first pixels; Based on the multiple sampling point identifiers corresponding to each first pixel, according to the first color storage location, the colors of the sampling points with the same sampling point identifier corresponding to every N first pixels are stored in the same color storage area to obtain the first color block corresponding to every N first pixels.

5. The image data storage method according to claim 4, characterized in that, The step of storing the colors of sampling points with the same sampling point identifier corresponding to every N first pixels in the same color storage area according to the first color storage location, based on multiple sampling point identifiers corresponding to each first pixel, to obtain a first color block corresponding to every N first pixels, includes: Based on the multiple sampling point identifiers corresponding to each first pixel, determine the color of the sampling point with sampling point identifier i corresponding to every N first pixels; i is a positive integer. According to the first color storage location, the colors of the sampling points marked as i corresponding to every N first pixels are sequentially stored in the i-th color storage area; Based on the multiple sampling point identifiers corresponding to each first pixel, determine the color of the sampling point with sampling point identifier i+1 corresponding to each N first pixels; According to the first color storage location, the color of the sampling point marked as i+1 corresponding to every N first pixels is stored sequentially in the (i+1)th color storage area. Based on the i-th color storage region and the (i+1)-th color storage region, determine the first color block corresponding to each N first pixels.

6. The image data storage method according to any one of claims 1 to 5, characterized in that, The image data storage method further includes: Determine the number M of pixels corresponding to a single identifier block; M is a positive integer; Based on the coordinates of each M first pixels, determine the first identifier storage location for each M first pixels; According to the first identifier storage location, the consistency identifiers of every M first pixels are stored in the same storage area to obtain the first identifier block.

7. A method for writing image data, characterized in that, The image data writing method includes: Based on the coordinates of the second pixel to be written and the second correspondence, the consistency identifier of the second pixel is determined; the second correspondence represents the correspondence between the coordinates of the second pixel, the consistency identifier of the second pixel, and the second color block corresponding to the second pixel; the consistency identifier of the second pixel is determined based on the color consistency of multiple sampling points corresponding to the second pixel, and the second color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area. Based on the coordinates of the second pixel and the second correspondence, the second color block and the second color storage position of the second pixel in the second color block are determined; If the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are completely the same, write out the consistency identifier of the second pixel and the color in the second color storage position in any color storage area of ​​the second color block.

8. The image data writing method according to claim 7, characterized in that, The image data writing method further includes: When the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are not completely the same, the colors of all sampling points in the second color block are compressed to obtain the compressed color. Write down the consistency identifier of the second pixel and the compressed color.

9. The image data writing method according to claim 7 or 8, characterized in that, The step of determining the consistency identifier of the second pixel based on the coordinates of the second pixel to be written and the second correspondence includes: From the second correspondence, determine the first sub-correspondence between pixel coordinates and identifier blocks, and the second sub-correspondence between pixel coordinates and identifier storage locations; Based on the first sub-correspondence, the second sub-correspondence, and the coordinates of the second pixel, the consistency identifier of the second pixel is determined.

10. The image data writing method according to claim 9, characterized in that, The step of determining the consistency identifier of the second pixel based on the first sub-correspondence, the second sub-correspondence, and the coordinates of the second pixel includes: Based on the first sub-correspondence relationship and the coordinates of the second pixel, the second identifier block corresponding to the second pixel is determined; Based on the second sub-correspondence and the coordinates of the second pixel, determine the second identifier storage location of the second pixel in the second identifier block; Based on the second identifier block and the second identifier storage location, the consistency identifier of the second pixel is determined.

11. The image data writing method according to claim 7 or 8, characterized in that, The step of determining the second color block and the second color storage location of the second pixel within the second color block based on the coordinates of the second pixel and the second correspondence includes: From the second correspondence, determine the third sub-correspondence between pixel coordinates and color blocks, and the fourth sub-correspondence between pixel coordinates and color storage locations; Based on the third sub-correspondence and the coordinates of the second pixel, the second color block corresponding to the second pixel is determined; Based on the fourth sub-correspondence and the coordinates of the second pixel, the storage location of the second color is determined.

12. The image data writing method according to claim 7, 8, or 10, characterized in that, The image data writing method further includes: Before writing, add the consistency flag of each second pixel to the target flag block; If the target identifier block already contains a first preset number of consistency identifiers for the second pixel, then write out the target identifier block.

13. The image data writing method according to any one of claims 7 to 11, characterized in that, The image data writing method further includes: Before writing, add the color of each sampling point of the second pixel to be written to the target color block; If the target color block already contains the colors of the sampling points corresponding to the second pixel of a second preset number, then write out the target color block.

14. A method for reading image data, characterized in that, The image data reading method includes: Based on the coordinates of the third pixel to be read and the third correspondence, the consistency identifier of the third pixel is determined; the third correspondence represents the correspondence between the coordinates of the third pixel, the consistency identifier of the third pixel, and the third color block corresponding to the third pixel; the consistency identifier of the third pixel is determined based on the color consistency of multiple sampling points corresponding to the third pixel, and the third color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area. Based on the coordinates of the third pixel and the third correspondence, the third color block and the third color storage position of the third pixel in the third color block are determined; When the consistency identifier of the third pixel indicates that the colors of multiple sampling points corresponding to the third pixel are completely the same, the color of the third color storage location in any color storage area of ​​the third color block and the coordinates of the multiple sampling points are read.

15. The image data reading method according to claim 14, characterized in that, The image data reading method further includes: If the consistency identifier of the third pixel indicates that the colors of multiple sampling points corresponding to the third pixel are not completely the same, determine whether there are at least two sampling points with the same color among the multiple sampling points; If at least two sampling points of the same color exist among the multiple sampling points corresponding to the third pixel, the color of any one of the at least two sampling points of the same color and the coordinates of the at least two sampling points are read from the third color block.

16. An image data storage device, characterized in that, The image data storage device includes: The module is configured to obtain the colors of multiple sampling points corresponding to the first pixel to be processed. The first processing module is configured to determine the consistency identifier of the first pixel based on the color consistency of multiple sampling points corresponding to the first pixel. The storage module is configured to store the colors of sampling points with the same sampling point identifier corresponding to different first pixels in the same color storage area based on multiple sampling point identifiers corresponding to each first pixel, thereby obtaining a first color block; different first pixels correspond to the same sampling point identifier generation method; The first processing module is further configured to establish a correspondence between the coordinates of the first pixel, the consistency identifier of the first pixel, and the first color block to obtain a first correspondence.

17. An image data writing device, characterized in that, The image data writing device includes: The second processing module is configured to determine the consistency identifier of the second pixel based on the coordinates of the second pixel to be written and the second correspondence; the second correspondence represents the correspondence between the coordinates of the second pixel, the consistency identifier of the second pixel, and the second color block corresponding to the second pixel; the consistency identifier of the second pixel is determined based on the color consistency of multiple sampling points corresponding to the second pixel, and the second color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area. The second processing module is further configured to determine the second color block and the second color storage position of the second pixel in the second color block based on the coordinates of the second pixel and the second correspondence. The write module is configured to write out the consistency identifier of the second pixel and the color at the second color storage position in any color storage area of ​​the second color block when the consistency identifier of the second pixel indicates that the colors of multiple sampling points corresponding to the second pixel are completely the same.

18. An image data reading device, characterized in that, The image data reading device includes: The third processing module is configured to determine the consistency identifier of the third pixel based on the coordinates of the third pixel to be read and the third correspondence relationship; the third correspondence relationship represents the correspondence between the coordinates of the third pixel, the consistency identifier of the third pixel, and the third color block corresponding to the third pixel; the consistency identifier of the third pixel is determined based on the color consistency of multiple sampling points corresponding to the third pixel, and the third color block includes the colors of sampling points corresponding to multiple different pixels, and the colors of sampling points with the same sampling point identifier corresponding to different pixels are stored in the same color storage area; The third processing module is further configured to determine the third color block and the third color storage position of the third pixel in the third color block based on the coordinates of the third pixel and the third correspondence. The reading module is configured to read the color at the third color storage location and the coordinates of the multiple sampling points in any color storage area of ​​the third color block when the consistency identifier of the third pixel indicates that the colors of the multiple sampling points corresponding to the third pixel are completely the same.

19. A computer device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 6, or claims 7 to 13, or claims 14 to 15.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program performs the steps of the method as described in any one of claims 1 to 6, or claims 7 to 13, or claims 14 to 15.

Citation Information

Patent Citations

  • Three-dimensional reconstruction method and device, equipment and storage medium

    CN117934728A

  • Pixel cutting method and device, equipment, storage medium and computer program product

    CN119151953A

  • Color interpolation algorithm

    CN1812595A

  • Methods And Apparatuses For Generating Compressed Data Representing A Visual Frame

    US20070263009A1

  • Rendering scalable raster content

    US20230082839A1