Data compression method and device, electronic equipment and storage medium

CN120201187APending Publication Date: 2025-06-24BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510265865.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-24

Smart Images

  • Figure CN120201187A_ABST
    Figure CN120201187A_ABST
Patent Text Reader

Abstract

The invention provides a data compression method and device, electronic equipment and a storage medium, and relates to the technical field of data compression. Comprising the steps of clustering pixel points in a target area based on brightness correction data corresponding to each pixel point in the target area to obtain at least one target cluster, determining brightness correction data corresponding to reference pixel points set in each target cluster, and compressing the brightness correction data corresponding to each reference pixel point to obtain a compressed brightness correction data corresponding to each reference pixel point; and determining first compressed data corresponding to each target cluster, and determining target compressed data corresponding to the target region according to the target cluster to which each pixel point belongs and the first compressed data corresponding to each target cluster. Therefore, after clustering compression is carried out on the brightness correction data of the target area, the brightness correction data corresponding to the reference pixel points of each target cluster can be further compressed, so that the code length of the compressed data corresponding to the brightness correction data is further reduced, and the compression rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data compression technologies, and in particular, to a data compression method, apparatus, electronic device, and storage medium. Background Art

[0002] Due to the limitations of the manufacturing process, organic light-emitting diode (OLED) screens are prone to the problem of uneven brightness of the display panel. Therefore, before the screen leaves the factory, the brightness correction data corresponding to each pixel point in the screen, such as the Demura compensation value, is usually determined. Then, when the screen displays an image, pixel-level brightness correction is performed on the image to be displayed through the brightness correction data. However, the amount of pixel-level brightness correction data is extremely large and usually needs to be compressed.

[0003] Therefore, how to compress the brightness correction data has become a key research direction. Summary of the Invention

[0004] The present disclosure aims to at least solve one of the technical problems in the related art to some extent.

[0005] A first aspect embodiment of the present disclosure provides a data compression method, including:

[0006] Clustering the pixel points in the target area based on the brightness correction data corresponding to each pixel point in the target area to obtain at least one target clustering cluster;

[0007] Determining the brightness correction data corresponding to the set reference pixel points in each of the target clustering clusters;

[0008] Compressing the brightness correction data corresponding to each of the reference pixel points to determine the first compression data corresponding to each of the target clustering clusters;

[0009] Determining the target compression data corresponding to the target area according to the target clustering cluster to which each pixel point belongs and the first compression data corresponding to each of the target clustering clusters.

[0010] A second aspect embodiment of the present disclosure provides a data compression apparatus, including:

[0011] A clustering module, configured to cluster the pixel points in the target area based on the brightness correction data corresponding to each pixel point in the target area to obtain at least one target clustering cluster;

[0012] A first determination module, configured to determine the brightness correction data corresponding to the set reference pixel points in each of the target clustering clusters;

[0013] A second determination module, configured to compress the brightness correction data corresponding to each of the reference pixel points, and determine first compressed data corresponding to each of the target clustering clusters;

[0014] A third determination module, configured to determine target compressed data corresponding to the target region according to the target clustering cluster to which each pixel point belongs and the first compressed data corresponding to each target clustering cluster.

[0015] An embodiment of the third aspect of the present disclosure provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the data compression method proposed in the embodiment of the first aspect of the present disclosure is implemented.

[0016] An embodiment of the fourth aspect of the present disclosure provides a computer-readable storage medium, storing a computer program, which when executed by a processor, implements the data compression method proposed in the embodiment of the first aspect of the present disclosure.

[0017] An embodiment of the fifth aspect of the present disclosure provides a computer program product, including a computer program, which when executed by a processor, implements the data compression method proposed in the embodiment of the first aspect of the present disclosure.

[0018] An embodiment of the sixth aspect of the present disclosure provides a chip, including a processing unit and an interface circuit. The processing unit obtains program instructions through the interface circuit, and the program instructions are executed by the processing unit. The processing unit is configured to execute the data compression method proposed in the embodiment of the first aspect of the present disclosure.

[0019] The data compression method, device, electronic device, and storage medium provided by the present disclosure have the following beneficial effects:

[0020] In the embodiment of the present disclosure, based on the brightness correction data corresponding to each pixel point in the target region, the pixel points in the target region are clustered to obtain at least one target clustering cluster, the brightness correction data corresponding to the set reference pixel points in each target clustering cluster is determined, the brightness correction data corresponding to each reference pixel point is compressed, the first compressed data corresponding to each target clustering cluster is determined, and the target compressed data corresponding to the target region is determined according to the target clustering cluster to which each pixel point belongs and the first compressed data corresponding to each target clustering cluster. Thus, after clustering and compressing the brightness correction data of the target region, the brightness correction data corresponding to the reference pixel points of each target clustering cluster can be further compressed, thereby further reducing the code length of the compressed data corresponding to the brightness correction data and improving the compression ratio.

[0021] Additional aspects and advantages of the present disclosure will be given in part in the following description, become apparent in part from the following description, or be learned by practice of the present disclosure. Description of the Drawings

[0022] The above and / or additional aspects and advantages of the present disclosure will become apparent and be readily understood from the following description of embodiments in conjunction with the drawings, where:

[0023] Figure 1 is a schematic flowchart of a data compression method provided by an embodiment of the present disclosure;

[0024] Figure 2 is a schematic flowchart of a data compression method provided by another embodiment of the present disclosure;

[0025] Figure 3 is a schematic flowchart of a data compression method provided by another embodiment of the present disclosure;

[0026] Figure 4 is a schematic structural diagram of a data compression device provided by another embodiment of the present disclosure;

[0027] Figure 5 shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure;

[0028] Figure 6 is a schematic structural diagram of a chip proposed by an embodiment of the present disclosure. Detailed Embodiments

[0029] Some embodiments of the present disclosure will be described in detail herein, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Various changes, modifications, and equivalents of the methods, apparatuses, and / or systems described herein will become apparent after understanding the present disclosure. For example, the order of operations described herein is merely exemplary and is not limited to those set forth herein, but may be changed as will be apparent after understanding the present disclosure, except for operations that must be performed in a specific order. Additionally, descriptions of features known in the art may be omitted for the sake of clarity and conciseness.

[0030] The embodiments described in some embodiments of the present disclosure below do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0031] The data compression method, apparatus, electronic device, and storage medium according to embodiments of the present disclosure will be described below with reference to the drawings.

[0032] Figure 1 A flowchart of a data compression method provided by an embodiment of the present disclosure.

[0033] In the embodiments of the present disclosure, the data compression method is configured in a data compression device for illustration. The data compression device can be applied to any electronic device or chip so that the electronic device or chip can perform the data compression function.

[0034] As Figure 1 shown, the data compression method may include the following steps:

[0035] Step 101: Cluster the pixel points in the target area based on the brightness correction data corresponding to each pixel point in the target area to obtain at least one target cluster.

[0036] In some embodiments, the screen can be evenly divided into multiple regions of the same size. The target area is any one of them.

[0037] In some embodiments, the brightness correction data corresponding to each pixel point may include the correction data corresponding to any color (for example, red, green, or blue). It should be noted that the logic for compressing the correction data for each color is the same. Therefore, in the present disclosure, the compression data corresponding to any color is described in detail. For example, the brightness correction data corresponding to each blue pixel point.

[0038] Among them, the brightness correction data corresponding to each pixel point can be one or multiple. When the brightness correction data corresponding to each pixel point is multiple, the brightness correction data includes sub-correction data corresponding to each preset gray level. When performing brightness correction, the correction data within the full gray level range can be obtained through interpolation fitting based on the sub-correction data corresponding to multiple preset gray levels. Thereby, the accuracy of brightness correction can be improved.

[0039] Among them, the preset gray levels can be 0, 16, 32, 64, 128, 255, etc. The present disclosure does not limit the number of preset gray levels and the gray scale values corresponding to each preset gray level.

[0040] In some embodiments, when the brightness correction data includes sub-correction data corresponding to each preset gray level, cluster the pixel points in the target area according to the clustering threshold corresponding to each preset gray level and the sub-correction data corresponding to each pixel point at each preset gray level to obtain at least one target cluster.

[0041] Among them, the clustering thresholds corresponding to each preset gray level can be the same or different. The present disclosure does not limit this.

[0042] In some embodiments, all pixel points in the target area can be clustered based on the K-means clustering algorithm, clustering algorithms, etc., to obtain at least one target clustering cluster. Among them, the brightness correction data corresponding to the pixel points in one target clustering cluster are similar. For example, the difference between the brightness correction data corresponding to each pixel point and the brightness correction data of the clustering center is less than the clustering threshold.

[0043] Step 102, determine the brightness correction data corresponding to the set reference pixel points in each target clustering cluster.

[0044] In some embodiments, the reference pixel point corresponding to the target clustering cluster can be the pixel point corresponding to the clustering center of the target clustering cluster.

[0045] In some embodiments, the clustering center corresponding to the target clustering cluster can be determined according to the brightness correction data corresponding to the pixel points in the target clustering cluster, and the pixel point corresponding to the clustering center can be determined as the set reference pixel point in the target clustering cluster.

[0046] In some embodiments, the median or average value corresponding to the brightness correction data in the target clustering cluster can be used to determine the pixel point corresponding to the median or average value as the clustering center. The present disclosure does not limit this.

[0047] It should be noted that the brightness correction data corresponding to each pixel point in the target clustering cluster are very similar. Therefore, any pixel point in the target clustering cluster can also be determined as the reference pixel point corresponding to the target clustering cluster.

[0048] Step 103, compress the brightness correction data corresponding to each reference pixel point to determine the first compression data corresponding to each target clustering cluster.

[0049] In some embodiments, a lossless compression method (such as Huffman coding, run-length coding, delta modulation coding, etc.) can be used to compress the brightness correction data corresponding to the reference pixel points. Alternatively, a lossy compression method (such as predictive coding, transform coding, etc.) can also be used to compress the brightness correction data corresponding to the reference pixel points. The present disclosure does not limit this.

[0050] Step 104, determine the target compression data corresponding to the target area according to the target clustering cluster to which each pixel point belongs and the first compression data corresponding to each target clustering cluster.

[0051] In some embodiments, the identifier corresponding to each pixel point and the target clustering cluster to which it belongs, and the identifier and the first compression data of each target clustering cluster can be determined as the target compression data corresponding to the target area.

[0052] In an embodiment of the present disclosure, based on the brightness correction data corresponding to each pixel point in the target area, the pixel points in the target area are clustered to obtain at least one target cluster. For the set reference pixel points in each target cluster, the corresponding brightness correction data is determined. The brightness correction data corresponding to each reference pixel point is compressed to determine the first compressed data corresponding to each target cluster. According to the target cluster to which each pixel point belongs and the first compressed data corresponding to each target cluster, the target compressed data corresponding to the target area is determined. Thus, after clustering and compressing the brightness correction data of the target area, the brightness correction data corresponding to the reference pixel points of each target cluster can be further compressed, thereby further reducing the code length of the compressed data corresponding to the brightness correction data and improving the compression ratio.

[0053] Figure 2 FIG. is a schematic flow chart of a data compression method provided by an embodiment of the present disclosure. As Figure 2 shown, the data compression method may include the following steps:

[0054] Step 201: Based on the brightness correction data corresponding to each pixel point in the target area, the pixel points in the target area are clustered to obtain at least one target cluster.

[0055] Among them, the brightness correction data includes sub-correction data corresponding to each preset gray level.

[0056] Step 202: Determine the brightness correction data corresponding to the set reference pixel points in each target cluster.

[0057] Among them, for the specific implementation forms of steps 201 to 202, reference may be made to the detailed descriptions in other embodiments of the present disclosure, and details are not described herein again.

[0058] Step 203: Based on each preset function and the sub-correction data corresponding to the reference pixel point at the i-th preset gray level, determine the predicted correction data corresponding to the (i + 1)-th preset gray level under each preset function.

[0059] In an embodiment of the present disclosure, the correlation between the sub-correction data of different preset gray levels can be used to reduce information redundancy, so as to compress the brightness correction data corresponding to the reference pixel points.

[0060] Among them, the i-th preset gray level is less than the (i + 1)-th preset gray level. For example, if the i-th preset gray level is 50, then the (i + 1)-th preset gray level needs to be greater than 50.

[0061] Among them, i takes positive integer values.

[0062] Among them, the number of preset functions may be one or more. The present disclosure does not limit this.

[0063] In some embodiments, the preset function may be determined according to the correlation between the preset gray levels. Wherein, the independent variable in the preset function is the sub-correction data corresponding to the i-th preset gray level, and the dependent variable is the sub-correction data corresponding to the (i + 1)-th preset gray level.

[0064] In some embodiments, according to the sub-correction data corresponding to each pixel point in the target screen at each preset gray level, the initial function corresponding to each pixel point in the target screen may be determined, the initial functions may be de-duplicated to obtain candidate functions, the number of pixel points corresponding to each candidate function in the target screen may be determined, and finally, according to the number of pixel points, the preset function may be determined from the candidate functions.

[0065] Wherein, the target screen is the screen where the target area is located.

[0066] Wherein, the initial function corresponding to each pixel point reflects the relationship between the sub-correction data corresponding to the i-th preset gray level corresponding to each pixel point and the sub-correction data corresponding to the (i + 1)-th preset gray level.

[0067] In some embodiments, the candidate functions may be sorted in descending order of the number of pixel points to obtain a function sequence, and then the first preset number of functions in the function sequence may be determined as the preset function.

[0068] For example, if there are 1000 pixels in the target screen, an initial function is determined for the brightness correction data corresponding to each pixel point, so there are 1000 initial functions in total. After de-duplicating the initial functions, 100 candidate functions are obtained. The 100 candidate functions are sorted in descending order of the number of pixel points to obtain a function sequence, and the first 5 candidate functions in the function sequence are determined as the preset functions.

[0069] Step 204, determine the difference between the sub-correction data corresponding to the reference pixel point at the (i + 1)-th preset gray level and the predicted correction data corresponding to each preset function.

[0070] It should be noted that there may be a difference between the predicted correction data corresponding to the (i + 1)-th preset gray level determined according to the preset function and the sub-correction data corresponding to the (i + 1)-th preset gray level. Therefore, it is necessary to further determine the difference between the sub-correction data corresponding to the (i + 1)-th preset gray level and the predicted correction data corresponding to each preset function.

[0071] Step 205, according to the sub-correction data corresponding to the reference pixel point at the first preset gray level and the differences corresponding to the other gray levels under each preset function, determine the second compression data corresponding to the target clustering cluster under each preset function, where the other gray levels are the other preset gray levels except the first preset gray level.

[0072] Among them, for the preset function 1, the sub-correction data corresponding to the first preset gray level, the difference value corresponding to the second preset gray level under the preset function 1, the difference value corresponding to the third preset gray level under the preset function 1, ……, the difference value corresponding to the nth preset gray level under the preset function 1 are determined as the second compression data corresponding to the target clustering cluster under the preset function 1. Among them, the value of n is the total number of preset gray levels.

[0073] Step 206: Determine the first compression data according to the second compression data corresponding to each preset function.

[0074] In some embodiments, the first compression data is determined according to the second compression data with the shortest code length and the preset function corresponding to the second compression data with the shortest code length.

[0075] In some embodiments, the second compression data with the shortest code length and the preset function corresponding to the second compression data with the shortest code length are determined as the first compression data.

[0076] Alternatively, the second compression data with the shortest code length and the identifier of the preset function corresponding to the second compression data with the shortest code length are determined as the first compression data. Thereby, the code length occupied by the preset function can be reduced, and while ensuring the compression quality, the compression ratio is reduced.

[0077] It should be noted that when compressing the brightness correction data of the target screen, each preset function and its corresponding identifier can be placed in front of the compression data of the target screen in advance, so that when decoding the compression data of the target screen, the preset function used for the first compression data can be determined according to the identifier in the first compression data corresponding to the target area, and then decoding can be performed.

[0078] In some embodiments, based on each preset compression method, the second compression data corresponding to each preset function is further compressed to determine the third compression data corresponding to each preset compression method and each preset function. According to the third compression data with the shortest code length, the preset compression method and the preset function corresponding to the third compression data with the shortest code length, the first compression data is determined. Thus, the second compression data can be further compressed, and the third compression data with the shortest code length is selected to generate the first compression data, thereby further reducing the code length of the first compression data.

[0079] Among them, each preset compression method can be one or multiple. The present disclosure does not make any limitation thereto.

[0080] In some embodiments, the preset compression method can be variable-length Golomb coding, fixed-length residual coding, etc. The present disclosure does not make any limitation thereto.

[0081] In some embodiments, the first compressed data is determined based on the third compressed data with the shortest code length, the corresponding preset compression method, and the preset function of the third compressed data with the shortest code length.

[0082] Alternatively, the third compressed data with the shortest code length, the identifier of the corresponding preset compression method, and the identifier of the preset function are determined as the first compressed data. Thus, using identifiers to represent the preset compression method and the preset function can further reduce the code length occupied by the preset function and the preset compression method, and while ensuring the compression quality, reduce the compression ratio.

[0083] It should be noted that when compressing the brightness correction data of the target screen, the preset functions and their corresponding identifiers, and the preset compression methods and their corresponding identifiers can be placed in front of the compressed data of the target screen in advance. Thus, when decoding the compressed data of the target screen, the preset function and the compression method used for the first compressed data can be determined according to the identifier in the first compressed data corresponding to the target area, and then decoding can be performed.

[0084] For example, there are 3 preset functions, namely preset function 1, preset function 2, and preset function 3; there are 2 preset compression methods, namely preset compression method 1 and preset compression method 2; the brightness correction data corresponding to the reference pixel points are determined, and the third compressed data corresponding to preset function 1 and preset compression method 1, the third compressed data corresponding to preset function 1 and preset compression method 2, the third compressed data corresponding to preset function 2 and preset compression method 1, the third compressed data corresponding to preset function 2 and preset compression method 2, the third compressed data corresponding to preset function 3 and preset compression method 1, and the third compressed data corresponding to preset function 3 and preset compression method 2. If the code length of the third compressed data corresponding to preset function 2 and preset compression method 2 is the shortest, then the first compressed data can be determined according to preset function 2, preset compression method 2, and the third compressed data corresponding to preset function 2 and preset compression method 2.

[0085] Step 207: Determine the target compressed data corresponding to the target area according to the target cluster to which each pixel point belongs and the first compressed data corresponding to each target cluster.

[0086] In the embodiments of the present disclosure, when the brightness correction data includes sub-correction data corresponding to each preset gray level, based on each preset function and the sub-correction data corresponding to the reference pixel at the i-th preset gray level, the predicted correction data corresponding to the (i + 1)-th preset gray level under each preset function is determined, the difference between the sub-correction data corresponding to the reference pixel at the (i + 1)-th preset gray level and the predicted correction data corresponding to each preset function is determined, and based on the sub-correction data corresponding to the reference pixel at the first preset gray level and the differences corresponding to the remaining gray levels under each preset function, the second compression data corresponding to the target cluster under each preset function is determined. Based on the second compression data corresponding to each preset function, the first compression data is determined. Finally, based on the target cluster to which each pixel belongs and the first compression data corresponding to each target cluster, the target compression data corresponding to the target area is determined. Thus, the correlation between the sub-correction data of different preset gray levels can be utilized to determine the preset function. Furthermore, based on the preset function, the predicted correction data is determined, and the difference between the predicted correction data and the sub-correction data is used as the compression data, thereby reducing information redundancy, further reducing the code length of the compression data without damaging the brightness correction data corresponding to the reference pixel, and improving the compression ratio.

[0087] Figure 3 is a schematic flowchart of a data compression method provided by an embodiment of the present disclosure; as Figure 3 shown, the data compression method may include the following steps:

[0088] Step 301: Cluster the pixels in the target area based on the brightness correction data corresponding to each pixel in the target area to obtain at least one target cluster.

[0089] Step 302: Determine the brightness correction data corresponding to the set reference pixel in each target cluster.

[0090] Among them, the specific implementation forms of steps 301 to 302 may refer to the detailed descriptions in other embodiments of the present disclosure and will not be specifically elaborated here.

[0091] Step 303: Match the brightness correction data corresponding to the reference pixel of the target cluster with the brightness correction data corresponding to the reference pixel of at least one reference cluster to obtain the matching result corresponding to each reference cluster.

[0092] In some embodiments, the reference cluster may be the cluster corresponding to the compressed area, and the compressed area and the target area belong to the target screen. Thus, when the matching result corresponding to any reference cluster is a successful match, the identifier corresponding to any reference cluster is determined as the first compression data corresponding to the target cluster, which can reduce the information redundancy between regions and improve the compression ratio.

[0093] Among them, the difference between the clustering threshold corresponding to the compressed area and the clustering threshold corresponding to the target area is less than the first value, thereby ensuring the uniformity of damage to the brightness correction data and further ensuring the uniformity of the screen brightness.

[0094] In some embodiments, when the difference between the sub-correction data corresponding to each preset gray level is less than or equal to the difference threshold, it is determined that the matching result is a successful match.

[0095] Among them, the difference between the sub-correction data is the difference between the sub-correction data corresponding to the reference pixel point of the target clustering cluster and the reference pixel point of the reference clustering cluster at the preset gray level.

[0096] For example, if the reference pixel point of the target clustering cluster is pixel point 1 and the reference pixel point of the reference clustering cluster is pixel point 2, the difference between the sub-correction data corresponding to pixel point 1 and the sub-correction data corresponding to pixel point 2 is determined as the difference between the sub-correction data.

[0097] Among them, the difference threshold is a preset value, and the present disclosure does not limit the value of the difference threshold.

[0098] In some embodiments, when the difference between the sub-correction data corresponding to any preset gray level is greater than the difference threshold, it is determined that the matching result is a failed match.

[0099] Step 304, when the matching result corresponding to any reference clustering cluster is a successful match, the identifier corresponding to any reference clustering cluster is determined as the first compression data corresponding to the target clustering cluster.

[0100] In the embodiments of the present disclosure, when the matching result corresponding to any reference clustering cluster is a successful match, the identifier corresponding to any reference clustering cluster is determined as the first compression data corresponding to the target clustering cluster. Thus, when decompressing, the brightness correction data corresponding to any reference clustering cluster can be determined as the brightness correction data of the target clustering cluster. Thus, while ensuring the accuracy of the determined brightness correction data, only the identifier corresponding to any reference clustering cluster is stored, reducing the code length of the first compression data.

[0101] In some embodiments, when the brightness correction data corresponding to the reference pixel point of the reference clustering cluster is stored in the reference table, the index value of the brightness correction data corresponding to any reference clustering cluster in the reference table is determined as the identifier corresponding to any reference clustering cluster.

[0102] Among them, the reference table stores the brightness correction data corresponding to the reference pixel point of the reference clustering cluster. Alternatively, the reference table may also store the identifier corresponding to the reference clustering cluster and the brightness correction data corresponding to the reference pixel point.

[0103] In some embodiments, the identifier of the reference clustering cluster may be the identifier in the area to which the reference clustering cluster belongs. For example, the identifier of the reference clustering cluster may be the m-th clustering cluster in area A.

[0104] In some embodiments, the index value of the luminance correction data corresponding to any reference clustering cluster in the reference table may be the storage location of the luminance correction data corresponding to any reference clustering cluster in the reference table, or may also be the identifier corresponding to any reference clustering cluster stored in the reference table.

[0105] In some embodiments, when different compression methods can be used to compress the luminance correction data corresponding to the reference pixel points of different clustering clusters, the identifier corresponding to the reference coding and the identifier corresponding to any reference clustering cluster may also be determined as the first compression data.

[0106] Step 305: Determine the target compression data corresponding to the target area according to the target clustering cluster to which each pixel point belongs and the first compression data corresponding to each target clustering cluster.

[0107] In some embodiments, the luminance correction data corresponding to the reference pixel points of the target clustering cluster may be stored in the reference table, so that when compressing other areas in the same screen, the compression data corresponding to the compressed area can be referred to.

[0108] In some embodiments, if there is a large amount of data in the reference table, it may lead to a large amount of matching work, and thus the compression efficiency is low. Therefore, the maximum code length of the reference table may be set, and when the data in the reference table reaches the maximum code length, the luminance correction data corresponding to the reference pixel points of the target clustering cluster may be stored in the reference table based on a preset update strategy.

[0109] The preset update strategy may be first-in, first-out, or replacement of the first-in, etc. The present disclosure does not limit this.

[0110] In the embodiments of the present disclosure, when the brightness correction data includes sub-correction data corresponding to each preset gray level, the brightness correction data corresponding to the reference pixel point of the target clustering cluster is matched with the brightness correction data corresponding to the reference pixel points of at least one reference clustering cluster to obtain a matching result corresponding to each reference clustering cluster. When the matching result corresponding to any reference clustering cluster is a successful match, the identifier corresponding to any reference clustering cluster is determined as the first compression data corresponding to the target clustering cluster. Finally, according to the target clustering cluster to which each pixel point belongs and the first compression data corresponding to each target clustering cluster, the target compression data corresponding to the target area is determined. Thus, a reference clustering cluster similar to the brightness correction data corresponding to the reference pixel point of the target clustering cluster can be determined, and then the identifier of the reference clustering cluster is determined as the compression data corresponding to the target clustering cluster, reducing the code length of the compression data corresponding to the target area and improving the compression ratio.

[0111] In some embodiments, the target compression data corresponding to the target area is also determined according to the total number of target clustering clusters, the target clustering cluster to which each pixel point belongs, and the first compression data corresponding to each target clustering cluster. Thus, the total number of target clustering clusters can also be put into the target compression data, so that it is possible to determine whether the compression data has been tampered with based on the total number of target clustering clusters.

[0112] In some embodiments, according to the total number of pixel points in the target area, the first code length corresponding to the total number of target clustering clusters is determined. According to the first code length, the total number of target clustering clusters is encoded to obtain the fourth compression data; according to the total number of target clustering clusters, the second code length corresponding to the label of each pixel point is determined; according to the second code length, the target clustering cluster to which each pixel point belongs is encoded to obtain the fifth compression data; finally, the first compression data, the fourth compression data, and the fifth compression data are determined as the target compression data.

[0113] Among them, the formula for the first code length can be: ceil(log2(pixel_num)). Where pixel_num is the total number of pixel points in the target area, and ceil is rounding up.

[0114] Among them, the formula for the second code length can be: label_bit = ceil(log2(cluster_num)), where label_bit is the second code length and cluster_num is the total number of target clustering clusters.

[0115] To implement the above embodiments, the present disclosure also proposes a data compression device.

[0116] Figure 4 It is a schematic structural diagram of the data compression device provided by the embodiments of the present disclosure.

[0117] As shown Figure 4 in the figure, the data compression device 400 may include:

[0118] A clustering module 401, configured to cluster the pixel points in the target area based on the luminance correction data corresponding to each pixel point in the target area, to obtain at least one target clustering cluster;

[0119] A first determination module 402, configured to determine the luminance correction data corresponding to the set reference pixel points in each target clustering cluster;

[0120] A second determination module 403, configured to compress the luminance correction data corresponding to each reference pixel point, and determine the first compression data corresponding to each target clustering cluster;

[0121] A third determination module 404, configured to determine the target compression data corresponding to the target area according to the target clustering cluster to which each pixel point belongs and the first compression data corresponding to each target clustering cluster.

[0122] In some embodiments, the second determination module 403 is configured to:

[0123] Based on each preset function and the sub-correction data corresponding to the reference pixel point at the i-th preset gray level, determine the predicted correction data corresponding to the (i + 1)-th preset gray level under each preset function, where the i-th preset gray level is less than the (i + 1)-th preset gray level, and the value of i is a positive integer;

[0124] Determine the difference between the sub-correction data corresponding to the reference pixel point at the (i + 1)-th preset gray level and the predicted correction data corresponding to each preset function;

[0125] According to the sub-correction data corresponding to the reference pixel point at the first preset gray level and the differences corresponding to the remaining gray levels under each preset function, determine the second compression data corresponding to the target clustering cluster under each preset function, where the remaining gray levels are other gray levels except the first preset gray level;

[0126] Determine the first compression data according to the second compression data corresponding to each preset function.

[0127] In some embodiments, the second determination module 403 is configured to:

[0128] Determine the first compression data according to the second compression data with the shortest code length and the preset function corresponding to the second compression data with the shortest code length.

[0129] In some embodiments, the second determination module 403 is configured to:

[0130] Based on each preset compression method, compress the second compressed data corresponding to each preset function to determine the third compressed data corresponding to each preset compression method and each preset function;

[0131] Determine the first compressed data according to the third compressed data with the shortest code length, the preset compression method and the preset function corresponding to the third compressed data with the shortest code length.

[0132] In some embodiments, the second determination module 403 is configured to:

[0133] Determine the initial function corresponding to each pixel point in the target screen according to the sub-correction data corresponding to each pixel point in the target screen under each preset gray level, where the target screen is the screen where the target area is located;

[0134] Deduplicate the initial functions to obtain candidate functions;

[0135] Determine the number of pixel points corresponding to each candidate function in the target screen;

[0136] Determine the preset function from the candidate functions according to the number of pixel points.

[0137] In some embodiments, the second determination module 403 is configured to:

[0138] Match the brightness correction data corresponding to the reference pixel points of the target clustering cluster with the brightness correction data corresponding to the reference pixel points of at least one reference clustering cluster to obtain the matching result corresponding to each reference clustering cluster;

[0139] When the matching result corresponding to any reference clustering cluster is a successful match, determine the identifier corresponding to any reference clustering cluster as the first compressed data corresponding to the target clustering cluster.

[0140] In some embodiments, the second determination module 403 is configured to:

[0141] When the difference between the sub-correction data corresponding to each preset gray level is less than or equal to the difference threshold, determine that the matching result is a successful match;

[0142] When the difference between the sub-correction data corresponding to any preset gray level is greater than the difference threshold, determine that the matching result is a failed match;

[0143] Wherein, the difference between the sub-correction data is the difference between the sub-correction data corresponding to the reference pixel points of the target clustering cluster and the reference pixel points of the reference clustering cluster under the preset gray level.

[0144] In some embodiments, the second determination module 403 is configured to:

[0145] When the brightness correction data corresponding to the reference pixel points of the reference clustering clusters is stored in the reference table, the index value of the brightness correction data corresponding to any reference clustering cluster in the reference table is determined as the identifier corresponding to any reference clustering cluster.

[0146] In some embodiments, it further includes an update module for:

[0147] Store the brightness correction data corresponding to the reference pixel points of the target clustering cluster into the reference table.

[0148] In some embodiments, the first determination module 402 is used for:

[0149] According to the brightness correction data corresponding to the pixel points in the target clustering cluster, determine the clustering center corresponding to the target clustering cluster, and determine the pixel point corresponding to the clustering center as the set reference pixel point in the target clustering cluster.

[0150] In some embodiments, the third determination module 404 is used for:

[0151] According to the total number corresponding to the target clustering cluster, the target clustering cluster to which each pixel point belongs, and the first compression data corresponding to each target clustering cluster, determine the target compression data corresponding to the target area.

[0152] For the functions and specific implementation principles of the above-mentioned modules in the embodiments of the present disclosure, reference may be made to the above-mentioned method embodiments, and details are not described herein again.

[0153] The data compression device in the embodiments of the present disclosure first clusters the pixel points in the target area based on the brightness correction data corresponding to each pixel point in the target area to obtain at least one target clustering cluster, determines the corresponding brightness correction data for the set reference pixel points in each target clustering cluster, compresses the brightness correction data corresponding to each reference pixel point, determines the first compression data corresponding to each target clustering cluster, and determines the target compression data corresponding to the target area according to the target clustering cluster to which each pixel point belongs and the first compression data corresponding to each target clustering cluster. Thus, after clustering and compressing the brightness correction data of the target area, the brightness correction data corresponding to the reference pixel points of each target clustering cluster can be further compressed, thereby further reducing the code length of the compression data corresponding to the brightness correction data and improving the compression ratio.

[0154] To implement the above embodiments, the present disclosure also proposes an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the data compression method proposed in the foregoing embodiments of the present disclosure.

[0155] Figure 5A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 5 The illustrated electronic device 12 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0156] As Figure 5 shown, the electronic device 12 appears in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects different system components (including the system memory 28 and the processing unit 16).

[0157] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnection (PCI) bus.

[0158] The electronic device 12 typically includes a variety of computer system-readable media. These media can be any available media accessible by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0159] The memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. Merely by way of example, the storage system 34 can be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, commonly referred to as a "hard disk drive"). Although Figure 5Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as: Compact Disc Read Only Memory; hereinafter referred to as: CD-ROM), Digital Video Disc Read Only Memory; hereinafter referred to as: DVD-ROM) or other optical media) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data medium interfaces. The memory 28 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.

[0160] A program / utility 40 having a set (at least one) of program modules 42 can be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present disclosure.

[0161] The electronic device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 22. And, the electronic device 12 can also communicate with one or more networks (such as a Local Area Network; hereinafter referred to as: LAN), a Wide Area Network; hereinafter referred to as: WAN) and / or a public network, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0162] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the methods mentioned in the foregoing embodiments.

[0163] To implement the above embodiments, the present disclosure also provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the data compression method proposed in the foregoing embodiments of the present disclosure.

[0164] To implement the above embodiments, the present disclosure also provides a computer program product including a computer program, which when executed by a processor, implements the data compression method proposed in the foregoing embodiments of the present disclosure.

[0165] Figure 6 It is a schematic structural diagram of the chip proposed in the embodiments of the present disclosure. Reference may be made to Figure 6 the schematic structural diagram of the chip 600 shown, but not limited thereto.

[0166] The chip 600 includes a processing circuit 601 configured to execute any of the above methods.

[0167] In some embodiments, the chip 600 further includes one or more interface circuits 602. Optionally, the interface circuit 602 is connected to the memory 603. The interface circuit 602 can be used to receive signals from the memory 603 or other devices, and the interface circuit 602 can be used to send signals to the memory 603 or other devices. For example, the interface circuit 602 can read the instructions stored in the memory 603 and send the instructions to the processing circuit 601.

[0168] In some embodiments, the interface circuit 602 executes at least one of the communication steps such as sending and / or receiving in the above method, and the processing circuit 601 executes other steps.

[0169] In some embodiments, terms such as interface circuit, interface, transceiver pin, transceiver, etc. can be replaced with each other.

[0170] In some embodiments, the chip 600 further includes one or more memories 603 for storing instructions. Optionally, all or part of the memory 603 can be outside the chip 600.

[0171] The collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information involved in the present disclosure all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0172] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.

[0173] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of the present disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0174] Any process or method description in a flowchart or described otherwise herein may be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a customized logic function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in an opposite order according to the functions involved, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present disclosure pertain.

[0175] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing it in a computer memory.

[0176] It should be understood that various parts of the present disclosure can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0177] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0178] In addition, each functional unit in various embodiments of the present disclosure may be integrated into one processing module, may exist physically alone for each unit, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0179] The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disc, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A data compression method, characterized in that: The method comprises: Based on the brightness correction data corresponding to each pixel point in the target area, clustering the pixel points in the target area to obtain at least one target cluster; Determining brightness correction data corresponding to a reference pixel point set in each of the target clusters; Compressing the brightness correction data corresponding to each of the reference pixels to determine first compressed data corresponding to each of the target clusters; The target compressed data corresponding to the target area is determined according to the target cluster to which each pixel point belongs and the first compressed data corresponding to each target cluster.

2. The method according to claim 1, characterized in that: The brightness correction data includes sub-correction data corresponding to each preset grayscale, and the brightness correction data corresponding to each reference pixel is compressed to determine the first compressed data corresponding to each target cluster, including: Based on each preset function and the sub-correction data corresponding to the reference pixel at the i-th preset grayscale, determine the predicted correction data corresponding to the i+1-th preset grayscale under each preset function, wherein the i-th preset grayscale is less than the i+1-th preset grayscale, and the value of i is a positive integer; Determine the difference between the sub-correction data corresponding to the reference pixel point at the (i+1)th preset grayscale and the predicted correction data corresponding to each of the preset functions; Determine the second compressed data corresponding to the target cluster under each preset function according to the sub-corrected data corresponding to the reference pixel under the first preset grayscale and the difference values ​​corresponding to the remaining grayscales under each preset function, wherein the remaining grayscales are the other preset grayscales except the first preset grayscale; The first compressed data is determined according to the second compressed data corresponding to each preset function.

3. The method according to claim 2, characterized in that The determining the first compressed data according to the second compressed data corresponding to each preset function includes: The first compressed data is determined according to the second compressed data with the shortest code length and a preset function corresponding to the second compressed data with the shortest code length.

4. The method according to claim 2, characterized in that: The determining the first compressed data according to the second compressed data corresponding to each preset function includes: Based on each preset compression mode, compress the second compressed data corresponding to each preset function, and determine the third compressed data corresponding to each preset compression mode and each preset function; The first compressed data is determined according to the third compressed data with the shortest code length, a preset compression method and a preset function corresponding to the third compressed data with the shortest code length.

5. The method according to claim 2, characterized in that: The method further comprises: Determining an initial function corresponding to each pixel point in the target screen according to the sub-correction data corresponding to each pixel point in the target screen at each preset grayscale, wherein the target screen is the screen where the target area is located; De-duplication of the initial function to obtain a candidate function; Determine the number of pixels corresponding to each of the candidate functions in the target screen; The preset function is determined from the candidate functions according to the number of pixels.

6. The method according to claim 1, characterized in that The compressing the brightness correction data corresponding to each of the reference pixels to determine the first compressed data corresponding to each of the target clusters includes: Matching the brightness correction data corresponding to the reference pixel points of the target cluster with the brightness correction data corresponding to the reference pixel points of at least one reference cluster to obtain a matching result corresponding to each of the reference clusters; When the matching result corresponding to any reference cluster is a successful match, the identifier corresponding to the reference cluster is determined as the first compressed data corresponding to the target cluster.

7. The method according to claim 6, characterized in that in, The brightness correction data includes sub-correction data corresponding to each preset grayscale, and obtaining a matching result corresponding to each reference cluster includes at least one of the following: When the sub-correction data differences corresponding to the preset grayscales are all less than or equal to the difference threshold, determining the matching result as a successful match; When the sub-correction data difference corresponding to any preset grayscale is greater than the difference threshold, determining the matching result as a matching failure; The sub-correction data difference is the difference between the sub-correction data corresponding to the reference pixel point of the target cluster and the reference pixel point of the reference cluster at a preset gray scale.

8. The method according to claim 6, characterized in that Before determining the identifier corresponding to any one of the reference clusters as the first compressed data corresponding to the target cluster, the method further includes: When the brightness correction data corresponding to the reference pixel points of the reference cluster is stored in a reference table, the index value of the brightness correction data corresponding to any reference cluster in the reference table is determined as the identifier corresponding to any reference cluster.

9. The method according to claim 8, characterized in that After determining the target compressed data corresponding to the target area according to the target cluster to which each pixel point belongs and the first compressed data corresponding to each target cluster, the method further includes: The brightness correction data corresponding to the reference pixel points of the target cluster is stored in the reference table.

10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: According to the brightness correction data corresponding to the pixel points in the target cluster, the cluster center corresponding to the target cluster is determined, and the pixel point corresponding to the cluster center is determined as the reference pixel point set in the target cluster.

11. The method according to any one of claims 1 to 9, characterized in that: The determining the target compressed data corresponding to the target area according to the target cluster to which each pixel point belongs and the first compressed data corresponding to each target cluster includes: The target compressed data corresponding to the target area is determined according to the total number of target clusters, the target cluster to which each pixel belongs, and the first compressed data corresponding to each target cluster.

12. A data compression device, characterized in that: The device comprises: A clustering module, configured to cluster the pixels in the target area based on the brightness correction data corresponding to each pixel in the target area to obtain at least one target cluster; A first determination module, used to determine brightness correction data corresponding to a reference pixel point set in each of the target clusters; A second determination module is used to compress the brightness correction data corresponding to each of the reference pixels to determine the first compressed data corresponding to each of the target clusters; The third determination module is used to determine the target compressed data corresponding to the target area according to the target cluster to which each pixel point belongs and the first compressed data corresponding to each target cluster.

13. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the data compression method as claimed in any one of claims 1 to 11 is implemented.

14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data compression method according to any one of claims 1 to 11 is implemented.

15. A chip, characterized in that: The chip includes a processing unit and an interface circuit, the processing unit obtains program instructions through the interface circuit, the program instructions are executed by the processing unit, and the processing unit is used to execute the data compression method as described in any one of claims 1-11.