CN109951707A - A kind of target motion vectors selection method, device, electronic equipment and medium - Google Patents
A kind of target motion vectors selection method, device, electronic equipment and medium Download PDFInfo
- Publication number
- CN109951707A CN109951707A CN201711397175.0A CN201711397175A CN109951707A CN 109951707 A CN109951707 A CN 109951707A CN 201711397175 A CN201711397175 A CN 201711397175A CN 109951707 A CN109951707 A CN 109951707A
- Authority
- CN
- China
- Prior art keywords
- motion vector
- candidate motion
- target candidate
- value
- target
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
- H04N19/147—Data rate or code amount at the encoder output according to rate distortion criteria
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/513—Processing of motion vectors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/557—Motion estimation characterised by stopping computation or iteration based on certain criteria, e.g. error magnitude being too large or early exit
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/567—Motion estimation based on rate distortion criteria
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The embodiment of the invention provides a kind of target motion vectors selection methods, device, electronic equipment and medium, the above method includes: for each predicting unit in video to be encoded, obtain the corresponding target candidate motion vector of each predicting unit, successively obtain the coding distortion cost of each target candidate motion vector, and judge the coding distortion cost of acquired target candidate motion vector whether less than the first preset threshold, when there are the coding distortion costs of acquired first object candidate motion vector less than the first preset threshold for judgement, first object candidate motion vector is determined as target motion vectors, and stop obtaining the coding distortion cost of next target candidate motion vector of first object candidate motion vector.Using target motion vectors selection method, device, electronic equipment and medium provided in an embodiment of the present invention, it is possible to reduce the process of target motion vectors selection is time-consuming.
Description
Technical field
The present invention relates to technical field of video coding, more particularly to a kind of target motion vectors selection method, device, electricity
Sub- equipment and medium.
Background technique
With the continuous development of multimedia digital video technique, the data volume of video file is increasing, gives video file
Transimission and storage bring inconvenience.Thus, the data compression technique of video file has obtained great development.Video text
The data compression of part, also known as Video coding, video compress, the principle is as follows: video file is by a large amount of video image frame group
At, there is extremely strong correlation, that is to say, that have a large amount of redundancy between each video image frame.Redundancy can be divided into
Spatial redundancy information and temporal redundancy information.Compress technique is exactly to remove the redundancy in data.
Currently, the video encoding standard of mainstream uses " block-based prediction and transformation " to remove redundancy, principle
It is to go out current prediction unit using other predicting units and motion-vector prediction, since motion vector has many, usually 5
It is a.In order to improve data compression effects, it is one the smallest that coding distortion cost is selected from multiple motion vectors, therefore want
Calculate separately the corresponding coding distortion cost of multiple motion vectors.Recycle other predicting units and coding distortion cost the smallest
One motion-vector prediction current prediction unit only encodes other predicting units and motion vector in coding, without
Other predicting units and current prediction unit are encoded, to eliminate the redundancy in data, that is, realizes data
Compression.When carrying out data compression, the step of removing spatial redundancy information referred to as intra prediction;Remove temporal redundancy information
Referred to as inter-prediction.For inter-prediction, principle is: pre- from currently according to sequence as defined in H264 H265 standard
The candidate motion vector that several candidate motion vectors are obtained in the adjacent block of unit as the predicting unit is surveyed, it is preferential to obtain
Adjacent block sequence be, it is left, on, lower-left, upper right, upper left is compared corresponding with all candidate motion vectors of current prediction unit
Coding distortion cost, to select coding distortion cost one the smallest, and using the motion vector as target motion vectors,
Wherein, coding distortion cost includes but are not limited to: distortion value or number of coded bits or according to distortion value and encoding ratio
The integrate-cost result that special number obtains.
But in the prior art, need to calculate the coding distortion generation of all candidate motion vectors of current prediction unit
Valence could obtain the smallest motion vector of Coding cost, and therefore, there are the process that target motion vectors select is time-consuming for the prior art
Longer technical problem.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of target motion vectors selection method, device, electronic equipment and Jie
Matter reduces purpose time-consuming in target motion vectors selection course to realize.Specific technical solution is as follows:
In a first aspect, the embodiment of the invention provides a kind of target motion vectors selection method, method includes:
For each predicting unit in video to be encoded, the corresponding target candidate movement of each predicting unit is obtained
Vector;
The coding distortion cost of each target candidate motion vector is successively obtained, and judges acquired target candidate
Whether the coding distortion cost of motion vector is less than the first preset threshold;
It is preset when determining that there are the coding distortion costs of acquired first object candidate motion vector less than described first
The first object candidate motion vector is determined as target motion vectors by threshold value, and stops obtaining the first object candidate
The coding distortion cost of next target candidate motion vector of motion vector.
It is optionally, described to obtain the corresponding target candidate motion vector of each predicting unit, comprising:
The number of adjacent data blocks is preset according to each predicting unit, obtains the corresponding time of each predicting unit
Select the first quantity of motion vector, wherein first quantity is positively correlated with the number;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority
Sequence from high in the end is ranked up, using the corresponding candidate motion vector of the first quantity order preceding in obtained sequence as every
The target candidate motion vector of one predicting unit.
It is optionally, described to obtain the corresponding target candidate motion vector of each predicting unit, comprising:
The feature of the motion vector distribution difference between adjacent data blocks is preset according to each predicting unit, is obtained every
Second quantity of the corresponding candidate motion vector of one predicting unit, wherein second quantity and the default consecutive number
It is positively correlated according to the value of the motion vector distribution difference between block;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority
Sequence from high in the end is ranked up, using the corresponding candidate motion vector of the second quantity order preceding in obtained sequence as every
The target candidate motion vector of one predicting unit.
It is optionally, described to obtain the corresponding target candidate motion vector of each predicting unit, comprising:
According to preset video encoding standard, the third number of the corresponding candidate motion vector of each predicting unit is obtained
Amount;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority
Sequence from high in the end is ranked up, using the corresponding candidate motion vector of third quantity order preceding in obtained sequence as every
The target candidate motion vector of one predicting unit.
Optionally, first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion of other target candidate motion vectors judged
Minimum value in cost.
Optionally, first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion of other target candidate motion vectors judged
The difference of minimum value and pre-arranged code cost in cost.
Optionally, in the coding distortion cost for successively obtaining each target candidate motion vector, the method
Further include:
Difference in the target candidate motion vector relative to other target candidate motion vectors is preset less than second
The target motion vectors of threshold value, the alternative motion vector as each predicting unit;
Alternatively, corresponding prediction result in the target candidate motion vector to be less than to the target candidate of third predetermined threshold value
Motion vector, the alternative motion vector as each predicting unit;
Alternatively, using relative to the maximum target candidate motion vector of the difference of other target candidate motion vectors as each
The alternative motion vector of the predicting unit;
The coding distortion cost for successively obtaining each target candidate motion vector, and judge acquired target
Whether the coding distortion cost of candidate motion vector is less than the first preset threshold, comprising:
The coding distortion cost of each alternative motion vector is successively obtained, and judges acquired alternative motion vector
Coding distortion cost whether less than the first preset threshold;
It is described to determine that there are the coding distortion costs of acquired first object candidate motion vector to be less than described first
The first object candidate motion vector is determined as target motion vectors, and stops obtaining the first object by preset threshold
The coding distortion cost of next target candidate motion vector of candidate motion vector, comprising:
When determine there are the coding distortion cost of the first acquired alternative motion vector be less than first preset threshold,
Described first alternative motion vector is determined as target motion vectors, and stops obtaining the next of the described first alternative motion vector
The coding distortion cost of alternative motion vector.
Optionally, the target that corresponding prediction result in the target candidate motion vector is less than third predetermined threshold value is waited
Motion vector is selected, the alternative motion vector as each predicting unit, comprising:
The corresponding prediction result of each target candidate motion vector is successively obtained, and judges acquired target candidate
Whether the prediction result of motion vector is less than third predetermined threshold value;
When determine there are the prediction result of the second acquired target candidate motion vector be less than the third predetermined threshold value,
The second target candidate motion vector is determined as alternative motion vector, and stops obtaining the second target candidate movement arrow
The prediction result of next target candidate motion vector of amount.
Optionally, the third predetermined threshold value is that estimation range is preset as defined in preset coding standard;
It is described successively to obtain the corresponding prediction result of each target candidate motion vector, comprising:
For each target candidate motion vector, the estimation range of each target candidate motion vector is obtained,
As the corresponding prediction result of each target candidate motion vector.
It is optionally, described successively to obtain the corresponding prediction result of each target candidate motion vector, comprising:
For each target candidate motion vector, the corresponding whole pixel of each target candidate motion vector is obtained
First predicted distortion value of the predicted value relative to original image;
The corresponding first pre- dendrometry of each target candidate motion vector will be removed in the first predicted distortion value obtained
Minimum value other than true value, the difference of the first predicted distortion value corresponding with each target candidate motion vector, as each
The corresponding prediction result of the target candidate motion vector.
It is optionally, described successively to obtain the corresponding prediction result of each target candidate motion vector, comprising:
For each target candidate motion vector, corresponding first face of each target candidate motion vector is obtained
Second predicted distortion value of colouring component;
The corresponding second pre- dendrometry of each target candidate motion vector will be removed in the second predicted distortion value obtained
Minimum value other than true value, the difference of the second predicted distortion value corresponding with each target candidate motion vector, as each
The corresponding prediction result of the target candidate motion vector.
It is optionally, described successively to obtain the corresponding prediction result of each target candidate motion vector, comprising:
For each target candidate motion vector, by corresponding first color of each target candidate motion vector
The third predicted distortion value of component, the 4th pre- dendrometry of the second color component corresponding with each target candidate motion vector
The sum of true value is used as the 5th predicted distortion value;
The corresponding 5th pre- dendrometry of each target candidate motion vector will be removed in the 5th predicted distortion value obtained
Minimum value other than true value, the difference of the 5th predicted distortion value corresponding with each target candidate motion vector, as each
The corresponding prediction result of the target candidate motion vector.
Optionally, the coding distortion cost for successively obtaining each target candidate motion vector, comprising:
Using the corresponding distortion value of color component of the predicting unit of each target candidate motion vector of correspondence as every
The coding distortion cost of the one target candidate motion vector;Alternatively, by the pre- of each target candidate motion vector of correspondence
The corresponding number of coded bits of color component of unit is surveyed, the linear superposition result with color component is as each target candidate
The coding distortion cost of motion vector.
Optionally, the corresponding mistake of color component of the predicting unit by each target candidate motion vector of correspondence
Coding distortion cost of the true value as each target candidate motion vector, comprising:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Acquisition is corresponding with each target candidate motion vector, corresponds to the pre- of each target candidate motion vector
Survey the corresponding predicted value of color component of unit;
By the absolute value of the difference of the original pixel value and the predicted value and the original pixel value and described pre-
It the transformation of the difference of the quadratic sum of the difference of measured value or the original pixel value and the predicted value and is waited as each target
Select the coding distortion cost of motion vector.
Optionally, the corresponding mistake of color component of the predicting unit by each target candidate motion vector of correspondence
Coding distortion cost of the true value as each target candidate motion vector, comprising:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Acquisition is corresponding with each target candidate motion vector, corresponds to the pre- of each target candidate motion vector
Survey the corresponding coding and rebuilding value of color component of unit;
By the absolute value of the difference of the original pixel value and the coding and rebuilding value and the original pixel value and institute
State the transformation of the quadratic sum of the difference of coding and rebuilding value or the difference of the original pixel value and the predicted value and as each institute
State the coding distortion cost of target candidate motion vector.
Second aspect, the embodiment of the invention also provides a kind of target motion vectors selection device, device includes:
Module is obtained, for it is corresponding to obtain each predicting unit for each predicting unit in video to be encoded
Target candidate motion vector;
Judgment module for successively obtaining the coding distortion cost of each target candidate motion vector, and judges institute
Whether the coding distortion cost of the target candidate motion vector of acquisition is less than the first preset threshold;
Determining module, for there are the coding distortion costs of acquired first object candidate motion vector to be less than when judgement
The first object candidate motion vector is determined as target motion vectors, and stopped described in acquisition by first preset threshold
The coding distortion cost of next target candidate motion vector of first object candidate motion vector.
Optionally, the acquisition module, is also used to:
The number of adjacent data blocks is preset according to each predicting unit, obtains the corresponding time of each predicting unit
Select the first quantity of motion vector, wherein first quantity is positively correlated with the number;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority
Sequence from high in the end is ranked up, using the corresponding candidate motion vector of the first quantity order preceding in obtained sequence as every
The target candidate motion vector of one predicting unit.
Optionally, the acquisition module, is also used to:
The feature of the motion vector distribution difference between adjacent data blocks is preset according to each predicting unit, is obtained every
Second quantity of the corresponding candidate motion vector of one predicting unit, wherein second quantity and the default consecutive number
It is positively correlated according to the value of the motion vector distribution difference between block;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority
Sequence from high in the end is ranked up, using the corresponding candidate motion vector of the second quantity order preceding in obtained sequence as every
The target candidate motion vector of one predicting unit.
Optionally, the acquisition module, is also used to:
According to preset video encoding standard, the third number of the corresponding candidate motion vector of each predicting unit is obtained
Amount;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority
Sequence from high in the end is ranked up, using the corresponding candidate motion vector of third quantity order preceding in obtained sequence as every
The target candidate motion vector of one predicting unit.
Optionally, first preset threshold includes:
In addition to current target candidate motion vector, the coding of other target candidate motion vectors being judged is lost
Minimum value in true cost.
Optionally, first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion of other target candidate motion vectors judged
The difference of minimum value and pre-arranged code cost in cost.
Optionally, described device further include: setup module is used for:
Difference in the target candidate motion vector relative to other target candidate motion vectors is preset less than second
The target motion vectors of threshold value, the alternative motion vector as each predicting unit;
Alternatively, corresponding prediction result in the target candidate motion vector to be less than to the target candidate of third predetermined threshold value
Motion vector, the alternative motion vector as each predicting unit;
Alternatively, using relative to the maximum target candidate motion vector of the difference of other target candidate motion vectors as each
The alternative motion vector of the predicting unit;
The judgment module, is also used to:
The coding distortion cost of each alternative motion vector is successively obtained, and judges acquired alternative motion vector
Coding distortion cost whether less than the first preset threshold;
The determining module, is also used to:
When determine there are the coding distortion cost of the first acquired alternative motion vector be less than first preset threshold,
Described first alternative motion vector is determined as target motion vectors, and stops obtaining the next of the described first alternative motion vector
The coding distortion cost of alternative motion vector.
Optionally, the setup module, is also used to:
The corresponding prediction result of each target candidate motion vector is successively obtained, and judges acquired target candidate
Whether the prediction result of motion vector is less than third predetermined threshold value;
When determine there are the prediction result of the second acquired target candidate motion vector be less than the third predetermined threshold value,
The second target candidate motion vector is determined as alternative motion vector, and stops obtaining the second target candidate movement arrow
The prediction result of next target candidate motion vector of amount.
Optionally, the third predetermined threshold value is that estimation range is preset as defined in preset coding standard;
The setup module, is also used to:
For each target candidate motion vector, the estimation range of each target candidate motion vector is obtained,
As the corresponding prediction result of each target candidate motion vector.
Optionally, the setup module, is also used to:
For each target candidate motion vector, the corresponding whole pixel of each target candidate motion vector is obtained
First predicted distortion value of the predicted value relative to original image;
The corresponding first pre- dendrometry of each target candidate motion vector will be removed in the first predicted distortion value obtained
Minimum value other than true value, the difference of the first predicted distortion value corresponding with each target candidate motion vector, as each
The corresponding prediction result of the target candidate motion vector.
Optionally, the setup module, is also used to:
For each target candidate motion vector, corresponding first face of each target candidate motion vector is obtained
Second predicted distortion value of colouring component;
The corresponding second pre- dendrometry of each target candidate motion vector will be removed in the second predicted distortion value obtained
Minimum value other than true value, the difference of the second predicted distortion value corresponding with each target candidate motion vector, as each
The corresponding prediction result of the target candidate motion vector.
Optionally, the setup module, is also used to:
For each target candidate motion vector, by corresponding first color of each target candidate motion vector
The third predicted distortion value of component, the 4th pre- dendrometry of the second color component corresponding with each target candidate motion vector
The sum of true value is used as the 5th predicted distortion value;
The corresponding 5th pre- dendrometry of each target candidate motion vector will be removed in the 5th predicted distortion value obtained
Minimum value other than true value, the difference of the 5th predicted distortion value corresponding with each target candidate motion vector, as each
The corresponding prediction result of the target candidate motion vector.
Optionally, the judgment module, is also used to:
Using the corresponding distortion value of color component of the predicting unit of each target candidate motion vector of correspondence as every
The coding distortion cost of the one target candidate motion vector;Alternatively, by the pre- of each target candidate motion vector of correspondence
The corresponding number of coded bits of color component of unit is surveyed, the linear superposition result with color component is as each target candidate
The coding distortion cost of motion vector.
Optionally, the judgment module, is also used to:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Acquisition is corresponding with each target candidate motion vector, corresponds to the pre- of each target candidate motion vector
Survey the corresponding predicted value of color component of unit;
By the absolute value of the difference of the original pixel value and the predicted value and the original pixel value and described pre-
It the transformation of the difference of the quadratic sum of the difference of measured value or the original pixel value and the predicted value and is waited as each target
Select the coding distortion cost of motion vector.
Optionally, the judgment module, is also used to:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Acquisition is corresponding with each target candidate motion vector, corresponds to the pre- of each target candidate motion vector
Survey the corresponding coding and rebuilding value of color component of unit;
By the absolute value of the difference of the original pixel value and the coding and rebuilding value and the original pixel value and institute
State the transformation of the quadratic sum of the difference of coding and rebuilding value or the difference of the original pixel value and the predicted value and as each institute
State the coding distortion cost of target candidate motion vector.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, including processor and memory, wherein
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any of the above-described method and step.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, computer readable storage mediums
It is inside stored with computer program, any of the above-described method and step is realized when computer program is executed by processor.
5th aspect, the embodiment of the invention provides a kind of computer program products comprising instruction, when it is in computer
When upper operation, so that computer executes any of the above-described method and step.
6th aspect, the embodiment of the invention provides a kind of computer programs, when run on a computer, make to succeed in one's scheme
Calculation machine executes any method and step.
Using a kind of target motion vectors selection method provided in an embodiment of the present invention, device and electronic equipment, judging
When the coding distortion cost of current target candidate motion vector is less than the first preset threshold out, just the target candidate is moved and is sweared
Amount is used as target motion vectors, thus finish the selection course of target motion vectors, and other targets not being judged are waited
Selecting motion vector, there is no need to calculation code distortion costs, compared with the existing technology in need to calculate all target candidate movements
The coding distortion cost of vector reduces the quantity for needing the target candidate motion vector of calculation code distortion cost, and then subtracts
The process for having lacked target motion vectors selection is time-consuming.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 be in the prior art Video coding inter-prediction when predicting unit division schematic diagram;
Fig. 2 is a kind of flow diagram of target motion vectors selection method provided in an embodiment of the present invention;
Referring-to relation schematic diagram in the video coding process that Fig. 3 provides for the prior art between each video frame;
Fig. 4 is the flow diagram of the acquisition methods of the first target candidate motion vector provided in an embodiment of the present invention;
Fig. 5 is the flow diagram of the acquisition methods of second of target candidate motion vector provided in an embodiment of the present invention;
Fig. 6 is the flow diagram of the acquisition methods of the third target candidate motion vector provided in an embodiment of the present invention;
Fig. 7 is the flow diagram of another target motion vectors selection method provided in an embodiment of the present invention;
Fig. 8 is a kind of flow diagram of the preparation method of alternative motion vector provided in an embodiment of the present invention;
Fig. 9 is a kind of structural schematic diagram of the selection device of target motion vectors provided in an embodiment of the present invention;
Figure 10 is the structural schematic diagram of the selection device of another target motion vectors provided in an embodiment of the present invention;
Figure 11 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
To solve prior art problem, the embodiment of the invention provides a kind of target motion vectors selection methods, device, electricity
Sub- equipment and medium.
In a first aspect, just a kind of target motion vectors selection method provided in an embodiment of the present invention is introduced first.It needs
It is noted that the embodiment of the present invention is applied to the inter predication process of Video coding, selected primarily directed to motion vector
Journey optimizes, and optimizes in particular for the motion vector selection course of merging patterns and skip mode.
H.264 and H.265 in existing primary video coding standard, as in, Video coding is carried out treating encoded video
When, there are two types of prediction mode, intra prediction and inter-predictions.For intra prediction, according to the statistical property of image, a frame
There are certain correlations between the pixel of image, and the correlation can be carried out closely with exponential decay curve in a certain range
Seemingly, the distance between pixel hour, correlation is stronger, and when pixel distance increases, correlation sharply weakens.Due to each picture
The efficiency that element is encoded is too low, as shown in Figure 1, a frame image can be divided into multiple data blocks.For there are correlations
Each data block for, the relative displacement of spatial position can use vector representation, for indicating opposite between data block
The vector of offset is exactly motion vector.Therefore, each frame image can be divided into multiple pieces, utilizes partial data therein
Other data blocks in same frame image are predicted in the combination of block and motion vector, and then eliminate the correlation in frame between each data block
Property, to realize the compression of video frame.It is similar with intra prediction for inter-prediction, as shown in Figure 1, being to utilize video
The correlation of image interframe, i.e. temporal correlation are predicted current using the combination of data block and motion vector in reference frame
The data block of frame, and then achieve the purpose that compression of images.It is understood that being used to predict that the data block of other data blocks is claimed
For reference block or reference unit;And it is referenced block and motion vector combines the data block predicted and is referred to as and predicts
Block or predicting unit.For predicting that the video frame of other video frames is referred to as reference frame, and it is referenced block and motion vector knot
The video frame predicted altogether is referred to as present frame.Usually, a reference block or prediction block may include 16*16
A pixel, 8*8 pixel or 4*4 pixel.
In inter predication process, there are two kinds of coding modes, merging patterns and skip mode.Merging patterns are from current
Several target candidate motion vectors are selected in the adjacent data blocks of the current prediction unit of frame, Fig. 1 is video in the prior art
The division schematic diagram of predicting unit when encoding inter-prediction, as shown in Figure 1, H.264 and H.265 existing video encoding standard is advised
The priority orders of the motion vector of fixed predicting unit adjacent data blocks are as follows: left, upper, lower-left, upper right and upper left.Then, than
Compared with the coding distortion cost of these target candidate motion vectors, to select a minimum target candidate of coding distortion cost
Motion vector, which is target motion vectors.Then the prediction according to predicting unit and after being encoded
The difference of unit calculates prediction residual value when being predicted using target motion vectors, finally by target motion vectors and in advance
It surveys residual values to be encoded, so as to complete the process for carrying out inter-prediction using the predicting unit.And skip mode is from working as
Several target candidate motion vectors are selected in the adjacent data blocks of preceding predicting unit, then compare these target candidates movement arrow
The coding distortion cost of amount, to select a minimum target candidate motion vector of coding distortion cost, the target candidate
Motion vector is target motion vectors, is then encoded to the target candidate motion vector, so as to complete pre- using this
Survey the process that unit carries out inter-prediction.Skip mode is relative to merging patterns, and without the calculating of prediction residual value, forcing will
Prediction residual value is assigned a value of zero.From the above, it is seen that needing to calculate when obtaining target motion vectors using the prior art
The coding distortion cost of all candidate motion vectors of current prediction unit, and calculate all candidates of current prediction unit
The process of motion vector is to take a long time, therefore, the process time-consuming that the prior art is selected there are target motion vectors compared with
Long technical problem.
Fig. 2 is a kind of schematic illustration of target motion vectors selection method provided in an embodiment of the present invention;Such as Fig. 2 institute
Show, this method comprises:
S201: for each predicting unit in video to be encoded, the corresponding target candidate fortune of each predicting unit is obtained
Dynamic vector.
Since video is continuously to be played to constitute by very multiple image, using video encoding standard H.264 or
H.265 it carries out in cataloged procedure, is that each frame treated in encoded video in a manner of encoding frame by frame is predicted and encoded.Such as
Shown in Fig. 3, Fig. 3 is the referring-to relation schematic diagram in the video coding process that provides of the prior art between each video frame, below with
It is illustrated for the predicting unit in 8k-3 frame in Fig. 3.
Illustratively, 8k-3 frame can be divided into multiple predicting units, such as predicting unit -1, predicting unit -2, pre-
Survey unit -3 and predicting unit -4 etc..According to video encoding standard H.264 or H.265 specified in quantity and sequence obtain it is above-mentioned
The corresponding target candidate motion vector of each predicting unit.Under normal conditions, the target candidate movement of each predicting unit
The quantity of vector is no more than 5.By taking predicting unit -1 as an example, the corresponding target candidate motion vector of predicting unit -1 can be fortune
Dynamic vector -1, motion vector -2, motion vector -3, motion vector -4 and motion vector -5;Similar, predicting unit -2 is corresponding
Target candidate motion vector can be motion vector -6, motion vector -7, motion vector -8, motion vector -9 and motion vector -
10。
It in practical applications, can be single using the set of the corresponding target candidate motion vector of predicting unit -1 as prediction
The target candidate motion vector collection of member -1.
S202: successively obtaining the coding distortion cost of each target candidate motion vector, and judges that acquired target is waited
Select the coding distortion cost of motion vector whether less than the first preset threshold.
Illustratively, for each target candidate motion vector of predicting unit -1, motion vector -1, movement arrow are obtained
Amount -2, motion vector -3, motion vector -4 and the corresponding coding distortion cost of motion vector -5.By taking motion vector -1 as an example, on
The coding distortion cost stated includes but are not limited to: distortion value or number of coded bits or according to distortion value and coded-bit
Number carries out the integrate-cost result of linear superposition acquisition.Then the coding of each of collection of comparing motion vector -1 motion vector
Whether distortion cost is less than the first preset threshold.
It in practical applications, can be using the coding distortion value of the luminance component of predicting unit as target candidate motion vector
Coding distortion cost.
In a kind of specific embodiment of the embodiment of the present invention, the first preset threshold can be, except current target is waited
It selects except motion vector, the minimum value in the coding distortion cost of other target candidate motion vectors judged.
For example, motion vector -1, motion vector -2, motion vector -3 are judged, and motion vector -1
Coding distortion cost is minimum value.If current target candidate motion vector is motion vector -4, and the coding of the motion vector
Distortion cost is less than motion vector -1, then regard motion vector -4 as target motion vectors.
In order to more accurately get target motion vectors, in a kind of specific embodiment of the embodiment of the present invention
In, the first preset threshold can also be in addition to current target candidate motion vector, other target candidates judged be transported
The difference of minimum value and pre-arranged code cost in the coding distortion cost of dynamic vector.
Wherein, pre-arranged code cost can be rule of thumb configured by technical staff.It, can also be for above-mentioned example
The coding distortion cost of motion vector -4 is less than the coding distortion cost of motion vector -1, and the coding distortion cost difference of the two
When greater than pre-arranged code cost, then motion vector -4 is regard as target motion vectors.It is understood that other mesh for having judged
Marking candidate motion vector does not include current target candidate motion vector itself, for example, current target candidate motion vector is
When the first aim candidate motion vector of predicting unit -1, the coding distortion cost of current target candidate motion vector can not
Make compared with the coding distortion cost of itself, therefore by next target candidate motion vector of current target candidate motion vector
Continue to judge for current target candidate motion vector, until obtaining target motion vectors.
It can also be in coding distortion cost of the coding distortion cost of motion vector -4 less than the target vector having determined
In the case where, then it regard motion vector -4 as target motion vectors.
It, can be minimum by coding distortion cost in the target candidate motion vector judged using the above embodiment of the present invention
Target candidate motion vector as target vector, and then reduce video to be encoded be encoded after code rate.
In a kind of specific embodiment of the embodiment of the present invention, the first preset threshold can be pre-set value, example
Such as, when the data volume of predicting unit -1 is larger, biggish first preset threshold can be set;When the corresponding volume of predicting unit -1
When the quantization parameter of code unit or image is larger, biggish first preset threshold also can be set;When predicting unit -1 is corresponding
Image level it is bigger when, biggish first preset threshold also can be set.It is understood that the existing code rate control of QP
Algorithm is mainly to export target bit rate by adjusting the quantization parameter size of discrete cosine transform.In fact, quantization parameter
(quantity parameter, quantization parameter) (QP) is the value for reflecting spatial detail compression situation, such as QP reduces, video
Most details in frame can be all retained;QP increases, and some loss in detail in video frame, code rate reduces, but image loses
Strong and quality of trueing add decline.That is, the relationship that QP and bit rate are inversely proportional, and with the raising of video source complexity,
This inverse relation can become apparent from.Specifically, the first preset threshold can be w*h/4* (level+1), wherein w is that prediction is single
First width;H is predicting unit height;Level is the level of present image, and the size of level is as shown in Figure 3.
It, can be by the pre- of each target candidate motion vector of correspondence in a kind of specific embodiment of the embodiment of the present invention
Survey coding distortion cost of the corresponding distortion value of color component of unit as each target candidate motion vector;Alternatively, by right
The corresponding number of coded bits of color component of the predicting unit of each target candidate motion vector and the linear of color component is answered to fold
Add result as the coding distortion cost of each target candidate motion vector.
It should be noted that the color component of above-mentioned predicting unit, can be one in predicting unit RGB color component
It is a, two or three, the embodiment of the present invention does not define it herein.In addition, number of coded bits is also referred to as bit rate, it is
The bit number of video transmission per second after coding.After the coding for carrying out predicting unit using motion vector -1, so that it may directly
The number of coded bits of the motion vector is obtained, usually, bit number is higher, illustrates that the prediction effect of the motion vector is poorer.
Using the above embodiment of the present invention, the coding distortion cost of available predicting unit.
In a kind of specific embodiment of the invention, can using the corresponding distortion value of the color component of predicting unit as
The coding distortion cost of the target candidate motion vector, specific steps can be with are as follows:
100: obtaining the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector.
For example, can be by the current target candidate motion vector of predicting unit -1, the corresponding R color point of motion vector -1
Measure pixel value of the corresponding pixel value as motion vector -1;It can also be by the color component R and color component G of predicting unit -1
Pixel value of the sum of the corresponding pixel value as motion vector -1;It can also be by color component R, the color component of predicting unit -1
G, pixel value of the sum of the corresponding pixel value of color component B as motion vector -1, the embodiment of the present invention are not made it herein
It limits out.The corresponding original pixel value of color component that predicting unit is acquired in this step is X.
200: obtaining, the prediction list of corresponding each target candidate motion vector corresponding with each target candidate motion vector
The corresponding predicted value of color component of member.
Obtain predicted value Y obtain after encoding using -1 pair of predicting unit of motion vector, corresponding color component.It needs
It is noted that original pixel value X color component corresponding with predicted value Y is identical color component.
300: by the absolute value of the difference of original pixel value and predicted value and original pixel value and predicted value difference it is flat
The transformation of the difference of Fang He or original pixel value and predicted value and coding distortion generation as each target candidate motion vector
Valence.
It illustratively, can be by original pixel value X and predicted value Y absolute value of the difference and original pixel value X and prediction
The transformation of the difference of the quadratic sum or original pixel value X and predicted value Y of the difference of value Y and coding distortion as predicting unit -1
Cost.
It should be noted that the calculation of distortion value includes but are not limited to the calculation of above-mentioned distortion value, appoint
What can be used as the distortion value of predicting unit with the value of the distortion situation of evaluation and foreca unit.
Using the above embodiment of the present invention, can be waited the corresponding distortion value of the color component of predicting unit as the target
Select the coding distortion cost of motion vector.
In a kind of specific embodiment of the invention, can using the corresponding distortion value of the color component of predicting unit as
The coding distortion cost of the target candidate motion vector, specific steps can be with are as follows:
400: obtaining the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector.
For example, can be by the current target candidate motion vector of predicting unit -1, the corresponding R color point of motion vector -1
Measure pixel value of the corresponding pixel value as motion vector -1;It can also be by the color component R and color component G of predicting unit -1
Pixel value of the sum of the corresponding pixel value as motion vector -1;It can also be by color component R, the color component of predicting unit -1
G, pixel value of the sum of the corresponding pixel value of color component B as motion vector -1, the embodiment of the present invention are not made it herein
It limits out.The corresponding original pixel value of color component that predicting unit is acquired in this step is X.
500: obtaining, the prediction list of corresponding each target candidate motion vector corresponding with each target candidate motion vector
The corresponding coding and rebuilding value of color component of member.
Obtain predicted value Y obtain after encoding using -1 pair of predicting unit of motion vector, corresponding color component.It needs
It is noted that original pixel value X color component corresponding with predicted value Y is identical color component.
600: by the absolute value of the difference of original pixel value and coding and rebuilding value and original pixel value and coding and rebuilding value
Difference quadratic sum or original pixel value and predicted value difference transformation and coding as each target candidate motion vector
Distortion cost.
It illustratively, can be by original pixel value X and predicted value Y absolute value of the difference and original pixel value X and prediction
The transformation of the difference of the quadratic sum or original pixel value X and predicted value Y of the difference of value Y and coding distortion as predicting unit -1
Cost.
Using the above embodiment of the present invention, can be waited the corresponding distortion value of the color component of predicting unit as the target
Select the coding distortion cost of motion vector.
S203: it is preset when determining that there are the coding distortion costs of acquired first object candidate motion vector less than first
First object candidate motion vector is determined as target motion vectors by threshold value, and stops obtaining first object candidate motion vector
Next target candidate motion vector coding distortion cost.
Illustratively, when the coding distortion cost of motion vector -1 is less than the first preset threshold, motion vector -1 is made
For target motion vectors.Otherwise, continue to judge next target candidate motion vector, it, can also be with for example, it may be motion vector -2
It is motion vector -3, is also possible to motion vector -4, can also be motion vector -5, the present invention does not transport first object herein
Next target candidate motion vector of dynamic vector is which motion vector is defined.
Illustratively, when the coding distortion cost of motion vector -1 is less than the first preset threshold, motion vector -1 is made
For target motion vectors.It is understood that after obtaining target motion vectors, no longer predicting unit -1 other are not judged to
Disconnected motion vector executes S202 step.
Table 1 is that the target vector selected using the embodiment of the present invention carries out efficiency comparative's table of Video coding, wherein Y,
U, V and YUV arranges code increase (negative value expression saving, the positive value expression increasing respectively indicated under identical Y, U, V and YUV merged-quality
Add).Wherein " Y " is brightness;" U " and " V " is coloration.As shown in table 1, it is carried out using the target vector of choosing of the embodiment of the present invention
Video coding, code rate the improving less than 1.55% relative to the code rate using prior art coding of video in encoded
In the case of, coding rate is improved 2.16% or more.
Table 1
Note: the term " visual classification " in table 1, which refers to, can carry out mesh using technical solution provided in an embodiment of the present invention
Mark the set of the video format of motion vector selection;It is understood that video format applied by the embodiment of the present invention includes
But the video format being not limited only in table 1.
Using embodiment illustrated in fig. 2 of the present invention provide a kind of target motion vectors selection method, judge it is current
When the coding distortion cost of target candidate motion vector is less than the first preset threshold, just using the target candidate motion vector as mesh
Motion vector is marked, thus finish the selection course of target motion vectors, and other target candidate movement arrows not being judged
Amount just need calculation code distortion cost, compared with the existing technology in, need to calculate the volume of all target candidate motion vectors
Code distortion cost reduces the quantity for needing the target candidate motion vector of calculation code distortion cost, and then reduces target
The process of motion vector selection is time-consuming.
Fig. 4 is the flow diagram of the acquisition methods of the first target candidate motion vector provided in an embodiment of the present invention;
As shown in Figure 4, comprising:
S201A: the number of adjacent data blocks is preset according to each unit, obtains the corresponding Candidate Motion of each predicting unit
First quantity of vector.
Wherein, the first quantity is positively correlated with number.
Illustratively, can be by the data block of the predeterminated position of predicting unit -1 such as, left, upper, lower-left and upper right are used as and are somebody's turn to do
The default adjacent data blocks of predicting unit.In the absence of the data block of these positions, it can be arranged for predicting unit -1 bigger
The first quantity.When the data block in above-mentioned position lacks one, the value of the first quantity can be 3;When in above-mentioned position
When data block lacks two, the value of the first quantity can be 4;When the data block in above-mentioned position lacks three, the first quantity
Value can be 5;When the data block in above-mentioned position lacks four, the value of the first quantity can be 6.For example, above-mentioned position
In data block lack two, then corresponding first quantity of the predicting unit -1 obtained in this step can be 4.
In practical applications, it is only necessary to guarantee that presetting adjacent data blocks when predicting unit lacks more, the predicting unit pair
The first quantity answered is bigger.It is understood that it is default with predicting unit to adjust the first quantity according to the actual situation
The positively related relationship of the number of adjacent data blocks.In addition, its positive correlation can be linear relationship, or non-linear
Relationship, the present invention are not defined herein.
It should be noted that above-mentioned " in the absence of the data block of these positions " it is to be understood that these positions number
According to the to be predicted or corresponding region of these data blocks is not required to, there is no pixels, for example, can be the blank in video frame
Region or solid color regions.
S201B: according to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained.
Illustratively, the corresponding candidate of each predicting unit H.264 or is H.265 obtained according to preset video encoding standard
Motion vector.Under normal conditions, the quantity of the candidate motion vector of each predicting unit is no more than 5.With predicting unit -1
For, the corresponding candidate motion vector of predicting unit -1 can be motion vector -1, motion vector -2, motion vector -3, movement
Vector -4 and motion vector -5.
S201C: according to the priority of candidate motion vector specified in preset video encoding standard, according to priority from
High sequence on earth is ranked up, using the corresponding candidate motion vector of the first quantity order preceding in obtained sequence as each
The target candidate motion vector of predicting unit.
Illustratively, according to preset video encoding standard H.264 or H.265 as defined in the corresponding candidate of predicting unit -1
The priority of motion vector is ranked up the candidate motion vector of predicting unit -1, for example, ranking results are as follows:
Motion vector -1, motion vector -2, motion vector -3, motion vector -4 and motion vector -5.
Using preceding 4 candidate motion vectors of above-mentioned sequence as the target candidate motion vector of predicting unit -1.
Using embodiment illustrated in fig. 4 of the present invention, it is possible to reduce the quantity of target candidate motion vector, and then mesh can be reduced
Mark the selection time of motion vector.
Fig. 5 is the flow diagram of the acquisition methods of second of target candidate motion vector provided in an embodiment of the present invention;
As shown in figure 5, this method may include:
S201D: presetting the feature of the motion vector distribution difference between adjacent data blocks according to each predicting unit, obtains
Second quantity of the corresponding candidate motion vector of each predicting unit.
Wherein, the value of the motion vector distribution difference between the second quantity and default adjacent data blocks is positively correlated.
Illustratively, H.264 or H.265 according to preset video encoding standard, the default phase of the predicting unit -1 of acquisition
Adjacent data block are as follows: left, upper, lower-left, upper right and upper left.When the variance of above-mentioned candidate motion vector is less than 0.3, the second quantity
Value can be 3;When the variance of above-mentioned candidate motion vector is greater than 0.3, and when less than 0.5, the value of the second quantity can be 4;When
The variance of above-mentioned candidate motion vector is greater than 0.5, and when less than 0.7, and the value of the second quantity can be 5;When above-mentioned Candidate Motion
When the variance of vector is greater than 0.7, the value of the second quantity can be 6;Or when the variance of the value of above-mentioned candidate motion vector is greater than
When a certain preset threshold, 5 value as the second quantity is preset.The embodiment of the present invention does not limit the occurrence of the second quantity
It is fixed, it is only necessary to be positively correlated the value of the motion vector distribution difference between the value of the second quantity and default adjacent data blocks.
The value of the second quantity obtained in this step is 4.
It is understood that the value of above-mentioned distributional difference and the feature of distributional difference, include but are not limited to variance, also
Can be other can evaluation and foreca unit preset the value of the motion vector distribution discrete type between adjacent data blocks, the present invention exists
This is not defined the type of the feature of the value of distributional difference and distributional difference.
S201E: according to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained.
Illustratively, H.264 or H.265 according to preset video encoding standard, the candidate fortune of the predicting unit -1 of acquisition
Dynamic vector can be motion vector -1, motion vector -2, motion vector -3, motion vector -4 and motion vector -5.
S201F: according to the priority of candidate motion vector specified in preset video encoding standard, according to priority from
High sequence on earth is ranked up, using the corresponding motion vector of the second quantity order preceding in obtained sequence as each prediction
The target candidate motion vector of unit.
Illustratively, according to preset video encoding standard H.264 or H.265 as defined in the corresponding candidate of predicting unit -1
The priority of motion vector is ranked up the candidate motion vector of predicting unit -1, for example, ranking results are as follows:
Motion vector -1, motion vector -2, motion vector -3, motion vector -4 and motion vector -5.
Using preceding 4 candidate motion vectors of above-mentioned sequence as the target candidate motion vector of predicting unit -1.
Using embodiment illustrated in fig. 5 of the present invention, it is possible to reduce the quantity of target candidate motion vector, and then mesh can be reduced
Mark the selection time of motion vector.
Fig. 6 is the flow diagram of the acquisition methods of the third target candidate motion vector provided in an embodiment of the present invention;
As shown in fig. 6, this method may include:
S201G: according to preset video encoding standard, the third of the corresponding candidate motion vector of each predicting unit is obtained
Quantity.
Illustratively, according to preset video encoding standard H.264 or H.265 as defined in the corresponding candidate of predicting unit -1
The number of motion vector can be 4.
It is understood that third quantity can for preset video encoding standard H.264 or H.265 as defined in K value, example
Such as, K value can be include in the set of the left side of predicting unit -1 the candidate motion vector corresponding with data block of upside movement swear
The number of amount.
S201H: according to the priority of candidate motion vector specified in preset video encoding standard, according to priority from
High sequence on earth is ranked up, using the corresponding motion vector of third quantity order preceding in obtained sequence as each prediction
The target candidate motion vector of unit.
Illustratively, according to preset video encoding standard H.264 or H.265 as defined in the corresponding candidate of predicting unit -1
The priority of motion vector is ranked up the candidate motion vector of predicting unit -1, for example, ranking results are as follows:
Motion vector -1, motion vector -2, motion vector -3, motion vector -4 and motion vector -5.
Using preceding 4 candidate motion vectors of above-mentioned sequence as the target candidate motion vector of predicting unit -1.
Using embodiment illustrated in fig. 6 of the present invention, it is possible to reduce the quantity of target candidate motion vector, and then mesh can be reduced
Mark the selection time of motion vector.
Second aspect, Fig. 7 are the process signal of another target motion vectors selection method provided in an embodiment of the present invention
Figure;As shown in fig. 7, embodiment illustrated in fig. 7 of the present invention increases before S202 on the basis of embodiment illustrated in fig. 2 of the present invention
S204, in this case, S202 can be S202A, and S203 can be S203A, wherein
S204: the difference in target candidate motion vector relative to other target candidate motion vectors is preset less than second
The target motion vectors of threshold value, the alternative motion vector as each predicting unit;Alternatively, by right in target candidate motion vector
The prediction result answered is less than the target candidate motion vector of third predetermined threshold value, and the alternative movement as each predicting unit is sweared
Amount;Alternatively, using relative to the maximum target candidate motion vector of the difference of other target candidate motion vectors as each prediction
The alternative motion vector of unit.
Illustratively, the target candidate motion vector of predicting unit -1 are as follows: motion vector -1, motion vector -2, movement arrow
Amount -3, motion vector -4 and motion vector -5.For each target candidate motion vector, available target candidate movement arrow
Amount and the target candidate motion vector of other predicting units before or the difference of target motion vectors, by difference less than second
The target candidate motion vector of preset threshold alternately motion vector;For example, the target of motion vector -1 and predicting unit -0
When the difference of motion vector is less than 0.2, the alternative motion vector by motion vector -1 as predicting unit -1.For motion vector-
2, motion vector -3, motion vector -4 and motion vector -5 are also handled according to the method described above.
It can also be directed to each target candidate motion vector, obtain the mesh of the target candidate motion vector and predicting unit -1
Mark candidate motion vector average value difference, by difference less than the second preset threshold target candidate motion vector alternately
Motion vector.It can also be directed to each target candidate motion vector, obtain the target candidate motion vector and predicting unit -1
The difference for the alternative motion vector having determined that, by difference less than the second preset threshold target candidate motion vector alternately
Motion vector.It is understood that above-mentioned difference includes but are not limited to the difference of the vector between motion vector, vector mould
Difference, any value that can measure difference between transport vector can be using in embodiments of the present invention.
Illustratively, it can also be directed to each target candidate motion vector, obtain the prediction of the target candidate motion vector
As a result.For example, the alternative movement when prediction result of motion vector -1 is less than 0.7, by motion vector -1 as predicting unit -1
Vector.Motion vector -2, motion vector -3, motion vector -4 and motion vector -5 are also handled according to the method described above.
Above-mentioned prediction result includes but are not limited to have as defined in distortion value or number of coded bits or preset coding standard
Imitate estimation range, it is to be understood that third predetermined threshold value is the evaluation result with prediction result same type, rather than just
Numerical value.
Illustratively, it can also determine in all target candidate motion vectors of predicting unit -1, be waited with other targets
The maximum target candidate motion vector of the difference of motion vector is selected, is sweared the motion vector as the alternative movement of predicting unit -1
Amount.Motion vector -2, motion vector -3, motion vector -4 and motion vector -5 are also handled according to the method described above.On
The difference stated includes but are not limited to the vector calculus of target candidate motion vector as a result, can also be target candidate motion vector
Mould.
For example, the alternative motion vector for the predicting unit -1 that this step obtains is motion vector -1, motion vector -2, movement
Vector -3.
S202A: successively obtaining the coding distortion cost of each alternative motion vector, and judges acquired alternative movement arrow
Whether the coding distortion cost of amount is less than the first preset threshold.
S203A: when there are the coding distortion costs of the first acquired alternative motion vector less than the first default threshold for judgement
Value, is determined as target motion vectors for the first alternative motion vector, and stops obtaining the next alternative of the first alternative motion vector
The coding distortion cost of motion vector.
Illustratively, for each alternative fortune in the alternative motion vector of the predicting unit -1 of the acquisition in S204 step
Dynamic vector judges whether the coding distortion cost of current alternative motion vector (the first alternative motion vector) is default less than first
Threshold value.For example, continuing to judge next alternative after current alternative motion vector is motion vector -1, has judged motion vector -1
Motion vector, it is to be understood that the embodiment of the present invention does not define the sequence of above-mentioned judgement, and above-mentioned judgement sequence can
Be random sequence, be also possible to according to the sequence from big to small of priority as defined in preset video encoding standard, can also be with
It is the sequence etc. according to priority as defined in preset video encoding standard from small arrival.
Using embodiment illustrated in fig. 7 of the present invention, it is possible to reduce the quantity of target candidate motion vector, after reducing quantity
Alternately motion vector, the process that can be further reduced target motion vectors selection are time-consuming for target candidate motion vector.
Fig. 8 is a kind of flow diagram of the preparation method of alternative motion vector provided in an embodiment of the present invention;Such as Fig. 8 institute
Show, S204 step may comprise steps of:
S204A: successively obtaining the corresponding prediction result of each target candidate motion vector, and judges that acquired target is waited
Select whether the prediction result of motion vector is less than third predetermined threshold value.
Target candidate motion vector are as follows: motion vector -1, motion vector -2, motion vector -3, motion vector -4 and movement
Vector -5.The corresponding prediction result of each target candidate motion vector can be obtained in the following way:
It, can be for each mesh in target candidate motion vector in a kind of specific embodiment of the embodiment of the present invention
Candidate motion vector is marked, using the estimation range of each target candidate motion vector as prediction result;Correspondingly, third presets threshold
Value is that estimation range is preset as defined in preset coding standard.
Illustratively, using the estimation range of motion vector -1 as the prediction result of the target candidate motion vector;It will be pre-
If video encoding standard H264 or H265 as defined in preset estimation range as third predetermined threshold value.And above-mentioned estimation range
It can be the range of the video frame where predicting unit, for example, the prediction unit of target candidate motion vector is greater than or equal to the
When three preset thresholds, i.e., target candidate motion vector has been directed toward except the video frame.Above-mentioned estimation range can also be that target is waited
The range of the value of motion vector is selected, for example, being (m, n) according to the range that statistical result obtains the value of common motion vector, such as
The value of fruit target candidate motion vector is more than the range, then it is assumed that the target candidate motion vector is more than default estimation range.It can
With understanding, the definition method of preset estimation range includes but are not limited to above method.
It, can also be for each in target candidate motion vector in a kind of specific embodiment of the embodiment of the present invention
Target candidate motion vector obtains of the corresponding whole pixel predictors of each target candidate motion vector relative to original image
One predicted distortion value;The corresponding first pre- dendrometry of each target candidate motion vector will be removed in the first predicted distortion value obtained
Minimum value other than true value, the difference of the first predicted distortion value corresponding with each target candidate motion vector, as each target
The corresponding prediction result of candidate motion vector.
Illustratively, when encoding predicting unit using motion vector -1 and predicting unit -1, which is encoded
The pixel predictors obtained afterwards are A, and the original pixel value of predicting unit is that the difference of B, above-mentioned A and B are the motion vector-obtained
1 corresponding first predicted distortion value.
At this point, predicting unit -1 obtained the first predicted distortion value motion vector be motion vector -2, motion vector -3,
And minimum value is the corresponding first predicted distortion value of motion vector -2.By the corresponding first predicted distortion value of motion vector -1 and fortune
Prediction result of the difference of the corresponding first predicted distortion value of dynamic vector -2 as motion vector -1.
It, can also be for each in target candidate motion vector in a kind of specific embodiment of the embodiment of the present invention
Candidate motion vector obtains the second predicted distortion value of corresponding first color component of each target candidate motion vector;It will
Minimum value in the second predicted distortion value obtained in addition to the corresponding second predicted distortion value of each target candidate motion vector,
The difference of the second predicted distortion value corresponding with each target candidate motion vector, it is corresponding as each target candidate motion vector
Prediction result.
Illustratively, when encoding predicting unit using motion vector -1 and predicting unit -1, which is encoded
The predicted value of first color component of image afterwards is C, and the value of the first color component of predicting unit is D, the difference of above-mentioned C and D
For the corresponding second predicted distortion value of motion vector -1 of acquisition.
At this point, predicting unit -1 obtained the first predicted distortion value motion vector be motion vector -2, motion vector -3,
And minimum value is the corresponding second predicted distortion value of motion vector -2.By the corresponding second predicted distortion value of motion vector -1 and fortune
Prediction result of the difference of the corresponding second predicted distortion value of dynamic vector -2 as motion vector -1.
It, can also be for each in target candidate motion vector in a kind of specific embodiment of the embodiment of the present invention
Candidate motion vector, it is and each by the third predicted distortion value of corresponding first color component of each target candidate motion vector
The sum of the 4th predicted distortion value of corresponding second color component of target candidate motion vector is used as the 5th predicted distortion value;It will
Minimum value in the 5th predicted distortion value obtained in addition to the corresponding 5th predicted distortion value of each target candidate motion vector,
The difference of the 5th predicted distortion value corresponding with each target candidate motion vector, it is corresponding as each target candidate motion vector
Prediction result.
Illustratively, when encoding predicting unit using motion vector -1 and predicting unit -1, which is encoded
The predicted value of first color component of image afterwards be E, the predicting unit be encoded after image the second color component it is pre-
Measured value is F.The value of first color component of predicting unit is G, and the value of the second color component of predicting unit is H.By E's and G
Difference is used as the corresponding third predicted distortion value of motion vector -1;F and the difference of H are as corresponding 4th predicted distortion of motion vector -1
Value;Again using the sum of third predicted distortion value and the 4th predicted distortion value as the 5th predicted distortion value of motion vector -1.
At this point, predicting unit -1 obtained the first predicted distortion value motion vector be motion vector -2, motion vector -3,
And minimum value is the corresponding 5th predicted distortion value of motion vector -2.By the corresponding 5th predicted distortion value of motion vector -1 and fortune
Prediction result of the difference of the corresponding 5th predicted distortion value of dynamic vector -2 as motion vector -1.
It should be noted that the first color component can be one in the RGB color component of predicting unit;Second color
Component can be one in two color components in the RGB color component of predicting unit in addition to the first color component.
S204B: threshold is preset less than third when determining that there are the prediction results of the second acquired target candidate motion vector
Value, is determined as alternative motion vector for the second target candidate motion vector, and stops obtaining the second target candidate motion vector
The prediction result of next target candidate motion vector.
Third predetermined threshold value includes but are not limited to preset as defined in preset video encoding standard H264 or H265 pre-
Minimum value in survey range, preset the first predicted distortion value that other have been obtained is corresponding with current target candidate motion vector
The upper limit value of difference of the first predicted distortion value, the minimum value in preset the second predicted distortion value that other have been obtained and current
The corresponding second predicted distortion value of target candidate motion vector difference upper limit value or it is preset other obtained the 5th
The upper limit value of the difference of minimum value the 5th predicted distortion value corresponding with current target candidate motion vector in predicted distortion value.
Illustratively, the prediction result of current target candidate motion vector, motion vector -1 presets threshold not less than third
Value, motion vector -1 cannot function as alternative motion vector, then using next motion vector of motion vector -1 as current mesh
First chosen sport vector is marked, for example, can be by motion vector -5 as current target candidate motion vector, and judge its prediction knot
Whether fruit is less than third prediction threshold value, until all being judged all target candidate motion vectors of predicting unit -1.
The prediction result of current target candidate motion vector, motion vector -1 is less than third predetermined threshold value, and movement is sweared
- 1 alternately motion vector of amount.
It in practical applications, can also be by the set for the alternative motion vector determined, as the standby of predicting unit -1
Select motion vector collection.
Using embodiment illustrated in fig. 8 of the present invention, it is possible to reduce the quantity of target candidate motion vector, after reducing quantity
Alternately motion vector, the process that can be further reduced target motion vectors selection are time-consuming for target candidate motion vector.
The third aspect, the embodiment of the invention also provides a kind of target motion vectors selection devices.Fig. 9 is that the present invention is implemented
A kind of structural schematic diagram of the selection device for target motion vectors that example provides;As shown in figure 9, the device includes:
Module 901 is obtained, for it is corresponding to obtain each predicting unit for each predicting unit in video to be encoded
Target candidate motion vector;
Judgment module 902 for successively obtaining the coding distortion cost of each target candidate motion vector, and judges to be obtained
Whether the coding distortion cost of the target candidate motion vector taken is less than the first preset threshold;
Determining module 903, for there are the coding distortion costs of acquired first object candidate motion vector when judgement
Less than the first preset threshold, first object candidate motion vector is determined as target motion vectors, and stops obtaining first object
The coding distortion cost of next target candidate motion vector of candidate motion vector.
Using embodiment illustrated in fig. 9 of the present invention provide a kind of target motion vectors selection device, judge it is current
When the coding distortion cost of target candidate motion vector is less than the first preset threshold, just using the target candidate motion vector as mesh
Motion vector is marked, thus finish the selection course of target motion vectors, and other target candidate movement arrows not being judged
Amount just need calculation code distortion cost, compared with the existing technology in, need to calculate the volume of all target candidate motion vectors
Code distortion cost reduces the quantity for needing the target candidate motion vector of calculation code distortion cost, and then reduces target
The process of motion vector selection is time-consuming.
In a kind of specific embodiment of the embodiment of the present invention, module 901 is obtained, is also used to:
The number that adjacent data blocks are preset according to each predicting unit obtains the corresponding Candidate Motion arrow of each predicting unit
First quantity of amount, wherein the first quantity is positively correlated with number;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of candidate motion vector specified in preset video encoding standard, from high in the end according to priority
Sequence be ranked up, it is single using the corresponding candidate motion vector of the first quantity order preceding in obtained sequence as each prediction
The target candidate motion vector of member.
Using the above embodiment of the present invention, it is possible to reduce the quantity of target candidate motion vector, and then target can be reduced
The selection time of motion vector.
In a kind of specific embodiment of the embodiment of the present invention, module 901 is obtained, is also used to:
The feature of the motion vector distribution difference between adjacent data blocks is preset according to each predicting unit, is obtained each pre-
Survey the second quantity of the corresponding candidate motion vector of unit, wherein the movement arrow between the second quantity and default adjacent data blocks
The value of amount distributional difference is positively correlated;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of candidate motion vector specified in preset video encoding standard, from high in the end according to priority
Sequence be ranked up, it is single using the corresponding candidate motion vector of the second quantity order preceding in obtained sequence as each prediction
The target candidate motion vector of member.
Using the above embodiment of the present invention, it is possible to reduce the quantity of target candidate motion vector, and then target can be reduced
The selection time of motion vector.
In a kind of specific embodiment of the embodiment of the present invention, module 901 is obtained, is also used to:
According to preset video encoding standard, the third quantity of the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of candidate motion vector specified in preset video encoding standard, from high in the end according to priority
Sequence be ranked up, it is single using the corresponding candidate motion vector of third quantity order preceding in obtained sequence as each prediction
The target candidate motion vector of member.
In a kind of specific embodiment of the embodiment of the present invention, the first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion of other target candidate motion vectors judged
Minimum value in cost.
In a kind of specific embodiment of the embodiment of the present invention, the first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion of other target candidate motion vectors judged
The difference of minimum value and pre-arranged code cost in cost.
Fourth aspect, the embodiment of the invention also provides the selection device of another target vector, Figure 10 is that the present invention is real
The structural schematic diagram of the selection device of another target motion vectors of example offer is applied, as shown in Figure 10, the device is in the present invention
Setup module 904 is increased on the basis of Fig. 9 shown device, is used for:
By the difference in target candidate motion vector relative to other target candidate motion vectors less than the second preset threshold
Target motion vectors, the alternative motion vector as each predicting unit;
Alternatively, the target candidate that prediction result corresponding in target candidate motion vector is less than third predetermined threshold value is moved
Vector, the alternative motion vector as each predicting unit;
Alternatively, using relative to the maximum target candidate motion vector of the difference of other target candidate motion vectors as each
The alternative motion vector of predicting unit;
Judgment module 902, is also used to:
The coding distortion cost of each alternative motion vector is successively obtained, and judges the volume of acquired alternative motion vector
Whether code distortion cost is less than the first preset threshold;
Determining module 903, is also used to:
When determine there are the coding distortion cost of the first acquired alternative motion vector be less than first preset threshold,
Described first alternative motion vector is determined as target motion vectors, and stops obtaining the next of the described first alternative motion vector
The coding distortion cost of alternative motion vector.
Using embodiment illustrated in fig. 10 of the present invention, it is possible to reduce the quantity of target candidate motion vector, after reducing quantity
Target candidate motion vector alternately motion vector, the process that can be further reduced target motion vectors selection is time-consuming.
In a kind of specific embodiment of the embodiment of the present invention, setup module 904 is also used to:
The corresponding prediction result of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the prediction result of vector is less than third predetermined threshold value;
When determining that there are the prediction results of the second acquired target candidate motion vector to be less than third predetermined threshold value, by the
Two target candidate motion vectors are determined as alternative motion vector, and stop obtaining next target of the second target candidate motion vector
The prediction result of candidate motion vector.
Using the above embodiment of the present invention, it is possible to reduce the quantity of target candidate motion vector, by the mesh after reduction quantity
Candidate motion vector alternately motion vector is marked, the process that can be further reduced target motion vectors selection is time-consuming.
In a kind of specific embodiment of the embodiment of the present invention, third predetermined threshold value is as defined in preset coding standard
Default estimation range;
Setup module 904, is also used to:
For each target candidate motion vector, the estimation range of each target candidate motion vector is obtained, as each
The corresponding prediction result of target candidate motion vector.
In a kind of specific embodiment of the embodiment of the present invention, setup module 904 is also used to:
For each target candidate motion vector, the corresponding whole pixel predictors phase of each target candidate motion vector is obtained
For the first predicted distortion value of original image;
The corresponding first predicted distortion value of each target candidate motion vector will be removed in the first predicted distortion value obtained
Minimum value in addition, the difference of the first predicted distortion value corresponding with each target candidate motion vector, as each target candidate
The corresponding prediction result of motion vector.
In a kind of specific embodiment of the embodiment of the present invention, setup module 904 is also used to:
For each target candidate motion vector, corresponding first color component of each target candidate motion vector is obtained
Second predicted distortion value;
The corresponding second predicted distortion value of each target candidate motion vector will be removed in the second predicted distortion value obtained
Minimum value in addition, the difference of the second predicted distortion value corresponding with each target candidate motion vector, as each target candidate
The corresponding prediction result of motion vector.
In a kind of specific embodiment of the embodiment of the present invention, setup module 904 is also used to:
For each target candidate motion vector, by the of corresponding first color component of each target candidate motion vector
Three predicted distortion values, the conduct of the sum of the 4th predicted distortion value of the second color component corresponding with each target candidate motion vector
5th predicted distortion value;
The corresponding 5th predicted distortion value of each target candidate motion vector will be removed in the 5th predicted distortion value obtained
Minimum value in addition, the difference of the 5th predicted distortion value corresponding with each target candidate motion vector, as each target candidate
The corresponding prediction result of motion vector.
In a kind of specific embodiment of the embodiment of the present invention, judgment module 902 is also used to:
Using the corresponding distortion value of color component of the predicting unit of each target candidate motion vector of correspondence as each mesh
Mark the coding distortion cost of candidate motion vector;Alternatively, by the color of the predicting unit of each target candidate motion vector of correspondence
The corresponding number of coded bits of component is lost with the linear superposition result of color component as the coding of each target candidate motion vector
True cost.
Using the above embodiment of the present invention, the coding distortion cost of available predicting unit.
In a kind of specific embodiment of the embodiment of the present invention, judgment module 902 is also used to:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Acquisition is corresponding with each target candidate motion vector, the predicting unit of corresponding each target candidate motion vector
The corresponding predicted value of color component;
By the absolute value of the difference of original pixel value and predicted value and original pixel value and predicted value difference square
With or original pixel value and predicted value difference transformation and as the coding distortion cost of each target candidate motion vector.
Using the above embodiment of the present invention, can be waited the corresponding distortion value of the color component of predicting unit as the target
Select the coding distortion cost of motion vector.
In a kind of specific embodiment of the embodiment of the present invention, judgment module 902 is also used to:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Acquisition is corresponding with each target candidate motion vector, the predicting unit of corresponding each target candidate motion vector
The corresponding coding and rebuilding value of color component;
By the absolute value of the difference of original pixel value and coding and rebuilding value and original pixel value and coding and rebuilding value difference
Quadratic sum or original pixel value and predicted value difference transformation and coding distortion as each target candidate motion vector
Cost.
Using the above embodiment of the present invention, can be waited the corresponding distortion value of the color component of predicting unit as the target
Select the coding distortion cost of motion vector.
5th aspect, the embodiment of the invention also provides a kind of electronic equipment, including processor 1101 and memory 1102,
Wherein,
Memory 1101, for storing computer program;
Processor 1102 when for executing the program stored on memory, executes following methods step:
For each predicting unit in video to be encoded, the corresponding target candidate movement arrow of each predicting unit is obtained
Amount;
The coding distortion cost of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the coding distortion cost of vector is less than the first preset threshold;
When determining that there are the coding distortion costs of acquired first object candidate motion vector less than the first preset threshold,
First object candidate motion vector is determined as target motion vectors, and stops obtaining the next of first object candidate motion vector
The coding distortion cost of target candidate motion vector.
Memory 1101 may include random access memory (Random Access Memory, RAM), also may include
Nonvolatile memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory
1101 can also be that at least one is located remotely from the storage device of aforementioned processor.
Above-mentioned processor 1102 can be general processor, including central processing unit (Central Processing
Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital
Signal Processing, DSP), specific integrated circuit (Application Specific Integrated Circuit,
ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic
Device, discrete gate or transistor logic, discrete hardware components.
6th aspect, the embodiment of the invention also provides a kind of computer readable storage medium, computer-readable storage mediums
It is stored with computer program in matter, is performed the steps of when computer program is executed by processor
For each predicting unit in video to be encoded, the corresponding target candidate movement arrow of each predicting unit is obtained
Amount;
The coding distortion cost of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the coding distortion cost of vector is less than the first preset threshold;
When determining that there are the coding distortion costs of acquired first object candidate motion vector less than the first preset threshold,
First object candidate motion vector is determined as target motion vectors, and stops obtaining the next of first object candidate motion vector
The coding distortion cost of target candidate motion vector.
7th aspect, the embodiment of the invention also provides a kind of computer program products comprising instruction, when it is being calculated
When being run on machine, so that computer executes following steps:
For each predicting unit in video to be encoded, the corresponding target candidate movement arrow of each predicting unit is obtained
Amount;
The coding distortion cost of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the coding distortion cost of vector is less than the first preset threshold;
When determining that there are the coding distortion costs of acquired first object candidate motion vector less than the first preset threshold,
First object candidate motion vector is determined as target motion vectors, and stops obtaining the next of first object candidate motion vector
The coding distortion cost of target candidate motion vector.
6th aspect, the embodiment of the invention provides a kind of computer programs, when run on a computer, make to succeed in one's scheme
Calculation machine executes following steps:
For each predicting unit in video to be encoded, the corresponding target candidate movement arrow of each predicting unit is obtained
Amount;
The coding distortion cost of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the coding distortion cost of vector is less than the first preset threshold;
When determining that there are the coding distortion costs of acquired first object candidate motion vector less than the first preset threshold,
First object candidate motion vector is determined as target motion vectors, and stops obtaining the next of first object candidate motion vector
The coding distortion cost of target candidate motion vector.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device,
For electronic equipment, computer readable storage medium, computer program product, since it is substantially similar to the method embodiment, institute
To be described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (32)
1. a kind of target motion vectors selection method, which is characterized in that the described method includes:
For each predicting unit in video to be encoded, the corresponding target candidate movement arrow of each predicting unit is obtained
Amount;
The coding distortion cost of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the coding distortion cost of vector is less than the first preset threshold;
When determine there are the coding distortion cost of acquired first object candidate motion vector be less than first preset threshold,
The first object candidate motion vector is determined as target motion vectors, and stops obtaining the first object Candidate Motion arrow
The coding distortion cost of next target candidate motion vector of amount.
2. the method according to claim 1, wherein the corresponding target of each predicting unit that obtains is waited
Select motion vector, comprising:
The number of adjacent data blocks is preset according to each predicting unit, obtains the corresponding candidate fortune of each predicting unit
First quantity of dynamic vector, wherein first quantity is positively correlated with the number;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority from height
Sequence on earth is ranked up, using the corresponding candidate motion vector of the first quantity order preceding in obtained sequence as each institute
State the target candidate motion vector of predicting unit.
3. method according to claim 1 or 2, which is characterized in that described to obtain the corresponding mesh of each predicting unit
Mark candidate motion vector, comprising:
The feature that the motion vector distribution difference between adjacent data blocks is preset according to each predicting unit, obtains each institute
State the second quantity of the corresponding candidate motion vector of predicting unit, wherein second quantity and the default adjacent data blocks
Between the value of motion vector distribution difference be positively correlated;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority from height
Sequence on earth is ranked up, using the corresponding candidate motion vector of the second quantity order preceding in obtained sequence as each institute
State the target candidate motion vector of predicting unit.
4. method according to claim 1 or 2, which is characterized in that described to obtain the corresponding mesh of each predicting unit
Mark candidate motion vector, comprising:
According to preset video encoding standard, the third quantity of the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority from height
Sequence on earth is ranked up, using the corresponding candidate motion vector of third quantity order preceding in obtained sequence as each institute
State the target candidate motion vector of predicting unit.
5. the method according to claim 1, wherein first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion cost of other target candidate motion vectors judged
In minimum value.
6. the method according to claim 1, wherein first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion cost of other target candidate motion vectors judged
In minimum value and pre-arranged code cost difference.
7. method according to claim 1 or 2, which is characterized in that successively obtain each target candidate fortune described
The coding distortion cost of dynamic vector, the method also includes:
By the difference in the target candidate motion vector relative to other target candidate motion vectors less than the second preset threshold
Target motion vectors, the alternative motion vector as each predicting unit;
Alternatively, the target candidate that corresponding prediction result in the target candidate motion vector is less than third predetermined threshold value is moved
Vector, the alternative motion vector as each predicting unit;
Alternatively, using relative to the maximum target candidate motion vector of the difference of other target candidate motion vectors as each described
The alternative motion vector of predicting unit;
The coding distortion cost for successively obtaining each target candidate motion vector, and judge acquired target candidate
Whether the coding distortion cost of motion vector is less than the first preset threshold, comprising:
The coding distortion cost of each alternative motion vector is successively obtained, and judges the volume of acquired alternative motion vector
Whether code distortion cost is less than the first preset threshold;
It is described to be preset when judgement is less than described first there are the coding distortion cost of acquired first object candidate motion vector
The first object candidate motion vector is determined as target motion vectors by threshold value, and stops obtaining the first object candidate
The coding distortion cost of next target candidate motion vector of motion vector, comprising:
When determining that there are the coding distortion costs of the first acquired alternative motion vector to be less than first preset threshold, by institute
It states the first alternative motion vector and is determined as target motion vectors, and stop obtaining the next alternative of the described first alternative motion vector
The coding distortion cost of motion vector.
8. the method according to the description of claim 7 is characterized in that prediction corresponding in the target candidate motion vector is tied
Fruit is less than the target candidate motion vector of third predetermined threshold value, the alternative motion vector as each predicting unit, comprising:
The corresponding prediction result of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the prediction result of vector is less than third predetermined threshold value;
When determining that there are the prediction results of the second acquired target candidate motion vector to be less than the third predetermined threshold value, by institute
It states the second target candidate motion vector and is determined as alternative motion vector, and stop obtaining the second target candidate motion vector
The prediction result of next target candidate motion vector.
9. according to the method described in claim 8, it is characterized in that, the third predetermined threshold value is preset coding standard regulation
Default estimation range;
It is described successively to obtain the corresponding prediction result of each target candidate motion vector, comprising:
For each target candidate motion vector, the estimation range of each target candidate motion vector is obtained, as
The corresponding prediction result of each target candidate motion vector.
10. according to the method described in claim 8, it is characterized in that, described successively obtain each target candidate movement arrow
Measure corresponding prediction result, comprising:
For each target candidate motion vector, the corresponding whole pixel prediction of each target candidate motion vector is obtained
It is worth the first predicted distortion value relative to original image;
The corresponding first predicted distortion value of each target candidate motion vector will be removed in the first predicted distortion value obtained
Minimum value in addition, the difference of the first predicted distortion value corresponding with each target candidate motion vector, as each described
The corresponding prediction result of target candidate motion vector.
11. according to the method described in claim 8, it is characterized in that, described successively obtain each target candidate movement arrow
Measure corresponding prediction result, comprising:
For each target candidate motion vector, corresponding first color point of each target candidate motion vector is obtained
Second predicted distortion value of amount;
The corresponding second predicted distortion value of each target candidate motion vector will be removed in the second predicted distortion value obtained
Minimum value in addition, the difference of the second predicted distortion value corresponding with each target candidate motion vector, as each described
The corresponding prediction result of target candidate motion vector.
12. according to the method described in claim 8, it is characterized in that, described successively obtain each target candidate movement arrow
Measure corresponding prediction result, comprising:
For each target candidate motion vector, by corresponding first color component of each target candidate motion vector
Third predicted distortion value, the 4th predicted distortion value of the second color component corresponding with each target candidate motion vector
The sum of be used as the 5th predicted distortion value;
The corresponding 5th predicted distortion value of each target candidate motion vector will be removed in the 5th predicted distortion value obtained
Minimum value in addition, the difference of the 5th predicted distortion value corresponding with each target candidate motion vector, as each described
The corresponding prediction result of target candidate motion vector.
13. the method according to claim 1, wherein described successively obtain each target candidate movement arrow
The coding distortion cost of amount, comprising:
Using the corresponding distortion value of color component of the predicting unit of each target candidate motion vector of correspondence as each institute
State the coding distortion cost of target candidate motion vector;Alternatively, by the prediction list of each target candidate motion vector of correspondence
The corresponding number of coded bits of color component of member is moved with the linear superposition result of color component as each target candidate
The coding distortion cost of vector.
14. according to the method for claim 13, which is characterized in that described to correspond to each target candidate motion vector
Predicting unit coding distortion cost of the corresponding distortion value of color component as each target candidate motion vector, packet
It includes:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Obtain, the prediction list of the corresponding each target candidate motion vector corresponding with each target candidate motion vector
The corresponding predicted value of color component of member;
By the absolute value of the difference of the original pixel value and the predicted value and the original pixel value and the predicted value
Difference quadratic sum or the original pixel value and the predicted value difference transformation and transported as each target candidate
The coding distortion cost of dynamic vector.
15. according to the method for claim 13, which is characterized in that described to correspond to each target candidate motion vector
Predicting unit coding distortion cost of the corresponding distortion value of color component as each target candidate motion vector, packet
It includes:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Obtain, the prediction list of the corresponding each target candidate motion vector corresponding with each target candidate motion vector
The corresponding coding and rebuilding value of color component of member;
By the absolute value of the difference of the original pixel value and the coding and rebuilding value and the original pixel value and the volume
The transformation of the difference of the quadratic sum or original pixel value and the predicted value of the difference of code reconstructed value and as each mesh
Mark the coding distortion cost of candidate motion vector.
16. a kind of target motion vectors selection device, which is characterized in that described device includes:
Module is obtained, for obtaining the corresponding target of each predicting unit for each predicting unit in video to be encoded
Candidate motion vector;
Judgment module, for successively obtaining the coding distortion cost of each target candidate motion vector, and acquired in judgement
Target candidate motion vector coding distortion cost whether less than the first preset threshold;
Determining module, for described when determining to be less than there are the coding distortion cost of acquired first object candidate motion vector
The first object candidate motion vector is determined as target motion vectors, and stops obtaining described first by the first preset threshold
The coding distortion cost of next target candidate motion vector of target candidate motion vector.
17. device according to claim 16, which is characterized in that the acquisition module is also used to:
The number of adjacent data blocks is preset according to each predicting unit, obtains the corresponding candidate fortune of each predicting unit
First quantity of dynamic vector, wherein first quantity is positively correlated with the number;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority from height
Sequence on earth is ranked up, using the corresponding candidate motion vector of the first quantity order preceding in obtained sequence as each institute
State the target candidate motion vector of predicting unit.
18. device according to claim 16 or 17, which is characterized in that the acquisition module is also used to:
The feature that the motion vector distribution difference between adjacent data blocks is preset according to each predicting unit, obtains each institute
State the second quantity of the corresponding candidate motion vector of predicting unit, wherein second quantity and the default adjacent data blocks
Between the value of motion vector distribution difference be positively correlated;
According to preset video encoding standard, the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority from height
Sequence on earth is ranked up, using the corresponding candidate motion vector of the second quantity order preceding in obtained sequence as each institute
State the target candidate motion vector of predicting unit.
19. device according to claim 16 or 17, which is characterized in that the acquisition module is also used to:
According to preset video encoding standard, the third quantity of the corresponding candidate motion vector of each predicting unit is obtained;
According to the priority of the candidate motion vector specified in the preset video encoding standard, according to priority from height
Sequence on earth is ranked up, using the corresponding candidate motion vector of third quantity order preceding in obtained sequence as each institute
State the target candidate motion vector of predicting unit.
20. device according to claim 16, which is characterized in that first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion cost of other target candidate motion vectors judged
In minimum value.
21. device according to claim 16, which is characterized in that first preset threshold includes:
In addition to current target candidate motion vector, the coding distortion cost of other target candidate motion vectors judged
In minimum value and pre-arranged code cost difference.
22. device according to claim 16 or 17, which is characterized in that described device further include: setup module is used for:
By the difference in the target candidate motion vector relative to other target candidate motion vectors less than the second preset threshold
Target motion vectors, the alternative motion vector as each predicting unit;
Alternatively, the target candidate that corresponding prediction result in the target candidate motion vector is less than third predetermined threshold value is moved
Vector, the alternative motion vector as each predicting unit;
Alternatively, using relative to the maximum target candidate motion vector of the difference of other target candidate motion vectors as each described
The alternative motion vector of predicting unit;
The judgment module, is also used to:
The coding distortion cost of each alternative motion vector is successively obtained, and judges the volume of acquired alternative motion vector
Whether code distortion cost is less than the first preset threshold;
The determining module, is also used to:
When determining that there are the coding distortion costs of the first acquired alternative motion vector to be less than first preset threshold, by institute
It states the first alternative motion vector and is determined as target motion vectors, and stop obtaining the next alternative of the described first alternative motion vector
The coding distortion cost of motion vector.
23. device according to claim 22, which is characterized in that the setup module is also used to:
The corresponding prediction result of each target candidate motion vector is successively obtained, and judges acquired target candidate movement
Whether the prediction result of vector is less than third predetermined threshold value;
When determining that there are the prediction results of the second acquired target candidate motion vector to be less than the third predetermined threshold value, by institute
It states the second target candidate motion vector and is determined as alternative motion vector, and stop obtaining the second target candidate motion vector
The prediction result of next target candidate motion vector.
24. device according to claim 23, which is characterized in that the third predetermined threshold value is preset coding standard rule
Fixed default estimation range;
The setup module, is also used to:
For each target candidate motion vector, the estimation range of each target candidate motion vector is obtained, as
The corresponding prediction result of each target candidate motion vector.
25. device according to claim 23, which is characterized in that the setup module is also used to:
For each target candidate motion vector, the corresponding whole pixel prediction of each target candidate motion vector is obtained
It is worth the first predicted distortion value relative to original image;
The corresponding first predicted distortion value of each target candidate motion vector will be removed in the first predicted distortion value obtained
Minimum value in addition, the difference of the first predicted distortion value corresponding with each target candidate motion vector, as each described
The corresponding prediction result of target candidate motion vector.
26. device according to claim 23, which is characterized in that the setup module is also used to:
For each target candidate motion vector, corresponding first color point of each target candidate motion vector is obtained
Second predicted distortion value of amount;
The corresponding second predicted distortion value of each target candidate motion vector will be removed in the second predicted distortion value obtained
Minimum value in addition, the difference of the second predicted distortion value corresponding with each target candidate motion vector, as each described
The corresponding prediction result of target candidate motion vector.
27. device according to claim 23, which is characterized in that the setup module is also used to:
For each target candidate motion vector, by corresponding first color component of each target candidate motion vector
Third predicted distortion value, the 4th predicted distortion value of the second color component corresponding with each target candidate motion vector
The sum of be used as the 5th predicted distortion value;
The corresponding 5th predicted distortion value of each target candidate motion vector will be removed in the 5th predicted distortion value obtained
Minimum value in addition, the difference of the 5th predicted distortion value corresponding with each target candidate motion vector, as each described
The corresponding prediction result of target candidate motion vector.
28. device according to claim 16, which is characterized in that the judgment module is also used to:
Using the corresponding distortion value of color component of the predicting unit of each target candidate motion vector of correspondence as each institute
State the coding distortion cost of target candidate motion vector;Alternatively, by the prediction list of each target candidate motion vector of correspondence
The corresponding number of coded bits of color component of member is moved with the linear superposition result of color component as each target candidate
The coding distortion cost of vector.
29. device according to claim 28, which is characterized in that the judgment module is also used to:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Obtain, the prediction list of the corresponding each target candidate motion vector corresponding with each target candidate motion vector
The corresponding predicted value of color component of member;
By the absolute value of the difference of the original pixel value and the predicted value and the original pixel value and the predicted value
Difference quadratic sum or the original pixel value and the predicted value difference transformation and transported as each target candidate
The coding distortion cost of dynamic vector.
30. device according to claim 28, which is characterized in that the judgment module is also used to:
Obtain the corresponding original pixel value of color component of the predicting unit of corresponding each target candidate motion vector;
Obtain, the prediction list of the corresponding each target candidate motion vector corresponding with each target candidate motion vector
The corresponding coding and rebuilding value of color component of member;
By the absolute value of the difference of the original pixel value and the coding and rebuilding value and the original pixel value and the volume
The transformation of the difference of the quadratic sum or original pixel value and the predicted value of the difference of code reconstructed value and as each mesh
Mark the coding distortion cost of candidate motion vector.
31. a kind of electronic equipment, which is characterized in that including processor and memory, wherein
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes that claim 1-15 is any described
Method and step.
32. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium
Program realizes claim 1-15 any method and step when the computer program is executed by processor.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711397175.0A CN109951707B (en) | 2017-12-21 | 2017-12-21 | Target motion vector selection method and device, electronic equipment and medium |
PCT/CN2018/122399 WO2019120255A1 (en) | 2017-12-21 | 2018-12-20 | Motion vector selection method and apparatus, electronic device, and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711397175.0A CN109951707B (en) | 2017-12-21 | 2017-12-21 | Target motion vector selection method and device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109951707A true CN109951707A (en) | 2019-06-28 |
CN109951707B CN109951707B (en) | 2021-04-02 |
Family
ID=66994437
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711397175.0A Active CN109951707B (en) | 2017-12-21 | 2017-12-21 | Target motion vector selection method and device, electronic equipment and medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109951707B (en) |
WO (1) | WO2019120255A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111083480A (en) * | 2019-12-10 | 2020-04-28 | 四川新视创伟超高清科技有限公司 | High-speed coding method for 8K ultra-high-definition video based on CPU |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003005731A1 (en) * | 2001-07-06 | 2003-01-16 | Koninklijke Philips Electronics N.V. | Motion estimation and compensation with controlled vector statistics |
CN1656515A (en) * | 2002-05-30 | 2005-08-17 | 皇家飞利浦电子股份有限公司 | Unit for and method of estimating a current motion vector |
CN103188496A (en) * | 2013-03-26 | 2013-07-03 | 北京工业大学 | Fast motion estimation video encoding method based on motion vector distribution forecast |
WO2014101089A1 (en) * | 2012-12-28 | 2014-07-03 | 华为技术有限公司 | Video coding method and device |
-
2017
- 2017-12-21 CN CN201711397175.0A patent/CN109951707B/en active Active
-
2018
- 2018-12-20 WO PCT/CN2018/122399 patent/WO2019120255A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003005731A1 (en) * | 2001-07-06 | 2003-01-16 | Koninklijke Philips Electronics N.V. | Motion estimation and compensation with controlled vector statistics |
CN1656515A (en) * | 2002-05-30 | 2005-08-17 | 皇家飞利浦电子股份有限公司 | Unit for and method of estimating a current motion vector |
WO2014101089A1 (en) * | 2012-12-28 | 2014-07-03 | 华为技术有限公司 | Video coding method and device |
CN103188496A (en) * | 2013-03-26 | 2013-07-03 | 北京工业大学 | Fast motion estimation video encoding method based on motion vector distribution forecast |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111083480A (en) * | 2019-12-10 | 2020-04-28 | 四川新视创伟超高清科技有限公司 | High-speed coding method for 8K ultra-high-definition video based on CPU |
CN111083480B (en) * | 2019-12-10 | 2022-11-04 | 四川新视创伟超高清科技有限公司 | High-speed coding method for 8K ultra-high definition video based on CPU |
Also Published As
Publication number | Publication date |
---|---|
CN109951707B (en) | 2021-04-02 |
WO2019120255A1 (en) | 2019-06-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102845060B (en) | Data compression for video | |
EP2629523A2 (en) | Data compression for video with preprocessing | |
US8204136B2 (en) | Image encoding apparatus | |
CN101552924B (en) | Spatial prediction method for video coding | |
CN106060539B (en) | A kind of method for video coding of low transmission bandwidth | |
CN108632627A (en) | Method for deriving reference prediction mode values | |
CN101309421B (en) | Intra-frame prediction mode selection method | |
CN101352046A (en) | Image encoding/decoding method and apparatus | |
CN102932642B (en) | Interframe coding quick mode selection method | |
CN103596004A (en) | Intra-frame prediction method and device based on mathematical statistics and classification training in HEVC | |
CN108028926A (en) | Picture coding device, picture decoding apparatus and its program | |
CN105141954A (en) | HEVC interframe coding quick mode selection method | |
CN102301716A (en) | Method for decoding a stream representative of a sequence of pictures, method for coding a sequence of pictures and coded data structure | |
CN109845263A (en) | Apparatus for video encoding and method | |
CN109379594A (en) | Video coding compression method, device, equipment and medium | |
CN104853192A (en) | Prediction mode selection method and device | |
CN109845252A (en) | Apparatus for video encoding and method | |
CN110087083A (en) | The selection method of prediction mode for chroma, image processing equipment and storage equipment in frame | |
CN106034235A (en) | Method for calculating coding distortion degree and coding mode control and system thereof | |
CN101569198A (en) | Decoding apparatus and decoding method | |
CN102740071A (en) | Scalable video codec encoder device and methods thereof | |
CN109819250A (en) | A kind of transform method and system of the full combination of multicore | |
CN104038769B (en) | Rate control method for intra-frame coding | |
CN104488268B (en) | Spatial prediction with increased number of possible coding mode | |
CN104104947B (en) | A kind of method for video coding and device |
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 |