JPEG quantization table and truncation position joint optimization method based on rate distortion

By adopting the joint optimization method of rate distortion-based quantization table and truncated position in JPEG compression, the problem of difficulty in improving encoding efficiency in the prior art is solved, and a more efficient image data compression effect is achieved.

CN119629357AActive Publication Date: 2025-03-14ANHUI UNIV

Patent Information

Application Number
CN202411772336.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-14
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

The prior art ignores the joint optimization of quantization table and truncation position in JPEG compression, which makes it difficult to improve coding efficiency and find the optimal quantization table and truncation position.

Method used

The joint optimization method of JPEG quantization table based on rate distortion and the truncated position is adopted. From the perspective of evolutionary calculation, the quantization table and the truncated position are combined with the JPEG compression method, and the estimation method for fitness evaluation is designed, and the optimal quantization table and truncated position are found through multi-objective optimization.

Benefits of technology

It effectively improves the efficiency of JPEG encoding, reduces redundant information, improves the compression effect of image data, and can more effectively meet the image encoding requirements at multi-code rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629357A_ABST
    Figure CN119629357A_ABST
Patent Text Reader

Abstract

The invention discloses a joint optimization method for a joint photographic experts group (JPEG) quantization table and a truncation position based on rate distortion, relates to the technical field of JPEG coding optimization, and solves the technical problems that in a JPEG compression scheme, improvement of coding efficiency caused by joint optimization by using the quantization table and the truncation position is neglected, and the optimal quantization table and the optimal truncation position are difficult to find. According to the method, joint optimization is carried out on a quantization table and a truncation position of the JPEG by combining a JPEG compression method from the perspective of evolutionary computation, a strategy that the truncation position is fixed when the quantization table is optimized, a strategy that the quantization table is unchanged when the truncation position is optimized, an estimation method for designing fitness evaluation and a method based on rate-distortion optimization are respectively carried out, and the quantization table and the truncation position are optimized. The optimal quantization table and the truncation position can be effectively found, and the corresponding truncation position is optimized while multiple groups of quantization tables are generated in the optimization process; through joint optimization of the quantization table and the truncation position, image data can be compressed more effectively, redundant information is reduced, and therefore coding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of JPEG coding optimization, and in particular is a rate-distortion-based JPEG quantization table and truncation position joint optimization method. Background Art

[0002] The JPEG standard provides an effective image compression method, which enables high-resolution image files to be compressed to a smaller size for easy storage and transmission. It plays an important role in multimedia applications such as web pages, video conferencing, and streaming media. JPEG technology plays an important role in the field of image storage and transmission with its efficient compression performance, wide applicability and flexibility.

[0003] At present, in JPEG compression, the solution and optimization of quantization tables have been widely studied and have always been a hot topic. With the explosive growth of digital images and video content, higher requirements are placed on the storage and transmission efficiency of image data. As a widely used image compression standard, one of the cores of JPEG is to compress images using DCT transform. After DCT transform, the energy of the image is mainly concentrated in the low-frequency part, that is, the upper left corner of the DCT coefficient. Therefore, using different quantization tables and different DCT coefficient truncation positions can obtain compressed images with different bit rates.

[0004] The prior art (invention patent application with publication number CN114095727B) discloses a JPEG image coding optimization method based on evolutionary computing, and its technical solution is: starting from the perspective of evolutionary computing, the JPEG quantization table is optimized, and in view of the multi-functional requirements of bit rate in image coding, a multi-functional image coding optimization technology based on multi-objective optimization is studied, while improving the coding efficiency, it meets the various bit rate requirements of users, and through multi-objective modeling of the image coding problem, the evolutionary operator that conforms to the rate-distortion optimal principle is designed, and the environment selection strategy can effectively find the optimal quantization table. In the JPEG compression scheme, the above scheme ignores the use of the quantization table and the truncation position for joint optimization to improve the coding efficiency, and it is difficult to find the optimal quantization table and truncation position, which is difficult to bring about the improvement of coding efficiency.

[0005] Therefore, the present invention provides a rate-distortion-based JPEG quantization table and a truncation position joint optimization method to solve the above problems. Summary of the invention

[0006] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a rate-distortion-based JPEG quantization table and truncation position joint optimization method, which is used to solve the technical problems that in the JPEG compression scheme, the use of the quantization table and the truncation position for joint optimization to improve the coding efficiency is neglected, and it is difficult to find the optimal quantization table and truncation position. The present invention combines the JPEG compression method from the perspective of evolutionary computing, jointly optimizes the JPEG quantization table and truncation position, and respectively optimizes the truncation position when the quantization table is fixed, and optimizes the truncation position when the quantization table is optimized. The estimation method of fitness evaluation is designed. The method based on rate-distortion optimization can effectively find the optimal quantization table and truncation position, and generates multiple groups of quantization tables during the optimization process while optimizing the corresponding truncation positions to solve the above problems.

[0007] To achieve the above object, a first aspect of the present invention provides a rate-distortion-based JPEG quantization table and truncation position joint optimization method, comprising:

[0008] Convert the image into YCbCr mode, process the three components Y, Cb and Cr independently, and obtain a discrete cosine block; perform partial coefficient truncation and quantization on the discrete cosine block, and perform encoding operations; where Y is the brightness component, Cb and Cr are the two chrominance components, and some coefficients include DCT coefficients;

[0009] In the process of DCT coefficient truncation and quantization, different truncation positions and different quantization tables are selected to obtain compressed images with different code streams. The optimal truncation position and quantization table are solved by using a multi-objective optimization method. The process includes:

[0010] Step 1: Initialize the default quantization table and the default truncation position combination as an individual, so as to optimize the MSE and bit rate of the default quantization table and the default truncation position;

[0011] Step 2: The truncation position is fixed and the quantization table update strategy based on rate-distortion optimization is adopted; the obtained bit rate and MSE are evaluated and the obtained bit rate and MSE are selected;

[0012] Step 3: The quantization table remains fixed, and the truncation position update strategy is based on rate-distortion optimization; the obtained bit rate and MSE are evaluated, and the obtained bit rate and MSE are selected.

[0013] Preferably, the encoding operation includes:

[0014] The discrete cosine block after quantization and truncation is subjected to Z-scan to obtain a one-dimensional symbol string, and the one-dimensional symbol string is run-length encoded to obtain the final binary code stream, thus completing the encoding process.

[0015] Preferably, the independent processing of the three components Y, Cb and Cr includes:

[0016] The image is divided into several 8x8 image blocks from left to right, and each image block is subjected to DCT transformation, DCT coefficient position truncation, quantization and encoding; wherein, the 8x8 graphic block is transformed into a discrete cosine block by DCT transformation, and then the discrete cosine block is quantized, and after quantization, a set position is selected in the block, and all quantization coefficients after the set position are set to zero, and information is selected by rounding by quantization division and truncating the coefficient to zero; the set position is obtained through experience.

[0017] Preferably, the initializing the default quantization table and the default truncation position combination as an individual comprises:

[0018] The size of the combination of the quantization table and the DCT coefficient cutoff position is recorded as pop, the maximum number of iterations is marked as maxgen, the initial number of iterations gen = 0, and the initial quantization table is set with the default quantization table and different values ​​are set by the quality factor QF to obtain different quantization tables;

[0019] The truncation position of the initial DCT coefficient is selected using a random function in the range of 2-64 to obtain different quantization tables and truncation positions; the optimization objectives of the problem are defined as MSE and bit rate, and the default quantization table and the truncation position of the DCT coefficient are used as decision variables, and the MSE and bit rate are optimized through the min function; the size of pop is the size of the quantization table plus the number of 8x8 image blocks into which the image is divided;

[0020] Among them, the code rate R u,v (Q) and ΔR i (Q,P j ) The first-order entropy of the quantization coefficient is estimated by using Formula 6 and Formula 7:

[0021]

[0022] Among them, Num blk Represents the number of 8x8 image blocks in the original image, S i represents the coefficient value distribution range of quantization index i, S i =[i*Q(u,v)-Q(u,v) / 2,i*Q(u,v)+Q(u,v) / 2], Num F(u,v) is the number of values ​​F(u,v) in the frequency band (u,v);

[0023]

[0024] Among them, ΔR i (Q,P j) represents the bit rate saved when the truncation position of the i-th 8x8 block is j, represents the DCT coefficient F at position j in the block j The number of

[0025] Preferably, the step of acquiring the MSE and the bit rate includes:

[0026] Quantize the image. The quantization process of the image is:

[0027]

[0028] Wherein, (u, v) is the frequency band coordinate, F(u, v) is the discrete cosine coefficient value at the frequency band (u, v), Q(u, v) and a(u, v) are the quantization step size and the quantized index i under the frequency band respectively, and the quantization process is shown in Formula 3;

[0029] The reconstruction process of inverse quantization is:

[0030]

[0031] The corresponding quantization error is estimated by Equation 3 and Equation 4:

[0032]

[0033] Preferably, the quantization table update strategy based on rate-distortion optimization and the truncation position update strategy based on rate-distortion optimization include:

[0034] The rate-distortion metric is obtained, and the updates of the quantization table and the truncation position evolve along the direction of the greatest rate-distortion performance improvement according to the rate-distortion metric: first, a random number k is generated. If k is less than 0.2, the individual performs a crossover operation; if k is greater than 0.2, the individual performs a mutation operation, and the crossover mutation generates a new quantization table and truncation position of size pop, which becomes a sub-population. The sub-population is merged with the parent population to obtain a new population.

[0035] Preferably, the rate-distortion metric criterion includes:

[0036]

[0037] Where, ΔD(Q)| Q(u,v)→Q'(u,v) and ΔR(Q)| Q(u,v)→Q'(u,v) They represent the changes of MSE and bit rate when the quantization step size of the band position in the quantization table changes, ΔD(Q,P)| P→P' and ΔR(Q,P)| P→P' They respectively represent the MSE and bit rate changes caused by the change of the truncation position.

[0038] Preferably, the evaluating the obtained bit rate and MSE includes:

[0039] Based on Formula 4 and Formula 7, the MSE and bit rate of the new population are calculated. The bit rate and MSE can be used to determine the image quality obtained by the current optimization parameters. Among them, the bit rate and MSE are two contradictory evaluation indicators, that is, the smaller the bit rate, the better, and the smaller the MSE, the better.

[0040] Preferably, the selecting and solving the obtained bit rate and MSE includes:

[0041] The obtained code rate and MSE are sorted according to the non-dominated sorting method to obtain a sorted solution with multiple frontier surfaces, and the number of individuals num on the first frontier surface is counted to determine whether the number of individuals num is less than 50; if yes, the individuals on the first frontier surface are directly transferred to the next generation; if not, an environmental selection is performed to randomly select an existing solution to perform a scaling method of adding and subtracting one to the truncated position value to obtain a new solution.

[0042] It should be noted that the purpose of performing environment selection and randomly selecting existing solutions to perform scaling methods of adding and subtracting 1 to truncation position values ​​to obtain new solutions is to enrich the diversity and uniformity of the solution space.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] 1. The present invention combines the JPEG compression method from the perspective of evolutionary computing to jointly optimize the quantization table and truncation position of JPEG. The optimization of the quantization table is aimed at the demand for optimal MSE under multiple code rates in image coding. The optimization of the truncation position can further optimize the coding effect of image coding on the basis of the optimized quantization table. A multi-objective optimization problem is established by jointly optimizing the quantization table and the truncation position, and a population composed of the quantization table and the truncation position is initialized. The strategies of fixing the truncation position when optimizing the quantization table and keeping the quantization table unchanged when optimizing the truncation position are respectively performed. An estimation method for fitness evaluation is designed. The method based on rate-distortion optimization can effectively find the optimal quantization table and truncation position. During the optimization process, multiple groups of quantization tables are generated while optimizing the corresponding truncation positions, which can more effectively compress image data, reduce redundant information, and improve coding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1Optimized process framework diagram for the present invention;

[0047] Figure 2 It is a schematic diagram of the operation steps of the present invention. DETAILED DESCRIPTION

[0048] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] See also Figure 1-Figure 2 The first aspect of the present invention provides a method for jointly optimizing a JPEG quantization table and a truncation position based on rate distortion, comprising:

[0050] The image is converted into YCbCr mode, and the three components Y, Cb and Cr are processed independently to obtain a discrete cosine block; the discrete cosine block is partially truncated and quantized, and then encoded; wherein Y is the brightness component, Cb and Cr are two chrominance components, and some coefficients include DCT coefficients; in the process of DCT coefficient truncation and quantization, different truncation positions and different quantization tables are selected to obtain compressed images with different bit streams, and the optimal truncation position and quantization table are solved by using a multi-objective optimization method, and the process includes:

[0051] Step 1: Initialize the default quantization table and the default truncation position combination as an individual, so as to optimize the MSE and bit rate of the default quantization table and the default truncation position;

[0052] Step 2: The truncation position is fixed and the quantization table update strategy based on rate-distortion optimization is adopted; the obtained bit rate and MSE are evaluated and the obtained bit rate and MSE are selected;

[0053] Step 3: The quantization table remains fixed, and the truncation position update strategy is based on rate-distortion optimization; the obtained bit rate and MSE are evaluated, and the obtained bit rate and MSE are selected.

[0054] It should be noted that the discrete cosine transform is an orthogonal regularization transform, so the error energy in the spatial domain and the error energy in the frequency domain remain unchanged, and the energy error in the frequency domain is used to calculate the quantization error in the spatial domain; since the discrete cosine block contains 64 frequency bands and the entire image contains several 8x8 image blocks, the MSE and bit rate of the compressed image can be accumulated by the MSE and bit rate of each frequency band.

[0055] It should be noted that JPEG image coding optimization methods are mainly divided into the following categories:

[0056] The first category: quantization table optimization based on rate-distortion optimization. Image compression can be viewed as a resource allocation problem, which is expressed as how to obtain the minimum distortion within the bit rate constraint, and uses strategies to explore the best quantization table based on the bit rate and distortion model. The problem of solving the 64 quantization steps in the quantization table can also be transformed into a 64-stage dynamic programming problem and solved using the dynamic programming method.

[0057] The second category: quantization table optimization based on human visual characteristics. The design of the JPEG default quantization table is based on the principle that the human eye is more sensitive to low-frequency signals than high-frequency signals. However, the specific sensitivity only depends on empirical values. As people's understanding of the visual system becomes more in-depth, some new visual models are used in the design of quantization tables. It is proposed to design a new subjective quantization table based on a uniform quantizer and the visual characteristics of the human eye, which achieves better subjective quality. It also proposes a structural similarity index as a distortion criterion to generate a global quantization table, and designs a JND model as a quality measurement standard.

[0058] The third category: quantization table optimization based on heuristic algorithms. Whether it is a search strategy or a dynamic programming method, it is difficult to ensure that the quantization table can reach the global optimal solution. To solve this problem, some heuristic algorithms are used in the optimization process of JPEG quantization tables, including genetic algorithms, differential evolution algorithms, etc. These methods usually convert bit rate and distortion into a single goal, which is highly complex and has poor flexibility.

[0059] In this application, the three components Y, Cb and Cr are processed independently, including:

[0060] The image is divided into several 8x8 image blocks from left to right, and each image block is subjected to DCT transformation, DCT coefficient position truncation, quantization and encoding; wherein, the 8x8 graphic block is transformed into a discrete cosine block by DCT transformation, and then the discrete cosine block is quantized, and after quantization, a set position is selected in the block, and all quantization coefficients after the set position are set to zero, and information is selected by rounding by quantization division and truncating the coefficient to zero; the set position is obtained through experience.

[0061] It should be noted that the standard JPEG encoder workflow includes the following specific steps:

[0062] A1: Convert the original image into the YCbCr color space. In the YCbCr color space, Y represents the brightness component, Cr and Cb represent the chrominance component and the saturation component respectively. The three components are processed separately.

[0063] A2: Taking the Y channel as an example, it is divided into 8x8 image blocks from left to right and from top to bottom, and then each block is subjected to DCT transformation, DCT coefficient position truncation, quantization and encoding; the 8x8 image block is subjected to DCT transformation to obtain a discrete cosine block, and then the discrete cosine block is quantized. After quantization, a suitable position in the block is selected, and all quantization coefficients after this position are set to zero to obtain quantized and truncated data, and the quantized data is read out in a zigzag shape. The read data is divided into a DC coefficient DC and an AC coefficient AC. The DC coefficient DC is encoded using differential pulse modulation encoding DPCM, and the AC coefficient AC is encoded using run length encoding RLE;

[0064] A3: Perform entropy coding on the intermediate formats of the DC coefficient and AC coefficient, and finally obtain a binary data stream, thereby completing the JPEG image encoding process.

[0065] In this application, the default quantization table and the default truncation position combination are initialized as an individual, including:

[0066] The size of the combination of the quantization table and the DCT coefficient cutoff position is recorded as pop, the maximum number of iterations is marked as maxgen, the initial number of iterations gen = 0, and the initial quantization table is set with the default quantization table and different values ​​are set by the quality factor QF to obtain different quantization tables;

[0067] The truncation position of the initial DCT coefficient is selected using a random function in the range of 2-64 to obtain different quantization tables and truncation positions; the optimization objectives of the problem are defined as MSE and bit rate, and the default quantization table and the truncation position of the DCT coefficient are used as decision variables, and the MSE and bit rate are optimized through the min function; the size of pop is the size of the quantization table plus the number of 8x8 image blocks into which the image is divided;

[0068] Among them, the code rate R u,v (Q) and ΔR i (Q,P j ) The first-order entropy of the quantization coefficient is estimated by using Formula 6 and Formula 7:

[0069]

[0070] Among them, Num blk Represents the number of 8x8 image blocks in the original image, S i represents the coefficient value distribution range of quantization index i, S i =[i*Q(u,v)-Q(u,v) / 2,i*Q(u,v)+Q(u,v) / 2], Num F(u,v) is the number of values ​​F(u,v) in the frequency band (u,v);

[0071]

[0072] Among them, ΔR i (Q,P j ) represents the bit rate saved when the truncation position of the i-th 8x8 block is j, represents the DCT coefficient F at position j in the block j The number of

[0073] It should be noted that, in the process of quantization and DCT coefficient truncation, compressed images with different bit rates can be obtained by using different quantization tables and different DCT coefficient truncation positions. The method of optimizing the quantization table and coefficient truncation position by using a multi-objective optimization method includes the following process:

[0074] S1: Initialize the default quantization table and DCT coefficient truncation position:

[0075] The size of the combination of the quantization table and the DCT coefficient truncation position is recorded as pop, the maximum number of iterations is recorded as maxgen, the initial number of iterations gen=0, the initial quantization table is set with the default quantization table by setting different values ​​through the quality factor QF to obtain different quantization tables; the truncation position of the initial DCT coefficient uses a random function to select a value in the range of 2-64, and the size of the scale pop is the size of the quantization table plus the number of 8x8 image blocks into which the image is divided; the default quantization table is:

[0076]

[0077] The optimization objectives are defined as MSE and bit rate. The default quantization table and DCT coefficient are used as decision variables. Then, the MSE and bit rate are optimized through the function. The specific process is as follows:

[0078]

[0079] Among them, Q is the default quantization table, P is the default truncation position, D(Q,P) and R(Q,P) are the MSE and bit rate when the default quantization table and DCT coefficient truncation position are Q and P respectively.

[0080] S2: In the specific implementation process, in order to avoid complex encoding and decoding processes, the MSE and bit rate are obtained by estimation. The specific process includes:

[0081] S21: quantize the image. The image quantization process is as follows:

[0082]

[0083] Among them, (u, v) is the frequency band coordinate, F(u, v) is the discrete cosine coefficient value at the frequency band (u, v), Q(u, v) and a(u, v) are the quantization step size and quantized index i under the frequency band respectively. The quantization process is shown in Formula 3, and the inverse quantization reconstruction process is:

[0084]

[0085] The corresponding quantization error can be estimated by formula 3 and formula 4:

[0086]

[0087] S22: Bit rate R u,v (Q) The first-order entropy of the quantization coefficient is estimated by the formula:

[0088]

[0089] Among them, Num blk Represents the number of 8x8 image blocks in the original image, S i represents the coefficient value distribution range of quantization index i, S i =[i*Q(u,v)-Q(u,v) / 2,i*Q(u,v)+Q(u,v) / 2], Num F(u,v) is the number of values ​​F(u,v) in the frequency band (u,v);

[0090] S23: Further, based on the optimization of the quantization table, the optimization of the truncation position is introduced. When the truncation position is optimized, the estimates of the two target bit rates and distortion before and after the truncation are changed. The truncated DCT coefficients will cause the estimates of the two target bit rates and distortion before and after the truncation to be changed. When the truncation position of each 8x8 block is different, the estimated bit rate savings brought by each block of each image are:

[0091]

[0092] Among them, ΔR i (Q,P j ) represents the bit rate saved when the truncation position of the i-th 8x8 block is j, represents the DCT coefficient F at position j in the block j the number of

[0093] S24: In the specific implementation process, since the discrete cosine transform is an orthogonal regularization transform, the error energy in the spatial domain remains unchanged with the error energy in the frequency domain. We can directly use the energy error in the frequency domain to calculate the quantization error in the spatial domain. Since the discrete cosine block contains 64 frequency bands and the entire image contains several 8x8 image blocks, the MSE and bit rate of the compressed image can be accumulated by the MSE and bit rate of each frequency band, that is:

[0094]

[0095] Among them, D u,v (Q) and ΔD i (Q,P j ) can be solved by the method defined in Formula 4, and the code rate R u,v (Q) can be estimated by Equation 6, ΔR i (Q,P j ) can be estimated by formula 7;

[0096] S25: Obtain the frequency band with the greatest rate-distortion performance improvement: Define a slope to measure the gradient of change in a specific frequency band, as shown in Formula 9:

[0097]

[0098] Where, ΔD(Q)| Q(u,v)→Q'(u,v) and ΔR(Q)| Q(u,v)→Q'(u,v) They represent the changes of MSE and bit rate when the quantization step size of the band position in the quantization table changes, ΔD(Q,P)| P→P' and ΔR(Q,P)| P→P' They respectively represent the changes in MSE and bit rate caused by changes in the truncation position;

[0099] S26: When the DCT coefficient cutoff position is fixed, after the rate-distortion metric is obtained, the update of the quantization table evolves in the direction of the maximum rate-distortion performance improvement: first, a random number k is generated. If k is less than 0.2, the individual performs a crossover operation. Specifically, there are two quantization table parts Q1 and Q2 in the individual. Taking Q1 as an example, the rate-distortion metric for updating from Q1 to Q2 is calculated for each of the 64 quantization parts, and then they are sorted to find the largest positions, and the corresponding quantization step size in Q1 is updated to the value at the corresponding position in Q2; Q2 is also crossovered in the same way;

[0100] When the optimized quantization table is fixed, in the cross-mutation process, for the two individual DCT coefficient truncation positions P1 and P2, taking P1 as an example, for all 8x8 image block truncation positions, the rate-distortion metric criteria for updating the truncation position from P1 to P2 are calculated respectively, and then they are sorted to find the largest positions, and the corresponding truncation positions in P1 are updated to the values ​​at the corresponding positions in Q2; P2 is also cross-mutated in the same way;

[0101] S27: If k is greater than 0.2, the individual will perform mutation operation. When the DCT coefficient cutoff position is fixed, for individual Q1, the possible updated values ​​of all quantization step sizes are all values ​​except itself. According to the rate-distortion metric criterion, 254 values ​​are calculated, and then these 254 values ​​are sorted to find the largest positions and update them to the corresponding target quantization step values.

[0102] When the optimized quantization table is fixed, for individual P1, the possible changeable values ​​of all truncation positions are all values ​​except itself. According to the rate-distortion metric, 62 values ​​are calculated, and then these 62 values ​​are sorted to find the largest positions and update them to the corresponding truncation positions.

[0103] S28: Crossover mutation produces new individuals with equal quantization tables and truncation positions, called sub-populations. The sub-populations and parent populations are merged to obtain a new population.

[0104] S3: Fitness evaluation:

[0105] According to Formula 4, Formula 6 and Formula 7 in the initialization step, the MSE and bit rate of the new population can be calculated. The bit rate and MSE can be used to determine the image quality obtained by the current optimization parameters. The bit rate and MSE are two contradictory evaluation indicators, that is, the smaller the bit rate, the better, and the smaller the MSE, the better.

[0106] S4: Environment selection:

[0107] The fitness values ​​obtained by the non-dominated sorting method are sorted to obtain a sorted quantization table with multiple frontier surfaces. The number of individuals num on the first frontier surface is counted. If num is less than 50, the individuals on the first frontier surface are directly promoted to the next generation, otherwise environmental selection is performed. In order to enrich the diversity and uniformity of the solution space, the existing solutions are randomly selected and the scaling method of adding and subtracting one to the truncated position value is performed to obtain a new solution.

[0108] S41: Take all individuals in the new solution as the gen+1th iteration, and repeat steps S2, S3, and S4 until the maximum number of iterations is reached;

[0109] S42: Select all individuals in the first frontier surface from the solution obtained in the last iteration, that is, the optimized quantization table and the corresponding truncation position of the DCT coefficient.

[0110] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.

[0111] Working principle of the present invention:

[0112] The image is converted into YCbCr mode, and the three components Y, Cb and Cr are processed independently to obtain a discrete cosine block; some coefficients of the discrete cosine block are truncated and quantized, and the quantized and truncated discrete cosine block is subjected to Z-type scanning to obtain a one-dimensional symbol string, and the one-dimensional symbol string is run-length encoded to obtain the final binary code stream, completing the encoding process;

[0113] In the process of DCT coefficient truncation and quantization, different truncation positions and different quantization tables are selected to obtain compressed images with different code streams. The optimal truncation position and quantization table are solved by using a multi-objective optimization method. The process includes:

[0114] Initializing the default quantization table and the default truncation position combination as an individual, thereby optimizing the MSE and the bit rate of the default quantization table and the default truncation position;

[0115] The truncation position is fixed and the quantization table update strategy is based on rate-distortion optimization; the obtained bit rate and MSE are evaluated and the obtained bit rate and MSE are selected;

[0116] The quantization table is fixed and the truncation position update strategy is based on rate-distortion optimization; the obtained bit rate and MSE are evaluated and selected.

[0117] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A rate-distortion-based JPEG quantization table and truncation position joint optimization method, characterized by: Convert the image into YCbCr mode, process the three components Y, Cb and Cr independently, and obtain a discrete cosine block; perform partial coefficient truncation and quantization on the discrete cosine block, and perform encoding operations; where Y is the brightness component, Cb and Cr are the two chrominance components, and some coefficients include DCT coefficients; In the process of DCT coefficient truncation and quantization, different truncation positions and different quantization tables are selected to obtain compressed images with different code streams. The optimal truncation position and quantization table are solved by using a multi-objective optimization method. The process includes: Step 1: Initialize the default quantization table and the default truncation position combination as an individual, so as to optimize the MSE and bit rate of the default quantization table and the default truncation position; Step 2: The truncation position is fixed and the quantization table update strategy based on rate-distortion optimization is adopted; the obtained bit rate and MSE are evaluated and the obtained bit rate and MSE are selected; Step 3: The quantization table remains fixed, and the truncation position update strategy is based on rate-distortion optimization; the obtained bit rate and MSE are evaluated, and the obtained bit rate and MSE are selected.

2. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 1, characterized in that: The encoding operation comprises: The discrete cosine block after quantization and truncation is subjected to Z-scan to obtain a one-dimensional symbol string, and the one-dimensional symbol string is run-length encoded to obtain the final binary code stream, thus completing the encoding process.

3. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 1, characterized in that: The three components Y, Cb and Cr are processed independently, including: The image is divided into several 8x8 image blocks from left to right, and each image block is subjected to DCT transformation, DCT coefficient position truncation, quantization and encoding; wherein, the 8x8 graphic block is transformed into a discrete cosine block by DCT transformation, and then the discrete cosine block is quantized. After quantization, a set position is selected within the block, and all quantization coefficients after the set position are set to zero. Information selection is performed by rounding the quantization division and truncating the coefficients to zero.

4. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 1, characterized in that: The initializing the default quantization table and the default truncation position combination as an individual includes: The size of the combination of the quantization table and the DCT coefficient cutoff position is recorded as pop, the maximum number of iterations is marked as maxgen, the initial number of iterations gen = 0, and the initial quantization table is set with the default quantization table and different values ​​are set by the quality factor QF to obtain different quantization tables; The truncation position of the initial DCT coefficient is selected using a random function in the range of 2-64 to obtain different quantization tables and truncation positions; the optimization objectives of the problem are defined as MSE and bit rate, and the default quantization table and the truncation position of the DCT coefficient are used as decision variables, and the MSE and bit rate are optimized through the min function; the size of pop is the size of the quantization table plus the number of 8x8 image blocks into which the image is divided; Among them, the code rate R u,v (Q) and ΔR i (Q,P j ) The first-order entropy of the quantization coefficient is estimated by using Formula 6 and Formula 7: Among them, Num blk Represents the number of 8x8 image blocks in the original image, S i represents the coefficient value distribution range of quantization index i, S i =[i*Q(u,v)-Q(u,v) / 2,i*Q(u,v)+Q(u,v) / 2], Num F(u,v) is the number of values ​​F(u,v) in the frequency band (u,v); Among them, ΔR i (Q,P j ) represents the bit rate saved when the truncation position of the i-th 8x8 block is j, represents the DCT coefficient F at position j in the block j The number of 5. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 1, characterized in that: The steps of obtaining the MSE and the bit rate include: Quantize the image. The quantization process of the image is: Wherein, (u, v) is the frequency band coordinate, F(u, v) is the discrete cosine coefficient value at the frequency band (u, v), Q(u, v) and a(u, v) are the quantization step size and the quantized index i under the frequency band respectively, and the quantization process is shown in Formula 3; The reconstruction process of inverse quantization is: The corresponding quantization error is estimated by Equation 3 and Equation 4:

6. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 1, characterized in that: The quantization table update strategy based on rate-distortion optimization and the truncation position update strategy based on rate-distortion optimization include: The rate-distortion metric is obtained, and the updates of the quantization table and the truncation position evolve along the direction of the greatest rate-distortion performance improvement according to the rate-distortion metric: first, a random number k is generated. If k is less than 0.2, the individual performs a crossover operation; if k is greater than 0.2, the individual performs a mutation operation, and the crossover mutation generates a new quantization table and truncation position of size pop, which becomes a sub-population. The sub-population is merged with the parent population to obtain a new population.

7. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 6, characterized in that: The obtained rate-distortion metric criterion includes: Where, ΔD(Q)| Q(u,v)→Q'(u,v) and ΔR(Q)| Q(u,v)→Q'(u,v) They represent the changes of MSE and bit rate when the quantization step size of the frequency band position in the quantization table changes, ΔD(Q,P)| P→P' and ΔR(Q,P)| P→P' They respectively represent the MSE and bit rate changes caused by the change of the truncation position.

8. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 1, characterized in that: The evaluating of the obtained bit rate and MSE includes: Based on Formula 4 and Formula 7, the MSE and bit rate of the new population are calculated. The bit rate and MSE can be used to determine the image quality obtained by the current optimization parameters. Among them, the bit rate and MSE are two contradictory evaluation indicators, that is, the smaller the bit rate, the better, and the smaller the MSE, the better.

9. The rate-distortion-based JPEG quantization table and truncation position joint optimization method according to claim 1, characterized in that: The selecting and solving the obtained bit rate and MSE includes: The obtained code rate and MSE are sorted according to the non-dominated sorting method to obtain a sorted solution with multiple frontier surfaces, and the number of individuals num on the first frontier surface is counted to determine whether the number of individuals num is less than 50; if yes, the individuals on the first frontier surface are directly transferred to the next generation; if not, an environmental selection is performed to randomly select an existing solution to perform a scaling method of adding and subtracting one to the truncated position value to obtain a new solution.

Citation Information

Patent Citations

  • An JPEG image coding optimization method based on evolutionary computation

    CN114095727B

  • Compressive sampling-based (CS-based) video coding / decoding system and method thereof

    CN102572435A

  • JPEG image coding optimization method based on evolutionary computation

    CN114095727A

  • System and method of fast MPEG-4 / AVC quantization

    US20080232465A1

Cited By

  • Optimization method based on JPEG (Joint Photographic Experts Group) image compression standard and image quality evaluation method

    CN120769045A