Functions

Bilinear Interpolation
[Interpolation Functions]

Functions

static INLINE void arm_bilinear_interp_f32 (const arm_bilinear_interp_instance_f32 *S, float32_t *X, float32_t *Y, float32_t *pOut, uint32_t blockSize)
static INLINE void arm_bilinear_interp_q31 (arm_bilinear_interp_instance_q31 *S, q31_t *X, q31_t *Y, q31_t *pOut, uint32_t blockSize)
static INLINE void arm_bilinear_interp_q15 (arm_bilinear_interp_instance_q15 *S, q31_t *X, q31_t *Y, q15_t *pOut, uint32_t blockSize)
static INLINE void arm_bilinear_interp_q7 (arm_bilinear_interp_instance_q7 *S, q31_t *X, q31_t *Y, q7_t *pOut, uint32_t blockSize)

Detailed Description

Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. The underlying function f(x, y) is sampled on a regular grid and the interpolation process determines values between the grid points. Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. Bilinear interpolation is often used in image processing to rescale images. The Cortex-R4 DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.

Algorithm

The instance structure used by the bilinear interpolation functions describes a two dimensional data table. For floating-point, the instance structure is defined as:
  
   typedef struct  
   {  
     uint16_t numRows;  
     uint16_t numCols;  
     float32_t *pData;  
 } arm_bilinear_interp_instance_f32;  
 
where numRows specifies the number of rows in the table; numCols specifies the number of columns in the table; and pData points to an array of size numRows*numCols values. The data table pTable is organized in row order and the supplied data values fall on integer indexes. That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers.
Let (x, y) specify the desired interpolation point. Then define:
  
     XF = floor(x)  
     YF = floor(y)  
 
The interpolated output point is computed as:
  
  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))  
           + f(XF+1, YF) * (x-XF)*(1-(y-YF))  
           + f(XF, YF+1) * (1-(x-XF))*(y-YF)  
           + f(XF+1, YF+1) * (x-XF)*(y-YF)  
 
Note that the coordinates (x, y) contain integer and fractional components. The integer components specify which portion of the table to use while the fractional components control the interpolation processor.
if (x,y) are outside of the table boundary, floating-point bilinear interpolation returns zero output and for fixed point Q31, Q15 and Q7 user need to take care of positive values of index in x-direction and y-direction

Function Documentation

static INLINE void arm_bilinear_interp_f32 ( const arm_bilinear_interp_instance_f32 S,
float32_t *  X,
float32_t *  Y,
float32_t *  pOut,
uint32_t  blockSize 
) [static]

Floating-point bilinear interpolation.

Parameters:
[in,out]*Spoints to an instance of the interpolation structure.
[in]*Xinterpolation coordinate buffer.
[in]*Yinterpolation coordinate buffer.
[out]*pOutpoints to output buffer.
[in]blockSizepoints number of samples.
Returns:
none.

Definition at line 6653 of file arm_math.h.

static INLINE void arm_bilinear_interp_q31 ( arm_bilinear_interp_instance_q31 S,
q31_t *  X,
q31_t *  Y,
q31_t *  pOut,
uint32_t  blockSize 
) [static]

Q31 bilinear interpolation.

Parameters:
[in,out]*Spoints to an instance of the interpolation structure.
[in]*Xinterpolation coordinate buffer in 12.20 format.
[in]*Yinterpolation coordinate buffer in 12.20 format.
[out]*pOutpoints to output buffer.
[in]blockSizepoints number of samples.
Returns:
none.

Definition at line 6737 of file arm_math.h.

static INLINE void arm_bilinear_interp_q15 ( arm_bilinear_interp_instance_q15 S,
q31_t *  X,
q31_t *  Y,
q15_t *  pOut,
uint32_t  blockSize 
) [static]

Q15 bilinear interpolation.

Parameters:
[in,out]*Spoints to an instance of the interpolation structure.
[in]*Xinterpolation coordinate buffer in 12.20 format.
[in]*Yinterpolation coordinate buffer in 12.20 format.
[out]*pOutpoints to output buffer.
[in]blockSizepoints number of samples.
Returns:
none.

Definition at line 6844 of file arm_math.h.

static INLINE void arm_bilinear_interp_q7 ( arm_bilinear_interp_instance_q7 S,
q31_t *  X,
q31_t *  Y,
q7_t *  pOut,
uint32_t  blockSize 
) [static]

Q7 bilinear interpolation.

Parameters:
[in,out]*Spoints to an instance of the interpolation structure.
[in]*Xinterpolation coordinate buffer in 12.20 format.
[in]*Yinterpolation coordinate buffer in 12.20 format.
[out]*pOutpoints to output buffer.
[in]blockSizepoints number of samples.
Returns:
none.

Definition at line 6955 of file arm_math.h.

 All Data Structures Files Functions Variables Enumerations Enumerator Defines