An encoding method, apparatus, device, and storage medium

By acquiring encoding quality data and image attribute data of historical video frames and combining them with network control parameters, the encoding quality of the current video frame is adjusted, solving the problem of bitrate inefficiency caused by network environment control in existing technologies, and achieving more efficient encoding quality and bandwidth utilization in VDI systems.

CN115002462BActive Publication Date: 2026-05-29SANGFOR TECH INC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SANGFOR TECH INC
Filing Date
2022-05-31
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Most existing VDI solutions rely on the network environment to regulate encoding quality, resulting in significant differences in the encoding difficulty of different video frames, which affects the final encoding quality and is not conducive to saving bitrate.

Method used

By acquiring the encoding quality data of historical video frames and the image attribute data of the current video frame, encoding control parameters are determined. Combined with network control parameters, the encoding quality of the current video frame is comprehensively adjusted to achieve low network bandwidth consumption and significant bit rate savings after encoding.

Benefits of technology

While ensuring video quality, it significantly saves bitrate, reduces network bandwidth consumption, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115002462B_ABST
    Figure CN115002462B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, and discloses an encoding method, an encoding device, an encoding equipment and a storage medium, which comprise the following steps: obtaining encoding quality data of a historical video frame and picture attribute data of a current video frame; wherein the picture attribute data reflects the texture characteristics of the video frame; determining an encoding control parameter based on the encoding quality data and the picture attribute data, so as to regulate and control the encoding quality of the current video frame by using the encoding control parameter; wherein the value of the encoding control parameter is negatively correlated with the encoding quality. In the application, the encoding quality of the historical video frame is considered as a factor, and the picture attribute reflecting the texture characteristics of the current video frame is also considered as a factor, so that a corresponding encoding control parameter is determined comprehensively, the encoding control parameter is used to regulate and control the encoding quality of the current video frame which is negatively correlated with the value of the encoding control parameter, the network bandwidth consumption of the current video frame after encoding is small, and the effect of significantly saving the code stream is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an encoding method, apparatus, device, and storage medium. Background Technology

[0002] With the deepening of information networking, encoding technologies based on multimedia and networks are gradually developing towards networking and digitalization. Especially against the backdrop of the rapid development of Virtual Desktop Infrastructure (VDI), the requirements for storage space and transmission bandwidth are extremely high, making the encoding and compression of video data an inevitable choice, and encoding quality has become a key factor affecting transmission bandwidth.

[0003] VDI deeply integrates server virtualization, desktop virtualization, and storage virtualization, enabling rapid delivery of cloud platforms with only two devices: a desktop cloud appliance and a cloud terminal. This simplifies desktop maintenance, ensures information security, and facilitates smooth and efficient mobile office work. Most current VDI solutions rely on network conditions to control encoding quality. However, due to the significant differences in encoding difficulty among different video frames, the final encoding quality is greatly affected. Relying solely on network conditions to control encoding quality is not conducive to saving bitrate.

[0004] Therefore, how to provide an encoding method that takes into account the characteristics of video frames themselves to improve encoding quality and save bitstream is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide an encoding method, apparatus, device, and storage medium that enables the encoded current view frame to consume less network bandwidth, achieving a significant saving in bitstream. The specific solution is as follows:

[0006] The first aspect of this application provides an encoding method, including:

[0007] Acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame;

[0008] Encoding control parameters are determined based on the encoding quality data and the image attribute data, so as to adjust the encoding quality of the current video frame using the encoding control parameters; wherein the value of the encoding control parameters is negatively correlated with the encoding quality.

[0009] Optionally, obtaining the encoding quality data of historical video frames and the image attribute data of the current video frame includes:

[0010] The coding quality data is obtained by acquiring at least one of the following: the first ambiguity of the source image of the historical video frame, the second ambiguity of the reconstructed image of the historical video frame, the average subjective opinion score, and the number of macroblocks with block effects in the reconstructed image of the historical video frame.

[0011] Obtain the third blur of the source image of the current video frame to obtain the image attribute data of the current video frame.

[0012] Optionally, obtaining the encoding quality data of historical video frames and the image attribute data of the current video frame includes:

[0013] The first ambiguity of the source image of the historical video frame, the second ambiguity of the reconstructed image of the historical video frame, the average subjective opinion score, and the third ambiguity of the source image of the current video frame are obtained.

[0014] Accordingly, determining the encoding control parameters based on the encoding quality data and the image attribute data includes:

[0015] A first bitrate is calculated using the third ambiguity, and a second bitrate is calculated using the first ambiguity and the second ambiguity; wherein the first bitrate is negatively correlated with the third ambiguity, and the second bitrate is positively correlated with the ratio of the second ambiguity to the first ambiguity;

[0016] A bit allocation factor is determined based on the first bit rate, the second bit rate, and the average subjective opinion score, so as to obtain the encoding control parameters through the bit allocation factor.

[0017] Optionally, determining the encoding control parameters based on the encoding quality data and the image attribute data includes:

[0018] Determine whether the encoding quality data meets the first preset condition and whether the image attributes meet the second preset condition. If so, set the encoding control parameter to a value less than the first threshold.

[0019] Optionally, the encoding method further includes:

[0020] The network control parameters are determined based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with the coding quality.

[0021] The parameter with the larger value among the network control parameters and the encoding control parameters is determined as the final control parameter, so as to adjust the encoding quality of the current video frame using the final control parameter.

[0022] Optionally, before determining the encoding control parameters based on the encoding quality data and the image attribute data, the method further includes:

[0023] Determine whether the source image of the current video frame meets the coding optimization conditions. If not, directly adjust the coding quality of the current video frame using the network control parameters.

[0024] Optionally, determining whether the source image of the current video frame satisfies the coding optimization conditions includes:

[0025] The structural similarity index value between the source image and the reconstructed image of the historical video frame is obtained, as well as the third ambiguity of the source image of the current video frame and the proportion of macroblocks with block effects in the reconstructed image of the historical video frame.

[0026] Determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, determine that the source image of the current video frame does not meet the coding optimization condition.

[0027] Optionally, the encoding method further includes:

[0028] The control level is configured according to the target requirements, wherein the control level reflects the degree of mapping of the control parameters;

[0029] If the control level is the first level, the encoding quality of the current video frame is directly controlled using the network control parameters;

[0030] If the control level is the second level, then the step of controlling the encoding quality of the current video frame using the final control parameters is performed.

[0031] Optionally, the historical video frame is the video frame preceding the current video frame, and the encoding quality data of the preceding video frame is obtained by updating the encoding quality data once every preset number of frames using a fixed window method.

[0032] Optionally, the encoding quality data can be updated every preset number of frames using a fixed window, including:

[0033] The number of macroblocks with block effects is updated once every first preset number of frames using a fixed window method, and the encoding quality data other than the number of macroblocks with block effects is updated once every second preset number of frames using a fixed window method; wherein the first preset number of frames is less than the second preset number of frames.

[0034] A second aspect of this application provides an encoding device, comprising:

[0035] The data acquisition module is used to acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame.

[0036] The control module is used to determine encoding control parameters based on the encoding quality data and the image attribute data, so as to adjust the encoding quality of the current video frame using the encoding control parameters; wherein the value of the encoding control parameters is negatively correlated with the encoding quality.

[0037] A third aspect of this application provides an electronic device comprising a processor and a memory; wherein the memory is used to store a computer program, the computer program being loaded and executed by the processor to implement the aforementioned encoding method.

[0038] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when loaded and executed by a processor, implement the aforementioned encoding method.

[0039] In this application, encoding quality data of historical video frames and image attribute data of the current video frame are first obtained; wherein, the image attribute data reflects the texture features of the video frame; then, encoding control parameters are determined based on the encoding quality data and the image attribute data, so as to regulate the encoding quality of the current video frame using the encoding control parameters; wherein, the value of the encoding control parameter is negatively correlated with the encoding quality. It can be seen that this application, while considering the encoding quality of historical video frames, also considers the image attributes reflecting the texture features of the current video frame, comprehensively determining the corresponding encoding control parameters. These encoding control parameters are used to regulate the encoding quality of the current video frame, which is negatively correlated with their value, resulting in low network bandwidth consumption for the encoded current video frame and achieving a significant saving in bitrate. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0041] Figure 1 A flowchart of an encoding method provided in this application;

[0042] Figure 2 A flowchart of a stream-oriented encoding method provided for this application;

[0043] Figure 3 A flowchart of a quality-oriented coding method provided in this application;

[0044] Figure 4A flowchart illustrating a user-demand-oriented coding method provided in this application;

[0045] Figure 5 A first-level encoding effect diagram provided for this application;

[0046] Figure 6 A second-level encoding effect diagram provided for this application;

[0047] Figure 7 A flowchart of a resource-oriented coding method provided in this application;

[0048] Figure 8 A framework diagram for full-screen video coding under flexible bandwidth provided in this application;

[0049] Figure 9 This is a framework diagram for full-screen video encoding under flexible bandwidth in existing technologies;

[0050] Figure 10 A schematic diagram of an encoding device structure is provided for this application;

[0051] Figure 11 A structural diagram of an coded electronic device provided in this application. Detailed Implementation

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

[0053] Most existing VDI solutions rely on the network environment to control encoding quality. However, due to the significant differences in encoding difficulty among different video frames, the final encoding quality is greatly affected. Relying solely on network conditions to control encoding quality is not conducive to saving bitrate. To address these technical shortcomings, this application provides an encoding scheme that minimizes network bandwidth consumption for the encoded current video frame, achieving a significant bitrate saving effect.

[0054] Figure 1 A flowchart illustrating an encoding method provided in an embodiment of this application. See also... Figure 1 As shown, the encoding method includes:

[0055] S11: Obtain the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame.

[0056] In this embodiment, the focus is on acquiring the encoding quality data of historical video frames and the image attribute data of the current video frame. The encoding quality data of historical video frames is reflected through the encoding results of historical video frames, while the image attribute data of the current video frame reflects the texture features of the current video frame. The combination of the encoding quality data of historical video frames and the image attribute data of the current video frame can characterize the encoding difficulty of the current video frame.

[0057] It is understandable that the influence of historical video frame encoding quality data on the encoding quality of the current video frame falls under inter-frame influencing factors, while the influence of the current video frame's own image attribute data on its encoding quality falls under intra-frame influencing factors. Regarding the former, given the temporal redundancy of video frames, if the encoding results of previous historical video frames were excellent, it can be approximated that the encoding results of the current video frame will also be good, even with fewer bits allocated, a good encoding result can be obtained. Conversely, more bits must be allocated to obtain a good encoding result. Regarding the latter, given that encoding quality is closely related to the image's own features—for example, the clearer the image texture details, the more bits need to be allocated during encoding to ensure higher video quality; the flatter the image texture details, the fewer bits need to be allocated during encoding, with little impact on encoding quality.

[0058] In this embodiment, the coding quality data of historical video frames is mainly based on indicators such as blurriness and block artifacts. The specific process for obtaining the coding quality data of historical video frames is as follows: obtaining at least one of the following: the first blurriness of the source image of the historical video frame, the second blurriness of the reconstructed image of the historical video frame, the average subjective opinion score, and the number of macroblocks with block artifacts in the reconstructed image of the historical video frame, to obtain the coding quality data. Based on this, the specific process for obtaining the image attribute data of the current video frame in this embodiment is as follows: obtaining the third blurriness of the source image of the current video frame. It is easy to understand that the source image is the image without coding processing, and the reconstructed image is the image after coding and reconstruction. Different coding quality data can be calculated using different algorithms, and this embodiment does not limit this. For example, algorithm models for blurriness (first blurriness, second blurriness, third blurriness) include the Blur model, the Blur* model, and the DT_Blur model; algorithm models for block artifacts include the BlockNum model and the BlockRate model.

[0059] Existing Blur models are generally used to calculate the average pixel distance at the point of a step change in the Y component of an image (the step change boundary is calculated by the Sobel operator). Physically, it represents the width of consecutive pixels in flat regions and is typically used to describe the blur intensity of the image (a larger value indicates greater blur). However, in the Blur model's thresholding process, the abrupt change threshold is fixed, making it less likely to trigger boundary conditions for darker images. This ultimately leads to inaccurate judgments about image blur. To accommodate darker images, this embodiment replaces the Blur model with the Blur* model, dynamically setting the abrupt change threshold based on the image content (e.g., setting it to 1 / 5 of the maximum brightness). Results show that the Blur* algorithm can more accurately determine whether an image is blurred.

[0060] Furthermore, the BlockNum model calculates the number of macroblocks with block artifacts that affect subjective quality due to encoding, based on the Y component of the reconstructed image. Specifically, it identifies blocks with low high-frequency components within each block, inter-block steps within a threshold range, and clustered together. These numbers are then weighted according to their screen space coordinates, resulting in a sum. Larger values ​​indicate a greater number of block artifacts affecting subjective quality, requiring more bits to be allocated. Analysis reveals that users find it difficult to tolerate video images with significant block artifacts. Therefore, accurately measuring the block artifacts of encoded video frames and promptly adjusting the encoding quality of frames that will produce block artifacts can save bitrate while ensuring video quality.

[0061] S12: Determine encoding control parameters based on the encoding quality data and the image attribute data, so as to adjust the encoding quality of the current video frame using the encoding control parameters; wherein, the value of the encoding control parameters is negatively correlated with the encoding quality.

[0062] In this embodiment, after obtaining the encoding quality data of historical video frames and the image attribute data of the current video frame, encoding control parameters are determined based on the encoding quality data and the image attribute data to regulate the encoding quality of the current video frame. Further, it is determined whether the encoding quality data meets a first preset condition and whether the image attribute data meets a second preset condition. If so, the encoding control parameter is set to a value less than a first threshold. The encoding control parameter can be a quantization parameter (QP), a key parameter used to control the quantization step size and encoding quality during video image encoding. The quantization parameter corresponding to the encoding control parameter is denoted as QP1. Furthermore, the value of the encoding control parameter is negatively correlated with encoding quality; that is, the smaller the QP1 of the encoding control parameter, the better the encoding quality. Therefore, a suitable QP1 can be determined based on the encoding quality data of historical video frames and the image attribute data of the current video frame. If the encoding quality data of historical video frames and the image attribute data of the current video frame indicate that encoding the current video frame is difficult, then QP1 can be appropriately lowered, and the encoding quality can be better when the encoding quality is adjusted by QP1.

[0063] To enable fine-grained evaluation of video coding quality, this embodiment constructs a bit allocation factor to determine the coding control parameters. For this purpose, the data obtained in step S11 includes: the first ambiguity of the source image of the historical video frame, the second ambiguity of the reconstructed image of the historical video frame, the average subjective opinion score, and the third ambiguity of the source image of the current video frame. Based on this, a first bitrate is calculated using the third ambiguity, and a second bitrate is calculated using the first and second ambiguities. The first bitrate is negatively correlated with the third ambiguity, and the second bitrate is positively correlated with the ratio of the second ambiguity to the first ambiguity.

[0064] In this embodiment, to correlate BLUR with bitrate, a Blur multiplier model (Alpha) and a Blur ratio model (Beta) are constructed. The first bitrate is derived from the Blur multiplier model. The Blur multiplier model calculates Blur*, called BlurIn, based on the Y component of the source image in the current video frame. The closer BlurIn is to 0, the clearer the image texture details and the more bits are consumed for encoding; the larger the BlurIn value, the coarser the image texture details. For example, when BlurIn is greater than 20, the number of bits consumed for encoding is still visually acceptable even at half the bitrate. The formula is expressed as:

[0065] .

[0066] Where k is the model parameter and m is a constant. Alpha characterizes the bitrate that should be used in the encoding process of the current video frame from the perspective of the source image blur (pre-encoding judgment).

[0067] The second bitrate is derived from the Blur ratio model. Blur*, calculated based on the Y component of the source image from historical video frames, is called BlurIn'; Blur*, calculated based on the Y component of the reconstructed image from historical video frames, is called BlurOut. BlurOut / BlurIn' describes the degree of image blurring caused by encoding. When the reconstructed image is too blurry, more bits are needed for the next encoding iteration; conversely, fewer bits are needed when the reconstructed image is less blurry. The formula is expressed as:

[0068] .

[0069] Where k is an empirical constant. Beta characterizes the relationship between the blur caused by encoding and the bit rate from the perspective of the blur of the reconstructed image (judged after encoding).

[0070] Furthermore, the average subjective opinion score is obtained based on the high-order objective quality model (Gama). Gama is an image quality assessment model that combines PSNR (Peak Signal to Noise Ratio) and SSIM (Structural Similarity), and is the result of fitting a quadratic polynomial to MOS (subjective quality can be expressed as the average opinion score) using PSNR and SSIM. The formula is expressed as:

[0071] .

[0072] A higher Gama value indicates better image quality, and more bits should be used. Gama establishes the relationship between objective video quality and subjective video quality.

[0073] Finally, a bit allocation factor is determined based on the first bitrate, the second bitrate, and the average subjective opinion score, and the encoding control parameters are obtained through this bit allocation factor. Specifically, the bit allocation factor is determined based on a pre-constructed bitrate decision model (Factor). That is, by combining Alpha, Beta, and Gama, the bitrate decision model Factor can be obtained. Here, Alpha represents the baseline ratio, Beta represents the increment ratio, and Gama represents the correction ratio. When the Factor is large, more bits should be allocated to the frame to ensure subjective quality; conversely, fewer bits can be allocated. The formula is expressed as:

[0074] .

[0075] As can be seen, this embodiment first acquires the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein, the image attribute data reflects the texture features of the video frame; then, encoding control parameters are determined based on the encoding quality data and the image attribute data, so as to regulate the encoding quality of the current video frame using the encoding control parameters; wherein, the value of the encoding control parameter is negatively correlated with the encoding quality. This embodiment, while considering the encoding quality of historical video frames, also considers the image attributes reflecting the texture features of the current video frame, comprehensively determining the corresponding encoding control parameters. These encoding control parameters are used to regulate the encoding quality of the current video frame, which is negatively correlated with their values, resulting in low network bandwidth consumption for the encoded current video frame and achieving a significant saving in bitrate.

[0076] Figure 2 A flowchart illustrating a stream-guided encoding method provided in this application embodiment. See also... Figure 2 As shown, the encoding method includes:

[0077] S21: Obtain the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame.

[0078] S22: Determine encoding control parameters based on the encoding quality data and the image attribute data; wherein, the value of the encoding control parameters is negatively correlated with the encoding quality.

[0079] In this embodiment, the specific processes of steps S21 and S22 can be referred to the corresponding contents disclosed in the foregoing embodiments, and will not be repeated here.

[0080] S23: Determine network control parameters based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with coding quality.

[0081] In this embodiment, the control parameters that ultimately regulate the encoding quality of the current video frame, in addition to referring to the encoding control parameters, also need to consider the network environment; that is, the network control parameters also need to be determined based on the current network conditions. Similarly, the network control parameters can also be quantization parameters QP, and the corresponding quantization parameters are represented as QP2. Compared to the encoding control parameters, which are determined based on the encoding difficulty of the video frame itself, the network control parameters are suitable quantization parameters QP2 determined based on the network conditions. The value of the network control parameters is negatively correlated with encoding quality; that is, the larger the value of the network control parameter QP2, the worse the encoding quality of the current video frame.

[0082] S24: The parameter with the larger value among the network control parameters and the encoding control parameters is determined as the final control parameter, so as to adjust the encoding quality of the current video frame using the final control parameter.

[0083] In this embodiment, after obtaining the encoding control parameters and the network control parameters, the parameter with the larger value among the network control parameters and the encoding control parameters is determined as the final control parameter. This final control parameter is used to adjust the encoding quality of the current video frame. That is, the final control parameter determined based on QP1 and QP2 is max(QP1, QP2). When QP1 is greater than QP2, it indicates a good network condition, and QP1 can be configured to reduce the bitrate while maintaining video quality. When QP1 is less than QP2, it indicates a poor network condition, and the network bandwidth is insufficient to provide good video quality. In this case, configuring QP2 can reduce network bandwidth pressure and comply with the system's network adjustments. The above process is a bitrate-driven QP decision.

[0084] As can be seen, this embodiment of the application determines the encoding control parameters based on the encoding quality data of historical video frames and the image attribute data of the current video frame, further determines the network control parameters based on the current network conditions, and then decides on a final control parameter based on the relationship between the network control parameters and the encoding control parameters. The above-mentioned bitstream-oriented QP decision can comprehensively consider the network conditions and the encoding difficulty of video frames, reducing the bitstream while ensuring video quality.

[0085] Figure 3 A flowchart illustrating a quality-oriented encoding method provided in an embodiment of this application. See also... Figure 3 As shown, the encoding method includes:

[0086] S31: Determine network control parameters based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with coding quality.

[0087] In this embodiment, the specific process of step S31 can be referred to the corresponding content disclosed in the previous embodiments, and will not be repeated here.

[0088] S32: Obtain the structural similarity index value between the source image and the reconstructed image of the historical video frame, the third ambiguity of the reconstructed image of the current video frame, and the proportion of macroblocks with block effects in the reconstructed image of the historical video frame.

[0089] S33: Determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, determine that the source image of the current video frame does not meet the coding optimization condition.

[0090] S34: If not, the encoding quality of the current video frame is directly adjusted using the network control parameters.

[0091] In this embodiment, steps S32 and S33 aim to determine whether the source image of the current video frame meets the encoding optimization conditions. For some video frames, the source image is right at the edge of sharpness and blurriness. Slight adjustments to QP1 will cause blurriness and color blocks in the image. For such blurry images, instead of optimizing through QP1, the image quality is directly adjusted using QP2 provided by the system network. Therefore, it is necessary to determine from the blurriness level whether the current video frame can have its image quality adjusted through QP1. If not, the encoding quality of the current video frame is directly adjusted using the network control parameters.

[0092] Specifically, the structural similarity index (SSIM) between the source image and the reconstructed image of the historical video frame, the third ambiguity of the source image of the current video frame, and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame are first obtained. Then, it is determined whether the structural similarity index, the second ambiguity, and the macroblock proportion all meet a third preset condition. If not, it is determined that the source image of the current video frame does not meet the coding optimization conditions. That is, the main indices used are SSIM, ambiguity, and block artifacts.

[0093] In this embodiment, the third blur is calculated using the DT_Blur model, and the block effect is calculated using the BlockRate model. The value of the third blur is represented by DT_Blur, and the proportion of macroblocks with block effects is represented by BlockRate. DT_Blur is related to the Y component of the source image of the current video frame. Its calculation method is similar to Blur, using a first-order gradient operator to calculate the image gradient and taking the average value of the gradient. This method is faster than Blur, and its physical meaning describes the blur intensity of the image itself (the smaller the value, the more blurred). BlockRate is related to BlockNum and represents the proportion of blocks with block effects in the video frame, expressed by the formula:

[0094] .

[0095] Where totalBlock=(width / 16-1)*(height / 16-1) represents the total number of macroblocks, and width and height represent the width and height of the image.

[0096] Based on this, blurred images are identified by setting thresholds for SSIM, DT_Blur, and BlockRate. For images that are identified as blurred, that is, if the result of "judging whether the structural similarity index value, the third blur, and the macroblock ratio all meet the third preset condition" (the result of comparing with the threshold) is no, then QP2 is used directly to avoid obvious color blocks appearing in the image.

[0097] As can be seen, this embodiment of the application determines whether the source image of the current video frame meets the coding optimization conditions by obtaining indicators such as the structural similarity index value between the source image and the reconstructed image of the historical video frame, the third ambiguity of the source image of the current video frame, and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame. If the coding optimization conditions are not met, the coding quality of the current video frame is directly adjusted using network control parameters. The above-mentioned image quality-oriented fuzzy image processing decision can distinguish the source image. For fuzzy images, the coding quality is directly adjusted using the network control parameters provided by the system network to avoid obvious color blocks in the image.

[0098] Figure 4 A flowchart illustrating a user-demand-oriented coding method provided in an embodiment of this application. See also... Figure 4 As shown, the encoding method includes:

[0099] S41: Obtain the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame.

[0100] S42: Determine encoding control parameters based on the encoding quality data and the image attribute data; wherein, the value of the encoding control parameters is negatively correlated with the encoding quality.

[0101] S43: Determine network control parameters based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with coding quality.

[0102] S44: The parameter with the larger parameter value among the network control parameters and the coding control parameters is determined as the final control parameter.

[0103] In this embodiment, the specific process of steps S41 to S44 can be referred to the corresponding content disclosed in the previous embodiments, and will not be repeated here.

[0104] S45: Configure the control level according to the target requirements, wherein the control level reflects the degree of mapping of the control parameters.

[0105] S46: If the control level is the first level, the encoding quality of the current video frame is directly controlled using the network control parameters.

[0106] S47: If the control level is the second level, then perform the step of controlling the encoding quality of the current video frame using the final control parameters.

[0107] In this embodiment, considering that different users have different definitions and tolerance levels for ambiguity, it is necessary to adjust the settings as needed to accommodate the visual experience of different users. Specifically, this is achieved by configuring the adjustment level according to the target requirements, where the adjustment level reflects the mapping degree of the control parameters. That is, the higher the adjustment level, the greater the adjustment of QP, and the more obvious the bitrate saving effect. If the adjustment level is the first level, the encoding quality of the current video frame is directly adjusted using the network control parameters. If the adjustment level is the second level, the step of adjusting the encoding quality of the current video frame using the final control parameters is executed. When the user sets the adjustment level to the first level, the QP1 optimization adjustment scheme is turned off, and the encoding adjustment is performed entirely according to the QP2 given by the system. When the user sets the adjustment level to the second level, the bitrate optimization method combining QP1 and QP2 is activated. The first and second levels in this embodiment are only examples; a higher level than the second level can be set to increase the adjustment intensity.

[0108] Figure 5 and Figure 6 The images show the encoding effects of Level 1 and Level 2 in Windows 10, compared to before optimization. Figure 6 In this test, the bitrate was reduced by 37.7%, 23.6%, 18.8%, and 26.9% respectively across four video workloads (average 26.7%), with an average CPU utilization increase of 1.7% in actual measurements. Furthermore, to better ensure image quality, Figure 5 The bitrate saving is slightly lower than level 2, and the bitrate saving varies depending on the video characteristics. In terms of image quality, compared to before optimization, Figure 6 The No Reference Image Quality Evaluation (NIQE) metric (lower is better) shows only fractional differences and no significant distinction.

[0109] As can be seen, this embodiment, based on the determined encoding control parameters and network control parameters, considers the different definitions and tolerance levels of ambiguity among different users and adds a step of configuring the adjustment level according to the target requirements. At the first level, the encoding quality of the current video frame is directly adjusted using the network control parameters. At the second level, the encoding quality of the current video frame is adjusted using the final control parameters obtained from the encoding control parameters and network control parameters. This user-demand-oriented level setting decision can take into account the visual experience of different users and has a better user experience.

[0110] Figure 7A flowchart of a resource-oriented coding method provided in this application embodiment is shown below. Figure 7 As shown, the encoding method includes:

[0111] S51: Obtain the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame.

[0112] S52: Determine encoding control parameters based on the encoding quality data and the image attribute data, so as to adjust the encoding quality of the current video frame using the encoding control parameters; wherein, the value of the encoding control parameters is negatively correlated with the encoding quality.

[0113] In this embodiment, the specific processes of steps S51 and S52 described above can be found in the corresponding content disclosed in the previous embodiments, and will not be repeated here. It should be noted that in this embodiment, the historical video frame is the video frame preceding the current video frame. When the historical video frame is the video frame preceding the current video frame, after encoding the current video frame, its encoding quality data also needs to be updated. Specifically, the encoding quality data of the preceding video frame is obtained by updating the encoding quality data once every preset number of frames using a fixed window method. The specific steps are as follows.

[0114] S53: The number of macroblocks with block effects is updated once every first preset number of frames using a fixed window, and the coding quality data other than the number of macroblocks with block effects is updated once every second preset number of frames using a fixed window; wherein the first preset number of frames is less than the second preset number of frames.

[0115] In this embodiment, calculating encoding quality data for each frame allows for timely responses to the encoding status, but it significantly increases computational load and CPU utilization. To optimize performance and reduce computational overhead, based on the temporal locality between video frames, all encoding quality data is updated every several frames (e.g., 10 frames), thereby significantly reducing the overall computational complexity of the system. Specifically, after encoding the current video frame, on the one hand, the number of macroblocks with block artifacts is updated every first preset number of frames using a fixed window method; on the other hand, the encoding quality data excluding the number of macroblocks with block artifacts is updated every second preset number of frames using a fixed window method.

[0116] In this step, the first preset frame number is less than the second preset frame number. Considering that updating data every few frames in a fixed window manner is not conducive to timely response to unexpected situations, analysis revealed that the deterioration in image quality caused by unexpected situations is often due to block artifacts in certain images. This embodiment increases the update frequency of indicators that reflect image block artifacts (e.g., once every 5 frames), and this update takes effect immediately. The above process can ensure image quality while responding promptly to abnormal situations.

[0117] As can be seen, this embodiment considers that if all calculations are concentrated on the same frame, although it can accurately reflect the encoding situation of the previous frame, it cannot reflect the changes in the encoding situation over a recent period of time, and for the current frame, it is easy to cause long-tail latency and screen stuttering. To solve this problem, this embodiment updates the number of macroblocks with block effects every first preset number of frames using a fixed window method, and updates the encoding quality data other than the number of macroblocks with block effects every second preset number of frames using a fixed window method. By reasonably balancing the calculation of these data across multiple video frames, it can not only reflect changes in the encoding situation, but also avoid screen stuttering caused by long-tail latency.

[0118] The following example illustrates the technical solution in this application: playing a high-definition 1080P video in full screen on a VDI system. The specific framework is as follows: Figure 8 As shown.

[0119] Playing full-screen 1080p high-definition video requires a huge amount of data traffic and network bandwidth. However, in a wide area network (WAN) environment, intense bandwidth competition often leaves users with limited bandwidth resources, posing a significant challenge to playing full-screen 1080p high-definition video on VDI systems. Figure 9 As shown, in order to fully utilize network bandwidth, most VDI products typically use a frame control quality control strategy that dynamically sets the QP based solely on network conditions, and then uses the video image encoding module to encode the source video frames. However, this frame control quality control strategy ignores the impact of video encoding characteristics on the bitstream, which is detrimental to saving bitstream and network bandwidth.

[0120] In comparison, the framework for full-screen video coding under flexible bandwidth in this application is as follows: Figure 8As shown, two key steps have been added: QP control and coding quality assessment. The coding quality assessment module performs a fine-grained evaluation of the quality of the encoded video frames after encoding (including source image blurriness, reconstructed image block effects, image blur caused by encoding, encoded image quality, and encoding bit allocation), providing sufficient data support for subsequent encoding optimization and avoiding significant image quality degradation caused by encoding. When encoding subsequent video frames, the QP controller calculates the most suitable coding control parameter QP1 for encoding the current video frame based on the content and coding quality of previous video frames and the coding difficulty of the current video frame. Finally, QP selection is performed by combining the coding control parameter QP1 and the network control parameter QP2 to select the most suitable QP under the current network conditions. Therefore, considering the strong temporal locality between video frames, in order to improve the bandwidth competitiveness of VDI products in poor network environments and save bandwidth costs, this application's flexible bandwidth full-screen video coding method significantly reduces the bitstream and bandwidth requirements for full-screen playback of high-definition 1080P video while ensuring acceptable subjective quality, thereby improving the user's video experience.

[0121] See Figure 10 As shown in the embodiments, this application also discloses an encoding device, including:

[0122] The data acquisition module 11 is used to acquire the encoding quality data of historical video frames and the picture attribute data of the current video frame; wherein the picture attribute data reflects the texture features of the video frame.

[0123] The control module 12 is used to determine the encoding control parameters based on the encoding quality data and the image attribute data, so as to control the encoding quality of the current video frame using the encoding control parameters; wherein the value of the encoding control parameters is negatively correlated with the encoding quality.

[0124] As can be seen, this embodiment first acquires the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein, the image attribute data reflects the texture features of the video frame; then, encoding control parameters are determined based on the encoding quality data and the image attribute data, so as to regulate the encoding quality of the current video frame using the encoding control parameters; wherein, the value of the encoding control parameter is negatively correlated with the encoding quality. This embodiment, while considering the encoding quality of historical video frames, also considers the image attributes reflecting the texture features of the current video frame, comprehensively determining the corresponding encoding control parameters. These encoding control parameters are used to regulate the encoding quality of the current video frame, which is negatively correlated with their values, resulting in low network bandwidth consumption for the encoded current video frame and achieving a significant saving in bitrate.

[0125] In some specific embodiments, the data acquisition module 11 specifically includes:

[0126] The first data acquisition unit is used to acquire at least one of the following: the first ambiguity of the source image of the historical video frame, the second ambiguity of the reconstructed image of the historical video frame, the average subjective opinion score, and the number of macroblocks with block effects in the reconstructed image of the historical video frame, so as to obtain the coding quality data.

[0127] The second data acquisition unit is used to acquire the third blur of the source image of the current video frame in order to obtain the image attribute data of the current video frame.

[0128] In some specific embodiments, the determining control module 12 specifically includes:

[0129] The first determining unit is used to determine whether the encoding quality data meets the first preset condition and whether the image attribute meets the second preset condition. If so, the encoding control parameter is set to a value less than the first threshold.

[0130] The second determining unit is configured to calculate a first code rate using the third ambiguity and calculate a second code rate using the first ambiguity and the second ambiguity; wherein the first code rate is negatively correlated with the third ambiguity, and the second code rate is positively correlated with the ratio of the second ambiguity to the first ambiguity; and to determine a bit allocation factor based on the first code rate, the second code rate and the average subjective opinion, so as to obtain the encoding control parameter through the bit allocation factor.

[0131] In some specific embodiments, the encoding device further includes:

[0132] The judgment and control module is used to determine whether the source image of the current video frame meets the coding optimization conditions. If not, the coding quality of the current video frame is directly controlled by the network control parameters.

[0133] A network determination module is used to determine network control parameters based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with the coding quality.

[0134] The comparison and adjustment module is used to determine the parameter with the larger parameter value among the network control parameters and the encoding control parameters as the final control parameter, so as to adjust the encoding quality of the current video frame using the final control parameter.

[0135] In some specific embodiments, the judgment and control module specifically includes:

[0136] The acquisition unit is used to acquire the structural similarity index value between the source image and the reconstructed image of the historical video frame, the third ambiguity of the source image of the current video frame, and the proportion of macroblocks with block effects in the reconstructed image of the historical video frame.

[0137] The judgment unit is used to determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, it is determined that the source image of the current video frame does not meet the coding optimization condition.

[0138] In some specific embodiments, the encoding device further includes:

[0139] A configuration module is used to configure the control level according to the target requirements, wherein the control level reflects the degree of mapping of the control parameters;

[0140] The first-level control module is used to directly control the encoding quality of the current video frame using the network control parameters if the control level is the first level.

[0141] The second-level control module is used to perform the step of controlling the encoding quality of the current video frame using the final control parameters if the control level is the second level.

[0142] In some specific embodiments, when the historical video frame is the video frame preceding the current video frame, the encoding quality data of the preceding video frame is obtained by updating the encoding quality data every preset number of frames using a fixed window method. The encoding device further includes:

[0143] The update module is used to update the number of macroblocks with block effects once every first preset number of frames using a fixed window, and to update the encoding quality data other than the number of macroblocks with block effects once every second preset number of frames using a fixed window; wherein the first preset number of frames is less than the second preset number of frames.

[0144] Furthermore, embodiments of this application also provide an electronic device. Figure 11 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0145] Figure 11This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the encoding method disclosed in any of the foregoing embodiments.

[0146] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0147] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0148] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. It can be Windows Server, Netware, Unix, Linux, etc. The computer program 222, in addition to including computer programs capable of performing the encoding methods disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data such as encoding quality and screen attributes collected by the electronic device 20.

[0149] Furthermore, this application also discloses a storage medium storing a computer program, which, when loaded and executed by a processor, implements the encoding method steps disclosed in any of the foregoing embodiments.

[0150] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0151] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0152] The encoding method, apparatus, device, and storage medium provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An encoding method, characterized in that, include: Acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame; Encoding control parameters are determined based on the encoding quality data and the image attribute data, so as to adjust the encoding quality of the current video frame using the encoding control parameters; wherein, the value of the encoding control parameters is negatively correlated with the encoding quality; Before determining the encoding control parameters based on the encoding quality data and the image attribute data, the method further includes: Determine whether the source image of the current video frame meets the coding optimization conditions. If not, directly adjust the coding quality of the current video frame using network control parameters. The network control parameters are determined based on the current network conditions, and the source image of the current video frame represents an image that has not undergone coding processing. The step of determining whether the source image of the current video frame meets the coding optimization conditions includes: The structural similarity index value between the source image and the reconstructed image of the historical video frame is obtained, as well as the third ambiguity of the source image of the current video frame and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame; wherein, the reconstructed image represents the image after encoding and reconstruction. Determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, determine that the source image of the current video frame does not meet the coding optimization condition.

2. The encoding method according to claim 1, characterized in that, The acquisition of encoding quality data of historical video frames and image attribute data of the current video frame includes: The coding quality data is obtained by acquiring at least one of the following: the first ambiguity of the source image of the historical video frame, the second ambiguity of the reconstructed image of the historical video frame, the average subjective opinion score, and the number of macroblocks with block effects in the reconstructed image of the historical video frame. Obtain the third blur of the source image of the current video frame to obtain the image attribute data of the current video frame.

3. The encoding method according to claim 1, characterized in that, The acquisition of encoding quality data of historical video frames and image attribute data of the current video frame includes: The first ambiguity of the source image of the historical video frame, the second ambiguity of the reconstructed image of the historical video frame, the average subjective opinion score, and the third ambiguity of the source image of the current video frame are obtained. Accordingly, determining the encoding control parameters based on the encoding quality data and the image attribute data includes: A first bitrate is calculated using the third ambiguity, and a second bitrate is calculated using the first ambiguity and the second ambiguity; wherein the first bitrate is negatively correlated with the third ambiguity, and the second bitrate is positively correlated with the ratio of the second ambiguity to the first ambiguity; A bit allocation factor is determined based on the first bit rate, the second bit rate, and the average subjective opinion score, so as to obtain the encoding control parameters through the bit allocation factor.

4. The encoding method according to claim 1, characterized in that, The step of determining the encoding control parameters based on the encoding quality data and the image attribute data includes: Determine whether the encoding quality data meets the first preset condition and whether the image attributes meet the second preset condition. If so, set the encoding control parameter to a value less than the first threshold.

5. The encoding method according to claim 2, characterized in that, The historical video frame is the video frame preceding the current video frame. The encoding quality data of the preceding video frame is obtained by updating the encoding quality data once every preset number of frames using a fixed window method.

6. The encoding method according to claim 5, characterized in that, The encoding quality data is updated every preset number of frames using a fixed window method, including: The number of macroblocks with block effects is updated once every first preset number of frames using a fixed window method, and the encoding quality data other than the number of macroblocks with block effects is updated once every second preset number of frames using a fixed window method; wherein the first preset number of frames is less than the second preset number of frames.

7. An encoding method, characterized in that, include: Acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame; Encoding control parameters are determined based on the encoding quality data and the image attribute data; wherein, the value of the encoding control parameters is negatively correlated with the encoding quality. The network control parameters are determined based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with the coding quality. The parameter with the larger value among the network control parameters and the encoding control parameters is determined as the final control parameter, so as to adjust the encoding quality of the current video frame using the final control parameter; Before determining the encoding control parameters based on the encoding quality data and the image attribute data, the method further includes: Determine whether the source image of the current video frame meets the coding optimization conditions. If not, directly adjust the coding quality of the current video frame using network control parameters. The network control parameters are determined based on the current network conditions, and the source image of the current video frame represents an image that has not undergone coding processing. The step of determining whether the source image of the current video frame meets the coding optimization conditions includes: The structural similarity index value between the source image and the reconstructed image of the historical video frame is obtained, as well as the third ambiguity of the source image of the current video frame and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame; wherein, the reconstructed image represents the image after encoding and reconstruction. Determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, determine that the source image of the current video frame does not meet the coding optimization condition.

8. An encoding method, characterized in that, include: Acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame; Encoding control parameters are determined based on the encoding quality data and the image attribute data; wherein, the value of the encoding control parameters is negatively correlated with the encoding quality. The network control parameters are determined based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with the coding quality. The parameter with the larger value among the network control parameters and the coding control parameters is determined as the final control parameter; Configure control levels according to target needs; If the control level is the first level, the encoding quality of the current video frame is directly controlled using the network control parameters; If the control level is the second level, then the step of controlling the encoding quality of the current video frame using the final control parameters is performed; Before determining the encoding control parameters based on the encoding quality data and the image attribute data, the method further includes: Determine whether the source image of the current video frame meets the coding optimization conditions. If not, directly adjust the coding quality of the current video frame using network control parameters. The network control parameters are determined based on the current network conditions, and the source image of the current video frame represents an image that has not undergone coding processing. The step of determining whether the source image of the current video frame meets the coding optimization conditions includes: The structural similarity index value between the source image and the reconstructed image of the historical video frame is obtained, as well as the third ambiguity of the source image of the current video frame and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame; wherein, the reconstructed image represents the image after encoding and reconstruction. Determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, determine that the source image of the current video frame does not meet the coding optimization condition.

9. An encoding device, characterized in that, include: The data acquisition module is used to acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame. The control module is used to determine encoding control parameters based on the encoding quality data and the image attribute data, so as to adjust the encoding quality of the current video frame using the encoding control parameters; wherein the value of the encoding control parameters is negatively correlated with the encoding quality; The judgment and control module is used to determine whether the source image of the current video frame meets the coding optimization conditions. If not, the coding quality of the current video frame is directly adjusted using network control parameters. The network control parameters are determined based on the current network conditions, and the source image of the current video frame represents an image that has not undergone coding processing. The judgment and control module includes: The acquisition unit is used to acquire the structural similarity index value between the source image and the reconstructed image of the historical video frame, the third ambiguity of the source image of the current video frame, and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame; wherein, the reconstructed image represents the image after encoding and reconstruction. The judgment unit is used to determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, it is determined that the source image of the current video frame does not meet the coding optimization condition.

10. An encoding device, characterized in that, include: The data acquisition module is used to acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame. The control module is used to determine encoding control parameters based on the encoding quality data and the image attribute data; wherein the value of the encoding control parameters is negatively correlated with the encoding quality. A network determination module is used to determine network control parameters based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with coding quality. The comparison and adjustment module is used to determine the parameter with the larger parameter value among the network control parameters and the encoding control parameters as the final control parameter, so as to adjust the encoding quality of the current video frame using the final control parameter; The judgment and control module is used to determine whether the source image of the current video frame meets the coding optimization conditions. If not, the coding quality of the current video frame is directly adjusted using network control parameters. The network control parameters are determined based on the current network conditions, and the source image of the current video frame represents an image that has not undergone coding processing. The judgment and control module includes: The acquisition unit is used to acquire the structural similarity index value between the source image and the reconstructed image of the historical video frame, the third ambiguity of the source image of the current video frame, and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame; wherein, the reconstructed image represents the image after encoding and reconstruction. The judgment unit is used to determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, it is determined that the source image of the current video frame does not meet the coding optimization condition.

11. An encoding device, characterized in that, include: The data acquisition module is used to acquire the encoding quality data of historical video frames and the image attribute data of the current video frame; wherein the image attribute data reflects the texture features of the video frame. The control module is used to determine encoding control parameters based on the encoding quality data and the image attribute data; wherein the value of the encoding control parameters is negatively correlated with the encoding quality. A network determination module is used to determine network control parameters based on the current network conditions; wherein the values ​​of the network control parameters are negatively correlated with coding quality. The comparison and control module is used to determine the parameter with the larger parameter value among the network control parameters and the coded control parameters as the final control parameter; The configuration module is used to configure the control level according to target requirements; The first-level control module is used to directly control the encoding quality of the current video frame using the network control parameters if the control level is the first level. The second-level control module is used to perform the step of controlling the encoding quality of the current video frame using the final control parameters if the control level is the second level. The judgment and control module is used to determine whether the source image of the current video frame meets the coding optimization conditions. If not, the coding quality of the current video frame is directly adjusted using network control parameters. The network control parameters are determined based on the current network conditions, and the source image of the current video frame represents an image that has not undergone coding processing. The judgment and control module includes: The acquisition unit is used to acquire the structural similarity index value between the source image and the reconstructed image of the historical video frame, the third ambiguity of the source image of the current video frame, and the proportion of macroblocks with block artifacts in the reconstructed image of the historical video frame; wherein, the reconstructed image represents the image after encoding and reconstruction. The judgment unit is used to determine whether the structural similarity index value, the third ambiguity, and the macroblock ratio all meet the third preset condition. If not, it is determined that the source image of the current video frame does not meet the coding optimization condition.

12. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the encoding method as described in any one of claims 1 to 6, or the encoding method as described in claim 7, or the encoding method as described in claim 8.

13. A computer-readable storage medium, characterized in that, Used to store computer-executable instructions, which, when loaded and executed by a processor, implement the encoding method as described in any one of claims 1 to 6, or the encoding method as described in claim 7, or the encoding method as described in claim 8.