qAutoStereo_20190430/qas/src/main/cpp/btk/b_ImageEm/Functions.c
/** downscale by factor 2 (dstPtrA and srcPtrA may be identical) */
downscale by factor 2 (dstPtrA and srcPtrA may be identical)
downscale by factor 2 ( dstPtrA and srcPtrA may be identical )
void bim_downscaleBy2( uint8*       dstPtrA, 
					   const uint8* srcPtrA,
					   uint32 srcWidthA,
					   uint32 effWidthA,
					   uint32 effHeightA )
{
	uint32 wsL = srcWidthA;
	uint32 w0L = effWidthA;
	uint32 h0L = effHeightA;
	uint32 w1L = w0L >> 1;
	uint32 h1L = h0L >> 1;
	const uint8* srcL = srcPtrA;
	uint8* dstL = dstPtrA;
	uint32 iL, jL;
	for( jL = 0; jL < h1L; jL++ )
	{
		for( iL = 0; iL < w1L; iL++ )
		{
			*dstL = ( ( uint32 )srcL[ 0 ] + srcL[ 1 ] + srcL[ wsL ] + srcL[ wsL + 1 ] + 2 ) >> 2;
			dstL++;
			srcL += 2;
		}
		srcL += ( wsL - w1L ) * 2;
	}
}
void bim_downscaleBy2 ( uint8 * dstPtrA , const uint8 * srcPtrA , uint32 srcWidthA , uint32 effWidthA , uint32 effHeightA ) { uint32 wsL = srcWidthA ; uint32 w0L = effWidthA ; uint32 h0L = effHeightA ; uint32 w1L = w0L >> 1 ; uint32 h1L = h0L >> 1 ; const uint8 * srcL = srcPtrA ; uint8 * dstL = dstPtrA ; uint32 iL , jL ; for ( jL = 0 ; jL < h1L ; jL ++ ) { for ( iL = 0 ; iL < w1L ; iL ++ ) { * dstL = ( ( uint32 ) srcL [ 0 ] + srcL [ 1 ] + srcL [ wsL ] + srcL [ wsL + 1 ] + 2 ) >> 2 ; dstL ++ ; srcL += 2 ; } srcL += ( wsL - w1L ) * 2 ; } }
downscale by factor 2 (dstPtrA and srcPtrA may be identical)
downscale by factor 2 ( dstPtrA and srcPtrA may be identical )