VXLIB User Guide
VXLIB_thresholdBinary_priv.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  ******************************************************************************/
33 
34 #ifndef VXLIB_THRESHOLDBINARY_IXX_OXX_PRIV_H_
35 #define VXLIB_THRESHOLDBINARY_IXX_OXX_PRIV_H_
36 
37 #include "../common/VXLIB_utility.h"
38 #include "VXLIB_thresholdBinary.h"
39 #include "VXLIB_types.h"
40 
52 #define VXLIB_THRESHOLDBINARY_IXX_OXX_PBLOCK_SIZE (VXLIB_SE_PARAM_SIZE + VXLIB_SA_PARAM_SIZE)
53 
58 #define VXLIB_THRESHOLDBINARY_I8U_O8U ((dTypeIn == VXLIB_UINT8) && (dTypeOut == VXLIB_UINT8))
59 #define VXLIB_THRESHOLDBINARY_I8S_O8S ((dTypeIn == VXLIB_INT8) && (dTypeOut == VXLIB_INT8))
60 #define VXLIB_THRESHOLDBINARY_I16U_O16U ((dTypeIn == VXLIB_UINT16) && (dTypeOut == VXLIB_UINT16))
61 #define VXLIB_THRESHOLDBINARY_I16S_O16S ((dTypeIn == VXLIB_INT16) && (dTypeOut == VXLIB_INT16))
62 
67 #define VXLIB_THRESHOLDBINARY_TYPENAME_I8U_O8U uint8_t, uint8_t
68 #define VXLIB_THRESHOLDBINARY_TYPENAME_I8S_O8S int8_t, int8_t
69 #define VXLIB_THRESHOLDBINARY_TYPENAME_I16U_O16U uint16_t, uint16_t
70 #define VXLIB_THRESHOLDBINARY_TYPENAME_I16S_O16S int16_t, int16_t
71 
76 #define VXLIB_THRESHOLDBINARY_DTYPE_I8U_O8U VXLIB_UINT8, VXLIB_UINT8
77 #define VXLIB_THRESHOLDBINARY_DTYPE_I8S_O8S VXLIB_INT8, VXLIB_INT8
78 #define VXLIB_THRESHOLDBINARY_DTYPE_I16U_O16U VXLIB_UINT16, VXLIB_UINT16
79 #define VXLIB_THRESHOLDBINARY_DTYPE_I16S_O16S VXLIB_INT16, VXLIB_INT16
80 
87  void *restrict pIn,
88  void *restrict pOut,
89  void *restrict pThresholdVal,
90  void *restrict pTrueVal,
91  void *restrict pFalseVal);
92 
121 template <uint32_t dTypeIn, uint32_t dTypeOut>
123  const VXLIB_bufParams2D_t * bufParamsIn,
124  const VXLIB_bufParams2D_t * bufParamsOut,
125  const VXLIB_thresholdBinary_InitArgs *pKerInitArgs);
126 
148 template <typename dTypeIn, typename dTypeOut>
150  void *restrict pIn,
151  void *restrict pOut,
152  void *restrict pThresholdVal,
153  void *restrict pTrueVal,
154  void *restrict pFalseVal);
155 
174 template <typename dTypeIn, typename dTypeOut>
176  void *restrict pIn,
177  void *restrict pOut,
178  void *restrict pThresholdVal,
179  void *restrict pTrueVal,
180  void *restrict pFalseVal);
181 
186 typedef struct {
189 
194 
196  size_t width;
198  size_t height;
199 
202 
205 
207  size_t numBlocks;
208 
212 
233  VXLIB_bufParams2D_t *bufParamsIn,
234  VXLIB_bufParams2D_t *bufParamsOut);
235 
236 #endif /* VXLIB_THRESHOLDBINARY_IXX_IXX_OXX_PRIV_H_ */
237 
238 /* ======================================================================== */
239 /* End of file: VXLIB_thresholdBinary_priv.h */
240 /* ======================================================================== */
VXLIB_STATUS VXLIB_thresholdBinary_init_ci(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_thresholdBinary_InitArgs *pKerInitArgs)
This function is the initialization function for the C7x implementation of the kernel....
VXLIB_STATUS(* pFxnVXLIB_thresholdBinary_exec)(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
This is a function pointer type that conforms to the declaration of VXLIB_thresholdBinary_exec_ci and...
VXLIB_STATUS VXLIB_thresholdBinary_exec_ci(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
This function is the main execution function for the C7x implementation of the kernel....
VXLIB_STATUS VXLIB_thresholdBinary_init_cn(VXLIB_kernelHandle handle, VXLIB_bufParams2D_t *bufParamsIn, VXLIB_bufParams2D_t *bufParamsOut)
This function is the initialization function for the natural C implementation of the kernel....
#define VXLIB_THRESHOLDBINARY_IXX_OXX_PBLOCK_SIZE
Macro to define the size of bufPblock array of VXLIB_thresholdBinary_PrivArgs structure.
VXLIB_STATUS VXLIB_thresholdBinary_exec_cn(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pThresholdVal, void *restrict pTrueVal, void *restrict pFalseVal)
This function is the main execution function for the natural C implementation of the kernel....
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
Definition: VXLIB_types.h:247
VXLIB_STATUS_NAME VXLIB_STATUS
Return value for VXLIB functions.
Definition: VXLIB_types.h:245
VXLIB_STATUS_NAME
The enumeration of all status codes.
Definition: VXLIB_types.h:220
A structure for a 2 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
Structure that is reserved for internal use by the kernel.
size_t numBlocks
Number of blocks to be processed after simidfication.
VXLIB_thresholdBinary_InitArgs pKerInitArgs
Initargs of the kernel.
size_t strideInElements
Stride of input in elements.
pFxnVXLIB_thresholdBinary_exec execute
Function pointer to point to the right execution variant between VXLIB_thresholdBinary_exec_cn and VX...
size_t strideOutElements
Stride of output in elements.