CN110868611A - Video encoding and decoding method and device - Google Patents

Video encoding and decoding method and device Download PDF

Info

Publication number
CN110868611A
CN110868611A CN201810986251.XA CN201810986251A CN110868611A CN 110868611 A CN110868611 A CN 110868611A CN 201810986251 A CN201810986251 A CN 201810986251A CN 110868611 A CN110868611 A CN 110868611A
Authority
CN
China
Prior art keywords
motion vector
derived
prediction
information
motion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810986251.XA
Other languages
Chinese (zh)
Other versions
CN110868611B (en
Inventor
陈杰
欧阳晓
郑丞洙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Samsung Telecommunications Technology Research Co Ltd
Samsung Electronics Co Ltd
Original Assignee
Beijing Samsung Telecommunications Technology Research Co Ltd
Samsung Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Samsung Telecommunications Technology Research Co Ltd, Samsung Electronics Co Ltd filed Critical Beijing Samsung Telecommunications Technology Research Co Ltd
Priority to CN201810986251.XA priority Critical patent/CN110868611B/en
Publication of CN110868611A publication Critical patent/CN110868611A/en
Application granted granted Critical
Publication of CN110868611B publication Critical patent/CN110868611B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a video coding and decoding method and device. The video coding method comprises the following steps: deriving a plurality of motion vectors for a current coding block; selecting part of the derived motion vectors to perform offset operation to obtain a first motion vector, wherein the motion vector which is not subjected to the offset operation is a second motion vector; selecting part of motion vectors in the first motion vectors to derive motion vectors in different prediction directions to obtain third motion vectors; determining a motion vector used by the current coding block from the first motion vector, the second motion vector and the third motion vector, and writing information about the determined motion vector into the code stream; and carrying out subsequent coding according to the motion vector used by the current coding block. The coding method reduces the bit number under the condition of not reducing the motion vector candidates, and improves the performance of video coding by balancing the bit overhead and the diversity of the candidate motion vectors.

Description

Video encoding and decoding method and device
Technical Field
The disclosure belongs to the technical field of video coding and decoding, and relates to a video coding and decoding method and device.
Background
Since in natural video there is a high similarity from image to image. Therefore, in video compression, inter-frame prediction is required to remove information redundancy between pictures. The so-called inter-frame prediction is to predict the current image to be encoded by using the image already encoded in the previous frame, and then to transfer the prediction error to the decoder. Compared with the direct transmission of the content of the current image, the information amount of the prediction error is much smaller, so that the purpose of compression is achieved. In actual encoding, when an encoder encodes a current image block, an image block (referred to as a reference block) needs to be determined in an encoded image, then a difference value between the two is transmitted to a decoder, and after the decoder receives a prediction error, the same reference block is added to restore a pixel value of the current image block, so that the encoder and the decoder need to use the same reference block. The position difference between the reference block and the current block is represented by a motion vector, which the encoder needs to transmit to the decoder so that the decoder can find the correct reference block.
With the continuous progress of the prediction technology, the image prediction residual error is continuously reduced, and the proportion of motion information such as motion vectors in code streams is continuously increased. In order to reduce the overhead of transmitting motion information, a skip mode, a direct mode, a merge mode, etc. are proposed. In these modes, motion information is not transmitted in the code stream, and the encoder and the decoder directly derive motion information such as a motion vector of the current image block according to a certain rule based on the motion information of the previously encoded image block. These modes may omit the transmission of motion information, but since the derivation rule of motion information is fixed and needs to be derived from the motion information of previously coded image blocks. When the difference between the motion situation of the current image block and the motion situation of the previous image block is large, the derived motion information is not suitable for the current block.
To solve this problem, a new motion vector offset technique is proposed. This technique offsets the derived motion vector after it is derived so that it is more appropriate for the current image block, the offset information being determined by the encoder and transmitted in the bitstream. In this technique, in order to reduce the number of bits used for expressing the offset information, the offset can be performed only in the horizontal direction and the vertical direction, and the magnitude of the offset is also limited and can be selected only among several candidate amplitude values. Due to these limitations of the offset, the encoder is enabled to use a smaller number of bits for a better correction of the derived motion vectors, which greatly improves the encoding performance. Meanwhile, the technology modifies the prediction direction of the inter prediction to provide a plurality of different candidate prediction directions. For example, if the shifted motion vector points to the forward reference picture, the technique derives a motion vector pointing to the backward reference picture according to a linear model, and the encoder decides whether to use forward prediction, backward prediction or bi-prediction, and these prediction direction information are also indicated in the code stream. This is equivalent to providing the encoder with more candidate motion vectors so that the encoder can find a reference block that is more suitable for the current block, and thus the encoding efficiency is further improved.
In the AVS2 video coding standard, the skip mode and the direct mode themselves provide a number of different prediction direction candidate motion vectors, including forward prediction, backward prediction, bi-prediction, and symmetric prediction. Thus, when the motion vector offset technique is applied to the direct and skip modes in the AVS2 video coding standard, the modification of the prediction direction for the offset motion vectors is somewhat redundant, since the motion vectors derived by the direct mode and the skip mode already cover different prediction directions. For example, the backward motion vector derived from the biased forward motion vector has a higher similarity with the backward motion vector biased by the backward candidate motion vector in the direct mode or the skip mode, and there is no need to provide candidate motion vector alternatives for both cases, because this increases the overhead of transmitting related information in the bitstream, and reduces the encoding performance. In addition, the motion vector offset technique offsets candidate motion vectors derived in the skip mode and the direct mode, but if the distance between the candidate motion vectors is short, the offset values may be the same, which causes redundancy. Therefore, there is a need for an improvement in motion vector offset techniques to reduce redundancy and codestream indication overhead, thereby improving coding performance.
Disclosure of Invention
Technical problem to be solved
The present disclosure provides a video encoding and decoding method and apparatus to at least partially solve the above-mentioned technical problems.
(II) technical scheme
According to an aspect of the present disclosure, there is provided a video encoding method including: deriving a plurality of motion vectors for a current coding block; selecting part of the derived motion vectors to perform offset operation to obtain a first motion vector, wherein the motion vector which is not subjected to the offset operation is a second motion vector; selecting part of motion vectors in the first motion vectors to derive motion vectors in different prediction directions to obtain third motion vectors; determining a motion vector used by the current coding block from the first motion vector, the second motion vector and the third motion vector, and writing information about the determined motion vector into the code stream; and carrying out subsequent coding according to the motion vector used by the current coding block.
In some embodiments of the present disclosure, in selecting a part of the first motion vectors to derive motion vectors in different prediction directions, only motion vectors in part of the different prediction directions are derived.
In some embodiments of the present disclosure, the shifting operation shifts the motion vector in horizontal and vertical directions only, including horizontally to the left, horizontally to the right, vertically up and vertically down, and/or the magnitude of the shift in the shifting operation to shift the motion vector is a power of two pixel.
In some embodiments of the present disclosure, the motion vector derivation rule includes: direct mode, skip mode, and merge mode.
In some embodiments of the present disclosure, the information of the written motion vector includes: information on whether the current coding block performs an offset operation on the derived motion vector, information on which derived motion vector the current coding block is to offset, information on how the current coding block performs an offset operation on the derived motion vector, and information on the prediction direction of the current coding block motion vector.
In some embodiments of the present disclosure, the derived plurality of motion vectors comprises: a motion vector derived from a motion vector of a block corresponding to a position on a reference picture, a motion vector of a bi-prediction derived from a neighboring block, a motion vector of a symmetric prediction derived from a neighboring block, a motion vector of a forward prediction derived from a neighboring block, and a motion vector of a backward prediction derived from a neighboring block.
In some embodiments of the present disclosure, some of the plurality of motion vectors subjected to the offset operation are: motion vectors for bi-prediction derived from neighboring blocks, motion vectors for symmetric prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, and motion vectors for backward prediction derived from neighboring blocks; or a bi-directionally predicted motion vector derived from a neighboring block, a forward predicted motion vector derived from a neighboring block, and a backward predicted motion vector derived from a neighboring block; or a symmetrically predicted motion vector derived from a neighboring block, a forward predicted motion vector derived from a neighboring block, and a backward predicted motion vector derived from a neighboring block; or a forward predicted motion vector derived from a neighboring block and a backward predicted motion vector derived from a neighboring block; or a bi-directionally predicted motion vector derived from a neighboring block and a symmetrically predicted motion vector derived from a neighboring block; or bi-directionally predicted motion vectors derived from neighboring blocks.
In some embodiments of the present disclosure, the partial motion vector in the first motion vector is: motion vectors for bi-prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, motion vectors for backward prediction derived from neighboring blocks, or motion vectors for bi-prediction derived from neighboring blocks and motion vectors for symmetric prediction derived from neighboring blocks; or bi-directionally predicted motion vectors derived from neighboring blocks.
In some embodiments of the present disclosure, in selecting a part of the first motion vectors to derive motion vectors in different prediction directions, deriving only motion vectors in the part of the different prediction directions, where the motion vectors in the part of the different prediction directions include: a forward predicted motion vector and a backward predicted motion vector, or a bi-directional predicted motion vector and a symmetric predicted motion vector, or a bi-directional predicted motion vector, or a forward predicted motion vector, or a backward predicted motion vector.
According to another aspect of the present disclosure, there is provided a video encoding apparatus including: a motion vector deriving unit for deriving a plurality of motion vectors; a motion vector offset unit, configured to perform offset operation on a part of the derived motion vectors to obtain a first motion vector, where a motion vector not subjected to the offset operation is a second motion vector; the motion vector derivation unit with different prediction directions is used for selecting part of motion vectors in the first motion vector to derive motion vectors in different prediction directions to obtain a third motion vector; a motion vector determination and code stream writing unit for determining a motion vector used by the current coding block from the first motion vector, the second motion vector and the third motion vector, and writing information on the motion vector used by the determination in the code stream; and a subsequent encoding unit for performing subsequent encoding according to the motion vector used by the encoding block.
In some embodiments of the present disclosure, the different-prediction-direction motion-vector derivation unit derives only motion vectors in part of the different prediction directions in deriving the motion vectors in the different prediction directions.
According to still another aspect of the present disclosure, there is provided a video decoding method including: analyzing information about whether to perform motion vector offset or not from the code stream, and analyzing a motion vector index value from the code stream according to an analysis result; when the motion vector offset is to be performed, resolving information about the motion vector offset from the code stream; analyzing information about the prediction direction from the code stream according to the index value; determining a motion vector of a current decoding block according to the index value, the information of the motion vector offset and the information of the prediction direction; and decoding the current decoded block according to the determined motion vector.
In some embodiments of the present disclosure, the parsing information about whether to perform motion vector offset from the codestream, and parsing the motion vector index value from the codestream according to the parsing result includes: and if the information analyzed from the code stream indicates that the derived motion vector is not shifted, analyzing a first index value related to the derived motion vector, and if the information analyzed from the code stream indicates that the derived motion vector is shifted, analyzing a second index value related to the derived motion vector, wherein the possible value number of the second index value is less than the possible value number of the first index value.
In some embodiments of the present disclosure, the motion vector of index value one index includes: a motion vector derived from a motion vector of a block corresponding to a position on a reference picture, and/or a motion vector of a bi-prediction derived from a neighboring block, and/or a motion vector of a symmetric prediction derived from a neighboring block, and/or a motion vector of a forward prediction derived from a neighboring block, and/or a motion vector of a backward prediction derived from a neighboring block; the motion vector indexed by the index value two includes: motion vectors for bi-prediction derived from neighboring blocks, motion vectors for symmetric prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, and motion vectors for backward prediction derived from neighboring blocks; or comprises bi-directionally predicted motion vectors derived from neighboring blocks, forward predicted motion vectors derived from neighboring blocks, and backward predicted motion vectors derived from neighboring blocks; or comprises symmetrically predicted motion vectors derived from neighboring blocks, forward predicted motion vectors derived from neighboring blocks, and backward predicted motion vectors derived from neighboring blocks; or comprises forward predicted motion vectors derived from neighboring blocks and backward predicted motion vectors derived from neighboring blocks; or comprises bi-directionally predicted motion vectors derived from neighboring blocks and symmetrically predicted motion vectors derived from neighboring blocks; or bi-directionally predicted motion vectors derived from neighboring blocks.
In some embodiments of the present disclosure, parsing information about the prediction direction from the codestream according to the index value includes at least one of: when the index value indicates to derive a forward motion vector or a backward motion vector, analyzing information about a prediction direction from the code stream, wherein the information has three possible values and can indicate a current decoding block to use forward prediction, backward prediction or bidirectional prediction; when the index value indicates that a bidirectional motion vector or a symmetric motion vector is derived, information about a prediction direction is not parsed from the code stream, and the current decoded block directly uses bidirectional prediction or symmetric prediction.
In some embodiments of the present disclosure, the prediction direction indicated by the information on the prediction direction includes all or a part of forward prediction, backward prediction, bidirectional prediction, symmetric prediction; or if the derived motion vector to be shifted is a forward predicted motion vector, the prediction direction indicated by the information on the prediction direction includes forward prediction and backward prediction; if the derived motion vector to be shifted is a backward prediction motion vector, the prediction direction indicated by the information on the prediction direction includes forward prediction and backward prediction; or if the derived motion vector to be shifted is a forward predicted motion vector, the prediction directions indicated by the information on the prediction directions include forward prediction, backward prediction, and bidirectional prediction; if the derived motion vector to be shifted is a backward prediction motion vector, the prediction directions indicated by the information on the prediction direction include forward prediction, backward prediction, and bidirectional prediction.
In some embodiments of the present disclosure, the information on the motion vector offset includes a direction in which the offset operation is performed and an offset magnitude; the shift operation shifts the motion vector in horizontal and vertical directions only, including horizontally to the left, horizontally to the right, vertically up, and vertically down, and/or the shift operation shifts the motion vector by a magnitude of a power of two pixel.
According to still another aspect of the present disclosure, there is provided a video decoding apparatus including: a motion vector offset enable information parsing unit for parsing information indicating whether the derived motion vector is offset from the code stream; a motion vector index value resolving unit for resolving an index value regarding the derived motion vector according to an instruction of the information resolved by the motion vector offset enabling information resolving unit; a motion vector offset information parsing unit for parsing information on how a motion vector is offset; a prediction direction information parsing unit for parsing information on a prediction direction from the code stream; a motion vector determination unit for determining a motion vector of a current decoded block; and a subsequent decoding unit for performing subsequent decoding according to the determined motion vector of the current decoded block.
In some embodiments of the disclosure, resolving an index value for a derived motion vector according to an indication of information resolved by a motion vector offset enabling information resolving unit comprises: if the information parsed by the motion vector offset enable information parsing unit indicates that the derived motion vector is not to be offset, parsing an index value one with respect to the derived motion vector; if the information parsed by the motion vector offset enable information parsing unit indicates that the derived motion vector is offset, parsing an index value two with respect to the derived motion vector; and the number of possible values of the index value two is less than that of the index value one.
(III) advantageous effects
It can be seen from the foregoing technical solutions that the video encoding and decoding methods and apparatuses provided by the present disclosure have at least one of the following beneficial effects:
(1) based on the relation between each derived motion vector in the motion vector derivation mode, only part of the motion vectors are shifted to obtain different motion vectors as much as possible under the condition of smaller index value overhead, so that the condition that different motion vectors are changed into the same motion vector or similar motion vectors after being shifted is avoided to the maximum extent; meanwhile, when motion vectors in different prediction directions are derived, the original prediction directions of all the motion vectors are considered, and only derivation of other prediction directions of partial motion vectors is supported, so that the bit number for indication is reduced under the condition of not reducing actual candidate motion vectors, namely, the performance of video coding is improved by balancing bit overhead and diversity of the candidate motion vectors;
(2) in the process of deriving the motion vectors in different prediction directions by selecting the motion vectors after the shifting operation of the part, only selecting part of the prediction directions in the different prediction directions to derive the motion vectors, so that the redundancy is further reduced, and the coding efficiency is further improved.
Drawings
Fig. 1 is a flowchart illustrating a video encoding method according to a first embodiment of the present disclosure.
Fig. 2 is a diagram of a video encoding apparatus according to a second embodiment of the disclosure.
Fig. 3 is a schematic diagram of a structure of a motion vector determination and code stream writing unit in an encoding apparatus according to a second embodiment of the present disclosure.
Fig. 4 is a flowchart of a video decoding method according to a third embodiment of the present disclosure.
Fig. 5 is a schematic diagram of a video decoding apparatus according to a fourth embodiment of the disclosure.
[ notation ] to show
201-a motion vector derivation unit; 202-motion vector offset unit;
203-different prediction direction motion vector derivation unit;
204-motion vector determination and code stream writing unit;
204 a-a motion vector determination subunit; 204 b-code stream write subunit;
205-subsequent coding unit;
501-motion vector derivation mode information analysis unit;
502-motion vector offset enable information parsing unit;
503-motion vector index value parsing unit;
504-motion vector offset information parsing unit;
505-a prediction direction information parsing unit;
506-a motion vector determination unit;
507-subsequent decoding unit.
Detailed Description
The invention provides a video coding and decoding method and a device, wherein each motion vector derived from a direct mode, a skip mode and other modes is subjected to statistical analysis, only partial motion vectors are subjected to offset operation, and the condition that different motion vectors are changed into the same motion vector after being offset is avoided to the maximum extent; secondly, according to the distribution conditions of the prediction directions of all the motion vectors derived from the modes such as the direct mode, the skip mode and the like, the adjustment of the prediction directions of the motion vectors after the deviation is also limited, and unnecessary adjustment of the prediction directions is removed, so that the complexity of an encoder is reduced, and the indication cost in a code stream is also reduced, thereby improving the encoding performance.
For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings. In the present disclosure, the term "neighboring block" is a block that is spatially adjacent in the same image.
In a first exemplary embodiment of the present disclosure, a video encoding method is provided.
Fig. 1 is a flowchart illustrating a video encoding method according to a first embodiment of the present disclosure.
Referring to fig. 1, a video encoding method of the present disclosure includes:
step S102: for the current coding block, deriving a plurality of motion vectors according to a motion vector derivation rule;
in this embodiment, the encoder derives a plurality of motion vectors for the current coding block according to a predetermined rule, and obtains a motion vector library including the plurality of motion vectors. The motion vector derivation rule in step S102 may adopt any existing rule, including: motion vector derivation rules employed in the direct mode, the skip mode, and the merge mode, and the like.
In one example, the plurality of motion vectors derived in step S102 includes: a motion vector derived from a motion vector of a block corresponding to a position on a reference picture, a motion vector of a bi-prediction derived from a neighboring block, a motion vector of a symmetric prediction derived from a neighboring block, a motion vector of a forward prediction derived from a neighboring block, and a motion vector of a backward prediction derived from a neighboring block.
Step S104: selecting part of the derived motion vectors to perform offset operation to obtain a first motion vector, wherein the motion vector which is not subjected to the offset operation is a second motion vector;
in step S104, only a part of the motion vectors in the derived motion vector library is selected to perform a shift operation to obtain as many different motion vectors as possible, so as to obtain as many different motion vectors as possible with a smaller index value overhead, reduce the mutual redundancy of the shifted motion vectors, and avoid the situation that different motion vectors become the same motion vector or similar motion vectors after being shifted to the greatest extent.
The principle of selecting the partial motion vectors here is to obtain as many different motion vectors as possible after the offset. In general, the shifting operation is not performed on those motion vectors that are close to or identical to the motion vectors in the derived motion vector library after being shifted, so as to avoid the coincidence with other motion vectors after being shifted, thereby reducing redundancy.
In this embodiment, a plurality of motion vectors obtained by performing different shift operations on each motion vector to be subjected to the shift operation are first motion vectors, and a plurality of motion vectors not subjected to the shift operation are second motion vectors. In other embodiments, a part of the motion vectors in the derived motion vector library is selected to perform a shift operation, the shift operation may be set according to actual needs, and the shift operation of each motion vector may be the same or different. It should be noted that the first motion vector and the second motion vector may each include several vectors, and the "first" and the "second" are used herein to distinguish whether the motion vector is subjected to the offset operation.
In this step S104, the offset operation may be performed in any direction and at any distance in a two-dimensional plane, or may be limited to horizontal and vertical directions, and a possible offset distance is specified. Wherein the shift operation does not change the prediction direction of the motion vector.
In one example, one possible implementation of step S104 is as follows: the motion vectors of the bidirectional prediction derived from the adjacent blocks, the motion vectors of the symmetric prediction derived from the adjacent blocks, the motion vectors of the forward prediction derived from the adjacent blocks, and the motion vectors of the backward prediction derived from the adjacent blocks are subjected to an offset operation, and the motion vectors derived from the motion vectors of the blocks corresponding to the positions on the reference image are not subjected to an offset operation. Alternatively, the shifting operation is performed only on the symmetrically predicted motion vectors derived from the neighboring blocks and/or the bi-directionally predicted motion vectors derived from the neighboring blocks, and not on the other derived motion vectors. Alternatively, the shifting operation is performed only on the forward predicted motion vectors derived from the neighboring blocks and/or the backward predicted motion vectors derived from the neighboring blocks, and the shifting operation is not performed on the other derived motion vectors.
Preferably, one possible implementation method of performing the shift operation is as follows: defining an offset may include horizontally to the left, horizontally to the right, vertically up, vertically down, etc., with the distance of the offset including a power of 2 pixel distance such as one quarter pixel, one half pixel, one pixel, two pixels, four pixels, eight pixels, sixteen pixels, thirty-two pixels, etc.
Step S106: selecting part of motion vectors in the first motion vectors to derive motion vectors in different prediction directions to obtain third motion vectors;
in step S106, a part of the motion vectors in the first motion vector is selected to derive motion vectors in different prediction directions, the motion vectors are derived according to the distribution of the prediction directions of the motion vectors derived in the direct mode and the skip mode, when motion vectors in different prediction directions are derived, the original prediction directions of the motion vectors are considered, only derivation of the part of the motion vectors in other manners is supported, adjustment of the prediction direction of the first motion vector is limited, and unnecessary adjustment of the prediction direction is removed. In this way, the number of bits is reduced without degrading the different motion vector candidates, and the performance of video coding is improved by balancing the bit overhead and the diversity of the candidate motion vectors.
In the present disclosure, the derived motion vectors in different prediction directions may be motion vectors in all other prediction directions, or may be motion vectors in individual prediction directions of the other prediction directions.
In one example, the method of deriving motion vectors in different prediction directions is as follows: a backward motion vector can be derived according to the forward motion vector, and the forward motion vector and the backward motion vector can be combined to obtain a bidirectional motion vector; a forward motion vector may be derived from the backward motion vector, and the forward motion vector and the backward motion vector may be combined to obtain a bi-directional motion vector; the forward motion vector in the bidirectional motion vector can be independently taken out to obtain a forward motion vector, and the backward motion vector in the bidirectional motion vector can be independently taken out to obtain a backward motion vector; the forward motion vector in the symmetric motion vector can be taken out separately to obtain a forward motion vector, and the backward motion vector in the symmetric motion vector can be taken out separately to obtain a backward motion vector.
Preferably, one possible implementation method of step S106 is as follows: in the first motion vector, a motion vector having a direction different from its prediction direction is derived for the forward motion vector and the backward motion vector, and a motion vector having a direction different from its prediction direction is not derived for the motion vectors in the other prediction directions, that is, a backward motion vector and a bidirectional motion vector are derived from the forward motion vector, a forward motion vector and a bidirectional motion vector are derived from the backward motion vector, a motion vector in the other prediction directions are not derived from the bidirectional motion vector, and a motion vector in the other prediction directions are not derived from the symmetric motion vector.
In this embodiment, in order to further reduce redundancy, in the process of selecting a part of motion vectors in the first motion vector to derive motion vectors in different prediction directions, only motion vectors in individual prediction directions in different prediction directions are selected to be derived, that is, when motion vectors in other prediction directions are derived, only motion vectors in some other prediction directions are derived. For example, only the backward motion vector but not the bidirectional motion vector and the symmetric motion vector are derived from the forward motion vector, and only the forward motion vector but not the bidirectional motion vector and the symmetric motion vector are derived from the backward motion vector.
In particular, this case is taken as a special case if all the shifted motion vectors do not require the derivation of further prediction directions.
Step S108: determining a motion vector used by the current coding block from the first motion vector, the second motion vector and the third motion vector, and writing information about the determined motion vector into the code stream;
in this embodiment, the optimal motion vector is selected for the current coding block from all the motion vectors obtained in steps S102, S104, and S106, and the information of the motion vector is written into the code stream. Wherein the obtained motion vector comprises: among the plurality of motion vectors derived in step S102, the motion vector that is not shifted in step S104, the motion vector after the shift operation in step S104, and the motion vectors of different prediction directions derived in step S106 correspond to: a second motion vector, a first motion vector, and a third motion vector. The encoder selects the most appropriate motion vector among these motion vectors for the current coding block to perform inter prediction, and writes information of the selected motion vector into the code stream so that the decoder can determine the motion vector used.
In the present embodiment, the information on the motion vector includes: information on whether the current coding block employs the derived motion vector mode, information on whether the current coding block performs an offset operation on the derived motion vector, information on which derived motion vector the current coding block is offset, information on how the current coding block performs an offset operation on the derived motion vector, and information on the prediction direction of the motion vector of the current coding block.
Step S110: performing subsequent encoding according to the motion vector used by the current encoding block;
in this embodiment, a reference block is obtained according to the motion vector used by the current encoding block determined in step S108, and subsequent encoding is performed. The present disclosure does not limit the subsequent encoding steps.
In a second exemplary embodiment of the present disclosure, a video encoding apparatus is provided.
Fig. 2 is a diagram of a video encoding apparatus according to a second embodiment of the disclosure. Fig. 3 is a schematic diagram of a structure of a motion vector determination and code stream writing unit in an encoding apparatus according to a second embodiment of the present disclosure.
As shown in fig. 2 and fig. 3, the video encoding apparatus of the present disclosure includes: a motion vector derivation unit 201 for deriving a plurality of motion vectors in accordance with a motion vector derivation rule; a motion vector offset unit 202, configured to perform an offset operation on a part of the derived motion vectors to obtain a first motion vector, where a motion vector not subjected to the offset operation is a second motion vector; a motion vector derivation unit 203 in different prediction directions, configured to select a part of motion vectors in the first motion vector to derive motion vectors in different prediction directions, so as to obtain a third motion vector; and a motion vector determination and code stream writing unit 204 for determining a motion vector used by the current coding block from among the first motion vector, the second motion vector, and the third motion vector, and writing information on the motion vector used for the determination in the code stream. Optionally, the encoding apparatus may further include a subsequent encoding unit 205, configured to perform subsequent encoding according to the motion vector used by the encoding block.
The motion vector deriving unit 201 is configured to derive a plurality of motion vectors according to a motion vector derivation rule, in this embodiment, the motion vector deriving unit is configured to derive a plurality of motion vectors in a motion vector direct derivation mode, where the derivation rule is commonly agreed by encoding and decoding or specified in an encoding and decoding standard, and may specifically perform, but is not limited to, step S102 in the first embodiment.
A motion vector offset unit 202, configured to perform an offset operation on a part of the derived motion vectors to obtain a first motion vector, where a motion vector not subjected to the offset operation is a second motion vector; specifically, but not limited to, step S104 of the first embodiment may be performed.
The different-prediction-direction motion vector derivation unit 203 is configured to select a part of the motion vectors in the first motion vector to derive motion vectors in different prediction directions, so as to obtain a third motion vector. Specifically, but not limited to, step S106 of the first embodiment may be performed.
And a motion vector determination and code stream writing unit 204, configured to determine a motion vector used by the current coding block from the first motion vector, the second motion vector, and the third motion vector, and write information about the motion vector used by the determination in the code stream. Step S108 of the first embodiment is performed. Referring to fig. 3, in an embodiment, the motion vector determination and code stream writing unit 204 includes a motion vector determination subunit 204a and a code stream writing subunit 204 b.
And a subsequent encoding unit 205, configured to perform subsequent encoding according to the motion vector used by the encoding block. Specifically, but not limited to, step S110 of the first embodiment may be performed. The invention is not limited to the subsequent encoding step.
In a third exemplary embodiment of the present disclosure, there is provided a video decoding method for decoding corresponding to the encoding of the present disclosure.
Fig. 4 is a flowchart of a video decoding method according to a third embodiment of the present disclosure.
Referring to fig. 4, a video decoding method of the present disclosure includes:
step S402: parsing information on a motion vector derivation mode from a codestream;
in this step S402, the information on the motion vector derivation mode indicates whether the decoder is to derive a motion vector for the currently decoded block, and the derivation mode includes, but is not limited to, a direct mode, a skip mode, a merge mode, and the like, in which the motion vector is directly derived by the decoder, and when these modes are employed, the motion vector difference is not resolved and the motion vector is directly derived for the currently decoded block.
In this embodiment, the information may be a flag bit for indicating whether the current decoding block adopts a mode of directly deriving a motion vector; or an index value, which indicates that the current decoding block adopts a mode of directly deriving the motion vector when the index value is a certain value or values. For example, the information is a skip mode flag bit or a direct mode flag bit, and when the value of the flag bit is equal to 0, it indicates that the skip mode or the direct mode is not used, and when the value of the flag bit is equal to 1, it indicates that the skip mode or the direct mode is used. Or, the information is a coded block type, and indicates that a skip mode is used when a type value is equal to 0, indicates that a direct mode is used when the type value is equal to 1, and indicates that a mode in which a motion vector is directly derived is not used when the type value is equal to other values.
If the information indicates that the motion vector derivation mode is used, the subsequent step S404 is continued. The present disclosure considers the case of using a motion vector derivation mode.
Step S404: after the motion vector export mode is indicated to be adopted, analyzing information about whether motion vector deviation is carried out or not from the code stream, and analyzing a motion vector index value from the code stream according to an analysis result;
if the information obtained by parsing in step S402 indicates that the current decoding block adopts the mode of directly deriving the motion vector, then it continues to parse the information whether to offset the derived motion vector from the code stream, where the offset information may be a flag bit.
Resolving an index value one with respect to the derived motion vector if the information in step S404 indicates that the derived motion vector is not to be shifted; if the information in step S404 indicates that the derived motion vector is offset, an index value of two with respect to the derived motion vector is resolved. And the value range of the index value two is smaller than the index value one.
If the information in step S404 indicates that the derived motion vector is not to be shifted, the decoder performs a subsequent decoding operation using the motion vector directly after deriving the motion vector. In this case, the motion vector derived by the decoder has multiple possible values, indicated by the index value one, which motion vector is to be derived at all.
The motion vector with index value-index includes: a motion vector derived from a motion vector of a block corresponding to a position on a reference picture, and/or a motion vector of a bi-prediction derived from a neighboring block, and/or a motion vector of a symmetric prediction derived from a neighboring block, and/or a motion vector of a forward prediction derived from a neighboring block, and/or a motion vector of a backward prediction derived from a neighboring block.
Preferably, the derived motion vector having a plurality of possible values indicated by the index value one comprises: some or all of the motion vector derived from the motion vector of the block corresponding to the position on the reference image, the motion vector of the bidirectional prediction derived from the adjacent block, the motion vector of the symmetric prediction derived from the adjacent block, the motion vector of the forward prediction derived from the adjacent block, and the motion vector of the backward prediction derived from the adjacent block may also include motion vectors derived by other methods.
If the information in step S404 indicates that the derived motion vector is to be shifted, the decoder needs to shift the derived motion vector before it can be used, i.e. the decoder needs to shift the derived motion vector at the same time as the motion vector is derived. In this case, the motion vector derived by decoding has one or more possible values, which is indicated by the index value to derive at all. The possible values are a subset of possible values of the motion vector derived without shifting the derived motion vector, and therefore the value range of the index value two is necessarily smaller than the value range of the index value one.
The motion vector indexed by the index value two includes: motion vectors for bi-prediction derived from neighboring blocks, motion vectors for symmetric prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, and motion vectors for backward prediction derived from neighboring blocks; or comprises bi-directionally predicted motion vectors derived from neighboring blocks, forward predicted motion vectors derived from neighboring blocks, and backward predicted motion vectors derived from neighboring blocks; or comprises symmetrically predicted motion vectors derived from neighboring blocks, forward predicted motion vectors derived from neighboring blocks, and backward predicted motion vectors derived from neighboring blocks; or comprises forward predicted motion vectors derived from neighboring blocks and backward predicted motion vectors derived from neighboring blocks; or comprises bi-directionally predicted motion vectors derived from neighboring blocks and symmetrically predicted motion vectors derived from neighboring blocks; or bi-directionally predicted motion vectors derived from neighboring blocks.
Preferably, the derived motion vector having a plurality of possible values indicated by the index value two comprises: some or all of the motion vectors for bi-prediction derived from neighboring blocks, symmetric prediction derived from neighboring blocks, forward prediction derived from neighboring blocks, and backward prediction derived from neighboring blocks, but less motion vectors are included than if the motion vectors were not offset. Therefore, the number of index values two should also be smaller than the number of index values one.
If the information indicates that the motion vector is shifted, the subsequent step S406 is continued, and if the information indicates that the motion vector is not shifted, the subsequent decoding operation is performed according to the original motion vector derivation mode, which is not limited in the present disclosure.
Step S406: when the motion vector offset is to be performed, resolving information about the motion vector offset from the code stream;
if the information in step S404 indicates that the derived motion vector needs to be shifted, the shift operation is performed by locating the motion vector according to the index value, and the information about the motion vector shift analyzed in step S406 indicates what shift operation is performed on the derived motion vector. The information on the motion vector offset includes a direction in which the offset operation is performed and an offset magnitude.
In the present embodiment, the information on the motion vector offset may also be composed of an offset direction and an offset magnitude. The offset directions include horizontal left, horizontal right, vertical up, vertical down, and the like; the offset magnitude includes power of two pixels, such as a quarter pixel, a half pixel, a pixel, two pixels, four pixels, eight pixels, sixteen pixels, thirty-two pixels, and so on. The code stream may indicate the offset direction and the offset magnitude.
In other embodiments, the information about the motion vector offset may be a two-dimensional vector, the two dimensions of which define the offset in the horizontal and vertical directions, respectively. For example, the analyzed offset information is (x, y), where x represents the offset of the horizontal component of the motion vector and y represents the offset of the vertical component of the motion vector.
Step S408: analyzing information about the prediction direction from the code stream according to the index value;
and determining whether the information about the prediction direction needs to be analyzed from the code stream and determining the possible value of the information about the prediction direction from the code stream according to the index value II.
The prediction direction indicated by the information on the prediction direction includes all or a part of forward prediction, backward prediction, bidirectional prediction and symmetric prediction; or
If the derived motion vector to be shifted is a forward predicted motion vector, the prediction direction indicated by the information on the prediction direction includes forward prediction and backward prediction; if the derived motion vector to be shifted is a backward prediction motion vector, the prediction direction indicated by the information on the prediction direction includes forward prediction and backward prediction; or
If the derived motion vector to be shifted is a forward predicted motion vector, the prediction directions indicated by the information on the prediction directions include forward prediction, backward prediction, and bidirectional prediction; if the derived motion vector to be shifted is a backward prediction motion vector, the prediction directions indicated by the information on the prediction directions include forward prediction, backward prediction, and bidirectional prediction; if the derived motion vector to be shifted is a bidirectional predictive motion vector, the prediction direction indicated by the information on the prediction direction includes; bi-directional prediction, forward prediction, and backward prediction; if the derived motion vector to be shifted is a symmetric predicted motion vector, the prediction direction indicated by the information on the prediction direction includes; symmetric prediction, forward prediction, and backward prediction.
In the present embodiment, the index value two indicates which prediction direction the motion vector to be derived is if the derived motion vector needs to be offset. For some derived motion vectors, the decoder directly uses the derived motion vectors after offsetting the derived motion vectors for a subsequent decoding process, and the actual prediction direction is the prediction direction of the derived motion vectors, so that the information about the prediction direction does not need to be analyzed; for some derived motion vectors, the decoder derives motion vectors in different prediction directions according to the motion vectors after offsetting the motion vectors, and then performs a subsequent decoding process, wherein the actual prediction direction is different from the prediction direction of the derived motion vectors, so that information about the prediction direction needs to be analyzed from a code stream.
Preferably, one possible implementation method for analyzing the information about the prediction direction from the code stream according to the index value is as follows: for the forward motion vector and the backward motion vector, a motion vector different from the prediction direction is derived, and for the motion vectors in other prediction directions, a motion vector different from the prediction direction is not derived, that is, the backward motion vector and the bidirectional motion vector are derived according to the forward motion vector, the forward motion vector and the bidirectional motion vector are derived according to the backward motion vector, the motion vectors in other directions are not derived according to the bidirectional motion vector, and the motion vectors in other prediction directions are not derived according to the symmetric motion vector. When the index value indicates to derive a forward motion vector, the information about the prediction direction is analyzed from the code stream, and the information has three possible values which can indicate that the current decoding block uses forward prediction, backward prediction or bidirectional prediction; when the index value indicates to derive a backward motion vector, analyzing information about a prediction direction from the code stream, wherein the information has three possible values and can indicate a current decoding block to use forward prediction, backward prediction or bidirectional prediction; when the index value indicates that a bidirectional motion vector or a symmetric motion vector is derived, information about a prediction direction is not parsed from the code stream, and the current decoded block directly uses bidirectional prediction or symmetric prediction.
Further, in the case of encoding, when motion vectors for other prediction directions need to be derived at the time of decoding, only motion vectors for individual other prediction directions are derived. For example, only the backward motion vector and not the bidirectional motion vector are derived from the forward motion vector, and only the forward motion vector and not the bidirectional motion vector are derived from the backward motion vector. When the index value indicates to derive a forward motion vector, the information about the prediction direction is analyzed from the code stream, and the information has two possible values, which may indicate that the current decoding block uses forward prediction or backward prediction; when the index value indicates to derive the backward motion vector, the information about the prediction direction is analyzed from the code stream, and the information has two possible values, which may indicate that the current decoding block uses forward prediction or backward prediction; when the index value indicates that a bidirectional motion vector or a symmetric motion vector is derived, information about a prediction direction is not parsed from the code stream, and the current decoded block directly uses bidirectional prediction or symmetric prediction.
In one example, a motion vector with a different prediction direction may be derived from the shifted motion vector obtained in step S406. For example, a backward motion vector may be derived from the forward motion vector, and the forward and backward motion vectors may be combined to obtain a bi-directional motion vector; a forward motion vector may be derived from the backward motion vector, and the forward motion vector and the backward motion vector may be combined to obtain a bi-directional motion vector; the forward motion vector in the bidirectional motion vector can be independently taken out to obtain a forward motion vector, and the backward motion vector in the bidirectional motion vector can be independently taken out to obtain a backward motion vector; the forward motion vector in the symmetric motion vector can be taken out separately to obtain a forward motion vector, and the backward motion vector in the symmetric motion vector can be taken out separately to obtain a backward motion vector.
In particular, if for all the shifted motion vectors no motion vector needs to be derived that differs from its prediction direction, no information about the prediction direction is parsed from the codestream.
The above analysis of information on the motion vector offset in step S406 and the analysis of information on the prediction direction in step S408 have no interdependence relationship, and may be performed in an alternative order. In addition, the analysis of the information about the motion vector offset in S406 may be performed before the motion vector index value is analyzed in the code stream after the information about whether the motion vector offset is performed is analyzed in step S404 from the code stream.
Step S410: determining a motion vector of a current decoding block according to the index value, the information of the motion vector offset and the information of the prediction direction;
in this embodiment, the step S410 of determining the information in the motion vector of the current decoded block according to the information includes the information in the steps S402, S404, S406, and S408, and specific operations include the following cases:
if the information parsed in steps S402 and S404 indicates that the current decoded block adopts a mode of directly deriving motion vectors and the derived motion vectors need to be shifted, the decoder derives motion vectors according to an index value two, for example, if the index value indicates a forward motion vector, motion vectors whose prediction directions are forward are derived according to a rule, if the index value indicates a backward motion vector, motion vectors whose prediction directions are backward are derived according to a rule, if the index value indicates a bidirectional motion vector, motion vectors whose prediction directions are bidirectional are derived according to a rule, and if the index value indicates a symmetric motion vector, motion vectors whose prediction directions are symmetric are derived according to a rule; after the motion vector is derived, the derived motion vector is shifted according to the information on the shift in step S406, and then the motion vector of a different prediction direction is derived according to the information on the prediction direction analyzed in step S408, and a final motion vector is obtained. For example, if the derived motion vector is a forward motion vector and the information parsed in step S408 indicates bidirectional prediction, a motion vector whose prediction direction is backward is derived from the biased forward motion vector, and then the forward motion vector and the backward motion vector are combined into a bidirectional motion vector, and the bidirectional motion vector is determined to be a motion vector of the current decoded block; if the derived motion vector is a forward motion vector and the information analyzed in step S408 indicates backward prediction, deriving a motion vector whose prediction direction is backward according to the biased forward motion vector, and then determining that the backward motion vector is a motion vector of the current decoded block; if the derived motion vector is a backward motion vector and the information analyzed in step S408 indicates bidirectional prediction, deriving a motion vector whose prediction direction is forward from the shifted backward motion vector, then combining the forward motion vector and the backward motion vector into a bidirectional motion vector, and determining that the bidirectional motion vector is a motion vector of the current decoded block; if the derived motion vector is a backward motion vector and the information analyzed in step S408 indicates forward prediction, deriving a motion vector whose prediction direction is forward from the shifted backward motion vector, and then determining that the forward motion vector is a motion vector of the current decoded block; if the derived motion vector is a bidirectional or symmetric motion vector and the parsed information in step S408 indicates forward prediction, determining that a forward motion vector in the bidirectional or symmetric motion vector is a motion vector of the current decoded block; if the derived motion vector is a bi-directional or symmetric motion vector and the information parsed in step S408 indicates backward prediction, it is determined that a backward motion vector of the bi-directional or symmetric motion vector is a motion vector of the current decoded block.
After the motion vector of the currently decoded block is determined, a reference block is obtained from the motion vector for a subsequent decoding step. The present disclosure does not limit the subsequent decoding steps.
In a fourth exemplary embodiment of the present disclosure, a video decoding apparatus is provided.
Fig. 5 is a schematic diagram of a video decoding apparatus according to a fourth embodiment of the disclosure.
Referring to fig. 5, the video decoding apparatus of the present disclosure includes: a motion vector derivation mode information parsing unit 501 for parsing information on a motion vector derivation mode from a code stream; a motion vector offset enable information parsing unit 502 for parsing information indicating whether the derived motion vector is offset from the code stream; a motion vector index value parsing unit 503 for parsing an index value regarding the derived motion vector according to the information indication parsed by the motion vector offset enable information parsing unit; a motion vector offset information analysis unit 504 for analyzing information on the motion vector offset; a prediction direction information parsing unit 505 for parsing information on a prediction direction from the code stream; and a motion vector determination unit 506 for determining a motion vector of the currently decoded block. Optionally, the video decoding apparatus may further include a subsequent decoding unit 507, configured to perform a subsequent decoding process according to the determined motion vector of the current decoded block.
The motion vector derivation mode information parsing unit 501 is configured to parse information about a motion vector derivation mode from a code stream, and in this embodiment, to parse information about whether a motion vector direct derivation mode is adopted by a current decoding block from the code stream, but is not limited to step S402 in the third embodiment.
A motion vector offset enable information parsing unit 502 for parsing information indicating whether to offset the derived motion vector from the codestream.
A motion vector index value analyzing unit 503 for analyzing an index value with respect to the derived motion vector according to the information indication analyzed by the motion vector offset enabling information analyzing unit, and if the information analyzed by the motion vector offset enabling information analyzing unit 502 indicates that the derived motion vector is not offset, analyzing an index value one with respect to the derived motion vector; if the information parsed by the motion vector offset enable information parsing unit indicates that the derived motion vector is offset, an index value two with respect to the derived motion vector is parsed. And the value range of the index value two is smaller than the index value one. The motion vector offset enabling information parsing unit 502 and the index value parsing unit 503 of the motion vector may perform, but are not limited to, step S404 in the third embodiment.
The motion vector offset information parsing unit 504 is configured to parse information about motion vector offset, and may specifically perform, but is not limited to, step S406 in the third embodiment.
The prediction direction information parsing unit 505 is configured to parse information about a prediction direction from the codestream, and may specifically perform, but is not limited to, step S408 in the third embodiment.
A motion vector determination unit 506, configured to determine a motion vector of the currently decoded block. Step S410 of the third embodiment is performed.
The subsequent decoding unit 507 is configured to perform subsequent decoding according to the determined motion vector of the current decoded block, which is not limited by the present invention.
In summary, the present disclosure provides a video encoding and decoding method and apparatus, wherein statistical analysis is performed on each motion vector derived in a direct mode, a skip mode, and other modes, and a part of motion vectors in a derived motion vector library is selected to perform a shift operation, so as to obtain as many different motion vectors as possible, obtain as many different motion vectors as possible under a smaller index value overhead, and avoid a situation that different motion vectors become the same motion vector after being shifted to the maximum extent; secondly, according to the distribution situation of the prediction directions of each motion vector derived from the modes such as the direct mode, the skip mode and the like, when motion vectors with different prediction directions are derived, the original prediction directions of each motion vector are considered, and the derivation of other prediction directions of partial motion vectors is only supported, so that the bit number is reduced under the condition of not reducing motion vector candidates, and the performance of video coding is improved by balancing the bit overhead and the diversity of the candidate motion vectors. On one hand, the complexity of the encoder is reduced, and on the other hand, the cost of the indication of the prediction direction in the code stream is also reduced, so that the encoding performance is improved. Furthermore, in the process of deriving motion vectors in different prediction directions from the motion vector after the shift operation is performed on the selection part, only motion vectors in individual prediction directions in different prediction directions are derived, so that redundancy is further reduced, and the coding efficiency is further improved.
The above-mentioned embodiments are intended to illustrate the objects, aspects and advantages of the present disclosure in further detail, and it should be understood that the above-mentioned embodiments are only illustrative of the present disclosure and are not intended to limit the present disclosure, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (19)

1. A video encoding method, comprising:
deriving a plurality of motion vectors for a current coding block;
selecting part of the derived motion vectors to perform offset operation to obtain a first motion vector, wherein the motion vector which is not subjected to the offset operation is a second motion vector;
selecting part of motion vectors in the first motion vectors to derive motion vectors in different prediction directions to obtain third motion vectors;
determining a motion vector used by the current coding block from the first motion vector, the second motion vector and the third motion vector, and writing information about the determined motion vector into the code stream; and
and carrying out subsequent coding according to the motion vector used by the current coding block.
2. The video coding method of claim 1, wherein in the selecting the partial motion vectors in the first motion vector to derive the motion vectors in different prediction directions, only the motion vectors in the partial prediction directions in the different prediction directions are derived.
3. The video coding method of claim 1 or 2, wherein:
the shift operation shifts the motion vector in horizontal and vertical directions only, including horizontally left, horizontally right, vertically up and vertically down, and/or
The offset operation is performed by shifting the motion vector by a power of two pixel.
4. The video coding method of any of claims 1 to 3, wherein the motion vector derivation rule comprises: direct mode, skip mode, and merge mode.
5. The video coding method of any of claims 1 to 4, wherein the written information of the motion vector comprises:
information on whether the current coding block performs an offset operation on the derived motion vector, information on which derived motion vector the current coding block is to offset, information on how the current coding block performs an offset operation on the derived motion vector, and information on the prediction direction of the current coding block motion vector.
6. The video coding method of any of claims 1 to 5, wherein the derived plurality of motion vectors comprises: a motion vector derived from a motion vector of a block corresponding to a position on a reference picture, a motion vector of a bi-prediction derived from a neighboring block, a motion vector of a symmetric prediction derived from a neighboring block, a motion vector of a forward prediction derived from a neighboring block, and a motion vector of a backward prediction derived from a neighboring block.
7. The video coding method of claim 6, wherein the partial motion vectors of the plurality of motion vectors subjected to the offset operation are:
motion vectors for bi-prediction derived from neighboring blocks, motion vectors for symmetric prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, and motion vectors for backward prediction derived from neighboring blocks; or
Motion vectors for bi-prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, and motion vectors for backward prediction derived from neighboring blocks; or
A symmetric predicted motion vector derived from a neighboring block, a forward predicted motion vector derived from a neighboring block, and a backward predicted motion vector derived from a neighboring block; or
Forward predicted motion vectors derived from neighboring blocks and backward predicted motion vectors derived from neighboring blocks; or
A bi-directionally predicted motion vector derived from the neighboring blocks and a symmetrically predicted motion vector derived from the neighboring blocks; or
Motion vectors for bi-prediction derived from neighboring blocks.
8. The video coding method of claim 7, wherein some of the first motion vectors are:
motion vectors for bi-prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, motion vectors for backward prediction derived from neighboring blocks, or
Motion vectors for forward prediction derived from neighboring blocks, motion vectors for backward prediction derived from neighboring blocks, or
A bi-directionally predicted motion vector derived from the neighboring blocks and a symmetrically predicted motion vector derived from the neighboring blocks; or
Motion vectors for bi-prediction derived from neighboring blocks.
9. The video coding method of claim 8, wherein in selecting the partial motion vectors in the first motion vector to derive the motion vectors in different prediction directions, only the motion vectors in the partial prediction directions in the different prediction directions are derived, and the motion vectors in the partial prediction directions in the different prediction directions comprise:
forward predictive motion vectors and backward predictive motion vectors, or
Bi-directionally predicted motion vectors and symmetrically predicted motion vectors, or
Bi-directionally predicting motion vectors, or
Forward predicted motion vector, or
Backward predicting the motion vector.
10. A video encoding device, comprising:
a motion vector deriving unit for deriving a plurality of motion vectors;
a motion vector offset unit, configured to perform offset operation on a part of the derived motion vectors to obtain a first motion vector, where a motion vector not subjected to the offset operation is a second motion vector;
the motion vector derivation unit with different prediction directions is used for selecting part of motion vectors in the first motion vector to derive motion vectors in different prediction directions to obtain a third motion vector;
a motion vector determination and code stream writing unit for determining a motion vector used by the current coding block from the first motion vector, the second motion vector and the third motion vector, and writing information on the motion vector used by the determination in the code stream; and
and the subsequent coding unit is used for performing subsequent coding according to the motion vector used by the coding block.
11. The video encoding apparatus according to claim 10, wherein the different-prediction-direction motion-vector derivation unit derives only motion vectors in some of the different prediction directions in deriving the motion vectors in the different prediction directions.
12. A video decoding method, comprising:
analyzing information about whether to perform motion vector offset or not from the code stream, and analyzing a motion vector index value from the code stream according to an analysis result;
when the motion vector offset is to be performed, resolving information about the motion vector offset from the code stream;
analyzing information about the prediction direction from the code stream according to the index value;
determining a motion vector of a current decoding block according to the index value, the information of the motion vector offset and the information of the prediction direction; and
and decoding the current decoding block according to the determined motion vector.
13. The video decoding method of claim 12, wherein the parsing information about whether to perform the motion vector offset from the codestream, and parsing the motion vector index value from the codestream according to the parsing result comprises:
and if the information analyzed from the code stream indicates that the derived motion vector is not shifted, analyzing a first index value related to the derived motion vector, and if the information analyzed from the code stream indicates that the derived motion vector is shifted, analyzing a second index value related to the derived motion vector, wherein the possible value number of the second index value is less than the possible value number of the first index value.
14. The video decoding method of claim 13,
the motion vector with the index value of one index comprises: a motion vector derived from a motion vector of a block corresponding to a position on a reference picture, and/or a motion vector of a bi-prediction derived from a neighboring block, and/or a motion vector of a symmetric prediction derived from a neighboring block, and/or a motion vector of a forward prediction derived from a neighboring block, and/or a motion vector of a backward prediction derived from a neighboring block;
the index value-two indexed motion vector includes: motion vectors for bi-prediction derived from neighboring blocks, motion vectors for symmetric prediction derived from neighboring blocks, motion vectors for forward prediction derived from neighboring blocks, and motion vectors for backward prediction derived from neighboring blocks; or comprises bi-directionally predicted motion vectors derived from neighboring blocks, forward predicted motion vectors derived from neighboring blocks, and backward predicted motion vectors derived from neighboring blocks; or comprises symmetrically predicted motion vectors derived from neighboring blocks, forward predicted motion vectors derived from neighboring blocks, and backward predicted motion vectors derived from neighboring blocks; or comprises forward predicted motion vectors derived from neighboring blocks and backward predicted motion vectors derived from neighboring blocks; or comprises bi-directionally predicted motion vectors derived from neighboring blocks and symmetrically predicted motion vectors derived from neighboring blocks; or bi-directionally predicted motion vectors derived from neighboring blocks.
15. The video decoding method according to claim 13 or 14, wherein said parsing information about prediction direction from the codestream according to the index value comprises at least one of:
when the index value indicates to derive a forward motion vector or a backward motion vector, analyzing information about a prediction direction from the code stream, wherein three possible values of the information respectively indicate that a current decoding block uses forward prediction, backward prediction and bidirectional prediction;
when the index value indicates that a bidirectional motion vector or a symmetric motion vector is derived, information about a prediction direction is not parsed from the code stream, and the current decoded block directly uses bidirectional prediction or symmetric prediction.
16. The video decoding method of any of claims 13 to 15, wherein:
the prediction direction indicated by the information on the prediction direction comprises all or part of forward prediction, backward prediction, bidirectional prediction and symmetric prediction; or
If the derived motion vector to be shifted is a forward prediction motion vector, the prediction direction indicated by the information on the prediction direction includes forward prediction and backward prediction; if the derived motion vector to be shifted is a backward prediction motion vector, the prediction direction indicated by the information on the prediction direction includes forward prediction and backward prediction; or
If the derived motion vector to be shifted is a forward prediction motion vector, the prediction directions indicated by the information on the prediction directions include forward prediction, backward prediction, and bidirectional prediction; if the derived motion vector to be shifted is a backward prediction motion vector, the prediction directions indicated by the information on the prediction direction include forward prediction, backward prediction, and bidirectional prediction.
17. The video coding method of any of claims 13 to 16, wherein:
the information on the motion vector offset includes a direction in which the offset operation is performed and an offset magnitude;
the shifting operation shifts the motion vector in horizontal and vertical directions only, including horizontally left, horizontally right, vertically up, and vertically down, and/or,
the offset operation is performed by shifting the motion vector by a power of two pixel.
18. A video decoding apparatus, comprising:
a motion vector offset enable information parsing unit for parsing information indicating whether the derived motion vector is offset from the code stream;
a motion vector index value resolving unit for resolving an index value regarding the derived motion vector according to an instruction of the information resolved by the motion vector offset enabling information resolving unit;
a motion vector offset information parsing unit for parsing information on how a motion vector is offset;
a prediction direction information parsing unit for parsing information on a prediction direction from the code stream;
a motion vector determination unit for determining a motion vector of a current decoded block; and
and the subsequent decoding unit is used for performing subsequent decoding according to the determined motion vector of the current decoding block.
19. The decoding apparatus of claim 18, wherein the parsing an index value for the derived motion vector according to the indication of the information parsed by the motion vector offset enabling information parsing unit comprises:
if the information parsed by the motion vector offset enable information parsing unit indicates that the derived motion vector is not to be offset, parsing an index value one with respect to the derived motion vector; if the information parsed by the motion vector offset enable information parsing unit indicates that the derived motion vector is offset, parsing an index value two with respect to the derived motion vector; and the number of possible values of the index value two is less than that of the index value one.
CN201810986251.XA 2018-08-27 2018-08-27 Video encoding and decoding methods and devices Active CN110868611B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810986251.XA CN110868611B (en) 2018-08-27 2018-08-27 Video encoding and decoding methods and devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810986251.XA CN110868611B (en) 2018-08-27 2018-08-27 Video encoding and decoding methods and devices

Publications (2)

Publication Number Publication Date
CN110868611A true CN110868611A (en) 2020-03-06
CN110868611B CN110868611B (en) 2023-09-12

Family

ID=69651187

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810986251.XA Active CN110868611B (en) 2018-08-27 2018-08-27 Video encoding and decoding methods and devices

Country Status (1)

Country Link
CN (1) CN110868611B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020061065A1 (en) * 2000-11-09 2002-05-23 Kevin Moore Transition templates for compressed digital video and method of generating the same
CN101193303A (en) * 2007-09-14 2008-06-04 四川虹微技术有限公司 Fast motion estimating method
WO2009114986A1 (en) * 2008-03-20 2009-09-24 华为技术有限公司 Method, device for scaling motion vector and encoding, decoding method and system
CN101605256A (en) * 2008-06-12 2009-12-16 华为技术有限公司 A kind of method of coding and decoding video and device
CN108134939A (en) * 2016-12-01 2018-06-08 北京金山云网络技术有限公司 A kind of method for estimating and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020061065A1 (en) * 2000-11-09 2002-05-23 Kevin Moore Transition templates for compressed digital video and method of generating the same
CN101193303A (en) * 2007-09-14 2008-06-04 四川虹微技术有限公司 Fast motion estimating method
WO2009114986A1 (en) * 2008-03-20 2009-09-24 华为技术有限公司 Method, device for scaling motion vector and encoding, decoding method and system
CN101605256A (en) * 2008-06-12 2009-12-16 华为技术有限公司 A kind of method of coding and decoding video and device
CN108134939A (en) * 2016-12-01 2018-06-08 北京金山云网络技术有限公司 A kind of method for estimating and device

Also Published As

Publication number Publication date
CN110868611B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
KR102284099B1 (en) Image encoding/decoding method and device
CN107113424B (en) With the Video coding and coding/decoding method of the block of inter-frame forecast mode coding
CN102656890B (en) For the method and apparatus of Video coding
CN107770524B (en) Video coding and decoding processing method and device
CN102835111B (en) The motion vector of previous block is used as the motion vector of current block, image to be carried out to the method and apparatus of coding/decoding
CN104584549A (en) Method and apparatus for video coding
CN104768011A (en) Image encoding and decoding method and related device
CN102860006A (en) Managing predicted motion vector candidates
CN102685504B (en) The decoding method of video image, code device, decoding device and system thereof
CN106031170A (en) Method of motion information coding
KR20170069917A (en) Method and apparatus for encoding and decoding an information indicating a prediction method of an intra skip mode
KR20190122638A (en) Apparatus and method for intra prediction coding/decoding based on adaptive candidate modes
JP7448558B2 (en) Methods and devices for image encoding and decoding
CN113163207B (en) Encoding and decoding method, device and equipment
JP2024508193A (en) Decoding method, encoding method, apparatus, device and storage medium
CN110868611B (en) Video encoding and decoding methods and devices
CN110636290B (en) Video image motion vector encoding/decoding method and encoder/decoder
US20220103826A1 (en) Encoding/decoding method and apparatus for motion vector information
CN110691247B (en) Decoding and encoding method and device
CA2614571C (en) A method for encoding images in a block-based manner employing block spatial prediction
CN107197288B (en) Video global disparity vector encoding method, decoding method and device
KR20230148506A (en) A method and an apparatus for processing a video signal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant