55 template <u
int32_t dTypeIn, u
int32_t dTypeOut>
63 printf(
"Enter VXLIB_tableLookup_generic_init_ci\n");
69 __SE_TEMPLATE_v1 se0Params = __gen_SE_TEMPLATE_v1();
70 __SA_TEMPLATE_v1 sa0Params = __gen_SA_TEMPLATE_v1();
71 size_t width = pKerPrivArgs->
width;
72 size_t height = pKerPrivArgs->
height;
75 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
78 VXLIB_SE0SA0_init<dTypeIn, dTypeIn>(&se0Params, &sa0Params, bufParamsIn, bufParamsOut);
79 sa0Params.VECLEN = __SA_VECLEN_1ELEM;
80 se0Params.VECLEN = __SE_VECLEN_1ELEM;
89 printf(
"Exit VXLIB_tableLookup_generic_init_ci\n");
130 template <
typename dataType>
134 printf(
"Enter VXLIB_tableLookup_generic_set_ci\n");
139 printf(
"Exit VXLIB_tableLookup_generic_set_ci\n");
153 template <
typename vecType,
typename dataType>
static inline dataType
getVal(vecType inpVec, dataType idx)
158 template <
typename dataType>
167 printf(
"Enter VXLIB_tableLookup_generic_exec_ci\n");
174 size_t width = pKerPrivArgs->
width;
175 size_t height = pKerPrivArgs->
height;
178 typedef typename c7x::make_full_vector<dataType>::type vec;
181 uint8_t *pBlock = pKerPrivArgs->
bufPblock;
183 __SE_TEMPLATE_v1 se0Params = *(__SE_TEMPLATE_v1 *) ((uint8_t *) pBlock +
SE1_PARAM_OFFSET);
184 __SA_TEMPLATE_v1 sa0Params = *(__SA_TEMPLATE_v1 *) ((uint8_t *) pBlock +
SA0_PARAM_OFFSET);
186 dataType *restrict pInLocal = (dataType *) pIn;
187 dataType *restrict pOutLocal = (dataType *) pOut;
188 dataType *restrict lutLocal = (dataType *) pLut;
190 printf(
"In VXLIB_tableLookup_generic_exec_ci, width: %d, height: %d\n", width, height);
193 __SE0_OPEN(pInLocal, se0Params);
194 __SA0_OPEN(sa0Params);
196 int32_t remElem = (height * width) - (numBlocksLut * 8);
197 for (int32_t j = 0; j < numBlocksLut; j++) {
198 vec srcVec = c7x::strm_eng<0, vec>::get_adv();
199 uint64_t srcIndex =
getVal(srcVec, 0) + offset;
200 dataType lutValue = lutLocal[srcIndex];
201 dataType *addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
204 srcVec = c7x::strm_eng<0, vec>::get_adv();
205 srcIndex =
getVal(srcVec, 0) + offset;
206 lutValue = lutLocal[srcIndex];
207 addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
210 srcVec = c7x::strm_eng<0, vec>::get_adv();
211 srcIndex =
getVal(srcVec, 0) + offset;
212 lutValue = lutLocal[srcIndex];
213 addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
216 srcVec = c7x::strm_eng<0, vec>::get_adv();
217 srcIndex =
getVal(srcVec, 0) + offset;
218 lutValue = lutLocal[srcIndex];
219 addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
222 srcVec = c7x::strm_eng<0, vec>::get_adv();
223 srcIndex =
getVal(srcVec, 0) + offset;
224 lutValue = lutLocal[srcIndex];
225 addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
228 srcVec = c7x::strm_eng<0, vec>::get_adv();
229 srcIndex =
getVal(srcVec, 0) + offset;
230 lutValue = lutLocal[srcIndex];
231 addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
234 srcVec = c7x::strm_eng<0, vec>::get_adv();
235 srcIndex =
getVal(srcVec, 0) + offset;
236 lutValue = lutLocal[srcIndex];
237 addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
240 srcVec = c7x::strm_eng<0, vec>::get_adv();
241 srcIndex =
getVal(srcVec, 0) + offset;
242 lutValue = lutLocal[srcIndex];
243 addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
246 for (int32_t j = 0; j < remElem; j++) {
248 vec srcVec = c7x::strm_eng<0, vec>::get_adv();
249 uint64_t srcIndex =
getVal(srcVec, 0) + offset;
250 dataType lutValue = lutLocal[srcIndex];
251 dataType *addr = c7x::strm_agen<0, dataType>::get_adv(pOutLocal);
258 printf(
"Exit VXLIB_tableLookup_generic_exec_ci \n");
265 void *restrict pLut);
269 void *restrict pLut);
273 void *restrict pLut);
277 void *restrict pLut);
template VXLIB_STATUS VXLIB_tableLookup_generic_set_ci< uint8_t >(VXLIB_kernelHandle handle, void *restrict pLut)
template VXLIB_STATUS VXLIB_tableLookup_generic_exec_ci< uint16_t >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pLut)
template VXLIB_STATUS VXLIB_tableLookup_generic_init_ci< VXLIB_TABLELOOKUP_DTYPE_I8U_O8U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_bufParams1D_t *bufParamsLut, const VXLIB_tableLookup_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_tableLookup_generic_exec_ci< int16_t >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pLut)
static dataType getVal(vecType inpVec, dataType idx)
VXLIB_STATUS VXLIB_tableLookup_generic_set_ci(VXLIB_kernelHandle handle, void *restrict pLut)
template VXLIB_STATUS VXLIB_tableLookup_generic_init_ci< VXLIB_TABLELOOKUP_DTYPE_I16S_O16S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_bufParams1D_t *bufParamsLut, const VXLIB_tableLookup_InitArgs *pKerInitArgs)
VXLIB_STATUS VXLIB_tableLookup_generic_exec_ci(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pLut)
VXLIB_STATUS VXLIB_tableLookup_generic_init_ci(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_bufParams1D_t *bufParamsLut, const VXLIB_tableLookup_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_tableLookup_generic_init_ci< VXLIB_TABLELOOKUP_DTYPE_I8S_O8S >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_bufParams1D_t *bufParamsLut, const VXLIB_tableLookup_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_tableLookup_generic_init_ci< VXLIB_TABLELOOKUP_DTYPE_I16U_O16U >(VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_bufParams1D_t *bufParamsLut, const VXLIB_tableLookup_InitArgs *pKerInitArgs)
template VXLIB_STATUS VXLIB_tableLookup_generic_exec_ci< uint8_t >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pLut)
template VXLIB_STATUS VXLIB_tableLookup_generic_set_ci< int8_t >(VXLIB_kernelHandle handle, void *restrict pLut)
template VXLIB_STATUS VXLIB_tableLookup_generic_exec_ci< int8_t >(VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pOut, void *restrict pLut)
template VXLIB_STATUS VXLIB_tableLookup_generic_set_ci< uint16_t >(VXLIB_kernelHandle handle, void *restrict pLut)
template VXLIB_STATUS VXLIB_tableLookup_generic_set_ci< int16_t >(VXLIB_kernelHandle handle, void *restrict pLut)
Header file for kernel's internal use. For the kernel's interface, please see VXLIB_tableLookup.
void * VXLIB_kernelHandle
Handle type for VXLIB operations.
VXLIB_STATUS_NAME
The enumeration of all status codes.
A structure for a 1 dimensional buffer descriptor.
A structure for a 2 dimensional buffer descriptor.
Structure containing the parameters to initialize the kernel.
uint16_t offset
Parameter indicating index of input value = 0 in the lookup table
Structure that is reserved for internal use by the kernel.
size_t numBlocksLut
Number of blocks to be processed for lut logic after simidfication.
VXLIB_tableLookup_InitArgs pKerInitArgs
Initargs of the kernel.
size_t width
Width of image
size_t height
Height of image
uint8_t bufPblock[VXLIB_TABLELOOKUP_IXX_IXX_OXX_PBLOCK_SIZE]
Array to hold SE/SA params.