39 template <
typename dataTypeIn>
47 uint32_t blockSize = pKerPrivArgs->
blockSize;
49 dataTypeIn *pInLocal = (dataTypeIn *) pIn;
50 int16_t *pOutLocal = (int16_t *) pOut;
52 DSPLIB_DEBUGPRINTFN(0,
"pInLocal: %p pOutLocal: %p blockSize: %d\n", pInLocal, pOutLocal, blockSize);
55 dataTypeIn mulFactor = 32768.00;
59 for (int32_t counter = 0; counter < (int32_t) blockSize; counter++) {
61 dataTypeIn mulVal = a * mulFactor;
63 int32_t intPart = (int32_t) mulVal;
64 dataTypeIn fracPart = mulVal - intPart;
66 if ((intPart % 2 == 0) && (abs(fracPart) == 0.5)) {
70 aInt = (int32_t) (mulVal - 0.5f);
73 aInt = (int32_t) (mulVal + 0.5f);
DSPLIB_STATUS DSPLIB_fltoq15_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
This function is the main execution function for the natural C implementation of the kernel....
template DSPLIB_STATUS DSPLIB_fltoq15_exec_cn< float >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
DSPLIB_STATUS DSPLIB_fltoq15_init_cn(DSPLIB_kernelHandle handle, DSPLIB_bufParams1D_t *bufParamsIn, DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_fltoq15_InitArgs *pKerInitArgs)
This function is the initialization function for the natural C implementation of the kernel....
template DSPLIB_STATUS DSPLIB_fltoq15_exec_cn< double >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_fltoq15.
#define DSPLIB_DEBUGPRINTFN(N, fmt,...)
DSPLIB_STATUS_NAME
The enumeration of all status codes.
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
A structure for a 1 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
int32_t blockSize
Size of input buffer for different batches DSPLIB_fltoq15_init that will be retrieved and used by DSP...