CN104581180A - Video coding method and device - Google Patents
Video coding method and device Download PDFInfo
- Publication number
- CN104581180A CN104581180A CN201410852735.7A CN201410852735A CN104581180A CN 104581180 A CN104581180 A CN 104581180A CN 201410852735 A CN201410852735 A CN 201410852735A CN 104581180 A CN104581180 A CN 104581180A
- Authority
- CN
- China
- Prior art keywords
- search
- point
- current
- cost value
- video image
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000005070 sampling Methods 0.000 claims description 53
- 229910003460 diamond Inorganic materials 0.000 claims description 30
- 239000010432 diamond Substances 0.000 claims description 30
- 238000010845 search algorithm Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000006073 displacement reaction Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention provides a video coding method and device. The method includes the steps that downsampling is conducted on initial resolution video images, and downsampling video images of D resolution levels are generated; for the downsampling vide image of the lowest resolution level, the MV of the current PU and MVs of the PUs adjacent to the current PU serve as candidates, and the MV of the minimum coding cost valve is selected to serve as the searching start point to conduct movement estimation; for the downsampling video images of the medium resolution level, the MV of the current PU, the MVs of the PUs adjacent to the current PU and the MVs of the adjacent PUs corresponding to the current PU in position in the downsampling video images of the resolution level being one level lower than the current resolution level serve as candidates, and the MV of the minimum coding cost value is selected to serve as the searching start point to conduct movement estimation; for the initial resolution video images, the MV of the adjacent block of the current PU and the MVs of the PUs overlapped with or partially overlapped with the image region occupied by the current PU in the downsampling video images of the resolution level being one level lower than the current level serve as candidates, and the MV of the minimum coding cost valve serves as the searching start point to conduct movement estimation.
Description
Technical field
The application relates to field of video encoding, particularly relates to a kind of method for video coding and device.
Background technology
When carrying out inter prediction encoding to video image, because the scenery in live image contiguous frames also exists certain correlation, therefore live image can be divided into some pieces or macro block, and manage to search out each piece or the position of macro block in contiguous frames image, and draw the relative displacement of locus between the two, the relative displacement obtained is exactly the motion vector of usual indication, and the process obtaining motion vector is called as estimation.
Motion vector and the predicated error that obtains after motion match are sent to decoding end jointly, in the position that decoding end indicates according to motion vector, from the contiguous reference frame image of having decoded, find corresponding block or macro block, and just obtain block or macro block position in the current frame after predicated error addition.
The interframe redundancy of video image can be removed by estimation, the bit number of transmission of video is greatly reduced.Therefore, estimation is an important component part in video coding system.General method for estimating is as follows: set the two field picture of t as present frame f (x, y), the two field picture of moment t ' is reference frame f ' (x, y), reference frame in advance or can lag behind present frame in time, as shown in Figure 1, as t ' <t, be referred to as forward motion estimation, as t ' >t, be referred to as backward motion estimation.When searching the optimum Match of the block in present frame t in reference frame t ', corresponding sports ground d (x can be obtained; T, t ± Δ t), the motion vector of present frame can be obtained.
The motion vector search method of current optimum is full search algorithm, that is: in a predefined region of search, current PU (Prediction Unit, predicting unit) compare with all candidate blocks in reference frame, and find one with minimum match error, the displacement between these two blocks is exactly estimated MV (motion vector).Adopt full search algorithm must cause great amount of calculation.
Fast search algorithm conventional in prior art is compared with full search algorithm, although the matching result of suboptimum can only be obtained, and Be very effective in minimizing operand.Such as, two dimensional logarithmic search method, three-step-march search method, hybrid search algorithm etc.But need wider motion estimation search range owing to carrying out Video coding to large resolution video image, above-mentioned fast algorithm of the prior art still can not meet the demand of existing coding framework.
Summary of the invention
Technical problems to be solved in this application are, overcome the deficiencies in the prior art, provide a kind of method for video coding and the device that can improve HEVC Video coding speed.
In order to solve the problem, the application provides a kind of method for video coding, and the method comprises:
Down-sampling is carried out to initial resolution video image to be encoded, generates the down-sampling video image of D different resolution level; D be more than or equal to 1 integer;
To the down-sampling video image of lowest resolution level, by the MV alternatively MV of the encoded adjacent PU of the MV of current PU and current PU, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
When D is the integer being greater than 1, to the down-sampling video image of middle stage resolution ratio, by the MV alternatively MV of the adjacent PU of position corresponding to current PU in the down-sampling video image of the MV of the encoded adjacent PU of the MV of current PU, current PU and a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
To initial resolution video image, by the MV of the adjacent block of current PU and the MV alternatively MV of PU that overlaps with image-region shared by current PU or partially overlap in the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU.
In addition, to the down-sampling video image of lowest resolution level, following steps are adopted to carry out estimation:
A: be initial search center point with initial search point, perform the search of following double trapezoid: the coding cost value corresponding to point to be searched calculating current search central point and be positioned on double trapezoid upper base and waist, to there is the point of minimum code cost value as new search center point, repeat the search of described double trapezoid, maybe the optimum search point that the point with minimum code cost value is searched for as double trapezoid is performed next step;
B: with double trapezoid search optimum search point be initial search center point, perform following hexagon search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on hexagon summit, to there is the point of minimum code cost value as new search center point, repeat described hexagon search, maybe the point with minimum code cost value is performed next step as the optimum search point of hexagon search;
C: be initial search center point with the optimum search of hexagon search point, perform following diamond search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit, to there is the point of minimum code cost value as new search center point, repeat described diamond search, maybe using the shift value that has between the point of minimum code cost value and the current PU MV as current PU.
In addition, in described steps A, step B and step C, search for the step value adopted and be respectively: S
t, S
hand S
r;
Wherein, S
tfor being greater than S
hinteger, S
hfor being greater than S
rinteger, S
rfor being more than or equal to the integer of 1.
In addition, in described steps A, current search central point is denoted as the initial point of coordinate system, then the point to be searched be positioned at described on double trapezoid upper base and waist comprises:
{4,0},{0,4},{-4,0},{0,-4},{2,3},{4,1},{4,-1},{4,2},{-2,3},{2,-3},{-2,-3},{-4,1},{-4,-1},{4,-2},{-4,2},{-4,-2}。
In addition, to down-sampling video image, sad value is carried out the selection of described initial search point as coding cost value;
To initial resolution video image, rate distortion costs value is carried out the selection of described initial search point as coding cost value.
In addition, when carrying out described estimation to down-sampling video image, the reference frame that estimation uses is primitive frame.
The present invention also provides a kind of video coding apparatus, and this device comprises: downsampling unit and predicting unit; Wherein:
Described downsampling unit, for carrying out down-sampling to initial resolution video image to be encoded, generates the down-sampling video image of D different resolution level; D be more than or equal to 1 integer;
Described predicting unit, for the MV alternatively MV of the adjacent PU by the MV of current PU and the encoded of current PU in the down-sampling video image of lowest resolution level, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
When D is the integer being greater than 1, described predicting unit, also for the MV alternatively MV by the adjacent PU of position corresponding to current PU in the MV of the MV of current PU, the encoded adjacent PU of current PU in the down-sampling video image of mid-resolution level and the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
Described predicting unit, also for the MV of the adjacent block by PU current in initial resolution video image and the MV alternatively MV of PU that overlaps with image-region shared by current PU or partially overlap in the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU.
In addition, described predicting unit adopts following steps to carry out estimation to the down-sampling video image of lowest resolution level:
A: be initial search center point with initial search point, perform the search of following double trapezoid: the coding cost value corresponding to point to be searched calculating current search central point and be positioned on double trapezoid upper base and waist, to there is the point of minimum code cost value as new search center point, repeat the search of described double trapezoid, maybe the optimum search point that the point with minimum code cost value is searched for as double trapezoid is performed next step;
B: with double trapezoid search optimum search point be initial search center point, perform following hexagon search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on hexagon summit, to there is the point of minimum code cost value as new search center point, repeat described hexagon search, maybe the point with minimum code cost value is performed next step as the optimum search point of hexagon search;
C: be initial search center point with the optimum search of hexagon search point, perform following diamond search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit, to there is the point of minimum code cost value as new search center point, repeat described diamond search, maybe using the shift value that has between the point of minimum code cost value and the current PU MV as current PU.
In addition, described predicting unit is in described steps A, step B and step C, and the step-size in search value adopted is respectively: S
t, S
hand S
r;
Wherein, S
tfor being greater than S
hinteger, S
hfor being greater than S
rinteger, S
rfor being more than or equal to the integer of 1.
In addition, when described predicting unit carries out described estimation to down-sampling video image, the reference frame that estimation uses is primitive frame.
The invention provides a kind of can be applied to HEVC Video coding system method for video coding and corresponding device, by carrying out estimation in other down-sampled images of lower-resolution stages, MV estimation obtained is applied in the estimation of the video image of high-resolution rank.Use above-mentioned from lowest resolution to highest resolution estimation upwards step by step, carry out at highest resolution the last solution that initial search point that estimation uses more is tending towards close to MV, and be less than the search total degree needed for directly searching in highest resolution level at the search total degree that each resolution levels carries out carrying out required for estimation.Through test, adopt method of the present invention and device, the video encoding time of 50% can be saved on existing x265 coding framework.
Accompanying drawing explanation
Fig. 1 is forward and backward estimation schematic diagram in prior art;
Fig. 2 is the method for video coding flow chart of the embodiment of the present invention;
Fig. 3 is the schematic diagram adopting the mode of decimation to carry out down-sampling;
Fig. 4 is the position view of the encoded adjacent PU of current PU;
Fig. 5 be the embodiment of the present invention adopt double trapezoid search, hexagon search and diamond search the position view of point to be searched;
Fig. 6 is the position view of the adjacent PU of position corresponding to current PU in a low stage resolution ratio video image;
Fig. 7 is the spatial domain position candidate schematic diagram of the movable information of HEVC;
Fig. 8 is the structural representation of embodiment of the present invention video coding apparatus.
Embodiment
Core of the present invention is:
Down-sampling is carried out to initial resolution video image to be encoded, generates other video image of one or more stage resolution ratios;
When inter prediction is carried out to the video image of lowest resolution rank, by current PU (Prediction Unit, predicting unit) MV (motion vector) and the MV alternatively MV of encoded adjacent PU of current PU, choosing the minimum MV of one of them coding cost value (such as, absolute length chang SAD) is that current PU carries out estimation as initial search point;
When inter prediction is carried out to the video image of middle resolution levels, by the MV alternatively MV of the adjacent PU of position corresponding to current PU in the MV of the encoded adjacent PU of the MV of current PU, current PU and a low stage resolution ratio video image, choosing the minimum MV of one of them coding cost value (such as, SAD) as initial search point is that current PU carries out estimation;
To raw video image (i.e. initial resolution video image, or be called highest resolution video image) when carrying out inter prediction, by the MV of the adjacent block of current PU and the MV alternatively MV of PU that overlaps with image-region shared by current PU or partially overlap in a low stage resolution ratio video image, choosing the minimum MV of one of them coding cost value (such as, rate distortion costs value) is that current PU carries out estimation as initial search point.
Below in conjunction with accompanying drawing, embodiments of the present invention is described in detail.
Fig. 2 is the method for video coding flow chart of the embodiment of the present invention; As shown in Figure 2, the method comprises:
Step 201: to initial resolution video image (L to be encoded
0level video image) sequence carries out down-sampling, generates the down-sampling video image of each stage resolution ratio: L
1..., L
dlevel video image; D be more than or equal to 1 integer;
In this step, different down-sampling ratio (i.e. the ratio of source resolution and target resolution) can be adopted to carry out down-sampling.When down-sampling ratio is Ds:1, represent every Ds pixel sampling 1 pixel, Ds be greater than 1 integer.
In the present embodiment, in order to retain the primary characteristic (such as, the textural characteristics of video) of video better, making Ds=2, namely adopting the mode of decimation to carry out down-sampling, as shown in Figure 3.
In addition, in order to accelerate the speed of computing, only down-sampling process being done to primitive frame in the present embodiment, reconstructed frame is not dealt with.
Step 202: to lowest resolution level (L
dlevel) video image carries out inter prediction, obtains the motion vector of each PU;
At lowest resolution level (L
dlevel) when carrying out inter prediction, the hunting zone SearchRange of estimation
dbe the length of side be R
dsquare area, R
d=R
0/ 2
d;
Wherein: R
0for video coding apparatus is L according to HEVC specification
0the hunting zone SearchRange that level video image (i.e. initial resolution video image) configures
0the length of side.
At lowest resolution level (L
dlevel) carry out inter prediction and adopt approximate full search method to carry out estimation (namely MV searches for), to obtain motion estimation result more accurately; In addition, in order to obtain arithmetic speed faster, the primitive frame that the reference frame used in this step is video image.Below will at lowest resolution level (L
dlevel) the concrete mode of carrying out estimation (i.e. MV search for) is described.
Step 202A: the initial search point determining estimation;
In the present embodiment, at lowest resolution level (L
dlevel), from the MV of the encoded adjacent PU of current PU, and the MV of current PU, namely in MV (0,0), the MV selecting coding cost value (such as, sad value) minimum is as the initial search point of current PU.
In the present embodiment, following formulae discovery lowest resolution level (L can be adopted
dlevel) sad value of each MV:
Wherein, s is current initial data of carrying out encoding, and c is the data of the reference frame for carrying out motion compensation of coding and rebuilding; Bx, By are the wide high information of current prediction block; MV is the motion vector of candidate; MV
xfor the x coordinate of motion vector; MV
yfor the y coordinate of motion vector.
The encoded adjacent PU of above-mentioned current PU comprises current PU's: left adjacent PU, one or more in upper left adjacent PU, upper adjacent PU and the adjacent PU of upper right, as shown in Figure 4.
Step 202B: the hunting zone (SearchRange preset
d) in, with S
tbe that initial search center point carries out double trapezoid search for step-length, with initial search point;
Above-mentioned double trapezoid search refers to: calculating current search central point and the coding cost value corresponding to point to be searched be positioned on double trapezoid upper base and waist are (such as, sad value), to there is the point of minimum sad value as new search center point, repeat double trapezoid search, until meet overall end condition or local end condition.
Above-mentioned double trapezoid is: go to the bottom for two and to overlap in Y-axis, and the center of going to the bottom is coordinate origin, upper base lays respectively at first, fourth quadrant (on the right side of Y-axis) of coordinate system, and the isosceles trapezoid of second and third quadrant (on the left of Y-axis) of coordinate system.
Above-mentioned overall end condition comprises: current corresponding sad value to be searched is less than the SAD stop value SAD preset
e; When satisfied overall end condition, stop the MV search of current PU, using current point to be searched as optimum search point, and using the MV of the shift value between optimum search point and current PU as current PU.
Wherein, SAD
e=M × N × threadhold;
M and N is respectively wide, the high level of PU, 0<threadhold<16;
In the present embodiment, get threadhold=4, namely to 8 × 8 PU search for time, SAD
e=4 × 8 × 8.
Above-mentioned local end condition comprises: the sad value being positioned at the point all to be searched on double trapezoid upper base and waist is all more than or equal to the sad value of current search central point; When satisfied local end condition, stop the search of step 202B, using current search central point as optimum search point, and using the search center point of this optimum search point as hexagon search, jump to step 202C and perform hexagon search.
When carrying out double trapezoid search, for the point to be searched exceeding hunting zone, its sad value can be arranged to be greater than current search central point and (be denoted as SAD with other numerical value not exceeding the sad value of the point to be searched of hunting zone
∞), namely guarantee that the sad value of the point to be searched exceeding hunting zone is greater than and allly do not exceed the point to be searched of hunting zone and the sad value of current search central point.
In the present embodiment, the step value S of double trapezoid search
tmeet: 4≤S
t≤ 16;
In the present embodiment, get S
t=4; Namely using the coordinate of current search central point as coordinate origin (0,0), each X-axis coordinate figure of point to be searched and the maximum of Y-axis coordinate figure are 4.
As shown in Figure 5, in the present embodiment, the point each to be searched of double trapezoid search comprises:
{4,0},{0,4},{-4,0},{0,-4},{2,3},{4,1},{4,-1},{4,2},{-2,3},{2,-3},{-2,-3},{-4,1},{-4,-1},{4,-2},{-4,2},{-4,-2}。
In figure, black circle represents point to be searched, and soft dot represents current search central point.
Adopt above-mentioned dot matrix to carry out double trapezoid search and can obtain Search Results more accurately.
Step 202C: the hunting zone (SearchRange preset
d) in, with S
hfor step-length, the optimum search point that obtains with double trapezoid search are that initial search center point carries out hexagon search;
Above-mentioned hexagon search refers to: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on hexagon summit (such as, sad value), to there is the point of minimum sad value as new search center point, repeat hexagon search, until meet overall end condition or local end condition.
Above-mentioned overall end condition comprises: current corresponding sad value to be searched is less than SAD
e; When satisfied overall end condition, stop the MV search of current PU, using current point to be searched as optimum search point, using the MV of the shift value between optimum search point and current PU as current PU.
Above-mentioned local end condition comprises: the sad value being positioned at the point all to be searched on hexagon summit is all more than or equal to the sad value of current search central point; When satisfied local end condition, stop the search of step 202C, using the initial ranging central point of current search central point as optimum search point and diamond search, jump to step 202D and perform diamond search.
When carrying out hexagon search, for the point to be searched exceeding hunting zone, its sad value can be arranged to be greater than current search central point and (be denoted as SAD with other numerical value not exceeding the sad value of the point to be searched of hunting zone
∞), namely guarantee that the sad value of the point to be searched exceeding hunting zone is greater than and allly do not exceed the point to be searched of hunting zone and the sad value of current search central point.
In the present embodiment, the step value S of hexagon search
hmeet: S
h<S
t, and 2≤S
h≤ 4;
In the present embodiment, get S
h=2; Namely using the coordinate of current search central point as coordinate origin (0,0), each X-axis coordinate figure of point to be searched and the maximum of Y-axis coordinate figure are 2.
As shown in Figure 5, in the present embodiment, the point each to be searched of hexagon search comprises:
{2,0},{-2,0},{1,2},{-1,2},{1,-2},{-1,-2}。
In figure, black circle represents point to be searched, and soft dot represents current search central point.
Step 202D: the hunting zone (SearchRange preset
d) in, with S
rfor step-length, the optimum search point that obtains with hexagon search are that initial search center point carries out diamond search, to correct hexagon search result;
Above-mentioned diamond search refers to: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit (such as, sad value), the point with minimum sad value is repeated diamond search as new search center point, until meet overall end condition or local end condition.
Above-mentioned overall end condition comprises: current corresponding sad value to be searched is less than SAD
e; When satisfied overall end condition, stop the MV search of current PU, using current point to be searched as optimum search point, using the MV of the shift value between optimum search point and current PU as current PU.
Above-mentioned local end condition comprises: the sad value being positioned at the point all to be searched on rhombus summit is all more than or equal to the sad value of current search central point; When satisfied local end condition, stop the search of step 202D, using the MV of the shift value between current point to be searched (i.e. optimum search point) and current PU as current PU.
When carrying out diamond search, for the point to be searched exceeding hunting zone, its sad value can be arranged to be greater than current search central point and (be denoted as SAD with other numerical value not exceeding the sad value of the point to be searched of hunting zone
∞), namely guarantee that the sad value of the point to be searched exceeding hunting zone is greater than and allly do not exceed the point to be searched of hunting zone and the sad value of current search central point.
In the present embodiment, the step value S of diamond search
r<S
h; And 1≤S
r≤ 2;
In the present embodiment, get S
r=1; Namely using the coordinate of current search central point as coordinate origin (0,0), each X-axis coordinate figure of point to be searched and the maximum of Y-axis coordinate figure are 1.
As shown in Figure 5, in the present embodiment, the point each to be searched of diamond search comprises:
{1,0},{0,1},{-1,0},{0,-1}。
In figure, black circle represents point to be searched, and soft dot represents current search central point.
In this step, the three kinds of searching methods adopting step-length to reduce gradually in the down-sampled images of lowest resolution level carry out estimation, can obtain good motion estimation result.
Step 203: with stage resolution ratio order from low to high, to each mid-resolution level (L
dlevel, 0<d<D) video image carries out inter prediction, obtains the motion vector of each PU;
At mid-resolution level (L
dlevel, 0<d<D) when carrying out inter prediction, the hunting zone SearchRange of estimation
dbe the length of side be R
dsquare area, R
d=R
0/ 2
d;
Wherein: R
0for video coding apparatus is L according to HEVC specification
0the hunting zone SearchRange that level video image (i.e. initial resolution video image) configures
0the length of side.
At mid-resolution level (L
dlevel, 0<d<D) adopt diamond search method to carry out estimation (MV search) when carrying out inter prediction; In addition, in order to obtain arithmetic speed faster, the primitive frame that the reference frame used in this step is video image.Below will at mid-resolution level (L
dlevel, 0<d<D) the concrete mode of carrying out estimation (i.e. MV search for) is described.
Step 203A: the initial search point determining estimation;
In the present embodiment, at mid-resolution level (L
dlevel, 0<d<D), from the MV and a low stage resolution ratio video image of the MV of the encoded adjacent PU of current PU, current PU (in other words in a low stage resolution ratio video image PU corresponding to current PU) adjacent PU of position corresponding to current PU MV in, the MV selecting SAD minimum is as the initial search point of current PU.
In the present embodiment, following formulae discovery mid-resolution level (L can be adopted
dlevel, 0<d<D) sad value of each MV:
Wherein, s is current initial data of carrying out encoding, and c is the data of the reference frame for carrying out motion compensation of coding and rebuilding; Bx, By are the wide high information of current prediction block; MV is the motion vector of candidate; MV
xfor the x coordinate of motion vector; MV
yfor the y coordinate of motion vector.
The encoded adjacent PU of above-mentioned current PU can comprise current PU's: left adjacent PU, one or more in upper left adjacent PU, upper adjacent PU and the adjacent PU of upper right, as shown in Figure 4.
In an above-mentioned low stage resolution ratio video image, the adjacent PU of position corresponding to current PU can comprise correspondence position: right adjacent PU, one or more in lower-left adjacent PU, lower adjacent PU and the adjacent PU in bottom right, as shown in Figure 6.
Step 203B: the hunting zone (SearchRange preset
d) in, with S
rfor step-length carries out diamond search, until meet end condition;
Above-mentioned diamond search refers to: using initial search point as initial search center point, calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit (such as, sad value), the point with minimum sad value is continued to perform diamond search as new search center point.
Above-mentioned end condition comprises:
1) current corresponding sad value to be searched is less than SAD
e;
2) sad value being positioned at the point all to be searched on rhombus summit is all more than or equal to the sad value of current search central point;
When meeting end condition 1, sad value is less than SAD
epoint to be searched as optimum search point, using the MV of the shift value between itself and current PU as current PU; When meeting end condition 2, using current search central point as optimum search point, using the MV of the shift value between itself and current PU as current PU.
When carrying out diamond search, for the point to be searched exceeding hunting zone, its sad value can be arranged to be greater than current search central point and (be denoted as SAD with other numerical value not exceeding the sad value of the point to be searched of hunting zone
∞), namely guarantee that the sad value of the point to be searched exceeding hunting zone is greater than and allly do not exceed the point to be searched of hunting zone and the sad value of current search central point.
In the present embodiment, the step value S of diamond search
rmeet: 1≤S
r≤ 2;
In the present embodiment, get S
r=1.
As shown in Figure 5, in the present embodiment, the point each to be searched of diamond search comprises:
{1,0},{0,1},{-1,0},{0,-1}。
As D=1, owing to there is no mid-resolution down-sampling video image, omit this step.
Step 204: to initial resolution video image (L to be encoded
0level video image) carry out inter prediction, obtain the motion vector of each PU;
To initial resolution video image (L
0level video image) when carrying out inter prediction, the hunting zone SearchRange of estimation
0be the length of side be R
0square area; R
0for video coding apparatus is L according to HEVC specification
0the hunting zone SearchRange that level video image (i.e. initial resolution video image) configures
0the length of side.
At initial resolution level (L
0level) carry out inter prediction and adopt diamond search method to carry out estimation (namely MV searches for), in addition, in order to obtain more accurate motion estimation result, the reconstructed frame that the reference frame used in this step is video image.Below will at initial resolution level (L
0level) the concrete mode of carrying out estimation (i.e. MV search for) is described.
Step 204A: the initial search point determining estimation;
In the present embodiment, at initial resolution level (L
0level), from MV and a low stage resolution ratio (L of the MV of the adjacent block of current PU, current PU
1level) in the MV of PU that overlaps with image-region shared by current PU or partially overlap in video image, the MV selecting coding cost value (such as, rate distortion costs value) minimum is as the initial search point of current PU.
In the present embodiment, the rate distortion costs value of each MV of following formulae discovery can be adopted:
J(MV,λ)=SAD(s,c(MV))+λ×R(MV-PMV);
Wherein, MV is the motion vector of candidate, and λ is Lagrangian constant, and PMV is median prediction vector, and R (MV-PMV) represents the bit number that motion vector differential coding may expend.
Fig. 7 is the spatial domain position candidate schematic diagram of the movable information of HEVC.{ a as shown in Figure 7 can be adopted in the present embodiment
0, a
1, b
0, b
1, b
2as the adjacent block of current PU.
Step 204B: the hunting zone (SearchRange preset
0) in, with S
rfor step-length carries out diamond search, until meet end condition;
Above-mentioned diamond search refers to: using initial search point as initial search center point, calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit (such as, rate distortion costs value), the point with minimum rate distortion costs value is continued to perform diamond search as new search center point.
Above-mentioned end condition comprises:
1) current corresponding sad value to be searched is less than SAD
e;
2) the rate distortion costs value being positioned at the point all to be searched on rhombus summit is all more than or equal to the rate distortion costs value of current search central point;
When meeting end condition 1, sad value is less than SAD
epoint to be searched as optimum search point, using the MV of the shift value between itself and current PU as current PU; When meeting end condition 2, using current search central point as optimum search point, using the MV of the shift value between itself and current PU as current PU.
Fig. 8 is the structural representation of embodiment of the present invention video coding apparatus, and as shown in Figure 8, this device comprises: downsampling unit and predicting unit; Wherein:
Downsampling unit, for carrying out down-sampling to initial resolution video image to be encoded, generates the down-sampling video image of D different resolution level; D be more than or equal to 1 integer;
Predicting unit, for the MV alternatively MV of the adjacent PU by the MV of current PU and the encoded of current PU in the down-sampling video image of lowest resolution level, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
When D is the integer being greater than 1, predicting unit, also for the MV alternatively MV by the adjacent PU of position corresponding to current PU in the MV of the MV of current PU, the encoded adjacent PU of current PU in the down-sampling video image of mid-resolution level and the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
Predicting unit, also for the MV of the adjacent block by PU current in initial resolution video image and the MV alternatively MV of PU that overlaps with image-region shared by current PU or partially overlap in the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU.
Predicting unit adopts following steps to carry out estimation to the down-sampling video image of lowest resolution level:
A: be initial search center point with initial search point, perform the search of following double trapezoid: the coding cost value corresponding to point to be searched calculating current search central point and be positioned on double trapezoid upper base and waist, to there is the point of minimum code cost value as new search center point, repeat the search of described double trapezoid, maybe the optimum search point that the point with minimum code cost value is searched for as double trapezoid is performed next step;
B: with double trapezoid search optimum search point be initial search center point, perform following hexagon search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on hexagon summit, to there is the point of minimum code cost value as new search center point, repeat described hexagon search, maybe the point with minimum code cost value is performed next step as the optimum search point of hexagon search;
C: be initial search center point with the optimum search of hexagon search point, perform following diamond search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit, to there is the point of minimum code cost value as new search center point, repeat described diamond search, maybe using the shift value that has between the point of minimum code cost value and the current PU MV as current PU.
In addition, predicting unit is in steps A, step B and step C, and the step-size in search value adopted is respectively: S
t, S
hand S
r; Wherein, S
tfor being greater than S
hinteger, S
hfor being greater than S
rinteger, S
rfor being more than or equal to the integer of 1.
In addition, when predicting unit carries out estimation to down-sampling video image, the reference frame that estimation uses is primitive frame.
The invention provides a kind of can be applied to HEVC Video coding system method for video coding and corresponding device, by carrying out estimation in other down-sampled images of lower-resolution stages, MV estimation obtained is applied in the estimation of the video image of high-resolution rank.Use above-mentioned from lowest resolution to highest resolution estimation upwards step by step, carry out at highest resolution the last solution that initial search point that estimation uses more is tending towards close to MV, and be less than the search total degree needed for directly searching in highest resolution level at the search total degree that each resolution levels carries out carrying out required for estimation.Through test, adopt method of the present invention and device, the video encoding time of 50% can be saved on existing x265 coding framework.
Claims (10)
1. a method for video coding, is characterized in that, the method comprises:
Down-sampling is carried out to initial resolution video image to be encoded, generates the down-sampling video image of D different resolution level; D be more than or equal to 1 integer;
To the down-sampling video image of lowest resolution level, by the MV alternatively MV of the encoded adjacent PU of the MV of current PU and current PU, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
When D is the integer being greater than 1, to the down-sampling video image of middle stage resolution ratio, by the MV alternatively MV of the adjacent PU of position corresponding to current PU in the down-sampling video image of the MV of the encoded adjacent PU of the MV of current PU, current PU and a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
To initial resolution video image, by the MV of the adjacent block of current PU and the MV alternatively MV of PU that overlaps with image-region shared by current PU or partially overlap in the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU.
2. method according to claim 1, is characterized in that,
To the down-sampling video image of lowest resolution level, following steps are adopted to carry out estimation:
A: be initial search center point with initial search point, perform the search of following double trapezoid: the coding cost value corresponding to point to be searched calculating current search central point and be positioned on double trapezoid upper base and waist, to there is the point of minimum code cost value as new search center point, repeat the search of described double trapezoid, maybe the optimum search point that the point with minimum code cost value is searched for as double trapezoid is performed next step;
B: with double trapezoid search optimum search point be initial search center point, perform following hexagon search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on hexagon summit, to there is the point of minimum code cost value as new search center point, repeat described hexagon search, maybe the point with minimum code cost value is performed next step as the optimum search point of hexagon search;
C: be initial search center point with the optimum search of hexagon search point, perform following diamond search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit, to there is the point of minimum code cost value as new search center point, repeat described diamond search, maybe using the shift value that has between the point of minimum code cost value and the current PU MV as current PU.
3. method according to claim 2, is characterized in that,
In described steps A, step B and step C, search for the step value adopted and be respectively: S
t, S
hand S
r;
Wherein, S
tfor being greater than S
hinteger, S
hfor being greater than S
rinteger, S
rfor being more than or equal to the integer of 1.
4. method according to claim 2, is characterized in that,
In described steps A, current search central point is denoted as the initial point of coordinate system, then the point to be searched be positioned at described on double trapezoid upper base and waist comprises:
{4,0},{0,4},{-4,0},{0,-4},{2,3},{4,1},{4,-1},{4,2},{-2,3},{2,-3},{-2,-3},{-4,1},{-4,-1},{4,-2},{-4,2},{-4,-2}。
5. method according to claim 1, is characterized in that,
To down-sampling video image, sad value is carried out the selection of described initial search point as coding cost value;
To initial resolution video image, rate distortion costs value is carried out the selection of described initial search point as coding cost value.
6. method according to claim 1, is characterized in that,
When carrying out described estimation to down-sampling video image, the reference frame that estimation uses is primitive frame.
7. a video coding apparatus, is characterized in that, this device comprises: downsampling unit and predicting unit; Wherein:
Described downsampling unit, for carrying out down-sampling to initial resolution video image to be encoded, generates the down-sampling video image of D different resolution level; D be more than or equal to 1 integer;
Described predicting unit, for the MV alternatively MV of the adjacent PU by the MV of current PU and the encoded of current PU in the down-sampling video image of lowest resolution level, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
When D is the integer being greater than 1, described predicting unit, also for the MV alternatively MV by the adjacent PU of position corresponding to current PU in the MV of the MV of current PU, the encoded adjacent PU of current PU in the down-sampling video image of mid-resolution level and the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU;
Described predicting unit, also for the MV of the adjacent block by PU current in initial resolution video image and the MV alternatively MV of PU that overlaps with image-region shared by current PU or partially overlap in the down-sampling video image of a low stage resolution ratio, the MV choosing one of them coding cost value minimum carries out estimation as initial search point for this current PU.
8. device according to claim 7, is characterized in that,
Described predicting unit adopts following steps to carry out estimation to the down-sampling video image of lowest resolution level:
A: be initial search center point with initial search point, perform the search of following double trapezoid: the coding cost value corresponding to point to be searched calculating current search central point and be positioned on double trapezoid upper base and waist, to there is the point of minimum code cost value as new search center point, repeat the search of described double trapezoid, maybe the optimum search point that the point with minimum code cost value is searched for as double trapezoid is performed next step;
B: with double trapezoid search optimum search point be initial search center point, perform following hexagon search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on hexagon summit, to there is the point of minimum code cost value as new search center point, repeat described hexagon search, maybe the point with minimum code cost value is performed next step as the optimum search point of hexagon search;
C: be initial search center point with the optimum search of hexagon search point, perform following diamond search: calculate current search center point and be positioned at the coding cost value corresponding to point to be searched on rhombus summit, to there is the point of minimum code cost value as new search center point, repeat described diamond search, maybe using the shift value that has between the point of minimum code cost value and the current PU MV as current PU.
9. device according to claim 8, is characterized in that,
Described predicting unit is in described steps A, step B and step C, and the step-size in search value adopted is respectively: S
t, S
hand S
r;
Wherein, S
tfor being greater than S
hinteger, S
hfor being greater than S
rinteger, S
rfor being more than or equal to the integer of 1.
10. device according to claim 7, is characterized in that,
When described predicting unit carries out described estimation to down-sampling video image, the reference frame that estimation uses is primitive frame.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410852735.7A CN104581180A (en) | 2014-12-31 | 2014-12-31 | Video coding method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410852735.7A CN104581180A (en) | 2014-12-31 | 2014-12-31 | Video coding method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104581180A true CN104581180A (en) | 2015-04-29 |
Family
ID=53096237
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410852735.7A Pending CN104581180A (en) | 2014-12-31 | 2014-12-31 | Video coding method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104581180A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106454349A (en) * | 2016-10-18 | 2017-02-22 | 哈尔滨工业大学 | Motion estimation block matching method based on H.265 video coding |
CN107087171A (en) * | 2017-05-26 | 2017-08-22 | 中国科学技术大学 | HEVC Integer Pixel Motion Estimation Method and Device |
CN111290810A (en) * | 2020-01-19 | 2020-06-16 | 维沃移动通信有限公司 | Image display method and electronic equipment |
CN113259677A (en) * | 2021-06-28 | 2021-08-13 | 腾讯科技(深圳)有限公司 | Data processing method, data processing equipment and computer readable storage medium |
CN113316017A (en) * | 2020-02-27 | 2021-08-27 | 瑞昱半导体股份有限公司 | Method and electronic device for detecting resolution |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003036978A1 (en) * | 2001-10-26 | 2003-05-01 | Koninklijke Philips Electronics N.V. | Method and apparatus for spatial scalable compression |
EP1383337A2 (en) * | 2002-07-18 | 2004-01-21 | Samsung Electronics Co., Ltd. | Hierarchical motion vector estimation |
CN101720039A (en) * | 2009-09-08 | 2010-06-02 | 广东工业大学 | Diamond search-based multi-resolution quick motion estimation method |
CN101815218A (en) * | 2010-04-02 | 2010-08-25 | 北京工业大学 | Method for coding quick movement estimation video based on macro block characteristics |
EP2334080A1 (en) * | 2008-09-28 | 2011-06-15 | Huawei Technologies Co., Ltd. | Method, apparatus and system for rapid motion search applied in template matching |
-
2014
- 2014-12-31 CN CN201410852735.7A patent/CN104581180A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003036978A1 (en) * | 2001-10-26 | 2003-05-01 | Koninklijke Philips Electronics N.V. | Method and apparatus for spatial scalable compression |
EP1383337A2 (en) * | 2002-07-18 | 2004-01-21 | Samsung Electronics Co., Ltd. | Hierarchical motion vector estimation |
EP2334080A1 (en) * | 2008-09-28 | 2011-06-15 | Huawei Technologies Co., Ltd. | Method, apparatus and system for rapid motion search applied in template matching |
CN101720039A (en) * | 2009-09-08 | 2010-06-02 | 广东工业大学 | Diamond search-based multi-resolution quick motion estimation method |
CN101815218A (en) * | 2010-04-02 | 2010-08-25 | 北京工业大学 | Method for coding quick movement estimation video based on macro block characteristics |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106454349A (en) * | 2016-10-18 | 2017-02-22 | 哈尔滨工业大学 | Motion estimation block matching method based on H.265 video coding |
CN106454349B (en) * | 2016-10-18 | 2019-07-16 | 哈尔滨工业大学 | A Motion Estimation Block Matching Method Based on H.265 Video Coding |
CN107087171A (en) * | 2017-05-26 | 2017-08-22 | 中国科学技术大学 | HEVC Integer Pixel Motion Estimation Method and Device |
CN107087171B (en) * | 2017-05-26 | 2020-02-07 | 中国科学技术大学 | HEVC integer pixel motion estimation method and device |
CN111290810A (en) * | 2020-01-19 | 2020-06-16 | 维沃移动通信有限公司 | Image display method and electronic equipment |
CN113316017A (en) * | 2020-02-27 | 2021-08-27 | 瑞昱半导体股份有限公司 | Method and electronic device for detecting resolution |
CN113316017B (en) * | 2020-02-27 | 2023-08-22 | 瑞昱半导体股份有限公司 | Method for detecting resolution and electronic device |
CN113259677A (en) * | 2021-06-28 | 2021-08-13 | 腾讯科技(深圳)有限公司 | Data processing method, data processing equipment and computer readable storage medium |
CN113259677B (en) * | 2021-06-28 | 2021-09-10 | 腾讯科技(深圳)有限公司 | Data processing method, data processing equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI856066B (en) | Constraints on decoder-side motion vector refinement | |
CN110741640B (en) | Optical flow estimation for motion compensated prediction in video coding | |
TWI440364B (en) | Motion estimation using prediction guided decimated search | |
CN104769947B (en) | A Multi-hypothesis Motion Compensation Coding Method Based on P Frames | |
KR101364195B1 (en) | Method and Apparatus for Encoding and Decoding Motion Vector | |
TWI451762B (en) | Frame rate conversion using motion estimation and compensation | |
CN104581180A (en) | Video coding method and device | |
CN104602019A (en) | Video coding method and device | |
CN104488271B (en) | A P-frame-based multi-hypothesis motion compensation method | |
BR102012013152A2 (en) | video decoding apparatus, video encoding apparatus, video decoding method, video encoding method and storage medium | |
US9883200B2 (en) | Method of acquiring neighboring disparity vectors for multi-texture and multi-depth video | |
CN104243982A (en) | Video coding and decoding processing method and device | |
CN102752588A (en) | Video encoding and decoding method using space zoom prediction | |
JP2022514802A (en) | Resolution-adaptive video coding | |
CN113489987B (en) | HEVC sub-pixel motion estimation method and device | |
JP2020150313A (en) | Image decoding device, image decoding method and program | |
WO2020259507A8 (en) | Method for computing position of integer grid reference sample for block level boundary sample gradient computation in bi-predictive optical flow computation and bi-predictive correction | |
CN107360433A (en) | A kind of interframe prediction encoding method and device | |
KR102126511B1 (en) | Method and apparatus for image frame interpolation using supplemental information | |
JP6280679B2 (en) | Frame thinning device, frame interpolation device, video encoding device, video decoding device, and programs thereof | |
CN102170567A (en) | Motion vector search prediction-based adaptive motion estimation algorithm | |
CN103096083B (en) | A kind of moving image compensation method and device | |
KR20150090454A (en) | Method for searching bidirectional motion using multiple frame and image apparatus with the same technique | |
TW202015405A (en) | Method and apparatus of inter prediction for video coding | |
CN104333758B (en) | The method and relevant apparatus of prediction technique and the detection pixel point of depth map |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20150429 |