Coding method and device, electronic equipment and storage medium
By introducing a multi-functional index and an expanded candidate motion vector list, the syntax elements of unidirectional and bidirectional MMVD are unified, which solves the parallel impact of MMVD optimization on the decoding end and improves both encoding and decoding efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-05
- Publication Date
- 2026-03-31
AI Technical Summary
In the VVC coding standard, optimization of unidirectional and bidirectional MMVD requires significant modifications to the decoding end, resulting in low parallel decoding efficiency.
A multi-functional index is introduced to unify the syntax elements of unidirectional and bidirectional MMVD. By determining the meaning of the multi-functional index during the motion information generation stage, the direct parsing of its syntax elements at the decoding end is avoided, thereby expanding the number of candidate motion vectors in the candidate motion vector list.
It effectively reduces the impact of MMVD optimization on decoder parallelism, improves coding efficiency, and enhances coding efficiency.
Smart Images

Figure CN116582680B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to encoding / decoding methods, apparatus, electronic devices, and storage media. Background Technology
[0002] In video coding, MMVD (Merge with Motion Vector Difference) is an inter-frame prediction technique in the VVC (Versatile Video Coding) coding standard. MMVD constructs MMVD candidates using the first two candidate motion information from the merge list, offsetting in both horizontal and vertical directions. Rate-distortion optimization is used to select the optimal candidate motion information index, offset direction, and offset step size. Based on whether the prediction direction corresponding to the selected candidate motion information is unidirectional or bidirectional, MMVD can be divided into unidirectional MMVD and bidirectional MMVD.
[0003] Related technologies have optimized unidirectional MMVD and bidirectional MMVD. However, in the actual implementation process, the optimization of unidirectional and bidirectional MMVD requires significant modifications to the decoding end, which will have a significant impact on decoding parallelism. Summary of the Invention
[0004] This disclosure provides an encoding / decoding method, apparatus, electronic device, and storage medium to at least solve the problem that optimizations for unidirectional and bidirectional MMVD in related technologies require significant modifications to the decoding end, which greatly impacts parallel decoding. The technical solution of this disclosure is as follows:
[0005] According to a first aspect of the present disclosure, an encoding method is provided, comprising:
[0006] Based on the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes, the target motion vector, target offset direction, and target offset step size are determined from the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame.
[0007] The motion vector index corresponding to the target motion vector, the offset direction index corresponding to the target offset direction, the offset step index corresponding to the target offset step, and the multi-function index are written into the encoded bitstream corresponding to the image frame; the offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction;
[0008] Wherein, when the prediction direction of the current coding unit is bidirectional, the multi-functional index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0009] In some exemplary embodiments of this disclosure, the method further includes:
[0010] Obtain the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame. The offset direction in the offset direction list includes the horizontal X-axis direction and the vertical Y-axis direction.
[0011] Based on the data in the offset direction list, the offset step size list, and the candidate motion vector list, the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes is calculated.
[0012] In some exemplary embodiments of this disclosure, the step of calculating the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes based on data from the offset direction list, the offset step size list, and the candidate motion vector list includes:
[0013] Select one data point from the offset direction list and the offset step size list respectively, and combine them to obtain multiple offset parameter combinations;
[0014] Based on the multiple offset parameter combinations, the motion vectors in the candidate motion vector list are adjusted sequentially to obtain multiple adjusted motion vectors;
[0015] Calculate the rate-distortion cost corresponding to the adjusted motion vector.
[0016] In some exemplary embodiments of this disclosure, the method further includes:
[0017] Get the list of motion vector precision;
[0018] The step involves selecting one data point from the offset direction list and the offset step size list, and combining them to obtain multiple offset parameter combinations, including:
[0019] Select one data point from each of the offset direction list, the offset step size list, and the motion vector accuracy list, and combine them to obtain multiple offset parameter combinations.
[0020] In some exemplary embodiments of this disclosure, the number of adjusted motion vectors is the product of the number of offset directions in the offset direction list, the number of offset steps in the offset step size list, the number of candidate vectors in the candidate motion vector list, and the number of motion vector accuracies in the motion vector accuracy list.
[0021] In some exemplary embodiments of this disclosure, when the prediction direction of the current coding unit is unidirectional, the multifunctional index is also used to represent the motion vector precision index.
[0022] In some exemplary embodiments of this disclosure, the offset step size list includes a first step size list and a second step size list; each offset step size in the first step size list is smaller than each offset step size in the second step size list; the step size interval between each offset step size in the first step size list is smaller than the step size interval between each offset step size in the second step size list; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is also used to represent the list index of the offset step size list.
[0023] In some exemplary embodiments of this disclosure, when the area of the encoding unit is less than a preset threshold, the offset step size list corresponding to the encoding unit includes 4 steps.
[0024] In some exemplary embodiments of this disclosure, the number of candidate motion vectors in the candidate motion vector list is greater than 2.
[0025] According to a second aspect of this disclosure, a decoding method is provided, comprising:
[0026] The encoded bitstream corresponding to the image frame is parsed to obtain the motion vector index, offset direction index, offset step size index, and multi-function index corresponding to the target motion vector of the current coding unit. The motion vector index, offset direction index, offset step size index, and multi-function index are determined from the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame, based on the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes. The offset direction index indicates whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction.
[0027] The meaning of the multi-functional index is determined based on the prediction direction of the current coding unit; wherein, when the prediction direction of the current coding unit is bidirectional, the multi-functional index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0028] The pixels of the current coding unit are reconstructed based on the meaning of the multi-function index, the motion vector index, the offset direction index, and the offset step index;
[0029] The image frame is obtained based on the pixels of multiple coding units.
[0030] According to a third aspect of this disclosure, a decoding apparatus is provided, comprising:
[0031] The bitstream parsing module is used to parse the encoded bitstream corresponding to the image frame to obtain the motion vector index, the offset direction index, the offset step index, and the multi-function index corresponding to the target motion vector of the current encoding unit. The motion vector index, the offset direction index, the offset step index, and the multi-function index are determined from the candidate motion vector list, offset direction list, and offset step list corresponding to the current encoding unit of the image frame, based on the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes. The offset direction index indicates whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction.
[0032] The meaning determination module is used to determine the meaning of the multi-functional index based on the prediction direction of the current coding unit; wherein, when the prediction direction of the current coding unit is bidirectional, the multi-functional index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0033] A pixel reconstruction module is used to reconstruct the pixels of the current coding unit based on the meaning of the multi-function index, the motion vector index, the offset direction index, and the offset step index.
[0034] The image reconstruction module is used to obtain the image frame based on the pixels of multiple coding units.
[0035] According to a fourth aspect of this disclosure, an encoding device is provided, comprising:
[0036] The first encoding module is used to determine the target motion vector, target offset direction, and target offset step size from the candidate motion vector list, offset direction list, and offset step size list corresponding to the rate-distortion cost of different combinations of motion vectors, offset directions, and offset step sizes in the current encoding unit of the image frame.
[0037] The second encoding module is used to write the motion vector index corresponding to the target motion vector, the offset direction index corresponding to the target offset direction, the offset step index corresponding to the target offset step, and the multi-function index into the encoded bitstream corresponding to the image frame; the offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction.
[0038] Wherein, when the prediction direction of the current coding unit is bidirectional, the multi-functional index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0039] According to a fifth aspect of this disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the decoding method described in any one of the preceding claims, or to implement the encoding method described in any one of the preceding claims.
[0040] According to a sixth aspect of this disclosure, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the decoding methods described above, or to implement any of the encoding methods described above.
[0041] According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program / instructions, which, when executed by a processor, implement the decoding method described in any one of the above descriptions, or implement the encoding method described in any one of the above descriptions.
[0042] According to an eighth aspect of the present disclosure, a chip is provided, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to run a program or instructions to implement the decoding method as described in the first aspect, or to implement the encoding method described in any one of the foregoing.
[0043] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:
[0044] This disclosure provides an encoding / decoding method, apparatus, electronic device, and storage medium. During the encoding / decoding process, a multi-functional index is introduced. The meaning of this multi-functional index syntax element is not revealed during the syntax element parsing stage, but is determined during the motion information generation stage. When the prediction direction of the current coding unit is bidirectional, the multi-functional index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction. This allows the same set of syntax elements to be used for both unidirectional and bidirectional MMVD optimization, thereby effectively reducing the impact of MMVD optimization on decoder parallelism and significantly improving decoding efficiency.
[0045] Furthermore, for both bidirectional and unidirectional MMVD, this embodiment expands the number of candidate motion vectors in the candidate motion vector list, which can effectively improve coding efficiency.
[0046] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0048] Figure 1 This is a block diagram illustrating a system architecture according to an exemplary embodiment.
[0049] Figure 2 This is an example diagram of a reference frame offset according to an exemplary embodiment.
[0050] Figure 3 This is a flowchart illustrating an encoding method according to an exemplary embodiment.
[0051] Figure 4 This is a flowchart illustrating the calculation of rate distortion cost according to an exemplary embodiment.
[0052] Figure 5 This is a flowchart illustrating a decoding method according to an exemplary embodiment.
[0053] Figure 6 This is a flowchart illustrating decoding of syntax elements and pixel reconstruction at a decoding end according to an exemplary embodiment.
[0054] Figure 7 This is a schematic diagram illustrating the image CTU decoding and pixel reconstruction sequence according to an exemplary embodiment.
[0055] Figure 8This is a schematic diagram illustrating the division of A coding units according to an exemplary embodiment.
[0056] Figure 9 This is a block diagram illustrating a decoding apparatus according to an exemplary embodiment.
[0057] Figure 10 This is a block diagram illustrating an encoding device according to an exemplary embodiment.
[0058] Figure 11 A structural block diagram of an electronic device is shown according to an exemplary embodiment;
[0059] Figure 12 A schematic diagram of the hardware structure of an electronic device is shown according to an exemplary embodiment. Detailed Implementation
[0060] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0061] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0062] Figure 1 A schematic diagram of an exemplary system architecture to which the encoding and / or decoding methods of embodiments of the present disclosure can be applied is shown.
[0063] like Figure 1 As shown, the system architecture may include server 101, network 102, terminal device 103, terminal device 104, and terminal device 105. Network 102 serves as the medium for providing a communication link between terminal device 103, terminal device 104, or terminal device 105 and server 101. Network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0064] Server 101 may be a server that provides various services, such as a back-end management server that supports the devices operated by users using terminal devices 103, 104, or 105. The back-end management server may analyze and process received requests and other data, and feed back the processing results to terminal devices 103, 104, or 105; server 101 may be, for example, an encoder or a decoder.
[0065] Terminal devices 103, 104, and 105 can be smartphones, tablets, laptops, desktop computers, smart speakers, wearable smart devices, virtual reality devices, augmented reality devices, etc., but are not limited to these.
[0066] In some embodiments, server 101 can be a decoding end. Server 101 can parse the encoded bitstream corresponding to the image frame to obtain the motion vector index corresponding to the target motion vector of the current coding unit, the offset direction index corresponding to the target offset direction, the offset step size index corresponding to the target offset step size, and the multi-function index; wherein, the motion vector index, offset direction index, offset step size index, and multi-function index are determined from the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame according to the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes; the offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction; the meaning of the multi-function index is determined according to the prediction direction of the current coding unit; wherein, when the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-function index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction; the pixels of the current coding unit are reconstructed according to the meaning of the multi-function index, the motion vector index, the offset direction index, and the offset step size index; and the image frame is obtained based on the pixels of multiple coding units.
[0067] In some embodiments, server 101 can be an encoding end. Server 101 can acquire the signal of an image frame, and then, based on the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes, determine the target motion vector, target offset direction, and target offset step size from the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame. The motion vector index corresponding to the target motion vector, the offset direction index corresponding to the target offset direction, the offset step size index corresponding to the target offset step size, and the multi-function index are written into the encoded bitstream corresponding to the image frame. The offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction. Wherein, when the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-function index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0068] In some embodiments, each image frame can be processed block by block, where a block can be, for example, but not limited to, a coding tree unit (CTU), a largest coding unit (LCU), a coding unit (CU), a prediction unit (PU), and a transformation unit (TU).
[0069] The principle of video coding is to use the similarity between consecutive image frames and the similarity between adjacent blocks within the same image frame / strip to encode a portion of representative image frames or blocks according to their original pixel values. For other image frames or blocks besides the representative ones, the pixel values are predicted by using the similarity between consecutive image frames or adjacent blocks, thereby compressing the video signal to remove redundancy in the spatial and temporal dimensions.
[0070] When performing video encoding, spatial and / or temporal predictions can be performed on blocks of the current image frame, depending on whether the similarity between adjacent blocks or between consecutive image frames is utilized.
[0071] Spatial prediction (or "intra-frame prediction") uses the pixel values of pixels from reconstructed neighboring blocks (neighboring blocks refer to already encoded adjacent blocks) stored in memory (called reference pixels) to predict the current block, thus obtaining the predicted block. Spatial prediction reduces the spatial redundancy inherent in the video signal.
[0072] Temporal prediction (also known as "inter-frame prediction" or "motion-compensated prediction") uses reconstructed pixels (reconstructed pixels refer to pixels that have already been encoded) from the encoded image frame (called the "reference image frame") stored in the image frame buffer to predict the current block, resulting in a predicted block. Temporal prediction reduces the inherent temporal redundancy in the video signal. The temporal prediction signal for the current block is typically determined based on one or more predicted motion vectors, which indicate the motion offset and direction between the current block and its temporal reference (called the "reference block," which is a block in the reference image frame). The process of determining the predicted motion vectors is called motion estimation; the process of determining the reference block based on the predicted motion vectors, the current block, and the reference image frame is called motion compensation, and the determined reference block becomes the predicted block.
[0073] An example of a method for predicting motion information for the current block is the Merge mode. Merge mode is a motion vector prediction technique in coding standards that uses the motion vectors (MVs) of neighboring blocks in the temporal or spatial domains to predict the MV of the current coding block (also called the current coding unit). Merge mode creates a candidate list of motion information for the current coding unit, containing five candidate motion information items. Each candidate contains information such as the MV, prediction direction, reference frame index, and motion vector precision. By traversing these five candidate motion information items, the candidate motion information with the lowest rate-distortion cost is used as the candidate motion information for the current coding unit. No motion information (such as the reference frame index, motion vector precision index, and prediction direction, etc.) needs to be transmitted in the bitstream; only the index of the optimal candidate motion information in the list needs to be transmitted.
[0074] Similar to the normal Merge mode, MMVD constructs the MV candidate list in the same way. However, MMVD only constructs two candidate lists, so it only needs to traverse the two candidate motion information and select the best one. MMVD uses the motion information of the candidate lists to perform motion compensation on the current coding block. Under the MMVD model, the MV information needs to be adjusted to a certain extent. Therefore, in MMVD mode, when transmitting motion information, in addition to transmitting the list index of the best candidate motion information as in the normal Merge mode, it is also necessary to transmit information for adjusting the MV, including the offset step size and offset direction.
[0075] Taking unidirectional MMVD as an example, in related technologies, after extracting the initial candidate MV, the position pointed to by the candidate MV in the reference frame is taken as the starting point, and different motion vectors (MV) are formed in 4 directions (positive and negative x-axis and positive and negative y-axis) and 8 step sizes {1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32}.
[0076] like Figure 2 As shown, in the forward reference frame (L0 reference) and the backward reference frame (L1 reference), the origin of the dashed line is the starting point of the MV in the reference frame. The initial MV will be offset in the horizontal or vertical direction to obtain a new MV.
[0077] Whether it is unidirectional MMVD or bidirectional MMVD, in the implementation, the encoding method of MMVD needs to select the optimal one from 64 candidates (2*4*8) formed by combining 2 candidate motion information, 4 directions and 8 offset compensations. The corresponding offset direction and offset step size and other information need to be written into the bit stream.
[0078] Figure 3 This is a flowchart illustrating an encoding method provided in an embodiment of the present disclosure, such as... Figure 3 As shown, the encoding method includes steps S310-S320.
[0079] In S310, based on the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes, the target motion vector, target offset direction, and target offset step size are determined from the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame.
[0080] In this embodiment of the disclosure, the position pointed to by the motion vector in the reference frame is taken as the starting point, and different new motion vectors are formed with different offset directions and different offset step sizes, that is, different combinations of motion vectors, offset directions and offset step sizes in S310.
[0081] In one embodiment, such as Figure 2 As shown, the origin 201 of the dashed line in the figure is the starting point of the candidate motion vector in the reference frame (forward reference frame or backward reference frame). The motion vector will be offset in the horizontal or vertical direction to obtain a new motion vector (solid circle in the figure).
[0082] For example, assuming the motion vector MV is {4,6} and the offset step size is 2, then the offsets MVoffset in the four directions are: positive x-axis {2,0}, negative x-axis {-2,0}, positive y-axis {0,2}, and negative y-axis {0,-2}. The adjusted new motion vector is: MVfinal = MV + MVoffset. Taking the positive x-axis as an example, the new motion vector is: MVfinal = {4,6} + {2,0} = {6,6}.
[0083] Therefore, based on the two candidate motion vectors, four offset directions, two list indices, and eight offset step sizes included in each offset step size list, 128 new motion vectors can be obtained, which are 128 different combinations of motion vectors, offset directions, and offset step sizes. These 128 new motion vectors are used to encode the current coding unit, obtaining the rate-distortion cost value for each combination of coding parameters. Then, based on the magnitude of the rate-distortion cost value, the target combination is selected from the 128 different combinations of motion vectors, offset directions, and offset step sizes to obtain the target motion vector, target offset direction, and target offset step size.
[0084] In this embodiment of the disclosure, different syntax elements can be used to represent the above-mentioned candidate motion vector list, offset direction list, and offset step size list.
[0085] For example, the first syntax element (mmvd_cand_flag) represents the list of candidate motion vectors, as shown in Table 1:
[0086] Table 1. Meaning of the first syntax element mmvd_cand_flag
[0087] value Meaning 0 Select the zeroth candidate motion vector 1 Select the first candidate motion vector
[0088] For example, the second syntax element (mmvd_direction_idx) represents the list of offset directions, as shown in Table 2:
[0089] Table 2. Meaning of the second syntax element mmvd_direction_idx
[0090] value Meaning 00 Choose the positive x-axis direction 01 Choose the negative x-axis direction
[0091] For example, the third syntax element (mmvd_distance_flag) is used to represent the list of offset steps, as shown in Table 3:
[0092] Table 3. Meaning of the third syntax element mmvd_distance_flag
[0093] value Meaning 0 Choose the 0th step size 10 Select the first step size 110 Choose the second step size 1110 Choose the 3rd step size
[0094] In S320, the motion vector index corresponding to the target motion vector, the offset direction index corresponding to the target offset direction, the offset step index corresponding to the target offset step, and the multi-function index are written into the encoded bitstream corresponding to the image frame.
[0095] The offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction.
[0096] The multi-functional index has different meanings depending on the prediction direction of the current coding unit. When the prediction direction of the current coding unit is bidirectional, the multi-functional index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0097] In this embodiment, the multi-function index has different meanings when the prediction direction of the current coding unit is bidirectional and unidirectional, respectively. This unifies the syntax elements for unidirectional MMVD optimization and bidirectional MMVD optimization. Encoding in this way can effectively reduce the impact of MMVD optimization on decoder parallelism and can effectively improve decoding efficiency.
[0098] In some embodiments, such as Figure 4 As shown, the calculation process of rate distortion cost in the above text includes steps S410-S420.
[0099] S410, obtain the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame.
[0100] The candidate motion vector list includes multiple candidate motion vectors, which are the different motion vectors mentioned in S310 above.
[0101] Unlike the offset direction list in related technologies, the offset direction list includes the horizontal X-axis direction and the vertical Y-axis direction, but does not include the specific positive and negative directions of the horizontal X-axis or the vertical Y-axis.
[0102] S420 calculates the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset steps based on the data in the offset direction list, offset step size list, and candidate motion vector list.
[0103] In this embodiment of the disclosure, the offset direction in the offset direction list represents the horizontal X-axis direction or the vertical Y-axis direction, without specifying the specific positive or negative direction. This unifies the syntax elements of offset direction for unidirectional MMVD and bidirectional MMVD, making it easier for the decoder to decode later.
[0104] In some embodiments, S420 may involve selecting one data point from the offset direction list and the offset step size list and combining them to obtain multiple offset parameter combinations; based on the multiple offset parameter combinations, sequentially adjusting the motion vectors in the candidate motion vector list to obtain multiple adjusted motion vectors; and calculating the rate distortion cost corresponding to the adjusted motion vectors.
[0105] This embodiment combines the data from the offset direction list and the offset step size list to obtain more adjusted motion vectors, thus enabling better selection of the target motion vector.
[0106] In some embodiments, motion vector precision may also be introduced into the encoding scheme. The method may further include obtaining a list of motion vector precisions. Furthermore, in the above embodiments, selecting one data point from the offset direction list and the offset step size list and combining them to obtain multiple offset parameter combinations can be achieved by selecting one data point from the offset direction list, the offset step size list, and the motion vector precision list and combining them to obtain multiple offset parameter combinations.
[0107] In related technologies, the motion vector precision of each coding unit in MMVD is inherited from the motion information candidate. Since only quarter-pixel precision and half-pixel precision are available in MMVD and merge mode, the motion vector precision of each coding block in MMVD is derived according to the following rule: if the motion vector precision of the motion information candidate is quarter-pixel precision, then the motion vector precision of the current coding block is also quarter-pixel precision; otherwise, the motion vector precision of the current coding block is set to half-pixel precision.
[0108] This disclosure proposes a rate-distortion optimization method to determine the optimal motion vector precision for the coding unit of a unidirectional MMVD. As an example, during the current traversal of offset parameter combinations in the unidirectional MMVD, each combination can also calculate the rate-distortion cost for motion vectors at quarter-precision and half-precision precisions using rate-distortion optimization, and select the optimal motion vector precision for the current coding unit from these calculations.
[0109] Therefore, each unidirectional MMVD coding unit can have a syntax element, such as the fourth syntax element (mmvd_mv_resolution_idx), to indicate the motion vector precision selected by the current coding unit.
[0110] Table 4. Meaning of mmvd_mv_resolution_idx syntax elements
[0111] value Meaning 0 Select quarter pixel precision 1 Select half-pixel precision
[0112] The embodiments disclosed herein introduce motion vector precision, which can provide more combinations of offset parameters to be selected, thereby enabling the selection of a more suitable combination of offset parameters to obtain the target motion vector.
[0113] In one embodiment, the number of adjusted motion vectors is the product of the number of offset directions in the offset direction list, the number of offset steps in the offset step list, the number of candidate vectors in the candidate motion vector list, and the number of motion vector accuracies in the motion vector accuracy list.
[0114] In some embodiments, when the prediction direction of the current coding unit is unidirectional, the multi-function index can also be used to represent the motion vector precision index.
[0115] In some embodiments, the offset step list includes a first step list and a second step list; each offset step in the first step list is smaller than each offset step in the second step list; the step interval between each offset step in the first step list is smaller than the step interval between each offset step in the second step list; when the prediction direction of the current coding unit is unidirectional, the multi-function index is also used to represent the list index of the offset step list.
[0116] In some embodiments, when the area of the encoding unit is less than a preset threshold, the offset step size list corresponding to the encoding unit includes 4 steps.
[0117] In this embodiment of the disclosure, the fifth syntax element can be used to represent the above-mentioned multi-function index (mmvd_multiple_idx). When the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the meaning of the multi-function index can be shown in the following table:
[0118] Table 5. Meaning of syntax elements of mmvd_multiple_idx in unidirectional MMVD
[0119]
[0120] The 0th value represents the list index of the offset step list, the 1st value represents the motion vector precision index, and the 2nd value represents the specific positive or negative direction in the offset direction.
[0121] As seen in the preceding text, the changes to the step in unidirectional MMVD align with those in bidirectional MMVD. Specifically, for encoded blocks where width * height <= 256, the step is reduced from 8 to 4. Therefore, the third syntax element (mmvd_distance_flag) is modified from 1-7 bits to 1-3 bits. The semantics of the second syntax element (mmvd_direction_idx) in unidirectional MMVD are modified to be consistent with bidirectional MMVD, indicating only the x or y axis direction, not the specific positive or negative direction, and is reduced from 2 bits to 1 bit. A multi-function index (mmvd_multiple_idx) syntax element is introduced, which is 3 bits. Thus, these changes ensure that the number of syntax element bits required to be written into the bitstream is equal for both unidirectional and bidirectional MMVD.
[0122] Therefore, at the encoding stage, when MMVD is enabled, only the multi-function index (mmvd_multiple_idx) needs to be encoded in addition to the original MMVD syntax elements. During the decoding stage, the multi-function index is decoded in the same way; motion information does not need to be generated simultaneously during the syntax element decoding stage. In the motion information generation stage, if it is a CU with MMVD enabled, the prediction direction is first determined, and based on the prediction direction, it is determined whether it is unidirectional or bidirectional MMVD. Based on this, the values of the multi-function index syntax elements can then be parsed.
[0123] The present invention optimizes the unidirectional and bidirectional MMVD optimization syntax elements in a unified manner, which can effectively reduce the impact on decoder parallelism and effectively improve decoding efficiency.
[0124] In some embodiments, the number of candidate motion vectors in the candidate motion vector list is greater than 2.
[0125] Regardless of whether the optimization targets unidirectional or bidirectional MMVD, the number of candidate motion information remains consistent with the original MMVD design. As an example, this disclosure expands the number of candidate motion information in the MMVD from 2 to 5. Simultaneously, the candidate list index syntax element `mmvd_cand_flag` is modified. See the table below for details:
[0126] Table 6. Meaning of optimized syntax elements in mmvd_cand_flag
[0127] value Meaning 00 Select the zeroth candidate motion information 01 Select the first candidate motion information 10 Select the second candidate motion information 110 Select the third candidate motion information 111 Select the fourth candidate motion information
[0128] As shown in the table above, for the mmvd_cand_flag syntax element, the first three candidates are encoded using a fixed-length codeword encoding method, while the last two codewords are encoded using a truncated unary code method. Therefore, this syntax element requires 2 to 3 bits to represent its meaning.
[0129] The embodiments disclosed herein expand the number of candidate motion information, which can effectively improve compression efficiency. Tests have shown that a BD-rate gain of approximately -0.15% can be achieved.
[0130] Based on the same inventive concept, this disclosure also provides a decoding method, such as... Figure 5 As shown, the decoding method includes steps S510-S540.
[0131] In S510, the encoded bitstream corresponding to the image frame is parsed to obtain the motion vector index, offset direction index, offset step size index, and multi-function index corresponding to the target motion vector of the current coding unit. Among them, the motion vector index, offset direction index, offset step size index, and multi-function index are determined from the candidate motion vector list, offset direction list, and offset step size list corresponding to the current coding unit of the image frame based on the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes. The offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction.
[0132] In one embodiment, the offset step list includes a first step list and a second step list; each offset step in the first step list is smaller than each offset step in the second step list; the step interval between each offset step in the first step list is smaller than the step interval between each offset step in the second step list; when the prediction direction of the current coding unit is unidirectional, the multi-function index is also used to represent the list index of the offset step list.
[0133] In one embodiment, when the area of the encoding unit is less than a preset threshold, the offset step size list corresponding to the encoding unit includes 4 steps.
[0134] In S520, the meaning of the multi-function index is determined based on the prediction direction of the current coding unit; wherein, when the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-function index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0135] In S530, the pixels of the current coding unit are reconstructed based on the meaning of the multi-function index, the motion vector index, the offset direction index, and the offset step index.
[0136] In S540, an image frame is obtained based on the pixels of multiple coding units.
[0137] like Figure 6 As shown, the process of decoding syntax elements and reconstructing pixels at the decoding end can include syntax element parsing, motion information generation, and pixel reconstruction.
[0138] Figure 7 This shows the image CTU decoding and pixel reconstruction sequence. Figure 8 Show Figure 7 This is a schematic diagram illustrating the division of a CTU (Coding Unit). At the decoding end, the decoder parses the syntax elements and reconstructs pixels for each CTU from left to right and from top to bottom. For example... Figure 6As shown, for the purpose of parallel decoding and improving decoding efficiency, the decoding process is divided into three steps from the start of decoding to the final reconstructed pixels: syntax element decoding, motion information generation, and pixel reconstruction. All three steps follow... Figure 7 The process is performed independently on a CTU basis. That is, first, all CTUs of the image are decoded in order from left to right and from top to bottom, and then steps 2 and 3 are performed.
[0139] Syntax element decoding stage: This stage involves decoding the information in the bitstream in a fixed order to determine the information of the corresponding syntax elements. For example, according to the original MMVD design, if a CU chooses MMVD, it is necessary to decode three syntax element information: the encoding candidate list index (mmvd_cand_flag), the offset step index (mmvd_distance_idx), and the direction index (mmvd_direction_idx).
[0140] Motion Information Generation Stage: This stage primarily involves determining the motion information of each CU block. This motion information mainly includes prediction direction, reference frame index, motion vector, and motion vector precision, among other things. It's important to emphasize that if a block is an MMVD block, only at this stage can it be determined whether it's a unidirectional or bidirectional prediction; this cannot be determined during the syntax element decoding stage.
[0141] Pixel reconstruction stage: The motion information of each CU determined in the above motion information generation stage is used to reconstruct the pixels at the corresponding positions of the CU to obtain the final reconstructed pixels.
[0142] It is important to note that all three steps are performed using CUs (Complex Units) within the CTU for decoding. Figure 7 Taking the gray ACTU block shown as an example, this ACTU block is divided into 9 CUs. Therefore, in the syntax element decoding stage, when decoding block A, block A will sequentially decode the syntax element information of the 9 CUs. Secondly, in the motion information generation stage, when working on block A, the syntax element information of the 9 CUs will be sequentially exported again. The final pixel reconstruction stage is similar.
[0143] The decoding of syntax elements and the generation of motion information are separate stages. This makes it impossible for a CU block that has selected MMVD mode to determine whether it is a unidirectional or bidirectional MMVD during the syntax element decoding stage. Figure 7 An example is the 6th CU in a CTU. When it's determined that this CU is enabling MMVD, the prediction direction of this CU needs to be determined when decoding MMVD syntax elements. Based on the prediction direction, it's determined whether the MMVD is unidirectional or bidirectional. Then, the corresponding unidirectional or bidirectional syntax elements are decoded. The decoder's original... Figure 6The decoding process shown cannot be implemented. Therefore, in related technologies, it is necessary to merge the two stages of syntax element decoding and motion information generation. That is, the motion information of each CU block is determined simultaneously during the decoding process. This implementation method has a significant impact on decoding parallelism, thereby increasing the decoding time.
[0144] In this embodiment, a multi-functional index is introduced. The meaning of the multi-functional index syntax element is not revealed during the syntax element parsing stage, but is determined during the motion information generation stage. When the prediction direction of the current coding unit is bidirectional, the multi-functional index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-functional index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction. This allows the same set of syntax elements to be used for both unidirectional and bidirectional MMVD optimization, thereby effectively reducing the impact of MMVD optimization on decoder parallelism and effectively improving decoding efficiency.
[0145] It should be noted that the decoding method provided in this disclosure can also be executed by a decoding device, or a control module within that decoding device for executing the decoding method. This disclosure uses the example of a decoding device executing a decoding method to illustrate the decoding device provided in this disclosure.
[0146] Figure 9 This is a block diagram illustrating a decoding apparatus according to an exemplary embodiment. (Refer to...) Figure 9 The device includes a bitstream parsing module 910, a meaning determination module 920, a pixel reconstruction module 930, and an image restoration module 940.
[0147] The bitstream parsing module 910 is used to parse the encoded bitstream corresponding to the image frame to obtain the motion vector index, the offset direction index, the offset step index, and the multi-function index corresponding to the target motion vector of the current coding unit. Among them, the motion vector index, offset direction index, offset step index, and multi-function index are determined from the candidate motion vector list, offset direction list, and offset step list corresponding to the current coding unit of the image frame based on the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset step sizes. The offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction.
[0148] The meaning determination module 920 is used to determine the meaning of the multi-function index based on the prediction direction of the current coding unit; wherein, when the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent the candidate coding unit index; when the prediction direction of the current coding unit is unidirectional, the multi-function index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0149] The pixel reconstruction module 930 is used to reconstruct the pixels of the current coding unit based on the meaning of the multi-function index, the motion vector index, the offset direction index, and the offset step index.
[0150] The image reconstruction module 940 is used to obtain an image frame based on pixels of multiple coding units.
[0151] In some embodiments, the offset step list includes a first step list and a second step list; each offset step in the first step list is smaller than each offset step in the second step list; the step interval between each offset step in the first step list is smaller than the step interval between each offset step in the second step list; when the prediction direction of the current coding unit is unidirectional, the multi-function index is also used to represent the list index of the offset step list.
[0152] In some embodiments, when the area of the encoding unit is less than a preset threshold, the offset step size list corresponding to the encoding unit includes 4 steps.
[0153] In some embodiments, the number of candidate motion vectors in the candidate motion vector list is greater than 2.
[0154] Based on the same inventive concept, this disclosure also provides an encoding device, such as... Figure 10 As shown, the encoding device includes:
[0155] The first encoding module 1010 is used to determine the target motion vector, target offset direction, and target offset step size from the candidate motion vector list, offset direction list, and offset step size list corresponding to the rate-distortion cost of different combinations of motion vectors, offset directions, and offset step sizes in the current encoding unit of the image frame.
[0156] The second encoding module 1020 is used to write the motion vector index corresponding to the target motion vector, the offset direction index corresponding to the target offset direction, the offset step index corresponding to the target offset step, and the multi-function index into the encoded bitstream corresponding to the image frame; the offset direction index is used to indicate whether the offset direction is the horizontal X-axis direction or the vertical Y-axis direction.
[0157] In the case where the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent the candidate coding unit index; in the case where the prediction direction of the current coding unit is unidirectional, the multi-function index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
[0158] In some embodiments, the device may further include:
[0159] The first acquisition module is used to acquire the candidate motion vector list, offset direction list and offset step size list corresponding to the current coding unit of the image frame. The offset direction in the offset direction list includes the horizontal X-axis direction and the vertical Y-axis direction.
[0160] The calculation module is used to calculate the rate-distortion cost corresponding to different combinations of motion vectors, offset directions, and offset steps based on the data in the offset direction list, offset step size list, and candidate motion vector list.
[0161] In some embodiments, the computing module includes:
[0162] The data combination unit is used to select one data point from the offset direction list and the offset step size list and combine them to obtain multiple offset parameter combinations.
[0163] The vector adjustment unit is used to adjust the motion vectors in the candidate motion vector list sequentially based on multiple offset parameter combinations to obtain multiple adjusted motion vectors.
[0164] Calculate the rate-distortion cost corresponding to the adjusted motion vector.
[0165] In some embodiments, the device may further include:
[0166] The second acquisition module is used to acquire a list of motion vector precision.
[0167] The data combination unit is used to select one data from the offset direction list, the offset step size list, and the motion vector accuracy list and combine them to obtain multiple offset parameter combinations.
[0168] In some embodiments, the number of adjusted motion vectors is the product of the number of offset directions in the offset direction list, the number of offset steps in the offset step list, the number of candidate vectors in the candidate motion vector list, and the number of motion vector accuracies in the motion vector accuracy list.
[0169] In some embodiments, when the prediction direction of the current coding unit is unidirectional, the multi-function index is also used to represent the motion vector precision index.
[0170] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0171] The encoding and decoding devices in this disclosure can be devices, or components, integrated circuits, or chips in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This disclosure does not impose specific limitations.
[0172] The encoding and decoding devices in the embodiments of this disclosure can be devices with an operating system. The operating system can be Android, iOS, or other possible operating systems; this disclosure does not specifically limit the specific operating system used.
[0173] The encoding and decoding devices provided in this disclosure can implement the various processes implemented in the above method embodiments, and will not be repeated here to avoid repetition.
[0174] like Figure 11 As shown, this disclosure also provides an electronic device 1100, including a processor 1101, a memory 1102, and a program or instructions stored in the memory 1102 and executable on the processor 1101. When the program or instructions are executed by the processor 1101, they implement the various processes of the above-described encoding and / or decoding method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0175] It should be noted that the electronic devices in this disclosure include the mobile electronic devices and non-mobile electronic devices described above.
[0176] Figure 12 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this disclosure.
[0177] The electronic device 1200 includes, but is not limited to, components such as: radio frequency unit 1201, network module 1202, audio output unit 1203, input unit 1204, sensor 1205, display unit 1206, user input unit 1207, interface unit 1208, memory 1209, and processor 1210.
[0178] Those skilled in the art will understand that the electronic device 1200 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1210 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 12 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0179] It should be understood that, in this embodiment of the disclosure, the input unit 1204 may include a graphics processing unit (GPU) 12041 and a microphone 12042. The GPU 12041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1206 may include a display panel 12061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1207 includes a touch panel 12071 and other input devices 12072. The touch panel 12071 is also called a touch screen. The touch panel 12071 may include a touch detection device and a touch controller. Other input devices 12072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here. The memory 1209 can be used to store software programs and various data, including but not limited to applications and operating systems. Processor 1210 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 1210.
[0180] This disclosure also provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the various processes of the above-described encoding and / or decoding method embodiments and achieve the same technical effects. To avoid repetition, these will not be described again here.
[0181] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0182] This disclosure also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described encoding and / or decoding method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0183] It should be understood that the chip mentioned in the embodiments of this disclosure may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0184] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this disclosure is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0185] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this disclosure.
[0186] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0187] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An encoding method characterized by comprising: The method comprises the following steps: According to the rate-distortion cost corresponding to different motion vector, offset direction and offset step combination, a target motion vector, a target offset direction and a target offset step are determined in a candidate motion vector list, an offset direction list and an offset step list corresponding to a current coding unit of an image frame; A motion vector index corresponding to the target motion vector, an offset direction index corresponding to the target offset direction, an offset step index corresponding to the target offset step and a multifunction index are written into a coding bitstream corresponding to the image frame; the offset direction index is used to indicate that the offset direction is a horizontal X-axis direction or a vertical Y-axis direction; Wherein, in the case that the prediction direction of the current coding unit is bidirectional, the multifunction index is used to represent a candidate coding unit index; in the case that the prediction direction of the current coding unit is unidirectional, the multifunction index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction.
2. The method of claim 1, wherein, The method further comprises the following steps: A candidate motion vector list, an offset direction list and an offset step list corresponding to a current coding unit of an image frame are obtained; the offset directions in the offset direction list include a horizontal X-axis direction and a vertical Y-axis direction; Based on the data in the offset direction list, the offset step list and the candidate motion vector list, rate-distortion costs corresponding to different motion vector, offset direction and offset step combinations are calculated.
3. The method of claim 2, wherein, The calculation of the rate-distortion costs corresponding to different motion vector, offset direction and offset step combinations based on the data in the offset direction list, the offset step list and the candidate motion vector list comprises the following steps: A plurality of offset parameter combinations are obtained by combining one data in the offset direction list and one data in the offset step list respectively; Based on the plurality of offset parameter combinations, motion vectors in the candidate motion vector list are adjusted in sequence to obtain a plurality of adjusted motion vectors; Rate-distortion costs corresponding to the adjusted motion vectors are calculated.
4. The method of claim 3, wherein, The method further comprises the following steps: A motion vector precision list is obtained; The combination of one data in the offset direction list and one data in the offset step list respectively to obtain a plurality of offset parameter combinations comprises the following steps: A plurality of offset parameter combinations are obtained by combining one data in the offset direction list, one data in the offset step list and one data in the motion vector precision list respectively.
5. The method of claim 4, wherein, The number of the adjusted motion vectors is the product of the number of offset directions in the offset direction list, the number of offset steps in the offset step list, the number of candidate vectors in the candidate motion vector list and the number of motion vector precisions in the motion vector precision list.
6. The method of claim 4, wherein, In the case that the prediction direction of the current coding unit is unidirectional, the multifunction index is also used to represent a motion vector precision index.
7. The method of claim 1, wherein, The offset step list comprises a first step list and a second step list; each offset step in the first step list is smaller than each offset step in the second step list; Step intervals between each offset step in the first step list are all less than step intervals between each offset step in the second step list; in a case where a prediction direction of the current coding unit is single-direction, the multi-function index is further used for representing a list index of an offset step list.
8. The method of claim 1, wherein, When an area of the coding unit is less than a preset threshold, the offset step list corresponding to the coding unit includes 4 steps.
9. The method of claim 1, wherein, A number of candidate motion vectors in the candidate motion vector list is greater than 2.
10. A decoding method, comprising: Comprising: parsing a coding bitstream corresponding to an image frame to obtain a motion vector index corresponding to a target motion vector of a current coding unit, an offset direction index corresponding to a target offset direction, an offset step index corresponding to a target offset step, and a multi-function index; wherein the motion vector index, the offset direction index, the offset step index, and the multi-function index are determined in a candidate motion vector list, an offset direction list, and an offset step list corresponding to a current coding unit of the image frame according to rate-distortion costs corresponding to different combinations of motion vectors, offset directions, and offset steps; the offset direction index is used to indicate that the offset direction is a horizontal X-axis direction or a vertical Y-axis direction; determining a meaning of the multi-function index according to a prediction direction of the current coding unit; wherein in a case where the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent a candidate coding unit index; in a case where the prediction direction of the current coding unit is single-direction, the multi-function index is used to represent a positive or negative direction of an X-axis or a Y-axis in the offset direction; reconstructing pixels of the current coding unit according to the meaning of the multi-function index, the motion vector index, the offset direction index, and the offset step index; obtaining the image frame based on pixels of a plurality of coding units.
11. An encoding apparatus, comprising: Comprising: a first encoding module, configured to determine a target motion vector, a target offset direction, and a target offset step in a candidate motion vector list, an offset direction list, and an offset step list corresponding to a current coding unit of an image frame according to rate-distortion costs corresponding to different combinations of motion vectors, offset directions, and offset steps; a second encoding module, configured to write a motion vector index corresponding to the target motion vector, an offset direction index corresponding to the target offset direction, an offset step index corresponding to the target offset step, and a multi-function index into a coding bitstream corresponding to the image frame; the offset direction index is used to indicate that the offset direction is a horizontal X-axis direction or a vertical Y-axis direction; wherein in a case where a prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent a candidate coding unit index; in a case where the prediction direction of the current coding unit is single-direction, the multi-function index is used to represent a positive or negative direction of an X-axis or a Y-axis in the offset direction.
12. A decoding apparatus, characterized by comprising: Comprising: The code stream analysis module is configured to analyze a coding code stream corresponding to the image frame to obtain a motion vector index corresponding to a target motion vector of the current coding unit, an offset direction index corresponding to a target offset direction, an offset step index corresponding to a target offset step, and a multi-function index. The motion vector index, the offset direction index, the offset step index, and the multi-function index are determined in a candidate motion vector list, an offset direction list, and an offset step list corresponding to the current coding unit of the image frame according to rate-distortion costs corresponding to different combinations of motion vectors, offset directions, and offset steps. The offset direction index is used to indicate whether the offset direction is a horizontal X-axis direction or a vertical Y-axis direction. The meaning determination module is configured to determine the meaning of the multi-function index according to a prediction direction of the current coding unit. When the prediction direction of the current coding unit is bidirectional, the multi-function index is used to represent a candidate coding unit index. When the prediction direction of the current coding unit is unidirectional, the multi-function index is used to represent the positive or negative direction of the X-axis or Y-axis in the offset direction. The pixel reconstruction module is configured to reconstruct pixels of the current coding unit according to the meaning of the multi-function index, the motion vector index, the offset direction index, and the offset step index. The image restoration module is configured to obtain the image frame based on the pixels of the plurality of coding units.
13. An electronic device, comprising: The processor; The memory for storing the instructions executable by the processor; The processor is configured to execute the instructions to implement the encoding method according to any one of claims 1 to 9, or implement the decoding method according to claim 10.
14. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement the encoding method according to any one of claims 1 to 9, or implement the decoding method according to claim 10.
Citation Information
Patent Citations
Techniques for simplified affine motion model coding with prediction offsets
CN112204976A
Inter-frame prediction method, encoder, decoder and computer storage medium
CN113727119A