Embedded/common/src/b_BitFeatureEm/LocalScanner.c
/** downscales original image by factor 2 */
downscales original image by factor 2
downscales original image by factor 2
void bbf_LocalScanner_downscale0( struct bbs_Context* cpA, struct bbf_LocalScanner* ptrA )
{
	int32 w0L = ptrA->origWidthE;
	int32 h0L = ptrA->origHeightE;
	int32 w1L = ( w0L - ptrA->xOffE ) >> 1;
	int32 h1L = ( h0L - ptrA->yOffE ) >> 1;
	const uint8* iArrL = ptrA->origImagePtrE + ptrA->xOffE + ptrA->yOffE * w0L;
		  uint8* oArrL = ptrA->workImageBufferE.arrPtrE;
	int32 iL, jL;
	int32 kL = 0;
	bbs_UInt8Arr_size( cpA, &ptrA->workImageBufferE, w1L * h1L );
	ptrA->workImagePtrE = ptrA->workImageBufferE.arrPtrE;
	ptrA->workWidthE = w1L;
	ptrA->workHeightE = h1L;
	for( jL = 0; jL < h1L; jL++ )
	{
		for( iL = 0; iL < w1L; iL++ )
		{
			int32 idxL = jL * 2 * w0L + iL * 2;
			oArrL[ kL++ ] = ( ( uint32 )iArrL[ idxL           ] + 
										iArrL[ idxL + 1       ] + 
										iArrL[ idxL + w0L     ] + 
										iArrL[ idxL + w0L + 1 ] + 2 ) >> 2;
		}
	}
}
void bbf_LocalScanner_downscale0 ( struct bbs_Context * cpA , struct bbf_LocalScanner * ptrA ) { int32 w0L = ptrA -> origWidthE ; int32 h0L = ptrA -> origHeightE ; int32 w1L = ( w0L - ptrA -> xOffE ) >> 1 ; int32 h1L = ( h0L - ptrA -> yOffE ) >> 1 ; const uint8 * iArrL = ptrA -> origImagePtrE + ptrA -> xOffE + ptrA -> yOffE * w0L ; uint8 * oArrL = ptrA -> workImageBufferE . arrPtrE ; int32 iL , jL ; int32 kL = 0 ; bbs_UInt8Arr_size ( cpA , & ptrA -> workImageBufferE , w1L * h1L ) ; ptrA -> workImagePtrE = ptrA -> workImageBufferE . arrPtrE ; ptrA -> workWidthE = w1L ; ptrA -> workHeightE = h1L ; for ( jL = 0 ; jL < h1L ; jL ++ ) { for ( iL = 0 ; iL < w1L ; iL ++ ) { int32 idxL = jL * 2 * w0L + iL * 2 ; oArrL [ kL ++ ] = ( ( uint32 ) iArrL [ idxL ] + iArrL [ idxL + 1 ] + iArrL [ idxL + w0L ] + iArrL [ idxL + w0L + 1 ] + 2 ) >> 2 ; } } }
downscales original image by factor 2
downscales original image by factor 2