Video coding method and device

文档序号:172855 发布日期:2021-10-29 浏览:24次 中文

阅读说明:本技术 一种视频编码的方法及装置 (Video coding method and device ) 是由 许东旭 于 2021-07-07 设计创作,主要内容包括:本申请公开了一种视频编码的方法及装置,用以降低视频编码技术的计算复杂度。其中,方法包括:获取编码单元中多个子块的帧内预测代价和帧间预测代价;根据所述编码单元中多个子块的帧内预测代价和帧间预测代价,对所述编码单元执行SKIP模式的帧间预测计算之后,停止对所述编码单元继续执行所述帧间预测计算。(The application discloses a video coding method and a video coding device, which are used for reducing the computational complexity of a video coding technology. The method comprises the following steps: obtaining intra-frame prediction costs and inter-frame prediction costs of a plurality of sub-blocks in a coding unit; and according to the intra-frame prediction cost and the inter-frame prediction cost of a plurality of sub-blocks in the coding unit, stopping continuously executing the inter-frame prediction calculation on the coding unit after executing the inter-frame prediction calculation of the SKIP mode on the coding unit.)

1. A method of video encoding, comprising:

obtaining intra-frame prediction costs and inter-frame prediction costs of a plurality of sub-blocks in a coding unit;

and according to the intra-frame prediction cost and the inter-frame prediction cost of a plurality of sub-blocks in the coding unit, stopping continuously executing the inter-frame prediction calculation on the coding unit after executing the inter-frame prediction calculation of the SKIP mode on the coding unit.

2. The method of claim 1, wherein stopping the inter prediction calculation for the coding unit after performing the inter prediction calculation for the SKIP mode for the coding unit according to the intra prediction cost and the inter prediction cost of the plurality of sub-blocks in the coding unit comprises:

if the sum of the intra-frame prediction costs of the sub-blocks in the coding unit is smaller than the sum of the inter-frame prediction costs of the sub-blocks in the coding unit, after the inter-frame prediction calculation of the SKIP mode is completed on the coding unit, no other inter-frame prediction calculation is performed on the coding unit.

3. The method of claim 1, wherein before obtaining the intra prediction cost and the inter prediction cost of the plurality of sub-blocks in the coding unit, further comprising:

obtaining a motion parameter of a first sub-block, wherein the first sub-block is any one of a plurality of sub-blocks in the coding unit;

and if the motion parameters of the first sub-block meet preset conditions, performing intra-frame prediction and inter-frame prediction on the first sub-block to respectively obtain the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block.

4. The method of claim 3, further comprising:

if the motion parameter of the first sub-block does not meet the preset condition, performing motion estimation on the first sub-block to obtain a motion vector of the first sub-block;

and according to the motion vector of the first sub-block, performing intra-frame prediction and inter-frame prediction on the first sub-block to respectively obtain the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block.

5. The method of claim 3 or 4, wherein the motion parameter of the first sub-block is a predicted motion vector cost of the first sub-block;

the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises:

the predicted motion vector cost of the first sub-block is less than a first threshold.

6. The method of claim 3 or 4, wherein the motion parameter of the first sub-block is a predicted motion vector cost of a neighboring sub-block of the first sub-block, the neighboring sub-block of the first sub-block being any one of four sub-blocks located to the left, above-left, and above-right of the first sub-block;

the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises:

the predicted motion vector cost of neighboring sub-blocks of the first sub-block is less than a second threshold.

7. The method of claim 1, wherein the prediction cost is a video residual signal size, and the frame type corresponding to the coding unit is a P-frame.

8. An apparatus for video encoding, comprising means for performing the method of any one of claims 1 to 7.

9. A computing device, comprising:

a memory for storing program instructions;

a processor for calling program instructions stored in said memory to perform the method of any of claims 1 to 7 in accordance with the obtained program.

10. A computer-readable non-transitory storage medium including computer-readable instructions which, when read and executed by a computer, cause the computer to perform the method of any one of claims 1 to 7.

Technical Field

The embodiment of the application relates to the technical field of cloud transcoding, in particular to a video coding method and device.

Background

With the continuous emergence of various video live broadcast websites, the image quality and the fluency in live broadcast scenes are two major indexes for measuring the live broadcast quality, and how to improve the image quality and the fluency is the main research direction at present. High Efficiency Video Coding (HEVC) is a new generation video coding standard, which may also be referred to as h.265, and can be used to solve the needs of people for vision and hearing in live scenes.

HEVC can effectively improve compression efficiency, but in the encoding process, an encoding device needs to divide each frame of image into a plurality of Coding Units (CUs), each CU may be divided into one or more Prediction Units (PUs), and the prediction units are used to implement the prediction process of the CU. The encoding device needs to traverse all the segmentation modes to determine the rate-distortion cost of each segmentation mode and select the segmentation mode with the minimum rate-distortion cost from the segmentation modes when determining which segmentation mode needs to be adopted. The computational complexity of this encoding technique is thus high.

Disclosure of Invention

The embodiment of the application provides a method and a device for video coding, which are used for reducing the computational complexity of a video coding technology.

In a first aspect, a method for video encoding provided by an embodiment of the present application may be performed by an encoding apparatus, or may be performed by a module, such as a chip, in the encoding apparatus.

The method comprises the following steps: obtaining intra-frame prediction costs and inter-frame prediction costs of a plurality of sub-blocks in a coding unit; and according to the intra-frame prediction cost and the inter-frame prediction cost of a plurality of sub-blocks in the coding unit, stopping continuously executing the inter-frame prediction calculation on the coding unit after executing the inter-frame prediction calculation of the SKIP mode on the coding unit.

In the foregoing technical solution, the inter prediction may include multiple prediction calculations such as SKIP, Merge, 2N × 2N, 2N × N, N × 2N, asymmetric partitioning, and the prediction calculation for performing inter prediction on the coding unit may be determined from the multiple prediction calculations according to intra prediction costs and inter prediction costs of multiple sub blocks in the coding unit. Therefore, all prediction calculation of the coding unit is not needed, and the calculation complexity of the video coding technology is reduced.

In one possible implementation manner, the stopping of the inter prediction calculation on the coding unit after the inter prediction calculation in the SKIP mode is performed on the coding unit according to the intra prediction costs and the inter prediction costs of the plurality of sub blocks in the coding unit includes: if the sum of the intra-frame prediction costs of the sub-blocks in the coding unit is smaller than the sum of the inter-frame prediction costs of the sub-blocks in the coding unit, after the inter-frame prediction calculation of the SKIP mode is completed on the coding unit, no other inter-frame prediction calculation is performed on the coding unit.

In the above technical solution, when the sum of intra-frame prediction costs is less than the sum of inter-frame prediction costs, only inter-frame prediction calculation of the SKIP mode may be performed on the coding unit without performing other prediction calculation, which is beneficial to reducing the calculation complexity of the video coding technology.

In a possible implementation manner, before obtaining the intra prediction cost and the inter prediction cost of the plurality of sub-blocks in the coding unit, the method further includes: obtaining a motion parameter of a first sub-block, wherein the first sub-block is any one of a plurality of sub-blocks in the coding unit; and if the motion parameters of the first sub-block meet preset conditions, performing intra-frame prediction and inter-frame prediction on the first sub-block to respectively obtain the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block.

In one possible implementation manner, the method further includes: if the motion parameter of the first sub-block does not meet the preset condition, performing motion estimation on the first sub-block to obtain a motion vector of the first sub-block; and according to the motion vector of the first sub-block, performing intra-frame prediction and inter-frame prediction on the first sub-block to respectively obtain the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block.

In the above technical solution, if the motion parameter of the first sub-block meets the preset condition, the intra-frame prediction and the inter-frame prediction are directly performed on the first sub-block without performing motion estimation on the first sub-block, thereby further reducing the computational complexity of the video coding technique.

In one possible implementation, the motion parameter of the first sub-block is a predicted motion vector cost of the first sub-block; the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises: the predicted motion vector cost of the first sub-block is less than a first threshold.

In one possible implementation, the motion parameter of the first sub-block is a predicted motion vector cost of a neighboring sub-block of the first sub-block, the neighboring sub-block of the first sub-block being any one of four sub-blocks located to the left, above-left, and above-right of the first sub-block; the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises: the predicted motion vector cost of neighboring sub-blocks of the first sub-block is less than a second threshold.

In a possible implementation manner, the prediction cost is a video residual signal size, and the frame type corresponding to the coding unit is a P frame.

In the above technical solution, the video residual signal with a small calculation amount is used as the prediction cost, so that the calculation complexity of the video coding technology can be further reduced.

In a second aspect, an apparatus for video encoding provided by the embodiments of the present application may be an encoding device, or a module in the encoding device, such as a chip.

The device comprises: an acquisition module and a prediction module; the device comprises an acquisition module, a coding unit and a decoding module, wherein the acquisition module is used for acquiring the intra-frame prediction cost and the inter-frame prediction cost of a plurality of sub-blocks in the coding unit; and the prediction module is used for stopping continuously executing the inter-frame prediction calculation on the coding unit after performing the inter-frame prediction calculation of the SKIP mode on the coding unit according to the intra-frame prediction cost and the inter-frame prediction cost of the plurality of sub-blocks in the coding unit.

In a possible implementation, the prediction module is specifically configured to: if the sum of the intra-frame prediction costs of the sub-blocks in the coding unit is smaller than the sum of the inter-frame prediction costs of the sub-blocks in the coding unit, after the inter-frame prediction calculation of the SKIP mode is completed on the coding unit, no other inter-frame prediction calculation is performed on the coding unit.

In one possible implementation manner, before obtaining the intra prediction cost and the inter prediction cost of the plurality of sub-blocks in the coding unit, the obtaining module is further configured to: obtaining a motion parameter of a first sub-block, wherein the first sub-block is any one of a plurality of sub-blocks in the coding unit; if the motion parameter of the first sub-block meets a preset condition, the prediction module is further configured to perform intra-frame prediction and inter-frame prediction on the first sub-block to obtain an intra-frame prediction cost and an inter-frame prediction cost of the first sub-block, respectively.

In a possible implementation manner, if the motion parameter of the first sub-block does not satisfy the preset condition, the prediction module is further configured to perform motion estimation on the first sub-block to obtain a motion vector of the first sub-block; and according to the motion vector of the first sub-block, performing intra-frame prediction and inter-frame prediction on the first sub-block to respectively obtain the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block.

In one possible implementation, the motion parameter of the first sub-block is a predicted motion vector cost of the first sub-block; the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises: the predicted motion vector cost of the first sub-block is less than a first threshold.

In one possible implementation, the motion parameter of the first sub-block is a predicted motion vector cost of a neighboring sub-block of the first sub-block, the neighboring sub-block of the first sub-block being any one of four sub-blocks located to the left, above-left, and above-right of the first sub-block; the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises: the predicted motion vector cost of neighboring sub-blocks of the first sub-block is less than a second threshold.

In a possible implementation manner, the prediction cost is a video residual signal size, and the frame type corresponding to the coding unit is a P frame.

In a third aspect, an embodiment of the present application further provides a computing device, including:

a memory for storing program instructions;

and a processor, configured to call the program instructions stored in the memory, and execute any one of the methods in the first aspect or the first aspect according to the obtained program.

In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program or instructions which, when executed by a computing device, cause the computing device to perform the method of the first aspect or any one of the first aspects.

In a fifth aspect, the present application provides a computer program product comprising a computer program or instructions which, when executed by a computing device, implements the method of the first aspect or any one of the first aspects above.

For technical effects that can be achieved by any one of the second aspect to the fifth aspect, reference may be made to the description of the advantageous effects in the first aspect, and details are not repeated here.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present application;

fig. 2 is a schematic diagram of video encoding according to an embodiment of the present application;

fig. 3 is a flowchart illustrating a method for video encoding according to an embodiment of the present application;

fig. 4 is a schematic diagram of determining adjacent sub-blocks according to an embodiment of the present disclosure;

fig. 5 is a schematic diagram of another method for determining adjacent sub-blocks according to an embodiment of the present disclosure;

fig. 6 is a schematic diagram of a motion estimation determination process according to an embodiment of the present disclosure;

fig. 7 is a flowchart illustrating a further method for video encoding according to an embodiment of the present application;

fig. 8 is a schematic structural diagram of an apparatus for video encoding according to an embodiment of the present application;

fig. 9 is a schematic structural diagram of another video encoding apparatus according to an embodiment of the present application.

Detailed Description

The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

Fig. 1 is a system architecture used in the embodiments of the present application, which includes an encoding device and a decoding device. The encoding device may encode the acquired video data, and send the encoded video data to the decoding device via the network. Alternatively, either the encoding device or the decoding device may be an electronic device, such as a desktop computer, a laptop computer, a tablet computer, a set-top box, a television, a camera, a display device, a digital media player, a video game console, a video streaming device, and so forth.

Referring to the encoding diagram exemplarily shown in fig. 2, in the encoding process, the encoding apparatus may divide each frame of video image in the video data into a plurality of encoding units, where the maximum size of the encoding unit may be 64 × 64, and the minimum size may be 8 × 8.

In a specific implementation, the size of a coding unit included in an original video image acquired by the encoding apparatus is 64 × 64, at this time, the coding unit is not yet divided, and the corresponding depth is 0 (see fig. 2, which shows that the depth is 0, and 64 × 64). The encoding device then performs multiple partitions:

first segmentation: dividing each coding unit with a size of 64 × 64 into four coding units of 32 × 32 (see fig. 2 showing that depth is 1, 32 × 32);

and (3) second segmentation: dividing each coding unit of size 32 × 32 into four coding units of size 16 × 16 (see depth 2, 16 × 16 shown in fig. 2);

and (3) third segmentation: each coding unit of size 16 × 16 is divided into four coding units of size 8 × 8 (see depth 3, 8 × 8 shown in fig. 2).

Further, the encoding apparatus may determine one or more prediction units corresponding to the coding unit based on different prediction calculation modes and the coding unit obtained by each division. The prediction calculation mode may specifically include: intra (intra) mode and inter (inter) mode.

With continued reference to fig. 2, for inter prediction, each prediction depth requires exhaustive computation of a wide variety of partition combinations: SKIP, Merge, 2N × 2N, 2N × N, N × 2N, asymmetric partitioning (e.g., 2N × nU, 2N × nD, nL × 2N, and nR × 2N), and the like. For intra prediction, 2N × 2N needs to be calculated for each depth, where the minimum depth 8 × 8 also needs to be calculated for N × N, and 35 prediction calculation combinations need to be calculated for each depth. When determining which partition combination mode needs to be adopted, the encoding device needs to traverse all partition combinations to determine the rate distortion cost of each partition mode, and selects the partition mode with the minimum rate distortion cost from the partition modes. The computational complexity of this encoding technique is thus high.

Based on this, the present application provides a method of video encoding for reducing computational complexity.

Fig. 3 schematically shows a flow of a method for video encoding provided by an embodiment of the present application, where the flow may be performed by a video encoding apparatus, which may specifically be the encoding device exemplarily shown in fig. 1, and the encoding device may also be referred to as an encoder.

As shown in fig. 3, the process specifically includes:

in step 301, intra prediction costs and inter prediction costs of a plurality of sub blocks in an encoding unit are obtained.

An encoding unit may be divided into a plurality of sub-blocks, for example, an encoding unit may be divided into four sub-blocks, for example, a 64 × 64 encoding unit may be divided into four 32 × 32 encoding units, or a 32 × 32 encoding unit may be divided into four 16 × 16 encoding units, etc. In this application, the coding unit may be divided into four sub-blocks, which may be respectively represented as sub-block 1, sub-block 2, sub-block 3, and sub-block 4.

For each sub-block in the coding unit, an intra prediction cost and an inter prediction cost of the sub-block may be determined. For example, the intra-frame prediction cost 1 and the inter-frame prediction cost 1 of the sub-block 1, the intra-frame prediction cost 2 and the inter-frame prediction cost 2 of the sub-block 2, the intra-frame prediction cost 3 and the inter-frame prediction cost 3 of the sub-block 3, and the intra-frame prediction cost 4 and the inter-frame prediction cost 4 of the sub-block 4 are respectively determined.

In a possible implementation manner, when inter-frame coding is started, 2 × 2 down-sampling may be performed on a current frame, costs of the current frame as an I frame, a P frame, and a B frame are calculated, and then a frame type corresponding to a minimum cost is selected from the costs of the I frame, the P frame, and the B frame as the frame type of the current frame. In this way, an encoded frame with a frame type of P frame may be obtained, and the encoding unit in the encoded frame is divided into four sub-blocks, where each sub-block corresponds to a respective cost. To further reduce the amount of computation, the intra prediction cost and the inter prediction cost of the sub-blocks in the coding unit may be low complexity SATD (video residual signal size).

Step 302, performing inter-frame prediction on the coding unit according to the intra-frame prediction costs and the inter-frame prediction costs of the plurality of sub-blocks in the coding unit.

In one possible implementation, the sum of intra prediction costs of a plurality of sub-blocks in the coding unit and the sum of inter prediction costs of the plurality of sub-blocks in the coding unit may be determined. And under the condition that the sum of the intra-frame prediction costs of the plurality of sub-blocks in the coding unit is smaller than the sum of the inter-frame prediction costs of the plurality of sub-blocks in the coding unit, determining that only the SKIP mode needs to be carried out, and not carrying out the calculation of the rest modes of inter-frame prediction, namely directly skipping the calculation of the rest modes such as the Merge mode, the 2Nx2N, the 2NxN, the Nx2N and the like.

For example, the sum of intra prediction costs of a plurality of sub blocks in a coding unit may be represented as: intra-frame prediction cost 1+ intra-frame prediction cost 2+ intra-frame prediction cost 3+ intra-frame prediction cost 4; the sum of inter prediction costs of a plurality of subblocks in a coding unit may be expressed as: inter-frame prediction cost 1+ inter-frame prediction cost 2+ inter-frame prediction cost 3+ inter-frame prediction cost 4; under the condition that the sum of the intra-frame prediction costs is larger than the sum of the inter-frame prediction costs, only the SKIP mode needs to be carried out, and the calculation of other modes of inter-frame prediction is not carried out, namely, the calculation of other modes such as Merge, 2Nx2N, 2NxN, Nx2N and the like is directly skipped.

In the case where the sum of the intra prediction costs of the plurality of sub blocks in the coding unit is greater than or equal to the sum of the inter prediction costs of the plurality of sub blocks in the coding unit, prediction calculations of the SKIP mode, the Merge mode, 2Nx2N, 2NxN, Nx2N, and the like may be performed, respectively.

Furthermore, intra prediction may also be performed on the coding unit, 2N × 2N intra prediction calculation may be performed on the current coding unit, and at the minimum depth of 8 × 8, N × N intra prediction calculation may be increased.

In the present application, in order to further reduce the amount of calculation, the motion estimation process of the sub-block may be skipped when calculating the inter-prediction cost of the sub-block.

For any sub-block in a coding unit (which may be referred to as a first sub-block), motion parameters for the first sub-block may be obtained. And determining whether to skip the motion estimation process of the first sub-block according to the operation parameters of the first sub-block. Specifically, the following two cases can be mentioned:

under the condition that the motion parameters of the first sub-block meet the preset conditions, the process of performing motion estimation on the first sub-block can be skipped, and intra-frame prediction and inter-frame prediction are directly performed on the first block, so that the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block are respectively obtained.

Under the condition that the motion parameter of the first sub-block does not meet the preset condition, performing motion estimation on the first sub-block to obtain a motion vector of the first sub-block; and then, according to the motion vector of the first sub-block, performing intra-frame prediction and inter-frame prediction on the first sub-block to respectively obtain the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block.

It is noted that, before performing motion estimation on a certain sub-block, it is necessary to predict a motion vector of the sub-block (i.e., obtain a predicted motion vector of the sub-block), and perform motion estimation on the sub-block using an offset point obtained by the optimal predicted motion vector as a starting point of the motion estimation. When the motion vector of the sub-block is predicted, the predicted motion vector of the sub-block is obtained by calculation based on the rate distortion cost, so that when the cost of the predicted motion vector of the sub-block is small enough, the predicted motion vector can be regarded as the optimal predicted motion vector, and the optimal predicted motion vector can be used as the final motion vector, so that the motion estimation process of the sub-block is skipped. Furthermore, because adjacent sub-blocks in the video data have extremely strong correlation in a space domain, when the cost of the predicted motion vector of the current sub-block is not small enough, the predicted motion vector of the adjacent sub-block of the current sub-block can be referred to, and the predicted motion vector of the adjacent sub-block of the current sub-block is small enough, so that the predicted motion vector of the current sub-block can be determined as the final motion vector, and therefore, the motion estimation process of the current sub-block can be skipped, and the calculation amount can be reduced.

Based on the above analysis, the motion parameter of the first sub-block may be a predicted motion vector cost of the first sub-block or a predicted motion vector cost of a neighboring sub-block of the first sub-block.

Example 1, when the motion parameter of the first sub-block is the predicted motion vector cost of the first sub-block, it may be determined whether the predicted motion vector cost of the first sub-block is less than a first threshold, and if so, the process of performing motion estimation on the first sub-block may be skipped; otherwise, after performing motion estimation on the first sub-block, intra prediction and inter prediction are performed on the first sub-block.

Example 2, when the motion parameter of the first sub-block is the predicted motion vector cost of the adjacent sub-block of the first sub-block, it may be determined whether the predicted motion vector cost of the adjacent sub-block of the first sub-block is less than a second threshold, and if yes, the process of performing motion estimation on the first sub-block may be skipped; otherwise, after performing motion estimation on the first sub-block, intra prediction and inter prediction are performed on the first sub-block.

In example 2, the adjacent sub-block of the first sub-block may be obtained in advance, and may be, for example, any one of four sub-blocks located at left, upper left, and upper right of the first sub-block. The adjacent sub-blocks of the first sub-block may be the same or different in size from the first sub-block.

For example, as in the partition diagram of the coding unit shown in fig. 4, if the first sub-block is sub-block 1, the adjacent sub-block of sub-block 1 may be any one of sub-blocks 5, 6, 7, and 8, where sub-blocks 5, 6, 7, and 8 are located at the left, upper right, and upper right of sub-block 1, respectively. The size of sub-block 1 is the same as that of sub-blocks 5, 6, 7 and 8.

Further illustratively, as in the partition diagram of the coding unit shown in fig. 5, if the current sub-block is sub-block 1, the adjacent sub-block of sub-block 1 may be any one of sub-blocks 5, 6, 7, and 8, where sub-blocks 5, 6, 7, and 8 are located at the left, upper right, and upper right of sub-block 1, respectively. The size of sub-block 1 is the same as that of sub-blocks 5, 6 and 8, and the size of sub-block 1 is different from that of sub-block 7.

Further, when determining whether the motion parameter of the first sub-block meets the preset condition, the method may specifically include determining whether the predicted motion vector cost of the first sub-block is smaller than a first threshold, and if not, determining whether the predicted motion vector cost of an adjacent sub-block of the first sub-block is smaller than a second threshold. Further, it may be determined whether the predicted motion vector cost of the neighboring sub-block of the first sub-block is less than the second threshold according to an order of the sub-block located at the left of the first sub-block, the sub-block located above the first sub-block, the sub-block located at the upper left of the first sub-block, and the sub-block located at the upper right of the first sub-block. Specifically, refer to fig. 6 for an exemplary flow of determining motion estimation for the first sub-block.

In the present application, the first threshold and the second threshold may be equal or different. In one possible implementation, the first threshold and the second threshold may both be equal to 64.

For better explanation of the embodiments of the present application, fig. 7 is a flowchart of still another video encoding method provided in the present application, where:

step 701, obtaining a motion parameter of the first sub-block. Wherein the first sub-block is any one of the sub-blocks in the coding unit, and the motion parameter of the first sub-block may be a predicted motion vector cost of the first sub-block or a predicted motion vector cost of a neighboring sub-block of the first sub-block.

Step 702, determining whether the motion parameter of the first sub-block meets a preset condition, if so, performing step 704, otherwise, performing step 704 after performing step 703.

Step 703, performing motion estimation on the first sub-block to obtain a motion vector of the first sub-block.

Step 704, performing intra prediction and inter prediction on the first sub-block to obtain intra prediction cost and inter prediction cost of the first sub-block.

Step 705, determining whether the sum of the intra prediction costs of the plurality of sub blocks in the coding unit is smaller than the sum of the inter prediction costs of the plurality of sub blocks in the coding unit, if yes, executing step 706, otherwise executing step 707.

In step 706, after the inter-frame prediction calculation of the SKIP mode is performed on the coding unit, no other inter-frame prediction calculation is performed on the coding unit.

In step 707, all inter prediction calculations are performed on the coding unit.

After the current coding unit performs the completion of the inter prediction calculation (step 706 or step 707), the steps 701 to 707 may be re-performed with the next coding unit of the current coding unit as a new current coding unit until the execution of the last coding unit in the last frame of video data is completed.

In the foregoing technical solution, the inter-frame prediction may include multiple prediction calculations such as SKIP, Merge, 2N × 2N, 2N × N, N × 2N, asymmetric partitioning, and a prediction calculation mode for performing inter-frame prediction on a coding unit may be determined from the multiple prediction calculations according to intra-frame prediction costs and inter-frame prediction costs of multiple sub-blocks in the coding unit. Specifically, in the case where the sum of the intra prediction costs is smaller than the sum of the inter prediction costs, the inter prediction calculation mode of SKIP may be performed only on the coding unit. Therefore, all prediction calculation of the coding unit is not needed, and the calculation complexity of the video coding technology is reduced. Furthermore, if the motion parameter of the first sub-block meets the preset condition, the intra-frame prediction and the inter-frame prediction are directly performed on the first sub-block without performing motion estimation on the first sub-block, thereby further reducing the computational complexity of the video coding technology.

It should be noted that the method for video coding provided by the present application may be applied to various coding techniques, such as h.265, h.266, or other coding techniques, as long as the sum of intra-frame prediction costs is smaller than the sum of inter-frame prediction costs, that is, the SKIP mode may be performed only on the coding unit, and the calculation of the remaining modes is not required. Further, as long as the cost of predicting the motion vector of the sub-block in the coding unit is small enough, the motion estimation may not be performed on the sub-block, and the intra prediction and the inter prediction may be directly performed on the first sub-block. Thereby contributing to a greater saving in computation in the encoding process.

Based on the above and the same concept, fig. 8 and 9 are schematic structural diagrams of a possible video encoding apparatus provided by the present application. These means can be used to implement the functions of the above-described method embodiments and thus also to achieve the advantageous effects of the above-described method embodiments. In this application, the apparatus may be the encoding device as shown in fig. 1, or a module in the encoding device, such as a chip.

The device comprises: an acquisition module 801 and a prediction module 802; an obtaining module 801, configured to obtain intra prediction costs and inter prediction costs of a plurality of sub blocks in an encoding unit; a prediction module 802, configured to stop performing inter-frame prediction calculation on the coding unit after performing inter-frame prediction calculation in the SKIP mode on the coding unit according to intra-frame prediction costs and inter-frame prediction costs of multiple sub-blocks in the coding unit.

In one possible implementation, the prediction module 802 is specifically configured to: if the sum of the intra-frame prediction costs of the sub-blocks in the coding unit is smaller than the sum of the inter-frame prediction costs of the sub-blocks in the coding unit, after the inter-frame prediction calculation of the SKIP mode is completed on the coding unit, no other inter-frame prediction calculation is performed on the coding unit.

In a possible implementation manner, the obtaining module 801 is further configured to, before obtaining the intra prediction cost and the inter prediction cost of the plurality of sub-blocks in the coding unit: obtaining a motion parameter of a first sub-block, wherein the first sub-block is any one of a plurality of sub-blocks in the coding unit; if the motion parameter of the first sub-block meets a preset condition, the prediction module 802 is further configured to perform intra-frame prediction and inter-frame prediction on the first sub-block to obtain an intra-frame prediction cost and an inter-frame prediction cost of the first sub-block, respectively.

In a possible implementation manner, if the motion parameter of the first sub-block does not satisfy the preset condition, the prediction module 802 is further configured to perform motion estimation on the first sub-block to obtain a motion vector of the first sub-block; and according to the motion vector of the first sub-block, performing intra-frame prediction and inter-frame prediction on the first sub-block to respectively obtain the intra-frame prediction cost and the inter-frame prediction cost of the first sub-block.

In one possible implementation, the motion parameter of the first sub-block is a predicted motion vector cost of the first sub-block; the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises: the predicted motion vector cost of the first sub-block is less than a first threshold.

In one possible implementation, the motion parameter of the first sub-block is a predicted motion vector cost of a neighboring sub-block of the first sub-block, the neighboring sub-block of the first sub-block being any one of four sub-blocks located to the left, above-left, and above-right of the first sub-block; the motion parameter of the first sub-block meets a preset condition, and the motion parameter comprises: the predicted motion vector cost of neighboring sub-blocks of the first sub-block is less than a second threshold.

In a possible implementation manner, the prediction cost is a video residual signal size, and the frame type corresponding to the coding unit is a P frame.

As shown in fig. 9, which is a device 900 provided in the embodiment of the present application, the device shown in fig. 9 may be implemented as a hardware circuit of the device shown in fig. 8. The apparatus may be adapted to perform the functions of the above described method embodiments in the previously illustrated flow charts.

For ease of illustration, fig. 9 shows only the main components of the device.

The apparatus 900 shown in fig. 9 includes a communication interface 910, a processor 920, and a memory 930, where the memory 930 is used to store program instructions and/or data. The processor 920 may operate in conjunction with the memory 930. Processor 920 may execute program instructions stored in memory 930. When the instructions or programs stored in the memory 930 are executed, the processor 920 is configured to perform the operations performed by the determining module 601 and the stopping module 602 in the above embodiments.

A memory 930 is coupled to the processor 920. The coupling in the embodiments of the present application is an indirect coupling or a communication connection between devices, units or modules, and may be an electrical, mechanical or other form for information interaction between the devices, units or modules. At least one of the memories 930 may be included in the processor 920.

In embodiments of the present application, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface. In the embodiment of the present application, when the communication interface is a transceiver, the transceiver may include an independent receiver and an independent transmitter; a transceiver that integrates transceiving functions, or a communication interface may also be used.

The apparatus 900 may also include communication lines 940. Wherein the communication interface 910, the processor 920 and the memory 930 may be connected to each other through a communication line 940; the communication line 940 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication lines 940 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.

Based on the above and the same concept, embodiments of the present application further provide a computing device, including:

a memory for storing program instructions;

and the processor is used for calling the program instructions stored in the memory and executing the method in the method embodiment according to the obtained program.

Based on the above and the same idea, the present application provides a computer-readable storage medium having stored therein a computer program or instructions which, when executed by a computing device, cause the computing device to perform the method of the above-described method embodiments.

Based on the above and the same idea, the present application provides a computer program product comprising a computer program or instructions which, when executed by a computing device, implements the method in the above-described method embodiments.

The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.

It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种视频编码的方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类