DSPLIB User Guide
DSPLIB_q15tofl_cn.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2 **+--------------------------------------------------------------------------+**
3 **| **** |**
4 **| **** |**
5 **| ******o*** |**
6 **| ********_///_**** |**
7 **| ***** /_//_/ **** |**
8 **| ** ** (__/ **** |**
9 **| ********* |**
10 **| **** |**
11 **| *** |**
12 **| |**
13 **| Copyright (c) 2016 Texas Instruments Incorporated |**
14 **| ALL RIGHTS RESERVED |**
15 **| |**
16 **| Permission to use, copy, modify, or distribute this software, |**
17 **| whether in part or in whole, for any purpose is forbidden without |**
18 **| a signed licensing agreement and NDA from Texas Instruments |**
19 **| Incorporated (TI). |**
20 **| |**
21 **| TI makes no representation or warranties with respect to the |**
22 **| performance of this computer program, and specifically disclaims |**
23 **| any responsibility for any damages, special or consequential, |**
24 **| connected with the use of this program. |**
25 **| |**
26 **+--------------------------------------------------------------------------+**
27 *******************************************************************************/
28 
29 #include "DSPLIB_q15tofl_priv.h"
30 
32  const DSPLIB_bufParams1D_t *bufParamsIn,
33  const DSPLIB_bufParams1D_t *bufParamsOut,
34  const DSPLIB_q15tofl_InitArgs *pKerInitArgs)
35 {
37  return status;
38 }
39 
40 template <typename dataTypeOut>
41 DSPLIB_STATUS DSPLIB_q15tofl_exec_cn(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
42 {
43  DSPLIB_DEBUGPRINTFN(0, "%s\n", "Entering function");
44 
46 
47  DSPLIB_q15tofl_PrivArgs *pKerPrivArgs = (DSPLIB_q15tofl_PrivArgs *) handle;
48  uint32_t blockSize = pKerPrivArgs->blockSize;
49  int16_t *pInLocal = (int16_t *) pIn;
50  dataTypeOut *pOutLocal = (dataTypeOut *) pOut;
51 
52  DSPLIB_DEBUGPRINTFN(0, "pInLocal: %p pOutLocal: %p blockSize: %d\n", pInLocal, pOutLocal, blockSize);
53 
54  int16_t a;
55  dataTypeOut out;
56 
57  for (int32_t counter = 0; counter < (int32_t) blockSize; counter++) {
58  a = *pInLocal++;
59  out = (dataTypeOut) a / 32768.0;
60  *pOutLocal++ = out;
61  }
62 
63  DSPLIB_DEBUGPRINTFN(0, "Exiting function with return status: %d\n", status);
64 
65  return (status);
66 }
67 
68 template DSPLIB_STATUS
69 DSPLIB_q15tofl_exec_cn<float>(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
70 template DSPLIB_STATUS
71 DSPLIB_q15tofl_exec_cn<double>(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut);
template DSPLIB_STATUS DSPLIB_q15tofl_exec_cn< float >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
template DSPLIB_STATUS DSPLIB_q15tofl_exec_cn< double >(DSPLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut)
DSPLIB_STATUS DSPLIB_q15tofl_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....
DSPLIB_STATUS DSPLIB_q15tofl_init_cn(DSPLIB_kernelHandle handle, const DSPLIB_bufParams1D_t *bufParamsIn, const DSPLIB_bufParams1D_t *bufParamsOut, const DSPLIB_q15tofl_InitArgs *pKerInitArgs)
This function is the initialization function for the natural C implementation of the kernel....
Header file for kernel's internal use. For the kernel's interface, please see DSPLIB_q15tofl.
#define DSPLIB_DEBUGPRINTFN(N, fmt,...)
Definition: DSPLIB_types.h:83
DSPLIB_STATUS_NAME
The enumeration of all status codes.
Definition: DSPLIB_types.h:151
void * DSPLIB_kernelHandle
Handle type for DSPLIB operations.
Definition: DSPLIB_types.h:172
@ DSPLIB_SUCCESS
Definition: DSPLIB_types.h:152
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_q15tofl_init that will be retrieved and used by DSP...