From 5546f4d77f10e7a6458ff2858ec53be270eb5132 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 1 Nov 2013 14:50:41 +0400 Subject: [PATCH] consistency SSE2 and plain versions of convertMaps and remap --- modules/imgproc/src/imgwarp.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index 3bbfe69..39cc043 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -2986,8 +2986,8 @@ public: int sx = cvRound(sX[x1]*INTER_TAB_SIZE); int sy = cvRound(sY[x1]*INTER_TAB_SIZE); int v = (sy & (INTER_TAB_SIZE-1))*INTER_TAB_SIZE + (sx & (INTER_TAB_SIZE-1)); - XY[x1*2] = (short)(sx >> INTER_BITS); - XY[x1*2+1] = (short)(sy >> INTER_BITS); + XY[x1*2] = saturate_cast(sx >> INTER_BITS); + XY[x1*2+1] = saturate_cast(sy >> INTER_BITS); A[x1] = (ushort)v; } } @@ -3000,8 +3000,8 @@ public: int sx = cvRound(sXY[x1*2]*INTER_TAB_SIZE); int sy = cvRound(sXY[x1*2+1]*INTER_TAB_SIZE); int v = (sy & (INTER_TAB_SIZE-1))*INTER_TAB_SIZE + (sx & (INTER_TAB_SIZE-1)); - XY[x1*2] = (short)(sx >> INTER_BITS); - XY[x1*2+1] = (short)(sy >> INTER_BITS); + XY[x1*2] = saturate_cast(sx >> INTER_BITS); + XY[x1*2+1] = saturate_cast(sy >> INTER_BITS); A[x1] = (ushort)v; } } @@ -3215,8 +3215,8 @@ void cv::convertMaps( InputArray _map1, InputArray _map2, { int ix = saturate_cast(src1f[x]*INTER_TAB_SIZE); int iy = saturate_cast(src2f[x]*INTER_TAB_SIZE); - dst1[x*2] = (short)(ix >> INTER_BITS); - dst1[x*2+1] = (short)(iy >> INTER_BITS); + dst1[x*2] = saturate_cast(ix >> INTER_BITS); + dst1[x*2+1] = saturate_cast(iy >> INTER_BITS); dst2[x] = (ushort)((iy & (INTER_TAB_SIZE-1))*INTER_TAB_SIZE + (ix & (INTER_TAB_SIZE-1))); } } @@ -3233,8 +3233,8 @@ void cv::convertMaps( InputArray _map1, InputArray _map2, { int ix = saturate_cast(src1f[x*2]*INTER_TAB_SIZE); int iy = saturate_cast(src1f[x*2+1]*INTER_TAB_SIZE); - dst1[x*2] = (short)(ix >> INTER_BITS); - dst1[x*2+1] = (short)(iy >> INTER_BITS); + dst1[x*2] = saturate_cast(ix >> INTER_BITS); + dst1[x*2+1] = saturate_cast(iy >> INTER_BITS); dst2[x] = (ushort)((iy & (INTER_TAB_SIZE-1))*INTER_TAB_SIZE + (ix & (INTER_TAB_SIZE-1))); } } -- 2.7.4