Motion vector prediction coding and decoding method, device and coding and decoding systemTechnical Field
The present invention relates to the field of video encoding and decoding, and in particular, to a motion vector prediction encoding and decoding method, device, and encoding and decoding system.
Background
As video applications continue to be developed, video coding standards and algorithms are also rapidly developed, for example, the latest video coding standard H264 has greatly improved image compression efficiency compared with the conventional coding standard such as H263, but also brings new problems. The image coding algorithm in the new video coding standard is more refined, and the division of the image data is smaller and smaller, for example, the minimum processing unit of H264 on the luminance data is 4 × 4. This has the advantage that the accuracy of motion prediction can be improved during inter prediction. The defects that the increase of motion vectors is caused by the refinement of the data processing unit, a large amount of data is needed to transmit the motion vectors, and the code rate is increased are particularly remarkable in low-code-rate video compression, and about 20% to 30% of data in a low-code-rate video stream is counted to be used for transmitting the motion vectors.
Disclosure of Invention
The embodiment of the invention aims to provide a motion vector prediction coding method, and aims to solve the problem that in the prior art, in low-bit-rate video compression, the bit rate is increased due to the increase of motion vectors caused by the refinement of a data processing unit.
The motion vector predictive coding method of the embodiment of the invention is realized by the following steps:
obtaining a motion vector (mv) of a current block after motion prediction;
constructing a candidate motion vector set for motion vector predictive coding;
selecting an optimal motion vector predictor (mv) from a set of candidate motion vectorsbest);
And solving a motion vector difference (mvd) between the current block motion vector and the optimal motion vector prediction value.
Preferably, the step of calculating the motion vector difference between the current block motion vector and the optimal motion vector predictor further comprises the steps of:
analog decoding of motion vectors at a coding end to obtain an optimal motion vector analog value (mv)dec)。
Preferably, the step of calculating the motion vector difference between the current block motion vector and the optimal motion vector predictor further comprises the steps of:
and the motion vector difference (mvd) is coded by an entropy coding module and sent to a decoding end.
A second object of an embodiment of the present invention is to provide a motion vector prediction encoding apparatus, including:
a motion vector obtaining module, configured to obtain a motion vector of the current block after motion prediction;
a candidate motion vector set construction module for constructing a candidate motion vector set for motion vector predictive coding; the method specifically comprises the following steps: selecting motion vector mv of left adjacent block of current blockAAnd the motion vector mv of the block right above the current blockBMotion vector mv of the upper right block of the current blockCAnd the predicted motion vector mv obtained by the H264 method for the current blockh264Motion vector mv of block at same position in previous frame of current frameDMotion vector mv of reference block to which motion vector mv of current block pointsEForming a candidate motion vector set
[mvAmvBmvCmvh264mvDmvE]Each candidate motion vector has its specific position sequence number in the candidate motion vector set;
the optimal motion vector predicted value selecting module is used for selecting an optimal motion vector predicted value from the candidate motion vector set and comprises a motion vector predicted difference bit number calculating module and a motion vector difference selecting module;
a motion vector prediction difference bit number calculation module for calculating the bit number R (mv-mv) required for coding the motion vector prediction differenceP) Wherein, mvP∈[mvAmvBmvCmvh264mvDmvE]Where mv is the current block motion vector, mvPIs a prediction value of a motion vector, mvPIs selected in the set of candidate motion vectors;
a motion vector difference bit number selection module for selecting a number R (mv-mv) of bits that causes a motion vector difference to be encodedP) Minimum motion vector predictor mvPPredicting value mv for optimal motion vectorbest;
A motion vector difference obtaining module for obtaining the motion vector mv of the current block and the optimal motion vector prediction value mvbestThe motion vector difference mvd, mvd-mvbest。
Preferably, the apparatus further comprises:
and the motion vector difference sending module is used for sending the motion vector difference mvd to a decoding end through the coding of the entropy coding module.
Preferably, the apparatus further comprises:
and the analog decoding module is connected with the motion vector difference solving module and is used for performing analog decoding on the motion vector at the encoding end so as to obtain an optimal motion vector analog value.
A third objective of an embodiment of the present invention is to provide a motion vector prediction decoding method, where the method includes:
receiving code stream data sent by an encoding end;
detecting whether the received code stream data contains the position serial number of the motion vector in the candidate motion vector set;
and decoding in different modes according to whether the code stream data contains the motion vector position serial number.
The "decoding in different manners according to whether the code stream data includes the motion vector position serial number" specifically includes:
when the code stream data contains the position serial number, acquiring an optimal motion vector predicted value mv from a motion vector candidate set according to the motion vector position serial numberbestFurther decoding the calculated motion vector mv of the current block, wherein mvd is mv-mvbest;
When the code stream data does not contain the position serial number, decoding the received motion vector difference mvd to obtain a current block motion vector, wherein mvd is mv-mvbest;
A fourth object of an embodiment of the present invention is to provide an apparatus for motion vector prediction decoding, the apparatus including:
the data receiving module is used for receiving code stream data sent by the encoding end, wherein the code stream data comprises a motion vector difference and/or a motion vector position sequence number;
a motion vector position serial number detection module, configured to detect whether received code stream data includes a motion vector position serial number, where the motion vector position serial number is a specific position serial number of a candidate motion vector in a candidate motion vector set;
the decoding module is used for decoding and calculating the received motion vector difference to obtain the motion vector of the current block when the code stream data does not contain the position serial number of the motion vector; and when the code stream data contains the motion vector position serial number, obtaining the optimal motion vector predicted value from the motion vector candidate set according to the motion vector position serial number, and further decoding the calculated motion vector of the current block.
A fifth object of an embodiment of the present invention is to provide a motion vector prediction encoding and decoding system, which includes the motion vector prediction encoding apparatus and the motion vector prediction decoding apparatus.
The invention has the advantages of
According to the embodiment of the invention, a set of motion vector analog decoding module is constructed at the encoding end, the predicted value of the motion vector is more accurately selected through the spatial and temporal correlation, the code rate of the motion vector difference value is reduced, the motion vector data can be more finely compressed, and the output code rate is reduced.
Drawings
FIG. 1 is a flow chart of a method for predictive coding a motion vector according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for decoding motion vectors at an encoding end to obtain an optimal motion vector analog value in the method of FIG. 1;
FIG. 3 is a diagram illustrating candidate motion vector positions when a current block is located at column 1 and line k of a current frame according to an embodiment of the present invention;
FIG. 4 is a block diagram of an exemplary motion vector prediction encoding apparatus;
FIG. 5 is a block diagram of an analog decoding module of the apparatus shown in FIG. 4;
FIG. 6 is a flowchart of a method for decoding a motion vector predictor according to an embodiment of the present invention;
FIG. 7 is a block diagram of an exemplary motion vector prediction decoding apparatus;
fig. 8 is a schematic structural diagram of a motion vector prediction encoding/decoding system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and examples, and for convenience of description, only parts related to the examples of the present invention are shown. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
According to the embodiment of the invention, a set of motion vector analog decoding module is constructed at the encoding end, the predicted value of the motion vector is more accurately selected through the spatial and temporal correlation, the code rate of the motion vector difference value is reduced, the motion vector data can be more finely compressed, and the output code rate is reduced.
Example one
Fig. 1 is a flowchart of a motion vector predictive coding method according to an embodiment of the present invention, where the method includes the following steps:
s101, obtaining a motion vector mv of a current block after motion prediction;
s102, constructing a candidate motion vector set for motion vector predictive coding;
the specific method for constructing the candidate motion vector set for the motion vector predictive coding comprises the following steps: selecting motion vector mv of left adjacent block of current blockAAnd the motion vector mv of the block right above the current blockBMotion vector mv of the upper right block of the current blockCAnd the predicted motion vector mv obtained by the H264 method for the current blockh264Motion vector mv of block at same position in previous frame of current frameDMotion vector mv of reference block to which motion vector mv of current block pointsEForming a candidate motion vector set
[mvAmvBmvCmvh264mvDmvE]Each candidate motion vector has its specific position index in the candidate motion vector set, for example: mvAThe position number in the candidate motion vector set may be 1, mvDPosition number in candidate motion vector setMay be 5.
Fig. 3 shows a diagram of candidate motion vector positions when the listed current block is located at the kth line of the 1 st column of the current frame. As shown in FIG. 3, the motion vector of the current block is mv, and the motion vector of the left block of the current block is mvAThe motion vector of the block right above the current block is mvBThe motion vector of the upper right block of the current block is mvC(ii) a The motion vector of the block at the same position (column 1, line k) in the previous frame of the current frame is mvDThe motion vector of the reference block to which the motion vector mv of the current block points is mvE。
S103, selecting the optimal motion vector predicted value mv from the candidate motion vector setbest;
The' selection of the optimal motion vector prediction value mvbestThe specific method of "is as follows:
s1031, calculating bit number R (mv-mv) needed for encoding motion vector prediction difference valueP);
Wherein, mvP∈[mvAmvBmvCmvh264mvDmvE]Where mv is the current block motion vector, mvPIs a prediction value of a motion vector, mvPIs selected in the set of candidate motion vectors.
S1032, select the difference bit number R (mv-mv) of the motion vector to be codedP) Minimum motion vector predictor mvPPredicting value mv for optimal motion vectorbest;
S104, obtaining the motion vector mv of the current block and the predicted value mv of the optimal motion vectorbestThe motion vector difference mvd, mvd-mvbest;
And S106, the motion vector difference mvd is coded and sent to a decoding end through an entropy coding module.
The embodiment of the invention more accurately selects the predicted value of the motion vector through the spatial and temporal correlation, and reduces the code rate of the coding motion vector difference value.
In order to further reduce the code rate required for transmitting the motion vector prediction mode, the following steps can be added after step S104:
s105, performing analog decoding on the motion vector at the encoding end to obtain an optimal motion vector analog value;
fig. 2 is a flowchart of a method for performing analog decoding on a motion vector by the encoding end to obtain an optimal motion vector analog value;
the specific method of performing analog decoding on the motion vector to obtain the optimal motion vector analog value is as follows:
s1051, selecting the predicted value mv of the motion vector from the candidate motion vector set in turnP;
S1052, constructing a temporary motion vector mvi, mvi ═ mvd + mvp;
s1053, obtaining the current reconstructed image block data YR,YR=ZR+XR;
Wherein:
ZRprediction data of the current block image, which is obtained by motion compensation through the temporary motion vector mvi;
XRis residual data obtained by motion compensation of the current block motion vector mv.
S1054, constructing a difference coefficient Ed;
Wherein,
y (i, j) is the reconstructed image data of the ith row and the jth column, and the current reconstructed image block
Data YRFirst in the middle upper left cornerData is the origin, denoted by y (0,0), and m and n are the length and width of the current block;
y (i, -1) represents the current reconstructed image block data YRThe left column of data, wherein i takes values from 0 to n-1;
y (-1, j) represents the current reconstructed image block data YRThe upper row of data, wherein j takes a value from 1 to m-1;
s1055, selecting the difference coefficient EdMinimum motion vector predictor mvPDecoding optimal motion vector analog value mv for simulationdec;
If the optimal motion vector analog value mvdecEqual to the optimal motion vector predictor mvdestAt known mvd and mvbestIn the case of (1), the decoding end can directly set mvd-mv tobestObtaining the motion vector mv of the current block, the coding end does not need to add the description indicating the position serial number of the optimal motion vector predicted value in the candidate motion vector set in the output code stream;
if the optimal motion vector analog value mvdecNot equal to the optimal motion vector predictor mvbestThe decoding end can not correctly select the optimal motion vector prediction value mvbestThen the encoding end needs to add the indication of the optimal motion vector prediction value mv in the output code streambestDescription of position indices in a set of candidate motion vectors; the decoding end obtains the optimal motion vector predicted value mv according to the position serial numberbest(ii) a At known mvd and mvbestIn the case of (1), further according to the formula mvd-mvbestA motion vector mv for the current block is derived.
The embodiment of the invention provides a motion vector prediction coding method, which can more accurately select the predicted value of a motion vector through the spatial and temporal correlation, reduce the code rate of a coded motion vector difference value, more finely compress motion vector data and reduce the output code rate.
Example two
Fig. 4 is a schematic structural diagram of a motion vector prediction encoding apparatus according to an embodiment of the present invention, the motion vector prediction encoding apparatus including:
a motion vector obtaining module, configured to obtain a motion vector of the current block after motion prediction;
a candidate motion vector set construction module for constructing a candidate motion vector set for motion vector predictive coding; the method specifically comprises the following steps: selecting motion vector mv of left adjacent block of current blockAAnd the motion vector mv of the block right above the current blockBMotion vector mv of the upper right block of the current blockCAnd the predicted motion vector mv obtained by the H264 method for the current blockh264Motion vector mv of block at same position in previous frame of current frameDMotion vector mv of reference block to which motion vector mv of current block pointsEForming a set of candidate motion vectors [ mv ]AmvBmvCmvh264mvDmvE]Each candidate motion vector has its specific position index in the candidate motion vector set.
The optimal motion vector predicted value selecting module is used for selecting an optimal motion vector predicted value from the candidate motion vector set and comprises a motion vector predicted difference bit number calculating module and a motion vector difference selecting module;
a motion vector prediction difference bit number calculation module for calculating the bit number R (mv-mv) required for coding the motion vector prediction differenceP) Wherein, mvP∈[mvAmvBmvCmvh264mvDmvE]Where mv is the current block motion vector, mvPIs a prediction value of a motion vector, mvPIs selected in the set of candidate motion vectors;
a motion vector difference bit number selection module for selecting a number R (mv-mv) of bits that causes a motion vector difference to be encodedP) Minimum motion vector predictionValue mvPPredicting value mv for optimal motion vectorbest;
A motion vector difference obtaining module for obtaining the motion vector mv of the current block and the optimal motion vector prediction value mvbestThe motion vector difference mvd, mvd-mvbest;
Further, the motion vector prediction encoding apparatus may further include:
the motion vector difference sending module is used for coding and sending the motion vector difference mvd to a decoding end through the entropy coding module;
further, the motion vector prediction encoding apparatus may further include an analog decoding module, and as shown in fig. 5, the specific module structure of the analog decoding module is shown.
The analog decoding module is connected with the motion vector difference solving module and is used for performing analog decoding on the motion vector at the encoding end to obtain an optimal motion vector analog value;
the analog decoding module further comprises a motion vector predicted value selecting module, a temporary motion vector constructing module, a reconstructed image block data acquiring module, a difference coefficient constructing module, an optimal motion vector analog value selecting module and an optimal motion vector position sequence number writing module;
a motion vector predictor selection module for sequentially selecting a motion vector predictor mv from the candidate motion vector setP;
A temporary motion vector construction module for constructing a temporary motion vector mvi, mvi ═ mvd + mvp; wherein mvd is a motion vector difference between the motion vector of the current block and the optimal motion vector predictor, and mvd is mv-mvbest;
A reconstructed image block data acquisition module for acquiring current reconstructed image block data YR,YR=ZR+XR;
Wherein: zRPrediction data of the current block image, which is obtained by motion compensation through the temporary motion vector mvi;
XRis residual data obtained by motion compensation of the current block motion vector mv. A difference coefficient construction module for calculating a construction difference coefficient Ed;
Wherein,
y (i, j) is the reconstructed image data of the ith row and the jth column, and the current reconstructed image block data YRThe first data in the upper left corner is the origin and is represented by y (0,0), and m and n are the length and width of the current block;
y (i, -1) represents the current reconstructed image block data YRThe left column of data, wherein i takes values from 0 to n-1;
y (-1, j) represents the current reconstructed image block data YRThe upper row of data, wherein j takes a value from 1 to m-1;
an optimal motion vector analog value selection module for selecting the coefficient of difference EdMinimum motion vector predictor mvPDecoding optimal motion vector analog value mv for simulationdec;
An optimal motion vector position serial number writing module for if the optimal motion vector analog value mvdecNot equal to the optimal motion vector predictor mvbestAdding indication of optimal motion vector predicted value mv in output code streambestDescription of position indices in a set of candidate motion vectors.
The embodiment of the invention selects the predicted value of the motion vector more accurately through the spatial and temporal correlation, reduces the code rate of the motion vector difference value, can more finely compress the motion vector data and reduce the output code rate.
EXAMPLE III
Fig. 6 is a flowchart illustrating a motion vector prediction decoding method according to an embodiment of the present invention, where the method includes:
s601, receiving code stream data sent by a coding end;
s602, detecting whether the received code stream data contains the motion vector position serial number, if yes, entering step S603, otherwise, entering step S604
The motion vector position serial number is a specific position serial number of a candidate motion vector in a candidate motion vector set;
s603, obtaining the optimal motion vector predicted value mv from the motion vector candidate set according to the motion vector position serial numberbestFurther decoding the calculated motion vector mv of the current block;
wherein mvd is mv-mvbest;
S604, decoding the received motion vector difference mvd to obtain the motion vector of the current block;
wherein mvd is mv-mvbest;
The code stream data comprises a motion vector difference mvd and/or a motion vector position serial number;
the candidate motion vector set is constructed by a coding end, and specifically comprises the following steps: selecting motion vector mv of left adjacent block of current blockAAnd the motion vector mv of the block right above the current blockBMotion vector mv of the upper right block of the current blockCAnd the predicted motion vector mv obtained by the H264 method for the current blockh264Motion vector mv of block at same position in previous frame of current frameDMotion vector mv of reference block to which motion vector mv of current block pointsEForming a set of candidate motion vectors [ mv ]AmvBmvCmvh264mvDmvE]Each candidate motionThe vectors have specific position serial numbers in a candidate motion vector set, and the motion vector set is maintained by a coding end and a decoding end together;
the motion vector position number is a specific position number of the candidate motion vector in the candidate motion vector set.
Example four
Fig. 7 is a schematic structural diagram of a motion vector prediction decoding apparatus according to an embodiment of the present invention.
The motion vector prediction decoding device comprises a data receiving module, a motion vector position serial number detection module and a decoding module;
the data receiving module is used for receiving code stream data sent by the encoding end, wherein the code stream data comprises a motion vector difference and/or a motion vector position sequence number;
a motion vector position serial number detection module, configured to detect whether received code stream data includes a motion vector position serial number, where the motion vector position serial number is a specific position serial number of a candidate motion vector in a candidate motion vector set;
the decoding module is used for decoding and calculating the received motion vector difference to obtain the motion vector of the current block when the code stream data does not contain the position serial number of the motion vector; and when the code stream data contains the motion vector position serial number, obtaining the optimal motion vector predicted value from the motion vector candidate set according to the motion vector position serial number, and further decoding the calculated motion vector of the current block.
The candidate motion vector set is constructed by a coding end, and specifically comprises the following steps: selecting motion vector mv of left adjacent block of current blockAAnd the motion vector mv of the block right above the current blockBMotion vector mv of the upper right block of the current blockCAnd the predicted motion vector mv obtained by the H264 method for the current blockh264Motion of a block at the same position as a previous frame of the current frameVector mvDMotion vector mv of reference block to which motion vector mv of current block pointsEForming a set of candidate motion vectors [ mv ]AmvBmvCmvh264mvDmvE]Each candidate motion vector has a specific position serial number in a candidate motion vector set, and the motion vector set is maintained by a coding end and a decoding end together;
the motion vector position number is a specific position number of the candidate motion vector in the candidate motion vector set.
Practice five
Fig. 8 is a schematic structural diagram of a motion vector prediction encoding and decoding system according to an embodiment of the present invention, where the system includes a motion vector prediction encoding device and a motion vector prediction decoding device.
The motion vector prediction encoding device includes:
a motion vector obtaining module, configured to obtain a motion vector of the current block after motion prediction;
a candidate motion vector set construction module for constructing a candidate motion vector set for motion vector predictive coding; the method specifically comprises the following steps: selecting motion vector mv of left adjacent block of current blockAAnd the motion vector mv of the block right above the current blockBMotion vector mv of the upper right block of the current blockCAnd the predicted motion vector mv obtained by the H264 method for the current blockh264Motion vector mv of block at same position in previous frame of current frameDMotion vector mv of reference block to which motion vector mv of current block pointsEForming a set of candidate motion vectors [ mv ]AmvBmvCmvh264mvDmvE]Each candidate motion vector has its specific position sequence number in the candidate motion vector set;
the optimal motion vector predicted value selecting module is used for selecting an optimal motion vector predicted value from the candidate motion vector set and comprises a motion vector predicted difference bit number calculating module and a motion vector difference selecting module;
a motion vector prediction difference bit number calculation module for calculating the bit number R (mv-mv) required for coding the motion vector prediction differenceP) Wherein, mvP∈[mvAmvBmvCmvh264mvDmvE]Where mv is the current block motion vector, mvPIs a prediction value of a motion vector, mvPIs selected in the set of candidate motion vectors;
a motion vector difference bit number selection module for selecting a number R (mv-mv) of bits that causes a motion vector difference to be encodedP) Minimum motion vector predictor mvPPredicting value mv for optimal motion vectorbest;
A motion vector difference obtaining module for obtaining the motion vector mv of the current block and the optimal motion vector prediction value mvbestThe motion vector difference mvd, mvd-mvbest;
Further, the motion vector prediction encoding apparatus may further include:
the motion vector difference sending module is used for coding and sending the motion vector difference mvd to a decoding end through the entropy coding module;
further, the motion vector prediction encoding apparatus may further include an analog decoding module, and as shown in fig. 5, the specific module structure of the analog decoding module is shown.
The analog decoding module is connected with the motion vector difference solving module and is used for performing analog decoding on the motion vector at the encoding end to obtain an optimal motion vector analog value;
the analog decoding module further comprises a motion vector predicted value selecting module, a temporary motion vector constructing module, a reconstructed image block data obtaining module, a difference coefficient constructing module, an optimal motion vector analog value selecting module and an optimal motion vector position sequence number writing module.
A motion vector predictor selection module for sequentially selecting a motion vector predictor mv from the candidate motion vector setP;
A temporary motion vector construction module for constructing a temporary motion vector mvi, mvi ═ mvd + mvp; wherein mvd is a motion vector difference between the motion vector of the current block and the optimal motion vector predictor, and mvd is mv-mvbest;
A reconstructed image block data acquisition module for acquiring current reconstructed image block data YR,YR=ZR+XR;
Wherein: zRPrediction data of the current block image, which is obtained by motion compensation through the temporary motion vector mvi;
XRis residual data obtained by motion compensation of the current block motion vector mv. A difference coefficient construction module for calculating a construction difference coefficient Ed;
Wherein,
y (i, j) is the reconstructed image data of the ith row and the jth column, and the current reconstructed image block data YRThe first data in the upper left corner is the origin and is represented by y (0,0), and m and n are the length and width of the current block;
y (i, -1) represents the current reconstructed image block data YRThe left column of data, wherein i takes values from 0 to n-1;
y (-1, j) represents the current reconstructed image block data YRThe upper row of data, wherein j takes a value from 1 to m-1;
an optimal motion vector analog value selection module for selecting the coefficient of difference EdMinimum motion vector predictor mvPDecoding optimal motion vector modulo for simulationAnalog value mvdec;
An optimal motion vector position sequence number writing module for if the optimal motion vector analog value mvdecNot equal to the optimal motion vector predictor mvbestAdding indication of optimal motion vector predicted value mv in output code streambestDescription of position indices in a set of candidate motion vectors.
The motion vector prediction decoding device comprises a data receiving module, a motion vector position serial number detection module and a decoding module;
the data receiving module is used for receiving code stream data sent by the encoding end, wherein the code stream data comprises a motion vector difference and/or a motion vector position sequence number;
a motion vector position serial number detection module, configured to detect whether received code stream data includes a motion vector position serial number, where the motion vector position serial number is a specific position serial number of a candidate motion vector in a candidate motion vector set;
the decoding module is used for decoding and calculating the received motion vector difference to obtain the motion vector of the current block when the code stream data does not contain the position serial number of the motion vector; and when the code stream data contains the motion vector position serial number, obtaining the optimal motion vector predicted value from the motion vector candidate set according to the motion vector position serial number, and further decoding the calculated motion vector of the current block.
The candidate motion vector set is constructed by a coding end, and specifically comprises the following steps: selecting motion vector mv of left adjacent block of current blockAAnd the motion vector mv of the block right above the current blockBMotion vector mv of the upper right block of the current blockCAnd the predicted motion vector mv obtained by the H264 method for the current blockh264Motion vector mv of block at same position in previous frame of current frameDMotion vector mv of reference block to which motion vector mv of current block pointsEForming a set of candidate motion vectors [ mv ]AmvBmvCmvh264mvDmvE]Each candidate motion vector has a specific position serial number in a candidate motion vector set, and the motion vector set is maintained by a coding end and a decoding end together;
the motion vector position number is a specific position number of the candidate motion vector in the candidate motion vector set.
The embodiment of the invention selects the predicted value of the motion vector more accurately through the spatial and temporal correlation, reduces the code rate of the motion vector difference value, can more finely compress the motion vector data and reduce the output code rate.
It will be understood by those skilled in the art that all or part of the steps in the method according to the above embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, such as ROM, RAM, magnetic disk, optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.