Data compression method and device, electronic equipment and storage medium
By pre-encoding the pixel blocks of the OLED screen and adjusting the target compression parameters, the problem of uneven brightness in the OLED screen was solved, and efficient compression and uniformity of brightness correction data were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING X RING TECHNOLOGY CO LTD
- Filing Date
- 2025-03-04
- Publication Date
- 2026-06-05
AI Technical Summary
OLED screens are prone to uneven brightness during manufacturing. Existing technologies result in inconsistent brightness compensation effects between different pixel blocks when compressing pixel-level brightness correction data.
By pre-encoding the pixel blocks in the target area, the initial compression parameters and data impairment information are determined. The target compression parameters are then adjusted to reduce the differences in data impairment between different pixel blocks, ensuring that the brightness correction data remains uniform after compression.
While reducing the amount of brightness correction data, the uniformity of screen brightness is ensured, avoiding the problem of uneven brightness after compression.
Smart Images

Figure CN120111213B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data compression technology, and in particular to a data compression method, apparatus, electronic device and storage medium. Background Technology
[0002] Organic light-emitting diode (OLED) screens are prone to uneven brightness due to limitations in their manufacturing process. Therefore, before the screen leaves the factory, brightness correction data for each pixel is typically determined. This data is then used to correct the brightness of the displayed image at the pixel level. However, pixel-level brightness correction data is extremely large and usually requires compression. Summary of the Invention
[0003] This disclosure aims to at least partially address one of the technical problems in the related art.
[0004] The first aspect of this disclosure provides a data compression method, including:
[0005] The brightness correction data corresponding to the pixel block in the target area is pre-encoded to determine the initial compression parameters and data impairment information corresponding to the pixel block;
[0006] Based on the data impairment information corresponding to the pixel block and the initial compression parameters, the target compression parameters corresponding to the pixel block are determined;
[0007] Based on the target compression parameters corresponding to the pixel block, the brightness correction data corresponding to the pixel block is compressed.
[0008] A second aspect of this disclosure provides a data compression apparatus, comprising:
[0009] The first determining module is used to pre-encode the brightness correction data corresponding to the pixel block in the target area and determine the initial compression parameters and data impairment information corresponding to the pixel block.
[0010] The second determining module is used to determine the target compression parameters corresponding to the pixel block based on the data impairment information corresponding to the pixel block and the initial compression parameters;
[0011] The compression module is used to compress the brightness correction data corresponding to the pixel block based on the target compression parameters corresponding to the pixel block.
[0012] A third aspect of this disclosure provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the data compression method as proposed in the first aspect of this disclosure.
[0013] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data compression method as proposed in the first aspect of this disclosure.
[0014] A fifth aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the data compression method as proposed in the first aspect of this disclosure.
[0015] A sixth aspect of this 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 used to perform a data compression method as proposed in the first aspect of this disclosure.
[0016] The data compression method, apparatus, electronic device, and storage medium disclosed herein have the following beneficial effects:
[0017] In this embodiment, the brightness correction data corresponding to pixel blocks in the target area is pre-encoded to determine the initial compression parameters and data impairment information for each pixel block. Based on the data impairment information and initial compression parameters, the target compression parameters for each pixel block are determined. The brightness correction data for each pixel block is then compressed based on the target compression parameters. Therefore, based on the data impairment information between the uncompressed and compressed brightness correction data, the initial compression parameters for each pixel block can be adjusted to obtain the target compression parameters. This reduces the difference in data impairment between different pixel blocks, preventing some pixel blocks from having severe data impairment while others have only slight impairment. This avoids uneven brightness between pixel blocks after brightness correction based on the compressed brightness correction data. Thus, while compressing the brightness correction data and reducing the data volume, it ensures the brightness uniformity between different pixel blocks after brightness correction based on the compressed brightness correction data.
[0018] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description
[0019] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which:
[0020] Figure 1 This is a schematic flowchart illustrating a data compression method provided in an embodiment of the present disclosure.
[0021] Figure 2 A schematic flowchart illustrating a data compression method provided in another embodiment of this disclosure;
[0022] Figure 3 A schematic flowchart illustrating a data compression method provided in another embodiment of this disclosure;
[0023] Figure 4 This is a schematic diagram of the structure of a data compression apparatus provided in another embodiment of the present disclosure;
[0024] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown;
[0025] Figure 6 This is a schematic diagram of the chip structure proposed in the embodiments of this disclosure. Detailed Implementation
[0026] Some embodiments of this disclosure will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. Various changes, modifications, and equivalents of the methods, apparatus, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but can be changed as will become apparent upon understanding this disclosure, except for operations that must be performed in a particular order. Furthermore, for clarity and brevity, descriptions of features known in the art may be omitted.
[0027] The embodiments described in the following examples of this disclosure are not representative of all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0028] In related technologies, the screen can be divided into different pixel blocks, and the brightness correction data corresponding to each pixel block can be compressed separately, thereby improving compression flexibility. However, this may result in different levels of damage to the compressed brightness correction data of each pixel block, which may lead to inconsistent brightness compensation effects between different pixel blocks during the final brightness compensation process, resulting in uneven brightness compensation.
[0029] The data compression method, apparatus, electronic device, and storage medium of this disclosure are described below with reference to the accompanying drawings.
[0030] Figure 1 This is a schematic flowchart of a data compression method provided in an embodiment of the present disclosure.
[0031] This disclosure illustrates an example where the data compression method is configured in a data compression device, which can be applied to any electronic device or chip to enable the electronic device or chip to perform data compression functions.
[0032] like Figure 1 As shown, the data compression method may include the following steps:
[0033] Step 101: Pre-encode the brightness correction data corresponding to the pixel blocks in the target area to determine the initial compression parameters and data impairment information corresponding to the pixel blocks.
[0034] In some embodiments, the target area can be the entire display screen. Alternatively, if the display screen is large, it can be divided into multiple target areas, and data compression can be performed on each target area separately, thereby reducing the amount of data processed and improving processing efficiency.
[0035] A pixel block can be a region composed of multiple pixels.
[0036] In some embodiments, the target region can be divided into multiple pixel blocks.
[0037] In some embodiments, the target area can be divided into multiple rectangular areas of the same size, each rectangular area being a pixel block.
[0038] It should be noted that different encoding methods result in different compression parameters. For example, if the compression method is entropy encoding, the corresponding compression parameter is the quantization parameter; or, if the compression method is cluster compression, the corresponding compression parameter is the clustering threshold. This disclosure does not impose any limitations on this.
[0039] In some embodiments, the initial compression parameters corresponding to each pixel block within the target region may be the same or different. This disclosure does not limit this.
[0040] In some embodiments, the brightness correction data corresponding to each pixel block may include the correction data corresponding to each pixel in the pixel block.
[0041] In some embodiments, the brightness correction data corresponding to each pixel block can be correction data corresponding to any color (e.g., red, green, or blue). It should be noted that the logic for compressing the correction data for each color is the same. Therefore, this disclosure provides a detailed description of the compressed data corresponding to any color.
[0042] In some embodiments, the brightness correction data corresponding to the pixel block is pre-encoded based on a preset compression rate to determine the initial compression parameters and initial compression data corresponding to the pixel block. Then, the data impairment information corresponding to the pixel block is determined based on the brightness correction data and initial compression data corresponding to the pixel block.
[0043] The preset compression rate can be 80%, 50%, 60%, etc. This disclosure does not limit it.
[0044] In some embodiments, the product of the total length of the brightness correction data corresponding to each pixel block and the preset compression rate can be used to determine the maximum length corresponding to each pixel block; based on the maximum length, the brightness correction data corresponding to the pixel block is pre-encoded to determine the initial compression parameters corresponding to the pixel block.
[0045] For example, if the total length of the brightness correction data corresponding to pixel block A is L1, and the compression rate is 50%, then the maximum length of pixel block A is 0.5*L1, thus determining the initial compression parameters for pixel block A. It should be noted that, based on the initial compression parameters for pixel block A, the length of the initially compressed data obtained after compressing the brightness correction data corresponding to pixel block A is less than or equal to 0.5*L1.
[0046] In some embodiments, the maximum length of the luminance correction data of all pixel blocks after compression can be determined by multiplying the total length of the luminance correction data of all pixel blocks within the target area with a preset compression rate; the initial compression parameters are then determined based on the maximum length. The initial compression parameters are the same for each pixel block.
[0047] In some embodiments, the initial compressed data can be decompressed first to obtain decompressed data, which is then compared with brightness correction data to determine the data impairment information corresponding to each pixel block.
[0048] In some embodiments, data impairment information may be the mean square error between the brightness correction data and the decompressed data corresponding to each pixel, the peak signal-to-noise ratio, etc. This disclosure does not limit this.
[0049] Step 102: Determine the target compression parameters corresponding to the pixel block based on the data impairment information and initial compression parameters corresponding to the pixel block.
[0050] In some embodiments, if the data impairment information corresponding to a pixel block meets the conditions, the initial compression parameter corresponding to the pixel block is determined as the target compression parameter corresponding to the pixel block; if the data impairment information corresponding to a pixel block does not meet the conditions, the initial compression parameter is adjusted to reduce the data impairment information corresponding to the pixel block, and the adjusted initial compressed data is determined as the target compression parameter corresponding to the pixel block.
[0051] In some embodiments, if the data impairment information is a mean square error value, then if the mean square error value is less than the error threshold, the data impairment information is determined to meet the condition; if the mean square error value is greater than or equal to the error threshold, the data impairment information is determined not to meet the condition.
[0052] In some embodiments, if the data impairment information is peak signal-to-noise ratio (PSNR), then if the PSNR is less than the error threshold, the data impairment information is determined to meet the condition; if the PSNR is greater than or equal to the error threshold, the data impairment information is determined not to meet the condition.
[0053] It should be noted that if the data impairment information does not meet the conditions, it indicates that the compressed brightness correction data is severely impaired, which may lead to a significant difference in brightness between the screen and other pixel blocks after compensation based on the compressed brightness correction data. Therefore, it is necessary to adjust the initial compression parameters to reduce the data impairment information corresponding to that pixel block. For example, if the initial compression parameter is a quantization parameter, then the initial compression parameter should be reduced. This disclosure does not limit this.
[0054] Step 103: Based on the target compression parameters corresponding to the pixel block, compress the brightness correction data corresponding to the pixel block.
[0055] In this embodiment of the disclosure, after determining the target compression parameters corresponding to the pixel block, the brightness correction data corresponding to the pixel block can be compressed based on the target compression parameters and written into the terminal device where the screen is located.
[0056] In this embodiment, the brightness correction data corresponding to pixel blocks in the target area is pre-encoded to determine the initial compression parameters and data impairment information for each pixel block. Based on the data impairment information and initial compression parameters, the target compression parameters for each pixel block are determined. The brightness correction data for each pixel block is then compressed based on the target compression parameters. Therefore, based on the data impairment information between the uncompressed and compressed brightness correction data, the initial compression parameters for each pixel block can be adjusted to obtain the target compression parameters. This reduces the difference in data impairment between different pixel blocks, preventing some pixel blocks from having severe data impairment while others have only slight impairment. This avoids uneven brightness between pixel blocks after brightness correction based on the compressed brightness correction data. Thus, while compressing the brightness correction data and reducing the data volume, it ensures the brightness uniformity between different pixel blocks after brightness correction based on the compressed brightness correction data.
[0057] Figure 2 This is a schematic flowchart of a data compression method provided in an embodiment of the present disclosure, as shown below. Figure 2 As shown, the data compression method may include the following steps:
[0058] Step 201: Based on the preset compression rate, pre-encode the brightness correction data corresponding to the pixel block to determine the initial compression parameters and initial compression data corresponding to the pixel block. The brightness correction data includes the sub-correction data corresponding to each pixel point at each preset gray level.
[0059] It should be noted that if a pixel corresponds to sub-correction data at each preset grayscale level, then during brightness correction, correction data across the entire grayscale range can be obtained through interpolation and fitting based on the sub-correction data corresponding to multiple preset grayscale levels. This can improve the accuracy of brightness correction.
[0060] The preset gray levels can be 50, 100, 150, 200, 250, etc. This disclosure does not limit the number of preset gray levels or the gray value corresponding to each preset gray level.
[0061] The initial compression parameters include the first compression parameters corresponding to each preset grayscale level. It should be noted that the first compression parameters corresponding to each preset grayscale level can be the same or different. This disclosure does not impose any limitation on this.
[0062] The initial compressed data includes sub-compressed data for each pixel at each preset grayscale level.
[0063] Step 202: Determine the data impairment information corresponding to the pixel block based on the brightness correction data and initial compression data corresponding to the pixel block. The data impairment information includes at least one of the number of damaged pixels and the loss value corresponding to each preset gray level.
[0064] In some embodiments, the sub-correction data corresponding to each pixel in the pixel block at each preset gray level is matched with the sub-compression data, and the number of pixels that fail to match at each preset gray level is determined as the number of damaged pixels.
[0065] In some embodiments, the difference between the sub-corrected data corresponding to each preset gray level of a pixel and the decompressed data of the corresponding sub-compressed data can be calculated first. If the difference is greater than the difference threshold, the corresponding matching result is determined to be a matching failure. If the difference is less than or equal to the difference threshold, the corresponding matching result is determined to be a matching success.
[0066] For example, if a pixel block contains 1000 pixels, the sub-correction data and sub-compression data corresponding to each of the 1000 pixels at a preset grayscale 1 are matched to determine the number of pixels that failed to match, thus obtaining the damaged pixel data corresponding to the preset grayscale 1. Similarly, the number of damaged pixels corresponding to each preset grayscale is obtained.
[0067] In some embodiments, the loss value corresponding to each preset gray level is determined based on the difference between the sub-correction data and the sub-compression data corresponding to each pixel in the pixel block at each preset gray level.
[0068] In some embodiments, the sum or average value or mean square error of the difference between the sub-corrected data and the sub-compressed data corresponding to each pixel at each preset gray level can be determined as the loss value corresponding to each preset gray level.
[0069] For example, if a pixel block contains 1000 pixels, determine the difference between the sub-corrected data and the sub-compressed data for each of the 1000 pixels at a preset grayscale level 1. Then, determine the sum or average or mean square error of the differences as the loss value corresponding to each preset grayscale level. Similarly, obtain the loss value corresponding to each preset grayscale level.
[0070] Step 203: Determine the target compression parameters corresponding to the pixel block based on the data impairment information and initial compression parameters corresponding to the pixel block.
[0071] The target compression parameters include the second compression parameters corresponding to each preset grayscale level.
[0072] In some embodiments, when the data damage information includes the number of damaged pixels and the loss value, in response to the pixel block having a number of damaged pixels greater than a first threshold or a loss value greater than a second threshold at a first preset gray level, the first compression parameter corresponding to the pixel block at the first preset gray level is adjusted based on a preset adjustment range and a preset adjustment direction to obtain the second compression parameter corresponding to the pixel block at the first preset gray level.
[0073] It should be noted that if the number of damaged pixels corresponding to a pixel block at the first preset grayscale is greater than the first threshold, or the corresponding loss value is greater than the second threshold, it indicates that the brightness correction data corresponding to the pixel block has been severely damaged after compression. This may result in a significant difference in brightness between the pixel block and other pixel blocks after the screen brightness is compensated based on the compressed brightness correction data. Therefore, the initial compression parameters need to be adjusted.
[0074] In some embodiments, when the data impairment information includes the number of damaged pixels and the loss value, in response to the pixel block having a number of damaged pixels less than or equal to a first threshold and a loss value greater than a second threshold at a second preset grayscale, the first compression parameter corresponding to the pixel block at the second preset grayscale is determined as the second compression parameter corresponding to the pixel block at the second preset grayscale.
[0075] The preset adjustment range and preset adjustment direction are both determined based on the compression method. Different compression methods correspond to different preset adjustment ranges and preset adjustment directions.
[0076] For example, if the compression method is quantization compression, the preset adjustment direction is a smaller initial compression parameter to reduce the number of damaged pixels and the loss value. The preset adjustment range can be 1, 0.5, etc. This disclosure does not specifically limit the size of the preset adjustment range.
[0077] In some embodiments, when the data impairment information includes the number of damaged pixels, in response to the number of damaged pixels corresponding to a pixel block at a first preset grayscale being greater than a first threshold, the first compression parameter corresponding to the pixel block at the first preset grayscale is adjusted to obtain a second compression parameter corresponding to the pixel block at the first preset grayscale. In response to the number of damaged pixels corresponding to a pixel block at a second preset grayscale being less than or equal to the first threshold, the first compression parameter corresponding to the pixel block at the second preset grayscale is determined as the second compression parameter corresponding to the pixel block at the second preset grayscale.
[0078] In some embodiments, when the loss value includes the number of damaged pixels, in response to the number of damaged pixels corresponding to the pixel block at the first preset grayscale being greater than a first threshold, the first compression parameter corresponding to the pixel block at the first preset grayscale is adjusted to obtain the second compression parameter corresponding to the pixel block at the first preset grayscale. In response to the number of damaged pixels corresponding to the pixel block at the second preset grayscale being less than or equal to the first threshold, the first compression parameter corresponding to the pixel block at the second preset grayscale is determined as the second compression parameter corresponding to the pixel block at the second preset grayscale.
[0079] In some embodiments, the first threshold may be determined in advance based on experience.
[0080] In some embodiments, the first threshold can also be determined by: when the target area contains multiple pixel blocks, determining the adjacent pixel blocks corresponding to each pixel block; determining a first reference number for each pixel block at each preset gray level based on the number of damaged pixels corresponding to the adjacent pixel blocks at each preset gray level; determining a second reference number for each pixel block at each preset gray level based on the number of damaged pixels corresponding to all pixel blocks at each preset gray level; determining a third reference number based on the first reference number and the second reference number; and determining the first threshold for each pixel block at each preset gray level based on the third reference number.
[0081] The number of adjacent pixel blocks corresponding to each pixel block can be one or more. This disclosure does not limit this.
[0082] In some embodiments, the average number of damaged pixels corresponding to multiple adjacent pixel blocks at each preset gray level can be used to determine the first reference number corresponding to each pixel block at each preset gray level.
[0083] In some embodiments, the average number of damaged pixels corresponding to all pixel blocks at each preset gray level can be used to determine the second reference number corresponding to each pixel block at each preset gray level.
[0084] In some embodiments, a first weight corresponding to a first reference quantity and a second weight corresponding to a second reference quantity can be determined. Then, based on the first weight and the second weight, the first reference quantity and the second reference quantity are weighted to obtain a third reference quantity. The sum of the first weight and the second weight is 1. The first weight and the second weight can be the same or different. This disclosure does not limit this.
[0085] In some embodiments, the first threshold can be the product of a third reference quantity and a first value. The first value can be 1.1, 1, 1.2, etc. This disclosure does not limit this.
[0086] In this embodiment, a first threshold is determined for a pixel block by combining the number of damaged pixels corresponding to its neighboring pixel blocks. This allows for the determination of a potential imbalance between the corrected brightness of a pixel block and the corrected brightness of its neighboring pixel blocks if the number of damaged pixels exceeds the first threshold. Consequently, the initial compression parameters of the pixel block are adjusted to ensure that the corrected brightness is uniform with that of its neighboring pixel blocks.
[0087] In some embodiments, the second threshold may be determined in advance based on experience.
[0088] In some embodiments, the second threshold can also be determined by: when the target area contains multiple pixel blocks, determining the neighboring pixel blocks corresponding to each pixel block; determining the first reference loss value corresponding to each pixel block at each preset gray level based on the loss value corresponding to the neighboring pixel blocks at each preset gray level; determining the second reference loss value corresponding to each pixel block at each preset gray level based on the loss value corresponding to all pixel blocks at each preset gray level; determining the third reference loss value based on the first reference loss value and the second reference loss value; and determining the second threshold corresponding to each pixel block at each preset gray level based on the third reference loss value.
[0089] In some embodiments, the average value of the loss values corresponding to multiple adjacent pixel blocks at each preset gray level can be determined as the first reference loss value corresponding to each pixel block at each preset gray level.
[0090] In some embodiments, the average of the loss values corresponding to all pixel blocks at each preset gray level can be used to determine the second reference loss value corresponding to each pixel block at each preset gray level.
[0091] In some embodiments, a third weight corresponding to the first reference loss value and a fourth weight corresponding to the second reference loss value can be determined. Then, based on the third and fourth weights, the first and second reference loss values are weighted to obtain a third reference loss value. The sum of the third and fourth weights is 1. The third and fourth weights can be the same or different. This disclosure does not limit this.
[0092] In some embodiments, the second threshold can be the product of a third reference loss value and a second value. The second value can be 1.1, 1, 1.2, etc. The first value and the second value can be the same or different. This disclosure does not limit this.
[0093] In this embodiment, a second threshold is determined by combining the loss values of adjacent pixel blocks. This allows for the determination of a second threshold if the loss value of a pixel block exceeds the second threshold. Furthermore, it is determined that after applying brightness correction to the pixel block based on the initial compressed data, the corrected brightness may not be uniform with that of adjacent pixel blocks. Therefore, the initial compression parameters of the pixel block are adjusted to ensure that the corrected brightness of the pixel block is uniform with that of its adjacent pixel blocks.
[0094] Step 204: Based on the target compression parameters corresponding to the pixel block, compress the brightness correction data corresponding to the pixel block.
[0095] In this embodiment, the brightness correction data corresponding to the pixel block includes sub-correction data corresponding to each pixel at each preset gray level, and the corresponding data impairment information includes at least one of the number of damaged pixels and the loss value corresponding to each preset gray level. Thus, based on the damaged pixels and loss value corresponding to the pixel block at each gray level, the impairment of the compressed correction data corresponding to the pixel block at each preset gray level can be determined, thereby determining the target compression parameters of the pixel block at each preset gray level in more detail. This reduces the impairment difference of the compressed correction data corresponding to different pixel blocks at each preset gray level, and further improves the brightness uniformity between different pixel blocks after the brightness of the screen is corrected based on the compressed brightness correction data.
[0096] Figure 3 This is a schematic flowchart of a data compression method provided in an embodiment of the present disclosure; as shown below. Figure 3 As shown, the data compression method may include the following steps:
[0097] Step 301: Based on the preset compression rate, pre-encode the brightness correction data corresponding to the pixel block to determine the initial compression parameters and initial compression data corresponding to the pixel block. The brightness correction data includes the sub-correction data corresponding to each pixel point at each preset gray level.
[0098] The initial compression parameters include the first compression parameters corresponding to each preset grayscale level.
[0099] The initial compressed data includes sub-compressed data for each pixel at each preset grayscale level.
[0100] Step 302: Determine the data impairment information corresponding to the pixel block based on the brightness correction data and initial compression data corresponding to the pixel block. The data impairment information includes at least one of the number of damaged pixels and the loss value corresponding to each preset gray level.
[0101] Step 303: In response to the fact that the number of damaged pixels corresponding to the pixel block is greater than a first threshold or the corresponding loss value is greater than a second threshold at the first preset gray level, the first compression parameter corresponding to the pixel block at the first preset gray level is adjusted based on the preset adjustment range and preset adjustment direction to obtain the second compression parameter corresponding to the pixel block at the first preset gray level.
[0102] The specific implementation of steps 301 to 303 can be found in the detailed descriptions of other embodiments in this disclosure, and will not be repeated here.
[0103] Step 304: Update the initial compression parameters corresponding to the pixel block based on the target compression parameters corresponding to the pixel block.
[0104] In this embodiment of the disclosure, the initial compression parameters corresponding to each pixel block can be updated to the adjusted target compression parameters.
[0105] Step 305: Based on the updated initial compression parameters corresponding to the pixel block, compress the brightness correction data corresponding to the pixel block to determine the updated data impairment information corresponding to the pixel block.
[0106] In some embodiments, the brightness correction data corresponding to the pixel block is compressed based on the updated initial compression parameters corresponding to the pixel block to determine the updated initial compressed data, and the updated data impairment information corresponding to the pixel block is determined based on the updated initial compressed data and the brightness correction data.
[0107] The specific implementation method for determining the updated data damage information can be found in the detailed description of determining the data damage information before the update, and will not be repeated here.
[0108] Step 306: If the number of updated damaged pixels corresponding to a pixel block at each preset grayscale is less than or equal to the first threshold and the updated loss value is less than or equal to the second threshold, the updated initial compression parameters corresponding to the pixel block are determined as the target compressed data corresponding to the pixel block.
[0109] In some embodiments, after determining the target compression parameter for each pixel block based on the initial compression parameter and data impairment information corresponding to each pixel block, the initial compression parameter for each pixel block can be updated to the adjusted target compression parameter, and the operation of compressing the brightness correction data corresponding to each pixel block can be performed cyclically until the number of damaged pixels corresponding to each pixel block is less than or equal to the first threshold and the loss value is less than or equal to the second threshold at each preset gray level. This ensures the uniformity of screen brightness after the screen brightness is corrected based on the compressed brightness correction data corresponding to each pixel block.
[0110] For example, there are four pixel blocks: pixel block 1, pixel block 2, pixel block 3, and pixel block 4; and three preset gray levels: gray level 1 and gray level 2. The initial compression parameter for pixel block 1 at gray level 1 is A1, and the initial compression parameter for gray level 2 is A2; the initial compression parameter for pixel block 2 at gray level 1 is B1, and the initial compression parameter for gray level 2 is B2; the initial compression parameter for pixel block 3 at gray level 1 is C1, and the initial compression parameter for gray level 2 is C2. If the number of damaged pixels in pixel block 1 at gray level 1 is greater than a first threshold, or the loss value is greater than a second threshold, then the corresponding target compression parameter is determined to be A1-1, and the other initial compression parameters are the target compression parameters.
[0111] Next, the initial compression parameter of pixel block 1 at grayscale 1 is adjusted to A-1, while other initial compression parameters remain unchanged. Based on the initial compression parameters, the brightness correction data corresponding to each pixel block is compressed, and the data impairment information corresponding to each pixel block is determined. If the number of damaged pixels corresponding to each pixel block at each preset grayscale is less than or equal to the first threshold, and the loss value is less than or equal to the second threshold, then the target compression parameter of pixel block 1 at grayscale 1 is determined to be A1-1, and the target compression parameter at grayscale 2 is A2; the target compression parameter of pixel block 2 at grayscale 1 is B1, and the target compression parameter at grayscale 2 is B2; the target compression parameter of pixel block 3 at grayscale 1 is C1, and the target compression parameter at grayscale 2 is C2.
[0112] Alternatively, if the number of damaged pixels corresponding to pixel block 1 at grayscale 1 is greater than the first threshold, or the loss value is greater than the second threshold, then the target compression parameter corresponding to pixel block 1 at grayscale 1 is determined to be A1-2, and the operation of updating the initial compression parameters is returned. If the number of damaged pixels corresponding to each pixel block at each preset grayscale is less than or equal to the first threshold, and the loss value is less than or equal to the second threshold, then the target compression parameter corresponding to pixel block 1 at grayscale 1 is determined to be A1-2, and the target compression parameter corresponding to grayscale 2 is A2; the target compression parameter corresponding to pixel block 2 at grayscale 1 is B1, and the target compression parameter corresponding to grayscale 2 is B2; the target compression parameter corresponding to pixel block 3 at grayscale 1 is C1, and the target compression parameter corresponding to grayscale 2 is C2.
[0113] Step 307: Based on the target compression parameters corresponding to each pixel block, compress the brightness correction data corresponding to each pixel block.
[0114] In this embodiment, after determining the target compression parameters for a pixel block based on the data impairment information and initial compression parameters corresponding to the pixel block, the initial compression parameters can be updated based on the target compression parameters. Finally, if the number of damaged pixels corresponding to each pixel block at each preset grayscale is less than or equal to a first threshold and the loss value is less than or equal to a second threshold, the updated initial compression parameters are determined as the target compressed data for the pixel block. Therefore, not only can the target compression parameters for each pixel block at each preset grayscale be determined in more detail, but the initial compression parameters can also be adjusted, further reducing the impairment differences of the compressed corrected data for each pixel block at each preset grayscale, and further improving the brightness uniformity between different pixel blocks after correcting the screen brightness based on the compressed brightness correction data.
[0115] In some embodiments, the initial compression parameters corresponding to a pixel block are updated based on the target compression parameters corresponding to that pixel block; the brightness correction data corresponding to the pixel block is compressed based on the updated initial compression parameters, and the updated initial compressed data corresponding to the pixel block is determined; if the total length of the updated initial compressed data corresponding to the target region is greater than or equal to a preset length, the initial compression parameters corresponding to the target compression parameters of the pixel block are determined as the target compression parameters of the pixel block. Therefore, while reducing brightness non-uniformity between different pixel blocks, the length of the compressed brightness correction data is limited based on a preset compression ratio, thereby reducing the occupied storage area.
[0116] The preset length is the product of the total length of all brightness correction data corresponding to the target area and the preset compression rate.
[0117] In some embodiments, if the total length of the updated initial compressed data corresponding to the target area is less than the preset length, and the number of damaged pixels corresponding to the pixel block at any preset gray level is greater than the first threshold, or the loss value is greater than the second threshold, the updated initial compression parameters can be updated until the total length of the updated initial compressed data corresponding to the target area is greater than or equal to the preset length, or the number of updated damaged pixels corresponding to the pixel block at each preset gray level is less than or equal to the first threshold, and the updated loss value is less than or equal to the second threshold.
[0118] For example, there are four pixel blocks: pixel block 1, pixel block 2, pixel block 3, and pixel block 4; and three preset gray levels: gray level 1 and gray level 2. The initial compression parameter for pixel block 1 at gray level 1 is A1, and the initial compression parameter for gray level 2 is A2; the initial compression parameter for pixel block 2 at gray level 1 is B1, and the initial compression parameter for gray level 2 is B2; the initial compression parameter for pixel block 3 at gray level 1 is C1, and the initial compression parameter for gray level 2 is C2. If the number of damaged pixels in pixel block 1 at gray level 1 is greater than a first threshold, or the loss value is greater than a second threshold, then the corresponding target compression parameter is determined to be A1-1, and the other initial compression parameters are the target compression parameters.
[0119] Next, the initial compression parameter of pixel block 1 at grayscale 1 is adjusted to A-1, while other initial compression parameters remain unchanged. Based on the initial compression parameters, the brightness correction data corresponding to each pixel block is compressed. If the total length of the compressed data corresponding to all pixel blocks is greater than or equal to the preset length, then the target compression parameter of pixel block 1 at grayscale 1 is determined to be A1, and the target compression parameter at grayscale 2 is determined to be A2; the target compression parameter of pixel block 2 at grayscale 1 is determined to be B1, and the target compression parameter at grayscale 2 is determined to be B2; the target compression parameter of pixel block 3 at grayscale 1 is determined to be C1, and the target compression parameter at grayscale 2 is determined to be C2.
[0120] Alternatively, if the total length of the compressed data corresponding to all pixel blocks is less than or equal to the preset length, and the number of damaged pixels corresponding to pixel block 1 in grayscale 1 is greater than the first threshold, or the loss value is greater than the second threshold; then the target compression parameter corresponding to pixel block 1 in grayscale 1 is determined to be A1-2, and the operation of updating the initial compression parameters is returned. If the total length of the compressed data corresponding to all pixel blocks is greater than the preset length; then the target compression parameter corresponding to pixel block 1 in grayscale 1 is determined to be A1-1, and the target compression parameter corresponding to pixel block 2 in grayscale 2 is determined to be A2; the target compression parameter corresponding to pixel block 2 in grayscale 1 is determined to be B1, and the target compression parameter corresponding to pixel block 2 in grayscale 2 is determined to be B2; the target compression parameter corresponding to pixel block 3 in grayscale 1 is determined to be C1, and the target compression parameter corresponding to pixel block 2 in grayscale 2 is determined to be C2.
[0121] In some embodiments, in response to the following conditions: the number of damaged pixels in the target area is less than or equal to a first threshold, the loss value is less than or equal to a second threshold, and the total length of the initial compressed data corresponding to all pixel blocks is less than a preset length, the first threshold and the second threshold are reduced. Therefore, if there is remaining length, reducing the threshold can further identify the initial compressed data that may lead to uneven brightness, and the corresponding initial compression parameters can be adjusted, thereby further improving the brightness uniformity of the screen.
[0122] In some embodiments, if the first threshold is the product of the third reference quantity and the first value, the first value can be reduced, thereby reducing the first threshold.
[0123] In some embodiments, if the second threshold is the product of the third reference loss value and the second value, the second value can be reduced, thereby reducing the second threshold.
[0124] To implement the above embodiments, this disclosure also proposes a data compression apparatus.
[0125] Figure 4 This is a schematic diagram of the structure of the data compression device provided in the embodiments of this disclosure.
[0126] like Figure 4 As shown, the data compression device 400 may include:
[0127] The first determining module 401 is used to pre-encode the brightness correction data corresponding to the pixel block in the target area and determine the initial compression parameters and data damage information corresponding to the pixel block.
[0128] The second determining module 402 is used to determine the target compression parameters corresponding to the pixel block based on the data impairment information and initial compression parameters corresponding to the pixel block.
[0129] Compression module 403 is used to compress the brightness correction data corresponding to the pixel block based on the target compression parameters corresponding to the pixel block.
[0130] In some embodiments, the first determining module 401 is configured to:
[0131] Based on the preset compression rate, the brightness correction data corresponding to the pixel block is pre-encoded to determine the initial compression parameters and initial compression data corresponding to the pixel block.
[0132] Based on the brightness correction data and initial compression data corresponding to the pixel block, the data impairment information corresponding to the pixel block is determined.
[0133] In some embodiments, the data impairment information includes at least one of the number of damaged pixels corresponding to each preset grayscale and the loss value. The first determining module 401 is configured to:
[0134] The sub-correction data corresponding to each pixel in the pixel block at each preset gray level is matched with the sub-compression data, and the number of pixels that fail to match at each preset gray level is determined as the number of damaged pixels.
[0135] The loss value corresponding to each preset gray level is determined based on the difference between the sub-correction data and the sub-compression data corresponding to each pixel in the pixel block at each preset gray level.
[0136] The brightness correction data includes sub-correction data for each pixel at each preset grayscale level, and the initial compression data includes sub-compression data for each pixel at each preset grayscale level.
[0137] In some embodiments, the initial compression parameters include first compression parameters corresponding to each preset grayscale, and the target compression parameters include second compression parameters corresponding to each preset grayscale. The second determining module 402 is used for:
[0138] In response to a pixel block having a number of damaged pixels greater than a first threshold or a loss value greater than a second threshold at a first preset gray level, the first compression parameter corresponding to the pixel block at the first preset gray level is adjusted based on a preset adjustment range and a preset adjustment direction to obtain the second compression parameter corresponding to the pixel block at the first preset gray level.
[0139] In response to a pixel block having a number of damaged pixels less than or equal to a first threshold and a corresponding loss value greater than a second threshold at a second preset grayscale, the first compression parameter corresponding to the pixel block at the second preset grayscale is determined as the second compression parameter corresponding to the pixel block at the second preset grayscale.
[0140] In some embodiments, a third determining module is further included, configured to:
[0141] When the target area contains multiple pixel blocks, determine the adjacent pixel blocks corresponding to each pixel block;
[0142] Based on the number of damaged pixels corresponding to adjacent pixel blocks at each preset gray level, determine the first reference number corresponding to each pixel block at each preset gray level;
[0143] Based on the number of damaged pixels corresponding to all pixel blocks at each preset gray level, determine the second reference number corresponding to each pixel block at each preset gray level;
[0144] The third reference quantity is determined based on the first reference quantity and the second reference quantity;
[0145] Based on the third reference quantity, the first threshold corresponding to each pixel block under each preset grayscale is determined.
[0146] In some embodiments, a fourth determining module is further included, configured to:
[0147] When the target area contains multiple pixel blocks, determine the adjacent pixel blocks corresponding to each pixel block;
[0148] Based on the loss values of adjacent pixel blocks at each preset gray level, determine the first reference loss value corresponding to each pixel block at each preset gray level;
[0149] Based on the loss values of all pixel blocks at each preset gray level, determine the second reference loss value corresponding to each pixel block at each preset gray level;
[0150] The third reference loss value is determined based on the first reference loss value and the second reference loss value;
[0151] Based on the third reference loss value, the second threshold corresponding to each pixel block at each preset gray level is determined.
[0152] In some embodiments, a fifth determining module is further included, configured to:
[0153] Based on the target compression parameters corresponding to the pixel block, the initial compression parameters corresponding to the pixel block are updated;
[0154] Based on the updated initial compression parameters corresponding to the pixel block, the brightness correction data corresponding to the pixel block is compressed to determine the updated data damage information corresponding to the pixel block.
[0155] If, under each preset grayscale, the number of updated damaged pixels corresponding to a pixel block is less than or equal to the first threshold, and the updated loss value is less than or equal to the second threshold, then the updated initial compression parameters corresponding to the pixel block are determined as the target compressed data corresponding to the pixel block.
[0156] In some embodiments, a sixth determining module is further included, configured to:
[0157] Based on the target compression parameters corresponding to the pixel block, the initial compression parameters corresponding to the pixel block are updated;
[0158] Based on the updated initial compression parameters corresponding to the pixel block, the brightness correction data corresponding to the pixel block is compressed to determine the updated initial compressed data corresponding to the pixel block.
[0159] If the total length of the updated initial compressed data corresponding to the target area is greater than or equal to the preset length, the initial compression parameter corresponding to the target compression parameter of the pixel block is determined as the target compression parameter corresponding to the pixel block.
[0160] The preset length is the product of the total length of all brightness correction data corresponding to the target area and the preset compression rate.
[0161] In some embodiments, an adjustment module is further included, for:
[0162] In response to the fact that the number of damaged pixels in each target area is less than or equal to a first threshold, each loss value is less than or equal to a second threshold, and the total length of the initial compressed data corresponding to all pixel blocks is less than a preset length, the first threshold and the second threshold are reduced.
[0163] The preset length is the product of the total length of all brightness correction data corresponding to the target area and the preset compression rate.
[0164] In some embodiments, the first determining module 401 is configured to:
[0165] The product of the total length of the brightness correction data corresponding to the pixel block and the preset compression rate is determined as the maximum length corresponding to the pixel block.
[0166] Based on the maximum length, the brightness correction data corresponding to the pixel block is pre-encoded to determine the initial compression parameters corresponding to the pixel block.
[0167] In some embodiments, a partitioning module is further included, for:
[0168] The target area is divided into multiple pixel blocks.
[0169] The functions and specific implementation principles of the modules described in this embodiment can be found in the above method embodiments, and will not be repeated here.
[0170] The data compression apparatus of this disclosure first pre-encodes the brightness correction data corresponding to pixel blocks in the target area to determine the initial compression parameters and data impairment information corresponding to the pixel blocks; then, based on the data impairment information and initial compression parameters, it determines the target compression parameters for the pixel blocks; and finally, it compresses the brightness correction data corresponding to the pixel blocks based on the target compression parameters. Therefore, based on the data impairment information between the uncompressed and compressed brightness correction data, the initial compression parameters for each pixel block can be adjusted to obtain the target compression parameters. This reduces the difference in data impairment between different pixel blocks, preventing some pixel blocks from having severe data impairment while others have only slight impairment. This avoids uneven brightness between pixel blocks after brightness correction based on the compressed brightness correction data. Thus, while compressing the brightness correction data and reducing the data volume, it ensures the brightness uniformity between different pixel blocks after brightness correction based on the compressed brightness correction data.
[0171] To implement the above embodiments, this disclosure also proposes an electronic device, including: a memory, a processor, and a computer program stored in 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 this disclosure.
[0172] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 5The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0173] like Figure 5 As shown, the electronic device 12 is represented 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, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0174] Bus 18 represents one or more of several bus architectures, 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 architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0175] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0176] 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. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.
[0177] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in 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 an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this disclosure.
[0178] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with 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.
[0179] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the foregoing embodiments.
[0180] To implement the above embodiments, this disclosure also proposes 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 this disclosure.
[0181] To implement the above embodiments, this disclosure also proposes a computer program product, including a computer program that, when executed by a processor, implements the data compression method proposed in the foregoing embodiments of this disclosure.
[0182] Figure 6 This is a schematic diagram of the chip structure proposed in an embodiment of this disclosure. See also... Figure 6 The diagram shown is a schematic representation of the structure of chip 600, but it is not limited to this.
[0183] Chip 600 includes processing circuitry 601, which is configured to perform any of the above methods.
[0184] In some embodiments, chip 600 further includes one or more interface circuits 602. Optionally, the interface circuit 602 is connected to memory 603, and the interface circuit 602 can be used to receive signals from memory 603 or other devices, and the interface circuit 602 can be used to send signals to memory 603 or other devices. For example, the interface circuit 602 can read instructions stored in memory 603 and send the instructions to processing circuit 601.
[0185] In some embodiments, the interface circuit 602 performs at least one of the communication steps such as sending and / or receiving in the above method, and the processing circuit 601 performs other steps.
[0186] In some embodiments, the terms interface circuit, interface, transceiver pin, transceiver, etc., can be used interchangeably.
[0187] In some embodiments, chip 600 further includes one or more memories 603 for storing instructions. Optionally, all or part of the memories 603 may be located outside of chip 600.
[0188] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this disclosure all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0189] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0190] Furthermore, 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 number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0191] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain.
[0192] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs 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: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0193] It should be understood that various parts of this disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0194] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware, and the program can be stored in a computer-readable storage medium. When executed, the program includes one or a combination of the steps of the method embodiments.
[0195] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0196] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled 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 includes: The brightness correction data corresponding to the pixel block in the target area is pre-encoded to determine the initial compression parameters and data impairment information corresponding to the pixel block; Based on the data impairment information corresponding to the pixel block and the initial compression parameters, the target compression parameters corresponding to the pixel block are determined; Based on the target compression parameters corresponding to the pixel block, the brightness correction data corresponding to the pixel block is compressed; The initial compression parameters include first compression parameters corresponding to each preset grayscale, and the target compression parameters include second compression parameters corresponding to each preset grayscale. Determining the target compression parameters corresponding to the pixel block based on the data impairment information corresponding to the pixel block and the initial compression parameters includes any one of the following: In response to the pixel block having a number of damaged pixels greater than a first threshold or a loss value greater than a second threshold at a first preset gray level, the first compression parameter of the pixel block at the first preset gray level is adjusted based on a preset adjustment range and a preset adjustment direction to obtain the second compression parameter of the pixel block at the first preset gray level. In response to the pixel block having a number of damaged pixels less than or equal to the first threshold and a loss value greater than the second threshold at the second preset gray level, the first compression parameter corresponding to the pixel block at the second preset gray level is determined as the second compression parameter corresponding to the pixel block at the second preset gray level. The data impairment information includes at least one of the number of damaged pixels and the loss value corresponding to each preset grayscale. Before determining the target compression parameter corresponding to the pixel block based on the data impairment information corresponding to the pixel block and the initial compression parameter, the method further includes: When the target area contains multiple pixel blocks, determine the adjacent pixel blocks corresponding to each pixel block; Based on the number of damaged pixels corresponding to the adjacent pixel blocks at each preset gray level, determine the first reference number corresponding to each pixel block at each preset gray level; Based on the number of damaged pixels corresponding to all pixel blocks at each preset gray level, determine the second reference number corresponding to each pixel block at each preset gray level; A third reference quantity is determined based on the first reference quantity and the second reference quantity; Based on the third reference quantity, the first threshold corresponding to each pixel block under each preset grayscale is determined; Before determining the target compression parameters corresponding to the pixel block based on the data impairment information and the initial compression parameters corresponding to the pixel block, the method further includes: When the target area contains multiple pixel blocks, determine the adjacent pixel blocks corresponding to each pixel block; Based on the loss values corresponding to the adjacent pixel blocks at each preset gray level, a first reference loss value corresponding to each pixel block at each preset gray level is determined. Based on the loss values of all pixel blocks at each preset gray level, determine the second reference loss value of each pixel block at each preset gray level; A third reference loss value is determined based on the first reference loss value and the second reference loss value; Based on the third reference loss value, the second threshold corresponding to each pixel block under each preset grayscale is determined.
2. The method according to claim 1, characterized in that, The step of pre-encoding the brightness correction data corresponding to the pixel blocks in the target area to determine the initial compression parameters and data impairment information corresponding to the pixel blocks includes: Based on a preset compression rate, the brightness correction data corresponding to the pixel block is pre-encoded to determine the initial compression parameters and initial compression data corresponding to the pixel block. Based on the brightness correction data corresponding to the pixel block and the initial compression data, the data impairment information corresponding to the pixel block is determined.
3. The method according to claim 2, characterized in that, The step of determining the data impairment information corresponding to the pixel block based on the brightness correction data corresponding to the pixel block and the initial compression data includes at least one of the following: The sub-correction data corresponding to each pixel in the pixel block at each preset gray level is matched with the sub-compression data, and the number of pixels that fail to match at each preset gray level is determined as the number of damaged pixels. Based on the difference between the sub-correction data and the sub-compression data corresponding to each pixel point in the pixel block at each preset gray level, the loss value corresponding to each preset gray level is determined. The brightness correction data includes sub-correction data corresponding to each pixel at each preset grayscale, and the initial compression data includes sub-compression data corresponding to each pixel at each preset grayscale.
4. The method according to claim 1, characterized in that, After determining the target compression parameters corresponding to the pixel block based on the data impairment information and the initial compression parameters corresponding to the pixel block, the method further includes: Based on the target compression parameters corresponding to the pixel block, the initial compression parameters corresponding to the pixel block are updated; Based on the updated initial compression parameters corresponding to the pixel block, the brightness correction data corresponding to the pixel block is compressed to determine the updated data impairment information corresponding to the pixel block. If, under each preset grayscale, the number of updated damaged pixels corresponding to the pixel block is less than or equal to a first threshold and the updated loss value is less than or equal to a second threshold, then the updated initial compression parameters corresponding to the pixel block are determined as the target compressed data corresponding to the pixel block.
5. The method according to claim 1, characterized in that, After determining the target compression parameters corresponding to the pixel block based on the data impairment information and the initial compression parameters corresponding to the pixel block, the method further includes: Based on the target compression parameters corresponding to the pixel block, the initial compression parameters corresponding to the pixel block are updated; Based on the updated initial compression parameters corresponding to the pixel block, the brightness correction data corresponding to the pixel block is compressed to determine the updated initial compressed data corresponding to the pixel block; If the total length of the updated initial compressed data corresponding to the target region is greater than or equal to the preset length, the initial compression parameter corresponding to the target compression parameter of the pixel block is determined as the target compression parameter corresponding to the pixel block. The preset length is the product of the total length of all brightness correction data corresponding to the target area and the preset compression rate.
6. The method according to claim 1, characterized in that, The method further includes: In response to the fact that the number of each damaged pixel in the target area is less than or equal to the first threshold, each loss value is less than or equal to the second threshold, and the total length of the initial compressed data corresponding to all pixel blocks is less than a preset length, the first threshold and the second threshold are reduced. The preset length is the product of the total length of all brightness correction data corresponding to the target area and the preset compression rate.
7. The method according to claim 2, characterized in that, The step of pre-encoding the brightness correction data corresponding to the pixel block based on a preset compression ratio to determine the initial compression parameters corresponding to the pixel block includes: The product of the total length of the brightness correction data corresponding to the pixel block and the preset compression rate is determined as the maximum length corresponding to the pixel block; Based on the maximum length, the brightness correction data corresponding to the pixel block is pre-encoded to determine the initial compression parameters corresponding to the pixel block.
8. The method according to claim 1, characterized in that, Before precoding the brightness correction data corresponding to the pixel blocks in the target area and determining the initial compression parameters and data impairment information corresponding to the pixel blocks, the method further includes: The target region is divided into multiple pixel blocks.
9. A data compression device, characterized in that, The device includes: The first determining module is used to pre-encode the brightness correction data corresponding to the pixel block in the target area and determine the initial compression parameters and data impairment information corresponding to the pixel block. The second determining module is used to determine the target compression parameters corresponding to the pixel block based on the data impairment information corresponding to the pixel block and the initial compression parameters; A compression module is used to compress the brightness correction data corresponding to the pixel block based on the target compression parameters corresponding to the pixel block; The initial compression parameters include first compression parameters corresponding to each preset grayscale, and the target compression parameters include second compression parameters corresponding to each preset grayscale. The second determining module is used to adjust the first compression parameters corresponding to the pixel block at the first preset grayscale based on a preset adjustment range and a preset adjustment direction in response to the pixel block having a number of damaged pixels greater than a first threshold or a loss value greater than a second threshold at the first preset grayscale, thereby obtaining the second compression parameters corresponding to the pixel block at the first preset grayscale. In response to the fact that the number of damaged pixels corresponding to the pixel block is less than or equal to the first threshold and the corresponding loss value is greater than the second threshold under the second preset gray level, the first compression parameter corresponding to the pixel block under the second preset gray level is determined as the second compression parameter corresponding to the pixel block under the second preset gray level. The data impairment information includes at least one of the number of damaged pixels corresponding to each preset grayscale and the loss value, and the device further includes: The third determining module is used to determine the adjacent pixel blocks corresponding to each pixel block when the target area contains multiple pixel blocks; Based on the number of damaged pixels corresponding to the adjacent pixel blocks at each preset gray level, determine the first reference number corresponding to each pixel block at each preset gray level; Based on the number of damaged pixels corresponding to all pixel blocks at each preset gray level, determine the second reference number corresponding to each pixel block at each preset gray level; A third reference quantity is determined based on the first reference quantity and the second reference quantity; Based on the third reference quantity, the first threshold corresponding to each pixel block under each preset grayscale is determined; The device further includes a fourth determining module, the fourth determining module being configured to: When the target area contains multiple pixel blocks, determine the adjacent pixel blocks corresponding to each pixel block; Based on the loss values corresponding to the adjacent pixel blocks at each preset gray level, determine the first reference loss value corresponding to each pixel block at each preset gray level; Based on the loss values of all pixel blocks at each preset gray level, determine the second reference loss value of each pixel block at each preset gray level; A third reference loss value is determined based on the first reference loss value and the second reference loss value; Based on the third reference loss value, the second threshold corresponding to each pixel block under each preset grayscale is determined.
10. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the data compression method as described in any one of claims 1-8.
11. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the data compression method as described in any one of claims 1-8.
12. 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, and the program instructions are executed by the processing unit. The processing unit is used to execute the data compression method as described in any one of claims 1-8.