Image compression method and device, and computer readable medium

By dividing the image into target pixel blocks and generating a minimum value tree and a bit width tree, using the reversible integer transformation and the correlation between adjacent pixels, the problem of poor image compression effect in the prior art is solved, and efficient losslessness is achieved Compression and error protection.

CN119277055APending Publication Date: 2025-01-07SANECHIPS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310791600.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing image compression technology has error-free protection function, slow speed, no obvious compression effect on small files, large memory usage, complex algorithms, easy channel errors to spread, sensitive to starting points, large pixel value range and high frequency components Poor image compression effect and other problems.

Method used

By dividing the image to be compressed into multiple target pixel blocks, performing reversible integer transformation, determining the minimum value tree and bit width tree, reducing the hierarchical information of brightness and chromaticity using the correlation between adjacent pixels, and improving the pixel values ​​between pixels similarity to improve compression effect.

Benefits of technology

Lossless compression is realized, the consumption of storage space and transmission resources is reduced, the compression effect of images with large pixel value range and high-frequency components is improved, and the error is small, and the calculation amount is small.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277055A_ABST
    Figure CN119277055A_ABST
Patent Text Reader

Abstract

The invention provides an image compression method. The method comprises the following steps: dividing an image to be compressed into a plurality of target pixel blocks; performing reversible integer transformation on the pixel value of the pixel in the target pixel block to obtain an integer pixel value; determining a minimum value tree of the target pixel block, and determining a bit width tree of the minimum value tree; leaf nodes of the minimum value tree represent integer pixel values of corresponding pixels, father nodes represent minimum values to be represented by subordinate child nodes, and values of the child nodes are equal to values to be represented by subtracting the minimum values to be represented by the same affiliated child nodes from the values to be represented by the child nodes; the node of the bit width tree represents the maximum bit width of the value of the sub-node belonging to the same node in the minimum value tree; and storing the minimum value tree and the bit width tree. The invention further provides image compression equipment and a computer readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of image compression, and in particular to an image compression method and device, and a computer-readable medium. Background Art

[0002] In some cases, lossless compression of images is required.

[0003] However, existing image compression technologies have one or more of the following problems: no error protection function, slow speed, poor compression effect on small files, large memory usage, complex algorithms, easy diffusion of channel errors, sensitivity to starting points, and poor compression effect on images with a large pixel value range and many high-frequency components. Summary of the invention

[0004] The present disclosure provides a method and device for image compression, and a computer-readable medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for image compression, comprising:

[0006] Dividing the image to be compressed into a plurality of target pixel blocks;

[0007] Performing a reversible integer transformation on the pixel values ​​of the pixels in the target pixel block to obtain integer pixel values;

[0008] Determine the minimum value tree of the target pixel block, and determine the bit width tree of the minimum value tree; the leaf nodes of the minimum value tree represent the integer pixel values ​​of the corresponding pixels, the parent nodes represent the minimum values ​​to be represented by the subordinate child nodes, and the values ​​of the child nodes are equal to the values ​​to be represented minus the minimum values ​​to be represented by the child nodes to which they belong; the nodes of the bit width tree represent the maximum bit widths of the values ​​of the child nodes to which they belong in the minimum value tree.

[0009] In a second aspect, an embodiment of the present disclosure provides an image compression device, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any one of the image compression methods of the embodiments of the present disclosure.

[0010] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any one of the image compression methods of the embodiments of the present disclosure.

[0011] In the disclosed embodiment, a reversible integer transform (such as a reversible integer DCT transform) is first preprocessed, which is equivalent to transforming the spatial domain image into the frequency domain for analysis, and ensuring that the frequency is concentrated in a smaller low-frequency range. The correlation between adjacent pixels is used to reduce the hierarchical information representing the brightness and chromaticity of the image, and the similarity between the pixel values ​​of each pixel in the image is increased, thereby improving the compression effect and having good generalization, especially for images with a large pixel value range and many high-frequency components. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In the accompanying drawings of the embodiments of the present disclosure:

[0013] Figure 1 A flowchart of an image compression method provided by an embodiment of the present disclosure;

[0014] Figure 2 A flowchart of another image compression method provided by an embodiment of the present disclosure;

[0015] Figure 3 An example diagram of a generation process of a minimum value tree and a bit width tree in another image compression method provided by an embodiment of the present disclosure;

[0016] Figure 4 A schematic diagram of dividing a target pixel block in another image compression method provided by an embodiment of the present disclosure;

[0017] Figure 5 A schematic diagram of the structure of a minimum value tree in another image compression method provided by an embodiment of the present disclosure;

[0018] Figure 6 A schematic diagram of the structure of a super minimum value tree in another image compression method provided by an embodiment of the present disclosure;

[0019] Figure 7 A block diagram of a device for image compression provided by an embodiment of the present disclosure;

[0020] Figure 8 A block diagram of a computer-readable medium provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the image compression method and device, and computer-readable medium provided by the embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.

[0022] The present disclosure will be described more fully below with reference to the accompanying drawings, but the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as being limited to the embodiments set forth below. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete, and will enable those skilled in the art to fully understand the scope of the present disclosure.

[0023] The accompanying drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification, and are used together with the detailed embodiments to explain the present disclosure, and do not constitute a limitation of the present disclosure. By describing the detailed embodiments with reference to the accompanying drawings, the above and other features and advantages will become more apparent to those skilled in the art.

[0024] The present disclosure may be described with reference to plan views and / or cross-sectional views by means of ideal schematic views of the present disclosure. Therefore, the exemplary illustrations may be modified according to manufacturing techniques and / or tolerances.

[0025] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0026] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure. The term "and / or" as used in the present disclosure includes any and all combinations of one or more related enumerated items. The singular forms "one" and "the" as used in the present disclosure are also intended to include plural forms, unless the context clearly indicates otherwise. The terms "including", "made of..." as used in the present disclosure specify the presence of the features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.

[0027] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.

[0028] The present disclosure is not limited to the embodiments shown in the drawings, but includes modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the drawings have schematic properties, and the shapes of the regions shown in the drawings illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0029] In some cases, it is expected that an image processing chip or a computer image processing program can perform lossless compression on images to reduce the storage space occupied by the images in the memory, or to reduce the transmission resources occupied when the images are transmitted between different objects (such as between different devices, or between different hardware of a device).

[0030] However, the image compression technologies in related technologies all have some problems.

[0031] For example, image compression technology that performs global statistical scanning on images to generate an optimal weighted binary tree has problems such as no error protection function, slow speed, and poor compression effect on small files.

[0032] For another example, image compression technology based on LZW (a table-based lookup algorithm invented by Abraham Lempel, Jacob Ziv, and Terry Welch) has problems such as large memory usage and complex algorithms.

[0033] For another example, image compression technology based on arithmetic coding has problems such as complex algorithms and easy diffusion of channel errors.

[0034] For another example, the image compression technology that calculates the local minimum spanning tree by coordinate sorting has problems such as sensitivity to the starting point, poor compression effect on small images, and slow speed.

[0035] For another example, image compression technology that divides pixel blocks by channels as compression units requires the use of models and has problems such as complex calculations.

[0036] For another example, the image compression technology using the minimum tree has problems such as poor compression effect on images with a large pixel value range and many high-frequency components.

[0037] In a first aspect, an embodiment of the present disclosure provides a method for image compression.

[0038] In the embodiment of the present disclosure, an image is a pattern represented by dots (pixels) arranged in an array, wherein each pixel includes one or more pixel values ​​representing its content.

[0039] The method of the embodiment of the present disclosure is used to losslessly compress an image, that is, to obtain compressed data that can fully represent the image content, and the amount of compressed data is smaller than the amount of original image data (pixel value of each pixel), thereby reducing the storage space occupied when storing the image, or reducing the transmission resources occupied when transmitting the image.

[0040] Reference Figure 1 , the image compression method of the embodiment of the present disclosure includes:

[0041] S101, dividing an image to be compressed into a plurality of target pixel blocks.

[0042] In the embodiment of the present disclosure, the image to be compressed is first divided into multiple target pixel blocks (blcocks), each of which includes multiple pixels in an array.

[0043] S102: Perform a reversible integer transformation on the pixel values ​​of the pixels in the target pixel block to obtain integer pixel values.

[0044] The pixel value of each pixel in each target pixel block is taken as a "signal" in the spatial domain, and a reversible integer transformation is performed on it to convert each pixel value into an integer form, i.e., an integer pixel value. Since the integer transformation is "reversible", there should be no information loss in the transformation.

[0045] S103: Determine a minimum value tree of the target pixel block, and determine a bit width tree of the minimum value tree.

[0046] Among them, the leaf node of the minimum value tree represents the integer pixel value of the corresponding pixel, the parent node represents the minimum value to be represented by the subordinate child node, and the value of the child node is equal to the value to be represented minus the minimum value to be represented by the same child node.

[0047] The nodes of the bit width tree represent the maximum bit width of the values ​​of the child nodes belonging to the same group in the minimum value tree.

[0048] The corresponding minimum value tree is generated by using the integer pixel value of each pixel in each target pixel block, and a bit width tree corresponding to the minimum value tree is generated as data representing the compressed image.

[0049] Among them, each leaf node (i.e., the child node at the bottom layer) of the minimum value tree corresponds to a pixel in the target pixel block, and its leaf node is used to represent the pixel value of its corresponding pixel; and the value to be represented by each parent node in the minimum value tree is the minimum value among the values ​​to be represented by its subordinate child nodes.

[0050] However, the actual value of each child node of the minimum value tree is also minimized, that is, the actual value of each child node should be equal to the value it originally represents, minus the minimum value of the values ​​to be represented by all child nodes with the same affiliation (belonging to the same parent node).

[0051] Specifically, the above minimum value tree can be implemented by writing the values ​​to be represented of all nodes in sequence from bottom to top, and then updating the actual value of each node from bottom to top. During the update, the value of each child node is replaced by the difference between its original value (the value to be represented) and the original value of the parent node (the value to be represented).

[0052] For example, suppose the values ​​(pixel values) to be represented by each leaf node of a minimum value tree refer to Figure 3 As shown above; then refer to Figure 3 In the middle, it can be determined that the values ​​to be represented by the two nodes in the second layer (counting from the top to the bottom, the same below) should be the minimum values ​​of the values ​​to be represented by the subordinate child nodes, namely 4 and 8, respectively, and the value to be represented by the root node of the first layer is the minimum value of the values ​​to be represented by its two subordinate child nodes, namely 4.

[0053] Afterwards, refer to Figure 3At the bottom, update the actual value of each node, that is, the actual value of the 3 leaf nodes on the left is equal to the value to be represented minus 4, while the actual value of the 3 leaf nodes on the right is equal to the value to be represented minus 8, and the actual value of the child nodes in the second layer is equal to the value to be represented minus 4.

[0054] It should be understood that in the minimum value tree, at least one of the values ​​of all child nodes belonging to the same parent node is 0, and the values ​​of the other child nodes are also "as small as possible".

[0055] The bit width tree is determined according to the bit width of the value of each node in the minimum value tree (i.e., the number of bits occupied in binary data). That is, each node in the bit width tree represents the maximum bit width of the value of each child node belonging to the same parent node in the minimum value tree. Figure 3 At the bottom, the bit width occupied by each child node of the minimum value tree is marked next to its value, so that the bit width tree on the right can be obtained.

[0056] It should be understood that the root node of the minimum value tree is not a child node, so it has no corresponding node in the bit-width tree, so the bit-width tree will have "one less layer" than the minimum value tree.

[0057] The data processed in the computer exists in binary form, and each data occupies a certain binary bit (bit width), but the value of the data does not necessarily always "need" to be expressed using the maximum bit width, so some of its high bits may be meaningless data of 0; therefore, the nodes of the bit width tree in the embodiment of the present disclosure can limit the bit width occupied by each node of the minimum value tree in actual processing to the minimum feasible value.

[0058] For example, refer to Figure 2 , after determining the bit width tree of the minimum value tree (S103), the method may further include:

[0059] S104: Store the minimum value tree and the bit width tree.

[0060] That is, all minimum value trees and corresponding bit width trees obtained for each image are stored in the memory, which is equivalent to storing the compressed image for subsequent use.

[0061] It should be understood that the actual data stored at this time only needs to represent the contents of the minimum value tree and the bit width tree, and its specific form may vary. For example, the minimum value tree may also be stored in the form of the following super minimum value tree.

[0062] It should be understood that the above minimum value tree and bit width tree do not necessarily have to be stored.

[0063] For example, the minimum value tree and the bit width tree may also be transmitted to other objects, such as to other devices, or to other hardware in the device (such as a display component), and then continued to be used by other objects (such as display).

[0064] In the disclosed embodiment, a reversible integer transform (such as a reversible integer DCT transform) is first preprocessed, which is equivalent to transforming the spatial domain image into the frequency domain for analysis, and ensuring that the frequency is concentrated in a smaller low-frequency range. The correlation between adjacent pixels is used to reduce the hierarchical information representing the brightness and chromaticity of the image, and the similarity between the pixel values ​​of each pixel in the image is increased, thereby improving the compression effect and having good generalization, especially for images with a large pixel value range and many high-frequency components.

[0065] Moreover, the reversible integer transformation in the embodiment of the present disclosure obtains an integer pixel value, so subsequent operations can all be integer operations rather than floating-point operations, so the amount of operations is small and the error is small.

[0066] At the same time, the embodiment of the present disclosure also extracts the local minimum value of the transformed target pixel block to generate a minimum value tree, which makes full use of the correlation between adjacent pixel values ​​to compress the repeated information in the data and improve the compression effect; at the same time, the bit width tree corresponding to the minimum value tree can also limit the bit width occupied by the nodes in the minimum value tree, compress the high-bit vacant information in the binary data, and further improve the compression effect.

[0067] In addition, the operation of the embodiment of the present disclosure is performed in units of target pixel blocks, without the need to generate a dictionary or a global tree, so the memory consumption is small, and different target pixel blocks are relatively independent, so they are not sensitive to the starting point and have a certain error protection function.

[0068] In some embodiments, the reversible integer transformation includes at least one of the following:

[0069] Reversible Integer Discrete Cosine Transform;

[0070] Reversible integer wavelet transform.

[0071] As one mode of an embodiment of the present disclosure, the above reversible integer transformation performed on each target pixel block may specifically be in the form of a reversible integer discrete cosine transform (DCT).

[0072] If there are N (e.g., 16) pixels in each target pixel block, their pixel values ​​can be regarded as N-point real signals F N (n),n=0,1,···,N-1.

[0073] F N (n) is expanded to obtain the 2N point symmetrical signal F 2N (n), n=0,1,···,2N-1, the formula is as follows:

[0074]

[0075] According to F 2N (n) Get signal The formula is as follows:

[0076]

[0077] Again Perform a reversible integer fast Fourier transform (FFT) that maintains conjugate symmetry to obtain and Real integer.

[0078] The standard formula for FFT is as follows:

[0079]

[0080] in, i represents an imaginary number, and j is an integer between 0 and N-1.

[0081] Therefore, the standard formula of FFT is transformed into the following rotation matrix product (integer):

[0082]

[0083] in,

[0084] The lifting form of the above rotation transformation is:

[0085]

[0086] According to the lifting theorem, substituting Formula 5 into Formula 4 can achieve the reversible integer FFT.

[0087] Furthermore, the obtained data is used to perform reversible integer DCT to obtain a signal of integer pixel value Where u is an integer between 0 and N-1, and the standard formula for reversible integer DCT is as follows:

[0088]

[0089] in, The upper horizontal line represents the conjugation operation.

[0090] make Then we can get and So we can get the following formula:

[0091]

[0092] Therefore, an integer solution, that is, an integer pixel value, can be obtained using the lifting form of the rotation matrix.

[0093] It should be understood that the reversible integer DCT used in the embodiments of the present disclosure is not limited to the form of the above specific formula; and the reversible integer transform used in the embodiments of the present disclosure is not limited to the form of reversible integer DCT, but may also be other forms such as reversible integer wavelet transform.

[0094] In some embodiments, the target pixel block is 4 rows * 4 columns, and is divided into 4 sub-pixel blocks of 2 rows * 2 columns; the minimum value tree is divided into 3 layers, and each node of the second layer corresponds to 4 leaf nodes of the same sub-pixel block; the bit width tree is divided into 2 layers, and its root node corresponds to the node of the second layer of the minimum value tree, and each leaf node corresponds to the 4 leaf nodes belonging to the same in the minimum value tree.

[0095] As one embodiment of the present disclosure, refer to Figure 4 , each target pixel block may be 4 rows*4 columns, which is further divided into 4 sub-pixel blocks of 2 rows*2 columns.

[0096] Therefore, refer to Figure 5 , each minimum value tree can be divided into 3 layers; among them, the root node corresponds to the target pixel block; the second layer has 4 child nodes, each child node corresponds to a 2*2 sub-pixel block; the third layer has 16 leaf nodes, each leaf node corresponds to a pixel.

[0097] Correspondingly, the bit-width tree has one less layer than the minimum value tree.

[0098] In some embodiments, reference Figure 2 , dividing the image to be compressed into a plurality of target pixel blocks (S101) includes:

[0099] S1011. Divide the image to be compressed into a plurality of super pixel blocks, and divide the super pixel block into a plurality of target pixel blocks.

[0100] After determining the minimum value tree of the target pixel block (S103), the method further includes:

[0101] S1031. The minimum value trees corresponding to the target pixel blocks in the super pixel block are combined into a super minimum value tree.

[0102] Reference Figure 4 As one method of an embodiment of the present disclosure, a plurality of larger "super pixel blocks" may be first divided from the image, and then a plurality of target pixel blocks may be divided from each super pixel block.

[0103] Furthermore, refer to Figure 6, for the minimum value trees of each target pixel block in the same super pixel block, they can be further "combined" into a larger "super minimum value tree", that is, the root node of the minimum value tree is used as a child node, and one or more layers of parent nodes are formed on it. Of course, the value selection rules of each node in the super minimum value tree still conform to the provisions of the minimum value tree.

[0104] Therefore, the embodiment of the present disclosure is equivalent to "multiple" divisions of the image and the minimum value tree. The super minimum value tree actually embodies the information of all minimum value trees (so storing the super minimum value tree is equivalent to storing the minimum value tree), but its data volume is further compressed.

[0105] At the same time, the bit-width trees corresponding to each minimum value tree are not "combined", so a super minimum value tree will correspond to multiple bit-width trees.

[0106] It should be understood that since the superpixel blocks are large, there may be a situation where some superpixel blocks at the edge of the image "do not have" enough pixels. In this regard, virtual pixels can be filled in, for example, by "copying" the rows or columns of the edge pixels to fill the superpixel blocks, or by directly filling the superpixel blocks with pixels with a pixel value of 0, etc., which will not be described in detail here.

[0107] In some embodiments, dividing the image to be compressed into a plurality of target pixel blocks (S101) includes:

[0108] S1012, dividing the image to be compressed into multiple super pixel blocks of 4 rows*64 columns, and dividing the super pixel block into 16 target pixel blocks of 4 rows*4 columns.

[0109] After determining the minimum value tree of the target pixel block (S103), the method further includes:

[0110] S1032. The minimum value trees corresponding to the target pixel blocks in the super pixel block are combined into a super minimum value tree.

[0111] The super minimum value tree is divided into 5 layers, and each node of the second layer corresponds to the minimum value tree of 4 target pixel blocks.

[0112] Reference Figure 4 As one embodiment of the present disclosure, the size of each super pixel block (super block) can be 4*64, so it can be further divided into 16 target pixel blocks (blocks) with a size of 4*4.

[0113] Correspondingly, each super minimum tree corresponds to 16 minimum trees, and the reference Figure 6, the super minimum value tree can be divided into 5 layers; among them, the root node corresponds to the super pixel block; the second layer has 4 child nodes, each child node corresponds to a part of the super pixel block, and each part includes 4 4*4 target pixel blocks; the third layer has 16 child nodes, each child node corresponds to a 4*4 target pixel block, so it is also the root node of the minimum value tree; the fourth layer has 64 child nodes, each child node corresponds to a 2*2 sub pixel block; the fourth layer has 256 leaf nodes, each leaf node corresponds to a pixel.

[0114] In some embodiments, dividing the superpixel block into 16 4-row*4-column target pixel blocks includes: combining two adjacent 2-row*4-column blocks in the superpixel block in the row direction into a 4-row*4-column target pixel block.

[0115] Reference Figure 4 Each 4-row*4-column target pixel block may not be a direct 4-row*4-column region in the image, but may be composed of two adjacent 2-row*4-column regions in the row direction, which are stacked up and down.

[0116] Figure 4 In the figure, (a,b) represents the pixel in the a-th row and the b-th column, and the same below.

[0117] In some embodiments, the value of the root node of the bit-width tree is the value to be represented, and the value of the child node is the difference between the value to be represented and the value of the root node.

[0118] As one embodiment of the present disclosure, refer to Figure 3 , the actual value of the root node in the bit width tree can be the value to be represented (bit width value), and the actual value of the child node can be the "difference" between the value to be represented (bit width value) and the value to be represented (bit width value) of the root node, thereby further reducing the amount of data of the child node.

[0119] In some embodiments, the bit width tree is constrained by constraints; the constraints include:

[0120] If the difference between the value of the root node of the bit width tree and the maximum value of the child nodes is less than a first predetermined value, updating the value of the root node to the maximum value of the child nodes plus the first predetermined value;

[0121] If the difference between the value of the root node and the value of the child node of the bit width tree is greater than a second predetermined value, the value of the child node is updated to be the value of the root node minus the second predetermined value; the second predetermined value is greater than the first predetermined value.

[0122] Furthermore, the bit width tree in the embodiment of the present disclosure may also be constrained, so that the difference between the child node and the root node is constrained within a certain range, further improving the compression effect.

[0123] For example, refer to Figure 3 , the maximum value of the child nodes of the bit-width tree minus 1 (that is, the first predetermined value is -1) can be compared with the value of the root node. If the value of the root node is smaller (that is, the difference between the value of the root node and the maximum value of the child node is less than the first predetermined value -1), the value of the root node is updated to the maximum value of the child node minus 1; then, the value of the root node minus 2 (that is, the second predetermined value is 2) is compared with the values ​​of each child node. If the value of a child node is smaller (that is, the difference between the value of the root node and the value of the child node is greater than the second predetermined value 2), the value of the child node is updated to the value of the root node minus 2.

[0124] The above method can ensure that the difference between the value of any child node and the value of the root node in the bit-width tree is within the range of the first predetermined value to the second predetermined value, for example, within the range of -1 to 2. Therefore, at this time, the difference between the value of each child node and the value of the root node can be represented by a 2-bit data. Therefore, for each bit-width tree, the space actually occupied is the value of the root node + 4*2 bits.

[0125] In some embodiments, the constraints also include:

[0126] If the values ​​represented by all nodes of the bit-width tree are the same, the bit-width tree only includes a root node of a third predetermined value; the third predetermined value is greater than or equal to the first predetermined value, and less than or equal to the second predetermined value.

[0127] As one method of an embodiment of the present disclosure, the constraints on the bit-width tree may also include special provisions under special circumstances, that is, when the values ​​represented by all nodes of the bit-width tree are the same, the bit-width tree may be set to have "only" one root node, and the value of the root node is a third predetermined value (of course, it also falls within the range from the first predetermined value to the second predetermined value).

[0128] For example, before comparing the maximum value of the child nodes of the bit-width tree minus 1 with the value of the root node, it may be determined whether the values ​​of all nodes of the bit-width tree are the same. If so, the bit-width tree is set to have only one root node, and its value is -1 (that is, the third predetermined value is -1).

[0129] In some embodiments, reference Figure 2 , after determining the bit width tree of the minimum value tree (S103), further comprising:

[0130] S105. Obtain a minimum value tree and a bit width tree.

[0131] S106: Determine the integer pixel value of the pixel according to the minimum value tree and the bit width tree.

[0132] S107 . Perform an inverse operation of the reversible integer transformation on the integer pixel values ​​of the pixels in the target pixel block to determine the pixel values ​​of the pixels.

[0133] The minimum value tree and the bit width tree (ie, the compressed image) obtained by the above compression can also be used to "restore" the original image.

[0134] When restoration is needed, first obtain (such as reading from a memory, or receiving through a channel) all minimum value trees and bit width trees of a previously obtained image; then, "restore" the integer pixel value of each pixel of the target pixel block through the minimum value tree and the bit width tree; then, perform the inverse operation of the above reversible integer transformation on the target pixel block containing the integer pixel value to obtain the pixel value of each pixel; thus, the pixel value of each pixel in the image is determined, which is equivalent to restoring the original image to continue subsequent processing (such as display).

[0135] Second, refer to Figure 7 An embodiment of the present disclosure provides an image compression device, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, any image compression method of the embodiment of the present disclosure is implemented.

[0136] Thirdly, refer to Figure 8 The embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, any image compression method of the embodiment of the present disclosure is implemented.

[0137] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, and can realize information exchange between the memory and the processor, including but not limited to the data bus (Bus), etc.

[0138] Those skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0139] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation.

[0140] Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-temporary medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical disk storage; magnetic cassettes, magnetic tapes, disk storage or other magnetic storage; any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0141] The present disclosure has disclosed example embodiments, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A method for image compression, comprising: Dividing the image to be compressed into a plurality of target pixel blocks; Performing a reversible integer transformation on the pixel values ​​of the pixels in the target pixel block to obtain integer pixel values; Determine a minimum value tree of the target pixel block, and determine a bit width tree of the minimum value tree; The leaf nodes of the minimum value tree represent the integer pixel values ​​of the corresponding pixels, the parent nodes represent the minimum values ​​to be represented by the subordinate child nodes, and the values ​​of the child nodes are equal to the values ​​to be represented minus the minimum values ​​to be represented by the child nodes to which they belong; the nodes of the bit width tree represent the maximum bit widths of the values ​​of the child nodes to which they belong in the minimum value tree.

2. The method according to claim 1, wherein: The reversible integer transformation includes at least one of the following: Reversible Integer Discrete Cosine Transform; Reversible integer wavelet transform.

3. The method according to claim 1, wherein: The dividing the image to be compressed into a plurality of target pixel blocks comprises: dividing the image to be compressed into a plurality of super pixel blocks, and dividing the super pixel blocks into a plurality of target pixel blocks; After determining the minimum value tree of the target pixel block, the method further includes: combining the minimum value trees corresponding to the target pixel blocks in the super pixel block into a super minimum value tree.

4. The method according to claim 1, wherein: The value of the root node of the bit-width tree is the value to be represented, and the value of the child node is the difference between the value to be represented and the value of the root node.

5. The method according to claim 4, wherein: The bit width tree is constrained by constraint conditions; the conditional constraints include: If the difference between the value of the root node of the bit width tree and the maximum value of the child nodes is less than a first predetermined value, updating the value of the root node to the maximum value of the child nodes plus the first predetermined value; If the difference between the value of the root node and the value of the child node of the bit width tree is greater than a second predetermined value, the value of the child node is updated to be the value of the root node minus the second predetermined value; the second predetermined value is greater than the first predetermined value.

6. The method according to claim 5, wherein: The constraints also include: If the values ​​represented by all nodes of the bit width tree are the same, the bit width tree only includes a root node of a third predetermined value; the third predetermined value is greater than or equal to the first predetermined value and less than or equal to the second predetermined value.

7. The method according to claim 1, wherein: The target pixel block is 4 rows*4 columns, and is divided into 4 sub-pixel blocks of 2 rows*2 columns; The minimum value tree is divided into three layers, and each node of the second layer has four leaf nodes corresponding to the same sub-pixel block; The bit width tree is divided into two layers, the root node of which corresponds to the node of the second layer of the minimum value tree, and each leaf node corresponds to the four leaf nodes belonging to the same in the minimum value tree.

8. The method according to claim 7, wherein: The step of dividing the image to be compressed into a plurality of target pixel blocks comprises: dividing the image to be compressed into a plurality of super pixel blocks of 4 rows*64 columns, and dividing the super pixel blocks into 16 target pixel blocks of 4 rows*4 columns; After determining the minimum value tree of the target pixel block, it also includes: forming a super minimum value tree from the minimum value trees corresponding to each target pixel block in the super pixel block; the super minimum value tree is divided into 5 layers, and each node of the second layer corresponds to the minimum value trees of 4 target pixel blocks.

9. The method according to claim 7, wherein: The step of dividing the super pixel block into 16 target pixel blocks of 4 rows and 4 columns comprises: Two adjacent blocks of 2 rows*4 columns in the row direction in the super pixel block are combined into a target pixel block of 4 rows*4 columns.

10. The method according to any one of claims 1 to 9, wherein: After determining the bit width tree of the minimum value tree, the method further includes: Obtaining the minimum value tree and the bit width tree; Determining the integer pixel value of a pixel based on the minimum value tree and the bit width tree; An inverse operation of the reversible integer transformation is performed on the integer pixel value of the pixel in the target pixel block to determine the pixel value of the pixel.

11. An image compression device, comprising a memory and a processor; the memory stores a computer program executable by the processor, and the computer program, when executed by the processor, implements the image compression method according to any one of claims 1 to 10.

12. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the image compression method according to any one of claims 1 to 10.