Image compression and decompression method and system, image processing chip

By performing GAMMA curve mapping and differential processing on images, combined with quantization and encoding, the problem of large storage space consumption in image compression and decompression methods is solved, achieving efficient image compression and decompression and improving the storage utilization of image processing chips.

CN122120467APending Publication Date: 2026-05-29CHENGDU LIGHT COLLECTOR TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU LIGHT COLLECTOR TECH
Filing Date
2026-03-11
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing image compression and decompression methods occupy a large amount of storage space and have uncertain compression ratios, which makes it difficult to design the storage space of image processing chips.

Method used

Image compression is achieved by mapping the image to be compressed using GAMMA curves, converting it into a differential image, and then quantizing and encoding it. The quantization intensity is adaptively adjusted to fit the buffer space size.

Benefits of technology

It effectively reduces redundant image information, reduces storage space requirements, improves image processing efficiency, and ensures minimal visual loss while maintaining a reasonable compression ratio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120467A_ABST
    Figure CN122120467A_ABST
Patent Text Reader

Abstract

The application provides an image compression and decompression method and system and an image processing chip, wherein the compression method comprises the following steps: obtaining an image to be compressed; performing mapping preprocessing on the image to be compressed; converting the image to be compressed after the mapping preprocessing into a difference image; performing quantization and encoding on the difference image to obtain compressed data; and storing the compressed data into a compressed file. Through the mapping preprocessing on the image to be compressed, the amount of image redundant information can be effectively reduced, and the conversion into the difference image can further reduce the image information, so that the image compression can be realized by occupying a smaller storage space, and the problem of a large occupied storage space in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image compression and decompression method and system, and an image processing chip. Background Technology

[0002] In image processing algorithms, multi-frame image processing based on temporal information can greatly improve image quality. For example, one or more cached historical images can be used to perform motion compensation with the current frame image, followed by temporal filtering to improve image quality; multiple cached subpixel-aligned images can be fused to improve image resolution; and the current frame image can be compared with historical images to more accurately detect moving targets and segment the background / foreground.

[0003] Uncompressed images generate enormous amounts of data, placing significant pressure on storage and transmission during multi-frame image processing. Therefore, image compression is essential. Common image formats such as JPG, GIF, and PNG typically use compression algorithms that compress redundant information to reduce image size. However, the amount of redundant information in each image is uncertain, resulting in variable compression ratios for existing algorithms. Image processing chips, on the other hand, have a fixed amount of usable storage space. Therefore, given the uncertain compression ratio of the algorithm, worst-case scenarios must be considered, necessitating the design of a large storage capacity. Summary of the Invention

[0004] The purpose of this invention is to provide an image compression and decompression method and system, and an image processing chip, so as to at least solve the problem of large storage space occupied by existing image compression and decompression methods.

[0005] To solve the above-mentioned technical problems, the present invention provides an image compression method, comprising: Obtain the image to be compressed; Perform mapping preprocessing on the image to be compressed; Convert the preprocessed image to be compressed into a difference image; The differential image is quantized and encoded to obtain compressed data; Store the compressed data in a compressed file.

[0006] Optionally, in the image compression method, the method for mapping preprocessing the image to be compressed includes: Perform GAMMA curve mapping on the image to be compressed.

[0007] Optionally, in the image compression method, the method of converting the preprocessed image to be compressed into a difference image includes: The pixel value of the current pixel in the image to be compressed is changed to the difference between the pixel value of the current pixel and the pixel value of the cached pixel in the same channel to obtain the difference image.

[0008] Optionally, in the image compression method, the method of quantizing and encoding the differential image to obtain compressed data includes: Quantize the difference image; The quantized differential image is losslessly encoded to obtain compressed data, which includes the encoding corresponding to each pixel in the image to be compressed.

[0009] Optionally, in the image compression method, the method for quantizing the difference image includes: According to a preset period, the quantization intensity is adaptively adjusted based on the size of the cache space used, wherein the quantization intensity is proportional to the size of the cache space used.

[0010] To address the aforementioned technical problems, the present invention also provides an image decompression method, comprising: Obtain the compressed data to be decompressed; The compressed data is decoded and dequantized to obtain a differential image; Convert the difference image to a full value image; The full-value image is mapped and then processed to obtain the decompressed image.

[0011] Optionally, in the image decompression method, when dequantizing the decoded compressed data, the dequantization intensity is adaptively adjusted according to the size of the cache space used, based on a preset period, wherein the dequantization intensity is proportional to the size of the cache space used.

[0012] Optionally, in the image decompression method, the method of converting the difference image into a full-value image includes: The pixel value of the current pixel in the difference image is changed to the sum of the pixel value of the current pixel and the pixel values ​​of the cached pixels in the same channel to obtain the full value image.

[0013] Optionally, in the image decompression method, the method of mapping and processing the full-value image to obtain the decompressed image includes: The full-value image is inversely mapped using GAMMA curves to obtain the decompressed image.

[0014] To address the aforementioned technical problems, the present invention also provides an image compression system for implementing the image compression method described in any of the preceding claims, the image compression system comprising: The image acquisition module is used to acquire the image to be compressed; The mapping processing module is used to perform mapping preprocessing on the image to be compressed. The image conversion module is used to convert the pre-processed image to be compressed into a difference image; The image compression module is used to quantize and encode the differential image to obtain compressed data; The data storage module is used to store compressed data into compressed files.

[0015] To address the aforementioned technical problems, the present invention also provides an image decompression system for implementing the image decompression method as described in any of the preceding claims, the image decompression system comprising: The data acquisition module is used to acquire the compressed data to be decompressed; The data decompression module is used to decode and inverse quantize compressed data to obtain differential images; The image conversion module is used to convert a difference image into a full-value image; The mapping processing module is used to perform mapping post-processing on the full-value image to obtain the decompressed image.

[0016] To address the aforementioned technical problems, the present invention also provides an image processing chip, comprising a processor and a cache space; the processor is used to execute the image compression method as described in any of the preceding claims, and / or to execute the image decompression method as described in any of the preceding claims; the cache space is used to store compressed data.

[0017] This invention provides an image compression and decompression method and system, as well as an image processing chip. The compression method includes: acquiring an image to be compressed; performing mapping preprocessing on the image to be compressed; converting the preprocessed image to be compressed into a differential image; quantizing and encoding the differential image to obtain compressed data; and storing the compressed data in a compressed file. By performing mapping preprocessing on the image to be compressed, the amount of redundant image information can be effectively reduced. Converting it into a differential image further reduces image information, enabling image compression to be achieved with a smaller storage space, thus solving the problem of large storage space usage in existing image compression and decompression methods. Attached Figure Description

[0018] Figure 1 This is a flowchart of the image compression method provided in this embodiment; Figure 2 This is a flowchart of the image decompression method provided in this embodiment; Figure 3 This is a structural block diagram of the image compression system provided in this embodiment; Figure 4 This is a structural block diagram of the image decompression system provided in this embodiment. Detailed Implementation

[0019] The image compression and decompression method and system, and image processing chip proposed in this invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of this invention. Furthermore, the structures shown in the drawings are often part of the actual structure. In particular, different proportions may be used in different drawings to illustrate different aspects.

[0020] It should be noted that the terms "first," "second," etc., used in the specification, claims, and drawings of this invention are used to distinguish similar objects in order to describe embodiments of the invention, and are not used to describe a specific order or sequence. It should be understood that such uses of terminology are interchangeable where appropriate. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0021] This embodiment provides an image compression method, such as... Figure 1 As shown, it includes: A1, Obtain the image to be compressed; A2, perform mapping preprocessing on the image to be compressed; A3 converts the pre-processed image to be compressed into a difference image; A4 is used to quantize and encode the differential image to obtain compressed data; A5 saves the compressed data into a compressed file.

[0022] The image compression method provided in this embodiment can effectively reduce the amount of redundant information in the image by performing mapping preprocessing on the image to be compressed. Converting it into a differential image can further reduce the image information, so that image compression can be achieved with a small storage space, thus solving the problem of large storage space occupied by existing image compression and decompression methods.

[0023] Specifically, in this embodiment, step A1 involves acquiring the image to be compressed.

[0024] In practical applications, the image to be compressed can be obtained from an image processing chip or a camera device. The format of the image to be compressed can be JPG, GIF, PNG, etc.; the image to be compressed can be a RAW image, an RGB image, or a YUV image, and this application does not impose any restrictions on this.

[0025] Furthermore, in this embodiment, step A2 involves performing mapping preprocessing on the image to be compressed.

[0026] Specifically, in this embodiment, GAMMA curve mapping can be performed on the image to be compressed. GAMMA curves are a core tool in image processing for adjusting the relationship between input and output brightness, playing a crucial role, especially in industries such as display devices, photography, and printing. A GAMMA curve is a non-linear tone curve whose core function is to describe the mapping relationship between the input signal and the output brightness. By adjusting the GAMMA value (γ), precise control over the brightness distribution of the image can be achieved. The specific implementation methods for GAMMA curve mapping of an image are well known to those skilled in the art, and will not be elaborated upon here.

[0027] The process of mapping preprocessing for the image to be compressed can be represented as: I1 = GAMMA(I0) Where I0 represents the image to be compressed, I1 represents the image to be compressed after mapping preprocessing, and GAMMA() represents GAMMA curve mapping.

[0028] In practical applications, if the image to be compressed is an HDR (High Dynamic Range) RAW image with a bit width of 16-bit, 18-bit, or 20-bit, a fast dynamic range mapping (Tonemapping, TM) and GAMMA curve mapping can be performed on the RAW image. If the image to be compressed is a TM image with a bit width of 12-bit, a GAMMA curve mapping can be performed on it.

[0029] Furthermore, in this embodiment, step A3 converts the preprocessed image to be compressed into a differential image.

[0030] Specifically, in this embodiment, the pixel value of the current pixel in the image to be compressed is changed to the difference between the pixel value of the current pixel and the pixel value of the cached pixel in the same channel, so as to obtain a difference image. This process can be represented as: I2=I1-I1' Where I1' represents the pixel value of the cached pixel in the same channel as I1, and I2 represents the pixel value of the current pixel in the differential image.

[0031] In practical applications, if the image to be compressed is a RAW image, and the current pixel is a green channel pixel, this step calculates the difference between the current green pixel's value and the cached green pixel's value, and uses this interpolated value as the updated current green pixel's value. If the image to be compressed is an RGB image, and the current pixel is a green channel pixel, this step calculates the difference between the current green pixel's value and the cached green pixel's value, and uses this interpolated value as the updated current green pixel's value. If the image to be compressed is a YUV image, and the current pixel is a U channel pixel, this step calculates the difference between the current U channel pixel's value and the cached U channel pixel's value, and uses this interpolated value as the updated current U channel pixel's value.

[0032] If the current pixel is the first pixel in the channel, the pixel value of the cached pixels in the same channel is 0, so as to ensure that all pixels can be differentially calculated.

[0033] Furthermore, in this embodiment, step A4 involves quantizing and encoding the differential image to obtain compressed data.

[0034] Specifically, in this embodiment, the differential image is first quantized; then the quantized differential image is losslessly encoded to obtain compressed data, wherein the compressed data includes the encoding corresponding to each pixel in the image to be compressed.

[0035] In practical applications, during quantization, the quantization intensity can be adaptively adjusted based on the size of the cache space used, where the quantization intensity is directly proportional to the size of the cache space. Specifically, the initial value of the quantization intensity is 0; when the size of the cache space used reaches the upper limit of the design, the quantization intensity k is at its maximum value; when the size of the cache space used is close to the lower limit of the design, the quantization intensity k is 0; when the size of the cache space used is in the middle range, the quantization intensity k corresponds to a value between the maximum value and 0.

[0036] Ideally, in practical applications, the adjustment period for quantization intensity can be set according to actual needs. For example, after encoding each group of pixels, the quantization intensity is updated once, and the updated quantization intensity is used to quantize subsequent pixels.

[0037] Furthermore, in practical applications, Huffman coding can be used to achieve lossless encoding of the quantized difference images. Specifically, a Huffman tree is constructed, and the smaller the absolute value of the number, the shorter its encoding. The encoding length in the Huffman tree varies depending on the bit width of I1; for example, 1 to 16 bits means that the encoded pixel length of each difference image is between [1, 16] bits. In this case, the quantization intensity k ranges from 0 to 15.

[0038] The specific implementation of Huffman coding is well known to those skilled in the art, and will not be described in detail here. Of course, other lossless coding algorithms may be used in other embodiments, and this application does not limit them.

[0039] Furthermore, in this embodiment, step A5 involves storing the compressed data into a compressed file.

[0040] Specifically, in this embodiment, after obtaining n encoded results (compressed data), these n codes are written to the compressed file via a cache. The amount of data d obtained from the n codes fluctuates depending on the image content; for example, in the above example, the data amount will be between [n, 16n]. For the compressed file, the expected number of bits per pixel is fixed, for example, 4 bits per pixel. To achieve this, in this embodiment, the data of the expected size is stored in the compressed file, and the remaining data is stored in the cache. In this case, the change in the size of the cache is d. 4x, where x represents the number of pixels; when one pixel corresponds to one code, x=n; when three pixels correspond to one code, x=3n. In practical applications, the correspondence between the number of pixels x and the encoding result n can be set according to actual needs, and this application does not impose any restrictions on this.

[0041] Preferably, when the compression and decompression processes use the same cache space and compressed file, in order to ensure that the amount of data used in the compression and decompression processes is similar and to avoid interference in data storage and retrieval between the two processes, a special case can be set in this embodiment, and a flag can be set for the special case. When the special case occurs, the encoding result is not saved, and the differential image is saved directly, with the bit width of each pixel fixed at the bit width of the differential image I1 + 1.

[0042] The image compression method provided in this embodiment effectively reduces the amount of image information by utilizing mapping preprocessing and differential processing. Simultaneously, the quantization intensity can be adaptively adjusted during the quantization process, reducing buffer space usage when encoding flat areas of the image. Therefore, although the image compression method provided in this embodiment is lossy compression, under a reasonable compression ratio target, its visual loss is minimal and can be considered equivalent to lossless compression.

[0043] Corresponding to the image compression method provided in this embodiment, this embodiment also provides an image decompression method, such as... Figure 2 As shown, it includes: B1, retrieve the compressed data to be decompressed.

[0044] Specifically, in this embodiment, compressed data can be read from the compressed file and the cache space. The compressed data read can be compressed data obtained using the image compression method described above in this embodiment.

[0045] B2 decodes and dequantizes the compressed data to obtain a differential image.

[0046] Specifically, in practical applications, decoding can be performed according to the compression process to obtain differential data. In one specific embodiment, 32n bits of compressed data are extracted from the compressed file, and differential data is obtained by decoding according to the compression process. Each time, n data are decompressed. When this set of data is decompressed to less than 16n bits, another 16n bits of data are taken to keep the amount of compressed data to be decompressed greater than 16n bits. This ensures that the read set of data can be decompressed to at least n pixel values.

[0047] Furthermore, in practical applications, differential data can be dequantized based on the quantization process. Specifically, when dequantizing the decoded compressed data (differential data), the dequantization intensity is adaptively adjusted according to the size of the cache space used, based on a preset period. The dequantization intensity is directly proportional to the size of the cache space used.

[0048] B3 converts the difference image into a full value image.

[0049] Specifically, in this embodiment, the process of converting the pre-processed image to be compressed into a differential image in step A3 is reversed. During decompression, the pixel value of the current pixel in the differential image is changed to the sum of the pixel value of the current pixel and the pixel value of the cached pixel in the same channel to obtain the full value image.

[0050] B4 performs mapping and post-processing on the full-value image to obtain the decompressed image.

[0051] Specifically, in this embodiment, the process of mapping preprocessing the image to be compressed is reversed in step A2. During decompression, the full-value image is inversely mapped using the GAMMA curve to obtain the decompressed image.

[0052] The specific implementation of the image decompression method provided in this embodiment is something that those skilled in the art can obtain based on the image compression method provided in this embodiment and the prior art, and this application will not elaborate on it further.

[0053] In practical applications, compared to traditional methods that require two separate storage spaces for image decompression and image compression respectively, the image decompression and image compression methods provided in this embodiment can control the amount of data compressed and decompressed, ensuring that the storage space required for the image compression process is no greater than the storage space released during the image decompression process. This allows the compressed data generated during the image compression process to be stored in the storage space released during the image decompression process. In this way, not only is storage space saved, but the image decompression and image compression processes can also be performed simultaneously, improving image processing efficiency.

[0054] Furthermore, this embodiment also provides an image compression system for implementing the image compression method described above, such as... Figure 3 As shown, the image compression system includes: The image acquisition module is used to acquire the image to be compressed; The mapping processing module is used to perform mapping preprocessing on the image to be compressed. The image conversion module is used to convert the pre-processed image to be compressed into a difference image; The image compression module is used to quantize and encode the differential image to obtain compressed data; The data storage module is used to store compressed data into compressed files.

[0055] Furthermore, this embodiment also provides an image decompression system for implementing the image decompression method described above, characterized in that the image decompression system comprises: The data acquisition module is used to acquire the compressed data to be decompressed; The data decompression module is used to decode and inverse quantize compressed data to obtain differential images; The image conversion module is used to convert a difference image into a full-value image; The mapping processing module is used to perform mapping post-processing on the full-value image to obtain the decompressed image.

[0056] In practical applications, when the image compression system and image decompression system provided in this embodiment are integrated into one unit, the mapping processing module in the image compression system can be merged with the mapping processing module in the image decompression system, thereby using the same mapping processing module to realize the mapping preprocessing and mapping postprocessing of the image; and the image conversion module in the image compression system can be merged with the image conversion module in the image decompression system, thereby using the same image conversion module to realize the conversion between differential images and full-value images; and the image compression module in the image compression system can be merged with the data decompression module in the image decompression system, thereby using the same compression and decompression module to realize encoding / decoding and quantization / inverse quantization.

[0057] Furthermore, this embodiment also provides an image processing chip, including a processor and a cache space; the processor is used to execute the image compression method described above, and / or to execute the image decompression method described above; the cache space is used to store compressed data.

[0058] In practical applications, if the image compression method and the image decompression method are performed simultaneously, the compressed data generated by the compression process can be stored in the free space released by the cache when the decompression process releases the free space, thereby improving the utilization rate of the cache space in the image processing chip.

[0059] Specifically, the amount of compressed data generated during the compression process and the amount of compressed data used during the decompression process can be controlled by adaptively adjusting the quantization intensity mentioned above, thereby ensuring that the decompression process and the compression process are matched in speed and will not overwrite each other's compressed file data.

[0060] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to mutually. In addition, different parts between embodiments can also be combined with each other, and this invention does not limit this.

[0061] This embodiment provides an image compression and decompression method and system, and an image processing chip. The compression method includes: acquiring an image to be compressed; performing mapping preprocessing on the image to be compressed; converting the preprocessed image to be compressed into a differential image; quantizing and encoding the differential image to obtain compressed data; and storing the compressed data in a compressed file. By performing mapping preprocessing on the image to be compressed, the amount of redundant image information can be effectively reduced. Converting it into a differential image further reduces image information, enabling image compression to be achieved with a smaller storage space, thus solving the problem of large storage space usage in existing image compression and decompression methods.

[0062] The above description is merely a description of preferred embodiments of the present invention and is not intended to limit the scope of the present invention in any way. Any changes or modifications made by those skilled in the art based on the above disclosure shall fall within the protection scope of the claims.

Claims

1. An image compression method, characterized in that, include: Obtain the image to be compressed; Perform mapping preprocessing on the image to be compressed; Convert the preprocessed image to be compressed into a difference image; The differential image is quantized and encoded to obtain compressed data; Store the compressed data in a compressed file.

2. The image compression method according to claim 1, characterized in that, The method for mapping preprocessing the image to be compressed includes: Perform GAMMA curve mapping on the image to be compressed.

3. The image compression method according to claim 1, characterized in that, The method for converting the preprocessed image to be compressed into a difference image includes: The pixel value of the current pixel in the image to be compressed is changed to the difference between the pixel value of the current pixel and the pixel value of the cached pixel in the same channel to obtain the difference image.

4. The image compression method according to claim 1, characterized in that, The method for quantizing and encoding the differential image to obtain compressed data includes: Quantize the difference image; The quantized differential image is losslessly encoded to obtain compressed data, which includes the encoding corresponding to each pixel in the image to be compressed.

5. The image compression method according to claim 4, characterized in that, The method for quantizing the difference image includes: According to a preset period, the quantization intensity is adaptively adjusted based on the size of the cache space used, wherein the quantization intensity is proportional to the size of the cache space used.

6. An image decompression method, characterized in that, include: Obtain the compressed data to be decompressed; The compressed data is decoded and dequantized to obtain a differential image; Convert the difference image to a full value image; The full-value image is mapped and then processed to obtain the decompressed image.

7. The image decompression method according to claim 6, characterized in that, When dequantizing the decoded compressed data, the dequantization intensity is adaptively adjusted according to the size of the cache space used, based on a preset period. The dequantization intensity is directly proportional to the size of the cache space used.

8. The image decompression method according to claim 6, characterized in that, The method for converting a difference image into a full value image includes: The pixel value of the current pixel in the difference image is changed to the sum of the pixel value of the current pixel and the pixel values ​​of the cached pixels in the same channel to obtain the full value image.

9. The image decompression method according to claim 6, characterized in that, The method for mapping and processing the full-value image to obtain the decompressed image includes: The full-value image is inversely mapped using GAMMA curves to obtain the decompressed image.

10. An image compression system for implementing the image compression method as described in any one of claims 1 to 5, characterized in that, The image compression system includes: The image acquisition module is used to acquire the image to be compressed; The mapping processing module is used to perform mapping preprocessing on the image to be compressed. The image conversion module is used to convert the pre-processed image to be compressed into a difference image; The image compression module is used to quantize and encode the differential image to obtain compressed data; The data storage module is used to store compressed data into compressed files.

11. An image decompression system for implementing the image decompression method as described in any one of claims 6 to 9, characterized in that, The image decompression system includes: The data acquisition module is used to acquire the compressed data to be decompressed; The data decompression module is used to decode and inverse quantize compressed data to obtain differential images; The image conversion module is used to convert a difference image into a full-value image; The mapping processing module is used to perform mapping post-processing on the full-value image to obtain the decompressed image.

12. An image processing chip, characterized in that, It includes a processor and a cache space; the processor is used to execute the image compression method as described in any one of claims 1 to 5, and / or to execute the image decompression method as described in any one of claims 6 to 9; the cache space is used to store compressed data.