Commit f3e1ead3 authored by Yue Chen's avatar Yue Chen
Browse files

Fix test failures and warnings of WARPED_MOTION

Properly set number of projection samples for seg skip blocks
at the encoder side to clear unit test failure when both seg feature
and warped_motion is on.
Clear 'implicit conversions' warnings

Change-Id: I29e40ffae75880dae2584dbc8772c81321f6d69e
parent bf6ad900
...@@ -708,7 +708,8 @@ static INLINE int16_t saturate_int16(int32_t v) { ...@@ -708,7 +708,8 @@ static INLINE int16_t saturate_int16(int32_t v) {
// at precision of DIV_LUT_PREC_BITS along with the shift. // at precision of DIV_LUT_PREC_BITS along with the shift.
static int16_t resolve_divisor_64(uint64_t D, int16_t *shift) { static int16_t resolve_divisor_64(uint64_t D, int16_t *shift) {
int64_t e, f; int64_t e, f;
*shift = (D >> 32) ? get_msb(D >> 32) + 32 : get_msb(D); *shift = (int16_t)((D >> 32) ? get_msb((unsigned int)(D >> 32)) + 32
: get_msb((unsigned int)D));
// e is obtained from D after resetting the most significant 1 bit. // e is obtained from D after resetting the most significant 1 bit.
e = D - ((uint64_t)1 << *shift); e = D - ((uint64_t)1 << *shift);
// Get the most significant DIV_LUT_BITS (8) bits of e into f // Get the most significant DIV_LUT_BITS (8) bits of e into f
...@@ -1554,18 +1555,18 @@ static int find_affine_int(int np, int *pts1, int *pts2, BLOCK_SIZE bsize, ...@@ -1554,18 +1555,18 @@ static int find_affine_int(int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
int64_t v; int64_t v;
v = Px[0] * (int64_t)iDet; v = Px[0] * (int64_t)iDet;
wm->wmmat[2] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift); wm->wmmat[2] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
v = Px[1] * (int64_t)iDet; v = Px[1] * (int64_t)iDet;
wm->wmmat[3] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift); wm->wmmat[3] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
v = (dux << WARPEDMODEL_PREC_BITS) - sux * wm->wmmat[2] - suy * wm->wmmat[3]; v = (dux << WARPEDMODEL_PREC_BITS) - sux * wm->wmmat[2] - suy * wm->wmmat[3];
wm->wmmat[0] = ROUND_POWER_OF_TWO_SIGNED(v, 3); wm->wmmat[0] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED(v, 3));
v = Py[0] * (int64_t)iDet; v = Py[0] * (int64_t)iDet;
wm->wmmat[4] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift); wm->wmmat[4] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
v = Py[1] * (int64_t)iDet; v = Py[1] * (int64_t)iDet;
wm->wmmat[5] = ROUND_POWER_OF_TWO_SIGNED_64(v, shift); wm->wmmat[5] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED_64(v, shift));
v = (duy << WARPEDMODEL_PREC_BITS) - sux * wm->wmmat[4] - suy * wm->wmmat[5]; v = (duy << WARPEDMODEL_PREC_BITS) - sux * wm->wmmat[4] - suy * wm->wmmat[5];
wm->wmmat[1] = ROUND_POWER_OF_TWO_SIGNED(v, 3); wm->wmmat[1] = (int32_t)(ROUND_POWER_OF_TWO_SIGNED(v, 3));
wm->wmmat[6] = wm->wmmat[7] = 0; wm->wmmat[6] = wm->wmmat[7] = 0;
......
...@@ -11517,6 +11517,12 @@ void av1_rd_pick_inter_mode_sb_seg_skip(const AV1_COMP *cpi, ...@@ -11517,6 +11517,12 @@ void av1_rd_pick_inter_mode_sb_seg_skip(const AV1_COMP *cpi,
#if CONFIG_MOTION_VAR #if CONFIG_MOTION_VAR
av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col); av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col);
#endif #endif
#if CONFIG_WARPED_MOTION
if (is_motion_variation_allowed_bsize(bsize) && !has_second_ref(mbmi)) {
int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
mbmi->num_proj_ref[0] = findSamples(cm, xd, mi_row, mi_col, pts, pts_inref);
}
#endif
if (cm->interp_filter != BILINEAR) { if (cm->interp_filter != BILINEAR) {
best_filter = EIGHTTAP_REGULAR; best_filter = EIGHTTAP_REGULAR;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment