An image compression method and compression device for RAM storage

By dividing area blocks of image data and adopting multiple compression methods, comparing the compression result with the smallest error as the encoding mode, the problem of fixed-length encoding and flexible access in RAM storage is solved, and efficient image data compression and decompression is achieved.

CN114938451BActive Publication Date: 2025-07-18NEW VISION MICROELECTRONICS INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210337940.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2025-07-18
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

The existing compression algorithms for RAM storage have problems such as fixed-length encoding, large circuit resource loss, and flexible access when implementing hardware, making it difficult to achieve simple and efficient image data compression.

Method used

The image data is divided into specific area blocks, and no less than two compression methods are used to compress, and the compression result with the smallest error is used as the current encoding mode, including sampling point value calculation, grayscale statistics, area division and state value determination.

Benefits of technology

It realizes RAM storage of fixed-length codewords, with a compression rate of up to 2 to 4 times, reduces RAM storage capacity, low hardware resource loss, supports flexible access, and is suitable for RAM storage of display driver ICs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114938451B_ABST
    Figure CN114938451B_ABST
Patent Text Reader

Abstract

The present invention provides an image compression method for RAM storage, which is characterized by the following steps: delimiting a specific region block for image data, and compressing the specific region block by using no less than two compression methods to obtain compression results respectively; comparing the compression results, and taking the compression mode corresponding to the compression result with the minimum error as the current compression coding mode, and outputting the compression result corresponding to the specific region block; the specific region block is a 2*8 region block. There is also provided an image compression and reconstruction device for RAM storage. Through the compression device provided by the present invention, the compression of RAM storage images can be effectively achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip design, especially display driver chips, and specifically relates to the compressed access of RAM in a display driver IC, namely an image compression method for RAM storage and a corresponding compression device. Background Art

[0002] Nowadays, the consumer electronics market has great prospects. Electronic products such as smart phones, TVs, watches, and tablets have become an indispensable part of people's lives. To meet customer needs, the resolution of display panels is getting higher and higher, so the demand for image data storage in display driver ICs is also increasing.

[0003] The RAM module in the display driver IC ensures that the display of static image data does not need to be continuously updated, reducing the interface power consumption.

[0004] However, RAM occupies a large proportion of the area in the entire IC. The increase in chip area leads to an increase in manufacturing cost. Therefore, on the premise of ensuring the display effect, compressing and storing data can reduce the storage capacity of RAM, reduce the chip area, and reduce the design and manufacturing cost of the chip.

[0005] For the compression algorithm of RAM storage in hardware implementation, in order to ensure good clock characteristics, the compressed codewords are preferably fixed-length encoded, and the RAM data itself needs to be flexibly accessed, and the lower the resource loss of hardware implementation, the better.

[0006] Huffman coding, run-length coding, and Golomb coding are simple to implement, but they are not fixed-length coding, which causes certain difficulties for the hardware implementation of compression and decompression. The compression algorithm based on the frequency domain space is quite complex in the time-frequency conversion process. Correspondingly, the circuit resource loss is large, and it is difficult to flexibly access the compressed data.

[0007] The objective of the present invention is to implement a compression method for RAM storage and a corresponding compression device that are relatively simple to implement but efficient. Summary of the Invention

[0008] In view of the defects in the prior art, the present invention provides an image compression method for RAM storage, which is characterized by including the following steps:

[0009] a. Designate a specific region block for the image data, and compress the specific region block using at least two compression methods to obtain compression results respectively;

[0010] b. Compare the compression results, and use the compression mode corresponding to the compression result with the minimum error as the current compression coding mode, and output the compression result corresponding to the specific region block;

[0011] Among them, the specific region block is a 2*8 region block;

[0012] Among them, the first compression method in the at least two compression methods is as follows:

[0013] Step i11: Take the sampling point value at the point with coordinates (0,0) of the specific region block as value a, take the sampling point value at the point with coordinates (2,-1) of the specific region block as value b, take the sampling point value at the point with coordinates (4,0) of the specific region block as value c, take the sampling point value at the point with coordinates (6,-1) of the specific region block as value d, and take the sampling point value at the point with coordinates (7,0) of the specific region block as value e;

[0014] Step i12: Use the step length between the sampling point and an unsampled point as the weight coefficient and calculate the pixel value of the unsampled point within the specific region block according to the sampling point value.

[0015] Preferably, step i12 includes the following steps: Calculate the values of the remaining sub-pixel points through the following formula:

[0016] p2 = 1 / 4*a + 1 / 2*b + 1 / 4*c, where p2 represents the value corresponding to the point with coordinates (2,0) of the specific region block;

[0017] p1 = 1 / 2*p2 + 1 / 2*a = 1 / 8*a + 1 / 4*b + 1 / 8*c + 1 / 2*a, where p1 represents the value corresponding to the point with coordinates (1,0) of the specific region block;

[0018] p3 = 1 / 2*p2 + 1 / 2*c = 1 / 8*a + 1 / 4*b + 1 / 8*c + 1 / 2*c, where p3 represents the value corresponding to the point with coordinates (3,0) of the specific region block;

[0019] p4 = 1 / 2*c + 1 / 4*d + 1 / 4*e, where p4 represents the value corresponding to the point with coordinates (5,0) of the specific region block;

[0020] p5 = 1 / 4*c + 3 / 8*d + 3 / 8*e, where p1 represents the value corresponding to the point with coordinates (6,0) of the specific region block;

[0021] p6 = 3 / 4*a + 1 / 4*b, where p1 represents the value corresponding to the point with coordinates (0,-1) of the specific region block;

[0022] p7 = 1 / 4*a + 3 / 4*b, where p1 represents the value corresponding to the point with coordinates (1,-1) of the specific region block;

[0023] p9 = 1 / 4 * b + 1 / 2 * c + 1 / 4 * d, where p1 represents the value corresponding to the point with coordinates (4, -1) in the specific region block;

[0024] p8 = 1 / 2 * p9 + 1 / 2 * b = 1 / 8 * b + 1 / 4 * c + 1 / 8 * d + 1 / 2 * b, where p1 represents the value corresponding to the point with coordinates (3, -1) in the specific region block;

[0025] p10 = 1 / 2 * p9 + 1 / 2 * d = 1 / 8 * b + 1 / 4 * c + 1 / 8 * d + 1 / 2 * d, where p1 represents the value corresponding to the point with coordinates (5, -1) in the specific region block;

[0026] p11 = 1 / 2 * d + 1 / 2 * e, where p1 represents the value corresponding to the point with coordinates (7, -1) in the specific region block.

[0027] Preferably, the second compression method among the at least two compression methods is as follows:

[0028] Step i21: Perform high - gray - level and low - gray - level statistics on the pixel values of the specific region block, and use the gray - level with the largest quantity as the reference gray - level;

[0029] Step i22: Determine the median value of the pixel values corresponding to the reference gray - level as the reference background value;

[0030] Step i23: Determine the reference position in units of 2 * 2 regions for the specific region block. Among them, if the reference gray - level is a high gray - level, then determine the position of the sub - pixel point with the smallest value in the 2 * 2 region as the reference position; if the reference gray - level is a low gray - level, then determine the position of the sub - pixel point with the largest value in the 2 * 2 region as the reference position;

[0031] Step i24: Take the upper 5 bits of the value corresponding to the reference position, and determine the status values of other sub - pixel points in the 2 * 2 region as 0 or 1. Among them, if the gray - level of the sub - pixel point is the same as the reference gray - level, then determine the status value of the sub - pixel point as 0, otherwise determine the status value of the sub - pixel point as 1.

[0032] Preferably, step i21 can be implemented through the following steps: Perform high - gray - level and low - gray - level statistics on the upper row of the specific region block, and use the one with the largest quantity as the reference gray - level.

[0033] Further preferably, when the specific region block is the region block of the first row and the second row, that is, this specific region block does not have an upper row, then the reference background value of this specific region block, that is, the first row and the second row, is defaulted to 0.

[0034] Preferably, during the decompression process for the above second compression method, the values of other sub-pixel points in the 2×2 area are calculated through the following steps:

[0035] Step i25: If the status value of the sub-pixel point is 0, determine that the pixel value of the current sub-pixel point is the reference background value;

[0036] Step i26: If the status value of the sub-pixel point is 1, find all determined pixel values within the area where the step length from the current sub-pixel point is no greater than 2, and calculate the determined pixel values with the step length group as the coefficient weights. The obtained calculated value is used as the pixel value of the current sub-pixel point.

[0037] Preferably, the third compression method among the at least two compression methods is as follows:

[0038] Step i31: Divide the specific area block into sub-area blocks with 2×4 areas as units;

[0039] Step i32: Count the pixel values within the two 2×4 sub-area blocks, summarize the quantity of each pixel value, and determine the number of identical pixel values in the two sub-areas;

[0040] Step I33: Determine a reference value for each sub-area block, determine a shared equilibrium value for two adjacent sub-area blocks, and determine a status bit for each sub-pixel point within each sub-area block. The status bit is 0 or 1;

[0041] Among them, when the number of different pixel values in each sub-area is less than or equal to 2, and the number of different pixel values in a 2×8 area is less than or equal to 3, the sub-area reference value is the unique pixel value of the sub-area, and the equilibrium value is the common pixel value of two adjacent sub-area blocks; when the number of different pixel values in the 2×8 area is greater than 3, the sub-area reference value is the average value of the unique pixel values of the sub-area, and the equilibrium value is the median of the common pixel values of two adjacent sub-area blocks.

[0042] Preferably, during the decompression process for the above third compression method, the values of the sub-pixel points within each sub-area block are calculated through the following steps:

[0043] Step i34: If the value of the sub-pixel point is 0, use the reference value of the sub-area block where the sub-pixel point is located as the image value of the sub-pixel point; otherwise, use the equilibrium value of the sub-area block where the sub-pixel point is located as the image value of the sub-pixel point.

[0044] Preferably, the fourth compression method among the at least two compression methods is as follows:

[0045] Step i41: Divide the specific region block into sub-region blocks in units of 2*2 regions;

[0046] Step i42: Obtain the status value with a bit length of 4 bits and the compensation value with a bit length of 6 bits for each sub-region block, wherein the pixel value of each sub-pixel point in the sub-region block is determined based on the status value and the compensation value.

[0047] Preferably, step i42 includes the following steps:

[0048] Step i421: Induce and group the pixel values of the sub-pixels in the sub-region block, the difference between the pixel values within each group is less than the first threshold, and the difference between two groups of values is greater than the second threshold;

[0049] Step i422: Determine the status value of the sub-region block according to the grouping situation.

[0050] Step i423: Process each group of values and obtain the compensation value.

[0051] Preferably, step i423 includes the following steps: Take the high bits after averaging each group of values to obtain the compensation value.

[0052] Preferably, the above step i423 may further include the following steps:

[0053] Step i4231: If the value of the status value is less than or equal to 10, take the average or median value of the sub-pixel points with the first status in the sub-region block as the first value, take the average or median value of the sub-pixel points with the second status in the sub-region block as the second value, and combine the high 3 bits of the first value and the high 3 bits of the second value as the compensation value; if the value of the status value is greater than 10, determine the high 6 bits of the average or median value of each sub-pixel point in the sub-region block as the compensation value.

[0054] Preferably, for the above step i421, the number of groups does not exceed 2. Correspondingly, steps i421 and i422 are implemented through the following steps:

[0055] - Compare each sub-pixel point in the sub-region block, and count the sub-pixel points with a comparison result greater than the third threshold as the first status points, and vice versa as the second status points;

[0056] - Determine the status value of the sub-region block according to the number and position of the first status points and the second status points in the sub-region block.

[0057] Preferably, in step b, the compression method corresponding to the minimum value among the maximum error values of sub-pixel reconstruction in various compression results is used as the current compression coding method.

[0058] Preferably, for step b above, if the maximum error values of not less than two compression methods are all the minimum values, then the compression method corresponding to the minimum value among the error sums of sub-pixel reconstruction in various compression results is used as the current compression coding method.

[0059] Preferably, for the above compression method, for each compression method, a status value uniquely corresponding to this compression method is determined, and the specific compression method corresponding thereto is determined according to this status value during the decompression process.

[0060] According to another aspect of the present invention, there is also provided an image compression and reconstruction device for RAM storage, which is characterized in that it includes the following devices:

[0061] A first processing device, which is used to delimit a specific region block for image data and compress the specific region block by using not less than two compression methods to respectively obtain compression results;

[0062] A first comparison device, which is used to compare the compression results and use the compression mode corresponding to the compression result with the minimum error as the current compression coding mode, and output the compression result corresponding to the specific region block;

[0063] Wherein, the specific region block is a 2*8 region block;

[0064] Wherein, the first processing device at least includes a first compression device and a second compression device, and the first compression device performs compression processing in the following manner:

[0065] Step i11: Take the sampling point value at the coordinate (0,0) of the specific region block as value a, take the sampling point value at the coordinate (2, -1) of the specific region block as value b, take the sampling point value at the coordinate (4,0) of the specific region block as value c, take the sampling point value at the coordinate (6, -1) of the specific region block as value d, and take the sampling point value at the coordinate (7,0) of the specific region block as value e;

[0066] Step i12: Calculate the pixel values of the unsampled points in the specific region block according to the step length between the sampling point and an unsampled point as the weight coefficient and according to the sampling point values.

[0067] Preferably, the first compression device includes a fifth compression device, which calculates the values of the remaining sub-pixel points through the following formula:

[0068] p2 = 1 / 4 * a + 1 / 2 * b + 1 / 4 * c, where p2 represents the value corresponding to the point with coordinates (2, 0) in the specific region block;

[0069] p1 = 1 / 2 * p2 + 1 / 2 * a = 1 / 8 * a + 1 / 4 * b + 1 / 8 * c + 1 / 2 * a, where p1 represents the value corresponding to the point with coordinates (1, 0) in the specific region block;

[0070] p3 = 1 / 2 * p2 + 1 / 2 * c = 1 / 8 * a + 1 / 4 * b + 1 / 8 * c + 1 / 2 * c, where p3 represents the value corresponding to the point with coordinates (3, 0) in the specific region block;

[0071] p4 = 1 / 2 * c + 1 / 4 * d + 1 / 4 * e, where p4 represents the value corresponding to the point with coordinates (5, 0) in the specific region block;

[0072] p5 = 1 / 4 * c + 3 / 8 * d + 3 / 8 * e, where p1 represents the value corresponding to the point with coordinates (6, 0) in the specific region block;

[0073] p6 = 3 / 4 * a + 1 / 4 * b, where p1 represents the value corresponding to the point with coordinates (0, -1) in the specific region block;

[0074] p7 = 1 / 4 * a + 3 / 4 * b, where p1 represents the value corresponding to the point with coordinates (1, -1) in the specific region block;

[0075] p9 = 1 / 4 * b + 1 / 2 * c + 1 / 4 * d, where p1 represents the value corresponding to the point with coordinates (4, -1) in the specific region block;

[0076] p8 = 1 / 2 * p9 + 1 / 2 * b = 1 / 8 * b + 1 / 4 * c + 1 / 8 * d + 1 / 2 * b, where p1 represents the value corresponding to the point with coordinates (3, -1) in the specific region block;

[0077] p10 = 1 / 2 * p9 + 1 / 2 * d = 1 / 8 * b + 1 / 4 * c + 1 / 8 * d + 1 / 2 * d, where p1 represents the value corresponding to the point with coordinates (5, -1) in the specific region block;

[0078] p11 = 1 / 2 * d + 1 / 2 * e, where p1 represents the value corresponding to the point with coordinates (7, -1) in the specific region block.

[0079] Preferably, the second compression device completes the compression process in the following manner:

[0080] Step i21: Perform high - gray - level and low - gray - level statistics on the pixel values of the specific region block, and use the gray - level with the largest quantity as the reference gray - level;

[0081] Step i22: Determine the median of the pixel values corresponding to the reference gray level as the reference background value;

[0082] Step i23: Determine the reference position for each 2*2 area within the specific region block. Specifically, if the reference gray level is a high gray level, determine the position of the sub-pixel point with the smallest value within the 2*2 area as the reference position; if the reference gray level is a low gray level, determine the position of the sub-pixel point with the largest value within the 2*2 area as the reference position;

[0083] Step i24: Take the upper 5 bits of the value corresponding to the reference position, and determine the status value of the other sub-pixel points within the 2*2 area as 0 or 1. Specifically, if the gray level of the sub-pixel point is the same as the reference gray level, determine the status value of the sub-pixel point as 0; otherwise, determine the status value of the sub-pixel point as 1.

[0084] Preferably, the second compression device includes a second decompression device, which is used to calculate the values of the other sub-pixel points within the 2*2 area during the decompression process through the following steps:

[0085] Step i241: If the status value of the sub-pixel point is 0, determine the pixel value of the current sub-pixel point as the reference background value;

[0086] Step i242: If the status value of the sub-pixel point is 1, search for all determined pixel values within the area where the step size from the current sub-pixel point is no more than 2, and calculate the determined pixel values according to the step size group as the coefficient weights. The calculated value is used as the pixel value of the current sub-pixel point.

[0087] Preferably, the compression device further includes a third compression device, which performs compression processing in the following manner:

[0088] Step i31: Divide the specific region block into sub-region blocks in units of 2*4 areas;

[0089] Step i32: Count the pixel values within the two 2*4 sub-region blocks, summarize the number of each pixel value, and determine the number of the same pixel values in the two sub-regions;

[0090] Step I33: Determine a reference value for each sub-region block, determine a common equilibrium value for two adjacent sub-region blocks, and determine a status bit for each sub-pixel point within each sub-region block. The status bit is 0 or 1;

[0091] Among them, when the different pixel values of each sub-region are less than or equal to 2, and the different pixel values of a 2*8 region are less than or equal to 3, the reference value of the sub-region is the unique pixel value of the sub-region, and the equalization value is the common pixel value of two adjacent sub-region blocks; when the different pixel values of the 2*8 region are greater than 3, the reference value of the sub-region is the average value of the unique pixel values of the sub-region, and the equalization value is the median value of the common pixel values of two adjacent sub-region blocks.

[0092] Preferably, the third compression device includes a third decompression device, which is used to calculate the values of the sub-pixel points in each sub-region block during decompression through the following steps:

[0093] Step i34: If the value of the sub-pixel point is 0, the reference value of the sub-region block where the sub-pixel point is located is used as the image value of the sub-pixel point; otherwise, the equalization value of the sub-region block where the sub-pixel point is located is used as the image value of the sub-pixel point.

[0094] Preferably, the compression device further includes a fourth compression device, which performs compression processing in the following manner:

[0095] Step i41: Divide the specific region block into sub-region blocks in units of 2*2 regions;

[0096] Step i42: Obtain the status value with a bit length of 4 bits and the compensation value with a bit length of 6 bits for each sub-region block, where the pixel value of each sub-pixel point in the sub-region block is determined based on the status value and the compensation value.

[0097] Preferably, the fourth compression device includes a sixth compression device, which is used to complete the processing of the above step i42 through the following manner:

[0098] Step i421: Induce and group the pixel values of the sub-pixels in the sub-region block, the difference between the pixel values within each group is less than the first threshold, and the difference between the two groups of values is greater than the second threshold;

[0099] Step i422: Determine the status value of the sub-region block according to the grouping situation.

[0100] Step i423: Process each group of values and obtain the compensation value.

[0101] Preferably, the sixth compression device further includes a seventh compression device, which is used to complete the processing of the above step i423 through the following manner: Take the high bits after averaging each group of values to obtain the compensation value.

[0102] Preferably, the sixth compression device further includes an eighth compression device, which is used to complete the processing of step i423 in the following manner:

[0103] Step i4231: If the value of the status value is less than or equal to 10, then take the mean or median of the sub-pixel points with the first status point in the sub-region block as the first value, and take the mean or median of the sub-pixel points with the second status point in the sub-region block as the second value, and combine the high 3 bits of the first value and the high 3 bits of the second value as the compensation value; if the value of the status value is greater than 10, then determine the high 6 bits of the mean or median of each sub-pixel point in the sub-region block as the compensation value.

[0104] Preferably, the first comparison device takes the compression method corresponding to the minimum value among the maximum error values of sub-pixel reconstruction in various compression results as the current compression coding method.

[0105] Preferably, during the processing of the first comparison device, if the maximum error values of not less than two compression methods are all the minimum values, then take the compression method corresponding to the minimum value among the error sums of sub-pixel reconstruction in various compression results as the current compression coding method.

[0106] Through the control method and control device provided by the present invention, a compression method for RAM image storage can be conveniently and cost-effectively realized, which has sufficient practicability and is convenient for mass production and large-scale application.

[0107] The method implemented by the present invention achieves fixed-length codewords and adjusts the sampling points. According to the display requirements, the compression ratio can reach 2 to 4 times, reducing the storage capacity of the RAM. The hardware resource consumption of the algorithm implementation is low, and the basic requirements of flexible access to the RAM can be achieved. The present invention achieves fixed-length coding, real-time compression and decompression, and the hardware implementation is simple. To a certain extent, it achieves flexible access and is suitable for accessing data facing the RAM. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] By reading the following detailed description of the non-limiting embodiments with reference to the accompanying drawings, other features, objects and advantages of the present invention will become more apparent:

[0109] Figure 1 Shows a flowchart of an image compression method for RAM storage according to a specific embodiment of the present invention;

[0110] Figure 2 Shows a schematic diagram of the specific implementation of a preferred compression method in an image compression method for RAM storage according to a specific embodiment of the present invention;

[0111] Figure 3Schematic diagram showing a specific implementation of a preferred compression method in an image compression method for RAM storage, which shows a specific embodiment of the present invention;

[0112] Figure 4 Schematic diagram showing a specific implementation of a preferred compression method in an image compression method for RAM storage, which shows a specific embodiment of the present invention;

[0113] Figure 5 Schematic diagram showing a specific implementation of a preferred compression method in an image compression method for RAM storage, which shows a specific embodiment of the present invention;

[0114] Figure 6 Schematic diagram showing a specific implementation of a preferred compression method in an image compression method for RAM storage, which shows a specific embodiment of the present invention;

[0115] Figure 7 Schematic diagram showing a specific implementation of a preferred compression method in an image compression method for RAM storage, which shows a specific embodiment of the present invention; and

[0116] Figure 8 Schematic diagram of an image compression device for RAM storage, which shows a specific embodiment of the present invention. Specific Embodiment

[0117] Those skilled in the art understand that the present invention provides a simple and feasible compression method, which can be effectively implemented and is convenient for management.

[0118] Specifically, refer to Figure 1 Flowchart of an image compression method for RAM storage, which shows a specific embodiment of the present invention. Through the preferred embodiment provided by the present invention, image compression for RAM storage is achieved. Specifically, Figure 1 The compression process is shown, that is:

[0119] First, step S101 is executed to delimit a specific region block for the image data and compress the specific region block using at least two compression methods to obtain compression results respectively;

[0120] Then, step S102 is entered to compare the compression results, and the compression method corresponding to the minimum value among the maximum error values of sub-pixel reconstruction in various compression results is used as the current compression coding method.

[0121] Finally, step S103 is executed. If the maximum error values of at least two compression methods are all the minimum values, then the compression method corresponding to the minimum value among the error sums of sub-pixel reconstruction in various compression results is used as the current compression coding method.

[0122] Further, referring to Figures 2 to 5 the illustrated embodiment, which shows at least four compression algorithms. For each compression algorithm, a state value uniquely corresponding to the compression method is determined, and the specific compression method corresponding thereto is determined according to the state value during the decompression process. For example Figure 2 the illustrated embodiment gives the state value 00 corresponding to the compression method. That is, during the decompression process, in a preferred embodiment, this state value will be recognized. When the state value "00" is read, it is determined as Figure 2 the compression method shown, which we call the first compression method. For specific reference, see Figure 2 the explanation of the illustrated embodiment. Correspondingly Figure 3 the state value of the second compression method shown is "01", Figure 4 the state value of the third compression method shown is "10", Figure 5 the state value of the fourth compression method shown is "11", etc. In a variant, more compression methods other than those shown in Figures 2 to 5 the illustrated embodiment can be set, and one of the compression methods is selected as the current compression coding mode according to Figure 1 the illustrated embodiment and other variants, so as to implement the compression method of the RAM image provided by the present invention.

[0123] Furthermore, after S103, if there are multiple minimum values among the sums of the sub-pixel reconstruction errors in various compression results, for example, the minimum values in the sums of the errors corresponding to the second compression method and the fourth compression method are the same, then the compression method with the earlier state value is selected as the current compression coding mode according to the state value corresponding to the compression method, that is, the second compression method "01" is selected. That is, the compression method priority is determined as "00" > "01" > "10" > "11", and the compression method is determined according to the priority. Further, if there are more compression methods, the state value can be represented by 3 bits, 4 bits, etc., so that the fifth and sixth compression methods can be expressed by "0100" and "0101" for their state values, thus having sufficient expansion space.

[0124] Furthermore, in a preferred embodiment, the image RGB processing is independent of each other. The image is divided into 2*8 blocks, and padding is performed if the boundary is insufficient. The compression mode is divided into 4 types. During compression coding, the errors of the 4 compression modes are calculated, and the mode with the smallest error is the current coding mode. If the errors are the same, they are processed in sequence.

[0125] Furthermore, those skilled in the art understand that the present invention provides the most basic compression framework and can have sufficient variations and substitution examples. Those skilled in the art also understand that in the process of giving examples, preferably a solution for compressing and encoding two rows of pixel points is adopted. However, in more preferred embodiments, more rows of pixel points can also be adaptively compressed, and the content of the present invention can be adjusted according to specific requirements, which are all within the protection scope of the present invention.

[0126] Further, continuing with the above Figure 1 illustrated embodiment, Figure 2 shows a schematic diagram of a specific implementation of a preferred compression method in an image compression method for RAM storage, which is a specific implementation manner of the present invention. As described in the above embodiment, the Figure 2 illustrated compression method can be used as the first compression method. Figure 2 The illustrated compression method is preferably implemented through the following steps:

[0127] Step i11: Take the sampling point value at the point with coordinates (0, 0) of the specific region block as value a, take the sampling point value at the point with coordinates (2, -1) of the specific region block as value b, take the sampling point value at the point with coordinates (4, 0) of the specific region block as value c, take the sampling point value at the point with coordinates (6, -1) of the specific region block as value d, and take the sampling point value at the point with coordinates (7, 0) of the specific region block as value e;

[0128] Step i12: Calculate the pixel values of the unsampled points within the specific region block according to the step length between the sampling point and an unsampled point as the weight coefficient and according to the sampling point values.

[0129] Furthermore, those skilled in the art understand that in a preferred embodiment, in step i12, the values of the remaining sub-pixel points are calculated through the following formula:

[0130] p2 = 1 / 4 * a + 1 / 2 * b + 1 / 4 * c, where p2 represents the value corresponding to the point with coordinates (2, 0) of the specific region block;

[0131] p1 = 1 / 2 * p2 + 1 / 2 * a = 1 / 8 * a + 1 / 4 * b + 1 / 8 * c + 1 / 2 * a, where p1 represents the value corresponding to the point with coordinates (1, 0) of the specific region block;

[0132] p3 = 1 / 2 * p2 + 1 / 2 * c = 1 / 8 * a + 1 / 4 * b + 1 / 8 * c + 1 / 2 * c, where p3 represents the value corresponding to the point with coordinates (3, 0) of the specific region block;

[0133] p4 = 1 / 2*c + 1 / 4*d + 1 / 4*e, where p4 represents the value corresponding to the point with coordinates (5, 0) in the specific region block;

[0134] p5 = 1 / 4*c + 3 / 8*d + 3 / 8*e, where p1 represents the value corresponding to the point with coordinates (6, 0) in the specific region block;

[0135] p6 = 3 / 4*a + 1 / 4*b, where p1 represents the value corresponding to the point with coordinates (0, -1) in the specific region block;

[0136] p7 = 1 / 4*a + 3 / 4*b, where p1 represents the value corresponding to the point with coordinates (1, -1) in the specific region block;

[0137] p9 = 1 / 4*b + 1 / 2*c + 1 / 4*d, where p1 represents the value corresponding to the point with coordinates (4, -1) in the specific region block;

[0138] p8 = 1 / 2*p9 + 1 / 2*b = 1 / 8*b + 1 / 4*c + 1 / 8*d + 1 / 2*b, where p1 represents the value corresponding to the point with coordinates (3, -1) in the specific region block;

[0139] p10 = 1 / 2*p9 + 1 / 2*d = 1 / 8*b + 1 / 4*c + 1 / 8*d + 1 / 2*d, where p1 represents the value corresponding to the point with coordinates (5, -1) in the specific region block;

[0140] p11 = 1 / 2*d + 1 / 2*e, where p1 represents the value corresponding to the point with coordinates (7, -1) in the specific region block.

[0141] Furthermore, those skilled in the art understand that in the above Figure 2 illustrated embodiment, the pixel value of each sub-pixel is calculated through the pixel values of the surrounding sub-pixels. The surrounding sub-pixels are assigned a step size according to the distance from the sub-pixel to be calculated, that is, the current sub-pixel. The step size is used as the weight for calculating the current sub-pixel, and the sum of the step size weights of all surrounding sub-pixels is 1. According to this principle, the pixel values of P1 - P11 can be calculated through the above steps.

[0142] Referring to the above Figure 2 illustrated embodiment, those skilled in the art understand that in a variant, other methods can also be used to calculate the pixel values of P1 - P11 based on the pixel values of a - e, which are all within the protection scope of the present invention.

[0143] Correspondingly, those skilled in the art understand that during the decompression process, the pixel values of each pixel point of P1 - P11 are calculated accordingly according to the above steps, so as to obtain the RAM - stored image. Or it can be more straightforwardly understood that the step i12 is a decompression process.

[0144] Furthermore, in the Figure 2 embodiment shown above, the background is preferably considered continuous. And 5 sampling point values from 'a' to 'e' are selected in the above - mentioned sub - region, and the values at the positions of P1 - P11 are reconstructed through the 5 sampling point values. In another variant, the positions of the 5 sampling point values from 'a' to 'e' in the sub - region can be adjusted, or 6 sampling points can be used, which are all within the protection scope of the present invention.

[0145] Further, continuing with the Figure 1 、 Figure 2 embodiment shown above, Figure 3 、 Figure 6 respectively show the specific implementation manners of the present invention from different perspectives. A schematic diagram of a preferred compression method in an image compression method for RAM storage is shown. Specifically, the second compression method realizes the compression process through the following steps:

[0146] Step i21: Perform high - gray - level and low - gray - level statistics on the pixel values of the specific region block, and use the gray - level with the largest quantity as the reference gray - level;

[0147] Step i22: Determine the median value of the pixel values corresponding to the reference gray - level as the reference background value;

[0148] Step i23: Determine the reference position in units of 2*2 regions for the specific region block. Among them, if the reference gray - level is a high gray - level, determine the position of the sub - pixel point with the smallest value in the 2*2 region as the reference position; if the reference gray - level is a low gray - level, determine the position of the sub - pixel point with the largest value in the 2*2 region as the reference position;

[0149] Step i24: Take the upper 5 bits of the value corresponding to the reference position, and determine the state values of other sub - pixel points in the 2*2 region as 0 or 1. Among them, if the gray - level of the sub - pixel point is the same as the reference gray - level, determine the state value of the sub - pixel point as 0, otherwise determine the state value of the sub - pixel point as 1.

[0150] Correspondingly, in the Figure 2 preferred embodiment shown, during the decompression process, calculate the values of other sub - pixel points in the 2*2 region through the following steps:

[0151] Step i241: If the state value of the sub-pixel is 0, determine the pixel value of the current sub-pixel as the reference background value;

[0152] Step i242: If the state value of the sub-pixel is 1, find all determined pixel values within the area where the step size from the current sub-pixel is no more than 2, and calculate the determined pixel values according to the step size group as coefficient weights. The obtained calculated value is used as the pixel value of the current sub-pixel.

[0153] Further, those skilled in the art understand that in the above second compression method and the corresponding decompression method, preferably, the gray level of the first two rows being processed is statistically analyzed, and there is 1 RGB background value for every two rows. In another variant, more rows of pixel points and sub-pixel points can be processed, but the compression method adopted is still the one shown above, and all these are within the protection scope of the present invention.

[0154] Furthermore, those skilled in the art understand that Figure 2 In the shown embodiment, preferably, the 2*8 interval is divided into 4 2*2 intervals. If the background value is a high gray level, find the position of the minimum value, and vice versa, find the position of the maximum value. The positioning of the 4 interval positions totals 2*4 = 8bit;

[0155] For the maximum value, take the upper 5 bits of the 8-bit value, and use "0" and "1" to mark the remaining positions. Here, "0" indicates that the pixel value at the current position is the background value, and "1" indicates that the pixel value at the current position is related to the selected foreground value. The total bit value is: 8 + 20 + 12 = 40bit;

[0156] If it is a background value, fill it directly; if it is a foreground value, after filling the background value, calculate it through a formula similar to that in Method 1. The foreground value reconstruction steps are as follows:

[0157] 1) Fill the background value;

[0158] 2) Determine whether each position is a foreground value or a background value in the calculation order of Method 1;

[0159] 3) In non-boundary cases,

[0160] If there are values at both the left and right adjacent positions, the calculation method is as shown in p1;

[0161] If there is a value at only one adjacent side position, the calculation method is as shown in p5;

[0162] If there are no values at both adjacent side positions, the calculation method is as shown in p2.

[0163] 4) In the boundary case, obtain the calculated value at position 6. If there is no value at position 5 / position 12, then position 6 takes 1 / 2 of the value at position d.

[0164] 5) After obtaining the value at position 6 in the boundary, calculate the values of other positions according to Method 1.

[0165] Furthermore, those skilled in the art understand that in a variant, compression processing can also be performed on more rows together. At this time, the above methods can still be applied for compression, which are all within the protection scope of the present invention.

[0166] Reference Figure 2 and Figure 3 In view of the embodiments shown, those skilled in the art understand that the step length of the reference sub-pixel point can be calculated with the current sub-pixel point as the origin, and the pixel value of the current sub-pixel point can be calculated according to the pixel value of the reference sub-pixel point and the step length weight. Specifically, in the Figure 3 embodiment shown, the step length between the pixel point to be processed, that is, the current sub-pixel point, and the adjacent upper, lower, left, and right pixel points is "1", and the step length to the adjacent diagonal pixel points is 2. A definite pixel value is searched for within the range where the step length is less than or equal to 2, and the coefficient weight is determined according to the step length. The sum of the coefficients is equal to 1. More specifically, in the Figure 3 embodiment shown, in a preferred case, the pixel value of the current sub-pixel point is calculated by the following formula. For example, in the Figure 6 embodiment shown, which includes known foreground values "a, b, c, d" and background value "0", the value of the state "1" related to the foreground value is obtained, that is:

[0167] p2 = 1 / 2 * p1 + 1 / 2 * b;

[0168] p3 = 1 / 2 * p2 + 1 / 2 * c = 1 / 4 * p1 + 1 / 4 * b + 1 / 2 * c;

[0169] p4 = 1 / 2 * c + 1 / 2 * p11;

[0170] p5 = 1 / 2 * p4 + 1 / 2 * d = 1 / 4 * c + 1 / 4 * p11 + 1 / 2 * d;

[0171] Among them, p4 / p5 within 2 step lengths of p6 are all values to be evaluated, and the step length does not extend outward. The expression within 2 step lengths is:

[0172] p6 = 3 / 4 * p12 + 1 / 4 * d;

[0173] p7 = 1 / 2 * a + 1 / 2 * p8 = 1 / 2 * a + 1 / 4 * p1 + 1 / 4 * b;

[0174] p8 = 1 / 2 * p1 + 1 / 2 * b;

[0175] Among them, there is an overflow situation in the values within one step length around p10. According to the situation where the sum of coefficients is equal to 1, the vertical weight is given as 1 / 2 and the horizontal weight is given as 1 / 2:

[0176] p10 = 1 / 2*c + 1 / 4*p9 + 1 / 4*p11.

[0177] Furthermore, continuing with the above Figure 1 、 Figure 2 、 Figure 3 illustrated embodiments, Figure 4 、 Figure 7 shows a schematic diagram of the specific implementation of a preferred compression method in an image compression method for RAM storage in a specific implementation manner of the present invention. Specifically, the third compression method realizes the compression process through the following steps:

[0178] Step i31: Divide the specific region block into sub-region blocks in units of 2*4 regions;

[0179] Step i32: Statistically analyze the pixel values within the two 2*4 sub-region blocks, summarize the number of each pixel value, and determine the number of the same pixel values in the two sub-regions;

[0180] Step I33: Determine a reference value for each sub-region block, determine a shared equilibrium value for two adjacent sub-region blocks, and determine a status bit for each sub-pixel point within each sub-region block, where the status bit is 0 or 1;

[0181] Among them, when the number of different pixel values in each sub-region is less than or equal to 2, and the number of different pixel values in a 2*8 region is less than or equal to 3, the sub-region reference value is the unique pixel value of the sub-region, and the equilibrium value is the common pixel value of two adjacent sub-region blocks; when the number of different pixel values in the 2*8 region is greater than 3, the sub-region reference value is the average value of the unique pixel values of the sub-region, and the equilibrium value is the median of the common pixel values of two adjacent sub-region blocks.

[0182] Furthermore, for example Figure 7 shown in a preferred embodiment, the pixel values can be determined in the following manner:

[0183] The average value of the unique pixel values in Region 1 is (127 + 127) / 2 = 127;

[0184] The average value of the unique pixel values in Region 2 is (129 + 129 + 129 + 129 + 129 + 129) / 6 = 129;

[0185] The average value of the common pixel values in Region 1 and Region 2 is 128;

[0186] Accordingly, 3 8-bit values are stored, which are: 01111111; 10000001; 10000000.

[0187] Furthermore, those skilled in the art understand that in a preferred embodiment, during the decompression process, the values of the sub-pixel points within each sub-region block are calculated through the following steps: Step i34: If the value of the sub-pixel point is 0, then use the reference value of the sub-region block where the sub-pixel point is located as the image value of the sub-pixel point; otherwise, use the equilibrium value of the sub-region block where the sub-pixel point is located as the image value of the sub-pixel point.

[0188] Furthermore, those skilled in the art understand that in this embodiment, a 2*8 region is divided into 2 2*4 regions, and 3 groups of values and 1-bit status judgment are agreed upon for the 2 regions, as Figure 3 shown. The stored bit number is 8*3 + 16 = 40 bits. Through this embodiment, the values in the region are statistically summarized into 3 groups of values, where the b group of values is shared by the two regions. The value reconstruction is performed according to the flag bit "0" / "1".

[0189] Furthermore, continuing with the above Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 shown embodiments, Figure 5 shows a schematic diagram of the specific implementation of a preferred compression method in an image compression method for RAM storage, which is a specific embodiment of the present invention. Specifically, the fourth compression method realizes the compression process through the following steps:

[0190] Step i41: Divide the specific region block into sub-region blocks in units of 2*2 regions;

[0191] Step i42: Obtain the 4-bit status value and the 6-bit compensation value of each sub-region block, and determine the pixel value of each sub-pixel point within the sub-region block based on the status value and the compensation value.

[0192] Furthermore, in a preferred embodiment, step i42 includes the following steps:

[0193] Step i421: Summarize and group the pixel values of the sub-pixels within the sub-region block, and the difference between the pixel values within each group is less than the first threshold, and the difference between the two groups of values is greater than the second threshold;

[0194] Step i422: Determine the status value of the sub-region block according to the grouping situation.

[0195] Step i423: Process each group of values and obtain the compensation value.

[0196] In the above step i421, the pixel values of all sub-pixels within a sub-region block are grouped. Preferably, they are grouped into at most two groups, and in other variations, they can also be grouped into three or four groups. The grouping is carried out by means of inductive comparison. Specifically, in a preferred embodiment, all pixel values are compared, and the difference between each pixel value is calculated. All sub-pixels with a difference less than the first threshold are grouped into the first group, and the other pixel values are grouped into the second group, and it is ensured that the difference between the pixel values of the two groups of sub-pixels is greater than the second threshold. If the difference between all sub-pixel values is less than the first threshold, then it is only grouped into one group, and the second group is not required. Further, for the sake of submission accuracy, a third group, a fourth group, etc. can also be inductively obtained, which are all within the protection scope of the present invention. Further, in step i422, according to different grouping situations, the state value of a sub-region block is determined. Preferably, it is represented by a 4-bit state value. Those skilled in the art understand that according to the number of sub-pixel points in each group and the corresponding positions, different state values can be used to represent, for example, preferably as specifically as Figure 5 shown. Conversely, according to different state values, the compensation values of different sub-pixel points within a sub-region block can also be determined, thereby realizing the decompression process. For example, for Figure 5 the first grouping situation shown is set to 0000, and the corresponding state value for the second grouping situation is set to 0001, etc.

[0197] In another embodiment, preferably, the step i423 includes the following steps: After averaging each group of values, the high bits are taken to obtain the compensation value.

[0198] In yet another embodiment, preferably, the step i423 includes the following steps: Step i4231: If the value of the state value is less than or equal to 10, then the mean value or the median value of the sub-pixel points with the first state within the sub-region block is used as the first value, and the mean value or the median value of the sub-pixel points with the second state within the sub-region block is used as the second value, and the high 3 bits of the first value and the high 3 bits of the second value are combined as the compensation value; if the value of the state value is greater than 10, then the high 6 bits of the mean value or the median value of each sub-pixel point within the sub-region block are determined as the compensation value.

[0199] Further, in a preferred embodiment, the steps i421 and i42 can be implemented through the following steps:

[0200] - Compare each sub-pixel point within the sub-region block, and count the sub-pixel points with a comparison result greater than the first threshold as the first state points, and vice versa as the second state points;

[0201] - Determine the status value of the sub-region block according to the number and positions of the first status points and the second status points within the sub-region block.

[0202] Those skilled in the art understand that, preferably, through the determination of the above status value, the positions of sub-pixel points with the same attributes within a sub-region block can be determined according to the status value. For example, the sub-pixel points counted as the first status points above. And these sub-pixel points with the first status points are determined as the first group of pixel points, thus constituting the grouping situation of different sub-pixel points within a sub-region block. These sub-pixel points preferably have the same or similar pixel values.

[0203] Furthermore, those skilled in the art understand that in the above process, the method adopted by this compression method is to use 4-bit values to represent the status bits of each sub-pixel point, and use 6-bit values to determine the pixel values of each sub-pixel point. Specifically, as shown in the above step i431, there are multiple ways to determine the 6-bit value. For example, for a sub-region block, select the high 6 bits of 1 pixel point as the 6-bit compensation value, or select the high 3 bits of 2 pixel points from the sub-region block as the 6-bit compensation value, or select the high 2 bits and high 4 bits of 2 pixel points from the sub-region block as the 6-bit compensation value, or select the mean value or other calculated values of several pixel points. All of these are within the protection scope of the present invention.

[0204] Even further, in a variation of this embodiment, different compression methods can be set according to different implementation environments. For example, the median value of the first status points can be selected. For example, the median value is determined by sorting, or the average value of the pixel values corresponding to the first status points can be obtained through calculation. It is also possible to select the average value of relatively more pixel points instead of the average value of all pixel points within the sub-region block. All of these are within the protection scope of the present invention.

[0205] Even further, those skilled in the art understand that in the above embodiment or variation, its essence lies in judging the status value that the sub-region block should be determined and the compensation value corresponding to the status value from a sub-region block. And there are various different variations for determining the compensation value, which are not within the protection scope of the present invention.

[0206] Furthermore, those skilled in the art understand that, preferably, in this embodiment, a 2*8 area is divided into 4 2*2 areas, and each area agrees on two sets of values and 4-bit position statuses. Specifically, as Figure 4 shown, the value bit width takes the high 3 bits; a total of (6 + 4)*4 = 40 bits.

[0207] Even further, referring to the above Figures 1 to 7In the illustrated embodiments, those skilled in the art understand that in a preferred embodiment, the present invention is applicable to 2*8 pixel points or sub-pixel points, where the 2*8 pixel points are sub-pixel points, and the background value is the pixel point background value. The specific operations of the above-provided compression method are as follows: The first compression method is preferably used for the transition of ordinary images, and the second compression method is used for engineering images with a single background. Further preferably, 4 positionings are performed in 4 intervals to locate the foreground value position. The background value stores one RGB pixel value per two rows and is not included in the storage space. Marking 0 represents the background value, and marking 1 indicates that it is obtained through calculation using the background value and the known foreground value.

[0208] The third compression method is used for boundary processing of images with a single numerical value, similar to gray-scale transition. Three numerical intervals are summarized, so three complete 8-bit numerical values are stored, as well as the states represented by "0" / "1" in two regions.

[0209] The fourth compression method 4 is used to limit the maximum error. The 2*8 interval is divided into four 2*2 intervals, and there are two numerical values in each interval. The numerical position is determined according to the state position.

[0210] Combined with the above Figures 1 to 7 In another preferred embodiment of the illustrated embodiments, Figure 8 An image compression and reconstruction device for RAM storage is shown, which includes the following devices:

[0211] A first processing device, which is used to delimit a specific region block for the image data and compress the specific region block using at least two compression methods to obtain compression results respectively;

[0212] A first comparison device, which is used to compare the compression results and use the compression mode corresponding to the compression result with the minimum error as the current compression coding mode, and output the compression result corresponding to the specific region block;

[0213] Among them, the specific region block is a 2*8 region block;

[0214] Among them, the first processing device at least includes a first compression device and a second compression device. The first compression device performs compression processing in the following manner:

[0215] Step i11: Take the sampling point value at the coordinate (0,0) of the specific region block as value a, take the sampling point value at the coordinate (2, -1) of the specific region block as value b, take the sampling point value at the coordinate (4,0) of the specific region block as value c, take the sampling point value at the coordinate (6, -1) of the specific region block as value d, and take the sampling point value at the coordinate (7,0) of the specific region block as value e;

[0216] Step i12: Calculate the pixel value of the unsampled point within the specific region block based on the step length between the sampled point and an unsampled point as the weight coefficient and according to the value of the sampled point.

[0217] Specifically, the above Figures 1 to 7 shown embodiment can be referred to for implementing the above compression device, which will not be elaborated here.

[0218] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various deformations or modifications within the scope of the claims, which do not affect the essence of the present invention.

Claims

1. An image compression method for RAM storage, characterized in that, It includes the following steps: a. Define a specific region block for the image data, and compress the specific region block using no less than two compression methods to obtain compression results respectively; b. Compare the compression results, and use the compression mode corresponding to the compression result with the minimum error as the current compression coding mode, and output the compression result corresponding to the specific region block; Among them, the specific region block is a 2*8 region block; Among them, the first compression method among the no less than two compression methods is as follows: Step i11: Take the sampling point value at the point with coordinates (0,0) of the specific region block as value a, take the sampling point value at the point with coordinates (2,-1) of the specific region block as value b, take the sampling point value at the point with coordinates (4,0) of the specific region block as value c, take the sampling point value at the point with coordinates (6,-1) of the specific region block as value d, and take the sampling point value at the point with coordinates (7,0) of the specific region block as value e; Step i12: Use the step size between the sampling point and an unsampled point as the weight coefficient and calculate the pixel values of the unsampled points within the specific region block according to the sampling point values; Among them, the second compression method among the no less than two compression methods is as follows: Step i21: Perform high gray level and low gray level statistics on the pixel values of the specific region block, and use the gray level with the largest quantity as the reference gray level; Step i22: Determine the median value of the pixel values corresponding to the reference gray level as the reference background value; Step i23: Determine the reference position in units of 2*2 regions for the specific region block. Among them, if the reference gray level is a high gray level, determine the position of the sub-pixel point with the smallest value in the 2*2 region as the reference position; if the reference gray level is a low gray level, determine the position of the sub-pixel point with the largest value in the 2*2 region as the reference position; Step i24: Take the high 5 bits of the value corresponding to the reference position, and determine the status values of the other sub-pixel points in the 2*2 region as 0 or 1. Among them, if the gray level of the sub-pixel point is the same as the reference gray level, determine the status value of the sub-pixel point as 0, otherwise determine the status value of the sub-pixel point as 1.

2. The compression method according to claim 1, characterized in that, The step i12 includes the following steps: Calculate the values of the remaining sub-pixel points through the following formula: p2 = 1 / 4*a + 1 / 2*b + 1 / 4*c, where p2 represents the value corresponding to the point with coordinates (2,0) of the specific region block; p1 = 1 / 2*p2 + 1 / 2*a = 1 / 8*a + 1 / 4*b + 1 / 8*c + 1 / 2*a, where p1 represents the value corresponding to the point with coordinates (1,0) of the specific region block; p3 = 1 / 2*p2 + 1 / 2*c = 1 / 8*a + 1 / 4*b + 1 / 8*c + 1 / 2*c, where p3 represents the value corresponding to the point with coordinates (3,0) of the specific region block; p4 = 1 / 2*c + 1 / 4*d + 1 / 4*e, where p4 represents the value corresponding to the point with coordinates (5,0) of the specific region block; p5 = 1 / 4*c + 3 / 8*d + 3 / 8*e, where p5 represents the value corresponding to the point with coordinates (6, 0) in the specific region block; p6 = 3 / 4*a + 1 / 4*b, where p6 represents the value corresponding to the point with coordinates (0, -1) in the specific region block; p7 = 1 / 4*a + 3 / 4*b, where p7 represents the value corresponding to the point with coordinates (1, -1) in the specific region block; p9 = 1 / 4*b + 1 / 2*c + 1 / 4*d, where p9 represents the value corresponding to the point with coordinates (4, -1) in the specific region block; p8 = 1 / 2*p9 + 1 / 2*b = 1 / 8*b + 1 / 4*c + 1 / 8*d + 1 / 2*b, where p8 represents the value corresponding to the point with coordinates (3, -1) in the specific region block; p10 = 1 / 2*p9 + 1 / 2*d = 1 / 8*b + 1 / 4*c + 1 / 8*d + 1 / 2*d, where p10 represents the value corresponding to the point with coordinates (5, -1) in the specific region block; p11 = 1 / 2*d + 1 / 2*e, where p11 represents the value corresponding to the point with coordinates (7, -1) in the specific region block.

3. The compression method according to claim 1 or 2, characterized in that, Step i21 is implemented through the following steps: Perform high and low gray-scale statistics on the upper row of the specific region block, and use the one with the largest quantity as the reference gray scale.

4. The compression method according to claim 3, wherein During the decompression process, calculate the values of other sub-pixel points in the 2*2 region through the following steps: Step i25: If the status value of the sub-pixel point is 0, determine that the pixel value of the current sub-pixel point is the reference background value; Step i26: If the status value of the sub-pixel point is 1, find all determined pixel values in the region where the step size from the current sub-pixel point is no greater than 2, and calculate the determined pixel values according to the step size group as the coefficient weights. The calculated value is used as the pixel value of the current sub-pixel point.

5. The compression method according to claim 3, wherein The third compression method in the at least two compression methods is as follows: Step i31: Divide the specific region block into sub-region blocks in units of 2*4 regions; Step i32: Statistically analyze the pixel values in the two 2*4 sub-region blocks, summarize the quantity of each pixel value, and determine the number of identical pixel values in the two sub-regions; Step I33: Determine a reference value for each sub-region block, determine a shared equilibrium value for two adjacent sub-region blocks, and determine a status bit for each sub-pixel point in each sub-region block. The status bit is 0 or 1; Among them, when the number of different pixel values in each sub-region is less than or equal to 2, and the number of different pixel values in a 2*8 region is less than or equal to 3, the reference value of the sub-region block is the unique pixel value of the sub-region, and the equilibrium value is the common pixel value of two adjacent sub-region blocks; when the number of different pixel values in the 2*8 region is greater than 3, the reference value of the sub-region block is the average value of the unique pixel values of the sub-region, and the equilibrium value is the median of the common pixel values of two adjacent sub-region blocks.

6. The compression method according to claim 5, characterized in that, During the decompression process, calculate the values of the sub-pixel points within each sub-region block through the following steps: Step i34: If the value of the sub-pixel point is 0, use the reference value of the sub-region block where the sub-pixel point is located as the image value of the sub-pixel point; otherwise, use the equilibrium value of the sub-region block where the sub-pixel point is located as the image value of the sub-pixel point.

7. The compression method according to claim 3, characterized in that, The fourth compression method among the at least two compression methods is as follows: Step i41: Divide the specific region block into sub-region blocks in units of 2*2 regions; Step i42: Obtain the status value with a bit length of 4 bits and the compensation value with a bit length of 6 bits for each sub-region block, where the pixel value of each sub-pixel point within the sub-region block is determined based on the status value and the compensation value; Among them, the step i42 includes the following steps: Step i421: Summarize and group the pixel values of the sub-pixels within the sub-region block, and the difference between the pixel values within each group is less than the first threshold, and the difference between the two groups of values is greater than the second threshold; Step i422: Determine the status value of the sub-region block according to the grouping situation; Step i423: After averaging each group of values, take the high bits to obtain the compensation value; Among them, the number of groups does not exceed 2, and the step i421 and the step i422 are implemented through the following steps: - Compare each sub-pixel point within the sub-region block, and count the sub-pixel points with a comparison result greater than the third threshold as the first status points, and vice versa as the second status points; - Determine the status value of the sub-region block according to the number and position of the first status points and the second status points within the sub-region block.

8. The compression method according to claim 7, wherein The step i423 includes the following steps: Step i4231: If the value of the status value is less than or equal to 10, use the average value or the middle value of the sub-pixel points that are the first status points within the sub-region block as the first value, use the average value or the middle value of the sub-pixel points that are the second status points within the sub-region block as the second value, and combine the high 3 bits of the first value and the high 3 bits of the second value as the compensation value; if the value of the status value is greater than 10, determine the high 6 bits of the average value or the middle value of each sub-pixel point within the sub-region block as the compensation value.

9. The compression method according to claim 1 or 2, characterized in that, In the step b, use the compression method corresponding to the minimum value among the maximum error values of sub-pixel reconstruction in various compression results as the current compression coding method.

10. The compression method according to claim 9, characterized in that, If the maximum error values of not less than two compression methods are both the minimum values, use the compression method corresponding to the minimum value among the error sums of sub-pixel reconstruction in various compression results as the current compression coding method.

11. The compression method according to claim 1 or 2, characterized in that For each compression method, determine a status value uniquely corresponding to this compression method, and determine the specific compression method corresponding to it according to this status value during the decompression process.

12. An image compression and reconstruction device for RAM storage, characterized in that, It includes the following devices: The first processing device is used to delimit a specific region block for the image data and compress the specific region block using at least two compression methods to obtain compression results respectively; The first comparison device is configured to compare the compression results, take the compression mode corresponding to the compression result with the smallest error as the current compression coding mode, and output the compression result corresponding to the specific region block; wherein, the specific region block is a 2*8 region block; wherein, the first processing device at least includes a first compression device and a second compression device, and the first compression device performs compression processing in the following manner: Step i11: Take the sampling point value at the coordinate (0,0) of the specific region block as value a, take the sampling point value at the coordinate (2,-1) of the specific region block as value b, take the sampling point value at the coordinate (4,0) of the specific region block as value c, take the sampling point value at the coordinate (6,-1) of the specific region block as value d, and take the sampling point value at the coordinate (7,0) of the specific region block as value e; Step i12: Calculate the pixel values of the unsampled points within the specific region block based on the step size between the sampled point and an unsampled point as the weight coefficient and according to the sampled point values; The second compression device completes the compression process in the following manner: Step i21: Perform high gray level and low gray level statistics on the pixel values of the specific region block, and take the gray level with the largest quantity as the reference gray level; Step i22: Determine the intermediate value of the pixel values corresponding to the reference gray level as the reference background value; Step i23: Determine the reference position in units of 2*2 regions for the specific region block. Specifically, if the reference gray level is a high gray level, determine the position of the sub-pixel point with the smallest value in the 2*2 region as the reference position; if the reference gray level is a low gray level, determine the position of the sub-pixel point with the largest value in the 2*2 region as the reference position; Step i24: Take the upper 5 bits of the value corresponding to the reference position, and determine the status values of the other sub-pixel points in the 2*2 region as 0 or 1. Specifically, if the gray level of the sub-pixel point is the same as the reference gray level, determine the status value of the sub-pixel point as 0, otherwise determine the status value of the sub-pixel point as 1.

13. The image compression and reconstruction apparatus according to claim 12, wherein The first comparison device takes the compression method corresponding to the minimum value among the maximum error values of sub-pixel reconstruction in various compression results as the current compression coding method.

14. The image compression and reconstruction device according to claim 13, characterized in that, During the processing of the first comparison device, if the maximum error values of not less than two compression methods are all the minimum values, then take the compression method corresponding to the minimum value among the error sums of sub-pixel reconstruction in various compression results as the current compression coding method.

Citation Information

Patent Citations

  • Image compression / decompression method and image coder / decoder and decoding circuit

    CN101060629A

  • Selective medical image compression method

    CN1471312A