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

By decoding the initial video compressed file and using decoded data for prediction encoding, the problem of large hardware resources consumption and slow transcoding speed in the video transcoding process in the prior art is solved, and more efficient video transcoding is achieved.

CN119697380APending Publication Date: 2025-03-25BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411621571.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art consumes a lot of hardware resources and slows the transcoding speed during the video transcoding process.

Method used

By decoding the initial video compressed file, the decoded data set is obtained, and the frame to be encoded is predicted and encoded based on the decoded data, the video transcoding process is optimized.

Benefits of technology

Effectively improve the utilization rate of decoded data, reduce hardware resource consumption, and improve the transcoding speed and transcoding efficiency of video files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697380A_ABST
    Figure CN119697380A_ABST
Patent Text Reader

Abstract

The invention provides a video transcoding method and device, electronic equipment and a readable storage medium, and relates to the technical field of artificial intelligence such as video processing, big data and cloud service. The video transcoding method comprises the following steps: decoding an initial video compressed file to obtain an original video compressed file and a decoding data set obtained in a decoding process; according to the position of the first coding unit in the to-be-coded frame, obtaining target decoding sub-data from decoding data corresponding to the to-be-coded frame; performing predictive coding on the first coding unit according to the target decoding sub-data to obtain a first prediction block of the to-be-coded frame; and obtaining a target video compressed file according to each to-be-coded frame and the corresponding first prediction block. The encoding process can be optimized by utilizing the decoding data set obtained in the decoding process, so that the consumption of hardware resources is reduced, and the transcoding speed and transcoding efficiency of the video file are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and in particular to the field of artificial intelligence technology such as video processing, big data, and cloud services. A video transcoding method, device, electronic device, and readable storage medium are provided. Background Art

[0002] In the prior art, when performing video transcoding, the method usually adopted is: after decoding the initial video compression file, a certain fixed encoding parameter configuration is used to encode the original video compression file obtained by decoding, that is, the original video compression file is encoded without prior knowledge, thereby completing the video transcoding. The video transcoding method of the prior art has the problems of large hardware resource consumption and slow transcoding speed. Summary of the invention

[0003] According to a first aspect of the present disclosure, a video transcoding method is provided, comprising: decoding an initial video compression file to obtain an original video compression file and a decoded data set obtained during the decoding process, wherein each decoded data included in the decoded data set corresponds to a frame to be encoded in the original video compression file; obtaining target decoding sub-data from the decoded data corresponding to the frame to be encoded according to a position of a first encoding unit in the frame to be encoded; predictively encoding the first encoding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be encoded; and obtaining a target video compression file according to each frame to be encoded and its corresponding first prediction block.

[0004] According to a second aspect of the present disclosure, a video transcoding device is provided, comprising: a decoding unit, configured to decode an initial video compression file to obtain the original video compression file and a decoded data set obtained during the decoding process, wherein each decoded data included in the decoded data set corresponds to a frame to be encoded in the original video compression file; a processing unit, configured to obtain target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded; a prediction unit, configured to perform predictive encoding on the first encoding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be encoded; and an encoding unit, configured to obtain a target video compression file according to each frame to be encoded and its corresponding first prediction block.

[0005] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0006] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.

[0007] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method as described above when executed by a processor.

[0008] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0010] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0011] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0012] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;

[0013] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0014] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure;

[0015] Figure 6 It is a block diagram of an electronic device used to implement the video transcoding method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and mechanisms is omitted in the following description.

[0017] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the video transcoding method of this embodiment specifically includes the following steps:

[0018] S101, decoding an initial video compression file to obtain an original video compression file and a decoded data set obtained during the decoding process, wherein each decoded data included in the decoded data set corresponds to a frame to be encoded in the original video compression file;

[0019] S102, acquiring target decoding sub-data from decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded;

[0020] S103, performing predictive coding on the first coding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be encoded;

[0021] S104: Obtain a target video compression file according to each frame to be encoded and its corresponding first prediction block.

[0022] The video transcoding method of this embodiment optimizes the predictive coding process of the first coding unit of the frame to be encoded in the original video compression file by using the decoded data set obtained when decoding the initial video compression file. This can effectively improve the utilization rate of the decoded data and avoid the problem of the prior art that a large number of prediction modes need to be searched during the predictive coding process due to the discarding of the decoded data (i.e., no prior knowledge). This reduces the consumption of hardware resources and improves the transcoding speed and efficiency of video files.

[0023] When executing S101, this embodiment may call a video decoder module to perform video decoding on the initial video compression file; this embodiment does not limit the type of the video decoder module.

[0024] In this embodiment, when the video decoding operation of the initial video compression file is performed through the video decoder module, the video parameter set (Video Parameter Set, VPS), sequence parameter set (Sequence Parameter Set, SPS), picture parameter set (Picture Parameter Set, PPS), etc. in the decoding process can be counted, so as to obtain the decoding data corresponding to each video frame (i.e., the frame to be encoded) in the original video compression file obtained after decoding the initial video compression file.

[0025] In this embodiment, the decoded data corresponding to different frames to be encoded include decoded video information (e.g., decoding header information), decoded video frame information (e.g., frame sequence number, frame type, frame resolution, coding block size, minimum prediction block, minimum transform block, reference frame information (e.g., reference frame list, reference frame absolute position difference, etc.) of the frame to be decoded corresponding to the frame to be encoded), and decoded video block information (e.g., residual coding bits of the second coding unit, prediction mode of the second prediction unit (intra-frame prediction mode or inter-frame prediction mode), motion vector of the second prediction unit, intra-frame prediction mode of the second prediction unit, etc.).

[0026] It can be understood that the first coding unit, the first prediction unit, etc. in this embodiment are coding units or prediction units corresponding to the frame to be encoded, and the second coding unit, the second prediction unit, etc. are coding units or prediction units corresponding to the frame to be decoded.

[0027] In this embodiment, the frames to be decoded are video frames in the initial video compression file. By decoding the initial video compression file through the video decoder module, corresponding frames to be encoded can be obtained according to different frames to be decoded, and then the relevant information obtained during the decoding process of the frames to be decoded is statistically analyzed to obtain decoding data corresponding to the frames to be encoded.

[0028] In this embodiment, according to the position of the second coding unit or the second prediction unit in the frame to be decoded, the corresponding information is stored in the decoded video block information in units of the minimum coding block or the minimum prediction block (the prediction block corresponding to the second coding unit is the second prediction block); for example, the residual coding bits corresponding to the minimum coding block of each second coding unit are stored in the decoded video block information, the prediction mode corresponding to the minimum prediction block of each second prediction unit is stored in the decoded video block information, the motion vector (forward motion vector, backward motion vector, forward and backward motion vector, etc.) corresponding to the minimum prediction block of each second prediction unit is stored in the decoded video block information, and the intra-frame prediction mode corresponding to the minimum prediction block of each second prediction unit is stored in the decoded video block information.

[0029] For example, when executing S101 in this embodiment, the decoded data set may be stored in the form of DecodeFrameBuf[i], where i represents the frame to be encoded whose display order is the i-th frame.

[0030] After executing S101 to obtain the original video compression file and the decoded data set obtained during the decoding process, this embodiment executes S102 to obtain target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded.

[0031] After completing the decoding of the initial video compression file, the encoding process of the obtained original video compression file can be carried out; this embodiment can call the video encoder module to transmit the obtained original video compression file and the decoded data set to the video encoder module to complete the video transcoding, thereby obtaining the target video compression file.

[0032] In this embodiment, the frame to be encoded may be first divided into a plurality of first coding units (Coding Unit, CU), and then prediction encoding is performed on the plurality of first coding units obtained by division, where the first coding unit is the original pixel block in the frame to be encoded.

[0033] Since the resolution of the video may change before and after the video is transcoded, when executing S102, the present embodiment obtains the target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the encoding unit in the frame to be encoded. The implementation method that can be adopted is: determine the target position of the first encoding unit in the frame to be decoded according to the target video resolution, image filling pixels, initial video resolution and the position of the first encoding unit in the frame to be encoded; obtain partial decoded data corresponding to the determined target position (for example, corresponding video block information) from the decoded data corresponding to the frame to be encoded as the target decoding sub-data.

[0034] That is to say, when the resolutions before and after video transcoding are different, this embodiment can obtain the target decoding sub-data corresponding to the first coding unit from the decoded data corresponding to the current frame to be encoded based on information such as the resolutions before and after transcoding, thereby improving the accuracy of the obtained target decoding sub-data, and further improving the accuracy of predictive decoding of the first coding unit based on the target decoding sub-data.

[0035] It is understandable that if the resolution of the video does not change before and after transcoding, this embodiment can directly use the position of the first coding unit in the frame to be encoded as the target position of the first coding unit in the frame to be decoded when executing S102.

[0036] In this embodiment, after executing S102 to obtain target decoding sub-data from the decoded data corresponding to the frame to be encoded, executing S103 to perform predictive encoding on the first encoding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be encoded.

[0037] In this embodiment, when executing S103, predictive encoding is performed on the first coding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded, the implementation method that can be adopted is: determining the frame type of the frame to be encoded according to the target decoding sub-data; using the prediction encoding method corresponding to the determined frame type, predictive encoding is performed on the first coding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded.

[0038] In this embodiment, the frame type of the frame to be encoded is the same as the frame type of the corresponding frame to be decoded, that is, if the frame type of the frame to be decoded is an I frame, the frame type of the frame to be encoded corresponding to the frame to be decoded is also an I frame, if the frame type of the frame to be decoded is a P frame or a B frame, the frame type of the frame to be encoded corresponding to the frame to be decoded is also a P frame or a B frame.

[0039] That is to say, this embodiment pre-sets prediction coding methods corresponding to different frame types, so that the first coding units in the to-be-encoded frames belonging to different frame types are prediction-encoded according to the corresponding prediction coding methods, which can further improve the accuracy of the first prediction block obtained by prediction coding.

[0040] After executing S103 to obtain the first prediction block of the frame to be encoded, this embodiment executes S104 to obtain a target video compression file according to each frame to be encoded and its corresponding first prediction block.

[0041] In this embodiment, the video encoding process may include prediction, transformation, quantization, entropy coding, inverse quantization, inverse transformation and loop filtering.

[0042] For the prediction process, the first coding unit is taken as the original pixel block, and intra-frame prediction or inter-frame prediction is performed on the first coding unit to obtain a first prediction block, that is, step S103 in this embodiment; the original pixel block and the first prediction block are subtracted to obtain a residual pixel block.

[0043] For the transformation process, the input is a residual pixel block, and the output is a transformation coefficient block converted from the residual pixel block through matrix multiplication transformation.

[0044] For the quantization process, the transform coefficient block is subjected to signal processing to reduce the amplitude of the signal and obtain a quantized signal.

[0045] For the entropy coding process, entropy coding is performed on the quantized signal to obtain a coded bit stream of the video.

[0046] For the inverse quantization, inverse transformation and loop filtering process, the quantized signal is inversely quantized and inversely transformed, and then added to the predicted pixel block. The result is loop filtered to reconstruct the video image.

[0047] When executing S104, this embodiment can perform subsequent transformation, quantization, entropy coding, inverse quantization, inverse transformation and loop filtering processes after obtaining the residual pixel block according to the first prediction unit and the first prediction block in the frame to be encoded, so as to obtain the final target video compression file.

[0048] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure. Figure 2As shown in , this embodiment, when executing “using the prediction encoding method corresponding to the determined frame type, predictively encoding the first encoding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded”, may include the following contents:

[0049] S201: When it is determined that the frame type of the frame to be encoded is an I frame, determine a prediction block segmentation mode of the first coding unit according to the target decoding sub-data:

[0050] S202, determining a prediction mode of a prediction block of the first coding unit according to the target decoding sub-data;

[0051] S203 . Obtain a first prediction block of the to-be-encoded frame according to the prediction block segmentation method and the prediction block prediction mode.

[0052] That is to say, when the frame type of the frame to be encoded is determined to be an I frame, the present embodiment determines the prediction block segmentation mode and the prediction block prediction mode (intra-frame prediction mode) of the first encoding unit according to the target decoding sub-data corresponding to the frame to be encoded, thereby accelerating the prediction process in the encoding process according to the decoding-related information obtained during the decoding process, which can improve the acquisition speed and efficiency of the first prediction block, and thus correspondingly improve the speed and efficiency of video transcoding.

[0053] When this embodiment performs S201 to determine the prediction block segmentation method of the first coding unit according to the target decoding sub-data, the implementation method that can be adopted is: according to the residual coding bits in the target decoding sub-data, obtain the first decoding residual mean and the first decoding residual variance corresponding to the first coding unit, and the second decoding residual mean and the second decoding residual variance corresponding to the frame to be encoded; determine the prediction block segmentation method of the first coding unit according to the first decoding residual mean, the first decoding residual variance, the second decoding residual mean and the second decoding residual variance.

[0054] Among them, when executing S201, this embodiment determines that the prediction mode in the target decoding sub-data only includes the direct current (DC) mode or the planar mode, or the prediction mode only includes the intra-frame angle prediction mode, and the angle difference between the maximum intra-frame angle prediction mode and the minimum intra-frame angle prediction mode is less than the first threshold, then the quadtree division and N×N division of the first coding unit are skipped, and "searching the first coding unit of the current layer" is used as the prediction block segmentation method.

[0055] When executing S201 in this embodiment, if it is determined that the mean of the first decoding residual is less than the second threshold and the variance of the first decoding residual is less than the third threshold, the quadtree division and N×N division of the first coding unit are skipped, and "searching the first coding unit of the current layer" is used as the prediction block segmentation method.

[0056] When executing S201 in this embodiment, if it is determined that the first decoding residual variance is greater than (the second decoding residual variance × a) and the first decoding residual variance is greater than the fourth threshold, "searching for the first coding unit of the current layer" is skipped, and quadtree division or N×N division is used as the prediction block segmentation method; a in this embodiment is a constant.

[0057] When executing S202 of this embodiment to determine the prediction block prediction mode of the first coding unit according to the target decoding sub-data, the implementation method that can be adopted is: according to the intra-frame angle prediction mode in the target decoding sub-data, the angle mean and angle variance of the intra-frame angle prediction mode corresponding to the first coding unit are obtained; according to the angle mean and the angle variance, the prediction block prediction mode of the first coding unit is determined.

[0058] Among them, when executing S202, this embodiment, if it is determined that the angle variance is greater than the fifth threshold, not all intra-frame prediction modes are searched, and only a few preset intra-frame prediction modes can be searched to determine the prediction block prediction mode; if it is determined that the angle variance is less than or equal to the fifth threshold, a search can be performed in the DC mode and the plane mode to determine the prediction block prediction mode, and a search can also be performed in the intra-frame angle prediction mode within the angle range of the angle mean and the surrounding +N angles, or the angle mean and the surrounding -N angles to determine the prediction block prediction mode.

[0059] That is to say, this embodiment can be combined with the decoded sub-data corresponding to the first coding unit to accelerate the search process of the prediction block segmentation mode and the prediction block prediction mode, without the need to search the full segmentation mode or the full prediction mode. It can improve the speed and efficiency in determining the prediction block segmentation mode and the prediction block prediction mode, thereby improving the transcoding speed and transcoding efficiency of the video.

[0060] When executing S203, this embodiment may divide the first prediction unit (ie, the prediction unit corresponding to the first coding unit) according to the determined prediction block division mode, and then obtain the first prediction block according to the determined prediction block prediction mode.

[0061] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure. Figure 3 As shown in , this embodiment, when executing “using the prediction encoding method corresponding to the determined frame type, predictively encoding the first encoding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded”, may include the following contents:

[0062] S301: When it is determined that the frame type of the frame to be encoded is a P frame or a B frame, determine a prediction block segmentation mode of the first coding unit according to the target decoding sub-data:

[0063] S302, determining a motion estimation algorithm for the first coding unit according to the target decoding sub-data;

[0064] S303: Obtain a first prediction block of the frame to be encoded according to the prediction block segmentation method and the motion estimation algorithm.

[0065] That is to say, when the frame type of the frame to be encoded is determined to be a P frame or a B frame, this embodiment determines the prediction block segmentation mode and the motion estimation algorithm of the first encoding unit according to the target decoding sub-data corresponding to the frame to be encoded, thereby accelerating the prediction process (inter-frame prediction) in the encoding process according to the decoding-related information obtained during the decoding process, which can improve the acquisition speed and efficiency of the first prediction block, and then correspondingly improve the speed and efficiency of video transcoding.

[0066] When this embodiment performs S301 to determine the prediction block segmentation method of the first coding unit according to the target decoded sub-data, the implementation method that can be adopted is: according to the motion vector in the target decoded sub-data, obtain the first motion vector variance corresponding to the first coding unit and the second motion vector variance corresponding to the frame to be encoded; according to the residual coding bits in the target decoded sub-data, obtain the first decoding residual variance corresponding to the first coding unit and the second decoding residual variance corresponding to the frame to be encoded; according to the first motion vector variance, the second motion vector variance, the first decoding residual variance and the second decoding residual variance, determine the prediction block segmentation method of the first coding unit.

[0067] Among them, when executing S301, this embodiment, if it is determined that the first motion vector variance is greater than (the second motion vector variance × b), and the first decoding residual variance is greater than (the second decoding residual variance × c), then "searching for the first coding unit of the current layer" is skipped, and quadtree division is used as the prediction block segmentation method; wherein b and c in this embodiment are constants.

[0068] When executing S302 to determine the motion estimation algorithm of the first coding unit according to the target decoding sub-data, this embodiment can be implemented as follows: obtaining the first motion vector variance corresponding to the first coding unit according to the target decoding sub-data; and determining the motion estimation algorithm of the first coding unit according to the first motion vector variance.

[0069] Among them, when executing S302, this embodiment determines that the first motion vector variance is less than the sixth threshold, the motion vector in the target decoded sub-data can be scaled according to the resolution and used as the motion vector of the first coding unit, skipping the motion search process.

[0070] In this embodiment, when S302 is executed, if it is determined that the first motion vector variance is greater than or equal to the sixth threshold, a motion search process is performed.

[0071] In this embodiment, the motion search process may be: first, the motion estimation vector of the first prediction unit is used as the starting search point of the motion vector, and then the motion estimation search range is set according to the maximum motion vector in the target decoding sub-data and the resolution before and after transcoding, and finally the motion search process is performed to obtain the motion vector of the first coding unit.

[0072] When executing S303, this embodiment can first divide the first prediction unit (i.e., the prediction unit corresponding to the first coding unit) according to the determined prediction block segmentation mode, and then determine the motion vector and reference frame of the first coding unit according to the determined motion estimation algorithm, and finally obtain the first prediction block according to the determined motion vector and reference frame.

[0073] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure. Figure 4 The flowchart of video transcoding of this embodiment is shown in the figure; first, the initial video compression file is decoded by the video decoder module to obtain the original video compression file and the decoded data set obtained during the decoding process; then the original video compression file and the decoded data set are transmitted to the video encoder module, and the video encoder module encodes the original video compression file according to the decoded data set, thereby completing the video transcoding and obtaining the target video compression file.

[0074] Figure 5 is a schematic diagram according to the fifth embodiment of the present disclosure. Figure 5 As shown, the video transcoding device 500 of this embodiment includes:

[0075] The decoding unit 501 is used to decode the initial video compression file to obtain the original video compression file and a decoded data set obtained during the decoding process, wherein each decoded data included in the decoded data set corresponds to a frame to be encoded in the original video compression file;

[0076] The processing unit 502 is configured to obtain target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded;

[0077] The prediction unit 503 is configured to perform predictive coding on the first coding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be encoded;

[0078] The encoding unit 504 is configured to obtain a target video compression file according to each frame to be encoded and its corresponding first prediction block.

[0079] The decoding unit 501 may call a video decoder module to perform video decoding on the initial video compression file; this embodiment does not limit the type of the video decoder module.

[0080] In this embodiment, the decoded data corresponding to different frames to be encoded include decoded video information (e.g., decoding header information), decoded video frame information (e.g., frame sequence number, frame type, frame resolution, coding block size, minimum prediction block, minimum transform block, reference frame information (e.g., reference frame list, reference frame absolute position difference, etc.) of the frame to be decoded corresponding to the frame to be encoded), and decoded video block information (e.g., residual coding bits of the second coding unit, prediction mode of the second prediction unit (intra-frame prediction mode or inter-frame prediction mode), motion vector of the second prediction unit, intra-frame prediction mode of the second prediction unit, etc.).

[0081] It can be understood that the first coding unit, the first prediction unit, etc. in this embodiment are coding units or prediction units corresponding to the frame to be encoded, and the second coding unit, the second prediction unit, etc. are coding units or prediction units corresponding to the frame to be decoded.

[0082] In this embodiment, the frames to be decoded are video frames in the initial video compression file. By decoding the initial video compression file through the video decoder module, corresponding frames to be encoded can be obtained according to different frames to be decoded, and then the relevant information obtained during the decoding process of the frames to be decoded is statistically analyzed to obtain decoding data corresponding to the frames to be encoded.

[0083] In this embodiment, according to the position of the second coding unit or the second prediction unit in the frame to be decoded, the corresponding information is stored in the decoded video block information in units of the minimum coding block or the minimum prediction block; for example, the residual coding bits corresponding to the minimum coding block of each second coding unit are stored in the decoded video block information, the prediction mode corresponding to the minimum prediction block of each second prediction unit is stored in the decoded video block information, the motion vector (forward motion vector, backward motion vector, forward and backward motion vector, etc.) corresponding to the minimum prediction block of each second prediction unit is stored in the decoded video block information, and the intra-frame prediction mode corresponding to the minimum prediction block of each second prediction unit is stored in the decoded video block information.

[0084] In this embodiment, after the decoding unit 501 obtains the original video compression file and the decoded data set obtained during the decoding process, the processing unit 502 obtains the target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded.

[0085] After completing the decoding of the initial video compression file, the encoding process of the obtained original video compression file can be carried out; this embodiment can call the video encoder module to transmit the obtained original video compression file and the decoded data set to the video encoder module to complete the video transcoding, thereby obtaining the target video compression file.

[0086] In this embodiment, the frame to be encoded may be first divided into a plurality of first coding units (Coding Unit, CU), and then prediction encoding is performed on the plurality of first coding units obtained by division, where the first coding unit is the original pixel block in the frame to be encoded.

[0087] Since the resolution of the video may change before and after the video is transcoded, when the processing unit 502 obtains the target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the encoding unit in the frame to be encoded, the implementation method that can be adopted is: determine the target position of the first encoding unit in the frame to be decoded according to the target video resolution, image filling pixels, initial video resolution and the position of the first encoding unit in the frame to be encoded; obtain partial decoded data corresponding to the determined target position (for example, corresponding video block information) from the decoded data corresponding to the frame to be encoded as the target decoding sub-data.

[0088] That is to say, when the resolutions before and after video transcoding are different, the processing unit 502 can obtain the target decoding sub-data corresponding to the first coding unit from the decoded data corresponding to the current frame to be encoded based on information such as the resolutions before and after transcoding, thereby improving the accuracy of the obtained target decoding sub-data, and further improving the accuracy of predictive decoding of the first coding unit based on the target decoding sub-data.

[0089] It is understandable that if the resolution of the video does not change before and after transcoding, the processing unit 502 can directly use the position of the first coding unit in the frame to be encoded as the target position of the first coding unit in the frame to be decoded.

[0090] In this embodiment, after the processing unit 502 obtains target decoded sub-data from the decoded data corresponding to the frame to be encoded, the prediction unit 503 performs predictive encoding on the first encoding unit according to the target decoded sub-data to obtain a first prediction block of the frame to be encoded.

[0091] When the prediction unit 503 predictively encodes the first coding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded, the implementation method that can be adopted is: determine the frame type of the frame to be encoded according to the target decoding sub-data; use the prediction encoding method corresponding to the determined frame type, predictively encode the first coding unit according to the target decoding sub-data, and obtain the first prediction block of the frame to be encoded.

[0092] In this embodiment, the frame type of the frame to be encoded is the same as the frame type of the corresponding frame to be decoded, that is, if the frame type of the frame to be decoded is an I frame, the frame type of the frame to be encoded corresponding to the frame to be decoded is also an I frame, if the frame type of the frame to be decoded is a P frame or a B frame, the frame type of the frame to be encoded corresponding to the frame to be decoded is also a P frame or a B frame.

[0093] That is to say, the prediction unit 503 will pre-set the prediction coding methods corresponding to different frame types, so as to perform prediction coding on the first coding unit in the to-be-encoded frames belonging to different frame types according to the corresponding prediction coding methods, which can further improve the accuracy of the first prediction block obtained by prediction coding.

[0094] In this embodiment, after the prediction unit 503 obtains the first prediction block of the frame to be encoded, the encoding unit 504 obtains the target video compression file according to each frame to be encoded and its corresponding first prediction block.

[0095] In this embodiment, the video encoding process may include prediction, transformation, quantization, entropy coding, inverse quantization, inverse transformation and loop filtering.

[0096] For the prediction process, the first coding unit is taken as an original pixel block, and intra-frame prediction or inter-frame prediction is performed on the first coding unit to obtain a first prediction block; the original pixel block and the first prediction block are subtracted to obtain a residual pixel block.

[0097] For the transformation process, the input is a residual pixel block, and the output is a transformation coefficient block converted from the residual pixel block through matrix multiplication transformation.

[0098] For the quantization process, the transform coefficient block is subjected to signal processing to reduce the amplitude of the signal and obtain a quantized signal.

[0099] For the entropy coding process, entropy coding is performed on the quantized signal to obtain a coded bit stream of the video.

[0100] For the inverse quantization, inverse transformation and loop filtering process, the quantized signal is inversely quantized and inversely transformed, and then added to the predicted pixel block. The result is loop filtered to reconstruct the video image.

[0101] After obtaining the residual pixel block according to the first prediction unit and the first prediction block in the frame to be encoded, the encoding unit 504 may perform subsequent transformation, quantization, entropy encoding, inverse quantization, inverse transformation and loop filtering processes to obtain the final target video compression file.

[0102] In addition, when the prediction unit 503 uses the prediction coding method corresponding to the determined frame type to predictively encode the first coding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded, it can include the following contents: when it is determined that the frame type of the frame to be encoded is an I frame, determining the prediction block segmentation method of the first coding unit according to the target decoding sub-data: determining the prediction block prediction mode of the first coding unit according to the target decoding sub-data; and obtaining the first prediction block of the frame to be encoded according to the prediction block segmentation method and the prediction block prediction mode.

[0103] That is to say, when the prediction unit 503 determines that the frame type of the frame to be encoded is an I frame, it determines the prediction block segmentation mode and the prediction block prediction mode of the first encoding unit according to the target decoding sub-data corresponding to the frame to be encoded, thereby accelerating the prediction process in the encoding process according to the decoding-related information obtained during the decoding process, which can improve the acquisition speed and efficiency of the first prediction block, and then correspondingly improve the speed and efficiency of video transcoding.

[0104] When the prediction unit 503 determines the prediction block segmentation method of the first coding unit according to the target decoding sub-data, the implementation method that can be adopted is: according to the residual coding bits in the target decoding sub-data, obtain the first decoding residual mean and the first decoding residual variance corresponding to the first coding unit, and the second decoding residual mean and the second decoding residual variance corresponding to the frame to be encoded; determine the prediction block segmentation method of the first coding unit according to the first decoding residual mean, the first decoding residual variance, the second decoding residual mean and the second decoding residual variance.

[0105] When the prediction unit 503 determines the prediction block prediction mode of the first coding unit according to the target decoding sub-data, the implementation method that can be adopted is: according to the intra-frame angle prediction mode in the target decoding sub-data, the angle mean and angle variance of the intra-frame angle prediction mode corresponding to the first coding unit are obtained; according to the angle mean and the angle variance, the prediction block prediction mode of the first coding unit is determined.

[0106] That is to say, the prediction unit 503 can be combined with the decoded sub-data corresponding to the first coding unit to accelerate the search process of the prediction block segmentation mode and the prediction block prediction mode, without the need to search the full segmentation mode or the full prediction mode, which can improve the speed and efficiency in determining the prediction block segmentation mode and the prediction block prediction mode, thereby improving the transcoding speed and transcoding efficiency of the video.

[0107] The prediction unit 503 divides the first prediction unit (ie, the prediction unit corresponding to the first coding unit) according to the determined prediction block partitioning mode, and then obtains the first prediction block according to the determined prediction block prediction mode.

[0108] When the prediction unit 503 uses the prediction coding method corresponding to the determined frame type to predictively encode the first coding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded, it may also include the following contents: when it is determined that the frame type of the frame to be encoded is a P frame or a B frame, the prediction block segmentation method of the first coding unit is determined according to the target decoding sub-data: the motion estimation algorithm of the first coding unit is determined according to the target decoding sub-data; and the first prediction block of the frame to be encoded is obtained according to the prediction block segmentation method and the motion estimation algorithm.

[0109] That is to say, when the prediction unit 503 determines that the frame type of the frame to be encoded is a P frame or a B frame, it determines the prediction block segmentation mode and the motion estimation algorithm of the first encoding unit according to the target decoding sub-data corresponding to the frame to be encoded, thereby accelerating the prediction process in the encoding process according to the decoding-related information obtained during the decoding process, which can improve the acquisition speed and efficiency of the first prediction block, and then correspondingly improve the speed and efficiency of video transcoding.

[0110] When the prediction unit 503 determines the prediction block segmentation method of the first coding unit according to the target decoded sub-data, the implementation method that can be adopted is: according to the motion vector in the target decoded sub-data, obtain the first motion vector variance corresponding to the first coding unit and the second motion vector variance corresponding to the frame to be encoded; according to the residual coding bits in the target decoded sub-data, obtain the first decoding residual variance corresponding to the first coding unit and the second decoding residual variance corresponding to the frame to be encoded; according to the first motion vector variance, the second motion vector variance, the first decoding residual variance and the second decoding residual variance, determine the prediction block segmentation method of the first coding unit.

[0111] When the prediction unit 503 determines the motion estimation algorithm of the first coding unit according to the target decoded sub-data, the implementation method that can be adopted is: obtaining the first motion vector variance corresponding to the first coding unit according to the target decoded sub-data; and determining the motion estimation algorithm of the first coding unit according to the first motion vector variance.

[0112] In this embodiment, the motion search process may be: first, the motion estimation vector of the first prediction unit is used as the starting search point of the motion vector, and then the motion estimation search range is set according to the maximum motion vector in the target decoding sub-data and the resolution before and after transcoding, and finally the motion search process is performed to obtain the motion vector of the first coding unit.

[0113] The prediction unit 503 can first divide the first prediction unit (i.e., the prediction unit corresponding to the first coding unit) according to the determined prediction block segmentation mode, and then determine the motion vector and reference frame of the first coding unit according to the determined motion estimation algorithm, and finally obtain the first prediction block according to the determined motion vector and reference frame.

[0114] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0115] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0116] like Figure 6 , is a block diagram of an electronic device according to a video transcoding method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0117] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0118] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0119] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as a video transcoding method. For example, in some embodiments, the video transcoding method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608.

[0120] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the video transcoding method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the video transcoding method in any other appropriate manner (e.g., by means of firmware).

[0121] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0122] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable video transcoding device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0123] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0125] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0126] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.

[0127] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0128] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A video transcoding method, comprising: Decoding the initial video compression file to obtain the original video compression file and a decoded data set obtained during the decoding process, wherein each decoded data included in the decoded data set corresponds to a frame to be encoded in the original video compression file; According to the position of the first coding unit in the frame to be coded, obtaining target decoding sub-data from the decoded data corresponding to the frame to be coded; Performing predictive coding on the first coding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be coded; A target video compression file is obtained according to each frame to be encoded and its corresponding first prediction block.

2. The method according to claim 1, wherein: The step of acquiring target decoding sub-data from decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded comprises: Determining a target position of the first coding unit in the frame to be decoded according to a target video resolution, image filling pixels, an initial video resolution, and a position of the first coding unit in the frame to be encoded; Part of the decoded data corresponding to the target position is obtained from the decoded data corresponding to the frame to be encoded as the target decoded sub-data.

3. The method according to claim 1, wherein: The performing predictive encoding on the first encoding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded comprises: Determining a frame type of the frame to be encoded according to the target decoding sub-data; Using a prediction encoding method corresponding to the frame type, the first encoding unit is predictively encoded according to the target decoding sub-data to obtain a first prediction block of the frame to be encoded.

4. The method according to claim 3, wherein: The using a prediction coding method corresponding to the frame type to perform prediction coding on the first coding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be coded comprises: When it is determined that the frame type of the frame to be encoded is an I frame, determining a prediction block segmentation mode of the first encoding unit according to the target decoding sub-data: Determining a prediction block prediction mode of the first coding unit according to the target decoding sub-data; A first prediction block of the frame to be encoded is obtained according to the prediction block segmentation method and the prediction block prediction mode.

5. The method according to claim 4, wherein: The determining, according to the target decoding sub-data, a prediction block segmentation mode of the first coding unit comprises: According to the residual coding bits in the target decoding sub-data, obtaining a first decoding residual mean and a first decoding residual variance corresponding to the first coding unit, and a second decoding residual mean and a second decoding residual variance corresponding to the frame to be encoded; A prediction block partitioning method of the first coding unit is determined according to the first decoding residual mean, the first decoding residual variance, the second decoding residual mean, and the second decoding residual variance.

6. The method according to claim 4, wherein: The determining, according to the target decoding sub-data, a prediction mode of a prediction block of the first coding unit comprises: According to the intra-frame angle prediction mode in the target decoded sub-data, obtaining an angle mean and an angle variance of the intra-frame angle prediction mode corresponding to the first coding unit; A prediction mode of a prediction block of the first coding unit is determined according to the angle mean and the angle variance.

7. The method according to claim 3, wherein: The using a prediction coding method corresponding to the frame type to perform prediction coding on the first coding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be coded comprises: When it is determined that the frame type of the frame to be encoded is a P frame or a B frame, determining a prediction block segmentation mode of the first encoding unit according to the target decoding sub-data: determining a motion estimation algorithm for the first coding unit according to the target decoding sub-data; According to the prediction block segmentation method and the motion estimation algorithm, a first prediction block of the frame to be encoded is obtained.

8. The method according to claim 7, wherein: The determining, according to the target decoding sub-data, a prediction block segmentation mode of the first coding unit comprises: According to the motion vector in the target decoded sub-data, obtaining a first motion vector variance corresponding to the first coding unit and a second motion vector variance corresponding to the frame to be coded; According to the residual coding bits in the target decoding sub-data, obtaining a first decoding residual variance corresponding to the first coding unit and a second decoding residual variance corresponding to the frame to be encoded; A prediction block partitioning mode of the first coding unit is determined according to the first motion vector variance, the second motion vector variance, the first decoding residual variance, and the second decoding residual variance.

9. The method according to claim 7, wherein: The determining, according to the target decoding sub-data, a motion estimation algorithm for the first coding unit comprises: Acquire a first motion vector variance corresponding to the first coding unit according to the target decoding sub-data; A motion estimation algorithm for the first coding unit is determined according to the first motion vector variance.

10. A video transcoding device, comprising: A decoding unit, used to decode the initial video compression file to obtain the original video compression file and a decoded data set obtained during the decoding process, wherein each decoded data included in the decoded data set corresponds to a frame to be encoded in the original video compression file; A processing unit, configured to obtain target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded; A prediction unit, configured to perform predictive coding on the first coding unit according to the target decoding sub-data to obtain a first prediction block of the frame to be coded; The encoding unit is used to obtain a target video compression file according to each frame to be encoded and its corresponding first prediction block.

11. The device according to claim 10, wherein: When the processing unit obtains target decoding sub-data from the decoded data corresponding to the frame to be encoded according to the position of the first encoding unit in the frame to be encoded, the processing unit specifically performs: Determining a target position of the first coding unit in the frame to be decoded according to a target video resolution, image filling pixels, an initial video resolution, and a position of the first coding unit in the frame to be encoded; Part of the decoded data corresponding to the target position is obtained from the decoded data corresponding to the frame to be encoded as the target decoded sub-data.

12. The device according to claim 10, wherein: When the prediction unit performs predictive encoding on the first encoding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be encoded, specifically: Determining a frame type of the frame to be encoded according to the target decoding sub-data; Using a prediction encoding method corresponding to the frame type, the first encoding unit is predictively encoded according to the target decoding sub-data to obtain a first prediction block of the frame to be encoded.

13. The device according to claim 12, wherein: When the prediction unit uses the prediction coding method corresponding to the frame type to perform prediction coding on the first coding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be coded, specifically: When it is determined that the frame type of the frame to be encoded is an I frame, determining a prediction block segmentation mode of the first encoding unit according to the target decoding sub-data: Determining a prediction block prediction mode of the first coding unit according to the target decoding sub-data; A first prediction block of the frame to be encoded is obtained according to the prediction block segmentation method and the prediction block prediction mode.

14. The device according to claim 13, wherein: When the prediction unit determines the prediction block segmentation mode of the first coding unit according to the target decoding sub-data, the prediction unit specifically performs: According to the residual coding bits in the target decoding sub-data, obtaining a first decoding residual mean and a first decoding residual variance corresponding to the first coding unit, and a second decoding residual mean and a second decoding residual variance corresponding to the frame to be encoded; A prediction block partitioning method of the first coding unit is determined according to the first decoding residual mean, the first decoding residual variance, the second decoding residual mean, and the second decoding residual variance.

15. The device according to claim 13, wherein: When the prediction unit determines the prediction mode of the prediction block of the first coding unit according to the target decoding sub-data, the prediction unit specifically performs: According to the intra-frame angle prediction mode in the target decoded sub-data, obtaining an angle mean and an angle variance of the intra-frame angle prediction mode corresponding to the first coding unit; A prediction mode of a prediction block of the first coding unit is determined according to the angle mean and the angle variance.

16. The device according to claim 12, wherein: When the prediction unit uses the prediction coding method corresponding to the frame type to perform prediction coding on the first coding unit according to the target decoding sub-data to obtain the first prediction block of the frame to be coded, specifically: When it is determined that the frame type of the frame to be encoded is a P frame or a B frame, determining a prediction block segmentation mode of the first encoding unit according to the target decoding sub-data: determining a motion estimation algorithm for the first coding unit according to the target decoding sub-data; According to the prediction block segmentation method and the motion estimation algorithm, a first prediction block of the frame to be encoded is obtained.

17. The device according to claim 16, wherein: When the prediction unit determines the prediction block segmentation mode of the first coding unit according to the target decoding sub-data, the prediction unit specifically performs: According to the motion vector in the target decoded sub-data, obtaining a first motion vector variance corresponding to the first coding unit and a second motion vector variance corresponding to the frame to be coded; According to the residual coding bits in the target decoding sub-data, obtaining a first decoding residual variance corresponding to the first coding unit and a second decoding residual variance corresponding to the frame to be encoded; A prediction block partitioning mode of the first coding unit is determined according to the first motion vector variance, the second motion vector variance, the first decoding residual variance, and the second decoding residual variance.

18. The device according to claim 16, wherein: When the prediction unit determines the motion estimation algorithm of the first coding unit according to the target decoding sub-data, the prediction unit specifically performs: Acquire a first motion vector variance corresponding to the first coding unit according to the target decoding sub-data; A motion estimation algorithm for the first coding unit is determined according to the first motion vector variance.

19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.

21. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.