Inter-frame prediction method and device, and corresponding encoder and decoder
By using the candidate length and direction information set to determine the motion vector difference value in video encoding, the problem of low encoding efficiency in inter-frame prediction is solved, and more efficient video data compression is achieved.
Patent Information
- Application Number
- CN202411945037.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-29
- Publication Date
- 2025-04-11
AI Technical Summary
In the existing video encoding technology, the inter-frame prediction method has the problem of low encoding efficiency, especially when processing motion vector prediction of image blocks, the existing methods fail to effectively reduce redundancy.
By obtaining the index of the motion vector prediction value and difference value of the current image block, using the candidate length and direction information set, the target length and direction information are determined, and the motion vector difference value is then calculated, thereby improving the accuracy and efficiency of inter prediction.
It improves the encoding and decoding efficiency during the video encoding process, reduces redundancy between image blocks, and improves the compression effect of video data.
Smart Images

Figure CN119815033A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 201811645808.X, and the original application date is December 29, 2018. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present invention relates to the field of video coding and decoding, and in particular to an inter-frame prediction method, device, and corresponding encoder and decoder. Background Art
[0003] Digital video capabilities may be incorporated into a wide variety of devices, including digital televisions, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, electronic book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio telephones (so-called "smart phones"), video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video compression techniques, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), Video Coding Standard H.265 / High Efficiency Video Coding (HEVC) standards, and extensions of such standards. Video devices may transmit, receive, encode, decode, and / or store digital video information more efficiently by implementing such video compression techniques.
[0004] Video compression techniques perform spatial (intra-image) prediction and / or temporal (inter-image) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (i.e., a video frame or a portion of a video frame) may be partitioned into several image blocks, which may also be referred to as tree blocks, coding units (CUs), and / or coding nodes. Image blocks in an intra-coded (I) slice of an image are encoded using spatial predictions with respect to reference samples in neighboring blocks in the same image. Image blocks in an inter-coded (P or B) slice of an image may use spatial predictions with respect to reference samples in neighboring blocks in the same image or temporal predictions with respect to reference samples in other reference images. Images may be referred to as frames, and reference images may be referred to as reference frames. Summary of the invention
[0005] The embodiments of the present application provide an inter-frame prediction method, device, and corresponding encoder and decoder, which can reduce the redundancy in the encoding and decoding process to a certain extent, thereby improving the encoding and decoding efficiency.
[0006] In a first aspect, an embodiment of the present application provides an inter-frame prediction method, the method comprising: obtaining a motion vector prediction value of a current image block; obtaining an index value of the length of a motion vector difference value of the current image block, the motion vector difference value of the current image block being used to indicate the difference between the motion vector prediction value and a motion vector target value of the current image block; determining target length information from a candidate length information set according to the index value of the length, the candidate length information set only including candidate length information of N motion vector differences, N being a positive integer greater than 1 and less than 8; obtaining the motion vector difference value of the current image block according to the target length information; determining the motion vector target value of the current image block according to the motion vector difference value of the current image block and the motion vector prediction value of the current image block; obtaining a prediction block of the current image block according to the motion vector target value of the current image block.
[0007] Among them, the candidate length information set may be preset.
[0008] In combination with the first aspect, in a first possible implementation manner of the first aspect, the method further includes: obtaining an index value of a direction of a motion vector difference value of the current image block; determining target direction information from M candidate direction information of motion vector differences according to the index value of the direction, where M is a positive integer greater than 1;
[0009] The obtaining the motion vector difference of the current image block according to the target length information includes: determining the motion vector difference of the current image block according to the target direction information and the target length information.
[0010] In combination with the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, N is 4.
[0011] In combination with the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect,
[0012] The candidate length information of the N motion vector differences includes at least one of the following: when the index value of the length is a first preset value, the length indicated by the target length information is a quarter pixel length; when the index value of the length is a second preset value, the length indicated by the target length information is a half pixel length; when the index value of the length is a third preset value, the length indicated by the target length information is a pixel length; when the index value of the length is a fourth preset value, the length indicated by the target length information is a two pixel length. In combination with the first aspect or any of the above possible implementations of the first aspect, in a fourth possible implementation of the first aspect, obtaining the motion vector prediction value of the current image block includes: constructing a candidate motion information list of the current image block, the candidate motion information list consisting of L motion vectors, where L is 1, 3, 4 or 5; obtaining the index value of the motion information prediction information of the current image block in the candidate motion information list, the motion information prediction information of the current image block including the motion vector prediction value; obtaining the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
[0013] In a second aspect, an embodiment of the present application provides an inter-frame prediction method, the method comprising: obtaining a motion vector prediction value of a current image block; performing a motion search in an area where a position indicated by the motion vector prediction value of the current image block is located to obtain a motion vector target value of the current image block; obtaining an index value of the length of a motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block, the motion vector difference of the current image block being used to indicate the difference between the motion vector prediction value and the motion vector target value of the current image block, the index value of the length of the motion vector difference of the current image block being used to indicate one candidate length information in a preset candidate length information set, the candidate length information set comprising only candidate length information of N motion vector differences, where N is a positive integer greater than 1 and less than 8.
[0014] In combination with the second aspect, in a first possible implementation of the second aspect, obtaining the index value of the length of the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block includes: obtaining the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block; and determining the index value of the length of the motion vector difference of the current image block and the direction index value of the motion vector difference of the current image block according to the motion vector difference of the current image block.
[0015] In combination with the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, N is 4.
[0016] In a third aspect, an embodiment of the present application provides an inter-frame prediction method, the method comprising: obtaining a motion vector prediction value of a current image block; obtaining an index value of a direction of a motion vector difference value of the current image block, the motion vector difference value of the current image block being used to indicate a difference between the motion vector prediction value and a motion vector target value of the current image block; determining target direction information from a candidate direction information set according to the index value of the direction, the candidate direction information set comprising candidate direction information of M motion vector differences, M being a positive integer greater than 4; obtaining a motion vector difference value of the current image block according to the target direction information; determining a motion vector target value of the current image block according to the motion vector difference value of the current image block and the motion vector prediction value of the current image block;
[0017] According to the motion vector target value of the current image block, a prediction block of the current image block is obtained.
[0018] In combination with the third aspect, in a first possible implementation manner of the third aspect, the method further includes: obtaining an index value of the length of the motion vector difference of the current image block; determining target length information from N candidate length information of the motion vector difference according to the index value of the length, where N is a positive integer greater than 1;
[0019] The obtaining the motion vector difference of the current image block according to the target direction information includes: determining the motion vector difference of the current image block according to the target direction information and the target length information.
[0020] In combination with the third aspect or the first possible implementation of the third aspect, in a second possible implementation of the third aspect, M is 8.
[0021] In combination with the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect,
[0022] The candidate direction information of the M motion vector differences includes at least one of the following:
[0023] When the index value of the direction is the first preset value, the direction indicated by the target direction information is due right;
[0024] When the index value of the direction is the second preset value, the direction indicated by the target direction information is due left;
[0025] When the index value of the direction is a third preset value, the direction indicated by the target direction information is directly downward;
[0026] When the index value of the direction is the fourth preset value, the direction indicated by the target direction information is directly upward;
[0027] When the index value of the direction is the fifth preset value, the direction indicated by the target direction information is the lower right;
[0028] When the index value of the direction is the sixth preset value, the direction indicated by the target direction information is the upper right;
[0029] When the index value of the direction is the seventh preset value, the direction indicated by the target direction information is the lower left;
[0030] When the index value of the direction is the eighth preset value, the direction indicated by the target direction information is the upper left.
[0031] In combination with the third aspect or any one of the above possible implementations of the third aspect, in a fourth possible implementation of the third aspect, obtaining the motion vector prediction value of the current image block includes: constructing a candidate motion information list of the current image block, the candidate motion information list may be composed of L motion vectors, where L is 1, 3, 4 or 5; obtaining the index value of the motion information prediction information of the current image block in the candidate motion information list, the motion information prediction information of the current image block including the motion vector prediction value; obtaining the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
[0032] In a fourth aspect, an embodiment of the present application provides an inter-frame prediction method, the method comprising: obtaining a motion vector prediction value of a current image block; performing a motion search in an area where a position indicated by the motion vector prediction value of the current image block is located to obtain a motion vector target value of the current image block; obtaining an index value of a direction of a motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block, the motion vector difference of the current image block being used to indicate the difference between the motion vector prediction value and the motion vector target value of the current image block, the index value of the direction of the motion vector difference of the current image block being used to indicate one candidate direction information in a preset candidate direction information set, the candidate direction information set comprising candidate length information of M motion vector differences, where M is a positive integer greater than 4.
[0033] In combination with the fourth aspect, in a first possible implementation of the fourth aspect, obtaining the index value of the length of the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block includes: obtaining the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block; and determining the index value of the length of the motion vector difference of the current image block and the direction index value of the motion vector difference of the current image block according to the motion vector difference of the current image block.
[0034] In combination with the fourth aspect or the first possible implementation of the fourth aspect, in a second possible implementation of the fourth aspect, M is 8.
[0035] In a fifth aspect, an embodiment of the present application provides an inter-frame prediction method, the method comprising: obtaining a first motion vector prediction value and a second motion vector prediction value of a current image block, the first motion vector prediction value corresponding to a first reference frame, and the second motion vector prediction value corresponding to a second reference frame; obtaining a first motion vector difference value of the current image block, the first motion vector difference value of the current image block being used to indicate the difference between the first motion vector prediction value and the first motion vector target value of the current image block, the first motion vector target value and the first motion vector prediction value corresponding to the same reference frame; determining a second motion vector difference value of the current image block based on the first motion vector difference value, the second motion vector difference value of the current image block being used to indicate the difference between the second motion vector prediction value and the second motion vector target value of the current image block, the second motion vector target value and the second motion vector prediction value corresponding to the same reference frame. A frame, wherein, when the direction of the first reference frame relative to the current frame where the current image block is located is the same as the direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or, when the direction of the first reference frame relative to the current frame where the current image block is located is opposite to the direction of the second reference frame relative to the current frame, the positive and negative signs of the second motion vector difference are opposite to those of the first motion vector difference, and the absolute value of the second motion vector difference is the same as the absolute value of the first motion vector difference; determining the first motion vector target value of the current image block according to the first motion vector difference and the first motion vector prediction value; determining the second motion vector target value of the current image block according to the second motion vector difference and the second motion vector prediction value; and obtaining the prediction block of the current image block according to the first motion vector target value and the second motion vector target value.
[0036] In a sixth aspect, an embodiment of the present application provides an inter-frame prediction device, the device comprising:
[0037] A prediction unit, used to obtain a motion vector prediction value of a current image block;
[0038] an acquisition unit, used to acquire an index value of a length of a motion vector difference value of the current image block, where the motion vector difference value of the current image block is used to indicate a difference between the motion vector prediction value and the motion vector target value of the current image block;
[0039] The prediction unit is also used to determine target length information from a candidate length information set according to an index value of the length, the candidate length information set only including candidate length information of N motion vector differences, N being a positive integer greater than 1 and less than 8; obtain the motion vector difference of the current image block according to the target length information; determine the motion vector target value of the current image block according to the motion vector difference of the current image block and the motion vector prediction value of the current image block; and obtain the prediction block of the current image block according to the motion vector target value of the current image block.
[0040] In combination with the sixth aspect, in a first possible implementation manner of the sixth aspect, the acquisition unit is further used to: acquire an index value of a direction of a motion vector difference value of the current image block;
[0041] The prediction unit is also used to: determine the target direction information from the candidate direction information of M motion vector differences according to the index value of the direction, where M is a positive integer greater than 1;
[0042] The prediction unit is used to determine the motion vector difference of the current image block according to the target direction information and the target length information.
[0043] In combination with the sixth aspect or the first possible implementation of the sixth aspect, in a second possible implementation of the sixth aspect, N is 4.
[0044] In combination with the second possible implementation manner of the sixth aspect, in a third possible implementation manner of the sixth aspect,
[0045] The candidate length information of the N motion vector differences may include at least one of the following: when the index value of the length is a first preset value, the length indicated by the target length information is a quarter of a pixel length; when the index value of the length is a second preset value, the length indicated by the target length information is a half of a pixel length; when the index value of the length is a third preset value, the length indicated by the target length information is a one pixel length; when the index value of the length is a fourth preset value, the length indicated by the target length information is a two pixel length.
[0046] In combination with the sixth aspect or any one of the above possible implementations of the sixth aspect, in a fourth possible implementation of the sixth aspect, the prediction unit is used to: construct a candidate motion information list for the current image block, the candidate motion information list may be composed of L motion vectors, where L is 1, 3, 4 or 5; obtain the index value of the motion information prediction information of the current image block in the candidate motion information list, the motion information prediction information of the current image block includes the motion vector prediction value; obtain the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
[0047] In a seventh aspect, an embodiment of the present application provides an inter-frame prediction device, the device comprising:
[0048] An acquisition unit, used to acquire a motion vector prediction value of a current image block;
[0049] A prediction unit, configured to perform a motion search in a region where a position indicated by a motion vector prediction value of the current image block is located, to obtain a motion vector target value of the current image block;
[0050] The prediction unit is also used to obtain an index value of the length of the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block, wherein the motion vector difference of the current image block is used to indicate the difference between the motion vector prediction value and the motion vector target value of the current image block, and the index value of the length of the motion vector difference of the current image block is used to indicate one candidate length information in a preset candidate length information set, wherein the candidate length information set only includes candidate length information of N motion vector differences, where N is a positive integer greater than 1 and less than 8.
[0051] In combination with the seventh aspect, in a first possible implementation of the seventh aspect, the prediction unit is used to: obtain the motion vector difference of the current image block based on the motion vector target value of the current image block and the motion vector prediction value of the current image block; and determine the index value of the length of the motion vector difference of the current image block and the direction index value of the motion vector difference of the current image block based on the motion vector difference of the current image block.
[0052] In combination with the seventh aspect or the first possible implementation of the seventh aspect, in a second possible implementation of the seventh aspect, N is 4.
[0053] In an eighth aspect, an embodiment of the present application provides an inter-frame prediction device, the device comprising:
[0054] A prediction unit, used to obtain a motion vector prediction value of a current image block;
[0055] an acquisition unit, used to acquire an index value of a direction of a motion vector difference value of the current image block, where the motion vector difference value of the current image block is used to indicate a difference between the motion vector prediction value and the motion vector target value of the current image block;
[0056] The prediction unit is also used to determine target direction information from a candidate direction information set according to an index value of the direction, the candidate direction information set including candidate direction information of M motion vector differences, where M is a positive integer greater than 4; obtain the motion vector difference of the current image block according to the target direction information; determine the motion vector target value of the current image block according to the motion vector difference of the current image block and the motion vector prediction value of the current image block; and obtain the prediction block of the current image block according to the motion vector target value of the current image block.
[0057] In combination with the eighth aspect, in a first possible implementation manner of the eighth aspect, the acquisition unit is further used to: acquire an index value of the length of the motion vector difference of the current image block;
[0058] The prediction unit is further used to determine the target length information from the candidate length information of N motion vector difference values according to the index value of the length, where N is a positive integer greater than 1;
[0059] The prediction unit is used to determine the motion vector difference of the current image block according to the target direction information and the target length information.
[0060] In combination with the eighth aspect or the first possible implementation of the eighth aspect, in a second possible implementation of the eighth aspect, M is 8.
[0061] In combination with the second possible implementation manner of the eighth aspect, in a third possible implementation manner of the eighth aspect,
[0062] The candidate direction information of the M motion vector differences may include at least one of the following:
[0063] When the index value of the direction is the first preset value, the direction indicated by the target direction information is due right;
[0064] When the index value of the direction is the second preset value, the direction indicated by the target direction information is due left;
[0065] When the index value of the direction is a third preset value, the direction indicated by the target direction information is directly downward;
[0066] When the index value of the direction is the fourth preset value, the direction indicated by the target direction information is directly upward;
[0067] When the index value of the direction is the fifth preset value, the direction indicated by the target direction information is the lower right;
[0068] When the index value of the direction is the sixth preset value, the direction indicated by the target direction information is the upper right;
[0069] When the index value of the direction is the seventh preset value, the direction indicated by the target direction information is the lower left;
[0070] When the index value of the direction is the eighth preset value, the direction indicated by the target direction information is the upper left.
[0071] In combination with the eighth aspect or any one of the above possible implementations of the eighth aspect, in a fourth possible implementation of the eighth aspect, the prediction unit is used to: construct a candidate motion information list for the current image block, the candidate motion information list consisting of L motion vectors, where L is 1, 3, 4 or 5; obtain the index value of the motion information prediction information of the current image block in the candidate motion information list, the motion information prediction information of the current image block including the motion vector prediction value; obtain the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
[0072] In a ninth aspect, an embodiment of the present application provides an inter-frame prediction device, the device comprising:
[0073] An acquisition unit, used to acquire a motion vector prediction value of a current image block;
[0074] A prediction unit, configured to perform a motion search in a region where a position indicated by a motion vector prediction value of the current image block is located, to obtain a motion vector target value of the current image block;
[0075] The prediction unit is further used to obtain an index value of the direction of the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block, wherein the motion vector difference of the current image block is used to indicate the difference between the motion vector prediction value and the motion vector target value of the current image block, and the index value of the direction of the motion vector difference of the current image block is used to indicate one candidate direction information in a preset candidate direction information set, wherein the candidate direction information set includes candidate length information of M motion vector differences, where M is a positive integer greater than 4.
[0076] In combination with the ninth aspect, in a first possible implementation of the ninth aspect, the prediction unit is used to: obtain a motion vector difference value of the current image block based on a motion vector target value of the current image block and a motion vector prediction value of the current image block; and determine an index value of a length of the motion vector difference value of the current image block and a direction index value of the motion vector difference value of the current image block based on the motion vector difference value of the current image block.
[0077] In combination with the ninth aspect or the first possible implementation of the ninth aspect, in a second possible implementation of the ninth aspect, M is 8.
[0078] In a tenth aspect, an embodiment of the present application provides an inter-frame prediction device, the device comprising:
[0079] An acquisition unit, configured to acquire a first motion vector prediction value and a second motion vector prediction value of a current image block, wherein the first motion vector prediction value corresponds to a first reference frame, and the second motion vector prediction value corresponds to a second reference frame;
[0080] The acquisition unit is further used to acquire a first motion vector difference value of the current image block, where the first motion vector difference value of the current image block is used to indicate a difference between the first motion vector prediction value and the first motion vector target value of the current image block, where the first motion vector target value and the first motion vector prediction value correspond to the same reference frame;
[0081] A prediction unit is configured to determine a second motion vector difference of the current image block according to the first motion vector difference, wherein the second motion vector difference of the current image block is used to indicate a difference between the second motion vector prediction value and the second motion vector target value of the current image block, and the second motion vector target value and the second motion vector prediction value correspond to the same reference frame, wherein when the direction of the first reference frame relative to the current frame where the current image block is located is the same as the direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or, when the direction of the first reference frame relative to the current frame where the current image block is located is the same as the direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; When the direction of the current frame of the second reference frame is opposite to the direction of the second reference frame relative to the current frame, the positive and negative signs of the second motion vector difference are opposite to those of the first motion vector difference, and the absolute value of the second motion vector difference is the same as the absolute value of the first motion vector difference; determine the first motion vector target value of the current image block according to the first motion vector difference and the first motion vector prediction value; determine the second motion vector target value of the current image block according to the second motion vector difference and the second motion vector prediction value; and obtain the prediction block of the current image block according to the first motion vector target value and the second motion vector target value.
[0082] In an eleventh aspect, an embodiment of the present application provides a video decoder, the video decoder being used to decode an image block from a bit stream, comprising:
[0083] The inter-frame prediction device in the first aspect or any possible implementation manner of the first aspect, the inter-frame prediction device is used to obtain a prediction block of the current image block;
[0084] The reconstruction module is used to reconstruct the current image block based on the prediction block.
[0085] In a twelfth aspect, an embodiment of the present application provides a video encoder, which is used to encode an image block, including:
[0086] The inter-frame prediction device in the second aspect or any possible implementation manner of the second aspect, wherein the inter-frame prediction device is used to obtain an index value of the length of the motion vector difference of the current image block based on the motion vector prediction value of the current image block, and the index value of the length of the motion vector difference of the current image block is used to indicate one candidate length information in a preset candidate length information set;
[0087] The entropy coding module is used to encode the index value of the length of the motion vector difference of the current image block into the bit stream.
[0088] In a thirteenth aspect, an embodiment of the present application provides a video decoder, the video decoder is used to decode an image block from a bit stream, including:
[0089] The inter-frame prediction device in the third aspect or any possible implementation manner of the third aspect, the inter-frame prediction device is used to obtain a prediction block of the current image block;
[0090] The reconstruction module is used to reconstruct the current image block based on the prediction block.
[0091] In a fourteenth aspect, an embodiment of the present application provides a video encoder, the video encoder being used to encode an image block, including:
[0092] The inter-frame prediction device in the fourth aspect or any possible implementation manner of the fourth aspect, wherein the inter-frame prediction device is used to obtain an index value of a direction of a motion vector difference value of the current image block based on a motion vector prediction value of the current image block, and the index value of the length of the motion vector difference value of the current image block is used to indicate one candidate direction information in a preset candidate direction information set;
[0093] The entropy coding module is used to encode the index value of the direction of the motion vector difference of the current image block into the bit stream.
[0094] In a fifteenth aspect, an embodiment of the present application provides a device for decoding video data, the device comprising:
[0095] A memory, used for storing video data in the form of code stream;
[0096] A video decoder provided in the eleventh aspect, or the thirteenth aspect, or the fifteenth aspect, or any one of the embodiments of the eleventh aspect, the thirteenth aspect and the fifteenth aspect.
[0097] In a sixteenth aspect, an embodiment of the present application provides a device for encoding video data, the device comprising:
[0098] A memory, used to store video data, the video data including one or more image blocks;
[0099] A video encoder is provided in the twelfth aspect, or the fourteenth aspect, or any one of the embodiments of the twelfth aspect and the fourteenth aspect.
[0100] In the seventeenth aspect, an embodiment of the present application provides a coding device, comprising: a non-volatile memory and a processor coupled to each other, the processor calling the program code stored in the memory to execute part or all of the steps of the method in the second aspect, or the fourth aspect, or any one of the implementations of the second and fourth aspects.
[0101] In the eighteenth aspect, an embodiment of the present application provides a decoding device, comprising: a non-volatile memory and a processor coupled to each other, the processor calling the program code stored in the memory to execute part or all of the steps of the method in the first aspect, or the third aspect, or the fifth aspect, or any one of the implementations of the first aspect, the third aspect and the fifth aspect.
[0102] In the nineteenth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a program code, wherein the program code includes instructions for executing part or all of the steps of the method in any one of the embodiments of the first to fifth aspects, or the first to fifth aspects.
[0103] In the twentieth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute part or all of the steps of the method in any one of the embodiments of the first to fifth aspects, or the first to fifth aspects.
[0104] It should be understood that the second to twentieth aspects of the present application are consistent with the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0105] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0106] Figure 1A is a block diagram of an example of a video encoding and decoding system 10 for implementing an embodiment of the present invention;
[0107] Figure 1B is a block diagram of an example of a video decoding system 40 for implementing an embodiment of the present invention;
[0108] Figure 2 is a block diagram of an example structure of an encoder 20 for implementing an embodiment of the present invention;
[0109] Figure 3is a block diagram of an example structure of a decoder 30 for implementing an embodiment of the present invention;
[0110] Figure 4 is a block diagram of an example of a video decoding device 400 for implementing an embodiment of the present invention;
[0111] Figure 5 is a block diagram of another example of an encoding device or a decoding device for implementing an embodiment of the present invention;
[0112] Figure 6 is an example block diagram of a spatial domain neighboring block and a temporal domain neighboring block for implementing an embodiment of the present invention;
[0113] Figure 7 It is a flowchart for implementing an inter-frame prediction method provided by an embodiment of the present invention;
[0114] Figure 8 It is a flowchart for implementing an inter-frame prediction method provided by an embodiment of the present invention;
[0115] Fig. 9 It is a flowchart for implementing an inter-frame prediction method provided by an embodiment of the present invention;
[0116] Fig.10 It is a flowchart for implementing an inter-frame prediction method provided by an embodiment of the present invention;
[0117] Fig.11 It is a flowchart for implementing an inter-frame prediction method provided by an embodiment of the present invention;
[0118] Fig.12 is a schematic block diagram of an inter-frame prediction device provided by an embodiment of the present invention;
[0119] Fig.13 is a schematic block diagram of an inter-frame prediction device provided by an embodiment of the present invention;
[0120] Fig.14 is a schematic block diagram of an inter-frame prediction device provided by an embodiment of the present invention;
[0121] Fig.15 is a schematic block diagram of an inter-frame prediction device provided by an embodiment of the present invention;
[0122] Fig.16 It is a schematic block diagram of an inter-frame prediction device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0123] The embodiments of the present invention are described below in conjunction with the drawings in the embodiments of the present invention. In the following description, reference is made to the drawings that form part of the present disclosure and show specific aspects of the embodiments of the present invention or specific aspects of the embodiments of the present invention in an illustrative manner. It should be understood that the embodiments of the present invention can be used in other aspects and may include structural or logical changes not depicted in the drawings. Therefore, the following detailed description should not be understood in a restrictive sense, and the scope of the present invention is defined by the appended claims. For example, it should be understood that the disclosure in conjunction with the described method can also be applied to the corresponding device or system for performing the method, and vice versa. For example, if one or more specific method steps are described, the corresponding device may include one or more units such as functional units to perform the one or more method steps described (for example, one unit performs one or more steps, or multiple units, each of which performs one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the drawings. On the other hand, for example, if a specific device is described based on one or more units such as functional units, the corresponding method may include a step to perform the functionality of one or more units (for example, one step performs the functionality of one or more units, or multiple steps, each of which performs the functionality of one or more units in multiple units), even if such one or more steps are not explicitly described or illustrated in the drawings. Further, it should be understood that, unless explicitly stated otherwise, features of the various exemplary embodiments and / or aspects described herein may be combined with each other.
[0124] The technical solutions involved in the embodiments of the present invention may not only be applied to existing video coding standards (such as H.264, HEVC and other standards), but may also be applied to future video coding standards (such as H.266 standards). The terms used in the implementation methods of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention. The following is a brief introduction to some concepts that may be involved in the embodiments of the present invention.
[0125] Video coding generally refers to processing a sequence of pictures that form a video or video sequence. In the field of video coding, the terms "picture", "frame" or "image" can be used as synonyms. Video coding used in this article means video encoding or video decoding. Video encoding is performed on the source side and generally includes processing (e.g., by compression) the original video picture to reduce the amount of data required to represent the video picture, thereby more efficiently storing and / or transmitting. Video decoding is performed on the destination side and generally includes inverse processing relative to the encoder to reconstruct the video picture. The "encoding" of video pictures involved in the embodiments should be understood as involving "encoding" or "decoding" of video sequences. The combination of the encoding part and the decoding part is also referred to as codec (encoding and decoding).
[0126] A video sequence includes a series of pictures, which are further divided into slices, and slices are further divided into blocks. Video coding is performed in blocks. In some new video coding standards, the concept of blocks is further expanded. For example, in the H.264 standard, there are macroblocks (MB), which can be further divided into multiple prediction blocks (partitions) that can be used for predictive coding. In the high-performance video coding (HEVC) standard, basic concepts such as coding units (CU), prediction units (PU) and transform units (TU) are used to functionally divide various block units and describe them using a new tree-based structure. For example, CU can be divided into smaller CUs according to a quadtree, and smaller CUs can be further divided to form a quadtree structure. CU is the basic unit for dividing and encoding coded images. There are similar tree structures for PU and TU. PU can correspond to prediction blocks and is the basic unit of predictive coding. CU is further divided into multiple PUs according to the division mode. TU may correspond to a transform block, which is a basic unit for transforming a prediction residual. However, no matter CU, PU or TU, they all belong to the concept of a block (or image block) in essence.
[0127] For example, in HEVC, a CTU is split into multiple CUs using a quadtree structure represented as a coding tree. A decision is made at the CU level whether to use inter-picture (temporal) or intra-picture (spatial) prediction to encode a picture area. Each CU can be further split into one, two or four PUs according to the PU split type. The same prediction process is applied within a PU, and relevant information is transmitted to the decoder on a PU basis. After obtaining the residual block by applying the prediction process based on the PU split type, the CU can be split into transform units (TUs) according to other quadtree structures similar to the coding tree for the CU. In the latest developments in video compression technology, a quadtree plus a multi-type tree is used to split the CTU to obtain a CU, and the multi-type tree includes a binary tree and a ternary tree. In this partition structure, the CU can be square or rectangular in shape.
[0128] In this article, for the convenience of description and understanding, the image block to be encoded in the current encoded image may be referred to as the current block. For example, in encoding, it refers to the block currently being encoded; in decoding, it refers to the block currently being decoded. The decoded image block in the reference image used to predict the current block is referred to as a reference block, that is, the reference block is a block that provides a reference signal for the current block, wherein the reference signal represents the pixel value in the image block. The block in the reference image that provides a prediction signal for the current block may be referred to as a prediction block, wherein the prediction signal represents the pixel value or sampling value or sampling signal in the prediction block. For example, after traversing multiple reference blocks, the best reference block is found, and this best reference block will provide a prediction for the current block, and this block is referred to as a prediction block. The current block may also be referred to as the current image block.
[0129] In the case of lossless video coding, the original video picture can be reconstructed, that is, the reconstructed video picture has the same quality as the original video picture (assuming no transmission loss or other data loss during storage or transmission). In the case of lossy video coding, further compression is performed by, for example, quantization to reduce the amount of data required to represent the video picture, but the decoder side cannot fully reconstruct the video picture, that is, the quality of the reconstructed video picture is lower or worse than the quality of the original video picture.
[0130] Several video coding standards of H.261 belong to the category of "lossy hybrid video codecs" (i.e., combining spatial and temporal prediction in the sample domain with 2D transform coding in the transform domain for applying quantization). Each picture of a video sequence is usually divided into a set of non-overlapping blocks, which are usually encoded at the block level. In other words, the encoder side usually processes, i.e., encodes, the video at the block (video block) level, for example, by generating a prediction block through spatial (intra-picture) prediction and temporal (inter-picture) prediction, subtracting the prediction block from the current block (currently processed or to be processed) to obtain a residual block, transforming the residual block in the transform domain and quantizing the residual block to reduce the amount of data to be transmitted (compressed), while the decoder side applies the inverse processing part relative to the encoder to the coded or compressed block to reconstruct the current block for representation. In addition, the encoder replicates the decoder processing cycle, so that the encoder and decoder generate the same prediction (e.g., intra-frame prediction and inter-frame prediction) and / or reconstruction for processing, i.e., encoding subsequent blocks.
[0131] The following describes the system architecture used in the embodiments of the present invention. Figure 1A , Figure 1A A schematic block diagram of a video encoding and decoding system 10 used in an embodiment of the present invention is exemplarily given. Figure 1AAs shown, the video encoding and decoding system 10 may include a source device 12 and a destination device 14, the source device 12 generating encoded video data, and therefore, the source device 12 may be referred to as a video encoding device. The destination device 14 may decode the encoded video data generated by the source device 12, and therefore, the destination device 14 may be referred to as a video decoding device. Various implementations of the source device 12, the destination device 14, or both may include one or more processors and a memory coupled to the one or more processors. The memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other media that can be used to store the desired program code in the form of instructions or data structures that can be accessed by a computer, as described herein. The source device 12 and the destination device 14 may include various devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, wireless communication devices, or the like.
[0132] Although Figure 1A The source device 12 and the destination device 14 are depicted as separate devices, but device embodiments may also include both the source device 12 and the destination device 14 or the functionality of both, i.e., the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality. In such embodiments, the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.
[0133] The source device 12 and the destination device 14 may be communicatively connected via a link 13, and the destination device 14 may receive the encoded video data from the source device 12 via the link 13. The link 13 may include one or more media or devices capable of moving the encoded video data from the source device 12 to the destination device 14. In one example, the link 13 may include one or more communication media that enable the source device 12 to transmit the encoded video data directly to the destination device 14 in real time. In this example, the source device 12 may modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol), and may transmit the modulated video data to the destination device 14. The one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from the source device 12 to the destination device 14.
[0134] The source device 12 includes an encoder 20. Optionally, the source device 12 may also include a picture source 16, a picture preprocessor 18, and a communication interface 22. In a specific implementation, the encoder 20, the picture source 16, the picture preprocessor 18, and the communication interface 22 may be hardware components in the source device 12, or may be software programs in the source device 12. They are described as follows:
[0135] The picture source 16 may include or may be any type of picture capture device, for example, for capturing real-world pictures, and / or any type of pictures or comments (for screen content encoding, some text on the screen is also considered to be part of the picture or image to be encoded) generating device, for example, a computer graphics processor for generating computer animation pictures, or any type of device for acquiring and / or providing real-world pictures, computer animation pictures (e.g., screen content, virtual reality (VR) pictures), and / or any combination thereof (e.g., augmented reality (AR) pictures). The picture source 16 may be a camera for capturing pictures or a memory for storing pictures, and the picture source 16 may also include any type of (internal or external) interface for storing previously captured or generated pictures and / or acquiring or receiving pictures. When the picture source 16 is a camera, the picture source 16 may be, for example, a local or integrated camera integrated in the source device; when the picture source 16 is a memory, the picture source 16 may be, for example, a local or integrated memory integrated in the source device. When the picture source 16 includes an interface, the interface may be, for example, an external interface for receiving pictures from an external video source, such as an external picture capture device, such as a camera, an external memory, or an external picture generating device, such as an external computer graphics processor, a computer, or a server. The interface may be any type of interface according to any proprietary or standardized interface protocol, such as a wired or wireless interface, an optical interface.
[0136] Among them, the picture can be regarded as a two-dimensional array or matrix of pixels (picture element). The pixels in the array can also be called sampling points. The number of sampling points in the array or picture in the horizontal and vertical directions (or axes) defines the size and / or resolution of the picture. In order to represent the color, three color components are usually used, that is, the picture can be represented as or include three sampling arrays. For example, in the RBG format or color space, the picture includes corresponding red, green and blue sampling arrays. However, in video coding, each pixel is usually represented in a brightness / chroma format or color space, such as for a picture in the YUV format, including a brightness component indicated by Y (sometimes also indicated by L) and two chroma components indicated by U and V. The brightness (luma) component Y represents the brightness or grayscale level intensity (for example, the two are the same in a grayscale picture), and the two chroma (chroma) components U and V represent the chroma or color information components. Accordingly, the picture in the YUV format includes a brightness sampling array of brightness sampling values (Y), and two chroma sampling arrays of chroma values (U and V). An image in RGB format can be converted or transformed into YUV format, and vice versa, which is also called color conversion or transformation. If the image is black and white, the image may only include a brightness sampling array. In an embodiment of the present invention, the image transmitted from the image source 16 to the image processor may also be referred to as raw image data 17.
[0137] The image preprocessor 18 is used to receive the original image data 17 and perform preprocessing on the original image data 17 to obtain a preprocessed image 19 or preprocessed image data 19. For example, the preprocessing performed by the image preprocessor 18 may include refurbishment, color format conversion (e.g., from RGB format to YUV format), color adjustment, or denoising.
[0138] The encoder 20 (or video encoder 20) is used to receive the pre-processed picture data 19, and process the pre-processed picture data 19 using a relevant prediction mode (such as the prediction mode in each embodiment of this invention), so as to provide encoded picture data 21 (hereinafter further based on Figure 2 or Figure 4 or Figure 5 ). In some embodiments, the encoder 20 may be used to execute various embodiments described below to implement the chroma block prediction method described in the present invention on the encoding side.
[0139] The communication interface 22 can be used to receive the encoded picture data 21 and transmit the encoded picture data 21 to the destination device 14 or any other device (such as a memory) through the link 13 for storage or direct reconstruction. The other device can be any device for decoding or storage. The communication interface 22 can, for example, be used to encapsulate the encoded picture data 21 into a suitable format, such as a data packet, for transmission on the link 13.
[0140] The destination device 14 includes a decoder 30. Optionally, the destination device 14 may also include a communication interface 28, a picture post-processor 32, and a display device 34. They are described as follows:
[0141] The communication interface 28 can be used to receive the encoded picture data 21 from the source device 12 or any other source, such as a storage device, such as an encoded picture data storage device. The communication interface 28 can be used to transmit or receive the encoded picture data 21 via the link 13 between the source device 12 and the destination device 14 or via any type of network, such as a direct wired or wireless connection, any type of network, such as a wired or wireless network or any combination thereof, or any type of private network and public network, or any combination thereof. The communication interface 28 can be used, for example, to decapsulate the data packet transmitted by the communication interface 22 to obtain the encoded picture data 21.
[0142] Both communication interface 28 and communication interface 22 may be configured as unidirectional communication interfaces or bidirectional communication interfaces and may be used, for example, to send and receive messages to establish connections, confirm and exchange any other information related to communication links and / or data transmissions such as encoded picture data transmissions.
[0143] The decoder 30 (or decoder 30) is configured to receive the encoded picture data 21 and provide decoded picture data 31 or decoded picture 31 (hereinafter further described based on Figure 3 or Figure 4 or Figure 5 ). In some embodiments, the decoder 30 may be used to execute various embodiments described below to implement the chrominance block prediction method described in the present invention on the decoding side.
[0144] The picture post-processor 32 is used to perform post-processing on the decoded picture data 31 (also called reconstructed picture data) to obtain post-processed picture data 33. The post-processing performed by the picture post-processor 32 may include: color format conversion (for example, from YUV format to RGB format), color adjustment, repair or resampling, or any other processing, and can also be used to transmit the post-processed picture data 33 to the display device 34.
[0145] A display device 34 is provided for receiving the post-processed picture data 33 to display the picture to, for example, a user or viewer. The display device 34 may be or may include any type of display for presenting the reconstructed picture, such as an integrated or external display or monitor. For example, the display may include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro-LED display, a liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display.
[0146] Although, Figure 1A The source device 12 and the destination device 14 are depicted as separate devices, but device embodiments may also include both the source device 12 and the destination device 14 or the functionality of both, i.e., the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality. In such embodiments, the source device 12 or the corresponding functionality and the destination device 14 or the corresponding functionality may be implemented using the same hardware and / or software, or using separate hardware and / or software, or any combination thereof.
[0147] It is obvious to a person skilled in the art based on the description that the functionality or Figure 1A The presence and (exact) division of the functionality of the source device 12 and / or destination device 14 shown may vary depending on the actual device and application. The source device 12 and the destination device 14 may include any of a variety of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, a mobile phone, a smart phone, a tablet or tablet computer, a video camera, a desktop computer, a set-top box, a television, a camera, a car device, a display device, a digital media player, a video game console, a video streaming device (such as a content service server or a content distribution server), a broadcast receiver device, a broadcast transmitter device, etc., and may not use or use any type of operating system.
[0148] Both the encoder 20 and the decoder 30 may be implemented as any of a variety of suitable circuits, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the technology is partially implemented in software, the device may store the instructions of the software in a suitable non-transitory computer-readable storage medium, and may use one or more processors to execute the instructions in hardware to perform the technology of the present disclosure. Any of the foregoing (including hardware, software, a combination of hardware and software, etc.) may be considered one or more processors.
[0149] In some cases, Figure 1A The video encoding and decoding system 10 shown in is only an example, and the technology of the present application can be applied to video encoding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between encoding and decoding devices. In other examples, data can be retrieved from local storage, streamed over a network, etc. A video encoding device can encode data and store the data in a memory, and / or a video decoding device can retrieve data from a memory and decode the data. In some examples, encoding and decoding are performed by devices that do not communicate with each other but only encode data to a memory and / or retrieve data from a memory and decode data.
[0150] See also Figure 1B , Figure 1B According to an exemplary embodiment, Figure 2 The encoder 20 and / or Figure 3 30. The video decoding system 40 may implement a combination of various techniques of the embodiments of the present invention. In the illustrated embodiment, the video decoding system 40 may include an imaging device 41, an encoder 20, a decoder 30 (and / or a video codec implemented by logic circuits 47 of a processing unit 46), an antenna 42, one or more processors 43, one or more memories 44, and / or a display device 45.
[0151] like Figure 1B As shown, imaging device 41, antenna 42, processing unit 46, logic circuit 47, encoder 20, decoder 30, processor 43, memory 44 and / or display device 45 can communicate with each other. As discussed, although video decoding system 40 is illustrated with encoder 20 and decoder 30, in different examples, video decoding system 40 may include only encoder 20 or only decoder 30.
[0152] In some examples, antenna 42 can be used to transmit or receive a coded bit stream of video data. In addition, in some examples, display device 45 can be used to present video data. In some examples, logic circuit 47 can be implemented by processing unit 46. Processing unit 46 can include application-specific integrated circuit (ASIC) logic, graphics processor, general processor, etc. Video decoding system 40 can also include optional processor 43, which can similarly include application-specific integrated circuit (ASIC) logic, graphics processor, general processor, etc. In some examples, logic circuit 47 can be implemented by hardware, such as video encoding dedicated hardware, etc., and processor 43 can be implemented by general software, operating system, etc. In addition, memory 44 can be any type of memory, such as volatile memory (e.g., static random access memory (SRAM), dynamic random access memory (DRAM), etc.) or non-volatile memory (e.g., flash memory, etc.). In a non-limiting example, memory 44 can be implemented by cache memory. In some examples, logic circuitry 47 may access memory 44 (eg, for implementing an image buffer). In other examples, logic circuitry 47 and / or processing unit 46 may include memory (eg, cache, etc.) for implementing an image buffer, etc.
[0153] In some examples, encoder 20 implemented by logic circuits may include an image buffer (e.g., implemented by processing unit 46 or memory 44) and a graphics processing unit (e.g., implemented by processing unit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include encoder 20 implemented by logic circuits 47 to implement reference Figure 2 The various modules discussed in connection with the encoder and / or any other encoder system or subsystem described herein. Logic circuits may be used to perform the various operations discussed herein.
[0154] In some examples, decoder 30 may be implemented in a similar manner by logic circuit 47 to implement reference Figure 3The decoder 30 and / or any other decoder system or subsystem described herein may include various modules discussed above. In some examples, the decoder 30 implemented by logic circuits may include an image buffer (implemented by processing unit 2820 or memory 44) and a graphics processing unit (implemented, for example, by processing unit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include the decoder 30 implemented by logic circuits 47 to implement the reference Figure 3 and / or the various modules discussed above for any other decoder system or subsystem described herein.
[0155] In some examples, antenna 42 may be used to receive an encoded bitstream of video data. As discussed, the encoded bitstream may include data related to the encoded video frames, indicators, index values, mode selection data, etc. discussed herein, such as data related to the encoded partitions (e.g., transform coefficients or quantized transform coefficients, (as discussed) optional indicators, and / or data defining the encoded partitions). Video decoding system 40 may also include decoder 30 coupled to antenna 42 and used to decode the encoded bitstream. Display device 45 is used to present the video frames.
[0156] It should be understood that for the examples described with reference to encoder 20 in the embodiments of the present invention, decoder 30 can be used to perform the reverse process. With respect to signaling syntax elements, decoder 30 can be used to receive and parse such syntax elements and decode the associated video data accordingly. In some examples, encoder 20 can entropy encode the syntax elements into an encoded video bitstream. In such examples, decoder 30 can parse such syntax elements and decode the associated video data accordingly.
[0157] It should be noted that the inter-frame prediction method described in the embodiment of the present invention is mainly used for the inter-frame prediction process, which exists in both the encoder 20 and the decoder 30. The encoder 20 and the decoder 30 in the embodiment of the present invention can be, for example, video standard protocols such as H.263, H.264, HEVV, MPEG-2, MPEG-4, VP8, VP9, or encoders / decoders corresponding to the next-generation video standard protocols (such as H.266, etc.).
[0158] See also Figure 2 , Figure 2 A schematic / conceptual block diagram of an example of an encoder 20 for implementing an embodiment of the present invention is shown. Figure 2In the example of , the encoder 20 includes a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a buffer 216, a loop filter unit 220, a decoded picture buffer (DPB) 230, a prediction processing unit 260, and an entropy encoding unit 270. The prediction processing unit 260 may include an inter-prediction unit 244, an intra-prediction unit 254, and a mode selection unit 262. The inter-prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). Figure 2 The illustrated encoder 20 may also be referred to as a hybrid video encoder or a video encoder according to a hybrid video codec.
[0159] For example, the residual calculation unit 204, the transform processing unit 206, the quantization unit 208, the prediction processing unit 260, and the entropy coding unit 270 form a forward signal path of the encoder 20, while for example, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the decoded picture buffer (DPB) 230, and the prediction processing unit 260 form a backward signal path of the encoder, wherein the backward signal path of the encoder corresponds to the signal path of the decoder (see Figure 3 Decoder 30 in ).
[0160] The encoder 20 receives a picture 201 or an image block 203 of the picture 201, e.g., a picture in a sequence of pictures forming a video or a video sequence, via, e.g., an input 202. The image block 203 may also be referred to as a current picture block or a picture block to be encoded, and the picture 201 may be referred to as a current picture or a picture to be encoded (particularly when the current picture is distinguished from other pictures in video coding, e.g., previously encoded and / or decoded pictures in the same video sequence, i.e., a video sequence that also includes the current picture).
[0161] An embodiment of the encoder 20 may include a segmentation unit ( Figure 2 201 into a plurality of blocks, such as image blocks 203, usually into a plurality of non-overlapping blocks. The segmentation unit may be used to use the same block size for all pictures in the video sequence and define a corresponding grid of block sizes, or to change the block size between pictures or subsets or groups of pictures, and to segment each picture into corresponding blocks.
[0162] In one example, prediction processing unit 260 of encoder 20 may be used to perform any combination of the above-described partitioning techniques.
[0163] Like the picture 201, the image block 203 is also or can be regarded as a two-dimensional array or matrix of sampling points with sample values, although its size is smaller than that of the picture 201. In other words, the image block 203 may include, for example, one sampling array (e.g., a luminance array in the case of the black and white picture 201) or three sampling arrays (e.g., one luminance array and two chrominance arrays in the case of a color picture) or any other number and / or type of arrays depending on the color format applied. The number of sampling points in the horizontal and vertical directions (or axes) of the image block 203 defines the size of the image block 203.
[0164] like Figure 2 The encoder 20 shown is used to encode the picture 201 block by block, for example, encoding and prediction are performed on each image block 203.
[0165] The residual calculation unit 204 is used to calculate the residual block 205 based on the picture image block 203 and the prediction block 265 (other details of the prediction block 265 are provided below), for example, by subtracting the sample value of the prediction block 265 from the sample value of the picture image block 203 sample by sample (pixel by pixel) to obtain the residual block 205 in the sample domain.
[0166] The transform processing unit 206 is used to apply a transform such as discrete cosine transform (DCT) or discrete sine transform (DST) on the sample values of the residual block 205 to obtain a transform coefficient 207 in the transform domain. The transform coefficient 207 can also be called a transform residual coefficient and represents the residual block 205 in the transform domain.
[0167] The transform processing unit 206 can be used to apply an integer approximation of the DCT / DST, such as the transform specified for HEVC / H.265. Compared to the orthogonal DCT transform, this integer approximation is usually scaled by a certain factor. In order to maintain the norm of the residual block processed by the forward transform and the inverse transform, an additional scaling factor is applied as part of the transform process. The scaling factor is usually selected based on certain constraints, such as the scaling factor is a power of 2 for the shift operation, the bit depth of the transform coefficients, the trade-off between accuracy and implementation cost, etc. For example, a specific scaling factor is specified for the inverse transform on the decoder 30 side by, for example, the inverse transform processing unit 212 (and for the corresponding inverse transform on the encoder 20 side by, for example, the inverse transform processing unit 212), and accordingly, a corresponding scaling factor can be specified for the forward transform on the encoder 20 side by the transform processing unit 206.
[0168] The quantization unit 208 is used to quantize the transform coefficients 207, for example, by applying scalar quantization or vector quantization to obtain quantized transform coefficients 209. The quantized transform coefficients 209 may also be referred to as quantized residual coefficients 209. The quantization process may reduce the bit depth associated with some or all of the transform coefficients 207. For example, an n-bit transform coefficient may be rounded down to an m-bit transform coefficient during quantization, where n is greater than m. The degree of quantization may be modified by adjusting a quantization parameter (QP). For example, for scalar quantization, different scales may be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to finer quantization, while a larger quantization step size corresponds to coarser quantization. A suitable quantization step size may be indicated by a quantization parameter (QP). For example, the quantization parameter may be an index to a predefined set of suitable quantization step sizes. For example, a smaller quantization parameter may correspond to fine quantization (a smaller quantization step size), a larger quantization parameter may correspond to coarse quantization (a larger quantization step size), and vice versa. Quantization may include division by a quantization step size and corresponding quantization or inverse quantization, for example, performed by inverse quantization 210, or may include multiplication by a quantization step size. Embodiments according to some standards such as HEVC may use a quantization parameter to determine the quantization step size. In general, the quantization step size may be calculated based on the quantization parameter using a fixed-point approximation of an equation containing division. Additional scaling factors may be introduced for quantization and inverse quantization to recover the norm of the residual block that may be modified due to the scale used in the fixed-point approximation of the equation for the quantization step size and the quantization parameter. In an example embodiment, the scales of the inverse transform and inverse quantization may be merged. Alternatively, a custom quantization table may be used and sent from an encoder to a decoder through a signal, for example in a bitstream. Quantization is a lossy operation, where the larger the quantization step size, the greater the loss.
[0169] The inverse quantization unit 210 is used to apply the inverse quantization of the quantization unit 208 on the quantized coefficients to obtain inverse quantized coefficients 211, for example, applying an inverse quantization scheme of the quantization scheme applied by the quantization unit 208 based on or using the same quantization step size as the quantization unit 208. The inverse quantized coefficients 211 may also be referred to as inverse quantized residual coefficients 211, corresponding to the transform coefficients 207, although the loss due to quantization is generally different from that of the transform coefficients.
[0170] The inverse transform processing unit 212 is used to apply the inverse transform of the transform applied by the transform processing unit 206, such as an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST), to obtain an inverse transform block 213 in the sample domain. The inverse transform block 213 may also be referred to as an inverse transform dequantized block 213 or an inverse transform residual block 213.
[0171] The reconstruction unit 214 (e.g., the summer 214) is used to add the inverse transform block 213 (i.e., the reconstructed residual block 213) to the prediction block 265 to obtain the reconstructed block 215 in the sample domain, for example, by adding the sample values of the reconstructed residual block 213 to the sample values of the prediction block 265.
[0172] Optionally, a buffer unit 216 (or simply "buffer" 216), such as a line buffer 216, is used to buffer or store the reconstructed blocks 215 and corresponding sample values for, for example, intra-frame prediction. In other embodiments, the encoder can be used to use the unfiltered reconstructed blocks and / or corresponding sample values stored in the buffer unit 216 for any type of estimation and / or prediction, such as intra-frame prediction.
[0173] For example, embodiments of the encoder 20 may be configured such that the buffer unit 216 is used not only to store the reconstructed blocks 215 used for the intra prediction 254, but also for the loop filter unit 220 (in Figure 2 ), and / or, for example, such that the buffer unit 216 and the decoded picture buffer unit 230 form a buffer. Other embodiments may be used to store the filtered block 221 and / or the blocks or samples ( Figure 2 (not shown) is used as input or basis for intra-frame prediction 254.
[0174] The loop filter unit 220 (or simply "loop filter" 220) is used to filter the reconstructed block 215 to obtain a filtered block 221, so as to smoothly perform pixel conversion or improve video quality. The loop filter unit 220 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an adaptive loop filter (ALF), or a sharpening or smoothing filter, or a collaborative filter. Although the loop filter unit 220 is in Figure 2 2 is shown as an in-loop filter, but in other configurations, the loop filter unit 220 may be implemented as a post-loop filter. The filtered block 221 may also be referred to as a filtered reconstructed block 221. The decoded picture buffer 230 may store the reconstructed coding block after the loop filter unit 220 performs a filtering operation on the reconstructed coding block.
[0175] Embodiments of the encoder 20 (correspondingly, the loop filter unit 220) can be used to output loop filter parameters (e.g., sample adaptive offset information), for example, directly or after entropy encoding by the entropy encoding unit 270 or any other entropy encoding unit, such that the decoder 30 can receive and apply the same loop filter parameters for decoding.
[0176] The decoded picture buffer (DPB) 230 may be a reference picture memory for storing reference picture data for use by the encoder 20 in encoding video data. The DPB 230 may be formed by any of a variety of memory devices, such as a dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM)) or other types of memory devices. The DPB 230 and the buffer 216 may be provided by the same memory device or separate memory devices. In one example, the decoded picture buffer (DPB) 230 is used to store the filtered block 221. The decoded picture buffer 230 may further be used to store other previously filtered blocks of the same current picture or a different picture, such as a previously reconstructed picture, such as the previously reconstructed and filtered block 221, and may provide a complete previously reconstructed, i.e., decoded picture (and corresponding reference blocks and samples) and / or a portion of the reconstructed current picture (and corresponding reference blocks and samples), such as for inter-frame prediction. In one example, if the reconstructed block 215 is reconstructed without in-loop filtering, the decoded picture buffer (DPB) 230 is used to store the reconstructed block 215.
[0177] The prediction processing unit 260, also referred to as the block prediction processing unit 260, is used to receive or obtain an image block 203 (a current image block 203 of a current picture 201) and reconstructed picture data, such as reference samples of the same (current) picture from a buffer 216 and / or reference picture data 231 of one or more previously decoded pictures from a decoded picture buffer 230, and to process such data for prediction, i.e. to provide a prediction block 265 which may be an inter-prediction block 245 or an intra-prediction block 255.
[0178] The mode selection unit 262 may be used to select a prediction mode (eg, intra or inter prediction mode) and / or a corresponding prediction block 245 or 255 for use as a prediction block 265 to calculate the residual block 205 and reconstruct the reconstructed block 215 .
[0179] Embodiments of the mode selection unit 262 may be configured to select a prediction mode (e.g., from those prediction modes supported by the prediction processing unit 260) that provides the best match or minimum residual (minimum residual means better compression in transmission or storage), or provides minimum signaling overhead (minimum signaling overhead means better compression in transmission or storage), or considers or balances both. The mode selection unit 262 may be configured to determine the prediction mode based on rate distortion optimization (RDO), i.e., select a prediction mode that provides minimum rate distortion, or select a prediction mode whose associated rate distortion at least satisfies a prediction mode selection criterion.
[0180] The prediction processing performed by an example of encoder 20 (eg, by prediction processing unit 260) and the mode selection performed (eg, by mode selection unit 262) will be explained in detail below.
[0181] As described above, the encoder 20 is configured to determine or select the best or optimal prediction mode from a (predetermined) prediction mode set. The prediction mode set may include, for example, an intra prediction mode and / or an inter prediction mode.
[0182] The intra-frame prediction mode set may include 35 different intra-frame prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in H.265, or may include 67 different intra-frame prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in H.266 under development.
[0183] In a possible implementation, the inter-prediction mode set depends on the available reference picture (i.e., at least part of the decoded picture stored in the DBP 230 as described above) and other inter-prediction parameters, such as whether to use the entire reference picture or only a part of the reference picture, such as a search window area around the area of the current block, to search for the best matching reference block, and / or, for example, whether to apply pixel interpolation such as half-pixel and / or quarter-pixel interpolation. The inter-prediction mode set may include, for example, an Advanced Motion Vector Prediction (AMVP) mode and a merge mode. In a specific implementation, the inter-prediction mode set may include an improved control point-based AMVP mode according to an embodiment of the present invention, and an improved control point-based merge mode. In one example, the intra-prediction unit 254 may be used to perform any combination of the inter-prediction techniques described below.
[0184] In addition to the above prediction modes, embodiments of the present invention may also apply skip mode and / or direct mode.
[0185] The prediction processing unit 260 can be further used to partition the image block 203 into smaller block partitions or sub-blocks, for example, by iteratively using quad-tree (QT) partitioning, binary-tree (BT) partitioning or triple-tree (TT) partitioning, or any combination thereof, and for performing prediction for each of the block partitions or sub-blocks, for example, wherein the mode selection includes selecting a tree structure of the partitioned image block 203 and selecting a prediction mode to be applied to each of the block partitions or sub-blocks.
[0186] The inter-frame prediction unit 244 may include a motion estimation (ME) unit ( Figure 2 ) and a motion compensation (MC) unit ( Figure 2 ). The motion estimation unit is used to receive or obtain the image block 203 (the current image block 203 of the current image 201) and the decoded image 231, or at least one or more previously reconstructed blocks, for example, reconstructed blocks of one or more other / different previously decoded images 231, to perform motion estimation. For example, a video sequence may include the current picture and the previously decoded picture 31, or in other words, the current picture and the previously decoded picture 31 may be part of a picture sequence forming the video sequence, or form the picture sequence.
[0187] For example, the motion estimation unit ( Figure 2(not shown) can be used to select a reference block from multiple reference blocks of the same or different pictures in multiple other pictures and send it to the motion compensation unit ( Figure 2 (not shown) provides a reference picture and / or provides a motion vector (the offset (spatial offset) between the position (X, Y coordinates) of the reference block and the position of the current block) as an inter-frame prediction parameter. The offset is also called a motion vector (MV).
[0188] The motion compensation unit is used to obtain inter-frame prediction parameters, and perform inter-frame prediction based on or using the inter-frame prediction parameters to obtain the inter-frame prediction block 245. Figure 2 Motion compensation performed by the motion compensation unit 246 (not shown) may include fetching or generating a prediction block based on a motion / block vector determined by motion estimation (possibly performing interpolation to sub-pixel accuracy). Interpolation filtering may produce additional pixel samples from known pixel samples, thereby potentially increasing the number of candidate prediction blocks that may be used to encode the picture block. Upon receiving the motion vector for the PU of the current picture block, the motion compensation unit 246 may locate the prediction block to which the motion vector points in a reference picture list. The motion compensation unit 246 may also generate syntax elements associated with blocks and video slices for use by the decoder 30 when decoding picture blocks of the video slice.
[0189] Specifically, the inter-frame prediction unit 244 may transmit a syntax element to the entropy coding unit 270, and the syntax element includes an inter-frame prediction parameter (such as an indication of an inter-frame prediction mode selected for current block prediction after traversing multiple inter-frame prediction modes, or at least one of an index value of the length of the motion vector difference of the current image block and an index value of the direction of the motion vector difference of the current image block). In a possible application scenario, if there is only one inter-frame prediction mode, the inter-frame prediction parameter may not be carried in the syntax element, and the decoding end 30 may directly use the default prediction mode for decoding. It can be understood that the inter-frame prediction unit 244 can be used to perform any combination of inter-frame prediction techniques.
[0190] The intra prediction unit 254 is used to obtain, for example, receive a picture block 203 (current picture block) of the same picture and one or more previously reconstructed blocks, for example, reconstructed adjacent blocks, for intra estimation. For example, the encoder 20 can be used to select an intra prediction mode from a plurality of (predetermined) intra prediction modes.
[0191] Embodiments of the encoder 20 may be configured to select an intra prediction mode based on an optimization criterion, such as minimum residual (eg, the intra prediction mode that provides a prediction block 255 most similar to the current picture block 203) or minimum rate distortion.
[0192] The intra prediction unit 254 is further configured to determine an intra prediction block 255 based on the intra prediction parameters of the selected intra prediction mode. In any case, after selecting the intra prediction mode for the block, the intra prediction unit 254 is further configured to provide the intra prediction parameters, i.e., provide information indicating the selected intra prediction mode for the block, to the entropy encoding unit 270. In one example, the intra prediction unit 254 can be configured to perform any combination of intra prediction techniques.
[0193] Specifically, the intra prediction unit 254 may transmit a syntax element to the entropy coding unit 270, the syntax element including intra prediction parameters (such as indication information of selecting an intra prediction mode for current block prediction after traversing multiple intra prediction modes). In a possible application scenario, if there is only one intra prediction mode, the intra prediction parameters may not be carried in the syntax element, and the decoding end 30 may directly use the default prediction mode for decoding.
[0194] The entropy coding unit 270 is used to apply an entropy coding algorithm or scheme (e.g., a variable length coding (VLC) scheme, a context adaptive VLC (CAVLC) scheme, an arithmetic coding scheme, a context adaptive binary arithmetic coding (CABAC), a syntax-based context-adaptive binary arithmetic coding (SBAC), a probability interval partitioning entropy (PIPE) coding, or other entropy coding methods or techniques) to a single or all (or none) of the quantized residual coefficients 209, inter-frame prediction parameters, intra-frame prediction parameters, and / or loop filter parameters to obtain the encoded picture data 21 that can be output through the output 272 in the form of, for example, an encoded bitstream 21. The encoded bitstream can be transmitted to the video decoder 30, or archived for later transmission or retrieval by the video decoder 30. The entropy coding unit 270 can also be used to entropy encode other syntax elements of the current video slice being encoded.
[0195] Other structural variations of the video encoder 20 may be used to encode the video stream. For example, a non-transform based encoder 20 may directly quantize the residual signal without a transform processing unit 206 for certain blocks or frames. In another embodiment, the encoder 20 may have a quantization unit 208 and an inverse quantization unit 210 combined into a single unit.
[0196] Specifically, in the embodiment of the present invention, the encoder 20 may be used to implement the inter-frame prediction method described in the following embodiments.
[0197] It should be understood that other structural changes of the video encoder 20 can be used to encode the video stream. For example, for some image blocks or image frames, the video encoder 20 can directly quantize the residual signal without processing by the transform processing unit 206, and accordingly, it does not need to be processed by the inverse transform processing unit 212; or, for some image blocks or image frames, the video encoder 20 does not generate residual data, and accordingly, it does not need to be processed by the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210 and the inverse transform processing unit 212; or, the video encoder 20 can directly store the reconstructed image block as a reference block without being processed by the filter 220; or, the quantization unit 208 and the inverse quantization unit 210 in the video encoder 20 can be combined together. The loop filter 220 is optional, and in the case of lossless compression encoding, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210 and the inverse transform processing unit 212 are optional. It should be understood that, according to different application scenarios, the inter-frame prediction unit 244 and the intra-frame prediction unit 254 may be selectively enabled.
[0198] See also Figure 3 , Figure 3 A schematic / conceptual block diagram of an example of a decoder 30 for implementing an embodiment of the present invention is shown. The video decoder 30 is used to receive encoded picture data (e.g., an encoded bitstream) 21, such as encoded by the encoder 20, to obtain a decoded picture 231. During the decoding process, the video decoder 30 receives video data from the video encoder 20, such as an encoded video bitstream representing picture blocks of an encoded video slice and associated syntax elements.
[0199] exist Figure 3 In the example of , decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (e.g., summer 314), a buffer 316, a loop filter 320, a decoded picture buffer 330, and a prediction processing unit 360. Prediction processing unit 360 may include an inter-prediction unit 344, an intra-prediction unit 354, and a mode selection unit 362. In some examples, video decoder 30 may perform substantially the same as reference. Figure 2 The encoding pass described by video encoder 20 is the inverse of the decoding pass.
[0200] The entropy decoding unit 304 is used to perform entropy decoding on the encoded picture data 21 to obtain, for example, quantized coefficients 309 and / or decoded encoding parameters ( Figure 3The entropy decoding unit 304 is further configured to forward the inter-prediction parameters, intra-prediction parameters, and / or other syntax elements to the prediction processing unit 360. The video decoder 30 may receive syntax elements at the video slice level and / or the video block level.
[0201] The inverse quantization unit 310 may be functionally the same as the inverse quantization unit 110, the inverse transform processing unit 312 may be functionally the same as the inverse transform processing unit 212, the reconstruction unit 314 may be functionally the same as the reconstruction unit 214, the buffer 316 may be functionally the same as the buffer 216, the loop filter 320 may be functionally the same as the loop filter 220, and the decoded picture buffer 330 may be functionally the same as the decoded picture buffer 230.
[0202] The prediction processing unit 360 may include an inter-frame prediction unit 344 and an intra-frame prediction unit 354, wherein the inter-frame prediction unit 344 may be functionally similar to the inter-frame prediction unit 244, and the intra-frame prediction unit 354 may be functionally similar to the intra-frame prediction unit 254. The prediction processing unit 360 is generally used to perform block prediction and / or obtain a prediction block 365 from the encoded data 21, and receive or obtain prediction-related parameters (for example, at least one of an index value of the length of the motion vector difference value of the current image block and an index value of the direction of the motion vector difference value of the current image block) and / or information about the selected prediction mode from, for example, the entropy decoding unit 304 (explicitly or implicitly).
[0203] When the video slice is encoded as an intra-coded (I) slice, the intra-prediction unit 354 of the prediction processing unit 360 is used to generate a prediction block 365 for a picture block of the current video slice based on the signaled intra-prediction mode and data from a previously decoded block of the current frame or picture. When the video frame is encoded as an inter-coded (i.e., B or P) slice, the inter-prediction unit 344 (e.g., a motion compensation unit) of the prediction processing unit 360 is used to generate a prediction block 365 for the video block of the current video slice based on the motion vector and other syntax elements received from the entropy decoding unit 304 (e.g., at least one of an index value of a length of a motion vector difference value of the current image block and an index value of a direction of a motion vector difference value of the current image block). For inter-prediction, the prediction block may be generated from one of the reference pictures in one of the reference picture lists. The video decoder 30 may construct the reference frame lists: List 0 and List 1 using a default construction technique based on the reference pictures stored in the DPB 330.
[0204] The prediction processing unit 360 is configured to determine prediction information for a video block of a current video slice by parsing motion vectors and / or other syntax elements, and use the prediction information to generate a prediction block for the current video block being decoded. In one example of the present invention, the prediction processing unit 360 uses some of the received syntax elements to determine a prediction mode (e.g., intra-frame or inter-frame prediction) for encoding a video block of a video slice, an inter-frame prediction slice type (e.g., B slice, P slice, or GPB slice), construction information of one or more of the reference picture lists for the slice, a motion vector for each inter-frame coded video block of the slice, an inter-frame prediction state of each inter-frame coded video block of the slice, a difference of the motion vector of the current picture block, and other information to decode the video block of the current video slice. In another example of the present disclosure, the syntax elements received by the video decoder 30 from the bitstream include receiving syntax elements in one or more of an adaptive parameter set (APS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.
[0205] Inverse quantization unit 310 may be used to inverse quantize (i.e., dequantize) quantized transform coefficients provided in the bitstream and decoded by entropy decoding unit 304. The inverse quantization process may include using quantization parameters calculated by video encoder 20 for each video block in a video slice to determine a degree of quantization that should be applied and likewise a degree of inverse quantization that should be applied.
[0206] The inverse transform processing unit 312 is used to apply an inverse transform (eg, an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients to generate a residual block in the pixel domain.
[0207] The reconstruction unit 314 (e.g., the summer 314) is used to add the inverse transform block 313 (i.e., the reconstructed residual block 313) to the prediction block 365 to obtain the reconstructed block 315 in the sample domain, for example, by adding the sample values of the reconstructed residual block 313 to the sample values of the prediction block 365.
[0208] The loop filter unit 320 is used to filter the reconstructed block 315 (during or after the encoding cycle) to obtain a filtered block 321, thereby smoothing pixel conversion or improving video quality. In one example, the loop filter unit 320 can be used to perform any combination of the filtering techniques described below. The loop filter unit 320 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an adaptive loop filter (ALF), or a sharpening or smoothing filter, or a collaborative filter. Although the loop filter unit 320 is in Figure 3 3. Although shown as an in-loop filter in FIG. 3, in other configurations, the loop filter unit 320 may be implemented as a post-loop filter.
[0209] The decoded video blocks 321 in a given frame or picture are then stored in a decoded picture buffer 330 which stores reference pictures for subsequent motion compensation.
[0210] Decoder 30 is operable to output decoded picture 31 , eg, via output 332 , for presentation to or viewing by a user.
[0211] Other variations of the video decoder 30 may be used to decode the compressed bitstream. For example, the decoder 30 may generate an output video stream without the loop filter unit 320. For example, a non-transform based decoder 30 may directly inverse quantize the residual signal without the inverse transform processing unit 312 for certain blocks or frames. In another embodiment, the video decoder 30 may have the inverse quantization unit 310 and the inverse transform processing unit 312 combined into a single unit.
[0212] Specifically, in the embodiment of the present invention, the decoder 30 is used to implement the inter-frame prediction method described in the following embodiments.
[0213] It should be understood that other structural changes of the video decoder 30 can be used to decode the encoded video bitstream. For example, the video decoder 30 can generate an output video stream without being processed by the filter 320; or, for some image blocks or image frames, the entropy decoding unit 304 of the video decoder 30 does not decode the quantized coefficients, and accordingly does not need to be processed by the inverse quantization unit 310 and the inverse transform processing unit 312. The loop filter 320 is optional; and for lossless compression, the inverse quantization unit 310 and the inverse transform processing unit 312 are optional. It should be understood that, according to different application scenarios, the inter-frame prediction unit and the intra-frame prediction unit can be selectively enabled.
[0214] It should be understood that in the encoder 20 and decoder 30 of the present application, the processing result of a certain link can be output to the next link after further processing. For example, after the interpolation filtering, motion vector derivation or loop filtering links, the processing results of the corresponding links can be further subjected to operations such as Clip or shift.
[0215] For example, the motion vector of the control point of the current image block derived from the motion vector of the adjacent affine coding block, or the motion vector of the sub-block of the current image block derived, can be further processed, and this application does not limit this. For example, the value range of the motion vector is constrained so that it is within a certain bit width. Assuming that the bit width of the allowed motion vector is bitDepth, the range of the motion vector is -2^(bitDepth-1)~2^(bitDepth-1)-1, where the "^" symbol represents the power. If bitDepth is 16, the value range is -32768~32767. If bitDepth is 18, the value range is -131072~131071. For another example, the value of the motion vector (for example, the motion vector MV of four 4x4 sub-blocks in an 8x8 image block) is constrained so that the maximum difference between the integer parts of the four 4x4 sub-block MVs does not exceed N pixels, for example, not more than one pixel.
[0216] It can be constrained in the following two ways to keep it within a certain bit width:
[0217] Method 1: remove the high bits of motion vector overflow:
[0218] ux=(vx+2 bitDepth )%2 bitDepth
[0219] vx=(ux>=2 bitDepth-1 )? (ux-2 bitDepth ):ux
[0220] uy=(vy+2 bitDepth )%2 bitDepth
[0221] vy=(uy>=2 bitDepth-1 )? (uy-2 bitDepth ):uy
[0222] Among them, vx is the horizontal component of the motion vector of the image block or a sub-block of the image block, vy is the vertical component of the motion vector of the image block or a sub-block of the image block, ux and uy are intermediate values; bitDepth represents the bit width.
[0223] For example, if the value of vx is -32769, the value obtained by the above formula is 32767. Because in computers, values are stored in binary complement form, the binary complement of -32769 is 1,0111,1111,1111,1111 (17 bits), and the computer handles overflow by discarding the high bits, so the value of vx is 0111,1111,1111,1111, which is 32767, which is consistent with the result obtained by the formula.
[0224] Method 2: Clipping the motion vector, as shown in the following formula:
[0225] vx=Clip3(-2 bitDepth-1 ,2 bitDepth-1 -1,vx)
[0226] vy=Clip3(-2 bitDepth-1 ,2 bitDepth-1 -1,vy)
[0227] Where vx is the horizontal component of the motion vector of the image block or a sub-block of the image block, and vy is the vertical component of the motion vector of the image block or a sub-block of the image block; where x, y, and z correspond to the three input values of the MV clamping process Clip3, and the definition of Clip3 is to clamp the value of z to the interval [x, y]:
[0228]
[0229] See also Figure 4 , Figure 4 FIG. 4 is a schematic diagram of the structure of a video decoding device 400 (eg, a video encoding device 400 or a video decoding device 400) provided in an embodiment of the present invention. The video decoding device 400 is suitable for implementing the embodiments described herein. In one embodiment, the video decoding device 400 may be a video decoder (eg, Figure 1A decoder 30) or a video encoder (e.g. Figure 1A In another embodiment, the video decoding device 400 may be the above-mentioned Figure 1A Decoder 30 or Figure 1A One or more components in encoder 20.
[0230] The video decoding device 400 includes: an inlet port 410 and a receiving unit (Rx) 420 for receiving data, a processor, a logic unit or a central processing unit (CPU) 430 for processing data, a transmitter unit (Tx) 440 and an outlet port 450 for transmitting data, and a memory 460 for storing data. The video decoding device 400 may also include an optical-to-electrical conversion component and an electro-optical (EO) component coupled to the inlet port 410, the receiver unit 420, the transmitter unit 440 and the outlet port 450 for the outlet or inlet of an optical signal or an electrical signal.
[0231] The processor 430 is implemented by hardware and software. The processor 430 can be implemented as one or more CPU chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. The processor 430 communicates with the inlet port 410, the receiver unit 420, the transmitter unit 440, the outlet port 450, and the memory 460. The processor 430 includes a decoding module 470 (e.g., an encoding module 470 or a decoding module 470). The encoding / decoding module 470 implements the embodiments disclosed herein to implement the chrominance block prediction method provided by the embodiments of the present invention. For example, the encoding / decoding module 470 implements, processes, or provides various encoding operations. Therefore, the encoding / decoding module 470 provides substantial improvements to the functions of the video decoding device 400 and affects the conversion of the video decoding device 400 to different states. Alternatively, the encoding / decoding module 470 is implemented by instructions stored in the memory 460 and executed by the processor 430.
[0232] The memory 460 includes one or more disks, tape drives, and solid-state drives, and can be used as an overflow data storage device for storing programs when these programs are selectively executed, and for storing instructions and data read during program execution. The memory 460 can be volatile and / or non-volatile, and can be a read-only memory (ROM), a random access memory (RAM), a ternary content-addressable memory (TCAM), and / or a static random access memory (SRAM).
[0233] See also Figure 5 , Figure 5 According to an exemplary embodiment, it can be used as Figure 1A 1 and 14. The device 500 is a simplified block diagram of an apparatus 500 for either or both of the source device 12 and the destination device 14. The apparatus 500 can implement the techniques of the present application. In other words, Figure 5The present invention is a schematic block diagram of an implementation method of an encoding device or decoding device (hereinafter referred to as a decoding device 500) of an embodiment of the present application. The decoding device 500 may include a processor 510, a memory 530 and a bus system 550. The processor and the memory are connected via a bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory. The memory of the decoding device stores program code, and the processor can call the program code stored in the memory to execute various video encoding or decoding methods described in the present application, especially various new inter-frame prediction methods. To avoid repetition, it will not be described in detail here.
[0234] In the embodiment of the present application, the processor 510 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0235] The memory 530 may include a read-only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may also be used as the memory 530. The memory 530 may include code and data 531 accessed by the processor 510 using the bus 550. The memory 530 may further include an operating system 533 and an application 535, which includes at least one program that allows the processor 510 to perform the video encoding or decoding method described in the present application (especially the inter-frame prediction method described in the present application). For example, the application 535 may include applications 1 to N, which further include a video encoding or decoding application (referred to as a video decoding application) that executes the video encoding or decoding method described in the present application.
[0236] The bus system 550 may include, in addition to the data bus, a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as the bus system 550 in the figure.
[0237] Optionally, the decoding device 500 may further include one or more output devices, such as a display 570. In one example, the display 570 may be a touch-sensitive display that combines a display with a touch-sensitive unit operable to sense touch input. The display 570 may be connected to the processor 510 via the bus 550.
[0238] The scheme of the embodiment of the present application is described in detail below:
[0239] The inter-frame prediction unit 244, or the inter-frame prediction unit 344, or the encoder 20, or the decoder 30, or the video decoding device 400, or the decoding device 500 implements the inter-frame prediction in the video encoding or decoding method, including the determination of motion information. Specifically, the determination of motion information can be performed by the motion estimation unit, wherein the motion information can include: at least one of reference image information and motion vector information. The reference image information can include at least one of: unidirectional / bidirectional prediction information (bidirectional prediction means that two reference blocks are required to determine the prediction block of the current image block. In the bidirectional prediction, two sets of motion information are required, which are used to determine the two reference blocks respectively), reference image list information, and the reference image index corresponding to the reference image list. The motion vector information can include a motion vector, which refers to the position offset in the horizontal and vertical directions. The motion vector information can also include a motion vector difference (MVD). The determination of the motion information and the further determination of the prediction block can include one of the following modes:
[0240] AMVP mode: The encoder first constructs a candidate motion vector list through the motion vectors of the current block's spatial or temporal neighboring blocks (such as but not limited to the encoded blocks), and then determines the motion vector from the candidate motion vector list as the motion vector predictor (MVP) of the current block by calculating the rate distortion. The encoder passes the index value of the selected motion vector predictor in the candidate motion vector list and the reference frame (reference frame can also be called reference image) index value to the decoder. Furthermore, a motion search is performed in the neighborhood centered on the MVP to obtain a better motion vector (also called motion vector target value) for the current block, and the encoder passes the difference (Motion vector difference) between the MVP and the better motion vector to the decoder. The decoding end first constructs a candidate motion vector list through the motion vectors of the current block's spatial or temporal neighboring blocks (such as but not limited to decoded blocks), and then obtains the motion vector prediction value based on the index value of the obtained motion vector prediction value in the candidate motion vector list and the candidate motion vector list, and then obtains the better motion vector based on the difference between the obtained MVP and the better motion vector, and then obtains the prediction block of the current block based on the better motion vector and the reference frame obtained according to the reference frame index value. It should be noted that when the number of candidates in the candidate motion vector list is 1, the index value of the selected motion vector prediction value in the candidate motion vector list may not be transmitted.
[0241] The encoding end may be the source device 12, or the video decoding system 40, or the encoder 20, or the video decoding device 400, or the decoding device 500. The decoding end may be the destination device 14, or the video decoding system 40, or the decoder 30, or the video decoding device 400, or the decoding device 500. The index value of the motion vector prediction value in the candidate motion vector list and the reference frame (the reference frame may also be referred to as a reference image) index value may be the syntax elements used for transmission as described above.
[0242] Merge mode: The encoder first constructs a candidate motion information list through the motion information of the current block's spatial or temporal neighboring blocks (such as but not limited to the encoded blocks), and then determines the optimal motion information from the candidate motion information list as the motion information of the current block by calculating the bit rate distortion, and then passes the index value of the position of the optimal motion information in the candidate motion information list (also called the motion information of the current block or the motion information prediction information of the current block) in the candidate motion information list (referred to as merge index, the same below) to the decoder. The spatial and temporal candidate motion information of the current block is as follows: Figure 6 As shown, the spatial candidate motion information comes from five spatially adjacent blocks (A0, A1, B0, B1 and B2). If the adjacent block is not available or is in intra-frame coding mode, it will not be added to the candidate motion information list. The temporal candidate motion information of the current block is obtained by scaling the MV of the corresponding position block in the reference frame according to the picture order count (POC) of the reference frame and the current frame. First, it is determined whether the block at position T0 in the reference frame is available. If not, the block at position T1 is selected. The decoder first constructs a candidate motion information list through the motion information of the spatial or temporal adjacent blocks of the current block (for example, but not limited to decoded blocks), where the motion information in the motion information list includes a motion vector and a reference frame index value. The decoder then obtains the optimal motion information based on the candidate motion information list and the index value of the position of the optimal motion information in the candidate motion information list, and obtains the prediction block of the current block based on the optimal motion information. It should be noted that when the number of candidate items in the candidate motion information list is 1, the index value of the position of the optimal motion information in the candidate motion information list may not be transmitted.
[0243] It should be noted that the candidate motion information list used in the embodiment of the present invention is not limited to being constructed by the motion information of the spatial or temporal neighboring blocks of the current block, and can be constructed or modified by at least one of the following: motion information of spatial neighboring blocks, motion information of temporal neighboring blocks, pairwise average merging candidates, history-based merging candidates and zero motion vector merging candidates. The specific construction process can refer to JVET-L1001-v6. However, the embodiment of the present invention is not limited to this.
[0244] Merge mode with motion vector difference (MMVD) mode: This mode adds the transmission of MVD on the basis of Merge mode. Specifically, the encoder will further perform motion search in the neighborhood centered on the best motion information in the candidate motion information list to obtain a better motion vector (also called a motion vector target value) of the current block, and the encoder will pass the difference (Motion vector difference) between the motion vector included in the best motion information in the candidate motion information list and the better motion vector to the decoder. After obtaining the best motion information, the decoder will further obtain a better motion vector based on the above difference and the motion vector included in the best motion information in the candidate motion information list, and then obtain the prediction block of the current block based on the reference frame indicated by the reference frame index value included in the better motion vector and the best motion information in the candidate motion information list.
[0245] It should be noted that the MMVD mode can also be based on the skip mode with the transmission of MVD added. Compared with the Merge mode, the skip mode can be understood as not transmitting the residual information between the prediction block of the current block and the original block of the current block. Similarly, based on the skip mode, the encoder will further perform motion search in the neighborhood centered on the optimal motion information in the candidate motion information list to obtain a better motion vector for the current block, and the encoder will pass the difference (Mot ion vector difference) between the motion vector included in the optimal motion information in the candidate motion information list and the better motion vector to the decoder. After obtaining the optimal motion information, the decoder will further obtain a better motion vector based on the above difference and the motion vector included in the optimal motion information in the candidate motion information list, and then obtain the prediction block of the current block based on the reference frame indicated by the reference frame index value included in the better motion vector and the optimal motion information in the candidate motion information list. For the description of the skip mode, reference can be made to the existing H.266 draft document (workingdraft, such as JVET-L1001-v6), which will not be repeated here.
[0246] MMVD utilizes the Merge candidates in VVC. One or more candidates are selected from the merge candidates, and then the MV is extended based on the candidates. The MV extension expression is achieved through a simplified identification method, which includes the MV starting point, motion step and motion direction. Using the existing Merge candidate list, the selected candidate can be the MRG_TYPE_DEFAULT_N mode. The selected candidate determines the initial position of the MV. Base candidate IDX (Table 1) indicates which candidate in the candidate list is selected as the best candidate.
[0247] Table 1. Base candidate IDX
[0248] Base candidate IDX 0 1 2 3 <![CDATA[N th MVP]]> <![CDATA[1 st MVP]]> <![CDATA[2 nd MVP]]> <![CDATA[3 rd MVP]]> <![CDATA[4 th MVP]]>
[0249] Wherein, Base candidate IDX is the index value of the position of the best motion information in the candidate motion information list in the candidate motion information list. Nth MVP indicates that the Nth item in the candidate motion information list is the MVP.
[0250] When transmitting MVD, the transmission object can be the offset value itself, such as x, y, or the length of MVD and the direction of MVD, or the index value of MVD length (indicating the distance from 1 / 4 pixel to 32 pixel) and the index value of MVD direction (up, down, left, and right).
[0251] The index value of the MVD length is used to indicate the length of the MVD. The corresponding relationship between the index value of the MVD length (Distance IDX) and the length of the MVD (Pixel distance) may be preset, and the corresponding relationship may be as shown in Table 2:
[0252] Table 2
[0253] Distance IDX 0 1 2 3 4 5 6 7 Pixel distance 1 / 4-pel 1 / 2-pel 1-pel 2-pel 4-pel 8-pel 16-pel 32-pel
[0254] The index value of the MVD direction is used to indicate the direction of the MVD. The correspondence between the index value of the MVD direction (Direction IDX) and the direction of the MVD (x-axis, y-axis) may be preset, and the correspondence may be as shown in Table 3:
[0255] Table 3
[0256] Direction IDX 0 1 2 3 x-axis + – N / A N / A y-axis N / A N / A + –
[0257] In Table 3, if the y-axis is N / A, it may indicate that the direction of the MVD is independent of the y-axis direction, and if the x-axis is N / A, it may indicate that the direction of the MVD is independent of the x-axis direction.
[0258] Among them, during the decoding process, the parsing of the MMVD flag (mmvd_flag, used to indicate whether the current block is decoded using the MMVD mode) is located after the Skip flag (cu_skip_flag, used to indicate whether the current block is decoded using the skip mode) or the Merge flag (merge_flag, used to indicate whether the current block is decoded using the merge mode). If the skip flag or the merge flag is true, the MMVD flag needs to be parsed. If the MMVD flag is true, the other flags corresponding to the MMVD need to be encoded and decoded.
[0259] Further, in a scenario of bidirectional inter-frame prediction (or bidirectional prediction), the decoding end or the encoding end may decode or encode only the MVD information in one direction, and the MVD information in the other direction may be obtained through the MVD information in the one direction. The specific process may be as follows:
[0260] 1) Determine whether the reference frame corresponding to the MVD in one direction is in the same direction or in the opposite direction as the reference frame corresponding to the MVD in the other direction. Specifically, the judgment can be made through the POC value of the frame where the current block is located and the POC values of the reference frames in the two directions. For example, if the first difference obtained by subtracting the POC value of the reference frame in one direction from the POC value of the frame where the current block is located has the same positive and negative signs as the second difference obtained by subtracting the POC value of the reference frame in the other direction from the POC value of the frame where the current block is located, then the direction of the reference frame corresponding to the MVD in one direction is in the same direction as the direction of the reference frame corresponding to the MVD in the other direction. Conversely, if the first difference obtained by subtracting the POC value of the reference frame in one direction from the POC value of the frame where the current block is located has the opposite positive and negative signs as the second difference obtained by subtracting the POC value of the reference frame in the other direction from the POC value of the frame where the current block is located, then the direction of the reference frame corresponding to the MVD in one direction is in the opposite direction as the direction of the reference frame corresponding to the MVD in the other direction.
[0261] It should be noted that the direction of the reference frame can be the direction of the reference frame relative to the current frame (the frame where the current block is located), or the direction of the current frame relative to the reference frame. In the specific implementation process of determining whether the same direction or reverse direction is the same, it can be determined not only by subtracting the POC value of the reference frame from the POC value of the current frame, but also by subtracting the POC value of the reference frame from the POC value of the current frame.
[0262] 2) When the reference frame corresponding to the MVD in one direction and the reference frame corresponding to the MVD in another direction are in the same direction, the MVD in the other direction has the same sign as the MVD in the one direction. For example, if the MVD in one direction is (x, y), then the MVD in the other direction is (x, y). Specifically, the MVD in one direction can be obtained by the index value of the MVD length in one direction and the index value of the MVD direction in one direction. Or,
[0263] When the reference frame corresponding to the MVD in one direction is opposite to the reference frame corresponding to the MVD in another direction, the MVD in the other direction has an opposite sign to the MVD in the one direction. For example, if the MVD in one direction is (x, y), then the MVD in the other direction is (-x, -y).
[0264] 3) According to the MVD in one direction, the first POC difference and the second POC difference are used to scale the MVD in another direction to obtain a better MVD in another direction. The first POC difference is the difference between the POC value of the frame where the current block is located and the POC value of the reference frame corresponding to the MVD in one direction, and the second POC difference is the difference between the POC value of the frame where the current block is located and the POC value of the reference frame corresponding to the MVD in the other direction. For a detailed description of the scaling method, please refer to the existing H.266 working draft document (such as JVET-L1001-v6), which will not be repeated here.
[0265] The above MVD solution has further room for optimization, for example, the index value of the longer pixel distance is rarely used, the index of the direction of the MVD can only indicate 4 directions, and in the specific implementation process, step 3) (scaling the MVD in another direction according to the MVD in one direction, the first POC difference and the second POC difference) is too complicated. Therefore, the embodiment of the present invention provides a series of improvement solutions.
[0266] Figure 7 A flowchart of an inter-frame prediction method provided by an embodiment of the present invention. The method may be performed by the destination device 14, or the video decoding system 40, or the decoder 30, or the video decoding device 400, or the decoding device 500, or specifically by the video decoder 30, or specifically by the entropy decoding unit 304 and the prediction processing unit 360 (or, for example, the inter-frame prediction unit 344 in the prediction processing unit 360). The method may include:
[0267] S701, obtaining a motion vector prediction value of a current image block.
[0268] In a specific implementation process, the acquisition of the motion vector prediction value of the current image block may include: constructing a candidate motion information list of the current image block, the candidate motion information list may be composed of L motion vectors, where L is 1, 3, 4 or 5; acquiring the index value of the motion information prediction information of the current image block in the candidate motion information list, the motion information prediction information of the current image block includes the motion vector prediction value; obtaining the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list. Among them, the candidate motion information list of the current image block may be a Merge candidate motion information list, and accordingly, the inter-frame prediction method provided in the embodiment of the present invention may be applied to the MMVD mode.
[0269] The index value in the candidate motion information list may be an index value in a variable length coding form, for example, when L is 3, 1 may be used to indicate the first item in the candidate motion information list, 01 may be used to indicate the second item in the candidate motion information list, and 00 may be used to indicate the third item in the candidate motion information list. Alternatively, when L is 4, 1 may be used to indicate the first item in the candidate motion information list, 01 may be used to indicate the second item in the candidate motion information list, 001 may be used to indicate the third item in the candidate motion information list, 000 may be used to indicate the fourth item in the candidate motion information list, and so on.
[0270] The above method of obtaining the motion vector prediction value by constructing a candidate motion information list of the current image block can refer to the introduction of AMVP, Merge, MMVD or skip modes in the previous text, which will not be repeated here.
[0271] S702: Obtain an index value of the length of a motion vector difference value of the current image block, where the motion vector difference value of the current image block is used to indicate a difference between the motion vector prediction value and the motion vector target value of the current image block.
[0272] The index value of the length of the motion vector difference may be used to indicate a piece of candidate length information in the candidate length information set.
[0273] The candidate length information set may be at least two pieces of candidate length information or one piece of candidate length information.
[0274] A candidate length information may be used to indicate the length of a motion vector difference, and the candidate length information may be a length value, or may be information used to derive the length value. The length may be represented by Euclidean distance, or may be the absolute value of the x component and the y component of the motion vector difference, or may be represented by other norms, which are not limited here.
[0275] It should be noted that since the motion vector is a two-dimensional array, the motion vector difference can also be represented by a two-dimensional array. If the motion vector is a three-dimensional array, the motion vector difference can also be represented by a three-dimensional array.
[0276] S703. Determine target length information from a candidate length information set according to the index value of the length. The candidate length information set only includes candidate length information of N motion vector differences, where N is a positive integer greater than 1 and less than 8.
[0277] Among them, N can be 4. In some feasible implementations, index values of different lengths can indicate different lengths. For example, the candidate length information of the N motion vector difference values may include at least one of the following: when the index value of the length is a first preset value, the length indicated by the target length information is a quarter of a pixel length; when the index value of the length is a second preset value, the length indicated by the target length information is a half pixel length; when the index value of the length is a third preset value, the length indicated by the target length information is a pixel length; when the index value of the length is a fourth preset value, the length indicated by the target length information is a two-pixel length. It should be noted that the first preset value to the fourth preset value may not be sequential, but independent of each other, and are only used to distinguish different preset values. Of course, the first preset value to the fourth preset value may also be sequential, or have sequential attributes. In some feasible implementations, the correspondence between the index value of the length and the length of the MVD may be as shown in Table 4:
[0278] Table 4
[0279] Index value of MVD length 0 1 2 3 Length of MVD 1 / 4-pel 1 / 2-pel 1-pel 2-pel MmvdDistance 1 2 3 4
[0280] Wherein, pel means pixel, for example, 1 / 4-pel means a quarter of the length of a pixel. For similar descriptions, refer to the description in Table 2.
[0281] Here, MmvdDistance is a value used to obtain the length of the MVD. For example, the value of the length of the MVD can be obtained by shifting MmvdDistance right by two bits.
[0282] S704: Obtain a motion vector difference of the current image block according to the target length information.
[0283] The method may further include: obtaining an index value of a direction of a motion vector difference of the current image block; and determining target direction information from M candidate direction information of motion vector differences according to the index value of the direction, where M is a positive integer greater than 1.
[0284] The candidate direction information of the M motion vector differences may refer to M candidate direction information.
[0285] The index value of the direction of the motion vector difference may be used to indicate one candidate direction information among the candidate direction information of the M motion vector differences.
[0286] Among them, a candidate direction information can be used to indicate the direction of a motion vector difference. Specifically, the candidate direction information can be a symbol indicating a positive or negative sign, and the symbol can be the sign of the x component of the motion vector difference, or the sign of the y component of the motion vector difference, or the sign of the x component and the y component of the motion vector. Alternatively, the candidate direction information can also be information used to derive the sign.
[0287] In a specific implementation process, obtaining the motion vector difference of the current image block according to the target length information may include: determining the motion vector difference of the current image block according to the target direction information and the target length information.
[0288] S705 . Determine a target value of the motion vector of the current image block according to the motion vector difference of the current image block and the predicted value of the motion vector of the current image block.
[0289] In some feasible implementations, the sum of the motion vector difference value of the current image block and the motion vector prediction value of the current image block may be used as the motion vector target value of the current image block.
[0290] S706: Obtain a prediction block of the current image block according to the target value of the motion vector of the current image block.
[0291] For more information about inter-frame prediction, please refer to the previous description, which will not be repeated here.
[0292] Figure 8 A flowchart of an inter-frame prediction method provided by an embodiment of the present invention. The method may be performed by the source device 12, or the video decoding system 40, or the encoder 20, or the video decoding device 400, or the decoding device 500, or specifically may be performed by the prediction processing unit 260 in the encoder 30 (or, for example, the inter-frame prediction unit 244 in the prediction processing unit 260). The method may include:
[0293] S801. Obtain a motion vector prediction value of a current image block.
[0294] This process can be referred to the introduction of AMVP, Merge, MMVD or skip modes in the previous article, which will not be repeated here.
[0295] S802: Perform motion search in the area where the position indicated by the motion vector prediction value of the current image block is located to obtain a motion vector target value of the current image block.
[0296] S803. Obtain an index value of the length of the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block, wherein the motion vector difference of the current image block is used to indicate the difference between the motion vector prediction value and the motion vector target value of the current image block, and the index value of the length of the motion vector difference of the current image block is used to indicate one candidate length information in a preset candidate length information set, wherein the candidate length information set only includes candidate length information of N motion vector differences, where N is a positive integer greater than 1 and less than 8.
[0297] Among them, obtaining the index value of the length of the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block may include: obtaining the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block; and determining the index value of the length of the motion vector difference of the current image block and the direction index value of the motion vector difference of the current image block according to the motion vector difference of the current image block.
[0298] Among them, N can be 4.
[0299] Figure 8 Described as Figure 7 For the encoding method corresponding to the decoding method described in the previous section, please refer to Figure 7 Or the related descriptions in the previous article will not be repeated here.
[0300] Fig. 9 A flowchart of an inter-frame prediction method provided by an embodiment of the present invention. The method may be performed by the destination device 14, or the video decoding system 40, or the decoder 30, or the video decoding device 400, or the decoding device 500, or specifically by the video decoder 30, or specifically by the entropy decoding unit 304 and the prediction processing unit 360 (or, for example, the inter-frame prediction unit 344 in the prediction processing unit 360). The method may include:
[0301] S901. Obtain a motion vector prediction value of a current image block.
[0302] In a specific implementation process, the acquisition of the motion vector prediction value of the current image block may include: constructing a candidate motion information list of the current image block, the candidate motion information list may be composed of L motion vectors, where L is 1, 3, 4 or 5; acquiring the index value of the motion information prediction information of the current image block in the candidate motion information list, the motion information prediction information of the current image block includes the motion vector prediction value; obtaining the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list. Among them, the candidate motion information list of the current image block may be a Merge candidate motion information list, and accordingly, the inter-frame prediction method provided in the embodiment of the present invention may be applied to the MMVD mode.
[0303] The above method of obtaining the motion vector prediction value by constructing a candidate motion information list of the current image block can refer to the introduction of AMVP, Merge, MMVD or skip modes in the previous text, which will not be repeated here.
[0304] S902: Obtain an index value of a direction of a motion vector difference value of the current image block, where the motion vector difference value of the current image block is used to indicate a difference between the motion vector prediction value and the motion vector target value of the current image block.
[0305] The index value of the direction of the motion vector difference may be used to indicate one of the candidate direction information in the candidate direction information set.
[0306] The candidate direction information set may be at least two pieces of candidate direction information or one piece of candidate direction information.
[0307] Among them, a candidate direction information can be used to indicate the direction of a motion vector difference. Specifically, the candidate direction information can be a symbol indicating a positive or negative sign, and the symbol can be the sign of the x component of the motion vector difference, or the sign of the y component of the motion vector difference, or the sign of the x component and the y component of the motion vector. Alternatively, the candidate direction information can also be information used to derive the sign.
[0308] It should be noted that since the motion vector is a two-dimensional array, the motion vector difference can also be represented by a two-dimensional array. If the motion vector is a three-dimensional array, the motion vector difference can also be represented by a three-dimensional array.
[0309] S903: Determine target direction information from a candidate direction information set according to the index value of the direction, where the candidate direction information set includes M pieces of candidate direction information of motion vector differences, where M is a positive integer greater than 4.
[0310] Wherein, M may be 8. In some feasible implementations, the index values of different directions may indicate different directions. For example, the candidate direction information of the M motion vector difference values may include at least one of the following: when the index value of the direction is the first preset value, the direction indicated by the target direction information is the right direction; when the index value of the direction is the second preset value, the direction indicated by the target direction information is the left direction; when the index value of the direction is the third preset value, the direction indicated by the target direction information is the bottom direction; when the index value of the direction is the fourth preset value, the direction indicated by the target direction information is the top direction; when the index value of the direction is the fifth preset value, the direction indicated by the target direction information is the bottom right; when the index value of the direction is the sixth preset value, the direction indicated by the target direction information is the top right; when the index value of the direction is the seventh preset value, the direction indicated by the target direction information is the bottom left; when the index value of the direction is the eighth preset value, the direction indicated by the target direction information is the top left. It should be noted that the first preset value to the eighth preset value may not be sequential, but are independent of each other and are only used to distinguish different preset values. Of course, the first preset value to the eighth preset value may also be in sequence, or have a sequential attribute.
[0311] In some feasible implementations, the corresponding relationship between the index value of the direction and the direction of the MVD may be as shown in Table 5, Table 6, or Table 7:
[0312] Table 5
[0313]
[0314] Table 6
[0315]
[0316] Table 7
[0317]
[0318] In Table 5, x-axis is "+" to indicate that the direction is the positive direction of the x-axis, y-axis is "+" to indicate that the direction is the positive direction of the y-axis, x-axis is "-" to indicate that the direction is the negative direction of the x-axis, y-axis is "-" to indicate that the direction is the negative direction of the y-axis, x-axis is N / A to indicate that the direction of the MVD is independent of the x-axis direction, y-axis is N / A to indicate that the direction of the MVD is independent of the y-axis direction, and x-axis and y-axis are both "+" to indicate The direction is the direction in which the projection on the x-axis is positive and the projection on the y-axis is also positive. If both x-axis and y-axis are "-", it can be indicated that the direction is the direction in which the projection on the x-axis is negative and the projection on the y-axis is also negative. If x-axis is "+" and y-axis is "-", it can be indicated that the direction is the direction in which the projection on the x-axis is positive and the projection on the y-axis is negative. If x-axis is "-" and y-axis is "+", it can be indicated that the direction is the direction in which the projection on the x-axis is negative and the projection on the y-axis is positive. Among them, the positive direction of the x-axis can represent the left, and the positive direction of the y-axis can represent the bottom.
[0319] In Table 6 or Table 7, the x-axis may represent the sign coefficient of the x component of the MVD, and the product of the sign coefficient of the x component and the absolute value of the x component of the MVD is the x component of the MVD. The y-axis may represent the sign coefficient of the y component of the MVD, and the product of the sign coefficient of the y component and the absolute value of the y component is the y component of the MVD.
[0320] S904: Obtain a motion vector difference of the current image block according to the target direction information.
[0321] Among them, the method may also include: the method may also include: obtaining the index value of the length of the motion vector difference of the current image block; determining the target length information from the candidate length information of N motion vector differences according to the index value of the length, where N is a positive integer greater than 1.
[0322] Among them, the candidate length information of N motion vector differences can be Figure 7 The candidate length information set in the embodiment may specifically be the candidate length information set provided in Table 4. For descriptions of the length of the motion vector difference, the index value of the length of the motion vector difference, the candidate length information and the motion vector difference, please refer to Figure 7 Or the description in the previous article will not be repeated here.
[0323] In a specific implementation process, obtaining the motion vector difference of the current image block according to the target direction information may include: determining the motion vector difference of the current image block according to the target direction information and the target length information.
[0324] S905 . Determine a target value of the motion vector of the current image block according to the motion vector difference of the current image block and the predicted value of the motion vector of the current image block.
[0325] In some feasible implementations, the sum of the motion vector difference value of the current image block and the motion vector prediction value of the current image block may be used as the motion vector target value of the current image block.
[0326] S906: Obtain a prediction block of the current image block according to the target value of the motion vector of the current image block.
[0327] For more information about inter-frame prediction, please refer to the previous description, which will not be repeated here.
[0328] Fig. 9 In the embodiment Figure 7 For similar content in the previous article, please refer to Figure 7 As well as the description in the previous article, I will not repeat it here.
[0329] Fig.10 A flowchart of an inter-frame prediction method provided by an embodiment of the present invention. The method may be performed by the source device 12, or the video decoding system 40, or the encoder 20, or the video decoding device 400, or the decoding device 500, or specifically may be performed by the prediction processing unit 260 in the encoder 30 (or, for example, the inter-frame prediction unit 244 in the prediction processing unit 260). The method may include:
[0330] S1001. Obtain a motion vector prediction value of a current image block.
[0331] This process can be referred to the introduction of AMVP, Merge, MMVD or skip modes in the previous article, which will not be repeated here.
[0332] S1002: Perform motion search in the area where the position indicated by the motion vector prediction value of the current image block is located to obtain a motion vector target value of the current image block.
[0333] S1003. Obtain an index value of a direction of a motion vector difference value of the current image block according to a motion vector target value of the current image block and a motion vector prediction value of the current image block, wherein the motion vector difference value of the current image block is used to indicate a difference between the motion vector prediction value and the motion vector target value of the current image block, and the index value of the direction of the motion vector difference value of the current image block is used to indicate one candidate direction information in a preset candidate direction information set, wherein the candidate direction information set includes candidate length information of M motion vector differences, where M is a positive integer greater than 4.
[0334] Among them, obtaining the index value of the length of the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block may include: obtaining the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block; and determining the index value of the length of the motion vector difference of the current image block and the direction index value of the motion vector difference of the current image block according to the motion vector difference of the current image block.
[0335] Among them, M can be 8.
[0336] Fig.10 Described as Fig. 9 For the encoding method corresponding to the decoding method described in the previous section, please refer to Fig. 9 Or the related descriptions in the previous article will not be repeated here.
[0337] Fig.11 A flowchart of an inter-frame prediction method provided by an embodiment of the present invention. The method may be performed by the destination device 14, or the video decoding system 40, or the decoder 30, or the video decoding device 400, or the decoding device 500, or specifically by the video decoder 30, or specifically by the entropy decoding unit 304 and the prediction processing unit 360 (or, for example, the inter-frame prediction unit 344 in the prediction processing unit 360). The method may include:
[0338] S1101. Obtain a first motion vector prediction value and a second motion vector prediction value of a current image block, where the first motion vector prediction value corresponds to a first reference frame, and the second motion vector prediction value corresponds to a second reference frame.
[0339] S1102. Obtain a first motion vector difference value of the current image block, where the first motion vector difference value of the current image block is used to indicate a difference between the first motion vector prediction value and the first motion vector target value of the current image block, and the first motion vector target value and the first motion vector prediction value correspond to the same reference frame.
[0340] S1103. Determine a second motion vector difference of the current image block according to the first motion vector difference, the second motion vector difference of the current image block being used to indicate a difference between the second motion vector prediction value and the second motion vector target value of the current image block, the second motion vector target value and the second motion vector prediction value corresponding to the same reference frame, wherein, when a direction of the first reference frame relative to a current frame where the current image block is located is the same as a direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or, when a direction of the first reference frame relative to the current frame where the current image block is located is opposite to a direction of the second reference frame relative to the current frame, the second motion vector difference has an opposite sign to that of the first motion vector difference, and an absolute value of the second motion vector difference is the same as an absolute value of the first motion vector difference.
[0341] S1104: Determine a first motion vector target value of the current image block according to the first motion vector difference and the first motion vector prediction value.
[0342] Among them, the first motion vector target value can be the sum of the first motion vector difference and the first motion vector prediction value.
[0343] S1105 . Determine a second motion vector target value of the current image block according to the second motion vector difference and the second motion vector prediction value.
[0344] Among them, the second motion vector target value can be the sum of the second motion vector difference and the second motion vector prediction value.
[0345] S1106. Obtain a prediction block of the current image block according to the first motion vector target value and the second motion vector target value.
[0346] Fig.11 For contents in the embodiments similar to those in the foregoing text, reference can be made to the description in the foregoing text and will not be repeated here.
[0347] Based on the same inventive concept as the above method, Fig.12As shown, an embodiment of the present invention further provides an inter-frame prediction device 1200, which can be a destination device 14, or a video decoding system 40, or a decoder 30, or a video decoding device 400, or a decoding device 500 itself, or can be a destination device 14, or a video decoding system 40, or a decoder 30, or a video decoding device 400, or a component of the decoding device 500, or the inter-frame prediction device 1200 can include an entropy decoding unit 304 and a prediction processing unit 360 (or, for example, an inter-frame prediction unit 344 in the prediction processing unit 360). The inter-frame prediction device 1200 includes an acquisition unit 1201 and a prediction unit 1202. The acquisition unit 1201 and the prediction unit 1202 can be implemented by software, for example, the acquisition unit 1201 and the prediction unit 1202 can be software modules, or the acquisition unit 1201 and the prediction unit 1202 are a processor and a memory that execute instructions. The acquisition unit 1201 and the prediction unit 1202 can also be implemented by hardware, for example, the acquisition unit 1201 and the prediction unit 1202 can be modules in a chip, wherein:
[0348] The prediction unit 1202 may be used to obtain a motion vector prediction value of the current image block.
[0349] The acquisition unit 1201 may be used to acquire an index value of the length of a motion vector difference value of the current image block, where the motion vector difference value of the current image block is used to indicate a difference between the motion vector prediction value and the motion vector target value of the current image block.
[0350] In some feasible implementations, the acquisition unit 1201 may include an entropy decoding unit 304, which is used to obtain an index value of the length of the motion vector difference of the current image block, or to obtain an index value of the direction of the motion vector difference of the current image block. The prediction unit 1202 may include a prediction unit 360, and specifically may include an inter-frame prediction unit 344.
[0351] The prediction unit 1202 can also be used to determine the target length information from the candidate length information set according to the index value of the length, and the candidate length information set only includes candidate length information of N motion vector differences, where N is a positive integer greater than 1 and less than 8; according to the target length information, the motion vector difference of the current image block is obtained; according to the motion vector difference of the current image block and the motion vector prediction value of the current image block, the motion vector target value of the current image block is determined; according to the motion vector target value of the current image block, the prediction block of the current image block is obtained.
[0352] The acquisition unit 1201 can also be used to: acquire the index value of the direction of the motion vector difference of the current image block. Correspondingly, the prediction unit 1202 can also be used to: determine the target direction information from the candidate direction information of M motion vector differences according to the index value of the direction, where M is a positive integer greater than 1. After obtaining the target direction information, the prediction unit 1202 can be used to: determine the motion vector difference of the current image block according to the target direction information and the target length information.
[0353] Among them, N can be, for example, 4. In some feasible implementations, the candidate length information of the N motion vector difference values may include at least one of the following: when the index value of the length is a first preset value, the length indicated by the target length information is a quarter of a pixel length; when the index value of the length is a second preset value, the length indicated by the target length information is a half of a pixel length; when the index value of the length is a third preset value, the length indicated by the target length information is a one-pixel length; when the index value of the length is a fourth preset value, the length indicated by the target length information is a two-pixel length.
[0354] Among them, the prediction unit 1202 can be used to: construct a candidate motion information list for the current image block, the candidate motion information list can be composed of L motion vectors, and L is 1, 3, 4 or 5; obtain the index value of the motion information prediction information of the current image block in the candidate motion information list, and the motion information prediction information of the current image block includes the motion vector prediction value; obtain the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
[0355] It can be understood that the functions of the various units of the inter-frame prediction device 1200 of this embodiment can be specifically implemented according to the method in the above-mentioned inter-frame prediction method embodiment, and its specific implementation process can refer to the relevant description of the above-mentioned method embodiment, which will not be repeated here.
[0356] Based on the same inventive concept as the above method, Fig.13As shown, an embodiment of the present invention further provides an inter-frame prediction device 1300, which can be a source device 12, or a video decoding system 40, or an encoder 20, or a video decoding device 400, or a decoding device 500 itself, or can be a component of the source device 12, or a video decoding system 40, or an encoder 20, or a video decoding device 400, or a decoding device 500, or the inter-frame prediction device 1300 can include a prediction processing unit 260 (or, for example, an inter-frame prediction unit 244 in the prediction processing unit 260). The inter-frame prediction device 1300 includes an acquisition unit 1301 and a prediction unit 1302. The acquisition unit 1301 and the prediction unit 1302 can be implemented by software, for example, the acquisition unit 1301 and the prediction unit 1302 can be software modules, or the acquisition unit 1301 and the prediction unit 1302 are a processor and a memory that execute instructions. The acquisition unit 1301 and the prediction unit 1302 can also be implemented by hardware, for example, the acquisition unit 1301 and the prediction unit 1302 can be modules in a chip, wherein:
[0357] The acquisition unit 1301 may be used to acquire a motion vector prediction value of a current image block.
[0358] The prediction unit 1302 may be configured to perform a motion search in an area where a position indicated by a motion vector prediction value of the current image block is located, to obtain a motion vector target value of the current image block.
[0359] In some feasible implementations, the acquisition unit 1301 and the prediction unit 1302 may be used as an implementation of the prediction processing unit 260 .
[0360] The prediction unit 1302 can also be used to obtain an index value of the length of the motion vector difference of the current image block based on the motion vector target value of the current image block and the motion vector prediction value of the current image block, wherein the motion vector difference of the current image block is used to indicate the difference between the motion vector prediction value and the motion vector target value of the current image block, and the index value of the length of the motion vector difference of the current image block is used to indicate one candidate length information in a preset candidate length information set, and the candidate length information set only includes candidate length information of N motion vector differences, where N is a positive integer greater than 1 and less than 8.
[0361] Among them, the prediction unit 1302 can be used to: obtain the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block; determine the index value of the length of the motion vector difference of the current image block and the direction index value of the motion vector difference of the current image block according to the motion vector difference of the current image block.
[0362] Here, N may be 4, for example.
[0363] It can be understood that the functions of the various units of the inter-frame prediction device 1300 of this embodiment can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0364] Based on the same inventive concept as the above method, Fig.14 As shown, an embodiment of the present invention further provides an inter-frame prediction device 1400, which can be a destination device 14, or a video decoding system 40, or a decoder 30, or a video decoding device 400, or a decoding device 500 itself, or can be a destination device 14, or a video decoding system 40, or a decoder 30, or a video decoding device 400, or a component of the decoding device 500, or the inter-frame prediction device 1400 can include an entropy decoding unit 304 and a prediction processing unit 360 (or, for example, an inter-frame prediction unit 344 in the prediction processing unit 360). The inter-frame prediction device 1400 includes an acquisition unit 1401 and a prediction unit 1402. The acquisition unit 1401 and the prediction unit 1402 can be implemented by software, for example, the acquisition unit 1401 and the prediction unit 1402 can be software modules, or the acquisition unit 1401 and the prediction unit 1402 are a processor and a memory that execute instructions. The acquisition unit 1401 and the prediction unit 1402 can also be implemented by hardware, for example, the acquisition unit 1401 and the prediction unit 1402 can be modules in a chip, wherein:
[0365] The prediction unit 1402 may be used to obtain a motion vector prediction value of the current image block.
[0366] The acquisition unit 1401 may be used to acquire an index value of a direction of a motion vector difference value of the current image block, where the motion vector difference value of the current image block is used to indicate a difference between the motion vector prediction value and the motion vector target value of the current image block.
[0367] In some feasible implementations, the acquisition unit 1401 may include an entropy decoding unit 304, which is used to obtain an index value of the length of the motion vector difference of the current image block, or to obtain an index value of the direction of the motion vector difference of the current image block. The prediction unit 1402 may include a prediction unit 360, and specifically may include an inter-frame prediction unit 344.
[0368] The prediction unit 1402 can also be used to determine the target direction information from the candidate direction information set according to the index value of the direction, the candidate direction information set including candidate direction information of M motion vector differences, M being a positive integer greater than 4; according to the target direction information, obtain the motion vector difference of the current image block; according to the motion vector difference of the current image block and the motion vector prediction value of the current image block, determine the motion vector target value of the current image block; according to the motion vector target value of the current image block, obtain the prediction block of the current image block.
[0369] The acquisition unit 1401 can also be used to: obtain the index value of the length of the motion vector difference of the current image block. Correspondingly, the prediction unit 1402 can also be used to determine the target length information from the candidate length information of N motion vector differences according to the index value of the length, where N is a positive integer greater than 1. After obtaining the target length information, the prediction unit 1402 can be used to: determine the motion vector difference of the current image block according to the target direction information and the target length information.
[0370] Among them, M can be, for example, 8. In some feasible implementations, the candidate direction information of the M motion vector difference values may include at least one of the following: when the index value of the direction is a first preset value, the direction indicated by the target direction information is due right; when the index value of the direction is a second preset value, the direction indicated by the target direction information is due left; when the index value of the direction is a third preset value, the direction indicated by the target direction information is due below; when the index value of the direction is a fourth preset value, the direction indicated by the target direction information is due above; when the index value of the direction is a fifth preset value, the direction indicated by the target direction information is the lower right; when the index value of the direction is a sixth preset value, the direction indicated by the target direction information is the upper right; when the index value of the direction is a seventh preset value, the direction indicated by the target direction information is the lower left; when the index value of the direction is an eighth preset value, the direction indicated by the target direction information is the upper left.
[0371] Among them, the prediction unit 1402 can be used to: construct a candidate motion information list for the current image block, the candidate motion information list can be composed of L motion vectors, and L is 1, 3, 4 or 5; obtain the index value of the motion information prediction information of the current image block in the candidate motion information list, and the motion information prediction information of the current image block includes the motion vector prediction value; obtain the motion vector prediction value according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
[0372] It can be understood that the functions of the various units of the inter-frame prediction device 1400 of this embodiment can be specifically implemented according to the method in the above-mentioned inter-frame prediction method embodiment, and its specific implementation process can refer to the relevant description of the above-mentioned method embodiment, which will not be repeated here.
[0373] Based on the same inventive concept as the above method, Fig.15 As shown, an embodiment of the present invention further provides an inter-frame prediction device 1500, which can be a source device 12, or a video decoding system 40, or an encoder 20, or a video decoding device 400, or a decoding device 500 itself, or can be a source device 12, or a video decoding system 40, or an encoder 20, or a video decoding device 400, or a component of the decoding device 500, or the inter-frame prediction device 1500 can include a prediction processing unit 260 (or, for example, an inter-frame prediction unit 244 in the prediction processing unit 260). The inter-frame prediction device 1500 includes an acquisition unit 1501 and a prediction unit 1502. The acquisition unit 1501 and the prediction unit 1502 can be implemented by software, for example, the acquisition unit 1501 and the prediction unit 1502 can be software modules, or the acquisition unit 1501 and the prediction unit 1502 are a processor and a memory that execute instructions. The acquisition unit 1501 and the prediction unit 1502 can also be implemented by hardware, for example, the acquisition unit 1501 and the prediction unit 1502 can be modules in a chip, wherein:
[0374] The acquisition unit 1501 may be used to acquire a motion vector prediction value of a current image block.
[0375] The prediction unit 1502 may be configured to perform a motion search in an area where a position indicated by a motion vector prediction value of the current image block is located, to obtain a motion vector target value of the current image block.
[0376] In some feasible implementations, the acquisition unit 1501 and the prediction unit 1502 may be used as an implementation of the prediction processing unit 260 .
[0377] The prediction unit 1502 can also be used to obtain an index value of the direction of the motion vector difference of the current image block based on the motion vector target value of the current image block and the motion vector prediction value of the current image block, wherein the motion vector difference of the current image block is used to indicate the difference between the motion vector prediction value and the motion vector target value of the current image block, and the index value of the direction of the motion vector difference of the current image block is used to indicate one candidate direction information in a preset candidate direction information set, and the candidate direction information set includes candidate length information of M motion vector differences, where M is a positive integer greater than 4.
[0378] Among them, the prediction unit 1502 can be used to: obtain the motion vector difference of the current image block according to the motion vector target value of the current image block and the motion vector prediction value of the current image block; determine the index value of the length of the motion vector difference of the current image block and the direction index value of the motion vector difference of the current image block according to the motion vector difference of the current image block.
[0379] Here, M can be 8, for example.
[0380] It can be understood that the functions of the various units of the inter-frame prediction device 1500 of this embodiment can be specifically implemented according to the method in the above method embodiment, and its specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0381] Based on the same inventive concept as the above method, Fig.16 As shown, an embodiment of the present invention further provides an inter-frame prediction device 1600, which can be a destination device 14, or a video decoding system 40, or a decoder 30, or a video decoding device 400, or a decoding device 500 itself, or can be a destination device 14, or a video decoding system 40, or a decoder 30, or a video decoding device 400, or a component of the decoding device 500, or the inter-frame prediction device 1600 can include an entropy decoding unit 304 and a prediction processing unit 360 (or, for example, an inter-frame prediction unit 344 in the prediction processing unit 360). The inter-frame prediction device 1600 includes an acquisition unit 1601 and a prediction unit 1602. The acquisition unit 1601 and the prediction unit 1602 can be implemented by software, for example, the acquisition unit 1601 and the prediction unit 1602 can be software modules, or the acquisition unit 1601 and the prediction unit 1602 are a processor and a memory that execute instructions. The acquisition unit 1601 and the prediction unit 1602 can also be implemented by hardware, for example, the acquisition unit 1601 and the prediction unit 1602 can be modules in a chip, wherein:
[0382] The acquisition unit 1601 may be configured to acquire a first motion vector prediction value and a second motion vector prediction value of a current image block, wherein the first motion vector prediction value corresponds to a first reference frame, and the second motion vector prediction value corresponds to a second reference frame.
[0383] The acquisition unit 1601 can also be used to obtain the first motion vector difference of the current image block, where the first motion vector difference of the current image block is used to indicate the difference between the first motion vector prediction value and the first motion vector target value of the current image block, and the first motion vector target value and the first motion vector prediction value correspond to the same reference frame.
[0384] The prediction unit 1602 may be configured to determine a second motion vector difference of the current image block according to the first motion vector difference, wherein the second motion vector difference of the current image block is used to indicate a difference between the second motion vector prediction value and the second motion vector target value of the current image block, wherein the second motion vector target value and the second motion vector prediction value correspond to the same reference frame, wherein when the direction of the first reference frame relative to the current frame where the current image block is located is the same as the direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or, when the direction of the first reference frame relative to the current image block is the same as the direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference. When the direction of the current frame where the block is located is opposite to the direction of the second reference frame relative to the current frame, the positive and negative signs of the second motion vector difference are opposite to those of the first motion vector difference, and the absolute value of the second motion vector difference is the same as the absolute value of the first motion vector difference; according to the first motion vector difference and the first motion vector prediction value, a first motion vector target value of the current image block is determined; according to the second motion vector difference and the second motion vector prediction value, a second motion vector target value of the current image block is determined; and according to the first motion vector target value and the second motion vector target value, a prediction block of the current image block is obtained.
[0385] In some feasible implementations, the acquisition unit 1601 and the prediction unit 1602 may be used as an implementation of the prediction processing unit 360 .
[0386] It can be understood that the functions of the various units of the inter-frame prediction device 1600 of this embodiment can be specifically implemented according to the method in the above-mentioned inter-frame prediction method embodiment, and its specific implementation process can refer to the relevant description of the above-mentioned method embodiment, which will not be repeated here.
[0387] Those skilled in the art will appreciate that the functions described in conjunction with the various illustrative logic blocks, modules, and algorithm steps disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logic blocks, modules, and steps can be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or includes any communication media that facilitates the transfer of computer programs from one place to another (e.g., according to a communication protocol). In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media, such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in this application. A computer program product may include computer-readable media.
[0388] As an example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwave are included in the definition of media. However, it should be understood that the computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are actually directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser optical disks, optical optical disks, digital versatile disks (DVDs), and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0389] Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Thus, the term "processor" as used herein may refer to any of the aforementioned structures or any other structures suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.
[0390] The techniques of the present application may be implemented in a variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of devices for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units may be combined in a codec hardware unit in conjunction with appropriate software and / or firmware, or provided by interoperating hardware units (including one or more processors as described above).
[0391] In the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0392] The above are only exemplary embodiments of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A video encoding method performed by an encoding device, characterized in that: The method comprises: Obtaining a first motion vector prediction value and a second motion vector prediction value of a current image block, wherein the first motion vector prediction value corresponds to a first reference frame, and the second motion vector prediction value corresponds to a second reference frame; Obtaining a first motion vector difference of the current image block, the first motion vector difference of the current image block being used to indicate a difference between the first motion vector prediction value and the first motion vector target value of the current image block, the first motion vector target value and the first motion vector prediction value corresponding to the same reference frame, the first motion vector difference being used to determine a second motion vector difference of the current image block, the second motion vector difference of the current image block being used to indicate a difference between the second motion vector prediction value and the second motion vector target value of the current image block, the second motion vector target value and the second motion vector prediction value corresponding to the same reference frame, wherein when a direction of the first reference frame relative to a current frame where the current image block is located is the same as a direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or when a direction of the first reference frame relative to a current frame where the current image block is located is opposite to a direction of the second reference frame relative to the current frame, the second motion vector difference has an opposite sign to that of the first motion vector difference, and an absolute value of the second motion vector difference is the same as an absolute value of the first motion vector difference; Obtaining a prediction block of the current image block according to the first motion vector target value and the second motion vector target value; The first motion vector difference of the current image block is encoded to obtain an encoded code stream.
2. The method according to claim 1, characterized in that The method comprises: A motion search is performed in an area where a position indicated by a first motion vector prediction value of the current image block is located, so as to obtain a first motion vector target value of the current image block.
3. The method according to claim 1 or 2, characterized in that: The obtaining of the first motion vector prediction value and the second motion vector prediction value of the current image block comprises: Constructing a candidate motion information list of the current image block; A first motion vector prediction value and a second motion vector prediction value of the current image block are obtained based on the candidate motion information list.
4. A video decoding method performed by a decoding device, characterized in that: The method comprises: Receive code stream; Obtaining a first motion vector prediction value and a second motion vector prediction value of a current image block, wherein the first motion vector prediction value corresponds to a first reference frame, and the second motion vector prediction value corresponds to a second reference frame; Based on the code stream, obtaining a first motion vector difference value of the current image block, where the first motion vector difference value of the current image block is used to indicate a difference between the first motion vector prediction value and a first motion vector target value of the current image block, where the first motion vector target value and the first motion vector prediction value correspond to the same reference frame; determining a second motion vector difference value of the current image block based on the first motion vector difference value, the second motion vector difference value of the current image block being used to indicate a difference between the second motion vector prediction value and a second motion vector target value of the current image block, the second motion vector target value and the second motion vector prediction value corresponding to the same reference frame, wherein when a direction of the first reference frame relative to a current frame where the current image block is located is the same as a direction of the second reference frame relative to the current frame, the second motion vector difference value is the first motion vector difference value; or when a direction of the first reference frame relative to a current frame where the current image block is located is opposite to a direction of the second reference frame relative to the current frame, the second motion vector difference value has an opposite sign to that of the first motion vector difference value, and an absolute value of the second motion vector difference value is the same as an absolute value of the first motion vector difference value; Determining a first motion vector target value of the current image block according to the first motion vector difference and the first motion vector prediction value; Determining a second motion vector target value of the current image block according to the second motion vector difference and the second motion vector prediction value; A prediction block of the current image block is obtained according to the first motion vector target value and the second motion vector target value.
5. The method according to claim 4, characterized in that The obtaining of the first motion vector prediction value and the second motion vector prediction value of the current image block comprises: Constructing a candidate motion information list of the current image block; Obtaining an index value of the motion information of the current image block in the candidate motion information list, where the motion information of the current image block includes the first motion vector prediction value and the second motion vector prediction value; The first motion vector prediction value and the second motion vector prediction value of the current image block are obtained according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
6. A coding device, characterized in that: The device comprises: an acquisition unit, the acquisition unit being used to acquire a first motion vector prediction value and a second motion vector prediction value of a current image block, the first motion vector prediction value corresponding to a first reference frame, and the second motion vector prediction value corresponding to a second reference frame; the acquisition unit is further used to acquire a first motion vector difference value of the current image block, the first motion vector difference value of the current image block being used to indicate a difference between the first motion vector prediction value and a first motion vector target value of the current image block, the first motion vector target value and the first motion vector prediction value corresponding to the same reference frame, the first motion vector difference value being used to determine a second motion vector difference value of the current image block, the second motion vector difference value of the current image block being used to indicate a difference between the first motion vector prediction value and a first motion vector target value of the current image block a difference between a predicted value of the current image block and a second motion vector target value of the current image block, the second motion vector target value and the second motion vector predicted value corresponding to the same reference frame, wherein, when a direction of the first reference frame relative to a current frame where the current image block is located is the same as a direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or, when a direction of the first reference frame relative to a current frame where the current image block is located is opposite to a direction of the second reference frame relative to the current frame, the second motion vector difference has an opposite sign to that of the first motion vector difference, and an absolute value of the second motion vector difference is the same as that of the first motion vector difference; A prediction unit, wherein the prediction unit is used to obtain a prediction block of the current image block according to the first motion vector target value and the second motion vector target value; An encoding unit, wherein the encoding unit is used to encode the first motion vector difference of the current image block to obtain an encoded code stream.
7. The device according to claim 6, characterized in that The acquisition unit is further configured to perform a motion search in an area where a position indicated by a first motion vector prediction value of the current image block is located, so as to obtain a first motion vector target value of the current image block.
8. The device according to claim 6 or 7, characterized in that The acquisition unit is also used for: Constructing a candidate motion information list of the current image block; A first motion vector prediction value and a second motion vector prediction value of the current image block are obtained based on the candidate motion information list.
9. A decoding device, characterized in that: The device comprises: An acquisition unit, wherein the receiving unit is used to receive a code stream; The acquisition unit is further used to acquire a first motion vector prediction value and a second motion vector prediction value of the current image block, and acquire a first motion vector difference value of the current image block based on the code stream, wherein the first motion vector prediction value corresponds to a first reference frame, the second motion vector prediction value corresponds to a second reference frame, and the first motion vector difference value of the current image block is used to indicate a difference between the first motion vector prediction value and a first motion vector target value of the current image block, and the first motion vector target value and the first motion vector prediction value correspond to the same reference frame; a prediction unit, the prediction unit being configured to determine a second motion vector difference value of the current image block based on the first motion vector difference value, the second motion vector difference value of the current image block being configured to indicate a difference between the second motion vector prediction value and a second motion vector target value of the current image block, the second motion vector target value and the second motion vector prediction value corresponding to the same reference frame, wherein when a direction of the first reference frame relative to a current frame where the current image block is located is the same as a direction of the second reference frame relative to the current frame, the second motion vector difference value is the first motion vector difference value; or when a direction of the first reference frame relative to a current frame where the current image block is located is opposite to a direction of the second reference frame relative to the current frame, the second motion vector difference value has an opposite sign to that of the first motion vector difference value, and an absolute value of the second motion vector difference value is the same as an absolute value of the first motion vector difference value; The prediction unit is also used for: Determine a first motion vector target value of the current image block according to the first motion vector difference and the first motion vector prediction value; determine a second motion vector target value of the current image block according to the second motion vector difference and the second motion vector prediction value; and A prediction block of the current image block is obtained according to the first motion vector target value and the second motion vector target value.
10. The device according to claim 9, characterized in that The acquisition unit is also used for: Constructing a candidate motion information list of the current image block; Obtaining an index value of the motion information of the current image block in the candidate motion information list, where the motion information of the current image block includes the first motion vector prediction value and the second motion vector prediction value; The first motion vector prediction value and the second motion vector prediction value of the current image block are obtained according to the index value of the motion information of the current image block in the candidate motion information list and the candidate motion information list.
11. An encoder, characterized in that: The invention comprises one or more processors and a computer-readable storage medium communicating with the one or more processors and storing instructions, and when the instructions are executed by the one or more processors, the encoder implements the method according to any one of claims 1 to 3.
12. A decoder, characterized in that: The invention comprises one or more processors and a computer-readable storage medium communicating with the one or more processors and storing instructions, and when the instructions are executed by the one or more processors, the decoder implements the method according to claim 4 or 5.
13. An encoded bit stream, characterized in that The code stream includes a first motion vector difference value of a current image block, the first motion vector difference value of the current image block is used to indicate a difference between a first motion vector prediction value and a first motion vector target value of the current image block, the first motion vector target value and the first motion vector prediction value correspond to the same reference frame, the first motion vector difference value is used to determine a second motion vector difference value of the current image block, the second motion vector difference value of the current image block is used to indicate a difference between a second motion vector prediction value and a second motion vector target value of the current image block, the second motion vector target value and the second motion vector prediction value correspond to the same reference frame, the first motion vector prediction value corresponds to a first reference frame, and the second motion vector prediction value corresponds to a first reference frame. The motion vector prediction value corresponds to a second reference frame, and the first motion vector target value and the second motion vector target value are used to determine the prediction block of the current image block, wherein, when the direction of the first reference frame relative to the current frame where the current image block is located is the same as the direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or, when the direction of the first reference frame relative to the current frame where the current image block is located is opposite to the direction of the second reference frame relative to the current frame, the second motion vector difference is opposite in sign to the first motion vector difference, and the absolute value of the second motion vector difference is the same as the absolute value of the first motion vector difference.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which, when executed by the one or more processors, enable the computer to implement the method according to any one of claims 1 to 5.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an encoded code stream, wherein the code stream includes a first motion vector difference value of a current image block, the first motion vector difference value of the current image block is used to indicate a difference between a first motion vector prediction value and a first motion vector target value of the current image block, the first motion vector target value and the first motion vector prediction value correspond to the same reference frame, the first motion vector difference value is used to determine a second motion vector difference value of the current image block, the second motion vector difference value of the current image block is used to indicate a difference between a second motion vector prediction value and the second motion vector target value of the current image block, the second motion vector target value and the second motion vector prediction value correspond to the same reference frame, and the first motion vector prediction value corresponds to a first reference frame, the second motion vector prediction value corresponds to a second reference frame, the first motion vector target value and the second motion vector target value are used to determine a prediction block of the current image block, wherein, when a direction of the first reference frame relative to a current frame where the current image block is located is the same as a direction of the second reference frame relative to the current frame, the second motion vector difference is the first motion vector difference; or, when a direction of the first reference frame relative to a current frame where the current image block is located is opposite to a direction of the second reference frame relative to the current frame, the second motion vector difference has an opposite sign to that of the first motion vector difference, and an absolute value of the second motion vector difference is the same as an absolute value of the first motion vector difference.
16. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to implement the method according to any one of claims 1 to 5.
Citation Information
Cited By
Image processing method and device and medium
CN121353495A