Fix a motion vector out of range bug
This patch fixed a motion vector(MV) out of range bug, which was caused by not restoring the original values of the MV min/max thresholds after the sub8x8 full pixel motion search. It occurred rarely and only was seen while encoding a 4k clip for 200 frames. BUG=webm:1271 Change-Id: Ibc4e0de80846f297431923cef8a0c80fe8dcc6a5
This commit is contained in:
parent
57f49db81f
commit
2fb826c4d5
@ -1958,6 +1958,10 @@ static int64_t rd_pick_best_sub8x8_mode(
|
|||||||
MV mvp_full;
|
MV mvp_full;
|
||||||
int max_mv;
|
int max_mv;
|
||||||
int cost_list[5];
|
int cost_list[5];
|
||||||
|
int tmp_col_min = x->mv_col_min;
|
||||||
|
int tmp_col_max = x->mv_col_max;
|
||||||
|
int tmp_row_min = x->mv_row_min;
|
||||||
|
int tmp_row_max = x->mv_row_max;
|
||||||
|
|
||||||
/* Is the best so far sufficiently good that we cant justify doing
|
/* Is the best so far sufficiently good that we cant justify doing
|
||||||
* and new motion search. */
|
* and new motion search. */
|
||||||
@ -2005,6 +2009,11 @@ static int64_t rd_pick_best_sub8x8_mode(
|
|||||||
sf->mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL,
|
sf->mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL,
|
||||||
&bsi->ref_mv[0]->as_mv, new_mv, INT_MAX, 1);
|
&bsi->ref_mv[0]->as_mv, new_mv, INT_MAX, 1);
|
||||||
|
|
||||||
|
x->mv_col_min = tmp_col_min;
|
||||||
|
x->mv_col_max = tmp_col_max;
|
||||||
|
x->mv_row_min = tmp_row_min;
|
||||||
|
x->mv_row_max = tmp_row_max;
|
||||||
|
|
||||||
if (bestsme < UINT_MAX) {
|
if (bestsme < UINT_MAX) {
|
||||||
uint32_t distortion;
|
uint32_t distortion;
|
||||||
cpi->find_fractional_mv_step(
|
cpi->find_fractional_mv_step(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user