High-compression-ratio low-cost image compression method

By combining macroblock segmentation, color space conversion, and entropy coding, the low cost and low latency issues of high compression ratio image compression are solved, realizing an efficient image compression method suitable for ultra-high-definition video and VR applications.

CN121037569APending Publication Date: 2025-11-28SHANGHAI TONGTU SEMICON TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511202424.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve high compression ratio image compression methods while simultaneously meeting the requirements of low cost, low power consumption, low latency, and ease of implementation. This is especially true in ultra-high-definition video and VR applications, where traditional solutions suffer from high bandwidth requirements and high algorithm complexity.

Method used

A combination of macroblock segmentation, color space conversion, precoding, quantization, and entropy coding is employed. Macroblocks are segmented into YUV color spaces with a fixed height of 2 and a flexible width of 128 or 256. Combined with vertical and horizontal wavelet transforms, precoding quantization parameters, and entropy coding, high compression ratio image compression is achieved.

Benefits of technology

While achieving a high compression ratio, it maintains visual lossless effects, reduces computational complexity and hardware costs, is suitable for multiple platforms, and meets the low latency and high bandwidth requirements of ultra-high-definition video and VR.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037569A_ABST
    Figure CN121037569A_ABST
Patent Text Reader

Abstract

The invention relates to a high-compression-ratio low-cost image compression method, which comprises the following steps of: segmenting an input image into macro blocks with the height of 2 and the width of 128 or 256, and converting RGB (Red, Green, Blue) to YUV (Yttrium, Ultraviolet) to reduce component correlation; the macro block is pre-coded, and a pre-coding bit number is obtained through up-sampling, vertical Haar wavelet transformation, horizontal transformation, quantization and entropy coding; calculating an optimal quantization parameter based on the precoding bit number to realize code rate control; and formally coding according to the optimal parameter, updating the buffer and outputting a code stream. According to the method, through multi-stage transformation and dynamic quantization control, the high compression ratio is achieved, vision is lossless, the algorithm is simple, the hardware implementation cost is low, the method is suitable for multiple platforms, and the scene requirements of ultra-high-definition videos and the like are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, specifically to a high-compression-ratio, low-cost image compression method. Background Technology

[0002] With the advent of the ultra-high-definition video era, the content, resolution, and frame rate of the video industry have increased dramatically and rapidly, leading to ever-increasing bandwidth demands during transmission. Simultaneously, multi-video composite applications such as VR have brought even greater bandwidth requirements. With the application and research of 8K video, the transmission and storage of uncompressed video has become an unavoidable global challenge. One of the most typical application scenarios involves compressing reference frame buffers and then storing the compressed video in memory units such as SDRAM. However, the power consumption of SDRAM is directly proportional to the access bandwidth.

[0003] To address the aforementioned issues, a lightweight compression solution is urgently needed that can improve resolution and frame rate while retaining the advantages of uncompressed video, namely high compression ratio, visual losslessness, low power consumption, low latency, ease of implementation, and support for multiple platforms (such as FPGA, ASIC, GPU, CPU, etc.).

[0004] Major video standards organizations and manufacturers have launched intra-frame image compression algorithms to keep complexity within a reasonable range. For example, the VESA DSC standard supported by MIPI DSI-1 can support a maximum compression ratio of 3.75x for a 30-bit source, and the VESA VDC-M standard supported by MIPI DSI-2 can support a maximum compression ratio of 5x for a 30-bit source. However, these two standards still cannot meet the demand for high compression ratios of more than 10x. While JPEG's JPEG-XS and H.264 / H.265 intra-frame coding can achieve high compression ratios of more than 10x, their algorithms are more complex, their hardware implementation is more complicated, and their costs are higher.

[0005] To comprehensively address the aforementioned problems, we propose a high-compression-ratio, low-cost image compression method. Summary of the Invention

[0006] The purpose of this invention is to provide a high compression ratio and low cost image compression method to solve the problems mentioned in the background art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a high compression ratio, low cost image compression method, comprising the following steps: Step 1, Macroblock Segmentation: Perform macroblock segmentation on the input image, where the height of the macroblock is 2, and the width is set to either 128 or 256 according to preset requirements; Step 2, Color Space Conversion: Perform color space conversion on the macroblocks segmented in Step 1, specifically converting the RGB of the macroblocks to YUV to reduce the correlation between image macroblock components. Step 3, Precoding: Precoding the converted macroblock to obtain the number of precoded bits; Step 4, Rate Control: Calculate the optimal quantization parameters based on the number of precoded bits for the current macroblock. ; Step 5, Formal Encoding: Based on the calculated optimal quantization parameters The current macroblock is formally encoded, and the encoding process is the same as pre-encoding, that is, the number of bits obtained from encoding is... Proceed to step 4 Update; simultaneously, change the precoding quantization parameters. Updated to macroblock quantization parameters And package and output the bitstream.

[0008] Preferably, the precoding in step 3 uses precoding quantization parameters. The current macroblock is encoded to obtain the number of pre-coded bits. The specific implementation logic is as follows: a. First, upsampling is used to improve the image data precision of macroblocks and reduce the quality loss caused by transformation and quantization. The calculation formula is as follows: ; ; ; in This indicates the number of bits that need to be boosted. The raw data depth of the image macroblock. The pixel values ​​of an image macroblock. This represents the median pixel value after enhancement; b. Then, a vertical transform is performed. The vertical direction after the upsampled macroblock is subjected to Haar wavelet transform to obtain the low-frequency and high-frequency coefficients, denoted as... and The low-pass filter coefficients used are: The high-pass filter coefficient is The formula is as follows: Forward transform: ; ; in ,and Indicates the width of the macroblock; Indicates the first in a macroblock Line number The pixel values ​​of the column; Inverse transform: ; ; and These are the pixel values ​​recovered by the inverse transform; c. Horizontal transformation: The low-frequency and high-frequency coefficients described above are then subjected to a horizontal transformation. Transformation; The decomposition is performed once to obtain the frequency band. , ,right The decomposition was performed five times to obtain the frequency band. , , , , , The formula is as follows: Forward transform: ; ; Inverse transform: ; ; in, , Indicates rounding down; The input vertical transform coefficients, i.e. and ; The frequency band coefficients are the output after horizontal transformation; d. Quantization: For the low-frequency and high-frequency coefficients after horizontal transformation, pre-encoded quantization parameters are used. The formula for uniform quantization is as follows: Quantification: ;

[0009] Inverse quantization: ;

[0010] in These are the quantized coefficients. These are the low-frequency or high-frequency coefficients after horizontal transformation. This is the offset. These are the coefficients recovered after dequantization; e. Entropy coding: Entropy coding is performed on the low-frequency and high-frequency coefficients after quantization in d.

[0011] Preferably, the specific implementation of entropy encoding of the quantized low-frequency and high-frequency coefficients is as follows: Step 1, Importance Encoding: Let every 4 quantized low-frequency or high-frequency coefficients be a coding group, and every 8 coding groups be called an importance group, i.e., 32 coefficients. The bit flag of each importance group indicates whether the coding group in the group completely carries data; if the importance flag is 1, then skip the entire importance group, and all 32 coefficients in the group are zero. Step II: Most Significant Bit (MSB) Position Encoding. For the coding groups within the non-zero importance groups selected in Step I, determine the position of their most significant bit. There are two implementation methods: Method 1: Directly transmit the original MSB position data, with each coding group occupying 4 bits; Method 2: Predict the MSB position using the MSB position of the left or top neighbor of the coding group, and send the prediction residual in the form of a unary code. Step III: Run-through encoding. In the encoding groups processed in Step II, if there is an empty encoding group without valid data and an overrun occurs, the empty encoding group is skipped directly to avoid encoding invalid data. Step IV: Data encoding. For the encoding groups that are still valid after being filtered in Step I and simplified in Step III, the absolute values ​​of their quantized wavelet coefficients are encoded. The encoding range covers all bits from the MSB position determined in Step II to the bit plane selected by the quantizer. Step V: Symbol encoding. Encode the symbols of the coefficients in the coding group in Step IV using unary codes. If there is a coding group with non-zero coefficients in Step I, only the symbols whose absolute values ​​are not zero are encoded.

[0012] Preferably, step 4 calculates the optimal quantization parameters based on the number of pre-coded bits and the preset target number of bits. The specific implementation logic is as follows: Step S1: Calculate the target number of bits required for the current MB encoding. ; Configure the budget bits for the current macroblock. : ; in, and These are the width and height of the macroblock, respectively. The number of color components. For pixel bit depth, Compression ratio; A virtual buffer verification model is adopted, based on the buffer fullness of the current macroblock. To obtain the current MB Number of buffer bits: ; in, It is the inverse gain coefficient; Calculate the target number of bits : ; Step S2: Calculate the target number of bits With the number of precoded bits The difference between : ; Step S3, according to , Calculate the quantization parameters of the current macroblock. : ; ; in, for Mapping table; Step S4 renew: .

[0013] Compared with the prior art, the beneficial effects of the present invention are: Balancing high compression ratio with visual quality: Macroblock segmentation (fixed height of 2, flexible width of 128 or 256) adapts to different scene requirements; RGB to YUV color space conversion reduces component correlation; and then vertical compression... Wavelet transform and horizontal The multi-level processing of the transformation effectively separates high-frequency and low-frequency information in the image. Combined with dynamic quantization parameter adjustment based on precoding (bitrate control), it can achieve a high compression ratio while preserving image details to the maximum extent, approaching the visual lossless effect, thus solving the contradiction between high compression ratio and image quality loss in traditional solutions.

[0014] Low cost and ease of implementation: The algorithm design is lightweight, and the transformation process uses a simple and efficient wavelet transform. Quantization / dequantization is achieved through shift operations, and entropy coding simplifies the data volume through hierarchical processing such as importance grouping, MSB position prediction, and run-length encoding, avoiding complex inter-frame prediction or loop filtering and reducing computational complexity.

[0015] High-efficiency rate control and stability: The number of bits is obtained through precoding and the optimal quantization parameters are dynamically calculated. This method combines a virtual buffer verification model to update the buffer fullness in real time, ensuring stable bitrate during encoding and avoiding transmission or storage problems caused by excessive bitrate fluctuations. It is especially suitable for bandwidth-sensitive scenarios such as ultra-high-definition video and VR, improving resolution and frame rate while reducing storage and transmission costs.

[0016] Low latency features: Macroblock-level parallel processing (independent segmentation and encoding processes) and coherent design of precoding and formal encoding reduce data dependencies and waiting time, ensuring low latency in the compression process and meeting the needs of applications with high real-time requirements (such as reference frame buffer compression). Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the overall method flow of the present invention; Figure 2 This is a schematic diagram of the encoding process of the present invention; Figure 3 This is a schematic diagram of the entropy encoding process of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figure 1-3 This invention provides a technical solution: a high compression ratio, low cost image compression method, comprising the following steps: Step 1, Macroblock Segmentation: Perform macroblock segmentation on the input image, where the height of the macroblock is 2, and the width is set to either 128 or 256 according to preset requirements; Step 2, Color Space Conversion: Perform color space conversion on the macroblocks segmented in Step 1, specifically converting the RGB of the macroblocks to YUV to reduce the correlation between image macroblock components. Step 3, Precoding: Precoding the converted macroblock to obtain the number of precoded bits; precoding uses precoding quantization parameters. The current macroblock is encoded to obtain the number of pre-coded bits. The specific implementation logic is as follows: a. First, upsampling is used to improve the image data precision of macroblocks and reduce the quality loss caused by transformation and quantization. The calculation formula is as follows: ; ; ; in This indicates the number of bits that need to be boosted. The raw data depth of the image macroblock. The pixel values ​​of an image macroblock. This represents the median pixel value after enhancement; b. Then, a vertical transform is performed. The vertical direction after the upsampled macroblock is subjected to Haar wavelet transform to obtain the low-frequency and high-frequency coefficients, denoted as... and The low-pass filter coefficients used are: The high-pass filter coefficient is The formula is as follows: Forward transform: ; ; in ,and Indicates the width of the macroblock; Indicates the first in a macroblock Line number The pixel values ​​of the column; Inverse transform: ; ; and These are the pixel values ​​recovered by the inverse transform, used to verify the accuracy of the transform; c. Horizontal transformation: The low-frequency and high-frequency coefficients described above are then subjected to a horizontal transformation. Transformation; The decomposition is performed once to obtain the frequency band. , ,right The decomposition was performed five times to obtain the frequency band. , , , , , As shown in Table 1: The specific calculation formula is as follows: Forward transform: ; ; Inverse transform: ; ; in, , Indicates rounding down; The input vertical transform coefficients, i.e. and ; The frequency band coefficients are the output after horizontal transformation; d. Quantization: For the low-frequency and high-frequency coefficients after horizontal transformation, pre-encoded quantization parameters are used. The formula for uniform quantization is as follows: Quantification: ;

[0020] Inverse quantization: ;

[0021] in These are the quantized coefficients. These are the low-frequency or high-frequency coefficients after horizontal transformation. This is the offset. These are the coefficients recovered after dequantization; e. Entropy coding: Entropy coding is performed on the quantized low-frequency and high-frequency coefficients in d.

[0022] The specific implementation details of entropy encoding for the quantized low-frequency and high-frequency coefficients are as follows: Step 1, Importance Encoding: Let every 4 quantized low-frequency and high-frequency coefficients form a coding group, and every 8 coding groups be called an importance group, i.e., 32 coefficients. The bit flag of each importance group indicates whether the coding group in the group completely carries data; if the importance flag is 1, then skip the entire importance group, and all 32 coefficients in the group are zero. Step II: Most Significant Bit (MSB) Position Encoding. For the coding groups within the non-zero importance groups selected in Step I, determine the position of their most significant bit. There are two implementation methods: Method 1: Directly transmit the original MSB position data, with each coding group occupying 4 bits; Method 2: Predict the MSB position using the MSB position of the left or top neighbor of the coding group, and send the prediction residual in the form of a unary code. Step III: Run-through encoding. In the encoding groups processed in Step II, if there is an empty encoding group without valid data and an overrun occurs, the empty encoding group is skipped directly to avoid encoding invalid data. Step IV: Data encoding. For the encoding groups that are still valid after being filtered in Step I and simplified in Step III, the absolute values ​​of their quantized wavelet coefficients are encoded. The encoding range covers all bits from the MSB position determined in Step II to the bit plane selected by the quantizer. Step V: Symbol encoding. Encode the symbols of the coefficients in the coding group in Step IV using unary codes. If there is a coding group with non-zero coefficients in Step I, only the symbols whose absolute values ​​are not zero are encoded.

[0023] Step 4, Rate Control: Calculate the optimal quantization parameters based on the number of precoded bits for the current macroblock. Specifically, based on the number of pre-coded bits and the preset target number of bits, the optimal quantization parameters are calculated through the model. The specific implementation logic is as follows: Step S1: Calculate the target number of bits required for the current MB encoding. ; Configure the budget bits for the current macroblock. : ;

[0024] in, and These are the width and height of the macroblock, respectively. The number of color components. For pixel bit depth, Compression ratio; A virtual buffer verification model is adopted, based on the buffer fullness of the current macroblock. To obtain the current MB Number of buffer bits: ;

[0025] in, This is the inverse gain coefficient.

[0026] Calculate the target number of bits : ;

[0027] Step S2: Calculate the target number of bits With the number of precoded bits The difference between : ;

[0028] Step S3, according to , Calculate the quantization parameters of the current macroblock. : ; ;

[0029] in, for Mapping table; Step S4 renew: .

[0030] Step 5, Formal Encoding: Based on the calculated optimal quantization parameters The current macroblock is formally encoded, and the encoding process is the same as pre-encoding, that is, the number of bits obtained from encoding is... Proceed to step 4 Update; simultaneously, change the precoding quantization parameters. Updated to macroblock quantization parameters And package and output the bitstream.

[0031] This invention discloses a high-compression-ratio, low-cost image compression method, aiming to solve the problems of high bandwidth requirements in ultra-high-definition video transmission and storage, as well as the high complexity and cost of traditional compression schemes. The method includes the following steps: First, the input image is segmented into macroblocks, with the macroblock height fixed at 2 and the width set to 128 or 256; then, the RGB color space of the macroblocks is converted to YUV to reduce component correlation; next, precoding is performed, using upsampling to improve accuracy, vertical Haar wavelet transform, and horizontal... The process involves transformation, quantization, and entropy coding (including importance coding, MSB position coding, etc.) to obtain the number of pre-coded bits. Then, the optimal quantization parameters are calculated based on the number of pre-coded bits and the target number of bits to achieve bit rate control. Finally, formal encoding is performed based on the optimal quantization parameters, the buffer state is updated, and the bit stream is output.

[0032] This invention separates image frequency information through multi-level transformation, dynamically adjusts quantization parameters, and employs efficient entropy coding. It achieves a high compression ratio while ensuring visual losslessness. Furthermore, the algorithm has low complexity and low hardware implementation cost, making it suitable for multiple platforms such as FPGA and ASIC. It meets the low latency and high bandwidth efficiency requirements of ultra-high-definition video, VR, and other scenarios.

[0033] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A high-compression-ratio, low-cost image compression method, characterized in that, Includes the following steps: Step 1, Macroblock Segmentation: Perform macroblock segmentation on the input image, where the height of the macroblock is 2, and the width is set to either 128 or 256 according to preset requirements; Step 2, Color Space Conversion: Perform color space conversion on the macroblocks segmented in Step 1, specifically converting the RGB of the macroblocks to YUV to reduce the correlation between image macroblock components. Step 3, Precoding: Precoding the converted macroblock to obtain the number of precoded bits; Step 4, Rate Control: Calculate the optimal quantization parameters based on the number of precoded bits for the current macroblock. ; Step 5, Formal Encoding: Based on the calculated optimal quantization parameters The current macroblock is formally encoded, and the encoding process is the same as pre-encoding, that is, the number of bits obtained from encoding is... Proceed to step 4 Update; simultaneously, change the precoding quantization parameters. Updated to macroblock quantization parameters And package and output the bitstream.

2. The high compression ratio, low cost image compression method according to claim 1, characterized in that, The precoding in step 3 uses precoding quantization parameters. The current macroblock is encoded to obtain the number of pre-coded bits. The specific implementation logic is as follows: a. First, upsampling is used to improve the image data precision of macroblocks and reduce the quality loss caused by transformation and quantization. The calculation formula is as follows: ; ; ; in This indicates the number of bits that need to be boosted. The raw data depth of the image macroblock. The pixel values ​​of the image macroblock. This represents the median pixel value after enhancement; b. Then, a vertical transform is performed. The vertical direction after the upsampled macroblock is subjected to Haar wavelet transform to obtain the low-frequency and high-frequency coefficients, denoted as... and The low-pass filter coefficients used are: The high-pass filter coefficient is The formula is as follows: Forward transform: ; ; in ,and Indicates the width of the macroblock; Indicates the first in a macroblock Line 1 The pixel values ​​of the column; Inverse transform: ; ; and These are the pixel values ​​recovered by the inverse transform; c. Horizontal transformation: The low-frequency and high-frequency coefficients described above are then subjected to a horizontal transformation. Transformation; The decomposition is performed once to obtain the frequency band. , ,right The decomposition was performed five times to obtain the frequency band. , , , , , The formula is as follows: Forward transform: ; ; Inverse transform: ; ; in, , Indicates rounding down; The input vertical transform coefficients, i.e. and ; The frequency band coefficients are the output after horizontal transformation; d. Quantization: For the low-frequency and high-frequency coefficients after horizontal transformation, pre-encoded quantization parameters are used. The formula for uniform quantization is as follows: Quantification: ; Inverse quantization: ; in These are the quantized coefficients. These are the low-frequency or high-frequency coefficients after horizontal transformation. This is the offset. These are the coefficients recovered after dequantization; e. Entropy coding: Entropy coding is performed on the low-frequency and high-frequency coefficients after quantization in d.

3. The high compression ratio, low cost image compression method according to claim 1, characterized in that, The specific implementation details of entropy encoding for the quantized low-frequency and high-frequency coefficients are as follows: Step 1, Importance Encoding: Let every 4 quantized low-frequency or high-frequency coefficients be a coding group, and every 8 coding groups be called an importance group, i.e., 32 coefficients. The bit flag of each importance group indicates whether the coding group in the group completely carries data; if the importance flag is 1, then skip the entire importance group, and all 32 coefficients in the group are zero. Step II: Most Significant Bit (MSB) Position Encoding. For the coding groups within the non-zero importance groups selected in Step I, determine the position of their most significant bit. There are two implementation methods: Method 1: Directly transmit the original MSB position data, with each coding group occupying 4 bits; Method 2: Predict the MSB position using the MSB position of the left or top neighbor of the coding group, and send the prediction residual in the form of a unary code. Step III: Run-through encoding. In the encoding groups processed in Step II, if there is an empty encoding group without valid data and an overrun occurs, the empty encoding group is skipped directly to avoid encoding invalid data. Step IV: Data encoding. For the encoding groups that are still valid after being filtered in Step I and simplified in Step III, the absolute values ​​of their quantized wavelet coefficients are encoded. The encoding range covers all bits from the MSB position determined in Step II to the bit plane selected by the quantizer. Step V: Symbol encoding. Encode the symbols of the coefficients in the coding group in Step IV using unary codes. If there is a coding group with non-zero coefficients in Step I, only the symbols whose absolute values ​​are not zero are encoded.

4. The high compression ratio, low cost image compression method according to claim 1, characterized in that, Step 4 calculates the optimal quantization parameters based on the number of pre-coded bits and the preset target number of bits. The specific implementation logic is as follows: Step S1: Calculate the target number of bits required for the current MB encoding. ; Configure the budget bits for the current macroblock. : ; in, and These are the width and height of the macroblock, respectively. The number of color components. For pixel bit depth, Compression ratio; A virtual buffer verification model is adopted, based on the buffer fullness of the current macroblock. To obtain the current MB Number of buffer bits: ; in, It is the inverse gain coefficient; Calculate the target number of bits : ; Step S2: Calculate the target number of bits With the number of precoded bits The difference between : ; Step S3, according to , Calculate the quantization parameters of the current macroblock. : ; ; in, for Mapping table; Step S4 renew: 。