Commit 1ae93c1d authored by Debargha Mukherjee's avatar Debargha Mukherjee

Resolve undefined saitize warning in ransac

BUG=aomedia:514

Change-Id: I97e20524b091169635395098efe234a7fd846bd9
parent 1aa07fa1
......@@ -776,7 +776,7 @@ static int ransac(const int *matched_points, int npoints,
if (current_motion.num_inliers >= worst_kept_motion->num_inliers &&
current_motion.num_inliers > 1) {
int temp;
double fracinliers, pNoOutliers, mean_distance;
double fracinliers, pNoOutliers, mean_distance, dtemp;
mean_distance = sum_distance / ((double)current_motion.num_inliers);
current_motion.variance =
sum_distance_squared / ((double)current_motion.num_inliers - 1.0) -
......@@ -796,7 +796,10 @@ static int ransac(const int *matched_points, int npoints,
pNoOutliers = 1 - pow(fracinliers, minpts);
pNoOutliers = fmax(EPS, pNoOutliers);
pNoOutliers = fmin(1 - EPS, pNoOutliers);
temp = (int)(log(1.0 - PROBABILITY_REQUIRED) / log(pNoOutliers));
dtemp = log(1.0 - PROBABILITY_REQUIRED) / log(pNoOutliers);
temp = (dtemp > (double)INT32_MAX)
? INT32_MAX
: dtemp < (double)INT32_MIN ? INT32_MIN : (int)dtemp;
if (temp > 0 && temp < N) {
N = AOMMAX(temp, MIN_TRIALS);
......
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