Coding parameter determination method and apparatus, electronic device and storage medium

By analyzing the code stream, the image to be decoded and the information to be decoded are obtained, and the encoding parameters are determined using the decode parameters, which solves the instability and high cost problems caused by fluctuations in the video encoding kernel, and achieves more stable video encoding and reduces server load.

WO2025152642A1PCT designated stage expired Publication Date: 2025-07-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/136876
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-15
Filing Date
2024-12-04
Publication Date
2025-07-24

AI Technical Summary

Technical Problem

The existing technology consumes a large fluctuation in computing resources in video encoding, resulting in unstable frame output of video encoding kernels and increasing server deployment costs. Especially in scenarios such as live broadcast, real-time communication and cloud rendering, it is difficult to effectively schedule computing resources to ensure picture stability.

Method used

By analyzing the code stream, the images to be decoded and the decoded information are obtained, the encoding parameters are determined using the parameters in the decoded information to reduce the computational complexity, avoid high consumption algorithms, improve the stability of the encoding kernel output frames and reduce server costs.

Benefits of technology

It improves the stability of the output frame of the video encoding kernel, reduces the deployment cost of the server, and ensures the stable performance of video encoding in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024136876_24072025_PF_FP_ABST
    Figure CN2024136876_24072025_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a coding parameter determination method and apparatus, an electronic device and a storage medium. The method relates to the technical field of video coding and decoding, and the method comprises: parsing a code stream to acquire an image to be decoded and decoding information (S410); using the decoding information to decode said image so as to obtain a reconstructed image (S420); and, on the basis of decoding parameters in the decoded information, determining coding parameters for re-coding the reconstructed image (S430). The method can improve the stability of output frames of coding kernels and reduce the deployment cost of servers.
Need to check novelty before this filing date? Find Prior Art

Description

Coding parameter determination method, device, electronic device and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on January 15, 2024, with application number 202410052407.2 and invention name “Coding Parameter Determination Method, Device, Electronic Device and Storage Medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of coding and decoding technology, and more specifically, to a method, device, electronic device and storage medium for determining coding parameters. Background Art

[0003] Scenarios such as live streaming, real-time communication (RTC), cloud rendering, and cloud desktops all place high demands on the stability of the output frames of the video encoding kernel.

[0004] Typically, the computational resources consumed by a video encoding kernel are related to the complexity of the video image.

[0005] For example, static images with small changes in motion texture are easier to compress and consume relatively few computing resources. However, compressing images with complex motion textures consumes more computing resources. If the texture of the compressed video is complex and the scene switching is frequent, the computing resources consumed by the video encoding compression will fluctuate greatly.

[0006] However, when computing resources fluctuate greatly, the consumption of the server's central processing unit (CPU) will also fluctuate greatly. When the CPU consumption fluctuates greatly, it will not only affect the stability of the output frame, especially for scenarios such as live broadcast, RTC, cloud rendering, and cloud desktop, but also increase the deployment cost of the server. The reason is that in terms of computing resource orchestration and scheduling, more computing resources must be reserved as buffer space to cope with computing resource fluctuations when video scenes are switched. For example, if a server runs 10 live video encoding streams at the same time, the CPU should be controlled within 50% as much as possible during scheduling to prevent the server computing resources from being overloaded due to the simultaneous upward fluctuation of computing resource consumption when the pictures of these 10 video encoding streams are switched to complex texture scenes at the same time, so as to ensure the stability of the output frames of video encoding.

[0007] Therefore, how to reduce the fluctuation of computing resource consumption, thereby improving the stability of the output frames of the encoding kernel and reducing the deployment cost of the server is a technical problem that needs to be solved urgently in this field. Summary of the Invention

[0008] The embodiments of the present application provide a method, device, electronic device, and storage medium for determining coding parameters, which can improve the stability of the output frames of the coding core and reduce the deployment cost of the server.

[0009] In a first aspect, an embodiment of the present application provides a method for determining a coding parameter, including:

[0010] Parse the code stream to obtain the image to be decoded and decoding information;

[0011] Decoding the image to be decoded using the decoding information to obtain a reconstructed image;

[0012] Based on the decoding parameters in the decoding information, encoding parameters for re-encoding the reconstructed image are determined.

[0013] In a second aspect, an embodiment of the present application provides a device for determining a coding parameter, including:

[0014] A parsing unit, used for parsing the code stream to obtain the image to be decoded and decoding information;

[0015] A decoding unit, configured to decode the image to be decoded using the decoding information to obtain a reconstructed image;

[0016] The determining unit is configured to determine encoding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0018] a processor adapted to implement computer instructions; and,

[0019] A computer-readable storage medium stores computer instructions, wherein the computer instructions are suitable for being loaded by a processor and executing the method of the first aspect mentioned above.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are read and executed by a processor of a computer device, the computer device executes the method of the first aspect involved above.

[0021] In a fifth aspect, embodiments of the present application provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method of the first aspect described above.

[0022] In a sixth aspect, an embodiment of the present application provides a code stream, which is generated by the method described in the first aspect mentioned above.

[0023] The coding parameter determination method provided in this application includes: parsing a bitstream to obtain an image to be decoded and decoding information; decoding the image to be decoded using the decoding information to obtain a reconstructed image; and determining coding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information. This method reduces the computational complexity of the coding parameters by reusing the decoding parameters in the decoding information when determining the coding parameters for the reconstructed image, thereby improving the stability of the output frames of the coding core and reducing server deployment costs.

[0024] It is worth noting that, under normal circumstances, the encoder will set some encoding-related processing algorithms and configurations (such as encoding complexity, bit rate, the number of reference frames for encoding cost estimation (lookahead), key picture group (KEY GOP) size, whether to enable B frames, encoding code control mode (i.e., the method of controlling the size of the encoder output stream), motion estimation-related algorithms, motion compensation-related algorithms, whether to enable relevant algorithms in pre-estimation, etc.) when applying. After these encoding kernel parameters are set, when the video source is input for encoding later, some encoding-related processing algorithms and configurations will not change adaptively. This is equivalent to the process of determining encoding parameters with high computing resource consumption (such as coding unit division, motion estimation, motion compensation, transformation, preprocessing, etc.) will also be fixed processes. In this embodiment, the encoding parameters are determined by the decoding parameters in the decoding information, avoiding the use of algorithms and configurations with high computing resource consumption to determine the encoding parameters. As a result, the computational complexity of the encoding parameters can be reduced, thereby improving the stability of the output frame of the encoding kernel and reducing the deployment cost of the server.

[0025] It should be noted that in other alternative embodiments, for the reconstructed image, the processes for determining encoding parameters that consume relatively large computing resources (such as coding unit division, motion estimation, motion compensation, transformation, preprocessing, etc.) can be adaptively trimmed based on the analysis results in the pre-analysis process (for example, the analysis results of the picture scene texture complexity or the analysis results of the picture scene analysis) or the detection results (for example, the detection results of the picture scene switching detection or the detection results of the picture texture detection), so as to reduce the computing resources consumed by video encoding compression at the expense of a certain DB-rate.

[0026] However, a major drawback of this type of solution is the lack of reuse of the decoded information of the reconstructed image. On the one hand, because pre-analysis is performed using already encoded images, the analysis or detection results may not be timely enough, resulting in a delay of several groups of pictures (GOPs). This means that even if the process used to determine the encoding parameters is adaptively tailored based on the analysis or detection results from the pre-analysis process, the untimely nature of the analysis or detection results may reduce the reference value of the analysis or detection results, thereby reducing the accuracy of the encoding parameters and the encoding performance of the encoder. On the other hand, excessive adaptive tailoring of the encoding parameter determination process can significantly impact video image quality, reduce image stability, and degrade encoding performance. In this embodiment, by reusing the decoding parameters in the decoded information, the computational complexity of the encoding parameters can be reduced, thereby improving the stability of the output frames of the encoding kernel and the encoding performance of the encoder. Furthermore, because the decoded information is real-time information used to decode the reconstructed image, the accuracy of the encoding parameters can be guaranteed when the encoding parameters used to re-encode the reconstructed image are determined based on the decoding parameters in the decoded information, thereby improving the encoding performance of the encoder. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0028] FIG1 is a schematic block diagram of a video encoding and decoding system involved in an embodiment of the present application.

[0029] FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application.

[0030] FIG3 is a schematic structural diagram of the relationship between the coding tree unit and the coding unit provided in the present application.

[0031] FIG4 is a schematic block diagram of a video decoder according to an embodiment of the present application.

[0032] FIG5 is a schematic diagram of a partitioning mode of PU and TU involved in an embodiment of the present application.

[0033] FIG6 is a schematic diagram of the principle of motion estimation involved in an embodiment of the present application.

[0034] FIG7 is a schematic diagram showing the principle of motion compensation according to an embodiment of the present application.

[0035] FIG8 is a schematic flowchart of a method for determining coding parameters provided in an embodiment of the present application.

[0036] FIG9 is another schematic flowchart of the coding parameter determination method provided in an embodiment of the present application.

[0037] FIG10 is a schematic diagram of using decoding parameters in an encoding kernel according to an embodiment of the present application.

[0038] FIG11 is a schematic block diagram of a coding parameter determination device provided in an embodiment of the present application.

[0039] FIG12 is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments provided by this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0041] The solution provided by this application relates to the field of digital compression technology.

[0042] Among them, digital video compression technology mainly compresses huge digital image video data for easy transmission and storage.

[0043] The solution provided in this application can be applied to the field of digital video coding technology.

[0044] Among them, the field of digital video coding technology includes but is not limited to at least one of the following: image coding and decoding field, video coding and decoding field, hardware video coding and decoding field, dedicated circuit video coding and decoding field, and real-time video coding and decoding field. In addition, the solution provided in this application can be combined with the following standards: Audio Video Coding Standard (AVS), second-generation AVS standard (AVS2) or third-generation AVS standard (AVS3). For example, including but not limited to: H.264 / Audio Video Coding (AVC) standard, H.265 / High Efficiency Video Coding (HEVC) standard and H.266 / Versatile Video Coding (VVC) standard. In addition, the solution provided in this application can be used for lossy compression of images, and can also be used for lossless compression of images. Among them, the lossless compression can be visually lossless compression or mathematically lossless compression.

[0045] To facilitate understanding of the technical solutions provided by this application, the relevant terms are explained below.

[0046] Instantaneous Decoding Refresh (IDR) frames: In video encoding algorithms, images are organized into sequences. The first image in a sequence is called an IDR frame, and IDR images are all I frames. IDR frames are also called IDR pictures.

[0047] I-frames: IDR frames cause the reference frame list (Decoded Picture Buffer, DPB) to be cleared, while I-frames do not. IDR images are always I-frames, but I-frames are not always IDR frames. A sequence can contain many I-frames, and frames following an I-frame can reference frames between them for motion reference.

[0048] P-frame: A forward predictive coded frame. A P-frame represents the difference between this frame and the previous keyframe (or P-frame). During decoding, the previously cached image is superimposed on the difference defined by this frame to generate the final image.

[0049] B-frame: A bidirectionally predicted interpolated coded frame. A B-frame is a bidirectional difference frame, which means that a B-frame records the difference between the current frame and the previous and next frames. A B-frame can be used as a reference frame for other B-frames, or it can not be used as a reference frame for other B-frames.

[0050] Quantization Parameter (QP): The rate control algorithm primarily outputs a target bitrate by adjusting the discrete cosine transform (DCT) quantization parameter. The QP reflects the compression of spatial detail. A low QP preserves most detail; a high QP loses some detail, lowers the bitrate, and increases image distortion and quality. In other words, QP and bitrate are inversely proportional, and this relationship becomes more pronounced as the complexity of the video source increases.

[0051] Intra-frame prediction: The predicted block is a block formed based on the coded reconstructed block and the current block.

[0052] Inter-frame prediction: mainly includes motion estimation (motion search method, motion estimation criteria, sub-pixel interpolation and motion vector estimation) and motion compensation, which is the reference and prediction interpolation compensation at the granularity of Group of Pictures (GOP).

[0053] Sum of Absolute Difference (SAD): the sum of absolute differences.

[0054] Sum of Absolute Error (SAE): the sum of absolute errors.

[0055] Sum of Absolute Transformed Difference (SATD): For example, the sum of absolute values ​​after Hadamard transformation.

[0056] Motion Compensation (MC): By predicting the motion trajectory of objects in the image and compensating for their displacement, the amount of data between consecutive images can be reduced.

[0057] Motion Estimation (ME): By finding the correlation between adjacent images and calculating the motion vector between blocks, redundant information in the time dimension is removed to further improve compression efficiency.

[0058] Lookahead: This function estimates the coding cost of images that have not yet been analyzed. It caches a certain configured length of previously encoded reconstructed images before the current image, providing a reference for inter-frame prediction. In other words, before the actual image data is encoded, a certain number of images are analyzed in advance, and the pre-analysis data is used to guide the subsequent encoding process.

[0059] BD-rate: One of the main parameters for evaluating the performance of video encoding algorithms, indicating the changes in bit rate and Peak Signal-to-Noise Ratio (PSNR) of the video encoded by the new algorithm compared to the original algorithm.

[0060] Group of pictures (GOP): The interval between two I-frames.

[0061] Minimum Group of Pictures (mini-GOP): In a GOP, there will be a certain amount of B frames between two P frames. The interval between two P frames is a mini-GOP.

[0062] Rate Distortion Optimization (RDO): During the encoding process, many modes are available. Some modes offer minimal image distortion but a high bitrate, while others offer significant image distortion but a low bitrate. This allows for the ability to minimize distortion without exceeding a certain maximum bitrate. In rate-distortion optimization for video coding, the maximum bitrate is used as a constraint, distortion as the optimization objective, and the Lagrange multiplier method is used to find the optimal encoding parameters.

[0063] Macroblock: The basic unit of encoding. An image must be divided into macroblocks before it can be processed. For example, an image can be divided into macroblocks of a certain size (16×16 in H.264). The encoding process is performed in units of blocks (e.g., macroblocks or blocks derived from macroblock divisions).

[0064] Reference image: In video coding and decoding, a reconstructed image that serves as a reference for other images and is used by other images to obtain reference data between images during the encoding / decoding process.

[0065] Motion Vector (MV): A two-dimensional vector that describes the position offset that occurs when a coding block moves from its current position to another position in the encoder.

[0066] Motion Search (MS): The process of finding the best matching block for the current coding block in the reference image according to a certain algorithm.

[0067] Motion Vector Prediction (MVP): Based on the existing information, the current MV is predicted according to a certain algorithm.

[0068] It should be noted that the terms used in the implementation methods of this application are only used to explain the embodiments of this application and are not intended to limit this application.

[0069] For example, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" is only a description of the combination relationship of enumerated objects, indicating that one or more items may exist. For example, at least one of the following: A, B, C can mean the following combinations: A exists alone, B exists alone, C exists alone, A and B exist at the same time, A and C exist at the same time, B and C exist at the same time, and A, B, and C exist at the same time. The term "multiple" refers to two or more. The character " / " generally indicates that the related objects before and after are in an "or" relationship.

[0070] For example, the term "corresponding" can indicate a direct or indirect correspondence between two items, an association between the two items, or a relationship between an indicator and the indicated, a configuration and the configured, and so on. The term "indication" can be a direct indication, an indirect indication, or an association. For example, "A indicates B" can mean that A directly indicates B, for example, B can obtain it through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can obtain it through C; it can also mean that A and B have an association. The terms "predefined" or "preconfigured" can mean that the corresponding code, table, or other relevant information that can be used for indication is pre-stored in the device, or it can refer to a protocol agreement. "Protocol" can refer to a standard protocol in this field. The term "when..." can be interpreted as "if," "if," "when," "in response to," and similar descriptions. Similarly, depending on the context, the phrase "if determined" or "if (stated condition or event) is detected" can be interpreted as "when determined" or "in response to determining" or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)" and similar descriptions. The terms "first", "second", "third", "fourth", "Ath", "Bth" and the like are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. Among them, digital video compression technology is mainly used to compress huge digital image video data for easy transmission and storage.

[0071] For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG1 .

[0072] FIG1 is a schematic block diagram of a video encoding and decoding system involved in an embodiment of the present application.

[0073] As shown in FIG. 1 , the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120 .

[0074] The encoding device 110 is used to encode (which can be understood as compressing) the video data to generate a code stream, and transmit the code stream to the decoding device 120. The decoding device 120 decodes the code stream generated by the encoding device 110 to obtain decoded video data.

[0075] The encoding device 110 can be understood as a device with a video encoding function, and the decoding device 120 can be understood as a device with a video decoding function, that is, the embodiments of the present application include a wider range of devices for the encoding device 110 and the decoding device 120, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, car computers, etc.

[0076] The encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via the channel 130 .

[0077] Channel 130 may include one or more media and / or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120 .

[0078] Channel 130 may include one or more communication media that enable encoding device 110 to transmit encoded video data directly to decoding device 120 in real time. Encoding device 110 may modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding device 120. The communication media may include wireless communication media, such as radio frequency spectrum. The communication media may also include wired communication media, such as one or more physical transmission lines.

[0079] Channel 130 may include a storage medium that can store the video data encoded by encoding device 110. The storage medium includes various locally accessible data storage media, such as optical disks, DVDs, flash memories, etc. In this example, decoding device 120 may obtain the encoded video data from the storage medium.

[0080] Channel 130 may include a storage server that can store the video data encoded by encoding device 110. In this example, decoding device 120 can download the stored encoded video data from the storage server. Alternatively, the storage server can store the encoded video data and transmit the encoded video data to decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.

[0081] The encoding device 110 includes a video encoder 112 and an output interface 113 .

[0082] The output interface 113 may include a modulator / demodulator (modem) and / or a transmitter. The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data may also be stored on a storage medium or storage server for subsequent reading by the decoding device 120.

[0083] In addition to the video encoder 112 and the input interface 113 , the encoding device 110 may also include a video source 111 .

[0084] Video source 111 may include at least one of a video capture device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system. The video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data. Video encoder 112 encodes the video data from video source 111 to generate a bitstream. The video data may include one or more pictures or a sequence of pictures. The bitstream contains encoding information for the picture or picture sequence in the form of a bitstream. The encoding information may include the encoded picture data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures. An SPS may contain parameters applicable to one or more sequences. A PPS may contain parameters applicable to one or more pictures. A syntax structure is a set of zero or more syntax elements arranged in a specified order within the bitstream.

[0085] The decoding apparatus 120 includes an input interface 121 and a video decoder 122. The input interface 121 may include a receiver and / or a modem.

[0086] The decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 .

[0087] The input interface 121 can receive the encoded video data via the channel 130. The video decoder 122 is configured to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123. The display device 123 displays the decoded video data. The display device 123 can be integrated with the decoding device 120 or external to the decoding device 120. The display device 123 can include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.

[0088] It should be understood that Figure 1 is only an example of the present application and should not be understood as a display of the present application. That is to say, the technical solution of the embodiment of the present application is not limited to the system framework shown in Figure 1. For example, the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding.

[0089] The following is an introduction to the video encoding framework involved in the embodiments of the present application.

[0090] FIG2 is a schematic block diagram of a video encoder 200 according to an embodiment of the present application.

[0091] It should be understood that the video encoder 200 can be applied to image data in luminance and chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in terms of color format, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 chrominance components (YYYYCbCrCbCr), and 4:4:4 represents full pixel display (YYYYCbCrCbCrCbCrCbCr). Of course, it can also be applied to image data in red-green-blue (RGB) format, but this application does not specifically limit this.

[0092] After reading the video stream, the video encoder 200 divides each frame into a number of coding tree units (CTUs). In some examples, a CTU may be referred to as a tree block, largest coding unit (LCU), or coding tree block (CTB). A CTU can be sized, for example, 128×128, 64×64, or 32×32.

[0093] FIG3 is a schematic structural diagram of the relationship between the coding tree unit and the coding unit provided in the present application.

[0094] As shown in Figure 3, a CTU can be further divided into several coding units (CUs) for encoding. A CU can be either a rectangular block or a square block. A CU can be further divided into prediction units (PUs) and transform units (TUs), allowing for separation of coding, prediction, and transform, making processing more flexible. In one example, a CTU is divided into CUs using a tree (e.g., a quadtree), and a CU is divided into TUs and PUs using a tree (e.g., a quadtree).

[0095] The video encoder and video decoder can support various PU sizes.

[0096] Assuming that the size of a particular CU is 2N×2N, the video encoder and video decoder may support PU sizes of 2N×2N or N×N for intra prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter prediction. The video encoder and video decoder may also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.

[0097] As shown in Figure 2, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may include more, fewer, or different functional components. In this application, the current block may be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block may also be referred to as a predicted image block or an image prediction block, and the reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.

[0098] Prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Because adjacent pixels in a video image have strong correlations, video encoding and decoding techniques use intra prediction to eliminate spatial redundancy between adjacent pixels. Because adjacent images in a video have strong similarities, inter prediction eliminates temporal redundancy between adjacent images, thereby improving coding efficiency.

[0099] The inter-prediction unit 211 can be used for inter-prediction, which includes motion estimation and motion compensation. It can refer to image information from different frames. Inter-prediction uses motion information to find a reference block from a reference frame and generates a prediction block based on the reference block to eliminate temporal redundancy. The reference frame can be a P-frame and / or a B-frame. P-frames refer to forward-predicted frames, and B-frames refer to bidirectionally predicted frames. After using motion information to find a reference block, inter-prediction generates a prediction block based on the reference block. Motion information includes the frame list to which the reference frame belongs, the frame index, and the motion vector. The motion vector can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering is required to generate the required fractional-pixel block in the reference frame. The reference block is the integer-pixel or fractional-pixel block found based on the motion vector. Some technologies directly use the reference block as the prediction block, while others further process the reference block to generate a prediction block. Reprocessing a reference block to generate a prediction block can also be understood as using the reference block as the prediction block and then processing the prediction block to generate a new prediction block.

[0100] The intra prediction unit 212 only refers to the information of the same frame image to predict the pixel information in the current code image block to eliminate spatial redundancy. The reference frame used for intra prediction can be an I frame.

[0101] Intra prediction uses multiple prediction modes, including angular and non-angular prediction modes, to predict the image block to be coded. Based on the rate-distortion information calculated from the prediction block and the image block to be coded, the optimal prediction mode for the image block to be coded is selected and written into the bitstream for transmission to the decoder. The decoder parses the prediction mode, predicts the predicted block of the target decoding block, and superimposes it with the time-domain residual block obtained from the bitstream to obtain the reconstructed block.

[0102] Taking the H series of international digital video coding standards as an example, the H.264 / AVC standard has 8 angle prediction modes and 1 non-angle prediction mode, and H.265 / HEVC is expanded to 33 angle prediction modes and 2 non-angle prediction modes. The intra prediction modes used by HEVC are planar mode, direct current (DC) and 33 angle modes, a total of 35 prediction modes. The intra modes used by VVC are planar, DC and 65 angle modes, a total of 67 prediction modes, which include traditional prediction modes and non-traditional prediction modes. Non-traditional prediction modes may include matrix weighted intra-frame prediction (MIP) mode. Traditional prediction modes include: planar mode with mode number 0, DC mode with mode number 1, and angle prediction modes with mode numbers 2 to 66. It should be noted that with the increase of angle modes, the prediction results of intra prediction will be more accurate and more in line with the needs of the development of high-definition and ultra-high-definition digital video. The above intra prediction mode is only an example of this application and should not limit this application.

[0103] The residual unit 220 may generate a residual block for the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate the residual block for the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel blocks of the CU and the corresponding sample in the prediction blocks of the PUs of the CU.

[0104] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of a CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0105] The inverse transform / quantization unit 240 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.

[0106] Reconstruction unit 250 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of a CU in this manner, video encoder 200 can reconstruct the pixel blocks of the CU.

[0107] The loop filter unit 260 processes the inverse-transformed and inverse-quantized pixels to compensate for distortion and provide a better reference for subsequent pixel encoding. For example, it can perform deblocking filtering to reduce the blocking artifacts of pixel blocks associated with the CU. In some embodiments, the loop filter unit 260 includes a deblocking filter (DBF) unit and a sample adaptive offset / adaptive loop filter (SAO / ALF) unit. The DBF unit is used to remove blocking artifacts, while the SAO / ALF unit is used to remove ringing artifacts.

[0108] The decoded image buffer 270 may store reconstructed pixel blocks.

[0109] The inter prediction unit 211 can use the reference image containing the reconstructed pixel blocks in the decoded image buffer 270 to perform inter prediction on PUs in other images. In addition, the intra prediction unit 212 can use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra prediction on other PUs in the same image as the CU.

[0110] The entropy coding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy coding unit 280 may perform one or more entropy coding operations on the quantized transform coefficients to generate entropy-coded data.

[0111] FIG4 is a schematic block diagram of a video decoder according to an embodiment of the present application.

[0112] 4 , the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transformation unit 330, a reconstruction unit 340, a loop filter unit 350, and a decoded picture buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.

[0113] The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / transform unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data based on the syntax elements extracted from the bitstream, thereby generating decoded video data.

[0114] The prediction unit 320 includes an intra prediction unit 322 and an inter prediction unit 321 .

[0115] The intra prediction unit 322 may perform intra prediction to generate a prediction block for the PU. The intra prediction unit 322 may use an intra prediction mode to generate a prediction block for the PU based on pixel blocks of spatially neighboring PUs. The intra prediction unit 322 may also determine the intra prediction mode for the PU based on one or more syntax elements parsed from the codestream.

[0116] The inter prediction unit 321 may construct a first reference picture list (List 0) and a second reference picture list (List 1) based on syntax elements parsed from the codestream. Furthermore, if a PU is encoded using inter prediction, the entropy decoding unit 310 may parse the motion information of the PU. The inter prediction unit 321 may determine one or more reference blocks for the PU based on the motion information of the PU. The inter prediction unit 321 may generate a prediction block for the PU based on the one or more reference blocks of the PU.

[0117] The inverse quantization / transform unit 330 may inversely quantize (i.e., dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization. After inverse quantizing the transform coefficients, the inverse quantization / transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.

[0118] The reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 340 can add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.

[0119] The loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.

[0120] The video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0121] Combining Figures 2 and 4, the basic process of video encoding and decoding is as follows:

[0122] At the encoding end, a frame of an image is divided into image blocks. For the current block, the prediction unit 210 uses intra prediction or inter prediction to predict the prediction block of the current block (i.e., the block to be encoded). The residual unit 220 can calculate a residual block based on the prediction block and the original block of the current block (i.e., the block to be encoded), that is, the difference between the prediction block and the original block. This residual block can also be called residual information. This residual block is transformed and quantized by the transform / quantization unit 230, which can remove information that is insensitive to the human eye to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization unit 230 can be called a time domain residual block, and the time domain residual block after transformation and quantization by the transform / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 280 receives the quantized change coefficients output by the change quantization unit 230, performs entropy coding on the quantized change coefficients, and outputs a bitstream. For example, the entropy coding unit 280 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.

[0123] At the decoding end, the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block (i.e., the block to be decoded). The prediction unit 320 uses intra prediction or inter prediction based on the prediction information to predict the prediction block of the current block (i.e., the block to be decoded). The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or block to obtain a decoded image. It is worth noting that the encoding end also needs to use operations similar to those of the decoder to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be a subsequent image used as a reference image for inter prediction.

[0124] In addition, the block division information determined by the encoder, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and analyzes the existing information to determine the same block division information, prediction, transform, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder, thereby ensuring that the decoded image obtained by the encoder and the decoder are the same.

[0125] It should be noted that due to the need for parallel processing, images can be divided into slices, etc., and slices in the same image can be processed in parallel, that is, there is no data dependency between them. The term "frame" can be understood as an image or slice, etc. The above is the basic process of a video codec under a block-based codec framework. As technology develops, some modules or steps of this framework or process may be optimized, that is, this application is not limited to this framework and process.

[0126] To facilitate understanding of the technical solution provided by this application, the relevant contents are explained below.

[0127] (1) Coding unit division.

[0128] A frame of image is fed into the encoder and first split into Coding Tree Units (CTUs) of 64×64 block size. Depth-wise partitioning is then performed to obtain Coding Units (CUs), each consisting of a Prediction Unit (PU) and a Transform Unit (TU). Each PU is predicted to obtain a predicted value, which is then subtracted from the input data to produce a residual. This residual is then transformed and quantized using the DCT (Digital Computation) technique to obtain the residual coefficients, which are then fed into the entropy coding module to output the bitstream. Simultaneously, the residual coefficients are dequantized and inversely transformed to obtain the residual value of the reconstructed image. This residual value is then added to the predicted value to produce the reconstructed image. After in-loop filtering, the reconstructed image enters the reference image queue and serves as the reference image for the next frame, allowing for subsequent backward encoding.

[0129] During the specific prediction, starting from the largest coding unit (LCU, Largest Code Unit), each layer is divided down layer by layer according to the quadtree, and recursive calculation is performed. First, divide from top to bottom. From depth = 0, the 64×64 block is first divided into 4 32×32 sub-CUs. Then one of the 32×32 sub-CUs is further divided into 4 16×16 sub-CUs, and so on, until depth = 3, the CU size is 8×8. Then, prune from bottom to top. The RDcost of the four 8×8 CUs is summed (denoted as cost1) as the RDcost of the current level, and compared with the RDcost (denoted as cost2) of the corresponding previous level (i.e., 16×16 CU). If cost1 is less than cost2, the 8×8 CU division is retained, otherwise continue to prune upwards and compare layer by layer. Finally, find the optimal CU depth division.

[0130] PU prediction is divided into intra-frame mode and inter-frame mode. First, within the same prediction mode, different PUs are compared to find the optimal split mode. Then, the intra-frame mode and inter-frame mode are compared to find the optimal prediction mode for the current CU. Simultaneously, a quadtree-based adaptive transform (Residual Quad-tree Transform, RQT) is performed on the CU to find the optimal TU mode. Finally, a frame of image is divided into CUs and the corresponding PUs and TUs.

[0131] FIG5 is a schematic diagram of a partitioning mode of PU and TU involved in an embodiment of the present application.

[0132] As shown in Figure 5, there are eight PU partitioning modes. For example, assuming the current CU size is 2N×2N, the PU partitioning modes include the following eight modes: no partitioning, N×N partitioning, 2N×N partitioning, N×2N partitioning, 2N×nU partitioning, 2N×nD partitioning, nL×N partitioning, and nR×N partitioning. A TU has only two partitioning modes: partitioning or no partitioning.

[0133] It should be noted that the above is the basic framework of the encoding kernel and the most complex is the basic process of coding unit division selection and CU, PU, ​​and TU division selection. Other relatively large computing resource processing processes include: Motion estimation (ME) and motion compensation (MC).

[0134] (2) Motion estimation.

[0135] Motion estimation can be divided into full-pixel motion prediction and sub-pixel motion prediction. Motion estimation can use different search modes or algorithms, including but not limited to diamond (DIA), hexagon (HEX), uneven multi-hexagon (UMH), exhaustive (ESA), and transformed exhaustive (TESA). merange is a parameter that controls the maximum motion search range in pixels. subme is a parameter used to characterize the sub-pixel estimation complexity (0-10). A larger value indicates a higher search complexity.

[0136] FIG6 is a schematic diagram of the principle of motion estimation involved in an embodiment of the present application.

[0137] As shown in Figure 6, motion estimation searches for a suitable matching area B (e.g., the best matching block) in a reference image for a certain area A (e.g., the current block) of the current image. The reference image can be a previous image or a subsequent image.

[0138] (3) Motion compensation.

[0139] Motion compensation is based on the results of motion estimation. Using the estimated motion vector, motion compensation can predict and compensate the next image in the image sequence, thereby reducing redundancy in the video data. In short, motion compensation uses the previous partial image to predict and compensate the current partial image, helping to reduce redundant information in the image sequence.

[0140] FIG7 is a schematic diagram showing the principle of motion compensation according to an embodiment of the present application.

[0141] As shown in FIG. 7 , based on the result of motion estimation, motion compensation can be used to find (or determine) the difference (or disparity) between region A and region B.

[0142] Motion estimation and motion compensation generate motion vectors and residuals. Motion vectors are the motion trajectories of certain regions relative to the reference image, while residuals are the differences between the predicted image and the current image after these regions have moved.

[0143] It is worth noting that the residual calculation (such as SAD or SSD) is also computationally complex. This is basically done together with the coding unit division and MC and ME. By controlling the algorithm complexity of the coding unit division, ME, MC, and the search area (i.e., merange), the computing resources consumed by the residual calculation can be controlled.

[0144] (4) Transformation operation.

[0145] The transform operation is the most complex of the atomic operations in a video encoder.

[0146] The TU size of the H.265 encoder can be from 32×32 to 4×4, a total of four depths. Since there are a large number of matrix multiplication operations in the process, the complexity is still very high even with assembly acceleration. Therefore, the computational complexity of the transformation operation can be controlled by controlling parameters. For example, the computational complexity of the transformation operation can be controlled by the following methods:

[0147] 1. Skip transform and quantization when the prediction distortion is small (eg, very small).

[0148] 2. If the rate-distortion and residual coding results of the current transform block are small (eg, very small), then the benefit of performing a deeper TU partition will be small, that is, the TU partition depth can be controlled.

[0149] 3. The transformation and quantization modules are often operated together. If the transform coefficients are rarely distributed, quantization can be skipped and directly forced to 0.

[0150] 4. The maximum TU depth of the current CU can be adaptively determined based on the information of adjacent TUs.

[0151] The technical problem to be solved by this application is described below.

[0152] The video industry has developed rapidly in recent years, and video applications are rapidly upgrading towards high definition and high frame rates (FPS). With the rapid development of video services such as short videos, e-commerce live streaming, and real-time "cloud" rendering, the demand for video processing is increasing. Video coding, as the foundation of video processing, has excellent encoding capabilities that can provide products with a high-definition and smooth playback experience, playing an important role in improving Quality of Experience (QoE) and Quality of Service (QoS).

[0153] Scenarios such as live streaming, real-time communication (RTC), cloud rendering, and cloud desktops all place high demands on the stability of the output frames of the video encoding kernel.

[0154] Typically, the computational resources consumed by a video encoding kernel are related to the complexity of the video image.

[0155] For example, static images with small changes in motion texture are easier to compress and consume relatively few computing resources. However, compressing images with complex motion textures consumes more computing resources. If the texture of the compressed video is complex and the scene switching is frequent, the computing resources consumed by the video encoding compression will fluctuate greatly.

[0156] However, when computing resources fluctuate greatly, the consumption of the server's central processing unit (CPU) will also fluctuate greatly. When the CPU consumption fluctuates greatly, it will not only affect the stability of the output frame, especially for scenarios such as live broadcast, RTC, cloud rendering, and cloud desktop, but also increase the deployment cost of the server. The reason is that in terms of computing resource orchestration and scheduling, more computing resources must be reserved as buffer space to cope with computing resource fluctuations when video scenes are switched. For example, if a server runs 10 live video encoding streams at the same time, the CPU should be controlled within 50% as much as possible during scheduling to prevent the server computing resources from being overloaded due to the simultaneous upward fluctuation of computing resource consumption when the pictures of these 10 video encoding streams are switched to complex texture scenes at the same time, so as to ensure the stability of the output frames of video encoding.

[0157] In view of this, embodiments of the present application provide a method, apparatus, electronic device, and storage medium for determining encoding parameters, which can improve the stability of the output frames of the encoding core and reduce the deployment cost of the server. It should be noted that the encoding parameter determination method provided in this application may also be referred to as an image encoding method, encoding method, image re-encoding method, or similar descriptions, and this application does not specifically limit this.

[0158] The following describes the method for determining the encoding parameters provided in this application.

[0159] FIG8 is a schematic flowchart of a coding parameter determination method 400 provided in an embodiment of the present application.

[0160] It should be understood that method 400 can be performed by any device capable of data processing. For example, method 400 can be performed by encoding device 110 shown in FIG1 . Alternatively, method 400 can be performed by video encoder 200 shown in FIG2 . For ease of description, the following description uses an encoding parameter determination device as an example.

[0161] As shown in FIG8 , the method 400 may include some or all of the following:

[0162] S410: The coding parameter determination apparatus parses the code stream to obtain an image to be decoded and decoding information.

[0163] Exemplarily, the coding parameter determination apparatus parses a video or image code stream to extract the image to be decoded and related decoding information, which may include some specific parameters for decoding the image.

[0164] In some embodiments, the decoding information includes at least one of the following: image type, partition type, macroblock type, motion vector, macroblock size, bit rate, quantization parameter, and the number of bits occupied by the macroblock in the bitstream.

[0165] Exemplarily, the image type is also called the frame type, and the frame type refers to the type of frame, such as I frame, P frame, B frame, etc. Among them, the I frame is a key frame, which does not refer to any other frame. P frame: forward predictive coding frame. The P frame represents the difference between this frame and the previous key frame (or P frame). During decoding, the difference defined by this frame needs to be superimposed with the previously cached picture to generate the final picture. B frame: bidirectional predictive interpolation coding frame. The B frame is a bidirectional difference frame, that is, the B frame records the difference between this frame and the previous and next frames. The B frame can be used as a reference frame for other B frames, or it may not be used as a reference frame for other B frames.

[0166] For example, the partition type may also be referred to as a partition mode, a partitioning mode, a partitioning method, etc., and may be a partition type of a macroblock. Of course, in other alternative embodiments, it may also be a partition type of a CU, PU, ​​or TU. For example, the partition type may include, but is not limited to, 128×128, 64×64, 32×32, 16×16, 16×8, 8×16, 8×8, 4×4, etc.

[0167] For example, the type of macroblock can be intra macroblock, inter macroblock, or skip macroblock: in video coding, macroblock is the basic coding unit. Of course, in other alternative embodiments, the type of macroblock can also be replaced by CU, PU, ​​or TU.

[0168] For example, a motion vector is a vector used to represent the movement of pixels between adjacent frames, which can be used to predict and encode the movement trajectory of a moving object.

[0169] Exemplarily, the size of a macroblock refers to the size after the macroblock is divided. For example, the size of a macroblock may include, but is not limited to, 128×128, 64×64, 32×32, 16×16, 16×8, 8×16, 8×8, 4×4, etc. Of course, in other alternative embodiments, the size of a macroblock may also be replaced by the size of a CU, PU, ​​or TU.

[0170] For example, bitrate refers to the amount of data that needs to be transmitted in a given time. In video encoding, bitrate is often used to measure compression efficiency. A lower bitrate means less data needs to be transmitted, but there may be some loss of image quality.

[0171] For example, the quantization parameter is an important parameter used to control image quality loss. A lower quantization parameter means better image quality but a larger data volume; a higher quantization parameter means less image quality loss but a smaller data volume.

[0172] Exemplarily, the number of bits occupied by a macroblock in a code stream refers to the number of bits occupied by the macroblock in the compressed video code stream, which depends on various factors, such as the type of macroblock, segmentation type, motion vector, etc.

[0173] Of course, in other alternative embodiments, the decoding information may also include other information, for example, the decoding information may include a frame size, which generally refers to the size of a frame, such as 1920×1080. For another example, the decoding information may include a reference frame, which is a base frame used for decoding and predicting other frames. In video coding, in order to reduce the amount of data, the encoder usually refers to the previous frame (i.e., the reference frame) to encode the current frame.

[0174] S420: The coding parameter determination apparatus decodes the image to be decoded using the decoding information to obtain a reconstructed image.

[0175] Exemplarily, the coding parameter determination apparatus uses the decoded information to decode the image to be decoded to obtain a reconstructed image. For example, the coding parameter determination apparatus may use the decoded information to obtain a predicted image and a residual image, and then sum these two images to obtain the reconstructed image. Alternatively, the coding parameter determination apparatus may perform inverse quantization and inverse transformation on the image obtained by summing the two images to obtain the reconstructed image.

[0176] Exemplarily, the encoding parameter determination apparatus uses the decoded information to decode the image to be decoded. After obtaining the reconstructed image, the decoding information may be stored. For example, the encoding parameter determination apparatus may store the decoded information together with the reconstructed image. For example, the encoding parameter determination apparatus may store the decoded information together with the data of the reconstructed image (e.g., YUV information).

[0177] S430: The coding parameter determining device determines coding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information.

[0178] Exemplarily, when re-encoding the reconstructed image blocks in the reconstructed image, the coding parameter determination device may determine whether to use the decoding parameters in the decoding information by utilizing a certain strategy or by considering certain influencing factors. If it is determined that the decoding parameters will be used, the coding parameter determination device may determine the coding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information. For example, when re-encoding the reconstructed image blocks in the reconstructed image, the coding parameter determination device may determine whether to use the decoding parameters in the decoding information based on factors such as the image quality of the reconstructed image, the spatial computing resources of the encoder, and the business scenario.

[0179] For example, if it is determined that the decoding parameters in the decoded information are used to determine the encoding parameters for the reconstructed image, then the encoding parameter determination device may determine the parameters in the decoded information that match the encoding parameters as the encoding parameters. The decoding parameters may be information used to provide a reference for the encoding parameter determination device when determining the encoding parameters. In other words, the decoding parameters are used to provide a reference for the encoding parameter determination device to determine the encoding parameters.

[0180] Exemplarily, the coding parameter determination device directly reuses the decoding parameter as the coding parameter, or processes the decoding parameter to obtain the coding parameter, or simplifies the default calculation mode of the coding parameter based on the decoding parameter to obtain the coding parameter. This application does not make specific limitations on this.

[0181] In this embodiment, the coding parameter determination device first parses the bitstream to obtain an image to be decoded and decoding information; then, using the decoding information, decodes the image to be decoded to obtain a reconstructed image; and based on the decoding parameters in the decoding information, determines coding parameters for re-encoding the reconstructed image. In other words, when determining the coding parameters for the reconstructed image, the coding parameter determination device can reuse the decoding parameters in the decoding information to reduce the computational complexity of the coding parameters, thereby improving the stability of the output frames of the encoding core and reducing server deployment costs.

[0182] It is worth noting that, under normal circumstances, the encoder will set some encoding-related processing algorithms and configurations (such as encoding complexity, bit rate, the number of reference frames for encoding cost estimation (lookahead), key picture group (KEY GOP) size, whether to enable B frames, encoding code control mode (i.e., the method of controlling the size of the encoder output stream), motion estimation-related algorithms, motion compensation-related algorithms, whether to enable relevant algorithms in pre-estimation, etc.) when applying. After these encoding kernel parameters are set, when the video source is input for encoding, some encoding-related processing algorithms and configurations will not change adaptively. This is equivalent to the process of determining encoding parameters with high computing resource consumption (such as coding unit division, motion estimation, motion compensation, transformation, preprocessing, etc.) will also be fixed processes. In this embodiment, when the encoding parameters are determined by the decoding parameters in the decoding information, the use of algorithms and configurations with high computing resource consumption to determine the encoding parameters is avoided. As a result, the computational complexity of the encoding parameters can be reduced, thereby improving the stability of the output frame of the encoding kernel and reducing the deployment cost of the server.

[0183] It should be noted that in other alternative embodiments, for the reconstructed image, the processes for determining encoding parameters that consume relatively large computing resources (such as coding unit division, motion estimation, motion compensation, transformation, preprocessing, etc.) can be adaptively trimmed based on the analysis results in the pre-analysis process (for example, the analysis results of the picture scene texture complexity or the analysis results of the picture scene analysis) or the detection results (for example, the detection results of the picture scene switching detection or the detection results of the picture texture detection), so as to reduce the computing resources consumed by video encoding compression at the expense of a certain DB-rate.

[0184] However, a major drawback of this type of solution is the lack of reuse of the decoded information of the reconstructed image. On the one hand, because pre-analysis uses already encoded images, its analysis or detection results may not be timely enough, resulting in a delay of several groups of pictures (GOPs). This means that even if the process used to determine the encoding parameters is adaptively tailored based on the analysis or detection results from the pre-analysis process, the lack of timely analysis or detection results may reduce the reference value of the analysis or detection results, thereby reducing the accuracy of the encoding parameters and the encoding performance of the encoder. On the other hand, excessive adaptive tailoring of the encoding parameter determination process can significantly impact video image quality, reduce image stability, and degrade encoding performance. In this embodiment, the encoding parameters are determined by reusing the decoding parameters in the decoded information to reduce the computational complexity of the encoding parameters, thereby improving the stability of the output frames of the encoding kernel and the encoding performance of the encoder. Furthermore, because the decoded information is real-time information used to decode the reconstructed image, the accuracy of the encoding parameters can be guaranteed when the encoding parameters used to re-encode the reconstructed image are determined based on the decoding parameters in the decoded information, thereby improving the encoding performance of the encoder.

[0185] It should be noted that the image to be decoded involved in this application can be understood or replaced by the encoded image, the encoded image, the encoding result of the residual image, and other similar descriptions. The reconstructed image involved in this application can be understood or replaced by the decoded image, the decoded image, the image after the sum of the predicted image and the residual image, and other similar descriptions. This application does not make specific limitations on this.

[0186] FIG9 is another schematic flowchart of the coding parameter determination method provided in an embodiment of the present application.

[0187] As shown in FIG9 , the coding parameter determination device can have not only a decoding function but also a coding function. Specifically, after receiving the code stream, the parameter determination device decodes it. During the decoding process, decoding information such as the image type, segmentation type, macroblock type, motion vector, macroblock size, bit rate, quantization parameter, and the number of bits occupied by the macroblock in the code stream is obtained. Based on this, when re-encoding the reconstructed image block in the reconstructed image, the coding parameter determination device determines whether to use the decoding information to determine the coding parameters of the reconstructed image; if it is determined that the decoding information is used to determine the coding parameters of the reconstructed image, the parameters in the decoding information that match the coding parameters are determined; and based on the matching parameters, the coding parameters are determined. That is, the solution provided in the present application is applicable to determining videos that have been encoded and decoded, such as videos compressed and decompressed by video compression algorithms such as H.264 / VP8 / VP9 / H.265 / H.266 / AV1 / AVS3, rather than originally captured YUV or RGB, NV12, etc. videos.

[0188] In some embodiments, before S430, the method 400 may further include:

[0189] The coding parameter determining device determines a parameter in the decoding information whose parameter type is the same as that of the coding parameter as the decoding parameter.

[0190] Exemplarily, when determining a decoding parameter, the encoding parameter determining device searches for a parameter of the same type as the encoding parameter in the decoded information as the decoding parameter. For example, if the encoding parameter is a quantization parameter (QP), the decoding parameter should be the QP in the decoded information. If the encoding parameter is a motion vector (MV), the decoding parameter should be the MV in the decoded information.

[0191] In this embodiment, the encoding parameter determination apparatus uses parameters of the same type as decoding parameters, which can ensure the reference effect of the decoding parameters and further improve the encoding effect of the encoding parameters.

[0192] Of course, in other alternative embodiments, the encoding parameter determination device may also determine as the decoding parameter a parameter in the decoding information whose parameter type is the same as the parameter used in the calculation process of the encoding parameter, and this application does not make any specific limitation on this.

[0193] In some embodiments, S430 may include:

[0194] The encoding parameter determination device determines the decoding parameter as the encoding parameter.

[0195] For example, when determining the decoding parameters, the encoding parameter determination device searches for parameters of the same type as the encoding parameters in the decoded information as the decoding parameters. For example, if the encoding parameter determination device needs to determine the QP, the encoding parameter determination device can directly use the QP in the decoded information. For another example, if the encoding parameter determination device needs to determine the MV, the encoding parameter determination device can directly use the MV in the decoded information.

[0196] In this embodiment, the coding parameter determination device determines the decoding parameter as the coding parameter, which can greatly simplify the computational complexity of determining the coding parameter.

[0197] In some embodiments, S430 may include:

[0198] The coding parameter determining device determines the coding parameter based on the decoding parameter and using a parameter calculation mode that matches the parameter type of the coding parameter.

[0199] Exemplarily, the coding parameter determining apparatus may adjust or fine-tune the decoding parameter using a parameter calculation mode that matches the parameter type of the coding parameter to obtain the coding parameter.

[0200] Exemplarily, the encoding parameters include at least one parameter. For a first parameter among the at least one parameter, the encoding parameter determination device can calculate the first parameter based on a parameter in the decoding parameters that has the same parameter type as the first parameter, using a parameter calculation mode that matches the parameter type of the first parameter.

[0201] In this embodiment, the coding parameter determination device determines the coding parameter based on the decoding parameter and uses a parameter calculation mode that matches the parameter type of the coding parameter. This is equivalent to the coding parameter determination device being able to adapt to the parameter type of the coding parameter and select a suitable calculation mode to calculate the coding parameter. This not only reduces the calculation complexity of the coding parameter and improves the coding efficiency, but also helps to improve the accuracy of the coding parameter, thereby improving the coding effect.

[0202] In some embodiments, if the encoding parameter includes a first motion vector, the parameter calculation mode that matches the parameter type of the encoding parameter includes a parameter calculation mode that matches the motion vector, and the parameter calculation mode that matches the motion vector includes at least one of the following:

[0203] A first search mode for searching using a motion vector in the decoded parameter as a starting search point;

[0204] a second search mode for searching with a higher precision than the precision of the motion vector in the decoded parameter;

[0205] A third search mode having a search range smaller than the search range used by the default calculation mode of the motion vector.

[0206] Exemplarily, if the decoding parameters include a second motion vector, the encoding parameter determination device may determine the first motion vector based on the second motion vector using the parameter calculation mode that matches the motion vector.

[0207] For example, the coding parameter determination device may determine the first motion vector based on the second motion vector using the first search mode. In other words, the coding parameter determination device may search for the first motion vector using the second motion vector as the starting search point. For another example, the coding parameter determination device may determine the first motion vector based on the second motion vector using the second search mode. In other words, the coding parameter determination device may determine a motion vector with a higher precision than the second motion quantity as the first motion vector. For another example, the coding parameter determination device may determine the first motion vector based on the second motion vector using the third search mode. In other words, the coding parameter determination device may determine the first motion vector using a first search range. The first search range may be smaller than the search range used by the default motion vector calculation mode.

[0208] In this embodiment, the parameter calculation mode that matches the motion vector includes at least one of the following: a first search mode that searches with the motion vector in the decoding parameter as the starting search point; a second search mode that searches with a higher accuracy than the motion vector in the decoding parameter; a third search mode whose search range is smaller than the search range used by the default calculation mode of the motion vector. This not only reduces the calculation complexity of the encoding parameter and improves the encoding efficiency, but also helps to improve the accuracy of the first motion vector, thereby improving the encoding effect.

[0209] Of course, when the coding parameter includes other parameters in addition to the motion vector, the parameter calculation mode that matches the parameter type of the coding parameter may also include a parameter calculation mode that matches the parameter type of other parameters, and this application does not make specific limitations on this.

[0210] In some embodiments, S430 may include:

[0211] The coding parameter determination device determines a candidate parameter set of the coding parameter based on the decoding parameter; and determines the optimal parameter in the candidate parameter set as the coding parameter by traversing the parameters in the candidate parameter set.

[0212] In this embodiment, the coding parameter determination device determines a candidate parameter set for the coding parameter based on the decoding parameter; by traversing the parameters in the candidate parameter set, the optimal parameter in the candidate parameter set is determined as the coding parameter, which not only reduces the calculation complexity of the coding parameter and improves the coding efficiency, but also ensures the accuracy of the coding parameter and its coding effect.

[0213] In some embodiments, if the encoding parameter includes a first segmentation type, the candidate parameter set for the first segmentation type includes: the segmentation type in the decoding parameter, the segmentation type of the previous level of the level to which the segmentation type in the decoding parameter belongs, and the segmentation type of the next level of the level to which the segmentation type in the decoding parameter belongs.

[0214] Exemplarily, the first segmentation type refers to the size of image blocks obtained by dividing the reconstructed image during re-encoding of the reconstructed image. The segmentation type in the decoding parameter refers to the size of image blocks obtained by dividing the image to be decoded during decoding of the image to be decoded.

[0215] Exemplarily, the level to which the segmentation type in the decoding parameters belongs refers to the granularity level of image blocks obtained by dividing the image to be decoded during the decoding process of the image to be decoded. For example, the height or width of the image block can be determined as the granularity level. The previous level refers to the granularity level of image blocks obtained by dividing the image to be decoded during the decoding process of the image to be decoded, according to the number of divisions corresponding to the segmentation type in the decoding parameters minus 1. The segmentation type in the previous level refers to the size of image blocks obtained by dividing the image to be decoded during the decoding process of the image to be decoded, according to the number of divisions corresponding to the segmentation type in the decoding parameters minus 1. The next level refers to the granularity level of image blocks obtained by dividing the image to be decoded during the decoding process of the image to be decoded, according to the number of divisions corresponding to the segmentation type in the decoding parameters plus 1. The segmentation type in the next level refers to the size of image blocks obtained by dividing the image to be decoded during the decoding process of the image to be decoded, according to the number of divisions corresponding to the segmentation type in the decoding parameters plus 1.

[0216] Exemplarily, if the encoding parameter includes a first segmentation type and the decoding parameter includes a second segmentation type that matches the first segmentation type; the encoding parameter determination device can determine the level to which the second segmentation type belongs, and determine the second segmentation type, the segmentation type of the upper level of the level to which it belongs, and the segmentation type of the lower level of the level to which it belongs as the candidate parameter set; that is, the encoding parameter determination device can determine the optimal segmentation type in the parameter set as the first segmentation type by traversing the segmentation types in the candidate parameter set.

[0217] For example, assuming that the second partition type is 16×16, the coding parameter determination device can determine that the level to which the second partition type belongs is 16. In this case, the coding parameter determination device can determine the second partition type (i.e., 16×16), the partition type of the upper level of the level to which it belongs (i.e., 32×32), and the partition type of the lower level of the level to which it belongs (i.e., 8×8) as the candidate parameter set; that is, the coding parameter determination device can determine the optimal partition type among 16×16, 32×32 and 8×8 as the first partition type by traversing the partition types in the candidate parameter set.

[0218] Of course, in other embodiments, the segmentation type of the previous level of the level to which the level belongs may also include at least one of 32×32, 16×32, and 32×16, and the segmentation type of the next level of the level to which the level belongs may also include at least one of 8×8, 16×8, and 8×16. This application does not specifically limit this. The candidate parameter set may even include the segmentation type of the next level of the next level to the next level, or the segmentation type of the previous level of the previous level to the previous level.

[0219] It should be noted that the first segmentation type and the second segmentation type may also be replaced by other parameters having a data format of a×b, and this application does not specifically limit this. For example, the first segmentation type may be replaced by the first frame size. The second segmentation type may also be replaced by the second frame size. For example, the first segmentation type may be replaced by the first macroblock size. The second segmentation type may also be replaced by the second macroblock size.

[0220] In some embodiments, if the first encoding parameter includes a first parameter, the candidate parameter set of the first parameter includes: multiple sampling values ​​sampled in a first value range; wherein the difference between the upper limit value and the lower limit value of the first value range is equal to a preset threshold, and the value of the parameter of the same parameter type as the first parameter in the decoding parameter is within the first value range.

[0221] Exemplarily, if the decoding parameter includes a parameter value of the same parameter type as the first parameter as the target value, the coding parameter determination device can determine the first value range based on a preset threshold value, using the preset threshold value as the difference between the upper limit value and the lower limit value of the first value range (which can be a preset value), and the target value is within the first value range; the coding parameter determination device samples within the first value range and determines the multiple sampled values ​​obtained by sampling as the candidate parameter set of the first parameter; that is, the coding parameter determination device can traverse the multiple sampled values ​​and determine the optimal value among the multiple sampled values ​​as the value of the first parameter. Of course, the coding parameter determination device can also traverse the target value and the multiple sampled values ​​and determine the optimal value among the target value and the multiple sampled values ​​as the value of the first parameter.

[0222] For example, assuming that the target value is 16 and the difference between the upper limit and the lower limit of the target value range is 3, the coding parameter determination device can determine the first value range as [15, 17]. In this case, the coding parameter determination device can sample within [15, 17] and determine the multiple sampled values ​​(assuming 15 and 15.5) obtained by sampling as the candidate parameter set. That is, the coding parameter determination device can traverse 15 and 15.5 and determine the optimal value among 15 and 15.5 as the value of the first parameter. Of course, the coding parameter determination device can also traverse 16, 15, and 15.5 and determine the optimal value among 16, 15, and 15.5 as the value of the first parameter.

[0223] In some embodiments, if the encoding parameters include a first parameter, the candidate parameter set of the first parameter includes: a plurality of adjustment values ​​obtained by adjusting the values ​​of parameters of the same parameter type as the first parameter in the decoding parameters.

[0224] For example, if the decoding parameter includes a parameter value of the same parameter type as the first parameter, the encoding parameter determination device may adjust the target value based on multiple thresholds to obtain multiple adjusted values, and determine the optimal value among the multiple adjusted values ​​as the value of the first parameter. Of course, the encoding parameter determination device may also traverse the target value and the multiple adjusted values ​​and determine the optimal value among the target value and the multiple adjusted values ​​as the value of the first parameter.

[0225] For example, assuming that the target value is 16 and the multiple thresholds include -1 and 1, the coding parameter determination device may determine that the multiple adjustment values ​​are 15 and 17. In this case, the coding parameter determination device may traverse 15 and 17 and determine the optimal value among 15 and 17 as the value of the first parameter. Of course, the coding parameter determination device may also traverse 16, 15, and 17 and determine the optimal value among 16, 15, and 17 as the value of the first parameter.

[0226] It is worth noting that the value of the first parameter and the target value can be the value of any parameter whose value is in a numerical format, and this application does not make any specific restrictions on this. For example, the value of the first parameter can be the value of the quantization parameter of the reconstructed image, and the target value can be the value of the quantization parameter in the decoding information. Alternatively, the value of the first parameter can be the value of the bit rate of the reconstructed image, and the target value can be the value of the bit rate in the decoding information. Alternatively, the value of the first parameter can be the value of the number of bits occupied by the macroblock of the reconstructed image in the code stream, and the target value can be the value of the number of bits occupied by the macroblock in the decoding information in the code stream. Alternatively, the value of the first parameter can be the value of the motion vector of the reconstructed image, and the target value can be the value of the motion vector in the decoding information.

[0227] In some embodiments, before S430, the method 400 may further include:

[0228] The encoding parameter determination means determines whether to use the decoding parameter to determine the encoding parameter.

[0229] Exemplarily, when the encoding parameter determining apparatus determines to use the decoding parameter to determine the encoding parameter, the encoding parameter is determined based on the decoding parameter.

[0230] In some embodiments, the encoding parameter determination apparatus determines whether to use the decoding parameter to determine the encoding parameter, which may be implemented as follows:

[0231] The coding parameter determination device evaluates the quality of the reconstructed image to obtain a quality evaluation value; if the quality evaluation value is greater than or equal to a preset evaluation value, it is determined that the decoding information is used to determine the coding parameters; if the quality evaluation value is less than the preset evaluation value, it is determined that the decoding information is not used to determine the coding parameters.

[0232] For example, before determining the coding parameters for the reconstructed image, the coding parameter determination device may evaluate the quality of the reconstructed image. This evaluation process may be based on various quality assessment indicators, such as peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM). Through the evaluation, the device may obtain a quality assessment value to measure the quality of the reconstructed image. Next, the device compares the quality assessment value with a preset assessment value. The preset assessment value may be a threshold or a value set based on a specific application scenario or data type. If the quality assessment value is greater than or equal to the preset assessment value, the device will consider the decoded information valid and can be used to determine the coding parameters. If the quality assessment value is less than the preset assessment value, the device will consider the decoded information insufficient to determine high-quality coding parameters. In this case, the device may choose not to use the decoded information to determine the coding parameters, or attempt to determine the coding parameters using a default calculation mode or algorithm.

[0233] In this embodiment, the quality assessment value is used to determine whether to use the decoding information to determine the encoding parameters. This assessment mechanism helps ensure that the determined encoding parameters can produce a high-quality reconstructed image while avoiding the adverse effects of low-quality decoding information on the encoding parameters. In practical applications, appropriate evaluation indicators and preset evaluation values ​​can be selected based on specific needs and scenarios. This is equivalent to adaptively determining whether to reuse the decoding parameters in the decoding information to determine the encoding parameters based on the actual demand for image quality. This not only helps to control the fluctuation range of computing resources consumed by video coding compression, but also can take into account and balance the consumption of computing resources and encoding effects, thereby improving the encoding performance of the encoder.

[0234] In some embodiments, the encoding parameter determination apparatus determines whether to use the decoding parameter to determine the encoding parameter, which may be implemented as follows:

[0235] The coding parameter determination device obtains a first computing capability, which is the computing capability consumed when the encoder calculates the coding parameter using a default parameter calculation method; based on the first computing capability, determines whether to use the decoding information to determine the coding parameter.

[0236] Exemplarily, before determining the encoding parameters for reconstructing the image, the encoding parameter determination device may consider computing power. In some cases, a specific encoding parameter may require a significant amount of computing power when using the default parameter calculation mode. Therefore, the encoding parameter determination device may first obtain a first computing power, which is the computing power consumed when the encoder calculates the encoding parameter using the default parameter calculation method. Based on this first computing power, the encoding parameter determination device may then evaluate the feasibility of using the decoded information to determine the encoding parameter. For example, the encoding parameter determination device may determine whether to use the decoded information to determine the encoding parameter based on a balance between computing power consumption and the encoding performance of the encoding parameter.

[0237] In this embodiment, the first computing capability is used to determine whether to use the decoded information to determine the encoding parameters. This consideration of computing capability helps balance the accuracy of the encoding parameters and the computing capability consumed. In some application scenarios, it may be necessary to determine the encoding parameters as accurately as possible within limited computing resources. By evaluating the first computing capability, the encoding parameter determination device can better weigh different factors and make a decision on whether to use the decoded information to determine the encoding parameters.

[0238] In some embodiments, determining whether to use the decoding information to determine the encoding parameter based on the first computing capability may be implemented as follows:

[0239] If the first computing power is greater than or equal to the computing power provided by the idle computing resources of the encoder, it is determined to use the decoding information to determine the encoding parameters; if the first computing power is less than the computing power provided by the idle computing resources, it is determined not to use the decoding information to determine the encoding parameters.

[0240] In some cases, the coding parameter determination device may be limited by computing power. In this case, the coding parameter determination device can obtain the computing power provided by the idle computing resources of the encoder as a reference. If the first computing power is greater than or equal to the computing power provided by the idle computing resources, it means that a large amount of computing power is required when the coding parameters adopt the default parameter calculation mode. In this case, the calculation of the coding parameters by the decoding information may not exceed the available computing resources, thereby ensuring the smooth progress of the calculation. However, if the first computing power is less than the computing power provided by the idle computing resources, then the coding parameter determination device adopts the default parameter calculation mode to calculate the coding parameters, which not only does not exceed the capacity provided by the idle computing resources, but also can ensure the accuracy of the coding parameters, that is, it is determined not to use the decoding information to determine the coding parameters.

[0241] In this embodiment, by comparing the first computing capacity with the available capacity of idle computing resources, the encoding parameter determination device can better evaluate the feasibility of using specific decoding information to determine encoding parameters. This helps balance the accuracy of the decoding information and the consumption of computing capacity within limited computing resources to adapt to different scenarios and needs. This is equivalent to adaptively determining whether to reuse the decoding parameters in the decoding information to determine the encoding parameters based on the actual computing capacity requirements of the default parameter calculation method. This not only helps control the fluctuation range of computing resources consumed by video encoding compression, but also balances computing resource consumption and encoding effects, thereby improving the encoding performance of the encoder.

[0242] In some embodiments, determining whether to use the decoding information to determine the encoding parameter based on the first computing capability may be implemented as follows:

[0243] Obtain a first resource usage rate of the encoder; convert the first computing capacity into the used computing resources of the encoder, and adjust the first resource usage rate based on the used computing resources to obtain a second resource usage rate; if the second resource usage rate is greater than or equal to a preset resource usage rate, determine to use the decoding information to determine the encoding parameters; if the second resource usage rate is less than the preset resource usage rate, determine not to use the decoding information to determine the encoding parameters.

[0244] Exemplarily, the encoding parameter determination device obtains a first resource utilization rate of the encoder: the first resource utilization rate represents the resource utilization of the encoder when performing encoding operations. This may include CPU utilization, memory utilization, disk I / O, etc. The encoding parameter determination device then converts the first computing capacity into computing resources used by the encoder. This can be achieved by comparing the first computing capacity with the encoder's total computing capacity. For example, if the first computing capacity is 30%, it can be considered that the encoder has used 30% of its computing resources. Next, the encoding parameter determination device adjusts the first resource utilization rate based on the computing resources used: adjusting the first resource utilization rate based on the computing resources used to obtain a second resource utilization rate. This can be achieved by adding the computing resources used to the first resource utilization rate to obtain the second resource utilization rate. For example, if 30% of the computing resources have been used and the first resource utilization rate is 50%, the second resource utilization rate is 80%. Thus, the encoding parameter determination device can compare the second resource utilization rate with a preset resource utilization rate. If the second resource utilization rate is greater than or equal to the preset resource utilization rate, it can be considered that if the default calculation mode is used to calculate the encoding parameter, the resource utilization rate of the encoder will be too high, that is, it is determined not to use the default calculation mode to calculate the encoding parameter. In other words, the encoding parameter determination device determines to use the decoding information to determine the encoding parameter.

[0245] If the second resource utilization rate is less than the preset resource utilization rate, it can be considered that if the default calculation mode is used to calculate the encoding parameter, it will not only not cause the resource utilization rate of the encoder to be too high, but also ensure the accuracy of the encoding parameter, that is, the default calculation mode can be used to calculate the encoding parameter. In other words, the encoding parameter determination device does not determine the encoding parameter using the decoding information.

[0246] In this embodiment, by obtaining the first resource utilization rate of the encoder, converting the first computing capacity into the used computing resources, and adjusting the first resource utilization rate, a more accurate second resource utilization rate can be obtained. This helps to better evaluate the resource utilization of the encoder when assuming that the encoding parameters are calculated using the default parameter calculation method, and thus can effectively make a decision on whether to use the decoding information to determine the encoding parameters. This is equivalent to adaptively determining whether to reuse the decoding parameters in the decoding information to determine the encoding parameters based on the actual demand for resource utilization. This is not only conducive to controlling the fluctuation range of the computing resources consumed by video encoding compression, but also can take into account and balance the consumption of computing resources and the encoding effect, thereby improving the encoding performance of the encoder.

[0247] In some embodiments, the encoding parameter determination apparatus determines whether to use the decoding parameter to determine the encoding parameter, which may be implemented as follows:

[0248] Obtain a first performance parameter, which is a performance parameter of the encoder when the encoder uses the decoding parameter to determine the encoding parameter; if the first performance parameter meets the performance parameter required by the business scenario, determine to use the decoding information to determine the encoding parameter; if the first performance parameter does not meet the performance parameter required by the business scenario, determine not to use the decoding information to determine the encoding parameter.

[0249] Exemplarily, the business scenario may include any one of the following: a scenario with low latency and high (frame) stability requirements (for example, an RTC scenario), a scenario with low latency requirements (for example, WebRTC), a scenario that takes both cost and (frame) stability into consideration (for example, HLS / DASH live broadcast), a cost-first scenario (on-demand scenario), etc.

[0250] For example, the coding parameter determination device may obtain a first performance parameter representing the performance of the encoder when calculating the coding parameters using a default parameter calculation method. The performance parameter may include metrics such as latency, output image stability, and resource cost. Next, the coding parameter determination device compares the first performance parameter with performance parameters required by the business scenario. The performance parameters required by the business scenario may be determined based on actual application requirements, such as latency, output image stability, and resource cost. The performance parameters required by the business scenario and the first performance parameter may be of the same or different parameter types, and in such cases, they need to be mapped to the same mapping space for comparison. If the first performance parameter meets the performance parameter requirements of the business scenario, meaning that the encoder's performance meets the requirements of the actual application, the coding parameter determination device will determine that using the decoding information to determine the coding parameters is feasible. However, if the first performance parameter does not meet the performance parameter requirements of the business scenario, meaning that the encoder's performance does not meet the requirements of the actual application, the coding parameter determination device will determine that using the decoding information to determine the coding parameters is infeasible or uneconomical. In this case, even if the decoding information helps reduce the computational complexity of the coding parameters, it may not meet the performance requirements of the actual application and is therefore not worth using.

[0251] In this embodiment, by evaluating the matching degree between the first performance parameter and the performance parameter required by the business scenario, the coding parameter determination device can better balance the computational complexity of the coding parameter and the performance requirements of the actual application to adapt to different scenarios and requirements. This is equivalent to adaptively determining whether to reuse the decoding parameters in the decoding information to determine the coding parameter based on the performance parameters required by the business scenario. This is not only conducive to controlling the fluctuation range of the computing resources consumed by video coding compression, but also can take into account and balance the consumption of computing resources and the coding effect, thereby improving the coding performance of the encoder.

[0252] Of course, in other embodiments, if the first performance parameter is the performance parameter of the encoder when the encoder uses the default parameter calculation method to determine the encoding parameter; if the first performance parameter meets the performance parameter required by the business scenario, it is determined not to use the decoding information to determine the encoding parameter; if the first performance parameter does not meet the performance parameter required by the business scenario, it is determined to use the decoding information to determine the encoding parameter.

[0253] It should be noted that the quality assessment value, the first computing capability and the first performance parameter mentioned above may consider only one factor or multiple mappings thereof. The specific implementation method may vary depending on the application scenario and requirements, and may even consider other factors. This application does not make specific limitations on this.

[0254] For example, after the encoding parameter determination device obtains the decoding information and reconstructed image data, such as luminance and chrominance (YCbCr, YUV) information, it can determine the encoding parameters of the reconstructed image based on the image quality of the reconstructed image, the idleness of the encoder's computing resources and the computing cost, and control whether to reuse the decoding parameters in the decoding information, so as to smoothly control the encoding performance and resource consumption of the encoding parameters. In this way, it can ensure relatively smooth control of computing resource consumption under the condition of a certain loss of video DB-rate. For example, after testing, the computing resource load of the encoder can be increased by 5-10 points, saving the cost of video media processing transcoding, and helping video users reduce costs and increase efficiency in media processing transcoding, especially for scenarios such as video media processing and live broadcast.

[0255] For example, in other alternative embodiments, other factors may need to be considered to determine whether to use the decoded information to determine the encoding parameters of the reconstructed image, such as the reliability of the decoded information, real-time requirements, etc.

[0256] FIG10 is a schematic diagram of using decoding parameters in an encoding kernel according to an embodiment of the present application.

[0257] As shown in FIG10 , after obtaining the data and decoding information of the decoded image, the coding parameter determination device can apply the information in the decoding information to the coding parameters that need to be determined during the pre-analysis process and the coding process performed by the coding core.

[0258] The decoding information may include the following information: ① frame type, ② segmentation type, ③ macroblock type, ④ motion vector, ⑤ macroblock size, ⑥ bit rate, and ⑦ quantization parameter.

[0259] For the pre-analysis process, it may include: obtaining decoded frames and buffering a certain number of decoded frames, then generating 1 / 2×1 / 2 downsampled frames, performing intra-frame / inter-frame analysis on the downsampled frames in units of MxN bit blocks (for example, the segmentation type of CU, PU, ​​TU and the corresponding prediction mode); then counting the intra-frame / inter-frame calculation cost of the entire frame and determining the frame type; then calculating the blur complexity of the frame, calculating the frame-level QP and allocating the bit rate.

[0260] Among them, the most computationally resource-consuming process in the pre-analysis process includes: the process of performing intra-frame / inter-frame analysis on the downsampled frame in units of MxN bit blocks, and the encoding parameters determined include parameters such as segmentation type and motion vector. When determining these encoding parameters, reference can be made to ② to ⑤ in the decoding information. For example, whether to refer to the information in ② to ⑤ can be determined based on the application scenario's requirements for latency and computational resource consumption. For example, when referring to ④, it can be used as the starting search point of the search process, which can greatly accelerate the search process, and the optimal MV found can be used as the MV used when encoding the current decoded image, thereby improving the transcoding speed and the accuracy of bit rate control.

[0261] Furthermore, in the pre-analysis process, the decision on I / P / B frame type consumes significant computational resources, for example, by determining the B / P ratio based on the cost of encoding a B frame versus the cost of encoding a P frame. Furthermore, since the normal need to advance frame by frame increases computational resources exponentially, in this embodiment, a comprehensive assessment of application scenario latency and computational resource consumption can be used to determine whether to refer to step ① to determine the frame type used for encoding the currently decoded frame, thereby reducing computational resource consumption. Regarding the pre-analysis process of calculating frame-level QP and allocating bitrate, a comprehensive assessment of application scenario latency and computational resource consumption can be used to determine whether to refer to steps ⑤ to ⑦ to determine the bitrate and frame-level QP used for encoding the currently decoded frame, thereby reducing computational resource consumption.

[0262] The encoding process may include: performing intra / inter analysis on the original decoded frame (e.g., the partitioning type of CU, PU, ​​TU and the corresponding prediction mode), then performing intra prediction / inter search, followed by mode decision / rate-distortion optimization, and finally transform, quantization, entropy coding, code control update, and bitstream output. The information that can be referenced during the encoding process is similar to the pre-analysis process. Specifically, the intra / inter analysis process may consider whether to refer to ② to ⑤, the intra prediction / inter search process may consider whether to refer to ④, and the mode decision / rate-distortion optimization process may consider whether to refer to ⑤ to ⑦. This determines the bitrate and frame-level QP used to encode the current decoded frame, thereby reducing the consumed computing resources.

[0263] In this embodiment, by referring to the decoding information in the pre-analysis process and the encoding process where computing resources are consumed more, it is possible to ensure relatively smooth control of computing resource consumption when a certain video DB-rate is lost. For example, after testing, the computing resource load of the encoder can be increased by 5-10 points, saving the cost of video media processing and transcoding, and helping video users reduce costs and increase efficiency in media processing and transcoding, especially for scenarios such as video media processing and live broadcast.

[0264] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the embodiments mentioned above. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all fall within the scope of protection of the present application. For example, the various specific technical features described in the specific embodiments mentioned above can be combined in any suitable manner unless there is any contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, and as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.

[0265] It should also be understood that in the various method embodiments of the present application, the size of the serial numbers of the processes involved above does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0266] The following describes in detail an embodiment of the device of the present application in conjunction with FIG. 11 and FIG. 12 .

[0267] FIG11 is a schematic block diagram of a coding parameter determination apparatus 500 provided in the present application.

[0268] As shown in FIG11 , the coding parameter determination apparatus 500 may include:

[0269] A parsing unit 510 is configured to parse a code stream to obtain an image to be decoded and decoding information;

[0270] A decoding unit 520 is configured to decode the image to be decoded using the decoding information to obtain a reconstructed image;

[0271] The determining unit 530 is configured to determine encoding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information.

[0272] In some embodiments, before determining the encoding parameters for re-encoding the reconstructed image, the determining unit 530 is further configured to:

[0273] A parameter in the decoding information having the same parameter type as the encoding parameter is determined as the decoding parameter.

[0274] In some embodiments, the determining unit 530 is specifically configured to:

[0275] The decoding parameter is determined as the encoding parameter.

[0276] In some embodiments, the determining unit 530 is specifically configured to:

[0277] The encoding parameter is determined based on the decoding parameter using a parameter calculation mode that matches the parameter type of the encoding parameter.

[0278] In some embodiments, if the encoding parameter includes a first motion vector, the parameter calculation mode that matches the parameter type of the encoding parameter includes a parameter calculation mode that matches the motion vector, and the parameter calculation mode that matches the motion vector includes at least one of the following:

[0279] A first search mode for searching using a motion vector in the decoded parameter as a starting search point;

[0280] a second search mode for searching with a higher precision than the precision of the motion vector in the decoded parameter;

[0281] A third search mode having a search range smaller than the search range used by the default calculation mode of the motion vector.

[0282] In some embodiments, the determining unit 530 is specifically configured to:

[0283] Determining a candidate parameter set for the encoding parameter based on the decoding parameter;

[0284] By traversing the parameters in the candidate parameter set, the optimal parameter in the candidate parameter set is determined as the encoding parameter.

[0285] In some embodiments, if the encoding parameter includes a first segmentation type, the candidate parameter set for the first segmentation type includes: the segmentation type in the decoding parameter, the segmentation type of the previous level of the level to which the segmentation type in the decoding parameter belongs, and the segmentation type of the next level of the level to which the segmentation type in the decoding parameter belongs.

[0286] In some embodiments, if the encoding parameter includes a first parameter, the candidate parameter set of the first parameter includes: multiple sampling values ​​obtained by sampling in a first value range, or multiple adjustment values ​​obtained by adjusting the value of a parameter of the same parameter type as the first parameter in the decoding parameter; wherein the difference between the upper limit value and the lower limit value of the first value range is equal to a preset threshold, and the value of the parameter of the same parameter type as the first parameter in the decoding parameter is within the first value range.

[0287] In some embodiments, before determining the encoding parameters for re-encoding the reconstructed image, the determining unit 530 is further configured to:

[0288] It is determined whether to use the decoding parameters to determine the encoding parameters.

[0289] In some embodiments, the determining unit 530 is specifically configured to:

[0290] Evaluating the quality of the reconstructed image to obtain a quality evaluation value;

[0291] If the quality evaluation value is greater than or equal to the preset evaluation value, determining to use the decoding parameter to determine the encoding parameter;

[0292] If the quality evaluation value is less than the preset evaluation value, it is determined not to use the decoding parameter to determine the encoding parameter.

[0293] In some embodiments, the determining unit 530 is specifically configured to:

[0294] Obtaining a first computing capability, where the first computing capability is the computing capability consumed when the encoder calculates the encoding parameter using a default parameter calculation method;

[0295] Based on the first computing capability, it is determined whether to use the decoding parameter to determine the encoding parameter.

[0296] In some embodiments, the determining unit 530 is specifically configured to:

[0297] If the first computing capability is greater than or equal to the computing capability provided by the idle computing resources of the encoder, determining to use the decoding parameter to determine the encoding parameter;

[0298] If the first computing capability is less than the computing capability provided by the idle computing resource, it is determined not to use the decoding parameter to determine the encoding parameter.

[0299] In some embodiments, the determining unit 530 is specifically configured to:

[0300] Obtaining a first resource usage rate of the encoder;

[0301] Converting the first computing capacity into used computing resources of the encoder, and adjusting the first resource usage rate based on the used computing resources to obtain a second resource usage rate;

[0302] If the second resource usage rate is greater than or equal to the preset resource usage rate, determining to use the decoding parameter to determine the encoding parameter;

[0303] If the second resource usage rate is less than the preset resource usage rate, it is determined not to use the decoding parameter to determine the encoding parameter.

[0304] In some embodiments, the determining unit 530 is specifically configured to:

[0305] Obtaining a first performance parameter, where the first performance parameter is a performance parameter of the encoder when the encoder determines the encoding parameter using the decoding parameter;

[0306] If the first performance parameter meets the performance parameter required by the business scenario, determining to use the decoding parameter to determine the encoding parameter;

[0307] If the first performance parameter does not meet the performance parameter required by the business scenario, it is determined not to use the decoding parameter to determine the encoding parameter.

[0308] In some embodiments, the decoding information includes at least one of the following: image type, partition type, macroblock type, motion vector, macroblock size, bit rate, quantization parameter, and the number of bits occupied by the macroblock in the bitstream.

[0309] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions can refer to the method embodiment. To avoid repetition, they are not described here. Specifically, the device 500 shown in Figure 11 can correspond to the corresponding subject in the method 400 of the embodiment of the present application, and the aforementioned and other operations and / or functions of each unit in the device 500 are respectively for implementing the corresponding process in the method 400.

[0310] It should also be understood that the various units in the device 500 involved in the embodiment of the present application are divided based on logical functions. In practical applications, the function of a unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit, or even these functions can also be implemented with the assistance of one or more other units. For example, part or all of the device 500 is merged into one or several other units. For another example, a certain unit (or units) in the device 500 can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. For another example, the device 500 can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0311] According to another embodiment of the present application, the apparatus 500 involved in the embodiment of the present application and the method for determining the coding parameters of the embodiment of the present application can be constructed by running a computer program (including program code) capable of executing each step involved in the corresponding method on a general-purpose computing device including a general-purpose computer such as a central processing unit (CPU), a random access memory (RAM), and a read-only memory (ROM) processing element and a storage element. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into an electronic device via the computer-readable storage medium, so that the computer program executes the corresponding method of the embodiment of the present application when it is run in the electronic device.

[0312] In other words, the units mentioned above can be implemented in the form of hardware, or can be implemented by software instructions, or can be implemented in the form of a combination of hardware and software.

[0313] Specifically, each step of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software instructions in the processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor for execution, or can be completed by a combination of hardware and software in the decoding processor. Optionally, the software can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The processor reads the information in the storage medium and completes the steps in the method embodiment mentioned above in combination with its hardware.

[0314] FIG12 is a schematic structural diagram of an electronic device 600 provided in this application.

[0315] As shown in Figure 12, the electronic device 600 includes at least a processor 610 and a computer-readable storage medium 620. The processor 610 and the computer-readable storage medium 620 may be connected via a bus or other means. The computer-readable storage medium 620 is used to store a computer program 621, which includes computer instructions. The processor 610 is used to execute the computer instructions stored in the computer-readable storage medium 620. The processor 610 is the computing core and control core of the electronic device 600 and is suitable for implementing one or more computer instructions, specifically loading and executing one or more computer instructions to implement the corresponding method flow or corresponding function.

[0316] For example, the processor 610 may also be referred to as a central processing unit (CPU). The processor 610 may include, but is not limited to, a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, discrete hardware components, and the like.

[0317] Exemplarily, the computer-readable storage medium 620 may be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it may be at least one computer-readable storage medium located away from the aforementioned processor 610. Specifically, the computer-readable storage medium 620 includes, but is not limited to: volatile memory and / or non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0318] As shown in FIG. 12 , the electronic device 600 may further include a transceiver 630 .

[0319] The processor 610 may control the transceiver 630 to communicate with other devices. Specifically, the processor 610 may send information or data to other devices or receive information or data sent by other devices. The transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include one or more antennas.

[0320] Exemplarily, the electronic device 600 may be a coding parameter determination device involved in an embodiment of the present application; the computer-readable storage medium 620 stores computer instructions; the processor 610 loads and executes the computer instructions stored in the computer-readable storage medium 620 to implement the corresponding steps in the coding parameter determination method provided in the present application; in other words, the computer instructions in the computer-readable storage medium 620 are loaded by the processor 610 and the corresponding steps are executed. To avoid repetition, they are not repeated here.

[0321] For example, the encoding parameter determination device involved in the embodiments of the present application may be an encoder.

[0322] According to another aspect of the present application, the present application also provides a coding and decoding system, including the encoder and decoder mentioned above.

[0323] According to another aspect of the present application, the present application also provides a computer-readable storage medium (Memory), which stores computer instructions. When the computer instructions are read and executed by the processor of a computer device, the computer device executes the encoding parameter determination method involved above.

[0324] Among them, the computer-readable storage medium is a memory device in a decoder or encoder for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The computer-readable storage medium can be used to provide storage space, and the storage space can store the operating system of the electronic device. In addition, one or more computer instructions suitable for being loaded and executed by the processor are also stored in the storage space, for example, one or more computer instructions for executing the encoding parameter determination method mentioned above are stored, and these computer instructions can be one or more computer programs (including program codes).

[0325] According to another aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer to perform the coding parameter determination method provided in the various optional embodiments described above.

[0326] It should be understood that the computer device involved in the present application can be any device or apparatus capable of performing data processing, for example, including but not limited to: a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. In addition, the computer instructions involved in the present application can be stored in a computer-readable storage medium, or can be transmitted between one computer-readable storage medium and another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0327] According to another aspect of the present application, the present application further provides a code stream, which may be a code stream generated using the coding parameter determination method provided by the present application.

[0328] Those skilled in the art will appreciate that the units and process steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0329] Finally, it should be noted that the above content is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for determining coding parameters, characterized in that, including: analyzing a bitstream to obtain an image to be decoded and decoding information; decoding the image to be decoded by using the decoding information to obtain a reconstructed image; determining encoding parameters for re-encoding the reconstructed image based on decoding parameters in the decoding information.

2. The method according to claim 1, wherein Before the determining of the encoding parameters for re-encoding the reconstructed image, the method further includes: determining, as the decoding parameters, parameters in the decoding information whose parameter types are the same as those of the encoding parameters.

3. The method according to claim 1 or 2, characterized in that, The determining of the encoding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information includes: determining the decoding parameters as the encoding parameters.

4. The method according to claim 1 or 2, characterized in that, The determining of the encoding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information includes: determining the encoding parameters based on the decoding parameters by using a parameter calculation mode matching the parameter type of the encoding parameters.

5. The method according to claim 4, wherein If the encoding parameters include a first motion vector, the parameter calculation mode matching the parameter type of the encoding parameters includes a parameter calculation mode matching the motion vector, and the parameter calculation mode matching the motion vector includes at least one of the following: a first search mode that searches starting from the motion vector in the decoding parameters; a second search mode that searches with a higher precision than the precision of the motion vector in the decoding parameters; a third search mode whose search range is smaller than the search range used by a default calculation mode of the motion vector.

6. The method according to claim 1 or 2, characterized in that, The determining of the encoding parameters for re-encoding the reconstructed image based on the decoding parameters in the decoding information includes: determining a candidate parameter set of the encoding parameters based on the decoding parameters; determining the optimal parameter in the candidate parameter set as the encoding parameters by traversing the parameters in the candidate parameter set.

7. The method according to claim 6, wherein If the encoding parameters include a first segmentation type, the candidate parameter set of the first segmentation type includes: the segmentation type in the decoding parameters, the segmentation type of the upper level of the level to which the segmentation type in the decoding parameters belongs, and the segmentation type of the lower level of the level to which the segmentation type in the decoding parameters belongs.

8. The method according to claim 6 or 7, characterized in that, If the encoding parameters include a first parameter, the candidate parameter set of the first parameter includes: a plurality of sampled values sampled within a first value range, or a plurality of adjusted values obtained by adjusting the value of a parameter in the decoding information whose parameter type is the same as that of the first parameter; wherein the difference between the upper limit value and the lower limit value of the first value range is equal to a preset threshold, and the value of the parameter in the decoding information whose parameter type is the same as that of the first parameter is within the first value range.

9. The method according to any one of claims 1 to 8, characterized in that Before the determining of the encoding parameters for re-encoding the reconstructed image, the method further includes: determining whether to use the decoding parameters to determine the encoding parameters.

10. The method according to claim 9, characterized in that, The determining of whether to use the decoding parameters to determine the encoding parameters includes: evaluating the quality of the reconstructed image to obtain a quality evaluation value; if the quality evaluation value is greater than or equal to a preset evaluation value, determining to use the decoding parameters to determine the encoding parameters; If the quality evaluation value is less than the preset evaluation value, it is determined not to use the decoding parameters to determine the encoding parameters.

11. The method according to claim 9, characterized in that, The determination of whether to use the decoding parameters to determine the encoding parameters includes: Obtaining a first computing capacity, where the first computing capacity is the computing capacity consumed by the encoder when calculating the encoding parameters using the default parameter calculation method; Based on the first computing capacity, determining whether to use the decoding parameters to determine the encoding parameters.

12. The method according to claim 11, wherein The determination based on the first computing capacity of whether to use the decoding parameters to determine the encoding parameters includes: If the first computing capacity is greater than or equal to the computing capacity provided by the idle computing resources of the encoder, it is determined to use the decoding parameters to determine the encoding parameters; If the first computing capacity is less than the computing capacity provided by the idle computing resources, it is determined not to use the decoding parameters to determine the encoding parameters.

13. The method according to claim 11, characterized in that The determination based on the first computing capacity of whether to use the decoding parameters to determine the encoding parameters includes: Obtaining a first resource utilization rate of the encoder; Converting the first computing capacity into the used computing resources of the encoder, and adjusting the first resource utilization rate based on the used computing resources to obtain a second resource utilization rate; If the second resource utilization rate is greater than or equal to a preset resource utilization rate, it is determined to use the decoding parameters to determine the encoding parameters; If the second resource utilization rate is less than the preset resource utilization rate, it is determined not to use the decoding parameters to determine the encoding parameters.

14. The method according to claim 9, characterized in that The determination of whether to use the decoding parameters to determine the encoding parameters includes: Obtaining a first performance parameter, where the first performance parameter is the performance parameter of the encoder when using the decoding parameters to determine the encoding parameters; If the first performance parameter meets the performance parameters required by the service scenario, it is determined to use the decoding parameters to determine the encoding parameters; If the first performance parameter does not meet the performance parameters required by the service scenario, it is determined not to use the decoding parameters to determine the encoding parameters.

15. The method according to any one of claims 1 to 14, characterized in that The decoding information includes at least one of the following: image type, segmentation type, type of macroblock, motion vector, size of macroblock, bit rate, quantization parameter, number of bits occupied by the macroblock in the bitstream.

16. An encoding parameter determination device, characterized in that, It includes: A parsing unit for parsing the bitstream to obtain the image to be decoded and decoding information; A decoding unit for decoding the image to be decoded using the decoding information to obtain a reconstructed image; A determination unit for determining, based on the decoding parameters in the decoding information, the encoding parameters for re-encoding the reconstructed image.

17. An electronic device, characterized in that, It includes: A processor suitable for executing a computer program; A computer-readable storage medium storing a computer program, and when the computer program is executed by the processor, it implements the method according to any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that, For storing a computer program, when the computer program runs on a computer, it causes the computer to execute the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Direct mode selection based H.264 / AVC (Advanced Video Coding) fast transcoding method and device

    CN101888547A

  • DVC-HEVC video transcoding method based on Fisher discriminant

    CN108769696A

  • Video transcoding method and device, electronic equipment and storage medium

    CN113014926A

  • Video transcoding method and device, electronic equipment and storage medium

    CN116916066A

  • Coding parameter determination method and device, electronic equipment and storage medium

    CN117579820A