Commit 65bd6da0 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Minor change in shifting for warp affine int

Change-Id: I5546263d3b3ce4c1b9b70175bc4e6a301b1c8463
parent 62e54cd3
......@@ -1424,10 +1424,10 @@ static int find_affine_int(const int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
Det = (int64_t)A[0][0] * A[1][1] - (int64_t)A[0][1] * A[0][1];
if (Det == 0) return 1;
iDet = resolve_divisor_64(labs(Det), &shift) * (Det < 0 ? -1 : 1);
if (shift > WARPEDMODEL_PREC_BITS) {
shift -= WARPEDMODEL_PREC_BITS;
} else {
iDet <<= WARPEDMODEL_PREC_BITS;
shift -= WARPEDMODEL_PREC_BITS;
if (shift < 0) {
iDet <<= (-shift);
shift = 0;
}
v = Px[0] * iDet;
......@@ -1561,10 +1561,10 @@ static int find_affine_int(const int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
int16_t shift;
int64_t iDet;
iDet = resolve_divisor_64(labs(Det), &shift) * (Det < 0 ? -1 : 1);
if (shift > WARPEDMODEL_PREC_BITS) {
shift -= WARPEDMODEL_PREC_BITS;
} else {
iDet <<= WARPEDMODEL_PREC_BITS;
shift -= WARPEDMODEL_PREC_BITS;
if (shift < 0) {
iDet <<= (-shift);
shift = 0;
}
v = Px[0] * iDet;
......
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