Image compression performance optimization methods, apparatus, equipment, storage media, and computer program products based on EZW.
By performing wavelet transform and regional gradient quantization on image data, and combining the main and auxiliary scans of the EZW algorithm, the algorithm dynamically determines whether the descendant nodes of the parent node need to be encoded, thus solving the problems of redundant coding and low quantization efficiency in existing technologies and achieving more efficient image compression.
Patent Information
- Application Number
- CN202411924098.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-25
AI Technical Summary
In some scenarios, when the parent node is determined to be an important coefficient, its descendant nodes are often redundantly encoded, resulting in a decrease in compression performance. Furthermore, the distribution characteristics of wavelet coefficients in different frequency regions are not fully utilized, leading to low quantization efficiency.
The image data is decomposed into multi-level wavelet coefficients by wavelet transform and then subjected to regional gradient quantization. Based on the EZW algorithm, the main scan and auxiliary scan are performed sequentially from high frequency to low frequency. During the main scan, the parasitic flag of the important coefficient is used to dynamically determine whether the descendant nodes of the parent node need to be encoded. Encoded data is generated and transmitted.
It effectively reduces the amount of redundant data in different frequency regions, improves coding efficiency and the utilization rate of zero-tree structure, and enhances image compression performance.
Smart Images

Figure CN119854524B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital image compression technology, and in particular to an image compression performance optimization method, apparatus, device, storage medium, and computer program product based on EZW. Background Technology
[0002] With the rapid development of digital integrated circuits, the demand for image processing technology in mobile devices is constantly increasing. To improve the efficiency of image transmission and storage, image compression technology has been widely researched and applied. Especially in high compression ratio scenarios, lossy compression algorithms are widely used, sacrificing some image quality to significantly reduce data volume. Wavelet transform-based image compression algorithms can further optimize compression effects, and the Embedded Zero-tree Scan (EZW) algorithm can further improve the performance of wavelet transform algorithms. The EZW algorithm utilizes the correlation between wavelet transform coefficients between parent and child nodes, achieving efficient image compression based on a zero-tree structure. However, in some scenarios, when a parent node is determined to be an important coefficient, its descendant nodes are often redundantly encoded, which reduces compression performance. Furthermore, the distribution characteristics of wavelet coefficients in different frequency regions are not fully utilized, resulting in low quantization efficiency and consequently poor image compression performance. Therefore, how to improve image compression performance has become an urgent technical problem to be solved. Summary of the Invention
[0003] The main objective of this application is to provide an image compression performance optimization method, apparatus, device, storage medium, and computer program product based on EZW, aiming to solve the technical problem of how to improve image compression performance.
[0004] To achieve the above objectives, this application provides an image compression performance optimization method based on EZW, the method comprising the following steps:
[0005] The image data is decomposed into multi-level wavelet coefficients by performing wavelet transform on the image data;
[0006] The multi-level wavelet coefficients are subjected to regional gradient quantization.
[0007] Based on the EZW algorithm, the multi-level wavelet coefficients after regional gradient quantization are subjected to main scanning and auxiliary scanning in order from high frequency to low frequency.
[0008] During the main scan, based on the parasitic flag of the importance coefficient, it is dynamically determined whether the descendant nodes of the parent node need to be encoded;
[0009] Based on the main scan results, auxiliary scan results, and judgment results, encoded data is generated and transmitted.
[0010] In one embodiment, the step of performing wavelet transform on the image data to decompose the image data into multi-level wavelet coefficients includes:
[0011] Extract the frequency distribution features of the image data, and determine the target wavelet basis function and the number of decomposition layers based on the frequency distribution features;
[0012] Based on the target wavelet basis function and the number of decomposition layers, the image data is decomposed in both the row direction and the column direction to obtain multiple sub-bands;
[0013] Perform row-direction decomposition and column-direction decomposition on the row and column low-frequency sub-bands in the plurality of sub-bands to obtain multi-level sub-bands;
[0014] The multi-level wavelet coefficients are determined based on the multiple sub-bands and the multi-level sub-bands.
[0015] In one embodiment, the step of performing regional gradient quantization processing on the multi-level wavelet coefficients includes:
[0016] Based on the sub-band frequency and decomposition level of the multi-level wavelet coefficients, the multi-level wavelet coefficients are divided into multiple frequency regions.
[0017] Based on the characteristics of the image data in each frequency region, a quantization factor allocation strategy is determined;
[0018] Based on the quantization factor allocation strategy, the sub-band coefficients corresponding to each frequency region are quantized.
[0019] In one embodiment, the step of performing main and auxiliary scans sequentially on the multi-level wavelet coefficients after regional gradient quantization processing based on the EZW algorithm, in order from high frequency to low frequency, includes:
[0020] The scanning threshold is determined based on the maximum absolute value of the multi-level wavelet coefficients after the regional gradient quantization processing.
[0021] The main scan is performed on the multi-level wavelet coefficients after the regional gradient quantization processing in order from high frequency to low frequency, and the main scan result is compared with the scan threshold.
[0022] Based on the comparison results, a secondary table of importance coefficients is generated, wherein the secondary table of importance coefficients includes the importance coefficients and the positions of the importance coefficients;
[0023] Based on the aforementioned important coefficient sub-table, the important coefficients are subjected to the auxiliary scan.
[0024] In one embodiment, the step of performing the auxiliary scan on the importance coefficients based on the importance coefficient sub-table includes:
[0025] Traverse the sub-table of importance coefficients and refine the encoding of the absolute values of the importance coefficients;
[0026] Determine whether the absolute value of the importance coefficient is within a preset range;
[0027] If so, based on the refined coding results, generate the corresponding binary coding sequence and record the positive and negative information of the important coefficients.
[0028] In one embodiment, after the step of performing main and auxiliary scans sequentially on the multi-level wavelet coefficients after regional gradient quantization processing based on the EZW algorithm in order from high frequency to low frequency, the method further includes:
[0029] The value of the scanning threshold is reduced based on a preset threshold reduction strategy;
[0030] Repeat the main scan and the auxiliary scan until the scan threshold is reduced to a preset minimum threshold.
[0031] Furthermore, to achieve the above objectives, this application also proposes an EZW-based image compression performance optimization device, which includes:
[0032] The wavelet transform module is used to perform wavelet transform on image data, decomposing the image data into multi-level wavelet coefficients;
[0033] The gradient quantization module is used to perform regional gradient quantization processing on the multi-level wavelet coefficients.
[0034] The scanning module is used to perform main scanning and auxiliary scanning on the multi-level wavelet coefficients after regional gradient quantization processing based on the EZW algorithm, in order from high frequency to low frequency.
[0035] The encoding judgment module is used to dynamically determine whether the descendant nodes of the parent node need to be encoded based on the parasitic flag bit of the importance coefficient during the main scanning process.
[0036] The target module is used to generate encoded data and transmit it based on the main scan results, auxiliary scan results, and judgment results.
[0037] Furthermore, to achieve the above objectives, this application also proposes an EZW-based image compression performance optimization device, the device comprising: a memory, a processor, and an EZW-based image compression performance optimization program stored in the memory and executable on the processor, the EZW-based image compression performance optimization program being configured to implement the steps of the EZW-based image compression performance optimization method described above.
[0038] In addition, to achieve the above objectives, this application also proposes a storage medium storing an EZW-based image compression performance optimization program, which, when executed by a processor, implements the steps of the EZW-based image compression performance optimization method described above.
[0039] In addition, to achieve the above objectives, this application also proposes a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the EZW-based image compression performance optimization method described above.
[0040] This application decomposes image data into multi-level wavelet coefficients through wavelet transform; performs regional gradient quantization on these multi-level wavelet coefficients; and, based on the EZW algorithm, performs main and auxiliary scans sequentially from high to low frequency on the multi-level wavelet coefficients after regional gradient quantization. During the main scan, it dynamically determines whether the descendant nodes of the parent node need to be encoded based on the parasitic flag of important coefficients. Based on the main scan results, auxiliary scan results, and the determination results, encoded data is generated and transmitted. This application effectively reduces redundant data in different frequency regions by performing wavelet transform on image data to decompose it into multi-level wavelet coefficients, combined with regional gradient quantization. The EZW algorithm performs main and auxiliary scans sequentially from high to low frequency, utilizing a zero-tree structure to reduce the encoding overhead for non-important coefficients. Furthermore, by introducing parasitic flags of important coefficients during the main scan and dynamically determining whether the descendant nodes of the parent node need to be encoded, it further optimizes encoding efficiency and the utilization rate of the zero-tree structure. Finally, it combines the main scan, auxiliary scan, and dynamic determination results to generate encoded data for transmission, thus improving image compression performance. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating the first embodiment of the image compression performance optimization method based on EZW of this application;
[0042] Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the image compression performance optimization method based on EZW of this application;
[0043] Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the image compression performance optimization method based on EZW of this application;
[0044] Figure 4 This is a schematic diagram of the scanning process in one embodiment of the image compression performance optimization method based on EZW of this application;
[0045] Figure 5 This is a schematic diagram of the module structure of the image compression performance optimization device based on EZW according to an embodiment of this application;
[0046] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the image compression performance optimization method based on EZW in the embodiments of this application.
[0047] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0049] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0050] It should be noted that with the rapid development of digital integrated circuits, the demand for image processing technology in mobile devices is constantly increasing. To improve the efficiency of image transmission and storage, image compression technology has been widely researched and applied. Especially in high compression ratio scenarios, lossy compression algorithms are widely used, sacrificing some image quality to significantly reduce data volume. Wavelet transform-based image compression algorithms can further optimize compression effects, and the Embedded Zero-tree Scan (EZW) algorithm can further improve the performance of wavelet transform algorithms. The EZW algorithm utilizes the correlation between wavelet transform coefficients between parent and child nodes, achieving efficient image compression based on a zero-tree structure. However, in some scenarios, when a parent node is determined to be an important coefficient, its descendant nodes are often redundantly encoded, which reduces compression performance. Furthermore, the distribution characteristics of wavelet coefficients in different frequency regions are not fully utilized, resulting in low quantization efficiency and consequently poor image compression performance. Therefore, how to improve image compression performance has become an urgent technical problem to be solved.
[0051] The main solution of this application is as follows: By performing wavelet transform on the image data, the image data is decomposed into multi-level wavelet coefficients; regional gradient quantization is performed on the multi-level wavelet coefficients; based on the EZW algorithm, the multi-level wavelet coefficients after regional gradient quantization are sequentially scanned in order from high frequency to low frequency, and then scanned in a secondary manner; during the main scan, the parasitic flag of the important coefficients is used to dynamically determine whether the descendant nodes of the parent node need to be encoded; based on the main scan results, the secondary scan results, and the judgment results, encoded data is generated and transmitted.
[0052] This application decomposes image data into multi-level wavelet coefficients by performing wavelet transform, and combines this with regional gradient quantization to effectively reduce redundant data in different frequency regions. Based on the EZW algorithm, the main scan and auxiliary scan are performed sequentially from high frequency to low frequency. The zero-tree structure is used to reduce the encoding overhead of non-important coefficients. At the same time, by introducing parasitic flag bits for important coefficients during the main scan, the encoding efficiency and utilization rate of the zero-tree structure are further optimized by dynamically determining whether the descendant nodes of the parent node need to be encoded. Finally, the encoded data is generated and transmitted by combining the results of the main scan, auxiliary scan, and dynamic judgment, thus improving the image compression performance.
[0053] It should be noted that the execution subject of the method in this embodiment can be a computing service device with data processing, network communication, and program execution functions, or it can be the aforementioned EZW-based image compression performance optimization device with the same or similar functions. This embodiment and the following embodiments will be described using an EZW-based image compression performance optimization device as an example.
[0054] Based on this, a first embodiment of the image compression performance optimization method based on EZW is proposed in this application. Please refer to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the image compression performance optimization method based on EZW in this application.
[0055] In this embodiment, the EZW-based image compression performance optimization method includes the following steps:
[0056] S1: Perform wavelet transform on the image data to decompose the image data into multi-level wavelet coefficients;
[0057] It should be noted that image data refers to digitized two-dimensional images, typically represented as a pixel matrix, with each pixel containing color or grayscale information. Wavelet transform is a mathematical transformation method that decomposes a signal into components of different scales and frequencies. Wavelet transform is particularly suitable for analyzing non-stationary signals, capable of simultaneously extracting both time and frequency information. Multi-level wavelet coefficients refer to the coefficients at which the wavelet transform decomposes an image into multiple frequency levels, each corresponding to a different frequency range. These coefficients reflect the image's feature information at different scales, including low-frequency components (global features) and high-frequency components (detail information).
[0058] Specifically, appropriate wavelet basis functions (such as Haar wavelets, Daubechies wavelets, etc.) and the number of decomposition levels are selected based on the characteristics of the image data. The wavelet basis functions determine the basic shape of the wavelet transform and affect the expressiveness of the transform result. The number of decomposition levels controls the depth at which the image is decomposed; the higher the number of levels, the lower the resolution of the low-frequency components and the less detail is contained in the high-frequency components. Then, the image data is preprocessed and represented as a two-dimensional pixel matrix to provide input for the subsequent wavelet transform.
[0059] Furthermore, a one-dimensional wavelet transform is applied to each row of the image matrix, decomposing it into low-frequency components (L) and high-frequency components (H), representing the main contour information and local detail information of the image, respectively. Half of the output matrix is the low-frequency part, and the other half is the high-frequency part. A one-dimensional wavelet transform is then applied again to each column of the row transform result matrix, yielding four sub-bands: low-low frequency (LL), low-high frequency (LH), high-low frequency (HL), and high-high frequency (HH). These sub-bands represent the features of the image in different directions and frequency ranges. For multi-level wavelet transforms, the low-frequency sub-band (LL) is repeatedly decomposed to form deeper multi-level wavelet coefficients.
[0060] Wavelet transform decomposes image data into multi-level wavelet coefficients, allowing the low-frequency components to represent the global information of the image, while the high-frequency components mainly reflect the image's detailed features. This decomposition provides the foundation for subsequent targeted compression operations, enabling the characteristics of different regions to be processed independently. Unlike the traditional Fourier transform, wavelet transform can preserve information in both the spatial and frequency domains, making it more effective in representing image edges and details, and particularly suitable for image compression and reconstruction. After multi-level wavelet decomposition, most of the image's energy is concentrated in the low-frequency components, while the high-frequency components contain less information and have higher redundancy. Through further quantization and optimization of the high-frequency components, the amount of data stored and transmitted can be significantly reduced without significantly affecting the overall image quality. Multi-level wavelet coefficients provide a hierarchical image representation, laying the foundation for subsequent operations such as regional quantization and EZW scanning, enabling the algorithm to achieve a flexible balance between compression ratio and decoding quality.
[0061] S2: Perform regional gradient quantization on the multi-level wavelet coefficients;
[0062] It should be noted that regionalization refers to dividing wavelet coefficients into different regions based on their frequency characteristics, such as low-frequency and high-frequency regions, with each region corresponding to different image features. Gradient quantization assigns different quantization factors based on the importance of each region, achieving a balance between compression and information preservation by finely quantizing important regions (such as low-frequency regions) and coarsely quantizing less important regions (such as high-frequency regions).
[0063] Specifically, the multi-level wavelet coefficients are divided into low-frequency and high-frequency regions based on their frequency distribution characteristics. The low-frequency region (LL sub-band) contains the main energy and global features of the image and is usually the most important region. The high-frequency regions (LH, HL, HH sub-bands) contain local details and texture information of the image and are relatively less important. The importance of high-frequency regions gradually decreases at higher decomposition levels in the multi-level wavelet transform result. High-frequency regions at lower decomposition levels usually contain more important detail information.
[0064] Furthermore, different quantization factors are set according to the importance of each frequency region. Smaller quantization factors are used in low-frequency regions to preserve global features and key information as much as possible. Larger quantization factors are used in high-frequency regions to reduce the precision requirements for less important details, thereby reducing the amount of data. Each frequency region is traversed, and the wavelet coefficients within that region are quantized. The coefficients are scaled using the quantization factor to retain effective information with a certain precision while truncating redundant data smaller than the quantization precision.
[0065] Regional gradient quantization effectively reduces redundant data and lowers the overall data volume for storage and transmission by introducing a larger quantization factor in high-frequency regions, thus achieving efficient compression. Differentiated quantization strategies are employed for different regions, allowing the compression algorithm to retain important information to the maximum extent while reducing data volume, thereby improving the compression ratio. A smaller quantization factor is used in low-frequency regions to ensure the preservation of the main image features, improving the quality of the decoded image. The quantization factor allocation strategy is dynamically adjusted according to the frequency characteristics of the image content, making the method more adaptable to different types of images. Through regional gradient quantization, the storage efficiency and information utilization of multi-level wavelet coefficients are significantly improved, providing more optimized input for subsequent EZW scanning and encoding.
[0066] S3: Based on the EZW algorithm, the multi-level wavelet coefficients after regional gradient quantization are subjected to main scanning and auxiliary scanning in order from high frequency to low frequency.
[0067] It should be noted that the EZW algorithm, short for Embedded Zerotree Wavelet, is a high-efficiency image compression algorithm that utilizes the parent-child node correlation of wavelet transform coefficients to achieve efficient coefficient encoding through a zero-tree structure. The main scan is the first stage of the EZW algorithm, primarily used to identify important coefficients and construct the zero-tree structure, determining which coefficients require further processing based on the current threshold. The auxiliary scan is the second stage of the EZW algorithm, refining the encoding of the coefficients marked as important in the main scan, including symbolic encoding and absolute value range refinement.
[0068] Specifically, the initial scanning conditions are first determined, including the value of the largest coefficient as the starting reference value for the scan. This is to accurately determine which coefficients are important in the first round of scanning. The scanning order is then determined, starting from the high-frequency region of the highest resolution layer and gradually transitioning to the low-frequency region. This order helps to prioritize the processing of detailed information while gradually preserving the global features of the image.
[0069] Furthermore, the main scan's task is to traverse each wavelet coefficient and classify them according to preset judgment criteria. If a coefficient is of high importance, it is marked as an "important coefficient," indicating that it requires further processing and encoding. If a coefficient and its child nodes are unimportant, they are marked as "zero roots" to avoid redundant processing of descendant nodes. If a coefficient itself is unimportant, but its child nodes contain important information, it is marked as an "isolated zero" so that these child nodes can be considered in subsequent processing. The results of the main scan are recorded, including the position and classification information of each important coefficient. This information is compiled into a "sub-table of important coefficients," providing a basis for the auxiliary scan. The auxiliary scan's task is to further process the important coefficients marked by the main scan. The specific values of each important coefficient are further subdivided, and its performance in different intervals is recorded. The positive and negative information of these important coefficients is also recorded to ensure the integrity of image reconstruction. The auxiliary scan results are finally combined with the zero-tree structure information from the main scan to form complete encoded data.
[0070] The main scan utilizes a zero-tree structure to directly mark a large number of unimportant coefficients and their descendant coefficients as "zero roots," avoiding repeated scanning and processing of descendant nodes, thus significantly reducing the amount of data processing. The auxiliary scan refines the encoding of the important coefficients marked in the main scan, ensuring that this important information is accurately preserved. This refined processing method effectively balances compression ratio and image quality. The main scan quickly filters unnecessary data, while the auxiliary scan finely encodes key data. Combined with a well-designed scanning order, the entire compression process is both efficient and maintains image reconstruction quality. The scanning order from high frequency to low frequency prioritizes the processing of detailed information, making the application of the zero-tree structure more efficient in high-frequency regions, while also preserving the global features of low-frequency regions. Through the cooperation of the main and auxiliary scans, the EZW algorithm can efficiently process wavelet coefficients after regional gradient quantization, achieving an optimized balance between high compression ratio and high reconstruction accuracy.
[0071] S4: During the main scan process, based on the parasitic flag of the importance coefficient, it is dynamically determined whether the descendant nodes of the parent node need to be encoded;
[0072] It should be noted that the Parasitic Significance Flag (PAF) is used to dynamically indicate whether the descendant nodes of a parent node need to be encoded. When the parent node has a significant coefficient, the parasitic flag indicates whether its descendant nodes also have significant coefficients, thus determining whether to skip further scanning of the descendant nodes. Dynamic judgment refers to generating a judgment result in real time based on the status (significant or unsignificant) of the coefficients during the actual scanning process, and adjusting the subsequent scanning logic accordingly.
[0073] Specifically, at the beginning of the main scan, an initial threshold is set based on the maximum value of the multi-level wavelet coefficients as a criterion for determining the importance of the coefficients. An important coefficient parasitic flag is dynamically set for each parent node, initially empty or at a default value, and used to subsequently determine whether to scan and encode descendant nodes.
[0074] Furthermore, if the absolute value of the coefficient of the current node is greater than or equal to the current threshold, the node is marked as an important coefficient. If the current node is marked as an important coefficient, its descendant nodes are further evaluated. If all descendant nodes are non-important coefficients: the parasitic flag of the parent node is set to "1", indicating that the descendant nodes can skip encoding. If an important coefficient exists in a descendant node: the parasitic flag of the parent node is set to "0", indicating that the descendant nodes need to continue encoding. The scanning process is dynamically adjusted according to the value of the parasitic flag: PAF=1: skip the scanning and encoding of descendant nodes to reduce redundant processing; PAF=0: continue scanning and judging descendant nodes to ensure that important information is correctly encoded. After the main scan is completed, the status of each important coefficient (such as position, value, symbol, etc.) and the marking result of the parasitic flag are recorded in the important coefficient sub-table as input for subsequent auxiliary scans. At the same time, the zero-tree structure information is updated, and the zero-tree optimized by combining the parasitic flag can more efficiently guide the encoding process.
[0075] By using parasitic flags for importance coefficients, it is possible to dynamically determine whether descendant nodes of a parent node need to be encoded. For descendant nodes lacking important information, scanning and encoding are skipped, avoiding unnecessary processing and improving the overall efficiency of the algorithm. Parasitic flags enhance the expressive power of the zero-tree structure, enabling it to more accurately represent the correlation between wavelet coefficients, thereby further improving the compression ratio. The dynamic judgment mechanism of parasitic flags can adjust scanning and encoding strategies according to the actual data distribution, making the algorithm more flexible and suitable for both low-compression-ratio scenarios and maintaining high image quality in high-compression-ratio scenarios. By reducing the encoding requirements for descendant nodes, parasitic flags can effectively reduce the amount of encoded data, thereby shortening encoding time and reducing storage requirements.
[0076] S5: Based on the main scan results, auxiliary scan results, and judgment results, generate encoded data and transmit it.
[0077] It should be noted that the judgment result refers to the result of dynamically judging the encoding requirements of the parent node's descendant nodes based on the parasitic flag bits of the importance coefficient during the main scan, which is used to optimize the zero-tree structure and compression process. The encoded data refers to the compressed data file formed by combining the main scan, auxiliary scan, and judgment results, which contains the complete information required for image restoration and is used for transmission or storage.
[0078] Specifically, the important coefficients, sub-table information, and zero-tree structure marker data generated by the main scan are extracted. Combined with dynamic judgment results (such as parasitic flags for important coefficients), the optimized zero-tree structure can directly mark which descendant nodes are skipped from encoding. The fine-grained encoding data generated in the auxiliary scan stage is mapped one-to-one with the important coefficients marked in the main scan, including the sign information and the binary encoding of the absolute value. This ensures that the auxiliary scan results cover all important coefficients marked in the main scan.
[0079] Furthermore, the zero-tree structure information is transformed into a compact encoding form, recording the state of each node (such as importance coefficients, zero-tree roots, isolated zeros) and parent-child node relationships. For descendant nodes marked as not requiring encoding in the dynamic judgment results, their related data is directly omitted, further compressing the encoding amount. The refined encoding results generated by the auxiliary scan are combined with the zero-tree structure to form complete coefficient encoding data, including: precise value encoding of importance coefficients, sign information, and related zero-tree markers. The main scan, auxiliary scan, and dynamic judgment results are integrated into a single compressed data file to ensure data compactness and decoding integrity, including all information required for image reconstruction, such as importance coefficients, sub-tables, zero-tree markers, and optimized parasitic flag information.
[0080] By integrating the results of the main and auxiliary scans and combining them with a zero-tree structure optimized by parasitic flags, the amount of redundant data encoded can be minimized, further improving compression efficiency. The zero-tree markers of the main scan provide global compression information, while the fine-grained encoding of the auxiliary scan ensures high-precision representation of important coefficients. Combined, these features guarantee high-quality image restoration after decoding even under high compression ratios. The resulting encoded data is small in size and compact in structure, suitable for efficient transmission in bandwidth-constrained scenarios or long-term storage in environments with limited storage resources. Dynamically optimizing the zero-tree structure based on the results adapts to the coefficient distribution characteristics of different images, ensuring a balance between high compression ratios and high decoding quality across various image types.
[0081] This embodiment decomposes image data into multi-level wavelet coefficients through wavelet transform; it then performs regional gradient quantization on these coefficients; based on the EZW algorithm, it performs main and auxiliary scans sequentially from high to low frequency on the multi-level wavelet coefficients after regional gradient quantization; during the main scan, it dynamically determines whether the descendant nodes of the parent node need to be encoded based on the parasitic flag of important coefficients; and finally, it generates and transmits encoded data based on the main scan results, auxiliary scan results, and the determination results. This embodiment effectively reduces redundant data in different frequency regions by performing wavelet transform on image data to decompose it into multi-level wavelet coefficients, combined with regional gradient quantization; it performs main and auxiliary scans sequentially from high to low frequency using the EZW algorithm, utilizing a zero-tree structure to reduce the encoding overhead for non-important coefficients; and further optimizes encoding efficiency and the utilization rate of the zero-tree structure by introducing parasitic flags of important coefficients during the main scan and dynamically determining whether the descendant nodes of the parent node need to be encoded; and finally, it generates and transmits encoded data by combining the main scan, auxiliary scan, and dynamic determination results, thus improving image compression performance.
[0082] Based on the first embodiment described above, a second embodiment of the image compression performance optimization method based on EZW is proposed in this application. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the image compression performance optimization method based on EZW of this application.
[0083] like Figure 2 As shown, in this embodiment, step S1 includes:
[0084] S11: Extract the frequency distribution features of the image data, and determine the target wavelet basis function and the number of decomposition layers based on the frequency distribution features;
[0085] S12: Based on the target wavelet basis function and the number of decomposition layers, the image data is decomposed in both the row direction and the column direction to obtain multiple sub-bands;
[0086] S13: Perform row direction decomposition and column direction decomposition on the row and column low-frequency sub-bands in the plurality of sub-bands to obtain multi-level sub-bands;
[0087] S14: Determine the multi-level wavelet coefficients based on the plurality of sub-bands and the multi-level sub-bands.
[0088] It should be noted that frequency distribution characteristics refer to the distribution patterns of different frequency components (such as low-frequency global information and high-frequency detail information) in image data, reflecting the complexity and structural characteristics of the image content.
[0089] Specifically, statistical analysis is performed on image data to extract its frequency distribution features, such as texture complexity, edge density, and global contrast. These frequency distribution features determine whether the main information of the image is concentrated in the low-frequency or high-frequency components. A suitable target wavelet basis function is then selected based on these features. For example, the Haar wavelet can be chosen for images with obvious edges to better capture edge characteristics. The Daubechies wavelet can be chosen for images containing smooth regions and detailed information to more accurately represent information at different levels. The number of wavelet decomposition levels is determined based on the image size and frequency distribution range. Higher decomposition levels result in lower resolution in the low-frequency components, suitable for large images with complex textures; lower decomposition levels are suitable for simpler images.
[0090] Furthermore, high-pass and low-pass filtering is applied to each row of the image matrix to extract high-frequency and low-frequency information, respectively, generating preliminary sub-band components. High-pass and low-pass filtering is then applied to each column of the resulting matrix after row decomposition to further separate frequency components in different directions, resulting in four sub-bands: LL, LH, HL, and HH. The low-frequency sub-band (LL) is further decomposed in both row and column directions, repeating the above process to extract lower-frequency information layer by layer. After each decomposition, the resolution of the low-frequency sub-band decreases, while the high-frequency sub-band contains less detailed information layer by layer. Through multiple decompositions, the image data is decomposed into multiple frequency sub-bands at different levels, each containing its specific frequency components, ultimately generating multi-level wavelet coefficients.
[0091] Selecting the target wavelet basis function and decomposition level based on the frequency distribution characteristics of the image enables wavelet transform to more accurately represent the main information and detailed features of the image, thereby improving the efficiency and accuracy of subsequent processing. Multi-level wavelet decomposition distributes image information across subbands of different frequencies and directions, clearly distinguishing between global features (low frequencies) and local details (high frequencies), providing a good data structure for subsequent compression and analysis. Further decomposition of the low-frequency subbands preserves the main global information, while the progressive refinement of the high-frequency subbands ensures that details are also reasonably preserved, providing an efficient foundation for subsequent compression. By dynamically selecting the wavelet basis function and decomposition level, the method can adapt to images of different types and complexities, effectively balancing compression ratio and decoding quality.
[0092] Based on the first embodiment described above, in this embodiment, step S2 includes:
[0093] S21: Based on the sub-band frequency and decomposition level of the multi-level wavelet coefficients, the multi-level wavelet coefficients are divided into multiple frequency regions;
[0094] S22: Determine the quantization factor allocation strategy based on the characteristics of the image data in each frequency region;
[0095] S23: Based on the quantization factor allocation strategy, the sub-band coefficients corresponding to each frequency region are quantized.
[0096] It should be noted that subband frequencies refer to the frequency components contained in different subbands generated after wavelet transform, such as low-frequency subbands (LL, containing global information) and high-frequency subbands (LH, HL, HH, containing detail information). Frequency regions are defined by dividing the wavelet coefficients into several specific frequency regions based on the frequency range and decomposition level of the subbands, corresponding to the global features and detail information of the image, respectively. Quantization factors refer to the scaling parameters applied to the wavelet coefficients during quantization, used to balance image quality and compression efficiency. Quantization factor allocation strategies refer to assigning appropriate quantization factors to different frequency regions based on their importance and characteristics to achieve optimized quantization processing.
[0097] Specifically, the frequency characteristics of different sub-bands in the multi-level wavelet coefficients are analyzed, dividing them into several frequency regions: the low-frequency region, composed of the LL sub-band, mainly contains the global energy and main feature information of the image; the high-frequency region, composed of the LH, HL, and HH sub-bands, reflects the details and texture information of the image. For the multi-level decomposition results, the low-frequency and high-frequency sub-bands of each level are further refined: the low-frequency region of higher decomposition levels retains the global structure; the high-frequency region of higher decomposition levels represents local details, with the importance decreasing layer by layer.
[0098] Furthermore, low-frequency regions have concentrated energy and a significant impact on image reconstruction quality, requiring smaller quantization factors to ensure accuracy. High-frequency regions contain detailed information such as texture and edges, having a smaller impact on visual perception, allowing for larger quantization factors to compress data volume. The quantization factor is dynamically adjusted based on the importance of each frequency region and its impact on image quality: low-frequency regions use small quantization factors to retain key information; high-frequency regions use large quantization factors to reduce redundant data. Higher-frequency regions at higher decomposition levels have lower importance and therefore larger quantization factors.
[0099] Optionally, for each frequency region, the wavelet coefficients are read one by one. The wavelet coefficients in each subband are scaled using a predetermined quantization factor: larger coefficients are retained to preserve important information; smaller coefficients are approximated to zero to reduce data volume. The quantized wavelet coefficients are truncated or rounded to ensure they meet compression requirements while avoiding excessive loss of data precision.
[0100] Different quantization strategies are employed for low-frequency and high-frequency regions to effectively reduce the storage of unimportant information and achieve a higher compression ratio. A smaller quantization factor is used in the low-frequency region to retain global information, ensuring that the main features of the compressed image are restored, thus guaranteeing the quality of the decoded image. The coefficients in the high-frequency region are significantly reduced after processing with a larger quantization factor, reducing data redundancy and minimizing storage and transmission overhead. The quantization factor allocation strategy is dynamically adjusted according to the image characteristics, enabling the algorithm to adapt to different types and complexities of images, achieving the optimal balance between compression efficiency and image restoration quality.
[0101] This embodiment decomposes image data into multi-level wavelet coefficients through wavelet transform; it then performs regional gradient quantization on these coefficients; based on the EZW algorithm, it performs main and auxiliary scans sequentially from high to low frequency on the multi-level wavelet coefficients after regional gradient quantization; during the main scan, it dynamically determines whether the descendant nodes of the parent node need to be encoded based on the parasitic flag of important coefficients; and finally, it generates and transmits encoded data based on the main scan results, auxiliary scan results, and the determination results. This embodiment effectively reduces redundant data in different frequency regions by performing wavelet transform on image data to decompose it into multi-level wavelet coefficients, combined with regional gradient quantization; it performs main and auxiliary scans sequentially from high to low frequency using the EZW algorithm, utilizing a zero-tree structure to reduce the encoding overhead for non-important coefficients; and further optimizes encoding efficiency and the utilization rate of the zero-tree structure by introducing parasitic flags of important coefficients during the main scan and dynamically determining whether the descendant nodes of the parent node need to be encoded; and finally, it generates and transmits encoded data by combining the main scan, auxiliary scan, and dynamic determination results, thus improving image compression performance.
[0102] Based on the second embodiment described above, a third embodiment of the image compression performance optimization method based on EZW is proposed in this application. Please refer to... Figure 3 , Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the image compression performance optimization method based on EZW of this application.
[0103] In this embodiment, step S3 includes:
[0104] S31: Determine the scanning threshold based on the maximum absolute value of the multi-level wavelet coefficients after the regional gradient quantization processing;
[0105] S32: Perform the main scan on the multi-level wavelet coefficients after the regional gradient quantization processing in order from high frequency to low frequency, and compare the main scan result with the scan threshold.
[0106] S33: Based on the comparison results, generate a sub-table of importance coefficients, wherein the sub-table of importance coefficients includes the importance coefficients and the positions of the importance coefficients;
[0107] S34: Based on the importance coefficient sub-table, perform the auxiliary scan on the importance coefficients.
[0108] It should be noted that the scanning threshold is used as a benchmark value to determine whether a wavelet coefficient is an important coefficient. It is dynamically set based on the maximum absolute value of the wavelet coefficient and gradually decreases with each scanning round. The important coefficient sub-table records the data of coefficients determined to be important during the main scan, including the value, sign, and position of these coefficients in the wavelet coefficient matrix, providing input for the auxiliary scans.
[0109] Specifically, the maximum absolute value is extracted from the multi-level wavelet coefficients after regional gradient quantization processing, serving as a reference for the initial scanning threshold. The scanning threshold is set based on the maximum absolute value for the first round of main scanning. In subsequent scans, the scanning threshold is gradually reduced (e.g., halved each round) to progressively refine the judgment and encoding. Starting from the high-frequency region of the highest decomposition layer, the scan progresses to the low-frequency region of the lowest decomposition layer, prioritizing high-frequency coefficients containing detailed information. Each wavelet coefficient is traversed, and its absolute value is checked against the current scanning threshold. If the absolute value is greater than or equal to the threshold, it is marked as an important coefficient. If the absolute value is less than the threshold, and the coefficients of its descendant nodes are also less than the threshold, it is marked as a zero root. If the absolute value is less than the threshold, but an important coefficient exists among its descendant nodes, it is marked as an isolated zero.
[0110] Furthermore, based on the main scan results, a secondary table of importance coefficients is generated, containing the numerical value, sign, and position information of the importance coefficients. The secondary table also records zero-tree structure information for complete representation in subsequent auxiliary scans and compressed data. Each coefficient in the secondary table is traversed, and its value is further encoded. The absolute value of the importance coefficient is divided into multiple intervals, and a corresponding refined code is generated based on its interval. The sign (positive or negative) of the importance coefficient is also recorded to ensure that the correct value can be restored during image decoding. The encoded data generated from the auxiliary scans is combined with the zero-tree structure recorded in the main scan to form complete compressed encoded data.
[0111] Setting the scanning threshold based on the maximum absolute value and gradually decreasing the threshold in multiple scans effectively distinguishes between important and unimportant coefficients, making the encoding process more efficient. The main scan quickly marks important coefficients and the zero-tree structure, significantly reducing redundant processing of descendant nodes; the auxiliary scan further refines the encoding of important coefficients, ensuring accuracy and compactness. The construction of the zero-tree structure and the secondary table of important coefficients effectively records the parent-child relationship of wavelet coefficients, skipping unimportant coefficients and avoiding unnecessary data processing. The efficient zero-tree marking in the main scan, combined with the refined encoding in the auxiliary scan, allows the algorithm to maintain a high compression ratio while ensuring image reconstruction quality. Through dynamic adjustment of the scanning threshold and the combination of main and auxiliary scans, this step achieves efficient encoding of image data, providing core support for improving image compression performance.
[0112] Based on the second embodiment described above, in this embodiment, step S34 includes:
[0113] S341: Traverse the important coefficient sub-table and refine the encoding of the absolute values of the important coefficients;
[0114] S342: Determine whether the absolute value of the importance coefficient is within a preset range;
[0115] S343: If so, based on the refined coding result, generate the corresponding binary coding sequence and record the positive and negative information of the important coefficients.
[0116] It should be noted that refined encoding refers to a more precise encoding process for the absolute values of importance coefficients, reducing data redundancy by further dividing their numerical ranges. Preset interval ranges divide the absolute values of importance coefficients into multiple fixed ranges to determine their corresponding intervals and thus the encoding method. Binary encoding sequences refer to compressed data generated after encoding the absolute values and symbolic information of importance coefficients, represented in binary form for easier storage and transmission.
[0117] Specifically, the absolute value of each important coefficient, along with its corresponding position information and symbol, is extracted sequentially from the importance coefficient sub-table. The coefficients in the sub-table are arranged according to the main scan order to ensure the orderliness of the encoding process. The absolute values of the important coefficients are divided into multiple intervals, each corresponding to a specific encoding rule. For example, smaller absolute value intervals correspond to shorter codes; larger absolute value intervals may require more bits to represent. For each important coefficient's absolute value, it is determined whether it falls within a preset interval range. Based on the interval to which the coefficient belongs, a corresponding refined code is generated, such as using a fixed-length or adaptive-length binary code.
[0118] Furthermore, based on the generated absolute value code, additional sign information is added: if the coefficient is positive, it is recorded as a "positive mark"; if the coefficient is negative, it is recorded as a "negative mark". The refined absolute value code and the sign mark are combined to generate a complete binary code sequence representing the compressed data of this important coefficient.
[0119] By refining the encoding of the absolute values of importance coefficients, the numerical range is represented more precisely, significantly reducing data redundancy and improving compression efficiency. The pre-defined interval division dynamically adapts to the distribution characteristics of importance coefficients, using more bits for large ranges and shorter bits for small ranges, thus improving compression adaptability. Adding symbolic information while recording the binary code ensures the correct reconstruction of the positive and negative attributes of each importance coefficient during decoding, thereby improving image reconstruction quality. The generated binary code sequence has a compact structure, suitable for efficient transmission in bandwidth-constrained scenarios, and is also easy to store at high density on storage devices. Through refined encoding, interval judgment, and symbol recording, this step achieves precise encoding and efficient representation of importance coefficients, providing optimized support for high-quality storage and transmission of compressed data.
[0120] Based on the second embodiment described above, in this embodiment, after step S3, the method further includes:
[0121] S3a: Reduce the value of the scanning threshold based on a preset threshold reduction strategy;
[0122] S3b: Repeat the main scan and the auxiliary scan until the scan threshold is reduced to a preset minimum threshold.
[0123] It should be noted that the preset threshold reduction strategy refers to dynamically adjusting the size of the scanning threshold according to specific rules, gradually decreasing it to refine the processing of wavelet coefficients layer by layer. Common strategies include fixed-proportion reduction (e.g., halving it each time) or adaptive adjustment. The scanning threshold is used as a benchmark value to determine whether a wavelet coefficient is an important coefficient. It is gradually reduced as the scanning rounds proceed to capture more important coefficients with low amplitudes. The preset minimum threshold is a pre-set lower limit of the scanning threshold, usually set to 1 or other small values, used to determine the scanning termination condition.
[0124] Specifically, the initial scanning threshold is determined based on the maximum absolute value of the multi-level wavelet coefficients. This threshold is used to identify the most significant coefficients in the first main scan. The threshold is adjusted according to a preset threshold reduction strategy: fixed-proportional reduction: for example, halving the current threshold each time to gradually refine the scanning process; adaptive adjustment: dynamically adjusting the threshold based on the number of important coefficients marked in the previous scan. If there are many important coefficients, the threshold is appropriately reduced; otherwise, it is conservatively reduced. A new threshold is recorded after each scan to ensure that the next scan can capture coefficients with smaller amplitudes but still significant importance.
[0125] Furthermore, the multi-level wavelet coefficients after regional gradient quantization are scanned using the current threshold to determine which coefficients are important. A zero-tree structure is generated and recorded in the important coefficient sub-table. Coefficients below the threshold and their descendant nodes are skipped, and data processing is optimized through the zero-tree structure to reduce redundancy. The important coefficients marked by the main scan are further refined and encoded to generate corresponding absolute value codes and symbol information. The results of the auxiliary scan are combined with the zero-tree structure of the main scan to gradually improve the encoded data. After each reduction of the scan threshold, the main scan and auxiliary scan are repeated to capture more important information and gradually refine the encoding process. When the scan threshold is reduced to the preset minimum threshold, further main and auxiliary scan operations are stopped. At this point, all possible important coefficients have been recorded and finely encoded, and the compressed data is complete. The results of all rounds of main and auxiliary scans, including zero-tree structure information and important coefficient codes, are integrated to generate a complete compressed file.
[0126] Dynamically lowering the scanning threshold allows the main and auxiliary scans to capture coefficients with smaller amplitudes but still important values layer by layer, progressively refining the encoding results and ensuring the accuracy of image compression. Significant coefficients are processed centrally in the initial scan, and by gradually lowering the threshold over multiple rounds, premature processing of unimportant data is effectively avoided, improving overall encoding efficiency. Successively lowering the threshold captures more important coefficients with low amplitudes, ensuring that the compressed data contains sufficient information, thus maintaining image reconstruction quality even under high compression ratios. Dynamically adjusting the processing depth through a preset threshold reduction strategy allows the algorithm to flexibly adapt to the coefficient distribution characteristics of different images, achieving a balance between compression performance and decoding quality. The introduction of a zero-tree structure combined with layer-by-layer threshold adjustment avoids repeated processing of descendant nodes, significantly reducing redundant data during the encoding process.
[0127] This embodiment decomposes image data into multi-level wavelet coefficients through wavelet transform; it then performs regional gradient quantization on these coefficients; based on the EZW algorithm, it performs main and auxiliary scans sequentially from high to low frequency on the multi-level wavelet coefficients after regional gradient quantization; during the main scan, it dynamically determines whether the descendant nodes of the parent node need to be encoded based on the parasitic flag of important coefficients; and finally, it generates and transmits encoded data based on the main scan results, auxiliary scan results, and the determination results. This embodiment effectively reduces redundant data in different frequency regions by performing wavelet transform on image data to decompose it into multi-level wavelet coefficients, combined with regional gradient quantization; it performs main and auxiliary scans sequentially from high to low frequency using the EZW algorithm, utilizing a zero-tree structure to reduce the encoding overhead for non-important coefficients; and further optimizes encoding efficiency and the utilization rate of the zero-tree structure by introducing parasitic flags of important coefficients during the main scan and dynamically determining whether the descendant nodes of the parent node need to be encoded; and finally, it generates and transmits encoded data by combining the main scan, auxiliary scan, and dynamic determination results, thus improving image compression performance.
[0128] For example, please refer to Figure 4 , Figure 4 This is a schematic diagram of the scanning process in one embodiment of the image compression performance optimization method based on EZW of this application.
[0129] like Figure 4 As shown, a parasitic importance flag (PAF) is added for nodes containing descendant nodes. When the node is scanned as a non-important coefficient, the parasitic flag (PAF) is not present and does not affect the normal scanning performance of EZW. When the node is scanned as a major coefficient, the parasitic flag (PAF) is present, and its meaning is as follows:
[0130] 0: The descendant nodes of this node have an important coefficient, and the descendant nodes cannot skip the encoding.
[0131] 1: The descendant nodes of this node have no importance coefficients, and the descendant nodes can skip the encoding.
[0132] When using the Parasitic Significance Flag (PAF), in order to improve the effect, the wavelet transform coefficients need to be gradient quantized in different regions. The lower the frequency of the region where the coefficient is located, the smaller the quantization coefficient is used. In this way, the child node has a higher probability of not being scanned along with the parent node, thus increasing the transmission efficiency.
[0133] This application also provides an image compression performance optimization device based on EZW. Please refer to... Figure 5 , Figure 5This is a schematic diagram of the module structure of the EZW-based image compression performance optimization device according to an embodiment of this application. The EZW-based image compression performance optimization device includes:
[0134] Wavelet transform module 501 is used to perform wavelet transform on image data and decompose the image data into multi-level wavelet coefficients;
[0135] Gradient quantization module 502 is used to perform regional gradient quantization processing on the multi-level wavelet coefficients;
[0136] The scanning module 503 is used to perform main scanning and auxiliary scanning on the multi-level wavelet coefficients after regional gradient quantization processing based on the EZW algorithm, in order from high frequency to low frequency.
[0137] The encoding judgment module 504 is used to dynamically determine whether the descendant nodes of the parent node need to be encoded based on the parasitic flag bit of the importance coefficient during the main scanning process.
[0138] The target module 505 is used to generate encoded data and transmit it based on the main scan result, the auxiliary scan result and the judgment result.
[0139] The image compression performance optimization device based on EZW provided in this application adopts the image compression performance optimization method based on EZW in the above embodiments, and can solve the technical problem of how to improve image compression performance. Compared with the prior art, the beneficial effects of the image compression performance optimization device based on EZW provided in this application are the same as the beneficial effects of the image compression performance optimization method based on EZW provided in the above embodiments, and other technical features in the image compression performance optimization device based on EZW are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.
[0140] This application provides an EZW-based image compression performance optimization device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the EZW-based image compression performance optimization method in the above embodiments.
[0141] The following is for reference. Figure 6 , Figure 6This is a schematic diagram of the hardware operating environment involved in the EZW-based image compression performance optimization method in the embodiments of this application. It shows a schematic diagram of the structure of the EZW-based image compression performance optimization device suitable for implementing the embodiments of this application. The EZW-based image compression performance optimization device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The EZW-based image compression performance optimization device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0142] like Figure 6 As shown, the EZW-based image compression performance optimization device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the EZW-based image compression performance optimization device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the EZW-based image compression performance optimization device to exchange data wirelessly or via wired communication with other devices. Although the figure shows an EZW-based image compression performance optimization device with various systems, it should be understood that it is not required to implement or possess all of the systems shown. More or fewer systems may be implemented alternatively.
[0143] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0144] The image compression performance optimization device based on EZW provided in this application, employing the EZW-based image compression performance optimization method described in the above embodiments, can solve the technical problem of how to improve image compression performance. Compared with the prior art, the beneficial effects of the EZW-based image compression performance optimization device provided in this application are the same as those of the EZW-based image compression performance optimization method provided in the above embodiments, and other technical features in this EZW-based image compression performance optimization device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0145] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0146] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0147] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the EZW-based image compression performance optimization method in the above embodiments.
[0148] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0149] The aforementioned computer-readable storage medium may be included in an EZW-based image compression performance optimization device; or it may exist independently and not assembled into an EZW-based image compression performance optimization device.
[0150] The aforementioned computer-readable storage medium carries one or more programs that, when executed by an EZW-based image compression performance optimization device, cause the EZW-based image compression performance optimization device to: perform wavelet transform on the image data, decomposing the image data into multi-level wavelet coefficients; perform regional gradient quantization on the multi-level wavelet coefficients; based on the EZW algorithm, perform main and auxiliary scans sequentially on the multi-level wavelet coefficients after regional gradient quantization in order from high frequency to low frequency; during the main scan, dynamically determine whether the descendant nodes of the parent node need to be encoded based on the parasitic flag bits of the important coefficients; and generate and transmit encoded data based on the main scan results, auxiliary scan results, and determination results. Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0152] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0153] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described EZW-based image compression performance optimization method, thereby solving the technical problem of how to improve image compression performance. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the EZW-based image compression performance optimization method provided in the above embodiments, and will not be repeated here.
[0154] This application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the EZW-based image compression performance optimization method described above.
[0155] The computer program product provided in this application can solve the technical problem of how to improve image compression performance. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiments of this application are the same as the beneficial effects of the EZW-based image compression performance optimization method provided in the above embodiments, and will not be repeated here.
[0156] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.
Claims
1. A method for optimizing image compression performance based on EZW, characterized in that, The method includes: The image data is decomposed into multi-level wavelet coefficients by performing wavelet transform on the image data; The multi-level wavelet coefficients are subjected to regional gradient quantization. The steps of regional gradient quantization include: dividing the multi-level wavelet coefficients into high-frequency and low-frequency regions based on the sub-band frequencies and decomposition levels; determining a quantization factor allocation strategy based on the characteristics of the image data in the high-frequency and low-frequency regions, wherein the high-frequency region includes texture edge information and the low-frequency region includes global energy and feature information; the quantization factor allocation strategy includes configuring a large quantization factor for the high-frequency region and a small quantization factor for the low-frequency region; and quantizing the sub-band coefficients corresponding to each frequency region based on the quantization factor allocation strategy. Based on the EZW algorithm, the multi-level wavelet coefficients after regional gradient quantization are subjected to main scanning and auxiliary scanning in order from high frequency to low frequency. During the main scan, a parasitic flag for the importance coefficient is dynamically set for each parent node. If the current node is marked as having an important coefficient, the importance coefficients of the descendant nodes of the current node are obtained. If all the descendant nodes have non-important coefficients, the parasitic flag of the parent node of the descendant node is set to "1", indicating that the descendant node can skip encoding. If the descendant node contains the important coefficient, the parasitic flag of the parent node of the descendant node is set to "0", indicating that the descendant node needs to continue encoding. Based on the parasitic flag for the importance coefficient, it is dynamically determined whether the descendant nodes of the parent node need to be encoded. Based on the main scan results, auxiliary scan results, and judgment results, encoded data is generated and transmitted.
2. The method as described in claim 1, characterized in that, The step of performing wavelet transform on the image data to decompose the image data into multi-level wavelet coefficients includes: Extract the frequency distribution features of the image data, and determine the target wavelet basis function and the number of decomposition layers based on the frequency distribution features; Based on the target wavelet basis function and the number of decomposition layers, the image data is decomposed in both the row direction and the column direction to obtain multiple sub-bands; Perform row-direction decomposition and column-direction decomposition on the row and column low-frequency sub-bands in the plurality of sub-bands to obtain multi-level sub-bands; The multi-level wavelet coefficients are determined based on the multiple sub-bands and the multi-level sub-bands.
3. The method as described in claim 1, characterized in that, The steps of performing main and auxiliary scans on the multi-level wavelet coefficients after regional gradient quantization processing based on the EZW algorithm, in order from high frequency to low frequency, include: The scanning threshold is determined based on the maximum absolute value of the multi-level wavelet coefficients after the regional gradient quantization processing. The main scan is performed on the multi-level wavelet coefficients after the regional gradient quantization processing in order from high frequency to low frequency, and the main scan result is compared with the scan threshold. Based on the comparison results, a secondary table of importance coefficients is generated, wherein the secondary table of importance coefficients includes the importance coefficients and the positions of the importance coefficients; Based on the aforementioned important coefficient sub-table, the important coefficients are subjected to the auxiliary scan.
4. The method as described in claim 3, characterized in that, The step of performing the auxiliary scan on the importance coefficients based on the importance coefficient sub-table includes: Traverse the sub-table of importance coefficients and refine the encoding of the absolute values of the importance coefficients; Determine whether the absolute value of the importance coefficient is within a preset range; If so, based on the refined coding results, generate the corresponding binary coding sequence and record the positive and negative information of the important coefficients.
5. The method as described in claim 3, characterized in that, After the step of performing main and auxiliary scans on the multi-level wavelet coefficients after regional gradient quantization processing based on the EZW algorithm in order from high frequency to low frequency, the method further includes: The value of the scanning threshold is reduced based on a preset threshold reduction strategy; Repeat the main scan and the auxiliary scan until the scan threshold is reduced to a preset minimum threshold.
6. An image compression performance optimization device based on EZW, characterized in that, The device includes: The wavelet transform module is used to perform wavelet transform on image data, decomposing the image data into multi-level wavelet coefficients; A gradient quantization module is used to perform regional gradient quantization processing on the multi-level wavelet coefficients. The steps of the regional gradient quantization processing include: dividing the multi-level wavelet coefficients into high-frequency regions and low-frequency regions based on the sub-band frequencies and decomposition levels of the multi-level wavelet coefficients; determining a quantization factor allocation strategy according to the characteristics of the image data in the high-frequency regions and the low-frequency regions, wherein the high-frequency regions include texture edge information, and the low-frequency regions include global energy and feature information; the quantization factor allocation strategy includes configuring a large quantization factor for the high-frequency regions and a small quantization factor for the low-frequency regions; and quantizing the sub-band coefficients corresponding to each frequency region based on the quantization factor allocation strategy. The scanning module is used to perform main scanning and auxiliary scanning on the multi-level wavelet coefficients after regional gradient quantization processing based on the EZW algorithm, in order from high frequency to low frequency. The encoding judgment module is used to dynamically set the parasitic flag bit of the importance coefficient for each parent node during the main scanning process. If the current node is marked as having an important coefficient, the module obtains the importance coefficient information of the descendant nodes of the current node. If all the descendant nodes have non-important coefficients, the module sets the parasitic flag bit of the parent node of the descendant node to "1", indicating that the descendant node can skip encoding. If the descendant node contains the important coefficient, the module sets the parasitic flag bit of the parent node of the descendant node to "0", indicating that the descendant node needs to continue encoding. Based on the parasitic flag bit of the importance coefficient, the module dynamically determines whether the descendant nodes of the parent node need to be encoded. The target module is used to generate encoded data and transmit it based on the main scan results, auxiliary scan results, and judgment results.
7. A computer device, characterized in that, The device includes: a memory, a processor, and an EZW-based image compression performance optimization program stored in the memory and executable on the processor, the EZW-based image compression performance optimization program being configured to implement the steps of the EZW-based image compression performance optimization method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores an EZW-based image compression performance optimization program, which, when executed by a processor, implements the steps of the EZW-based image compression performance optimization method as described in any one of claims 1 to 5.
9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the EZW-based image compression performance optimization method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Wavelet coefficient quantization method applying human -eye visual model in image compression
CN102934428A
Image coding and decoding method and device based on wavelet transform
CN114390296A