Prediction unit PU mode selection method and device, electronic device and storage medium
By using SATD cost in HEVC video encoding to perform preliminary screening of PU division methods and determining the target PU mode using rate distortion cost, the calculation complexity problem caused by the complexity of PU layer encoding parameters in HEVC video encoding is solved, and the encoding speed is improved And maintain the coding quality.
Patent Information
- Application Number
- CN202410389551.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-04-01
AI Technical Summary
In HEVC video encoding, the encoding parameters of the prediction unit (PU) layer are highly complex, resulting in high computational complexity and affecting the video encoding speed.
The SATD cost is used to initially select multiple PU partitioning methods, determine the candidate PU mode, and then select the candidate PU mode at the utilization rate distortion cost to determine the target PU mode.
It effectively reduces the computational complexity of PU mode selection, improves video encoding speed, and ensures encoding quality.
Smart Images

Figure CN118301322B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a prediction unit PU mode selection method and device, electronic device and storage medium. Background Art
[0002] High Efficiency Video Coding (HEVC) has become the mainstream of video coding. More and more film and television production, video communication, radio and television broadcasting, etc. are gradually adopting the HEVC video coding standard. Among the current mainstream technologies, rate-distortion optimization technology is the main means to achieve optimal coding performance. However, since the coding parameters of the prediction unit (PU) layer of HEVC include multiple PU partitioning methods, multiple transform units (TU), multiple PU prediction modes, etc., the method of traversing all coding parameters of the PU layer based on rate-distortion optimization to determine the optimal PU mode has a high computational complexity, which affects the video encoding speed. Summary of the invention
[0003] The present disclosure proposes a technical solution of a prediction unit PU mode selection method and device, an electronic device and a storage medium.
[0004] According to one aspect of the present disclosure, a PU mode selection method is provided, comprising: the method is applied to HEVC, the method comprising: for a current CU of HEVC, using SATD cost to select multiple PU partitioning methods, and determining a candidate PU mode corresponding to the current CU, wherein each candidate PU mode includes a corresponding PU partitioning method and a PU prediction mode; utilizing rate-distortion cost to select the candidate PU modes, and determining a target PU mode corresponding to the current CU, wherein the target PU mode includes a corresponding PU partitioning method, TU partitioning method, and PU prediction mode.
[0005] In a possible implementation, for the HEVC current CU, multiple PU partitioning methods are selected using SATD cost to determine a candidate PU mode, including: using SATD cost to select multiple non-2N×2N PU partitioning methods to determine a non-2N×2N candidate PU partitioning method corresponding to the current CU; using SATD cost and bit rate cost to select candidate PU partitioning methods to determine the candidate PU mode, wherein the candidate PU partitioning methods include 2N×2N PU partitioning methods and the non-2N×2N candidate PU partitioning methods.
[0006] In a possible implementation, the SATD cost is used to select multiple non-2N×2N PU partitioning modes to determine a non-2N×2N candidate PU partitioning mode corresponding to the current CU, including: for any non-2N×2NPU partitioning mode, dividing the current CU based on the non-2N×2N PU partitioning mode to obtain multiple PUs under the non-2N×2NPU partitioning mode; based on the multiple PUs under the non-2N×2N PU partitioning mode, determining the SATD cost corresponding to the non-2N×2NPU partitioning mode; based on the SATD cost corresponding to each non-2N×2N PU partitioning mode, determining the non-2N×2N PU partitioning mode with the smallest SATD cost as the non-2N×2N candidate PU partitioning mode.
[0007] In a possible implementation, the determining the SATD cost corresponding to the non-2N×2N PU partitioning method based on multiple PUs under the non-2N×2N PU partitioning method includes: for any PU under the non-2N×2N PU partitioning method, determining the predicted pixel block corresponding to the PU based on a motion estimation method; determining the SATD cost corresponding to the PU based on a residual pixel block between an original pixel block and a predicted pixel block corresponding to the PU; and summing the SATD costs corresponding to each PU under the non-2N×2N PU partitioning method to determine the SATD cost corresponding to the non-2N×2N PU partitioning method.
[0008] In a possible implementation, the use of SATD cost and bit rate cost to select a candidate PU partitioning method and determine the candidate PU mode includes: dividing the current CU based on the candidate PU partitioning method to obtain at least one PU under the candidate PU partitioning method; setting different PU prediction modes for each PU under the candidate PU partitioning method to obtain multiple PU modes corresponding to the candidate PU partitioning method, wherein different PU prediction modes include: inter-frame PU prediction mode and intra-frame PU prediction mode; for any PU mode, based on the PU prediction mode corresponding to each PU under the PU mode, using SATD cost and bit rate cost, determine the sum of the costs corresponding to the PU mode; and determine the candidate PU mode according to the sum of the costs corresponding to each PU mode.
[0009] In a possible implementation, for any PU mode, based on the PU prediction mode corresponding to each PU in the PU mode, the SATD cost and the bit rate cost are used to determine the sum of the costs corresponding to the PU mode, including: for any PU in the PU mode, based on the PU prediction mode corresponding to the PU, determining the motion vector and predicted pixel block corresponding to the PU; based on the residual pixel block between the original pixel block and the predicted pixel block corresponding to the PU, determining the SATD cost corresponding to the PU; based on the motion vector and the residual pixel block corresponding to the PU, determining the bit rate cost corresponding to the PU; summing the SATD cost and bit rate cost corresponding to each PU in the PU mode to determine the sum of the costs corresponding to the PU mode.
[0010] In a possible implementation, the inter-PU prediction mode includes: AMVP mode and Merge mode; the intra-PU prediction mode includes: a first candidate intra-PU prediction mode and a second candidate intra-PU prediction mode; the setting of different PU prediction modes for each PU under the candidate PU partitioning method to obtain multiple PU modes corresponding to the candidate PU partitioning method includes: when the candidate PU partitioning method is the 2N×2N PU partitioning method, setting the AMVP mode and the Merge mode for a PU under the 2N×2N PU partitioning method to obtain two first PU modes corresponding to the 2N×2N PU partitioning method; when the candidate PU partitioning method is the 2N×2N PU partitioning method, setting the first candidate intra-PU prediction mode and the second candidate intra-PU prediction mode for a PU under the 2N×2N PU partitioning method to obtain the 2N×2N two second PU modes corresponding to the PU partitioning method; when the candidate PU partitioning method is the non-2N×2N candidate PU partitioning method, setting the AMVP mode and the Merge mode for each PU under the non-2N×2N candidate PU partitioning method, to obtain at least four third PU modes corresponding to the non-2N×2N candidate PU partitioning method.
[0011] In a possible implementation, determining the candidate PU mode according to the sum of costs corresponding to each PU mode includes: selecting the PU mode with the smallest sum of costs among the at least four third PU modes as the first selected PU mode; selecting the PU mode with the smallest sum of costs among the two first PU modes and the first selected PU mode as one of the candidate PU modes, and selecting the PU mode with the second smallest sum of costs as the second selected PU mode; selecting the PU mode with the smallest sum of costs among the two second PU modes as the third selected PU mode; and selecting the PU mode with the smallest sum of costs among the second selected PU mode and the third selected PU mode as one of the candidate PU modes.
[0012] In a possible implementation, the utilization rate-distortion cost is used to select the candidate PU mode to determine a target PU mode corresponding to the current CU, including: determining the rate-distortion cost corresponding to each candidate PU mode under different TU partitioning methods based on the PU partitioning method and PU prediction mode corresponding to each candidate PU mode; and determining the target PU mode according to the candidate PU mode with the smallest rate-distortion cost and the corresponding TU partitioning method.
[0013] According to one aspect of the present disclosure, a PU mode selection device is provided, which is applied to HEVC, and the device includes: a first selection module, which is used to select multiple PU partitioning methods for the HEVC current CU using SATD cost, and determine a candidate PU mode corresponding to the current CU, wherein each candidate PU mode includes a corresponding PU partitioning method and a PU prediction mode; a second selection module, which is used to select the candidate PU mode using rate-distortion cost, and determine a target PU mode corresponding to the current CU, wherein the target PU mode includes a corresponding PU partitioning method, TU partitioning method, and PU prediction mode.
[0014] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0015] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
[0016] In the disclosed embodiment, for the current CU of HEVC, SATD cost is used to select multiple PU partitioning methods to determine the candidate PU mode corresponding to the current CU, each candidate PU mode includes a corresponding PU partitioning method and a PU prediction mode. Compared with the method of performing rate-distortion cost calculation with higher computational complexity for each PU partitioning method, preliminary selection is performed through SATD cost with lower computational complexity, and candidate PU modes can be quickly screened out based on multiple PU partitioning methods, so that only rate-distortion cost calculation needs to be performed on the candidate PU modes to quickly determine a target PU mode that the current CU finally corresponds to. The target PU mode includes the corresponding PU partitioning method, TU partitioning method, and PU prediction mode. Since the rate-distortion cost is still used to calculate the target PU mode in the end, it can be ensured that the encoding quality is not affected while effectively reducing the computational complexity.
[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0019] Figure 1 A flowchart of a PU mode selection method according to an embodiment of the present disclosure is shown.
[0020] Figure 2 A block diagram of a PU mode selection device according to an embodiment of the present disclosure is shown.
[0021] Figure 3 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0022] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0023] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0024] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0025] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0026] HEVC adopts a hybrid coding framework, uses intra-frame prediction and inter-frame prediction to eliminate the temporal and spatial redundancy of video frames, uses discrete cosine transform and quantization technology to eliminate the frequency domain redundancy of residual pixels, and compresses syntax elements through arithmetic coding. The main purpose of video coding is to minimize the coding bit rate while ensuring a certain video quality, or to minimize coding distortion under the condition of mobile coding bit rate constraints. Under a fixed coding framework, in order to cope with different video contents, there are often multiple candidate coding methods. One of the main tasks of the encoder is to select the optimal coding parameters with a certain strategy to achieve the best coding performance.
[0027] Among the current mainstream technologies, the coding parameter optimization method based on rate-distortion theory, namely rate-distortion optimization technology, is the main means to achieve optimal coding performance. The rate-distortion optimization methods in HEVC encoders include rate-distortion optimization of video image groups, rate-distortion optimization of slice layers, rate-distortion optimization of coding tree units (CTU) layers, rate-distortion optimization of coding units (CU) layers, rate-distortion optimization of PU layers, etc.
[0028] In HEVC, the rate-distortion optimization of the PU layer is performed by traversing all coding parameters. By calculating the rate-distortion costs of all PU modes, the PU mode with the smallest rate-distortion cost is selected as the optimal PU mode. PU modes include: PU partitioning mode and PU prediction mode. Inter-frame PU partitioning modes include: 2N×2N, N×N, 2N×N, N×2N, 2N×nU, 2N×nD, nL×2N, nR×2N, and intra-frame PU partitioning modes include: 2N×2N, N×N. Among them, the inter-frame PU prediction modes that can be used by each PU in the PU partitioning mode include: Advanced Motion Vector Prediction (AMVP) mode and Merge mode, and the intra-frame PU prediction modes that can be used include: 35 intra-frame PU prediction modes, all of which require calculation of rate-distortion costs to select. When calculating the rate-distortion cost of each PU mode, it is necessary to try different TU partitioning methods and select the TU partitioning with the smallest rate-distortion cost. Therefore, the optimal PU mode includes the optimal PU partitioning method, the optimal TU partitioning method, and the optimal PU prediction mode.
[0029] The method of determining the optimal PU mode of CU based on rate-distortion optimization requires traversing each PU mode for rate-distortion optimization and selecting the PU mode with the smallest rate-distortion cost as the optimal PU mode of CU. Since the calculation of rate-distortion cost requires a series of calculations such as transformation, quantization, inverse quantization, inverse transformation, and bit rate estimation, this method based on rate-distortion optimization traversal seriously affects the encoding speed, introduces excessive power consumption in hardware video encoding, and is not suitable for low-latency encoding and high frame rate encoding application scenarios.
[0030] In order to solve the above technical problems, the embodiment of the present disclosure provides a PU mode selection method, which can effectively reduce the computational complexity of selecting the optimal PU mode for the current CU, thereby improving the encoding speed of the current CU. The PU mode selection method provided by the embodiment of the present disclosure is described in detail below.
[0031] Figure 1 A flowchart of a PU mode selection method according to an embodiment of the present disclosure is shown. The method is applied to HEVC, and the method can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable instruction stored in a memory. Alternatively, the method can be executed by a server. Figure 1 As shown, the method includes:
[0032] In step S11, for the HEVC current CU, multiple PU partitioning methods are selected using the Sum of Absolute Transformed Differences (SATD) cost to determine the candidate PU mode corresponding to the current CU, where each candidate PU mode includes a corresponding PU partitioning method and a PU prediction mode.
[0033] The multiple PU division methods here include: N×N, 2N×N, N×2N, 2N×nU, 2N×nD, nL×2N, nR×2N, and 2N×2N.
[0034] SATD cost is a cost function used to measure the quality of an image or signal. In video coding and image processing, SATD cost is usually used to evaluate the size of the prediction error in the frequency domain. The cost is obtained by calculating the sum of the absolute differences between the original signal and the predicted signal. In video coding and image processing, SATD cost is widely used to measure the quality of an image or signal. Compared with the rate-distortion cost, the computational complexity of SATD cost is lower.
[0035] By performing preliminary selection using the SATD cost with low computational complexity, a candidate PU mode with the lowest cost can be quickly screened out from multiple PU partitioning modes, each candidate PU mode including a corresponding PU partitioning mode and a PU prediction mode.
[0036] The number of candidate PU modes is greater than or equal to two and less than the total number of all PU modes supported by the current CU. The fewer the number of candidate PU modes, the lower the complexity of the subsequent rate-distortion cost calculation; however, the more the number of candidate PU modes, the higher the accuracy of the target PU mode determined after the subsequent rate-distortion cost calculation. In actual application scenarios, the number of candidate PU modes is flexibly set by comprehensively considering the computational complexity and accuracy requirements, and the present disclosure does not make specific limitations on this.
[0037] The specific process of selecting multiple PU partitioning methods using SATD cost and determining the candidate PU mode corresponding to the current CU will be described in detail later in combination with possible implementation methods of the present disclosure, which will not be repeated here.
[0038] In step S12, the candidate PU modes are selected using the rate-distortion cost to determine a target PU mode corresponding to the current CU, wherein the target PU mode includes a corresponding PU partitioning method, a TU partitioning method, and a PU prediction mode.
[0039] Since the aforementioned preliminary screening has quickly screened out a small number of candidate PU modes based on multiple PU partitioning methods, at this time, further screening can be performed based on the rate-distortion cost with higher computational complexity, so as to select the best target PU mode for the current CU, so that the current CU can be encoded based on the target PU mode subsequently.
[0040] The specific process of selecting candidate PU modes based on utilization distortion cost and determining a target PU mode corresponding to the current CU will be described in detail later in combination with possible implementation methods of the present disclosure, which will not be repeated here.
[0041] In the disclosed embodiment, for the current CU of HEVC, SATD cost is used to select multiple PU partitioning methods to determine the candidate PU mode corresponding to the current CU, each candidate PU mode includes a corresponding PU partitioning method and a PU prediction mode. Compared with the method of performing rate-distortion cost calculation with higher computational complexity for each PU partitioning method, preliminary selection is performed through SATD cost with lower computational complexity, and candidate PU modes can be quickly screened out based on multiple PU partitioning methods, so that only rate-distortion cost calculation needs to be performed on the candidate PU modes to quickly determine a target PU mode that the current CU finally corresponds to. The target PU mode includes the corresponding PU partitioning method, TU partitioning method, and PU prediction mode. Since the rate-distortion cost is still used to calculate the target PU mode in the end, it can be ensured that the encoding quality is not affected while effectively reducing the computational complexity.
[0042] In a possible implementation, for the HEVC current CU, multiple PU partitioning methods are selected using SATD cost to determine a candidate PU mode, including: using SATD cost to select multiple non-2N×2N PU partitioning methods to determine a non-2N×2N candidate PU partitioning method corresponding to the current CU; using SATD cost and bit rate cost to select candidate PU partitioning methods to determine the candidate PU mode, wherein the candidate PU partitioning methods include 2N×2N PU partitioning methods and non-2N×2N candidate PU partitioning methods.
[0043] The multiple non-2N×2N PU partitioning methods here include: N×N, 2N×N, N×2N, 2N×nU, 2N×nD, nL×2N, and nR×2N.
[0044] A preliminary selection is performed using a SATD cost with low computational complexity, and a non-2N×2N PU partitioning method with the lowest cost is quickly screened out from multiple non-2N×2N PU partitioning methods as the selected non-2N×2N candidate PU partitioning method.
[0045] Bitrate cost refers to the cost paid to reduce the compression rate of image data in video encoding. Bitrate is an indicator of data compression efficiency. The lower the bitrate, the higher the compression rate and the greater the loss of image quality. Compared with rate-distortion cost, the computational complexity of bitrate cost is lower.
[0046] Further selection is performed using SATD cost and bit rate cost with lower computational complexity, so as to quickly screen out the PU prediction mode with the lowest cost for the 2N×2N PU partitioning mode and / or the non-2N×2N candidate PU partitioning mode, and obtain the candidate PU mode.
[0047] In one example, the process of selecting a non-2N×2N candidate PU partitioning method corresponding to the current CU by using SATD cost can be used as the first stage mode selection, the process of selecting the candidate PU partitioning method by using SATD cost and bit rate cost to determine the candidate PU mode can be used as the second stage mode selection, and the process of selecting the candidate PU mode by using rate distortion cost to determine a target PU mode corresponding to the current CU can be used as the third stage mode selection. Each stage mode selection uses an independent software program or hardware module to perform the selection operation.
[0048] Hardware pipelining is a technology that divides the computer instruction process into multiple steps and executes them in parallel on multiple hardware processing units to speed up the execution of instructions. It can split an instruction into multiple steps and then execute these steps simultaneously on different hardware processing units, thereby realizing parallel processing of instructions. In the hardware pipeline, each processing unit only completes a specific task. These processing units can work in parallel so that new instructions are processed in each clock cycle. This method can greatly improve the execution speed and efficiency of the computer.
[0049] Since each of the above-mentioned stage mode selections uses an independent software program or hardware module to perform the selection operation, the above-mentioned stage mode selection method is conducive to the implementation of the hardware pipeline. For example, after the current CU completes the first stage mode, the current CU can enter the second stage mode selection. At this time, the next CU can start the first stage mode selection without waiting for the current CU to complete the third stage mode selection to determine the final target PU mode before the next CU starts, thereby effectively improving the efficiency of each CU in determining the target PU mode, thereby improving the coding efficiency.
[0050] In a possible implementation, multiple non-2N×2N PU partitioning modes are selected using SATD costs to determine a non-2N×2N candidate PU partitioning mode corresponding to a current CU, including: for any non-2N×2N PU partitioning mode, dividing the current CU based on the non-2N×2N PU partitioning mode to obtain multiple PUs under the non-2N×2N PU partitioning mode; based on the multiple PUs under the non-2N×2N PU partitioning mode, determining the SATD cost corresponding to the non-2N×2N PU partitioning mode; based on the SATD cost corresponding to each non-2N×2N PU partitioning mode, determining the non-2N×2N PU partitioning mode with the smallest SATD cost as the non-2N×2N candidate PU partitioning mode.
[0051] When the first-stage mode selection is performed using the SATD cost, the SATD cost corresponding to each non-2N×2N PU partitioning method is determined. The smaller the SATD cost, the smaller the prediction error. Therefore, the non-2N×2N PU partitioning method with the smallest SATD cost is determined as the non-2N×2N candidate PU partitioning method selected for the first-stage mode selection.
[0052] In a possible implementation, based on multiple PUs in a non-2N×2N PU partitioning method, the SATD cost corresponding to the non-2N×2N PU partitioning method is determined, including: for any PU in the non-2N×2N PU partitioning method, based on a motion estimation method, determining a predicted pixel block corresponding to the PU; based on a residual pixel block between an original pixel block and a predicted pixel block corresponding to the PU, determining the SATD cost corresponding to the PU; and summing the SATD costs corresponding to each PU in the non-2N×2N PU partitioning method to determine the SATD cost corresponding to the non-2N×2N PU partitioning method.
[0053] In the first stage mode selection, the PU prediction mode can be ignored. Instead, the prediction pixel block corresponding to each PU is determined based on the motion estimation method, and then the SATD cost of each PU is determined to reduce the computational complexity of the first stage mode selection.
[0054] For any non-2N×2N PU partitioning mode, the current CU is partitioned based on the non-2N×2N PU partitioning mode to obtain multiple PUs under the non-2N×2N PU partitioning mode. For example, the current CU is partitioned according to other non-2N×2N PU partitioning modes other than the N×N PU partitioning mode to obtain 2 PUs; the current CU is partitioned according to the N×N PU partitioning mode to obtain 4 PUs.
[0055] For any PU, the predicted pixel block corresponding to the PU is determined based on the motion estimation method; the original pixel block corresponding to the PU is subtracted from the predicted pixel block to obtain the residual pixel block corresponding to the PU; the SATD cost is calculated for the residual pixel block corresponding to the PU to obtain the SATD cost corresponding to the PU. The SATD cost calculation process can refer to the relevant technology, and the present disclosure does not make specific limitations on this.
[0056] For any non-2N×2N PU partitioning mode, the sum of the SATD costs corresponding to each PU in the non-2N×2N PU partitioning mode is used as the SATD cost corresponding to the non-2N×2N PU partitioning mode.
[0057] After the non-2N×2N PU partitioning mode with the minimum SATD cost is determined as the non-2N×2N candidate PU partitioning mode selected in the first stage mode selection, the second stage mode selection may be performed on the current CU.
[0058] In a possible implementation, a candidate PU partitioning method is selected using SATD cost and bit rate cost to determine a candidate PU mode, including: dividing the current CU based on the candidate PU partitioning method to obtain at least one PU under the candidate PU partitioning method; setting a different PU prediction mode for each PU under the candidate PU partitioning method to obtain multiple PU modes corresponding to the candidate PU partitioning method, wherein the different PU prediction modes include: inter-frame PU prediction mode and intra-frame PU prediction mode; for any PU mode, based on the PU prediction mode corresponding to each PU under the PU mode, using SATD cost and bit rate cost, determine the sum of the costs corresponding to the PU mode; and determine the candidate PU mode according to the sum of the costs corresponding to each PU mode.
[0059] When executing the second stage mode using SATD cost and bit rate cost, both intra PU prediction mode and intra PU prediction mode are considered, so that different video coding scenario requirements such as inter coding and intra coding can be taken into account, and the optimal candidate PU mode is determined for the current CU.
[0060] In a possible implementation, the inter-PU prediction mode includes: AMVP mode and Merge mode; the intra-PU prediction mode includes: a first candidate intra-PU prediction mode and a second candidate intra-PU prediction mode; different PU prediction modes are set for each PU under the candidate PU partitioning mode, and multiple PU modes corresponding to the candidate PU partitioning mode are obtained, including: when the candidate PU partitioning mode is a 2N×2N PU partitioning mode, the AMVP mode and the Merge mode are respectively set for a PU under the 2N×2N PU partitioning mode, and two first PU modes corresponding to the 2N×2N PU partitioning mode are obtained; when the candidate PU partitioning mode is a 2N×2N PU partitioning mode, the first candidate intra-PU prediction mode and the second candidate intra-PU prediction mode are respectively set for a PU under the 2N×2N PU partitioning mode, and a 2N×2N Two second PU modes corresponding to the PU partitioning method; when the candidate PU partitioning method is a non-2N×2N candidate PU partitioning method, AMVP mode and Merge mode are set for each PU under the non-2N×2N candidate PU partitioning method to obtain at least four third PU modes corresponding to the non-2N×2N candidate PU partitioning method.
[0061] Here, the first candidate intra-frame PU prediction mode and the second candidate intra-frame PU prediction mode may be two selected from 35 intra-frame PU prediction modes according to preset requirements, and the specific selection process is not limited in the present disclosure.
[0062] Comprehensively consider the inter-frame PU prediction modes: AMVP mode, Merge mode, and the intra-frame PU prediction modes: the first candidate intra-frame PU prediction mode, the second candidate intra-frame PU prediction mode, so that each PU under different candidate PU partitioning methods sets a different PU prediction mode, and multiple PU modes can be obtained. The PU mode includes the corresponding PU partitioning method and PU prediction mode.
[0063] When the candidate PU partitioning mode is 2N×2N PU partitioning mode, the current CU corresponds to only one PU, and the optional PU prediction modes of the PU include: AMVP mode and Merge mode. At this time, two first PU modes are obtained. First PU mode A: 2N×2N PU partitioning mode, AMVP mode; first PU mode B: 2N×2N PU partitioning mode, Merge mode.
[0064] When the candidate PU partitioning mode is 2N×2N PU partitioning mode, the current CU corresponds to only one PU, and the optional PU prediction modes of the PU include: the first candidate intra PU prediction mode and the second candidate intra PU prediction mode. At this time, two second PU modes are obtained. Second PU mode C: 2N×2N PU partitioning mode, first candidate intra PU prediction mode; second PU mode D: 2N×2N PU partitioning mode, second candidate intra PU prediction mode.
[0065] When the candidate PU partitioning mode is a non-2N×2N candidate PU partitioning mode and other non-2N×2N PU partitioning modes other than the non-N×N PU partitioning mode, the current CU is divided into 2 PUs, and the optional PU prediction modes of each PU include: AMVP mode and Merge mode. At this time, four (2 2 ) The third PU mode. For example, the candidate PU partitioning method is 2N×N, and the current CU is divided into two PUs: PU1 and PU2, then the third PU mode E can be obtained: 2N×N PU partitioning method, PU1 corresponds to AMVP mode, PU2 corresponds to AMVP mode; the third PU mode F: 2N×N PU partitioning method, PU1 corresponds to Merge mode, PU2 corresponds to Merge mode; the third PU mode G: 2N×N PU partitioning method, PU1 corresponds to AMVP mode, PU2 corresponds to Merge mode; the third PU mode H: 2N×N PU partitioning method, PU1 corresponds to Merge mode, PU2 corresponds to AMVP mode. Other non-2N×2N PU partitioning methods other than non-N×N PU partitioning methods are similar and will not be described here.
[0066] When the candidate PU partitioning mode is not a 2N×2N candidate PU partitioning mode, but an N×N PU partitioning mode, the current CU is divided into 4 PUs, and the optional PU prediction modes of each PU include: AMVP mode and Merge mode. At this time, sixteen (2 4 ) The third PU mode. The specific forms of the sixteen third PU modes can refer to the above expressions and will not be described in detail here.
[0067] In a possible implementation, for any PU mode, based on the PU prediction mode corresponding to each PU in the PU mode, the sum of the costs corresponding to the PU mode is determined using SATD cost and bit rate cost, including: for any PU in the PU mode, based on the PU prediction mode corresponding to the PU, determining the motion vector and predicted pixel block corresponding to the PU; based on the residual pixel block between the original pixel block and the predicted pixel block corresponding to the PU, determining the SATD cost corresponding to the PU; based on the motion vector and the residual pixel block corresponding to the PU, determining the bit rate cost corresponding to the PU; and summing the SATD cost and bit rate cost corresponding to each PU in the PU mode to determine the sum of the costs corresponding to the PU mode.
[0068] For any PU mode, prediction is performed based on the PU prediction mode corresponding to each PU in the PU mode, and the motion vector (MV) and predicted pixel block corresponding to the PU can be determined. The process of prediction based on the PU prediction mode can refer to the relevant technology, and the present disclosure does not make specific limitations on this.
[0069] For any PU, the original pixel block and the predicted pixel block corresponding to the PU are subtracted to obtain the residual pixel block corresponding to the PU; the SATD cost is calculated on the residual pixel block corresponding to the PU to obtain the SATD cost corresponding to the PU.
[0070] For any PU, the PU is encoded based on the motion vector and residual pixel block corresponding to the PU, and the bit rate cost corresponding to the PU is determined based on the encoded data. The specific algorithm for calculating the bit rate cost can refer to the relevant technology, and this disclosure does not make specific limitations on this.
[0071] For any PU mode, the SATD cost and the bit rate cost corresponding to each PU in the PU mode are summed to obtain the sum of the costs corresponding to the PU mode. Further, a candidate PU mode can be selected from multiple PU modes according to the sum of the costs corresponding to each PU mode.
[0072] The selection process when the number of candidate PU modes is two is described in detail below.
[0073] In a possible implementation, a candidate PU mode is determined according to the sum of the costs corresponding to each PU mode, including: among at least four third PU modes, the PU mode with the smallest sum of costs is selected as the first selected PU mode; among the two first PU modes and the first selected PU mode, the PU mode with the smallest sum of costs is selected as a candidate PU mode, and the PU mode with the second smallest sum of costs is selected as the second selected PU mode; among the two second PU modes, the PU mode with the smallest sum of costs is selected as the third selected PU mode; and among the second selected PU mode and the third selected PU mode, the PU mode with the smallest sum of costs is selected as a candidate PU mode.
[0074] Based on the above selection strategy, both inter-frame PU prediction and intra-frame PU prediction can be taken into consideration, and the best two candidate PU modes can be selected from multiple PU modes.
[0075] In addition to adopting the above selection strategy to select the best two candidate PU modes from multiple PU modes, other selection strategies may also be adopted for selection, and the present disclosure does not make specific limitations on this.
[0076] When the number of candidate PU modes is other than two, a corresponding selection strategy may be used for selection, as long as the number of candidate PU modes finally determined is less than the total number of all PU modes supported by the current CU. The present disclosure does not limit the specific selection strategy.
[0077] In a possible implementation, the candidate PU mode is selected using the rate-distortion cost to determine a target PU mode corresponding to the current CU, including: determining the rate-distortion cost corresponding to each candidate PU mode under different TU partitioning modes based on the PU partitioning mode and PU prediction mode corresponding to each candidate PU mode; and determining the target PU mode based on the candidate PU mode with the smallest rate-distortion cost and the corresponding TU partitioning mode.
[0078] For the candidate PU modes determined by the first stage mode selection and the second stage mode selection, in order to ensure that the encoding quality does not decrease, in the third extreme mode selection, based on the PU partitioning mode and PU prediction mode corresponding to each candidate PU mode, the rate-distortion cost corresponding to each candidate PU mode under different TU partitioning modes is determined, thereby effectively determining the optimal target PU mode for the current PU, including the corresponding PU partitioning mode, TU partitioning mode, and PU prediction mode. The calculation process of the rate-distortion cost can refer to the relevant technology, and the present disclosure does not make specific limitations on this.
[0079] In the disclosed embodiment, for the current CU of HEVC, SATD cost is used to select multiple PU partitioning methods to determine the candidate PU mode corresponding to the current CU, each candidate PU mode includes a corresponding PU partitioning method and a PU prediction mode. Compared with the method of performing rate-distortion cost calculation with higher computational complexity for each PU partitioning method, preliminary selection is performed through SATD cost with lower computational complexity, and candidate PU modes can be quickly screened out based on multiple PU partitioning methods, so that only rate-distortion cost calculation needs to be performed on the candidate PU modes to quickly determine a target PU mode that the current CU finally corresponds to. The target PU mode includes the corresponding PU partitioning method, TU partitioning method, and PU prediction mode. Since the rate-distortion cost is still used to calculate the target PU mode in the end, it can be ensured that the encoding quality is not affected while effectively reducing the computational complexity.
[0080] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0081] In addition, the present disclosure also provides a PU mode selection device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any PU mode selection method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0082] Figure 2 A block diagram of a PU mode selection device according to an embodiment of the present disclosure is shown. Figure 2 As shown, the device 20 includes:
[0083] The first selection module 21 is used to select multiple PU partitioning modes for the current HEVC CU using the SATD cost to determine a candidate PU mode corresponding to the current CU, wherein each candidate PU mode includes a corresponding PU partitioning mode and a PU prediction mode;
[0084] The second selection module 22 is used to select candidate PU modes based on rate-distortion cost, and determine a target PU mode corresponding to the current CU, wherein the target PU mode includes a corresponding PU partitioning mode, TU partitioning mode, and PU prediction mode.
[0085] In a possible implementation, the first selection module 21 includes:
[0086] A first selection submodule is used to select multiple non-2N×2N PU partitioning modes by using SATD cost, and determine a non-2N×2N candidate PU partitioning mode corresponding to the current CU;
[0087] The second selection submodule is used to select the candidate PU partitioning mode by using the SATD cost and the code rate cost to determine the candidate PU mode, wherein the candidate PU partitioning mode includes a 2N×2N PU partitioning mode and a non-2N×2N candidate PU partitioning mode.
[0088] In a possible implementation, the first selection submodule includes:
[0089] A first partitioning unit is configured to partition a current CU based on any non-2N×2N PU partitioning mode to obtain a plurality of PUs in the non-2N×2N PU partitioning mode;
[0090] A first cost determination unit, configured to determine a SATD cost corresponding to the non-2N×2N PU partitioning mode based on a plurality of PUs in the non-2N×2N PU partitioning mode;
[0091] The first selection unit is configured to determine, based on the SATD cost corresponding to each non-2N×2N PU partitioning mode, a non-2N×2N PU partitioning mode with the minimum SATD cost as a non-2N×2N candidate PU partitioning mode.
[0092] In a possible implementation manner, the first cost determination unit is specifically configured to:
[0093] For any PU in the non-2N×2N PU partitioning mode, determine a prediction pixel block corresponding to the PU based on a motion estimation mode;
[0094] Determine the SATD cost corresponding to the PU based on the residual pixel block between the original pixel block and the predicted pixel block corresponding to the PU;
[0095] The SATD cost corresponding to each PU in the non-2N×2N PU partitioning mode is summed to determine the SATD cost corresponding to the non-2N×2N PU partitioning mode.
[0096] In a possible implementation, the second selection submodule includes:
[0097] A second partitioning unit, configured to partition the current CU based on the candidate PU partitioning mode to obtain at least one PU under the candidate PU partitioning mode;
[0098] A first determining unit is used to set a different PU prediction mode for each PU under the candidate PU partitioning mode, and obtain a plurality of PU modes corresponding to the candidate PU partitioning mode, wherein the different PU prediction modes include: an inter-frame PU prediction mode and an intra-frame PU prediction mode;
[0099] A second cost determination unit is used to determine, for any PU mode, based on a PU prediction mode corresponding to each PU in the PU mode, using a SATD cost and a bit rate cost to determine a sum of costs corresponding to the PU mode;
[0100] The second determining unit is configured to determine a candidate PU mode according to the sum of the costs corresponding to each PU mode.
[0101] In a possible implementation manner, the second cost determination unit is specifically configured to:
[0102] For any PU in the PU mode, determine a motion vector and a predicted pixel block corresponding to the PU based on the PU prediction mode corresponding to the PU;
[0103] Determine the SATD cost corresponding to the PU based on the residual pixel block between the original pixel block and the predicted pixel block corresponding to the PU;
[0104] Determine a bit rate cost corresponding to the PU based on a motion vector and a residual pixel block corresponding to the PU;
[0105] The SATD cost and the bit rate cost corresponding to each PU in the PU mode are summed to determine the sum of the costs corresponding to the PU mode.
[0106] In a possible implementation, the inter-frame PU prediction mode includes: AMVP mode and Merge mode; the intra-frame PU prediction mode includes: a first candidate intra-frame PU prediction mode and a second candidate intra-frame PU prediction mode;
[0107] The first determining unit is specifically used for:
[0108] When the candidate PU partitioning mode is a 2N×2N PU partitioning mode, an AMVP mode and a Merge mode are respectively set for a PU in the 2N×2N PU partitioning mode, so as to obtain two first PU modes corresponding to the 2N×2N PU partitioning mode;
[0109] When the candidate PU partitioning mode is a 2N×2N PU partitioning mode, a first candidate intra PU prediction mode and a second candidate intra PU prediction mode are respectively set for a PU in the 2N×2N PU partitioning mode, so as to obtain two second PU modes corresponding to the 2N×2N PU partitioning mode;
[0110] When the candidate PU partitioning mode is a non-2N×2N candidate PU partitioning mode, an AMVP mode and a Merge mode are respectively set for each PU in the non-2N×2N candidate PU partitioning mode to obtain at least four third PU modes corresponding to the non-2N×2N candidate PU partitioning mode.
[0111] In a possible implementation manner, the second determining unit is specifically configured to:
[0112] Among the at least four third PU modes, a PU mode having the smallest sum of selection costs is determined as a first selected PU mode;
[0113] Among the two first PU modes and the first selected PU mode, the PU mode with the smallest sum of selection costs is determined as a candidate PU mode, and the PU mode with the second smallest sum of selection costs is determined as a second selected PU mode;
[0114] Among the two second PU modes, the PU mode with the smallest sum of selection costs is determined as the third selected PU mode;
[0115] Among the second selected PU mode and the third selected PU mode, the PU mode with the smallest sum of costs is selected and determined as a candidate PU mode.
[0116] In a possible implementation, the second selection module 22 is specifically configured to:
[0117] Based on the PU partitioning mode and the PU prediction mode corresponding to each candidate PU mode, determine the rate-distortion cost corresponding to each candidate PU mode under different TU partitioning modes;
[0118] The target PU mode is determined according to the candidate PU mode with the minimum rate-distortion cost and the corresponding TU partitioning method.
[0119] This method has a specific technical connection with the internal structure of the computer system, and can solve the technical problem of how to improve the hardware computing efficiency or execution effect (including reducing the amount of data storage, reducing the amount of data transmission, increasing the hardware processing speed, etc.), thereby obtaining the technical effect of improving the internal performance of the computer system in accordance with the laws of nature.
[0120] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0121] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.
[0122] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0123] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.
[0124] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0125] Figure 3 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 3 , the electronic device 1900 can be provided as a server or a terminal device. Figure 3 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0126] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003). TM ), a graphical user interface operating system launched by Apple (Mac OS X TM ), a multi-user, multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.
[0127] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0128] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0129] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0130] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0131] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0132] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0133] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0134] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0135] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0136] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0137] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0138] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0139] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0140] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A prediction unit PU mode selection method, characterized in that: The method is applied to high efficiency video coding (HEVC), and the method comprises: For a current HEVC coding unit CU, multiple PU partitioning modes are selected using the sum of absolute transform differences SATD cost to determine a candidate PU mode corresponding to the current CU, wherein the candidate PU mode includes a corresponding PU partitioning mode and a PU prediction mode; Selecting the candidate PU mode by utilizing the rate-distortion cost, and determining a target PU mode corresponding to the current CU, wherein the target PU mode includes a corresponding PU partitioning mode, a transform unit TU partitioning mode, and a PU prediction mode; The method of selecting multiple PU partitioning modes for the current HEVC CU using the SATD cost to determine the candidate PU mode includes: Selecting multiple non-2N×2N PU partitioning modes by using SATD cost, and determining a non-2N×2N candidate PU partitioning mode corresponding to the current CU, wherein the multiple non-2N×2N PU partitioning modes include: N×N, 2N×N, N×2N, 2N×nU, 2N×nD, nL×2N, and nR×2N; The candidate PU partitioning mode is selected by using the SATD cost and the coding rate cost to determine the candidate PU mode, wherein the candidate PU partitioning mode includes a 2N×2N PU partitioning mode and the non-2N×2N candidate PU partitioning mode.
2. The method according to claim 1, characterized in that The method of selecting a plurality of non-2N×2N PU partitioning modes by using the SATD cost to determine a non-2N×2N candidate PU partitioning mode corresponding to the current CU includes: For any non-2N×2N PU partitioning mode, the current CU is partitioned based on the non-2N×2N PU partitioning mode to obtain multiple PUs in the non-2N×2N PU partitioning mode; Determine, based on multiple PUs in the non-2N×2N PU partitioning mode, a SATD cost corresponding to the non-2N×2N PU partitioning mode; Based on the SATD cost corresponding to each non-2N×2N PU partitioning mode, a non-2N×2N PU partitioning mode with the minimum SATD cost is determined as the non-2N×2N candidate PU partitioning mode.
3. The method according to claim 2, characterized in that The determining, based on the multiple PUs in the non-2N×2N PU partitioning mode, a SATD cost corresponding to the non-2N×2N PU partitioning mode includes: For any PU in the non-2N×2N PU partitioning mode, determine a prediction pixel block corresponding to the PU based on a motion estimation mode; Determine a SATD cost corresponding to the PU based on a residual pixel block between an original pixel block and a predicted pixel block corresponding to the PU; The SATD cost corresponding to each PU in the non-2N×2N PU partitioning mode is summed to determine the SATD cost corresponding to the non-2N×2N PU partitioning mode.
4. The method according to claim 1, characterized in that: The method of selecting a candidate PU partitioning method by using the SATD cost and the coding rate cost to determine the candidate PU mode includes: Divide the current CU based on the candidate PU division mode to obtain at least one PU under the candidate PU division mode; Setting a different PU prediction mode for each PU under the candidate PU partitioning mode to obtain a plurality of PU modes corresponding to the candidate PU partitioning mode, wherein the different PU prediction modes include: an inter-frame PU prediction mode and an intra-frame PU prediction mode; For any PU mode, based on the PU prediction mode corresponding to each PU in the PU mode, using SATD cost and bit rate cost, determine the sum of costs corresponding to the PU mode; The candidate PU mode is determined according to the sum of the costs corresponding to each PU mode.
5. The method according to claim 4, characterized in that For any PU mode, based on the PU prediction mode corresponding to each PU in the PU mode, using SATD cost and bit rate cost, determining the sum of costs corresponding to the PU mode includes: For any PU in the PU mode, determining a motion vector and a predicted pixel block corresponding to the PU based on a PU prediction mode corresponding to the PU; Determine a SATD cost corresponding to the PU based on a residual pixel block between an original pixel block and a predicted pixel block corresponding to the PU; Determine a bit rate cost corresponding to the PU based on a motion vector and a residual pixel block corresponding to the PU; The SATD cost and the bit rate cost corresponding to each PU in the PU mode are summed to determine the sum of the costs corresponding to the PU mode.
6. The method according to claim 4 or 5, characterized in that: The inter-frame PU prediction mode includes: Advanced Motion Vector Prediction AMVP mode and Merge mode; the intra-frame PU prediction mode includes: a first candidate intra-frame PU prediction mode and a second candidate intra-frame PU prediction mode; The step of setting a different PU prediction mode for each PU under the candidate PU partitioning mode to obtain a plurality of PU modes corresponding to the candidate PU partitioning mode includes: When the candidate PU partitioning mode is the 2N×2N PU partitioning mode, setting an AMVP mode and a Merge mode for a PU under the 2N×2N PU partitioning mode to obtain two first PU modes corresponding to the 2N×2N PU partitioning mode; When the candidate PU partitioning mode is the 2N×2N PU partitioning mode, a first candidate intra PU prediction mode and a second candidate intra PU prediction mode are respectively set for a PU under the 2N×2N PU partitioning mode to obtain two second PU modes corresponding to the 2N×2N PU partitioning mode; In the case where the candidate PU partitioning method is the non-2N×2N candidate PU partitioning method, an AMVP mode and a Merge mode are respectively set for each PU under the non-2N×2N candidate PU partitioning method to obtain at least four third PU modes corresponding to the non-2N×2N candidate PU partitioning method.
7. The method according to claim 6, characterized in that The determining the candidate PU mode according to the sum of the costs corresponding to each PU mode includes: Among the at least four third PU modes, the PU mode with the smallest sum of selection costs is determined as the first selected PU mode; Among the two first PU modes and the first selected PU mode, the PU mode with the smallest sum of selection costs is determined as one of the candidate PU modes, and the PU mode with the second smallest sum of selection costs is determined as the second selected PU mode; Among the two second PU modes, the PU mode with the smallest sum of selection costs is determined as the third selected PU mode; Among the second selected PU mode and the third selected PU mode, the PU mode with the smallest sum of costs is selected and determined as one of the candidate PU modes.
8. The method according to claim 1, characterized in that The utilization distortion cost is used to select the candidate PU mode to determine a target PU mode corresponding to the current CU, including: Based on the PU partitioning mode and the PU prediction mode corresponding to each candidate PU mode, determine the rate-distortion cost corresponding to each candidate PU mode under different TU partitioning modes; The target PU mode is determined according to the candidate PU mode with the minimum rate-distortion cost and the corresponding TU partitioning method.
9. A PU mode selection device, characterized in that: The device is applied to HEVC, and the device includes: A first selection module is used to select multiple PU partitioning modes for the HEVC current CU using SATD cost to determine a candidate PU mode corresponding to the current CU, wherein each candidate PU mode includes a corresponding PU partitioning mode and a PU prediction mode; A second selection module is used to select the candidate PU mode by utilizing the rate-distortion cost, and determine a target PU mode corresponding to the current CU, wherein the target PU mode includes a corresponding PU partitioning mode, a TU partitioning mode, and a PU prediction mode; The first selection module includes: A first selection submodule is used to select a plurality of non-2N×2N PU partitioning modes by using a SATD cost, and determine a non-2N×2N candidate PU partitioning mode corresponding to the current CU, wherein the plurality of non-2N×2N PU partitioning modes include: N×N, 2N×N, N×2N, 2N×nU, 2N×nD, nL×2N, and nR×2N; The second selection submodule is used to select the candidate PU partitioning mode by using the SATD cost and the coding rate cost to determine the candidate PU mode, wherein the candidate PU partitioning mode includes the 2N×2N PU partitioning mode and the non-2N×2N candidate PU partitioning mode.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 8.
11. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Selection method and device of rate distortion coding mode and coding method and system
CN116033162A
Inter-frame prediction mode selection method and device for video coding
CN117156133A