Image Encoding Method, Apparatus, Electronic Device, and Storage Medium
By combining the deep learning model to identify the encoding transformation coefficients and the position information of the coefficient groups during the image encoding process, importance recognition and correction of encoding performance indicators are solved, and a more efficient image encoding effect is achieved.
Patent Information
- Application Number
- CN202310127517.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-02
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2043-02-02
AI Technical Summary
In the prior art, image encoding performance refers to low standard accuracy, resulting in degradation of encoding performance, mainly due to calculation errors caused by inequality of frequency domain and pixel domain losses.
By combining the first position information of each initial encoding transformation coefficient corresponding to the image in the coded transformation coefficient group, a first important indicator is obtained, and combining the second position information of the coded transformation coefficient group in the transformation unit to identify the coefficient group importance, a second important indicator is obtained, and the initial encoding performance indicators are corrected based on these indicators, the correct encoding performance indicators are determined, and the image encoding process is finally carried out.
It effectively improves the accuracy of coding performance indicators, reduces the computational complexity, and improves the efficiency and performance of the image encoding process.
Smart Images

Figure CN116233448B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image encoding method, device, electronic device, and storage medium. Background Art
[0002] Currently, hybrid coding frameworks are often used in the encoding of multimedia data such as video and images. These frameworks typically include modules such as block partitioning, transformation, and quantization. Quantized transform coefficients typically account for 50%-70% of the bitstream. Therefore, efficiently obtaining these quantized transform coefficients for encoding can help improve compression performance.
[0003] In related technologies, multiple rounds of fine-tuning are typically performed on the coding transform coefficients in each coefficient group after quantization. The optimal fine-tuned coding transform coefficients are then selected as the final coefficients for encoding, based on the coding performance indicators (e.g., rate-distortion data) corresponding to each round of fine-tuning. However, in order to reduce computational complexity, the coding performance indicator calculation process in related technologies directly estimates the image loss in the pixel domain by combining the loss of the coding transform coefficients in the frequency domain. Since the loss of the coding transform coefficients in the frequency domain is not equivalent to the loss in the pixel domain, the calculated coding performance indicator is less accurate, which in turn leads to problems such as reduced image coding performance. Summary of the Invention
[0004] The present disclosure provides an image coding method, apparatus, electronic device, and storage medium to at least address technical issues in related technologies such as low accuracy of coding performance indicators and decreased image coding performance. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an image encoding method, including:
[0006] Obtaining at least one coded transform coefficient group for each transform unit in at least one transform unit corresponding to the target image, each coded transform coefficient group including at least one initial coded transform coefficient;
[0007] performing coefficient importance identification based on first position information of each initial coding transform coefficient in the coding transform coefficient group to which it belongs, to obtain a first importance index corresponding to each initial coding transform coefficient; the first importance index representing a degree of visual impact of each initial coding transform coefficient on the target image;
[0008] performing coefficient group importance identification based on second position information of each coded transform coefficient group in the transform unit to which it belongs, to obtain a second importance index corresponding to each coded transform coefficient group; the second importance index represents a degree of visual impact of each coded transform coefficient group on the target image;
[0009] In the process of adjusting the coefficients of each initial encoded transform coefficient, based on the first important index and the second important index, the initial encoding performance index corresponding to the current encoded transform coefficient is corrected to obtain the corrected encoding performance index corresponding to the current encoded transform coefficient, where the current encoded transform coefficient is any adjusted coefficient of each initial encoded transform coefficient in the coefficient adjustment process;
[0010] When the adjustment of each initial encoded transform coefficient ends, the current encoded transform coefficient corresponding to the corrected encoding performance index that meets the preset conditions in the coefficient adjustment process is used as the target encoded transform coefficient corresponding to each initial encoded transform coefficient;
[0011] Based on the target encoded transform coefficient, image encoding processing is performed to obtain the encoded image of the target image.
[0012] In an optional embodiment, the initial encoding performance index is determined based on the coefficient distortion data corresponding to the current encoded transform coefficient and the amount of information corresponding to the current encoded transform coefficient; in the process of adjusting the coefficients of each initial encoded transform coefficient, based on the first important index and the second important index, the initial encoding performance index corresponding to each initial encoded transform coefficient is corrected, and the steps for obtaining the corrected encoding performance index include:
[0013] Adjust each initial encoded transform coefficient to obtain the current encoded transform coefficient corresponding to each initial encoded transform coefficient;
[0014] Determine the coefficient distortion data and the amount of information corresponding to the current encoded transform coefficient;
[0015] Based on the first important index corresponding to the current encoded transform coefficient, the second important index corresponding to the encoding transform coefficient group to which the current encoded transform coefficient belongs, the coefficient distortion data, and the amount of information, determine the corrected encoding performance index corresponding to the current encoded transform coefficient;
[0016] Adjust the current encoded transform coefficient, and based on the adjusted current encoded transform coefficient, repeat the steps of determining the coefficient distortion data and the amount of information corresponding to the current encoded transform coefficient until the step of adjusting the current encoded transform coefficient until the preset convergence condition is met.
[0017] In an optional embodiment, determining the corrected coding performance metric corresponding to the current coded transform coefficient based on the first important metric corresponding to the current coded transform coefficient, the second important metric corresponding to the coded transform coefficient group to which the current coded transform coefficient belongs, the coefficient distortion data, and the amount of information includes:
[0018] Correct the amount of information according to the first important metric corresponding to the current coded transform coefficient and the second important metric corresponding to the coded transform coefficient group to which the current coded transform coefficient belongs, to obtain a corrected amount of information;
[0019] Generate the corrected coding performance metric corresponding to the current coded transform coefficient according to the coefficient distortion data and the corrected amount of information.
[0020] In an optional embodiment, determining the corrected coding performance metric corresponding to the current coded transform coefficient based on the first important metric corresponding to the current coded transform coefficient, the second important metric corresponding to the coded transform coefficient group to which the current coded transform coefficient belongs, the coefficient distortion data, and the amount of information includes:
[0021] Correct the coefficient distortion data according to the first important metric corresponding to the current coded transform coefficient and the second important metric corresponding to the coded transform coefficient group to which the current coded transform coefficient belongs, to obtain corrected coefficient distortion data;
[0022] Generate the corrected coding performance metric corresponding to the current coded transform coefficient according to the corrected coefficient distortion data and the amount of information.
[0023] In an optional embodiment, performing coefficient importance identification according to the first position information of each initial coded transform coefficient in the coded transform coefficient group to which it belongs, to obtain the first important metric corresponding to each initial coded transform coefficient includes:
[0024] Input the first position information into a first target identification model for coefficient importance identification, to obtain the first important metric;
[0025] Wherein, the first target identification model is a deep learning model for performing coefficient importance identification.
[0026] In an optional embodiment, the method further includes:
[0027] Obtain the target image;
[0028] Input the target image into an image type identification model for image type identification, to obtain the target image type corresponding to the target image;
[0029] According to the target image type, match the first target recognition model from multiple first preset recognition models;
[0030] Among them, the multiple first preset recognition models are deep learning models corresponding to various preset image types and used for coefficient importance recognition.
[0031] In an optional embodiment, the coefficient group importance recognition based on the second position information of each coding transform coefficient group in the corresponding transform unit, and obtaining the second importance index corresponding to each coding transform coefficient group includes:
[0032] Input the second position information into the second target recognition model for coefficient group importance recognition to obtain the second importance index;
[0033] Among them, the second target recognition model is a deep learning model used for coefficient group importance recognition.
[0034] In an optional embodiment, the method further includes:
[0035] Obtain the target image;
[0036] Input the target image into an image type recognition model for image type recognition to obtain the target image type corresponding to the target image;
[0037] According to the target image type, match the second target recognition model from multiple second preset recognition models;
[0038] Among them, the multiple second preset recognition models are deep learning models corresponding to various preset image types and used for coefficient group importance recognition.
[0039] According to the second aspect of the embodiments of the present disclosure, there is provided an image encoding apparatus, including:
[0040] A coding transform coefficient group acquisition module, configured to execute acquiring at least one coding transform coefficient group of each transform unit in at least one transform unit corresponding to a target image, and each coding transform coefficient group includes at least one initial coding transform coefficient;
[0041] A coefficient importance recognition module, configured to execute coefficient importance recognition according to the first position information of each initial coding transform coefficient in the corresponding coding transform coefficient group, and obtain the first importance index corresponding to each initial coding transform coefficient; the first importance index characterizes the visual influence degree of each initial coding transform coefficient on the target image;
[0042] The coefficient group importance recognition module is configured to perform coefficient group importance recognition according to the second position information of each coded transform coefficient group in the corresponding transform unit, so as to obtain a second importance index corresponding to each coded transform coefficient group; the second importance index characterizes the degree of visual impact of each coded transform coefficient group on the target image;
[0043] The coding performance index correction module is configured to perform correction on the initial coding performance index corresponding to the current coded transform coefficient based on the first importance index and the second importance index during the process of adjusting the coefficients of each initial coded transform coefficient, so as to obtain a corrected coding performance index corresponding to the current coded transform coefficient, where the current coded transform coefficient is any adjusted coefficient of each initial coded transform coefficient during the coefficient adjustment process;
[0044] The target coded transform coefficient determination module is configured to perform, when the adjustment of each initial coded transform coefficient ends, taking the current coded transform coefficient corresponding to the corrected coding performance index that meets the preset conditions during the coefficient adjustment process as the target coded transform coefficient corresponding to each initial coded transform coefficient;
[0045] The image coding processing module is configured to perform image coding processing based on the target coded transform coefficient to obtain a coded image of the target image.
[0046] In an optional embodiment, the initial coding performance index is determined based on the coefficient distortion data corresponding to the current coded transform coefficient and the information amount corresponding to the current coded transform coefficient; the coding performance index correction module includes:
[0047] The coefficient adjustment unit is configured to perform adjustment on each initial coded transform coefficient to obtain the current coded transform coefficient corresponding to each initial coded transform coefficient;
[0048] The data determination unit is configured to perform determination of the coefficient distortion data and the information amount corresponding to the current coded transform coefficient;
[0049] The corrected coding performance index determination unit is configured to perform determination of the corrected coding performance index corresponding to the current coded transform coefficient based on the first importance index corresponding to the current coded transform coefficient, the second importance index corresponding to the coded transform coefficient group to which the current coded transform coefficient belongs, the coefficient distortion data, and the information amount;
[0050] The current coded transform coefficient adjustment unit is configured to perform adjustment on the current coded transform coefficient;
[0051] An iterative processing unit, configured to perform repeating the step of determining the coefficient distortion data and the amount of information corresponding to the current coding transform coefficient based on the adjusted current coding transform coefficient, to the step of adjusting the current coding transform coefficient until a preset convergence condition is satisfied.
[0052] In an optional embodiment, the corrected coding performance metric determination unit includes:
[0053] An information amount correction unit, configured to perform correcting the information amount according to the first important metric corresponding to the current coding transform coefficient and the second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, to obtain a corrected information amount;
[0054] A first corrected coding performance metric generation unit, configured to perform generating the corrected coding performance metric corresponding to the current coding transform coefficient according to the coefficient distortion data and the corrected information amount.
[0055] In an optional embodiment, the corrected coding performance metric determination unit includes:
[0056] A coefficient distortion data correction unit, configured to perform correcting the coefficient distortion data according to the first important metric corresponding to the current coding transform coefficient and the second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, to obtain a corrected coefficient distortion data;
[0057] A second corrected coding performance metric generation unit, configured to perform generating the corrected coding performance metric corresponding to the current coding transform coefficient according to the corrected coefficient distortion data and the information amount.
[0058] In an optional embodiment, the coefficient importance identification module is specifically configured to perform inputting the first position information into a first target identification model for coefficient importance identification, to obtain the first important metric;
[0059] Wherein, the first target identification model is a deep learning model for coefficient importance identification.
[0060] In an optional embodiment, the apparatus further includes:
[0061] A first image acquisition module, configured to perform acquiring the target image;
[0062] A first image type identification module, configured to perform inputting the target image into an image type identification model for image type identification, to obtain a target image type corresponding to the target image;
[0063] The first target recognition model matching module is configured to match the first target recognition model from multiple first preset recognition models according to the type of the target image;
[0064] Among them, the multiple first preset recognition models are deep learning models corresponding to multiple preset image types and used for coefficient importance recognition.
[0065] In an optional embodiment, the coefficient group importance recognition module is specifically configured to input the second position information into a second target recognition model for coefficient group importance recognition to obtain the second important index;
[0066] Among them, the second target recognition model is a deep learning model used for coefficient group importance recognition.
[0067] In an optional embodiment, the device further includes:
[0068] The second image acquisition module is configured to acquire the target image;
[0069] The second image type recognition module is configured to input the target image into an image type recognition model for image type recognition to obtain the target image type corresponding to the target image;
[0070] The second target recognition model matching module is configured to match the second target recognition model from multiple second preset recognition models according to the type of the target image;
[0071] Among them, the multiple second preset recognition models are deep learning models corresponding to multiple preset image types and used for coefficient group importance recognition.
[0072] According to the third aspect of the embodiments of the present disclosure, an electronic device is provided, including: a processor; a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the instructions to implement the method described in each item of the first aspect above.
[0073] According to the fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the methods described in each item of the image encoding method of the embodiments of the present disclosure.
[0074] According to the fifth aspect of the embodiments of the present disclosure, a computer program product containing instructions is provided. When it runs on a computer, the computer is enabled to execute the methods described in each item of the first aspect above.
[0075] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0076] In the process of image coding, by combining the first position information of each initial coding transformation coefficient corresponding to the image in the coding transformation coefficient group to identify the importance of the coefficients, a first importance index representing the visual influence degree of each initial coding transformation coefficient on the target image can be obtained; and by combining the second position information of each coding transformation coefficient group corresponding to the image in the transformation unit to identify the importance of the coefficient group, a second importance index representing the visual influence degree of each coding transformation coefficient group on the target image can be obtained; and in the process of adjusting each initial coding transformation coefficient, based on the above first importance index and second importance index, the initial coding performance index corresponding to the current coding transformation coefficient is corrected to obtain the corrected coding performance index corresponding to the current coding transformation coefficient, which can effectively compensate for the coding performance index error caused by directly calculating the pixel domain loss in the related technology when calculating the coding performance index, greatly improve the accuracy of the coding performance index, and without directly calculating the pixel domain loss and without converting the coefficients to the pixel domain, effectively reducing the complexity in the process of calculating the coding performance index. Then, by combining the target coding transformation coefficients determined by the corrected coding performance index to perform image coding processing, the coding performance and efficiency in the entire image coding process can be greatly improved.
[0077] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. Brief Description of the Drawings
[0078] The accompanying drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation to the present disclosure.
[0079] Figure 1 is a schematic diagram of an application environment shown according to an exemplary embodiment;
[0080] Figure 2 is a flowchart of an image coding method shown according to an exemplary embodiment;
[0081] Figure 3 is a flowchart of matching a first target recognition model shown according to an exemplary embodiment;
[0082] Figure 4 is a flowchart of matching a second target recognition model shown according to an exemplary embodiment;
[0083] Figure 5A flowchart showing the process of modifying the initial coding performance index corresponding to each initial coding transform coefficient based on the first important index and the second important index during the coefficient adjustment of each initial coding transform coefficient to obtain the modified coding performance index according to an exemplary embodiment;
[0084] Figure 6 A block diagram of an image coding device shown according to an exemplary embodiment;
[0085] Figure 7 A block diagram of an electronic device for image coding shown according to an exemplary embodiment;
[0086] Figure 8 A block diagram of another electronic device for image coding shown according to an exemplary embodiment. Detailed implementation manners
[0087] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0088] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described here can be implemented in an order different from those illustrated or described here. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties.
[0090] Please refer to Figure 1 , Figure 1 A schematic diagram of an application environment shown according to an exemplary embodiment, and the application environment may include a terminal 100 and a server 200.
[0091] In an optional embodiment, taking the scenario of transmitting multimedia data such as images and videos as an example, optionally, the terminal 100 can be used to encode multimedia data and then transmit it to the server 200. Specifically, the terminal 100 can include, but is not limited to, electronic devices such as smartphones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. It can also be software running on the above-mentioned electronic devices, such as application programs. Optionally, the operating systems running on the electronic devices can include, but are not limited to, Android, IOS, Linux, Windows, etc. The server 200 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0092] In addition, it should be noted that Figure 1 The application environment shown is only one provided by the present disclosure. In actual applications, other application environments may also be included. For example, a terminal 300 may also be included. Optionally, the server can transmit the encoded multimedia data to the terminal 300. Correspondingly, the terminal 300 can decode the encoded multimedia data to obtain the multimedia data. Optionally, the server can also perform image encoding processing on the original multimedia data.
[0093] In the embodiments of this specification, the above-mentioned terminal 100 and server 200 can be directly or indirectly connected through wired or wireless communication methods, and the present disclosure does not limit this.
[0094] Please refer to Figure 2 , Figure 2 which is a flowchart of an image encoding method shown according to an exemplary embodiment. This image encoding method can be applied to electronic devices such as terminals and servers. Specifically, the method can include the following steps:
[0095] In step S201, obtain at least one set of encoding transformation coefficients for each transformation unit in at least one transformation unit corresponding to the target image.
[0096] In an optional embodiment, the target image may be an image acquired in image format or at least one frame of image extracted from a video. Each of the above encoding transform coefficient groups may include at least one initial encoding transform coefficient. Specifically, any initial encoding transform coefficient may be a quantized encoding transform coefficient. In practical applications, during the image encoding process, each image to be encoded is divided into at least one image block; then, the encoder generates a prediction block corresponding to each image block, and then, by subtracting the corresponding prediction block from the image block, a residual block corresponding to each image block can be obtained; then, image encoding is performed in combination with the residual block. Specifically, during the process of image encoding in combination with the residual block, each residual block is divided into at least one transform unit. For each transform unit, a transform can be performed in combination with the pixel values of the pixel points corresponding to the transform unit, and then each transform unit can be divided into at least one group of original encoding transform coefficients. Each group of original encoding transform coefficients includes at least one original encoding transform coefficient. Then, the original encoding transform coefficients in the group of original encoding transform coefficients are quantized to obtain the above at least one group of encoding transform coefficients.
[0097] In step S203, according to the first position information of each initial encoding transform coefficient in the encoding transform coefficient group to which it belongs, coefficient importance recognition is performed to obtain a first importance index corresponding to each initial encoding transform coefficient;
[0098] In a specific embodiment, the first position information may be the position information of each initial encoding transform coefficient in the encoding transform coefficient group to which it belongs. The above first importance index can represent the degree of visual influence of each initial encoding transform coefficient on the target image. In practical applications, the low-frequency components in the encoding transform coefficient group represent most of the energy of the corresponding image region. Correspondingly, the low-frequency components have a greater subjective visual impact on the image; and the low-frequency components (such as the DC component) in an encoding transform coefficient group tend to be located in the upper left corner, and the high-frequency components (such as the AC component) in an encoding transform coefficient group tend to be located in the lower right corner; correspondingly, the closer the initial encoding transform coefficient is to the upper left corner position, the greater its subjective visual impact on the image, and vice versa, the farther the initial encoding transform coefficient is from the upper left corner position (i.e., the closer it is to the lower right corner position), the smaller its subjective visual impact on the image; correspondingly, the first position information of each initial encoding transform coefficient in the encoding transform coefficient group to which it belongs can be combined to perform coefficient importance recognition, and then a first importance index that can represent the degree of visual influence of each initial encoding transform coefficient on the target image can be obtained.
[0099] In an optional embodiment, coefficient importance recognition can be performed in combination with a deep learning model. Correspondingly, the above coefficient importance recognition according to the first position information of each initial encoding transform coefficient in the encoding transform coefficient group to which it belongs to obtain a first importance index corresponding to each initial encoding transform coefficient may include:
[0100] Input the first position information into the first target recognition model for coefficient importance recognition to obtain the first important index.
[0101] In a specific embodiment, the above first target recognition model can be a deep learning model (coefficient importance recognition model) for coefficient importance recognition. Specifically, the first target recognition model can be obtained by performing coefficient importance recognition on the first preset deep learning model based on the first position information corresponding to the sample coding transformation coefficient (the position information of the sample coding transformation coefficient in the corresponding coding transformation coefficient group) and the first preset important index corresponding to the sample coding transformation coefficient (representing the visual influence degree of the sample coding transformation coefficient on the sample image); specifically, the sample coding transformation coefficient can be the quantization-coded transformation coefficient corresponding to the sample image.
[0102] In the above embodiment, in the process of combining the first position information for coefficient importance recognition, by combining the deep learning model for coefficient importance recognition, the accuracy of coefficient importance recognition can be greatly improved, and then the accuracy of the subsequent determined coding performance index can be improved.
[0103] In an optional embodiment, in order to better improve the recognition accuracy of the coefficient importance recognition model, coefficient importance recognition models corresponding to different types of images can be preset. Correspondingly, the coefficient importance recognition model can be selected targeted according to the image type. Correspondingly, the above method can further include the step of matching the first target recognition model: as Figure 3 shown, the step of matching the first target recognition model can include the following steps:
[0104] In step S301, obtain the target image;
[0105] In step S303, input the target image into the image type recognition model for image type recognition to obtain the target image type corresponding to the target image;
[0106] In step S305, according to the target image type, match the first target recognition model from multiple first preset recognition models.
[0107] In a specific embodiment, multiple (at least two) preset image types can be set according to actual application requirements. Optionally, taking the division of image types in combination with the degree of object movement in the image as an example, the multiple preset image types can include a gentle type and a violent type. Specifically, the object in the image can be a person, an animal, etc. In a specific embodiment, the above-mentioned multiple first preset recognition models can be deep learning models corresponding to different preset image types for coefficient importance recognition. Optionally, the image type of the sample image corresponding to any first preset recognition model corresponding to a preset image type is the preset image type.
[0108] In a specific embodiment, the above-mentioned image type recognition model can be obtained by performing image type recognition on a second preset deep learning model based on the sample image and the preset image type corresponding to the sample image.
[0109] In a specific embodiment, the matching of the first target recognition model from multiple first preset recognition models according to the target image type may include using the first preset recognition model whose corresponding preset image type in the multiple first preset recognition models is the target image type as the first target recognition model.
[0110] In the above embodiment, by performing image type recognition on the target image to be encoded currently, the target image type of the target image can be determined, and coefficient importance recognition models corresponding to different image types can be set, so that the selection of the coefficient importance recognition model can be targeted, and further the recognition accuracy of coefficient importance recognition can be better improved.
[0111] In step S205, according to the second position information of each coding transform coefficient group in the corresponding transform unit, coefficient group importance recognition is performed to obtain a second importance index corresponding to each coding transform coefficient group;
[0112] In a specific embodiment, the second position information may be the position information of each coding transform coefficient group in the corresponding transform unit. The above-mentioned second important index characterizes the visual influence degree of each coding transform coefficient group on the target image; in practical applications, the low-frequency components in the transform unit represent most of the energy of the corresponding image region. Correspondingly, the low-frequency components have a greater subjective visual impact on the image; and the low-frequency components (such as the DC component) in a transform unit are often located in the upper left corner, and the high-frequency components (such as the AC component) in a transform unit are often located in the lower right corner; correspondingly, the coding transform coefficient group closer to the upper left corner has a greater subjective visual impact on the image, and vice versa, the coding transform coefficient group farther from the upper left corner (i.e., closer to the lower right corner) has a smaller subjective visual impact on the image; correspondingly, the second position information of each coding transform coefficient group in the corresponding transform unit can be combined to identify the importance of the coefficient group, and then the second important index that can characterize the visual influence degree of each coding transform coefficient group on the target image can be obtained.
[0113] In an optional embodiment, the importance of the coefficient group can be identified by combining a deep learning model. Correspondingly, the above-mentioned identification of the importance of the coefficient group according to the second position information of each coding transform coefficient group in the corresponding transform unit to obtain the second important index corresponding to each coding transform coefficient group includes:
[0114] Input the second position information into the second target recognition model to identify the importance of the coefficient group and obtain the second important index.
[0115] In a specific embodiment, the above-mentioned second target recognition model is a deep learning model (coefficient group importance recognition model) for identifying the importance of the coefficient group. Specifically, the second target recognition model can be obtained by identifying the importance of the coefficient group of the third preset deep learning model based on the second position information corresponding to the sample coding transform coefficient group (the position information of the sample coding transform coefficient group in the corresponding transform unit) and the second preset important index corresponding to the sample coding transform coefficient group (characterizing the visual influence degree of the sample coding transform coefficient group on the sample image).
[0116] In the above embodiment, in the process of identifying the importance of the coefficient group by combining the second position information, by combining the deep learning model for identifying the importance of the coefficient group, the accuracy of identifying the importance of the coefficient group can be greatly improved, and then the accuracy of the subsequent determined coding performance index can be improved.
[0117] In an optional embodiment, in order to better improve the recognition accuracy of the coefficient group importance recognition model, coefficient group importance recognition models corresponding to different types of images can be preset. Correspondingly, the coefficient group importance recognition model can be selected targeted according to the image type. Correspondingly, the above method may further include the step of matching the second target recognition model: as Figure 4 As shown, the step of matching the second target recognition model may include the following steps:
[0118] In step S401, obtain the target image;
[0119] In step S403, input the target image into the image type recognition model for image type recognition to obtain the target image type corresponding to the target image;
[0120] In step S405, according to the target image type, match the second target recognition model from multiple second preset recognition models.
[0121] In a specific embodiment, for the above-mentioned input of the target image into the image type recognition model for image type recognition to obtain the target image type corresponding to the target image, the specific refinement can refer to the above relevant refinement and will not be elaborated here.
[0122] In a specific embodiment, the above-mentioned multiple second preset recognition models are deep learning models corresponding to multiple preset image types for coefficient group importance recognition. Optionally, the image type of the sample image corresponding to the second preset recognition model corresponding to any one preset image type is the preset image type.
[0123] In a specific embodiment, the above-mentioned matching of the second target recognition model from multiple second preset recognition models according to the target image type may include using the second preset recognition model whose corresponding preset image type in the multiple second preset recognition models is the target image type as the second target recognition model.
[0124] In the above embodiment, by performing image type recognition on the target image to be encoded currently, the target image type of the target image can be determined, and coefficient group importance recognition models corresponding to different image types can be set, so that the coefficient group importance recognition model can be selected targeted, and further the recognition accuracy of coefficient group importance recognition can be better improved.
[0125] In step S207, during the process of adjusting the coefficients of each initial coding transformation coefficient, based on the first important index and the second important index, correct the initial coding performance index corresponding to the current coding transformation coefficient to obtain the corrected coding performance index corresponding to the current coding transformation coefficient.
[0126] In a specific embodiment, the above-mentioned current coding transformation coefficient may be any adjusted coefficient of each initial coding transformation coefficient during the coefficient adjustment process. The above-mentioned initial coding performance metric is determined based on the coefficient distortion data corresponding to the current coding transformation coefficient and the amount of information corresponding to the current coding transformation coefficient. The coding performance metric corresponding to the coding transformation coefficient can characterize the pixel data loss brought about by image coding processing based on this coding transformation coefficient; optionally, the coding performance metric is positively correlated with the pixel data loss, that is, the smaller the coding performance metric, the smaller the pixel data loss, and correspondingly, the better the coding performance; conversely, the larger the coding performance metric, the larger the pixel data loss, and correspondingly, the worse the coding performance. In a specific embodiment, the initial coding performance metric corresponding to the current coding transformation coefficient can be determined in combination with the following formula (1):
[0127] J0 = ΔD + λΔR (1)
[0128] Where, J0 is the initial coding performance metric corresponding to the current coding transformation coefficient, ΔD is the coefficient distortion data corresponding to the current coding transformation coefficient (i.e., the sum of the squares of the difference between the current coding transformation coefficient and the coding transformation coefficient before the adjustment of the current coding transformation coefficient), ΔR is the amount of information corresponding to the current coding transformation coefficient (i.e., the number of bits consumed by the current coding transformation coefficient), and λ is the Lagrange multiplier.
[0129] In an optional embodiment, as Figure 5 shown, during the process of adjusting each initial coding transformation coefficient, based on the first important metric and the second important metric, the initial coding performance metric corresponding to each initial coding transformation coefficient is corrected to obtain the corrected coding performance metric, which may include the following steps:
[0130] In step S2071, each initial coding transformation coefficient is adjusted to obtain the current coding transformation coefficient corresponding to each initial coding transformation coefficient;
[0131] In step S2073, the coefficient distortion data and the amount of information corresponding to the current coding transformation coefficient are determined;
[0132] In step S2075, based on the first important metric corresponding to the current coding transformation coefficient, the second important metric corresponding to the coding transformation coefficient group to which the current coding transformation coefficient belongs, the coefficient distortion data, and the amount of information, the corrected coding performance metric corresponding to the current coding transformation coefficient is determined;
[0133] In step S2077, the current coding transformation coefficient is adjusted, and based on the adjusted current coding transformation coefficient, the coefficient distortion data and the amount of information corresponding to the current coding transformation coefficient are repeatedly determined until the step of adjusting the current coding transformation coefficient is reached, until a preset convergence condition is satisfied.
[0134] In a specific embodiment, each initial coding transform coefficient can be increased or decreased to obtain the current coding transform coefficient corresponding to each initial coding transform coefficient. Optionally, the adjustment amplitude each time can be set in combination with the actual application requirements.
[0135] In a specific embodiment, for the specific refinement of determining the coefficient distortion data and the amount of information corresponding to the current coding transform coefficient, reference can be made to the above relevant description, which will not be elaborated here.
[0136] In an optional embodiment, since the initial coding performance metric is determined based on the coefficient distortion data corresponding to the current coding transform coefficient and the amount of information corresponding to the current coding transform coefficient, optionally, in order to compensate for the problem of the reduction in the accuracy of the coding performance metric caused by the inequality between the loss of the coding transform coefficient in the frequency domain (coefficient distortion data) and the loss in the pixel domain, the coefficient distortion data can be directly corrected. Correspondingly, the determination of the corrected coding performance metric corresponding to the current coding transform coefficient based on the first important metric corresponding to the current coding transform coefficient, the second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, the coefficient distortion data, and the amount of information can include:
[0137] Correct the coefficient distortion data according to the first important metric corresponding to the current coding transform coefficient and the second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, to obtain the corrected coefficient distortion data;
[0138] Generate the corrected coding performance metric corresponding to the current coding transform coefficient according to the corrected coefficient distortion data and the amount of information.
[0139] In a specific embodiment, correcting the coefficient distortion data according to the first important metric corresponding to the current coding transform coefficient and the second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, to obtain the corrected coefficient distortion data can include: calculating the product between the first important metric corresponding to the current coding transform coefficient and the second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, and multiplying the coefficient distortion data by this product to obtain the corrected coefficient distortion data; further, in combination with the above formula (1), the coefficient distortion data can be replaced with the corrected coefficient distortion data to obtain the corrected coding performance metric corresponding to the current coding transform coefficient. Correspondingly, the determination of the corrected coding performance metric corresponding to the current coding transform coefficient based on the first important metric corresponding to the current coding transform coefficient, the second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, the coefficient distortion data, and the amount of information can be expressed in combination with the following formula (2):
[0140] J = W1W2ΔD + λΔR (2)
[0141] Among them, J is the corrected coding performance index corresponding to the current coding transform coefficient, ΔD is the coefficient distortion data corresponding to the current coding transform coefficient (i.e., the sum of squares of the differences between the current coding transform coefficient and the coding transform coefficient before the adjustment of the current coding transform coefficient), ΔR is the information amount corresponding to the current coding transform coefficient (i.e., the number of bits consumed by the current coding transform coefficient), and λ is the Lagrange multiplier; W1 is the first important index corresponding to the current coding transform coefficient, and W2 is the second important index corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs.
[0142] In the above embodiment, by combining the first important index representing the visual impact degree of the current coding transform coefficient on the target image and the second important index representing the visual impact degree of the coding transform coefficient group to which the current coding transform coefficient belongs on the target image, the coefficient loss (coefficient distortion data) of the current coding transform coefficient in the frequency domain is corrected, which can effectively compensate for the coding performance index error caused by not directly calculating the loss in the pixel domain, greatly improve the accuracy of the coding performance index, and without directly calculating the loss in the pixel domain, there is no need to convert the coefficient to the pixel domain, effectively reducing the complexity in the calculation process of the coding performance index, and thus can also greatly improve the coding performance and efficiency in the entire coding process.
[0143] In an optional embodiment, since the initial coding performance index is determined based on the coefficient distortion data corresponding to the current coding transform coefficient and the information amount corresponding to the current coding transform coefficient, optionally, in order to compensate for the problem of reduced accuracy of the coding performance index caused by the inequivalence between the loss (coefficient distortion data) of the coding transform coefficient in the frequency domain and the loss in the pixel domain, the information amount can also be corrected. Correspondingly, the determination of the corrected coding performance index corresponding to the current coding transform coefficient based on the first important index corresponding to the current coding transform coefficient, the second important index corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, the coefficient distortion data, and the information amount can include:
[0144] Correct the information amount according to the first important index corresponding to the current coding transform coefficient and the second important index corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, to obtain the corrected information amount;
[0145] Generate the corrected coding performance index corresponding to the current coding transform coefficient according to the coefficient distortion data and the corrected information amount.
[0146] In a specific embodiment, in combination with the above formula (2), divide the right side of the equation in the above formula (2) by W1W2, so as to achieve the correction of the information amount in the initial coding performance index, and make up for the loss of the coding transformation coefficient in the frequency domain (coefficient distortion data) and the pixel domain loss being not equivalent; correspondingly, the above-mentioned correction of the information amount according to the first important index corresponding to the current coding transformation coefficient and the second important index corresponding to the coding transformation coefficient group to which the current coding transformation coefficient belongs may include: calculating the product between the first important index corresponding to the current coding transformation coefficient and the second important index corresponding to the coding transformation coefficient group to which the current coding transformation coefficient belongs, and dividing the information amount by this product to obtain the corrected information amount; further, the information amount in the above formula (1) can be replaced with the corrected information amount to obtain the corrected coding performance index corresponding to the current coding transformation coefficient. Correspondingly, the above-mentioned determination of the corrected coding performance index corresponding to the current coding transformation coefficient based on the first important index corresponding to the current coding transformation coefficient, the second important index corresponding to the coding transformation coefficient group to which the current coding transformation coefficient belongs, the coefficient distortion data and the information amount can be expressed in combination with the following formula (3):
[0147]
[0148] Where, J is the corrected coding performance index corresponding to the current coding transformation coefficient, ΔD is the coefficient distortion data corresponding to the current coding transformation coefficient (that is, the sum of the squares of the differences between the current coding transformation coefficient and the coding transformation coefficient before the current coding transformation coefficient is adjusted), ΔR is the information amount corresponding to the current coding transformation coefficient (that is, the number of bits consumed by the current coding transformation coefficient), λ is the Lagrange multiplier; W1 is the first important index corresponding to the current coding transformation coefficient, and W2 is the second important index corresponding to the coding transformation coefficient group to which the current coding transformation coefficient belongs.
[0149] In the above embodiment, by combining the first important index representing the influence degree of the current coding transformation coefficient on the visual effect of the target image and the second important index representing the influence degree of the coding transformation coefficient group to which the current coding transformation coefficient belongs on the visual effect of the target image, the information amount in the initial coding performance index is corrected, which can effectively make up for the coding performance index error caused by not directly calculating the pixel domain loss, greatly improve the accuracy of the coding performance index, and without directly calculating the pixel domain loss, there is no need to convert the coefficient to the pixel domain, effectively reducing the complexity in the calculation process of the coding performance index, and thus can also greatly improve the coding performance and efficiency in the entire coding process.
[0150] In a specific embodiment, the current coding transformation coefficient can be continuously adjusted. Specifically, during the coefficient adjustment process, taking increasing as an example, if the previous adjustment was an increase and the corrected coding performance index is decreasing, that is, the coding performance is getting better; for the next coefficient adjustment, it can continue to be increased. On the contrary, if the previous adjustment was an increase and the corrected coding performance index is increasing, that is, the coding performance is getting worse; for the next coefficient adjustment, it can be decreased.
[0151] In a specific embodiment, the above preset convergence condition can be set in combination with the actual application. For example, the range of amplitude change during the adjustment of each initial coding transformation coefficient can be set. Optionally, assuming the amplitude change range is ±2. Optionally, during the adjustment process, the largest current coding transformation coefficient is the current coding transformation coefficient that is 2 larger than the initial coding transformation coefficient, and the smallest current coding transformation coefficient is the current coding transformation coefficient that is 2 smaller than the initial coding transformation coefficient. And when the current coding transformation coefficient during the adjustment process includes the largest current coding transformation coefficient and the smallest current coding transformation coefficient, it can be determined that the preset convergence condition is satisfied.
[0152] In the above embodiment, during the adjustment process of each initial coding transformation coefficient, by obtaining the coefficient distortion data and information amount used to determine the initial coding performance index corresponding to each initial coding transformation coefficient, when determining the initial coding performance index by combining the coefficient distortion data and information amount, the first important index representing the influence degree of the current coding transformation coefficient on the visual effect of the target image and the second important index representing the influence degree of the coding transformation coefficient group to which the current coding transformation coefficient belongs on the visual effect of the target image can be incorporated. Thus, the coding performance index error caused by not directly calculating the pixel domain loss can be effectively compensated, greatly improving the accuracy of the coding performance index. And without directly calculating the pixel domain loss, there is no need to convert the coefficients to the pixel domain, effectively reducing the complexity in the calculation process of the coding performance index. Furthermore, the coding performance and efficiency in the entire coding process can be greatly improved.
[0153] In step S209, when the adjustment of each initial coding transformation coefficient ends, the current coding transformation coefficient corresponding to the corrected coding performance index that meets the preset condition during the coefficient adjustment process is used as the target coding transformation coefficient corresponding to each initial coding transformation coefficient;
[0154] In a specific embodiment, the corrected coding performance index that meets the preset condition can be the smallest corrected coding performance index during the adjustment process of each initial coding transformation coefficient.
[0155] In step S211, image coding processing is performed based on the target coding transformation coefficient to obtain the coded image of the target image.
[0156] In a specific embodiment, based on the target coding transform coefficients, image coding processing is performed, and the coded image of the target image can be entropy coding on the target coding transform coefficients to obtain coded data; optionally, the coded data can be transmitted to the corresponding requester; subsequently, the requester can obtain the above-mentioned target image based on decoding (operations such as inverse quantization and inverse transformation) of the coded data; optionally, when the target image is at least one frame image extracted from a video, the at least one frame image (target image) can be converted into a corresponding video.
[0157] As can be seen from the technical solutions provided in the embodiments of this specification above, in the process of image coding in this specification, by combining the first position information of each initial coding transform coefficient corresponding to the image in the coding transform coefficient group to which it belongs, coefficient importance recognition is performed, and a first importance index representing the visual influence degree of each initial coding transform coefficient on the target image can be obtained; and by combining the second position information of each coding transform coefficient group corresponding to the image in the transform unit to which it belongs, coefficient group importance recognition is performed, and a second importance index representing the visual influence degree of each coding transform coefficient group on the target image can be obtained; and in the process of adjusting each initial coding transform coefficient, based on the above first importance index and second importance index, the initial coding performance index corresponding to the current coding transform coefficient is corrected to obtain the corrected coding performance index corresponding to the current coding transform coefficient, which can effectively compensate for the coding performance index error caused by directly calculating the pixel domain loss in calculating the coding performance index in the related art, greatly improving the accuracy of the coding performance index, and not directly calculating the pixel domain loss, without converting the coefficients to the pixel domain, effectively reducing the complexity in the calculation process of the coding performance index. Then, by combining the target coding transform coefficients determined according to the corrected coding performance index for image coding processing, the coding performance and efficiency in the entire image coding process can be greatly improved.
[0158] Figure 6 is a block diagram of an image coding device shown according to an exemplary embodiment. Refer to Figure 6 , the device includes:
[0159] A coding transform coefficient group acquisition module 610, configured to execute to acquire at least one coding transform coefficient group of each transform unit in at least one transform unit corresponding to a target image, and each coding transform coefficient group includes at least one initial coding transform coefficient;
[0160] A coefficient importance recognition module 620, configured to execute coefficient importance recognition according to the first position information of each initial coding transform coefficient in the coding transform coefficient group to which it belongs, and obtain a first importance index corresponding to each initial coding transform coefficient; the first importance index represents the visual influence degree of each initial coding transform coefficient on the target image;
[0161] The coefficient group importance recognition module 630 is configured to perform coefficient group importance recognition according to the second position information of each coded transform coefficient group in the corresponding transform unit, so as to obtain a second importance index corresponding to each coded transform coefficient group; the second importance index represents the degree of visual impact of each coded transform coefficient group on the target image.
[0162] The coding performance index correction module 640 is configured to perform, during the process of adjusting each initial coded transform coefficient, correction of the initial coding performance index corresponding to the current coded transform coefficient based on the first importance index and the second importance index, so as to obtain a corrected coding performance index corresponding to the current coded transform coefficient, where the current coded transform coefficient is any adjusted coefficient of each initial coded transform coefficient during the coefficient adjustment process.
[0163] The target coded transform coefficient determination module 650 is configured to perform, when the adjustment of each initial coded transform coefficient ends, using the current coded transform coefficient corresponding to the corrected coding performance index that meets the preset conditions during the coefficient adjustment process as the target coded transform coefficient corresponding to each initial coded transform coefficient.
[0164] The image coding processing module 660 is configured to perform image coding processing based on the target coded transform coefficient to obtain a coded image of the target image.
[0165] In an optional embodiment, the initial coding performance index is determined based on the coefficient distortion data corresponding to the current coded transform coefficient and the amount of information corresponding to the current coded transform coefficient; the coding performance index correction module 640 includes:
[0166] The coefficient adjustment unit is configured to perform adjustment on each initial coded transform coefficient to obtain a current coded transform coefficient corresponding to each initial coded transform coefficient.
[0167] The data determination unit is configured to perform determination of the coefficient distortion data and the amount of information corresponding to the current coded transform coefficient.
[0168] The corrected coding performance index determination unit is configured to perform determination of the corrected coding performance index corresponding to the current coded transform coefficient based on the first importance index corresponding to the current coded transform coefficient, the second importance index corresponding to the coded transform coefficient group to which the current coded transform coefficient belongs, the coefficient distortion data, and the amount of information.
[0169] The current coded transform coefficient adjustment unit is configured to perform adjustment on the current coded transform coefficient.
[0170] An iterative processing unit, configured to perform steps of repeatedly determining coefficient distortion data and information amount corresponding to the current coding transform coefficient based on the adjusted current coding transform coefficient, and adjusting the current coding transform coefficient until a preset convergence condition is met.
[0171] In an optional embodiment, the corrected coding performance metric determination unit includes:
[0172] An information amount correction unit, configured to perform correcting the information amount according to a first important metric corresponding to the current coding transform coefficient and a second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, to obtain a corrected information amount;
[0173] A first corrected coding performance metric generation unit, configured to perform generating a corrected coding performance metric corresponding to the current coding transform coefficient according to the coefficient distortion data and the corrected information amount.
[0174] In an optional embodiment, the corrected coding performance metric determination unit includes:
[0175] A coefficient distortion data correction unit, configured to perform correcting the coefficient distortion data according to a first important metric corresponding to the current coding transform coefficient and a second important metric corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, to obtain corrected coefficient distortion data;
[0176] A second corrected coding performance metric generation unit, configured to perform generating a corrected coding performance metric corresponding to the current coding transform coefficient according to the corrected coefficient distortion data and the information amount.
[0177] In an optional embodiment, the coefficient importance recognition module 620 is specifically configured to perform inputting the first position information into a first target recognition model for coefficient importance recognition to obtain a first important metric;
[0178] Wherein, the first target recognition model is a deep learning model for coefficient importance recognition.
[0179] In an optional embodiment, the above device further includes:
[0180] A first image acquisition module, configured to perform acquiring a target image;
[0181] A first image type recognition module, configured to perform inputting the target image into an image type recognition model for image type recognition to obtain a target image type corresponding to the target image;
[0182] A first target recognition model matching module, configured to perform matching out the first target recognition model from multiple first preset recognition models according to the target image type;
[0183] Among them, the multiple first preset recognition models are deep learning models corresponding to multiple preset image types and used for coefficient importance recognition.
[0184] In an optional embodiment, the coefficient group importance recognition module 630 is specifically configured to input the second position information into the second target recognition model to perform coefficient group importance recognition and obtain a second importance index.
[0185] Among them, the second target recognition model is a deep learning model used for coefficient group importance recognition.
[0186] In an optional embodiment, the above device further includes:
[0187] A second image acquisition module, configured to acquire a target image.
[0188] A second image type recognition module, configured to input the target image into an image type recognition model to perform image type recognition and obtain the target image type corresponding to the target image.
[0189] A second target recognition model matching module, configured to match the second target recognition model from multiple second preset recognition models according to the target image type.
[0190] Among them, the multiple second preset recognition models are deep learning models corresponding to multiple preset image types and used for coefficient group importance recognition.
[0191] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0192] Figure 7 is a block diagram of an electronic device for image coding shown according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as Figure 7As shown. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an image encoding method. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the electronic device, or an external keyboard, a touchpad, or a mouse, etc.
[0193] Figure 8 is a block diagram of another electronic device for image encoding shown according to an exemplary embodiment. The electronic device can be a server, and its internal structure diagram can be as Figure 8 shown. The electronic device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an image encoding method.
[0194] Those skilled in the art can understand that Figure 7 or Figure 8 the structures shown in are only block diagrams of partial structures related to the solution of the present disclosure, and do not constitute a limitation on the electronic devices to which the solution of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0195] In an exemplary embodiment, there is also provided an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein, the processor is configured to execute the instructions to implement the image encoding method as in the embodiments of the present disclosure.
[0196] In an exemplary embodiment, there is also provided a computer-readable storage medium. When the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute the image encoding method in the embodiments of the present disclosure.
[0197] In an exemplary embodiment, there is also provided a computer program product including instructions that, when run on a computer, cause the computer to execute the image encoding method in the embodiments of the present disclosure.
[0198] Those of ordinary skill in the art will understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0199] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0200] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. An image coding method, characterized in that: include: Obtaining at least one coded transform coefficient group for each transform unit in at least one transform unit corresponding to the target image, each coded transform coefficient group including at least one initial coded transform coefficient; performing coefficient importance identification based on first position information of each initial coding transform coefficient in the coding transform coefficient group to which it belongs, to obtain a first importance index corresponding to each initial coding transform coefficient; the first importance index representing a degree of visual impact of each initial coding transform coefficient on the target image; performing coefficient group importance identification based on second position information of each coded transform coefficient group in the transform unit to which it belongs, to obtain a second importance index corresponding to each coded transform coefficient group; the second importance index represents a degree of visual impact of each coded transform coefficient group on the target image; In a coefficient adjustment process for each initial coding transform coefficient, based on the first important indicator and the second important indicator, correcting an initial coding performance indicator corresponding to a current coding transform coefficient to obtain a corrected coding performance indicator corresponding to the current coding transform coefficient, where the current coding transform coefficient is any adjusted coefficient of each initial coding transform coefficient in the coefficient adjustment process; When the adjustment of each initial coding transform coefficient is completed, the current coding transform coefficient corresponding to the modified coding performance indicator that meets the preset condition during the coefficient adjustment process is used as the target coding transform coefficient number corresponding to each initial coding transform coefficient; Image coding processing is performed based on the target coding transformation coefficient to obtain a coded image of the target image.
2. The image encoding method according to claim 1, wherein The initial coding performance indicator is determined based on coefficient distortion data corresponding to the current coding transform coefficient and the amount of information corresponding to the current coding transform coefficient; and in the process of performing coefficient adjustment on each of the initial coding transform coefficients, the initial coding performance indicator corresponding to each of the initial coding transform coefficients is corrected based on the first important indicator and the second important indicator, to obtain the corrected coding performance indicator, comprising: Adjusting each of the initial coding transform coefficients to obtain the current coding transform coefficient corresponding to each of the initial coding transform coefficients; Determining the coefficient distortion data and the information amount corresponding to the current encoding transform coefficient; determining, based on the first important indicator corresponding to the current coding transform coefficient, the second important indicator corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, the coefficient distortion data, and the amount of information, the modified coding performance indicator corresponding to the current coding transform coefficient; Adjust the current coding transform coefficient, and based on the adjusted current coding transform coefficient, repeat the steps of determining the coefficient distortion data and the amount of information corresponding to the current coding transform coefficient, up to the step of adjusting the current coding transform coefficient, until a preset convergence condition is met.
3. The image encoding method according to claim 2, wherein: The determining, based on the first important indicator corresponding to the current coding transform coefficient, the second important indicator corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, the coefficient distortion data, and the amount of information, the modified coding performance indicator corresponding to the current coding transform coefficient includes: Correcting the information amount according to the first important indicator corresponding to the current coding transform coefficient and the second important indicator corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs to obtain a corrected information amount; The modified coding performance indicator corresponding to the current coding transformation coefficient is generated according to the coefficient distortion data and the modified information amount.
4. The image encoding method according to claim 2, wherein: The determining, based on the first important indicator corresponding to the current coding transform coefficient, the second important indicator corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs, the coefficient distortion data, and the amount of information, the modified coding performance indicator corresponding to the current coding transform coefficient includes: Correcting the coefficient distortion data according to the first important indicator corresponding to the current coding transform coefficient and the second important indicator corresponding to the coding transform coefficient group to which the current coding transform coefficient belongs to obtain corrected coefficient distortion data; The modified coding performance indicator corresponding to the current coding transformation coefficient is generated according to the modified coefficient distortion data and the information amount.
5. The image coding method according to any one of claims 1 to 4, characterized in that: The performing coefficient importance identification according to the first position information of each initial coding transform coefficient in the coding transform coefficient group to which it belongs, and obtaining the first important index corresponding to each initial coding transform coefficient includes: Inputting the first position information into a first target recognition model to perform coefficient importance recognition to obtain the first important indicator; Among them, the first target recognition model is a deep learning model used to identify the importance of coefficients.
6. The image encoding method according to claim 5, wherein: The method further comprises: Acquiring the target image; Inputting the target image into an image type recognition model to perform image type recognition to obtain a target image type corresponding to the target image; According to the target image type, matching the first target recognition model from a plurality of first preset recognition models; Among them, the multiple first preset recognition models are deep learning models corresponding to multiple preset image types and used for coefficient importance identification.
7. The image coding method according to any one of claims 1 to 4, characterized in that: The step of identifying the importance of each coding transform coefficient group according to the second position information of each coding transform coefficient group in the transform unit to which it belongs, and obtaining the second important index corresponding to each coding transform coefficient group includes: Inputting the second position information into a second target recognition model to perform coefficient group importance recognition to obtain the second important indicator; The second target recognition model is a deep learning model used to identify the importance of coefficient groups.
8. The image encoding method according to claim 7, wherein: The method further comprises: Acquiring the target image; Inputting the target image into an image type recognition model to perform image type recognition to obtain a target image type corresponding to the target image; According to the target image type, matching the second target recognition model from a plurality of second preset recognition models; Among them, the multiple second preset recognition models are deep learning models corresponding to multiple preset image types and used to identify the importance of coefficient groups.
9. An image coding device, characterized in that include: a coding transform coefficient group acquisition module, configured to acquire at least one coding transform coefficient group for each transform unit in at least one transform unit corresponding to a target image, each coding transform coefficient group including at least one initial coding transform coefficient; a coefficient importance identification module configured to perform coefficient importance identification based on first position information of each initial coded transform coefficient in the coded transform coefficient group to which it belongs, and obtain a first importance index corresponding to each initial coded transform coefficient; the first importance index represents a degree of visual impact of each initial coded transform coefficient on the target image; a coefficient group importance identification module configured to perform coefficient group importance identification based on second position information of each coded transform coefficient group in the transform unit to which it belongs, and obtain a second importance index corresponding to each coded transform coefficient group; the second importance index represents a degree of visual impact of each coded transform coefficient group on the target image; a coding performance index correction module configured to, during a coefficient adjustment process for each initial coding transform coefficient, correct an initial coding performance index corresponding to a current coding transform coefficient based on the first important index and the second important index to obtain a corrected coding performance index corresponding to the current coding transform coefficient, where the current coding transform coefficient is any adjusted coefficient of each initial coding transform coefficient during the coefficient adjustment process; a target coding transform coefficient determination module configured to, upon completion of adjustment of each initial coding transform coefficient, use the current coding transform coefficient corresponding to the modified coding performance indicator that satisfies a preset condition during the coefficient adjustment process as the target coding transform coefficient corresponding to each initial coding transform coefficient; The image coding processing module is configured to perform image coding processing based on the target coding transformation coefficient to obtain a coded image of the target image.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image encoding method according to each of claims 1 to 8.
11. A computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image encoding method according to any one of claims 1 to 8.
Citation Information
Patent Citations
A video encoding method
CN102300094A
Rate distortion optimization method based on visual perception
CN115174898A