Prediction model decision method, device, equipment and storage medium

By judging the parallel movement of image blocks in video encoding and skipping the intra prediction mode, and using the inter prediction mode for encoding, the problem of high computing complexity in the prior art is solved, and the acceleration of video encoding and resource saving is achieved.

CN116366839BActive Publication Date: 2025-08-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310227313.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2025-08-08
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

In the existing video encoding methods, the combination of image block division and prediction modes lead to high computational complexity and excessive time-consuming.

Method used

By obtaining the encoding indication information of the video frame to be encoded, it is determined whether the image block is moving in parallel in the video, and when determining the parallel movement, the intra prediction mode is skipped and only the inter prediction mode is used for encoding, reducing the calculation complexity.

Benefits of technology

Accelerate the video encoding process, save computing resources, and improve encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366839B_ABST
    Figure CN116366839B_ABST
Patent Text Reader

Abstract

The present application discloses a prediction mode decision method, apparatus, device and storage medium. The method includes: obtaining coding indication information of a target image block in a video frame to be encoded; when the coding indication information includes first coding indication information, it indicates that when the image block is encoded in a non-division mode, it is implemented based on an inter-frame prediction mode and an intra-frame prediction mode respectively; when the coding indication information includes second coding indication information, it indicates that it is implemented based on an inter-frame prediction mode; when the coding indication information of the target image block includes first coding indication information, determining a first image block obtained by using a target division mode for the target image block; if, based on the target image block and each first image block, it is determined that the target image block moves in parallel in the target video to which it belongs, then determining the coding indication information of the second image block obtained by each division mode of multiple division modes for the target image block as the second coding indication information; this can accelerate the video encoding process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a prediction model decision-making method, device, equipment and storage medium. Background Art

[0002] In scenarios related to video transmission, it is necessary to encode the video to obtain an encoding result, and then transmit the encoding result through the network so that the device that receives the encoding result can decode and play it. In existing video encoding methods, image blocks in video frames can be encoded based on block division. The encoder can traverse multiple division methods and multiple prediction modes to obtain encoding results under different combinations of division methods and prediction modes, and then select the encoding result with the best encoding efficiency as the encoding result of the image block. Since the sub-image blocks obtained by dividing the image blocks can be further divided and encoded based on different prediction modes, the computational complexity of the encoding process is high, making the encoding process too time-consuming. Summary of the Invention

[0003] Embodiments of the present application provide a prediction mode decision method, apparatus, device, storage medium, and computer program product that can accelerate the video encoding process.

[0004] In one aspect, an embodiment of the present application provides a prediction model decision method, comprising:

[0005] Obtaining encoding indication information of a target image block in a to-be-encoded video frame; the encoding indication information includes first encoding indication information or second encoding indication information, the first encoding indication information being used to indicate that, when encoding is performed in a non-division manner, the image block is to be encoded based on an inter-frame prediction mode and an intra-frame prediction mode, respectively; and the second encoding indication information being used to indicate that, when encoding is performed in the non-division manner, the image block is to be encoded based on the inter-frame prediction mode.

[0006] When the encoding indication information of the target image block includes the first encoding indication information, determining a first image block obtained by adopting a target division method for the target image block; the target division method is different from the non-division method;

[0007] If, based on the target image block and each first image block, it is determined that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block is determined as the second encoding indication information, so that each second image block is implemented based on the inter-frame prediction mode when the encoding processing is performed using the non-division method; the multiple division methods include the non-division method and the target division method.

[0008] On the one hand, an embodiment of the present application provides a prediction mode decision device, including:

[0009] an acquiring unit, configured to acquire encoding indication information of a target image block in a video frame to be encoded; the encoding indication information includes first encoding indication information or second encoding indication information, the first encoding indication information being used to indicate that, when encoding is performed in a non-division manner, the image block is encoded based on an inter-frame prediction mode and an intra-frame prediction mode, respectively; and the second encoding indication information being used to indicate that, when encoding is performed in a non-division manner, the image block is encoded based on the inter-frame prediction mode.

[0010] a processing unit, configured to determine, when the encoding indication information of the target image block includes the first encoding indication information, a first image block obtained by adopting a target division method for the target image block; the target division method is different from the non-division method;

[0011] The processing unit is further configured to, if it is determined based on the target image block and each first image block that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, determine the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block as the second encoding indication information, so that each second image block is implemented based on the inter-frame prediction mode when encoding is performed using the non-division method; the multiple division methods include the non-division method and the target division method.

[0012] In one aspect, an embodiment of the present application provides an electronic device, characterized in that the electronic device includes an input interface and an output interface, and further includes:

[0013] a processor adapted to implement one or more instructions; and

[0014] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the above-mentioned prediction mode decision method.

[0015] On the one hand, an embodiment of the present application provides a computer storage medium, characterized in that the computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to execute the decision method of the above-mentioned prediction model.

[0016] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of an electronic device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the electronic device executes the decision method of the above-mentioned prediction model.

[0017] In an embodiment of the present application, if the target image block is implemented based on the inter-frame prediction mode and the intra-frame prediction mode respectively when the encoding process is performed in a non-division manner, then based on the target image block and the first image blocks obtained by dividing the target image block in the target division manner, when it is determined that the target image block moves in parallel in the target video to which it belongs, it is decided that the second image blocks obtained by dividing the target image block can skip the intra-frame prediction mode when the encoding process is performed in a non-division manner, and only be encoded based on the inter-frame prediction mode, which can reduce the computational complexity of the encoding process, accelerate the video encoding process and save computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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.

[0019] Figure 1 is a structural diagram of a video encoding system provided in an embodiment of the present application;

[0020] Figure 2 This is a schematic diagram of a division method provided in an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of a division form of an image block provided in an embodiment of the present application;

[0022] Figure 4 This is a flowchart of a decision-making method for a prediction model provided in an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of obtaining a first image block by dividing according to an embodiment of the present application;

[0024] Figure 6 1 is a flow chart of another prediction model decision-making method provided in an embodiment of the present application;

[0025] Figure 7a This is a decision diagram of a prediction model provided in an embodiment of the present application;

[0026] Figure 7b This is a decision diagram of another prediction model provided in an embodiment of the present application;

[0027] Figure 8 is a schematic diagram of encoding a target image block provided by an embodiment of the present application;

[0028] Figure 9a is another schematic diagram of encoding a target image block provided by an embodiment of the present application;

[0029] Figure 9b is another schematic diagram of encoding a target image block provided by an embodiment of the present application;

[0030] Figure 10 This is a schematic diagram of encoding a target image block in a non-division manner provided by an embodiment of the present application;

[0031] Figure 11 This is a schematic diagram of the structure of a decision-making device for a prediction model provided in an embodiment of the present application;

[0032] Figure 12 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of 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.

[0034] An embodiment of the present application provides a prediction mode decision scheme, which can obtain coding indication information of a target image block in a video frame to be encoded; the coding indication information includes first coding indication information or second coding indication information, the first coding indication information is used to indicate: when the image block is encoded in a non-division mode, it is implemented based on an inter-frame prediction mode and an intra-frame prediction mode respectively, and the second coding indication information is used to indicate: when the image block is encoded in a non-division mode, it is implemented based on an inter-frame prediction mode; when the coding indication information of the target image block includes the first coding indication information, a first image block obtained by using a target division mode is determined for the target image block; if, based on the target image block and each first image block, it is determined that the target image block moves parallel in a target video to which the video frame to be encoded belongs, the coding indication information of the second image block obtained by using each of multiple division modes of the target image block is determined as the second coding indication information, so that each second image block is implemented based on the inter-frame prediction mode when the encoding is performed in a non-division mode; wherein the multiple division modes include a non-division mode and a target division mode, and the target division mode is different from the non-division mode.

[0035] In one embodiment, the above prediction mode decision scheme can be used in the relevant process of video encoding, and can be executed by a video encoding device or by multiple electronic devices with computing power. The embodiments of this application will be described later using a video encoding device as an example. Figure 1 , is a structural diagram of a video encoding system provided in an embodiment of the present application; Figure 1 The video encoding system shown may include a terminal device 101, a video server 102, and a video encoding device 103. The terminal device 101 may include any one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart car-mounted device, and a smart wearable device. The video server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The video encoding device 103 may be a video encoding module in the video server 102, or it may be a device or server independent of the video server 102 for implementing video encoding. The terminal device 101 and the video server 102, as well as the video server 102 and the video encoding device 103, may be directly or indirectly connected in a wired or wireless communication manner, and this application does not limit this.

[0036] In one embodiment, the video server 102 can call the video encoding device 103 to encode the video, obtain the encoding result, and transmit the encoding result to the terminal device 101, so that the terminal device 101 can decode the encoding result to obtain the decoded video and play it; the above-mentioned prediction mode decision scheme can be applied to the relevant process of video encoding, and is used to decide whether the image blocks in the video frame will be implemented based on the inter-frame prediction mode when the encoding process is not divided, that is, to decide whether the processing process based on the inter-frame prediction mode can be skipped to speed up the video encoding process. Further, when the above-mentioned prediction mode decision scheme is used in the video encoding process, it can be applied to relevant scenarios of video transmission, such as video instant messaging scenarios, cloud game scenarios, etc.; further, if Figure 1 The video encoding system shown is only an exemplary system architecture proposed in the embodiment of the present application.

[0037] In one embodiment, the video encoding device 103 may be an encoder that supports the H.266 video coding standard. H.266, also known as VVC (Versatile Video Coding), is the latest generation of coding standards, which specifies the decoding process and syntax of H.266 decoding. H.266 supports encoding in the form of image blocks. That is, when the video encoding device 103 that supports H.266 encodes a video frame in a video, it can be based on the encoding of the image blocks obtained by dividing the video frame. The image block can be used as a coding unit CU (Coding Unit.), which is a basic unit specified in H.266. Furthermore, when encoding the image block, multiple division methods specified in H.266 can also be used for encoding; see Figure 2 , is a schematic diagram of a division method provided in an embodiment of the present application, which may include a non-division method, a horizontal two-division method, a vertical two-division method, a four-division method, a horizontal three-division method, and a vertical three-division method; when the video encoding device 103 adopts the non-division method to encode the image block, the image block can be directly encoded, that is, the image block will not be divided. When the video encoding device 103 adopts any division method other than the non-division method to encode the image block, the image block can be divided using any division method to obtain a corresponding image block (the image block can be used as a sub-image block), and further encoding each sub-image block. When encoding each sub-image block, multiple division methods specified in the above-mentioned H.266 can also be used for encoding until the division termination condition is reached. This process is a recursive process.

[0038] In one embodiment, for a specific image block, H.266 does not specify what form it should be divided into. As long as the division form conforms to the division method, it conforms to the standard; different division forms will bring different coding efficiencies. In order to maximize the coding efficiency, the video encoding device 103 will often try all possible division forms and finally select the one with the best coding efficiency. In one implementation, when encoding an image block, all possible sub-image blocks obtained by dividing the image block can be organized into a search tree; the video encoding device 103 can use a top-down recursive process to traverse the search tree, and then determine the final division form of the image block. That is, the video encoding device 103 can give priority to the non-division method for encoding, and then recursively use other division methods in the multiple division methods for encoding. Furthermore, the video encoding device 103 can use a division form composed of a combination of division methods with the best coding efficiency. For example, see Figure 3 , which is a schematic diagram of a division form of an image block provided in an embodiment of the present application; as can be seen from the figure, the image block is first divided into four parts to obtain the image block shown as 31, the image block shown as 32, the image block shown as 33, and the image block shown as 34; the image block shown as 32 is divided into four parts to obtain the image blocks shown as 321, 322, 323 and 324 respectively; the image block shown as 33 is divided into two parts horizontally to obtain the image blocks shown as 331 and 332 respectively; the image block shown as 331 is divided into three parts vertically to obtain the image blocks shown as 331 respectively. The image blocks shown by marks 3311, 3312 and 3313 are obtained; the image block shown by mark 34 is divided into three horizontal parts to obtain the image blocks shown by marks 341, 342 and 343 respectively; the encoding results of each image block under the division form are obtained when the non-division method is used for encoding, that is, the encoding results of each image block shown by marks 31, 321, 322, 323, 324, 3311, 3312, 3313, 332, and 341, 342, 343 are obtained when the non-division method is used for encoding, that is, the encoding results corresponding to the image block are obtained when the non-division method is used for encoding.

[0039] In one embodiment, when an image block is encoded in a non-divided manner, it can be implemented based on each prediction mode in the inter-frame prediction mode and each mode in the intra-frame prediction mode. That is to say, during the encoding process of the image block, not only each division method will be traversed, but also each prediction mode will be traversed. There can be multiple combinations of various division forms of the image block and each prediction mode. The video encoding device 103 can select the combination with the best encoding efficiency to obtain the final encoding result. When encoding based on the inter-frame prediction mode, the current frame can be encoded using information from other video frames, and the temporal correlation of the video data can be utilized. When encoding based on the intra-frame prediction mode, the encoding of the current frame does not refer to information from other video frames, and the spatial correlation of the video data can be utilized. Generally speaking, in the video encoding process, the inter-frame prediction mode is adopted more frequently than the intra-frame prediction mode. This is because the temporal correlation of the video is usually stronger than the spatial correlation. Generally speaking, the video encoding device 103 will only select the intra-frame prediction mode when the temporal correlation is too poor. Based on this, the above prediction mode decision scheme proposes that: if an image block is encoded based on the inter-frame prediction mode and the intra-frame prediction mode respectively when the image block is encoded using the non-division method, then based on the image block and the image blocks obtained by dividing the image block, when it is determined that the image block moves parallel in the video to which it belongs, it can be further determined that the image blocks obtained by dividing the image block can skip the intra-frame prediction mode when the non-division method is used for encoding, and only be encoded based on the inter-frame prediction mode, so as to accelerate the video encoding process and save computing resources. It should be noted that the above-mentioned prediction mode decision scheme is applicable to the H.266 video coding standard. In this case, the multiple division methods in the above-mentioned scheme are the multiple division methods specified by H.266; when there are other video coding standards that support the use of multiple division methods including non-division methods, the scheme is also applicable to the other video coding standards. In this case, the multiple division methods in the above-mentioned scheme are the multiple division methods specified by the corresponding video coding standards.

[0040] It is particularly important to note that in the specific implementation of this application, when object-related data is involved, such as target videos, video frames to be encoded, etc., when the embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the object, and the collection, use and processing of the relevant data must comply with local laws, regulations and standards. In addition, during the collection, use and processing of data, the relevant objects can be notified through the user interface, and subsequent processing will only be carried out after receiving an operation confirming that the data can be collected, used or processed on the user interface.

[0041] Based on the above prediction model decision solution, the present application embodiment provides a prediction model decision method. Figure 4, which is a flow chart of a decision-making method for a prediction model provided in an embodiment of the present application. Figure 4 The prediction mode decision method shown may be executed by a video encoding device. Figure 4 The decision-making method of the prediction model shown may include the following steps:

[0042] S401: Obtain encoding indication information of a target image block in a video frame to be encoded.

[0043] In one embodiment, the video frame to be encoded may be a video frame in a target video, and the target video may be any video that requires video encoding; the target image block may be an image block that is currently to be encoded among the image blocks obtained by dividing the video frame to be encoded. Furthermore, the encoding indication information may include first encoding indication information or second encoding indication information, wherein the first encoding indication information is used to indicate that when encoding the image block is performed in a non-division manner, the encoding is performed based on an inter-frame prediction mode and an intra-frame prediction mode, respectively; and the second encoding indication information is used to indicate that when encoding is performed in a non-division manner, the encoding is performed based on an inter-frame prediction mode.

[0044] When encoding a video frame to be encoded based on an inter-frame prediction mode, the information of other video frames in the target video can be used to encode the video frame to be encoded, and the temporal correlation of the video data can be utilized. When encoding a video frame to be encoded based on an intra-frame prediction mode, the information of other video frames in the target video is not referenced, and the spatial correlation of the video data can be utilized. Furthermore, both the inter-frame prediction mode and the intra-frame prediction mode can include at least one prediction mode, and the inter-frame prediction mode can include a translation inter-frame prediction mode and an affine inter-frame prediction mode. When encoding a video frame to be encoded based on an inter-frame prediction mode, the video encoding device constructs a reference frame list for the video frame to be encoded. The reference frame list can include a forward reference frame list and a backward reference frame list. The forward reference frame list can include one or more video frames whose encoding order and playback order are both before the video frame to be encoded, and the backward reference frame list can include one or more video frames whose encoding order is before the video frame to be encoded but whose playback order is after the video frame to be encoded. When encoding the target image block in the video frame to be encoded based on the inter-frame prediction mode, the video encoding device can select a video frame from the forward reference frame list or the backward reference frame list as the reference frame of the video frame to be encoded, and encode the target image block with reference to the information of the reference frame. This process is called unidirectional prediction. When the reference frame is selected from the forward reference frame list, the process can be further called forward prediction. When the reference frame is selected from the backward reference frame list, the process can be further called backward prediction. Similarly, the video encoding device can also select a video frame from the forward reference frame list and a video frame from the backward reference frame list as the reference frames of the video frame to be encoded, and encode the target image block with reference to the information of the reference frame. This process is called bidirectional prediction.

[0045] Furthermore, the basic idea of inter-frame prediction mode is to leverage the temporal correlation of video data to select an image region with the most similar pixel distribution in one or two already encoded reference frames for prediction of the target image block. Specifically, only the position information of the image region and the pixel difference between the target image block and the image region can be encoded. Generally speaking, the smaller the pixel difference, the fewer bits required for transmission and the higher the coding efficiency. If the video encoding device ultimately selects an image region that is not the most reasonable for prediction, it may still generate a standard-compliant bitstream, but the coding efficiency will be compromised. The video encoding device can find this most reasonable image region through pixel-by-pixel comparison, a process also known as motion search. The displacement from this most reasonable image region (i.e., the image region with the most similar pixel distribution) to the target image block is called a motion vector. In translational inter-frame prediction mode, the motion vector of each pixel in the target image block is the same. In affine inter-frame prediction mode, the motion vector of each pixel in the target image block may be different. Affine inter-frame prediction mode is suitable for scaling and rotational motion.

[0046] S402 : When the encoding indication information of the target image block includes first encoding indication information, determine a first image block obtained by adopting a target division method for the target image block.

[0047] Among them, the target division method is different from the non-division method; further, the target division method can be any division method among multiple division methods except the non-division method, which can be set according to specific needs; further optionally, in order to improve the accuracy of judging whether the target image block moves in parallel in the target video to which the video frame to be encoded belongs, a division method that satisfies the following conditions as much as possible among multiple division methods can be selected as the target division method, and the corresponding conditions are: the sizes of the image blocks obtained by division are as similar as possible, the number of image blocks obtained by division is as large as possible, and so on. For example, when the multiple division methods are the six division methods specified by H.266, four division methods can be selected as the target division method, and the embodiments of this application will be elaborated based on this later. See. Figure 5 , which is a schematic diagram of a first image block obtained by division provided in an embodiment of the present application; if the target image block is as indicated by mark 501, and the target division method is a four-division method, then the first image blocks obtained by division can be respectively indicated by marks 511, 512, 513 and 514.

[0048] S403: If, based on the target image block and each first image block, it is determined that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block is determined as the second encoding indication information, so that each second image block is implemented based on the inter-frame prediction mode when encoding is performed in a non-division method.

[0049] In one embodiment, multiple division methods include a non-division method and a target division method; generally speaking, in the process of video encoding, the proportion of inter-frame prediction mode adopted is higher than that of intra-frame prediction mode. This is because the time domain correlation of the video is usually stronger than the spatial correlation. Generally speaking, the video encoding device will only choose the intra-frame prediction mode when the time domain correlation is too poor. When the target image block moves in parallel in the target video, that is, when the image content contained in the target image block moves in parallel as a whole in the target video, the encoding effect based on the translation inter-frame prediction mode is often good enough, and the residual is small enough. In this case, the probability that the target image block adopts the intra-frame prediction mode is extremely low; therefore, when it is determined that the target image block moves in parallel in the target video, it can be inferred that the probability that the target image block adopts the intra-frame prediction mode is extremely low, and the probability that each second image block obtained by dividing the target image block adopts the intra-frame prediction mode is also extremely low. Therefore, when it is determined that the target image block moves in parallel in the target video, the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block can be determined as the second encoding indication information, so that each second image block can skip the intra-frame prediction mode when the encoding processing is performed in a non-division method, and is only implemented based on the inter-frame prediction mode; the encoding process of each second image block can be accelerated, further accelerating the video encoding process and saving computing resources.

[0050] In an embodiment of the present application, if the target image block is implemented based on the inter-frame prediction mode and the intra-frame prediction mode respectively when the encoding process is performed in a non-division manner, then based on the target image block and the first image blocks obtained by dividing the target image block in the target division manner, when it is determined that the target image block moves in parallel in the target video to which it belongs, it is decided that the second image blocks obtained by dividing the target image block can skip the intra-frame prediction mode when the encoding process is performed in a non-division manner, and only be encoded based on the inter-frame prediction mode, which can reduce the computational complexity of the encoding process, accelerate the video encoding process and save computing resources.

[0051] Based on the above-mentioned related embodiments of the prediction model decision method, the present application embodiment provides another prediction model decision method. Figure 6 , which is a flow chart of another prediction model decision-making method provided in an embodiment of the present application. Figure 6 The prediction mode decision method shown may be executed by a video encoding device.

[0052] Figure 6 The decision-making method of the prediction model shown may include the following steps:

[0053] S601: Obtain encoding indication information of a target image block in a video frame to be encoded.

[0054] Among them, the coding indication information may include first coding indication information or second coding indication information. The first coding indication information is used to indicate that when the image block is encoded in a non-division manner, it is implemented based on the inter-frame prediction mode and the intra-frame prediction mode respectively. The second coding indication information is used to indicate that when the image block is encoded in a non-division manner, it is implemented based on the inter-frame prediction mode. The relevant process of step S601 is similar to the relevant process of the above-mentioned step S401, and will not be repeated here.

[0055] S602: When the encoding indication information of the target image block includes first encoding indication information, determine a first image block obtained by adopting a target division method for the target image block.

[0056] Among them, the target division method is different from the non-division method; the relevant process of step S602 is similar to the relevant process of the above-mentioned step S402, and will not be repeated here; in subsequent embodiments, multiple division methods are the division methods specified by H.266, and the target division method is four division methods. As an example, it is explained.

[0057] S603: If, based on the target image block and each first image block, it is determined that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block is determined as the second encoding indication information, so that each second image block is implemented based on the inter-frame prediction mode when encoding is performed in a non-division method.

[0058] In one embodiment, multiple division methods include a non-division method and a target division method; whether the target image block moves parallel in the target video can be determined by comparing the image area composed of the image area with the most similar pixel distribution obtained by motion search of each first image block in the translation inter-frame prediction mode, and whether the image area with the most similar pixel distribution obtained by motion search of the target image block in the translation inter-frame prediction mode is the same; generally speaking, if the motion information required for motion search of each first image block when obtaining the image area with the most similar pixel distribution is consistent with the motion information required for motion search of the target image block when obtaining the image area with the most similar pixel distribution, then it can be considered that the image area composed of the image area with the most similar pixel distribution corresponding to each first image block is the same as the image area with the most similar pixel distribution corresponding to the target image block.

[0059] In one embodiment, a video encoding device determines, based on a target image block and each first image block, a manner in which the target image block moves in parallel within a target video to which a video frame to be encoded belongs, which may include: obtaining first motion information required for encoding the target image block in a non-division manner; the first motion information being motion information required for performing a motion search based on a translational inter-frame prediction mode in an inter-frame prediction mode when the target image block is encoded in a non-division manner; obtaining second motion information required for each first image block in a non-division manner; any second motion information being motion information required for performing a motion search based on a translational inter-frame prediction mode in an inter-frame prediction mode when the corresponding first image block is encoded in a non-division manner; and if the first motion information corresponding to the target image block and the second motion information corresponding to each first image block are the same, determining that the target image block moves in parallel within the target video to which the video frame to be encoded belongs. The first motion information should be motion information obtained when obtaining an image region with a most similar pixel distribution to the target image block, and the second motion information corresponding to any first image block should be motion information obtained when obtaining an image region with a most similar pixel distribution to the first image block. Furthermore, both the first motion information and the second motion information may include: prediction mode information, reference frame mode information and reference frame index information; the consistency between the first motion information and the second motion information may include: the prediction mode information in the first motion information is consistent with the prediction mode information in the second motion information, and both are information indicating the translation inter-frame prediction mode; the reference frame mode information in the first motion information is consistent with the reference frame mode information in the second motion information, and simultaneously indicate forward prediction, simultaneously indicate backward prediction, or simultaneously indicate bidirectional prediction; the reference frame index information in the first motion information is consistent with the reference frame index information in the second motion information, that is, when simultaneously indicating forward prediction, a reference frame determined by the first motion information and a reference frame determined by the second motion information are the same video frame, when simultaneously indicating backward prediction, a reference frame determined by the first motion information and a reference frame determined by the second motion information are the same video frame, and when simultaneously indicating bidirectional prediction, the two reference frames determined by the first motion information are the same as the two reference frames determined by the second motion information.

[0060] In one embodiment, if the target image block is indeed moving in parallel in the target video, then this means that when the target image block is encoded in a non-dividing manner, it should have the best coding efficiency when implemented based on the translational inter-frame prediction mode in the inter-frame prediction mode, that is, the best prediction mode for the target image block should be the translational inter-frame prediction mode. Based on this, the video encoding device can further determine whether the target image block is moving in parallel in the target video by determining whether the best prediction mode for the target image block when encoded in a non-dividing manner is the translational inter-frame prediction mode. Furthermore, the video encoding device can also obtain the corresponding prediction costs when the target image block is encoded in a non-dividing manner based on each prediction mode in the inter-frame prediction mode and the corresponding prediction costs when the target image block is encoded in a non-dividing manner; the inter-frame prediction mode includes at least the translational inter-frame prediction mode; if the prediction mode indicated by the minimum prediction cost is the translational inter-frame prediction mode, then the operation of obtaining the first motion information required for the target image block when encoded in a non-dividing manner is performed. Among them, the prediction cost can be used to measure the coding efficiency when performing encoding processing under a certain prediction mode. The appropriate evaluation index can be selected according to specific needs. For example, the rate-distortion cost can be selected as the prediction cost; the prediction mode indicated by the minimum prediction cost is the translation inter-frame prediction mode, indicating that the best prediction mode is the translation inter-frame prediction mode, so the operation of obtaining the first motion information required for the target image block when encoding processing is performed in a non-division manner can be performed.

[0061] In one embodiment, if the target image block does move in parallel in the target video, it means that when the target image block is encoded in a non-division manner, it should have a good encoding effect when implemented based on the translation inter-frame prediction mode in the inter-frame prediction mode. At this time, the pixel difference between the image area with the most similar pixel distribution obtained by motion search for the target image block and the target image block should be small enough; therefore, the video encoding device can further determine whether the target image block moves in parallel in the target video based on the pixel difference between the image area with the most similar pixel distribution obtained by motion search for the target image block and the target image block. Furthermore, if the prediction mode indicated by the minimum prediction cost is the translation inter-frame prediction mode, then the operation of obtaining the first motion information required for the target image block when the encoding process is performed in a non-division manner is performed, which may include: if the prediction mode indicated by the minimum prediction cost is the translation inter-frame prediction mode, then determining the search error generated by the motion search based on the translation inter-frame prediction mode when the target image block is encoded in a non-division manner; a search error is used to indicate: the pixel difference between the target image block and a reference image block, the target image block and the corresponding reference image block are the same size, and the reference image block corresponding to the target image block is determined from the reference frame of the target video; if the minimum search error is less than the search error threshold, then the operation of obtaining the first motion information required for the target image block when the encoding process is performed in a non-division manner is performed. Among them, the search error threshold can be set according to specific needs and is not limited in the embodiment of the present application.

[0062] The reference image block corresponding to the target image block is determined from the reference frame corresponding to the target image block; the image region of the target reference image block indicated by the minimum search error in the reference frame corresponding to the target image block is the image region obtained by motion search in the reference frame corresponding to the target image block and having the most similar pixel distribution to the target image block; accordingly, the minimum search error can be used to indicate the pixel difference between the target image block and the image region with the most similar pixel distribution obtained by motion search. A method for determining the minimum search error provided in an embodiment of the present application can be shown by the following formula 1:

[0063]

[0064] Among them, S represents the minimum search error, m represents the width of the target image block, n represents the height of the target image block, and I i Represents the i-th pixel value in the target image block, I′ i Represents the i-th pixel value in the target reference image block.

[0065] S604, when the encoding indication information of the target image block includes the first encoding indication information, if it is determined based on the target image block and each first image block that the target image block does not move parallel in the target video to which the video frame to be encoded belongs, then the encoding indication information of each second image block is determined as the first encoding indication information.

[0066] In one embodiment, when any of the following three determination conditions is met, it can be determined that the target image block does not move parallel in the target video to which the video frame to be encoded belongs; the determination conditions include: (1) the first motion information corresponding to the target image block is not completely the same as the second motion information corresponding to each first image block, that is, there is at least one second motion information corresponding to the first image block in each first image block, which is different from the first motion information corresponding to the target image block; (2) the optimal prediction mode of the target image block is not a translation inter-frame prediction mode, that is, the prediction mode indicated by the minimum prediction cost is not a translation inter-frame prediction mode; (3) the minimum search error is greater than or equal to the search error threshold.

[0067] S605 : When the encoding indication information of the target image block includes second encoding indication information, determine the encoding indication information of each second image block as the second encoding indication information.

[0068] In one embodiment, when the encoding indication information of the target image block includes the second encoding indication information, the encoding indication information of each second image block is determined as the second encoding indication information, so that when each second image block is encoded in a non-division manner, the intra-frame prediction mode can be skipped and only implemented based on the inter-frame prediction mode.

[0069] See also Figure 7a, is a prediction mode decision diagram provided in an embodiment of the present application; a video encoding device can obtain encoding indication information of a target image block in a video frame to be encoded; the encoding indication information includes first encoding indication information or second encoding indication information, the first encoding indication information is used to indicate: when the image block is encoded in a non-division mode, it is implemented based on an inter-frame prediction mode and an intra-frame prediction mode respectively, and the second encoding indication information is used to indicate: when the image block is encoded in a non-division mode, it is implemented based on an inter-frame prediction mode; when the encoding indication information of the target image block includes the first encoding indication information, a first image block obtained by adopting the target division mode for the target image block is determined. It is determined whether the optimal prediction mode for the target image block is a translational inter-frame prediction mode in the inter-frame prediction mode; if not, the encoding indication information of the second image block obtained by adopting each of the multiple division modes for the target image block is determined as the first encoding indication information; if so, it is determined whether the minimum search error generated by the target image block when the non-division mode is encoded is less than a search error threshold. If not, the coding indication information of each second image block is determined as the first coding indication information; if so, it is determined whether the first motion information corresponding to the target image block and the second motion information corresponding to each first image block are all the same. If not, the coding indication information of each second image block is determined as the first coding indication information; if so, the coding indication information of each second image block is determined as the second coding indication information. In the case where the coding indication information of the target image block includes the second coding indication information, the coding indication information of each second image block is determined as the second coding indication information.

[0070] See also Figure 7b, which is a decision diagram of another prediction mode provided in an embodiment of the present application; the video encoding device can obtain encoding indication information of a target image block in a video frame to be encoded; the encoding indication information includes first encoding indication information or second encoding indication information, the first encoding indication information is used to indicate: when the image block is encoded in a non-division manner, it is implemented based on an inter-frame prediction mode and an intra-frame prediction mode respectively, and the second encoding indication information is used to indicate: when the image block is encoded in a non-division manner, it is implemented based on an inter-frame prediction mode; when the encoding indication information of the target image block includes the first encoding indication information, the first image block obtained by the target division manner of the target image block is determined. Obtaining prediction costs corresponding to each prediction mode in the inter-frame prediction mode and prediction costs corresponding to each prediction mode in the intra-frame prediction mode when encoding the target image block in a non-division manner; determining whether the prediction mode indicated by the minimum prediction cost is the translational inter-frame prediction mode; if not, determining the encoding indication information of the second image block obtained by each of the multiple division modes of the target image block as the first encoding indication information; if so, determining the search error generated by motion search based on the translational inter-frame prediction mode when encoding the target image block in a non-division manner. Determining whether the minimum search error is less than a search error threshold; if not, determining the encoding indication information of each second image block as the first encoding indication information; if so, obtaining first motion information required for encoding the target image block in a non-division manner; and obtaining second motion information required for each first image block when encoding the target image block in a non-division manner. Determine whether the first motion information corresponding to the target image block is the same as the second motion information corresponding to each first image block; if not, determine the encoding indication information of each second image block as the first encoding indication information; if so, determine the encoding indication information of each second image block as the second encoding indication information. In the case where the encoding indication information of the target image block includes the second encoding indication information, the encoding indication information of each second image block is determined as the second encoding indication information. Furthermore, since the second image blocks obtained by dividing the target image block can also be recursively encoded, it means that when the encoding indication information of each second image block is determined to be the second encoding indication information, the encoding indication information of the image blocks obtained by dividing each second image block is also determined to be the second encoding indication information, until the division termination condition is reached; the effect of accelerating video encoding can be achieved.

[0071] In one embodiment, since the second image block can be obtained by dividing the target image block, at this time, the target image block can be used as the parent image block of the second image block, and the second image block can be used as the child image block of the target image block. Based on this, when determining the encoding indication information of any image block, it can be obtained by inheriting the encoding indication information of its parent image block. In one embodiment, when the encoding indication information of the target image block includes the first encoding indication information, if it is determined that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, then when the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block is determined as the second encoding indication information, the video encoding device can update the encoding indication information of the target image block to the second encoding indication information; before any second image block is encoded in a non-division method, it inherits the updated encoding indication information of the target image block to determine that the encoding indication information of any second image block is the second encoding indication information. If it is determined that the target image block does not move in parallel in the target video to which the video frame to be encoded belongs, then when the encoding indication information of each second image block is determined to be the first encoding indication information, the video encoding device may inherit the encoding indication information of the target image block before any second image block is encoded in a non-dividing manner, so as to determine that the encoding indication information of any second image block is the first encoding indication information. In the case where the encoding indication information of the target image block includes the second encoding indication information, when the encoding indication information of each second image block is determined to be the second encoding indication information, the video encoding device may inherit the encoding indication information of the target image block before any second image block is encoded in a non-dividing manner, so as to determine that the encoding indication information of any second image block is the second encoding indication information. In one embodiment, when obtaining the coding indication information of the target image block, the video coding device may determine the coding indication information of the target image block as the first coding indication information if the target image block does not have a parent image block, and inherit the coding indication information of its parent image block if the target image block has a parent image block; it is worth noting that if the coding indication information of the parent image block is updated during the processing of the parent image block of the target image block, then when the target image block needs to inherit the coding indication information of its parent image block, the coding indication information of its parent image block is already the updated coding indication information, that is, at this time the target image block inherits the updated coding indication information of its parent image block.

[0072] In one embodiment, when a video encoding device encodes a target image block, a top-down encoding architecture may be used, that is, the video encoding device may first encode the target image block in a non-dividing manner, and then successively adopt other division methods from among multiple division methods to recursively encode the target image block; when recursively encoding the target image block in other division methods, the target image block may be first divided in a corresponding division method to obtain a corresponding second image block (sub-image block), and the divided second image block may be recursively encoded; when recursively encoding any second image block, the second image block is taken as the target image block, and may first be encoded in a non-dividing manner, and then successively adopt other division methods from among multiple division methods to recursively encode. Further optionally, since in the process of deciding the encoding indication information of the second image block obtained by dividing the target image block, it is necessary to make a decision based on the target image block and the first image block obtained by the target image block using the target division method, therefore, when encoding the target image block, the video encoding device can be set to first encode the target image block using the non-division method, then recursively encode the target image block using the target division method, and then recursively encode the target image block using other division methods in multiple division methods in sequence. Furthermore, for the target image block, after encoding the target image block in various combinations using various division methods and various prediction modes, the combination with the best encoding efficiency can be selected to obtain the final encoding result; optionally, by comparing the prediction costs of the target image block in various combinations, the combination corresponding to the minimum prediction cost can be determined as the best combination method, and the coding efficiency under the best combination method is considered to be the best. Further, the encoding result under the best combination method can be used as the final encoding result; further optionally, the prediction cost can be selected according to specific needs, for example, the rate-distortion cost can be used as the prediction cost; this process can be done by Figure 8 Shown.

[0073] In one embodiment, the above-mentioned prediction mode decision method can be used during the encoding process of a target image block to determine whether a second image block (sub-image block) obtained by dividing the target image block, as well as a sub-image block obtained by recursively dividing the second image block, can skip the intra-frame prediction mode when encoding is performed in a non-division manner, thereby accelerating the encoding process and reducing computing resource consumption. Based on this, a video encoding device can introduce a specific prediction mode decision process during the recursive encoding process of the target image block using the target division method to determine whether the second image block obtained by the target division method can skip the intra-frame prediction mode when encoding is performed in a non-division manner. Moreover, since the specific prediction mode decision process can be executed by updating the encoding indication information of the target image block so that the sub-image blocks of the target image block can inherit the encoding indication information, when the target image block is subsequently encoded using other division methods among the multiple division methods, the same decision effect can be achieved by inheriting the encoding indication information (or updated encoding indication information) of the target image block.

[0074] In one embodiment, see Figure 9a, is another schematic diagram of encoding a target image block provided by an embodiment of the present application; when the video encoding device needs to encode the target image block, it can obtain the encoding indication information of the target image block. Specifically, it can determine whether the target image block has a parent image block. If not, the encoding indication information of the target image block is determined as the first encoding indication information. If it exists, the encoding indication information of the parent image block is inherited. The target image block can be encoded according to the encoding indication information of the target image block and in a non-division manner. Further, the video encoding device enters a processing flow for recursively encoding the target image in a target division manner; in this process, the target image block can be first divided in a target division manner to obtain a corresponding second image block (sub-image block); it is determined whether the encoding indication information of the target image block includes the first encoding indication information; in the case that the encoding indication information of the target image block includes the first encoding indication information, it is determined that the target image block is the first image block obtained in the target division manner. At this time, the second image block is the same as the first image block. Based on the target image block and each first image block, determine whether the target image block moves in parallel in the target video to which it belongs. If, based on the target image block and each first image block, it is determined that the target image block moves in parallel in the target video to which it belongs, the encoding indication information of the target image block is updated to the second encoding indication information; and the second image block obtained by division is recursively encoded. Furthermore, the target image block is recursively encoded using other division methods in a plurality of division methods in sequence. In the case where the encoding indication information of the target image block includes the second encoding indication information, or, in the case where the encoding indication information of the target image block includes the first encoding indication information, if, based on the target image block and each first image block, it is determined that the target image block does not move in parallel in the target video to which it belongs, the process of recursively encoding the second image block obtained by division is executed. In one embodiment, see Figure 9b , is a schematic diagram of another method for encoding a target image block provided by an embodiment of the present application; Figure 9b It is shown that the video encoding device performs a process of recursively encoding the second image blocks obtained by division when the encoding indication information of the target image block includes the second encoding indication information; or when the optimal prediction mode of the target image block is not the translation inter-frame prediction mode; or when the minimum search error generated when the target image block is encoded in a non-division manner is not less than the search error threshold; or when the first motion information corresponding to the target image block is not completely the same as the second motion information corresponding to each first image block.

[0075] In one embodiment, since the inter-frame prediction mode cannot be skipped during the encoding process of the target image block, that is, the inter-frame prediction mode must be executed, the same decision effect as that achieved by the above-mentioned prediction mode decision scheme can be achieved by setting a new first encoding indication information for indicating that the image block needs to be implemented based on the intra-frame prediction mode when the image block is encoded in a non-dividing manner, and a new second encoding indication information for indicating that the image block does not need to be implemented based on the intra-frame prediction mode when the image block is encoded in a non-dividing manner. In this case, refer to Figure 10 , which is a schematic diagram of an embodiment of the present application providing a method for encoding a target image block in a non-division manner; after the video encoding device obtains the encoding indication information of the target image block (the encoding indication information at this time includes new first encoding indication information or new second encoding indication information), it can use the non-division method and the inter-frame prediction mode to encode the target image block; further, the video encoding device can determine whether the encoding indication information of the target image block includes the new first encoding indication information. If it does, the target image block is encoded in a non-division method and the intra-frame prediction mode. If it does not include it (that is, the encoding indication information of the target image block includes the new second encoding indication information), the process of encoding the target image block in a non-division method is terminated.

[0076] In an embodiment of the present application, if the target image block is implemented based on the inter-frame prediction mode and the intra-frame prediction mode respectively when the encoding process is performed in a non-dividing manner, then when it is determined that the target image block moves in parallel in the target video to which it belongs based on the target image block and the first image blocks obtained by dividing the target image block in the target dividing manner, it is decided that the target image block is divided into each second image block when the encoding process is performed in a non-dividing manner, the intra-frame prediction mode can be skipped and the encoding can be performed only based on the inter-frame prediction mode; when it is determined that the target image block does not move in parallel in the target video to which it belongs, it is decided that the target image block is divided into each second image block when the encoding process is performed in a non-dividing manner During encoding, the intra-frame prediction mode cannot be skipped; when the target image block is encoded in a non-divided manner and is implemented based on the inter-frame prediction mode, it is decided that each second image block obtained by dividing the target image block can skip the intra-frame prediction mode when the encoding is performed in a non-divided manner; further, since the second image block obtained by dividing the target image block can also be recursively encoded, it means that when the second image block can skip the intra-frame prediction mode, the image block obtained by dividing the second image block can also skip the intra-frame prediction mode when the encoding is performed in a non-divided manner; the computational complexity of the encoding process can be reduced, the video encoding process can be accelerated, and computing resources can be saved.

[0077] Based on the above-mentioned embodiments of the decision method for prediction mode, the present application provides a decision device for prediction mode. Figure 11 , is a structural diagram of a prediction model decision device provided in an embodiment of the present application. The prediction model decision device may include an acquisition unit 1101 and a processing unit 1102. Figure 11 The decision making device of the prediction mode shown can be used to perform the following operations:

[0078] An acquiring unit 1101 is configured to acquire encoding indication information of a target image block in a to-be-encoded video frame; the encoding indication information includes first encoding indication information or second encoding indication information, the first encoding indication information being used to indicate that, when encoding of the image block is performed in a non-division manner, the image block is to be encoded based on an inter-frame prediction mode and an intra-frame prediction mode, respectively; and the second encoding indication information being used to indicate that, when encoding of the image block is performed in the non-division manner, the image block is to be encoded based on the inter-frame prediction mode.

[0079] The processing unit 1102 is configured to determine, when the encoding indication information of the target image block includes the first encoding indication information, a first image block obtained by adopting a target division method for the target image block; the target division method is different from the non-division method;

[0080] The processing unit 1102 is further configured to determine, as the second encoding indication information, the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block, if it is determined based on the target image block and each first image block that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, so that each second image block is implemented based on the inter-frame prediction mode when encoding is performed using the non-division method; the multiple division methods include the non-division method and the target division method.

[0081] In one embodiment, the processing unit 1102 determines, based on the target image block and each first image block, a manner in which the target image block is moved in parallel in the target video to which the to-be-encoded video frame belongs, including:

[0082] obtaining first motion information required for encoding the target image block in the non-division mode; wherein the first motion information refers to motion information required for performing motion search based on a translational inter-frame prediction mode in the inter-frame prediction mode when encoding the target image block in the non-division mode;

[0083] Obtaining second motion information required for each of the first image blocks when encoding is performed in the non-division manner; any second motion information refers to motion information required for performing motion search based on a translational inter-frame prediction mode in the inter-frame prediction mode when encoding is performed in the non-division manner on the corresponding first image block;

[0084] If the first motion information corresponding to the target image block is the same as the second motion information corresponding to each of the first image blocks, it is determined that the target image block moves in parallel in the target video to which the to-be-encoded video frame belongs.

[0085] In one embodiment, the processing unit 1102 is further configured to:

[0086] Obtaining prediction costs corresponding to implementation of each prediction mode in the inter-frame prediction mode and prediction costs corresponding to implementation of each prediction mode in the intra-frame prediction mode when encoding the target image block in the non-division manner; the inter-frame prediction mode includes at least the translation inter-frame prediction mode;

[0087] If the prediction mode indicated by the minimum prediction cost is the translation inter-frame prediction mode, the operation of obtaining the first motion information required for encoding the target image block in the non-division manner is performed.

[0088] In one embodiment, the processing unit 1102 is configured to, if the prediction mode indicated by the minimum prediction cost is the translational inter-frame prediction mode, specifically perform the following operations when performing the operation of obtaining the first motion information required for encoding the target image block in the non-division manner:

[0089] If the prediction mode indicated by the minimum prediction cost is the translational inter-frame prediction mode, determining a search error generated by a motion search based on the translational inter-frame prediction mode when the target image block is encoded using the non-division method; a search error is used to indicate: a pixel difference between the target image block and a reference image block, the target image block and the corresponding reference image block being the same size, and the reference image block corresponding to the target image block being determined from a reference frame of the target video;

[0090] If the minimum search error is less than the search error threshold, the operation of obtaining the first motion information required for encoding the target image block in the non-division manner is performed.

[0091] In one embodiment, the processing unit 1102 is further configured to:

[0092] In a case where the encoding indication information of the target image block includes the second encoding indication information, the encoding indication information of each second image block is determined as the second encoding indication information.

[0093] In one embodiment, the processing unit 1102 is further configured to:

[0094] In a case where the encoding indication information of the target image block includes the first encoding indication information, if, based on the target image block and the respective first image blocks, it is determined that the target image block does not move parallely in the target video to which the video frame to be encoded belongs, the encoding indication information of the respective second image blocks is determined to be the first encoding indication information.

[0095] In one embodiment, when the processing unit 1102 determines the encoding indication information of the second image block obtained by dividing the target image block using each of the multiple division methods as the second encoding indication information, it specifically performs the following operations:

[0096] Updating the encoding indication information of the target image block to the second encoding indication information;

[0097] Before encoding processing is performed in the non-division manner, any second image block inherits the updated encoding indication information of the target image block to determine that the encoding indication information of any second image block is the second encoding indication information.

[0098] According to one embodiment of the present application, Figure 4 as well as Figure 6 The steps involved in the decision-making method of the forecast model shown can be represented by Figure 11 The prediction mode shown is executed by each unit in the decision device. For example, Figure 4 Step S401 shown can be performed by Figure 11 The prediction mode decision device shown in FIG. 1 is executed by the acquisition unit 1101. Figure 4 Steps S402 to S403 shown in FIG. Figure 11 The processing unit 1102 in the decision device of the prediction mode shown is executed. Figure 6 Step S601 shown can be performed by Figure 11 The prediction mode decision device shown in FIG. 1 is executed by the acquisition unit 1101. Figure 6 Steps S602 to S605 shown in FIG. Figure 11 The prediction mode decision device is shown as being executed by the processing unit 1102.

[0099] According to another embodiment of the present application, Figure 11The various units in the decision-making device of the prediction model shown can be individually or all combined into one or several other units to form, or one (or some) of the units can be further divided into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. For example, the functions implemented by the above-mentioned units can be implemented by a processing unit. In other embodiments of the present application, the decision-making device of the prediction model based on the logical function division can also include other units. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0100] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory (RAM), a read-only memory (ROM) and other processing elements and storage elements. Figure 4 as well as Figure 6 A computer program (including program code) for each step of the corresponding method shown in FIG. Figure 11 The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the computing device via the computer-readable storage medium and run therein.

[0101] In an embodiment of the present application, if the target image block is implemented based on the inter-frame prediction mode and the intra-frame prediction mode respectively when the encoding process is performed in a non-division manner, then based on the target image block and the first image blocks obtained by dividing the target image block in the target division manner, when it is determined that the target image block moves in parallel in the target video to which it belongs, it is decided that the second image blocks obtained by dividing the target image block can skip the intra-frame prediction mode when the encoding process is performed in a non-division manner, and only be encoded based on the inter-frame prediction mode, which can reduce the computational complexity of the encoding process, accelerate the video encoding process and save computing resources.

[0102] Based on the above-mentioned related embodiments of the prediction mode decision method and the prediction mode decision device embodiment, the present application also provides an electronic device, which can be the video encoding device in the above-mentioned embodiment. Figure 12 , is a structural diagram of an electronic device provided in an embodiment of the present application. Figure 12The electronic device shown may include at least a processor 1201, an input interface 1202, an output interface 1203, and a computer storage medium 1204. The processor 1201, the input interface 1202, the output interface 1203, and the computer storage medium 1204 may be connected via a bus or other means.

[0103] Computer storage medium 1204 may be stored in the memory of the electronic device. Computer storage medium 1204 is used to store a computer program, which includes program instructions. Processor 1201 is used to execute the program instructions stored in computer storage medium 1204. Processor 1201 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device. It is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the decision-making method process or corresponding functions of the above-mentioned prediction model.

[0104] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and, of course, the extended storage medium supported by the terminal. The computer storage medium provides a storage space that stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 1201 are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed random access memory (RAM) memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0105] In one embodiment, the processor 1201 may load and execute one or more instructions stored in a computer storage medium to implement the above-mentioned Figure 4 as well as Figure 6 In the corresponding steps of the method in the embodiment of the prediction mode decision method, in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 1201 and execute the following steps:

[0106] Obtaining encoding indication information of a target image block in a to-be-encoded video frame; the encoding indication information includes first encoding indication information or second encoding indication information, the first encoding indication information being used to indicate that, when encoding is performed in a non-division manner, the image block is to be encoded based on an inter-frame prediction mode and an intra-frame prediction mode, respectively; and the second encoding indication information being used to indicate that, when encoding is performed in the non-division manner, the image block is to be encoded based on the inter-frame prediction mode.

[0107] When the encoding indication information of the target image block includes the first encoding indication information, determining a first image block obtained by adopting a target division method for the target image block; the target division method is different from the non-division method;

[0108] If, based on the target image block and each first image block, it is determined that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, the encoding indication information of the second image block obtained by each of the multiple division methods of the target image block is determined as the second encoding indication information, so that each second image block is implemented based on the inter-frame prediction mode when the encoding processing is performed using the non-division method; the multiple division methods include the non-division method and the target division method.

[0109] In one embodiment, the processor 1201 determines, based on the target image block and each first image block, a manner in which the target image block is moved in parallel in the target video to which the to-be-encoded video frame belongs, including:

[0110] obtaining first motion information required for encoding the target image block in the non-division mode; wherein the first motion information refers to motion information required for performing motion search based on a translational inter-frame prediction mode in the inter-frame prediction mode when encoding the target image block in the non-division mode;

[0111] Obtaining second motion information required for each of the first image blocks when encoding is performed in the non-division manner; any second motion information refers to motion information required for performing motion search based on a translational inter-frame prediction mode in the inter-frame prediction mode when encoding is performed in the non-division manner on the corresponding first image block;

[0112] If the first motion information corresponding to the target image block is the same as the second motion information corresponding to each of the first image blocks, it is determined that the target image block moves in parallel in the target video to which the to-be-encoded video frame belongs.

[0113] In one embodiment, the processor 1201 is further configured to:

[0114] Obtaining prediction costs corresponding to implementation of each prediction mode in the inter-frame prediction mode and prediction costs corresponding to implementation of each prediction mode in the intra-frame prediction mode when encoding the target image block in the non-division manner; the inter-frame prediction mode includes at least the translation inter-frame prediction mode;

[0115] If the prediction mode indicated by the minimum prediction cost is the translation inter-frame prediction mode, the operation of obtaining the first motion information required for encoding the target image block in the non-division manner is performed.

[0116] In one embodiment, if the prediction mode indicated by the minimum prediction cost is the translational inter-frame prediction mode, the processor 1201 is configured to perform the operation of obtaining the first motion information required for encoding the target image block in the non-division manner by specifically performing the following operations:

[0117] If the prediction mode indicated by the minimum prediction cost is the translational inter-frame prediction mode, determining a search error generated by a motion search based on the translational inter-frame prediction mode when the target image block is encoded using the non-division method; a search error is used to indicate: a pixel difference between the target image block and a reference image block, the target image block and the corresponding reference image block being the same size, and the reference image block corresponding to the target image block being determined from a reference frame of the target video;

[0118] If the minimum search error is less than the search error threshold, the operation of obtaining the first motion information required for encoding the target image block in the non-division manner is performed.

[0119] In one embodiment, the processor 1201 is further configured to:

[0120] In a case where the encoding indication information of the target image block includes the second encoding indication information, the encoding indication information of each second image block is determined as the second encoding indication information.

[0121] In one embodiment, the processor 1201 is further configured to:

[0122] In a case where the encoding indication information of the target image block includes the first encoding indication information, if, based on the target image block and the respective first image blocks, it is determined that the target image block does not move parallely in the target video to which the video frame to be encoded belongs, the encoding indication information of the respective second image blocks is determined to be the first encoding indication information.

[0123] In one embodiment, when the processor 1201 determines the encoding indication information of the second image block obtained by dividing the target image block using each of the multiple division modes as the second encoding indication information, the processor 1201 specifically performs the following operations:

[0124] Updating the encoding indication information of the target image block to the second encoding indication information;

[0125] Before encoding processing is performed in the non-division manner, any second image block inherits the updated encoding indication information of the target image block to determine that the encoding indication information of any second image block is the second encoding indication information.

[0126] The embodiment of the present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of an electronic device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the electronic device performs the above-mentioned Figure 4 as well as Figure 6 The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0127] The above description is merely a specific embodiment of the present application, but the scope of protection of the present 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 the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A decision-making method for a prediction model, characterized in that: include: Obtaining encoding indication information of a target image block in a video frame to be encoded; The encoding instruction information includes first encoding instruction information or second encoding instruction information, the first encoding instruction information is used to indicate that when encoding is performed on an image block in a non-division manner, encoding is performed based on an inter-frame prediction mode and an intra-frame prediction mode, respectively; the second encoding instruction information is used to indicate that when encoding is performed on an image block in a non-division manner, encoding is performed based on the inter-frame prediction mode; When the encoding indication information of the target image block includes the first encoding indication information, determining a first image block obtained by adopting a target division method for the target image block; the target division method is different from the non-division method; If it is determined based on the target image block and each first image block that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, encoding indication information of a second image block obtained by each division method of the target image block in a plurality of division methods is determined as the second encoding indication information, and encoding indication information of a sub-image block obtained by dividing each second image block is determined as the second encoding indication information, so that each second image block is implemented based on the inter-frame prediction mode when encoding is performed in the non-division method, and so that each sub-image block is implemented based on the inter-frame prediction mode when encoding is performed in the non-division method; the plurality of division methods include the non-division method and the target division method; In a case where the encoding indication information of the target image block includes the first encoding indication information, if, based on the target image block and the respective first image blocks, it is determined that the target image block does not move parallely in the target video to which the video frame to be encoded belongs, the encoding indication information of the respective second image blocks is determined to be the first encoding indication information.

2. The method according to claim 1, wherein The determining, based on the target image block and each first image block, a manner in which the target image block is moved in parallel in the target video to which the to-be-encoded video frame belongs, includes: obtaining first motion information required for encoding the target image block in the non-division mode; wherein the first motion information refers to motion information required for performing motion search based on a translational inter-frame prediction mode in the inter-frame prediction mode when encoding the target image block in the non-division mode; Obtaining second motion information required for each of the first image blocks when encoding is performed in the non-division manner; any second motion information refers to motion information required for performing motion search based on a translational inter-frame prediction mode in the inter-frame prediction mode when encoding is performed in the non-division manner on the corresponding first image block; If the first motion information corresponding to the target image block is the same as the second motion information corresponding to each of the first image blocks, it is determined that the target image block moves in parallel in the target video to which the to-be-encoded video frame belongs.

3. The method according to claim 2, wherein The method further comprises: Obtaining prediction costs corresponding to implementation of each prediction mode in the inter-frame prediction mode and prediction costs corresponding to implementation of each prediction mode in the intra-frame prediction mode when encoding the target image block in the non-division manner; the inter-frame prediction mode includes at least the translation inter-frame prediction mode; If the prediction mode indicated by the minimum prediction cost is the translation inter-frame prediction mode, the operation of obtaining the first motion information required for encoding the target image block in the non-division manner is performed.

4. The method according to claim 3, wherein If the prediction mode indicated by the minimum prediction cost is the translation inter prediction mode, performing the operation of obtaining the first motion information required for encoding the target image block in the non-division manner includes: If the prediction mode indicated by the minimum prediction cost is the translational inter-frame prediction mode, determining a search error generated by a motion search based on the translational inter-frame prediction mode when the target image block is encoded using the non-division method; a search error is used to indicate: a pixel difference between the target image block and a reference image block, the target image block and the corresponding reference image block being the same size, and the reference image block corresponding to the target image block being determined from a reference frame of the target video; If the minimum search error is less than the search error threshold, the operation of obtaining the first motion information required for encoding the target image block in the non-division manner is performed.

5. The method according to claim 1, wherein The method further comprises: In a case where the encoding indication information of the target image block includes the second encoding indication information, the encoding indication information of each second image block is determined as the second encoding indication information.

6. The method according to any one of claims 1 to 5, wherein: The determining, as the second encoding indication information, the encoding indication information of the second image block obtained by dividing the target image block in each of the multiple division modes includes: Updating the encoding indication information of the target image block to the second encoding indication information; Before encoding processing is performed in the non-division manner, any second image block inherits the updated encoding indication information of the target image block to determine that the encoding indication information of any second image block is the second encoding indication information.

7. A decision-making device for a prediction model, characterized in that: include: An acquisition unit, configured to acquire encoding indication information of a target image block in a video frame to be encoded; The encoding instruction information includes first encoding instruction information or second encoding instruction information, the first encoding instruction information is used to indicate that when encoding is performed on an image block in a non-division manner, encoding is performed based on an inter-frame prediction mode and an intra-frame prediction mode, respectively; the second encoding instruction information is used to indicate that when encoding is performed on an image block in a non-division manner, encoding is performed based on the inter-frame prediction mode; a processing unit, configured to determine, when the encoding indication information of the target image block includes the first encoding indication information, a first image block obtained by adopting a target division method for the target image block; the target division method is different from the non-division method; The processing unit is further configured to, if it is determined based on the target image block and each of the first image blocks that the target image block moves in parallel in the target video to which the video frame to be encoded belongs, determine the encoding indication information of the second image block obtained by each of the multiple division modes of the target image block as the second encoding indication information, and determine the encoding indication information of the sub-image blocks obtained by dividing each of the second image blocks as the second encoding indication information, so that when encoding is performed in the non-division mode, each of the second image blocks is implemented based on the inter-frame prediction mode, and when encoding is performed in the non-division mode, each of the sub-image blocks is implemented based on the inter-frame prediction mode; the multiple division modes include the non-division mode and the target division mode; The processing unit is further configured to, when the encoding indication information of the target image block includes the first encoding indication information, determine the encoding indication information of each second image block as the first encoding indication information if it is determined based on the target image block and the each first image block that the target image block does not move parallel in the target video to which the video frame to be encoded belongs.

8. An electronic device, characterized in that: The electronic device includes an input interface and an output interface, and further includes: a processor adapted to implement one or more instructions; and A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the prediction model decision method according to any one of claims 1 to 6.

9. A computer storage medium, characterized in that The computer storage medium stores computer program instructions, which, when executed by a processor, are used to execute the prediction model decision method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image prediction method and device

    CN108965871A

  • Video coding method and device, computer equipment and storage medium

    CN109788287A

  • Video encoding method and device, video decoding method and device, electronic equipment and storage medium

    CN112040233A

  • Coding prediction method and device, equipment and medium

    CN115643409A