TIOVX User Guide
hwa_vpac_msc.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2019-2021 Texas Instruments Incorporated
4  *
5  * All rights reserved not granted herein.
6  *
7  * Limited License.
8  *
9  * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
10  * license under copyrights and patents it now or hereafter owns or controls to make,
11  * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
12  * terms herein. With respect to the foregoing patent license, such license is granted
13  * solely to the extent that any such patent is necessary to Utilize the software alone.
14  * The patent license shall not apply to any combinations which include this software,
15  * other than combinations with devices manufactured by or for TI ("TI Devices").
16  * No hardware patent is licensed hereunder.
17  *
18  * Redistributions must preserve existing copyright notices and reproduce this license
19  * (including the above copyright notice and the disclaimer and (if applicable) source
20  * code license limitations below) in the documentation and/or other materials provided
21  * with the distribution
22  *
23  * Redistribution and use in binary form, without modification, are permitted provided
24  * that the following conditions are met:
25  *
26  * * No reverse engineering, decompilation, or disassembly of this software is
27  * permitted with respect to any software provided in binary form.
28  *
29  * * any redistribution and use are licensed by TI for use only with TI Devices.
30  *
31  * * Nothing shall obligate TI to provide you with source code for the software
32  * licensed and provided to you in object code.
33  *
34  * If software source code is provided to you, modification and redistribution of the
35  * source code are permitted provided that the following conditions are met:
36  *
37  * * any redistribution and use of the source code, including any resulting derivative
38  * works, are licensed by TI for use only with TI Devices.
39  *
40  * * any redistribution and use of any object code compiled from the source code
41  * and any resulting derivative works, are licensed by TI for use only with TI Devices.
42  *
43  * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
44  *
45  * may be used to endorse or promote products derived from this software without
46  * specific prior written permission.
47  *
48  * DISCLAIMER.
49  *
50  * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
51  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53  * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
54  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
58  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59  * OF THE POSSIBILITY OF SUCH DAMAGE.
60  *
61  */
62 
63 #ifndef HWA_VPAC_MSC_H_
64 #define HWA_VPAC_MSC_H_
65 
66 #include <VX/vx.h>
67 #include <VX/vx_kernels.h>
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
81 #define TIVX_KERNEL_VPAC_MSC_MULTI_SCALE_NAME "com.ti.hwa.vpac_msc_multi_scale"
82 
86 #define TIVX_KERNEL_VPAC_MSC_PYRAMID_NAME "com.ti.hwa.vpac_msc_pyramid"
87 
88 /*********************************
89  * VPAC_MSC Control Commands
90  *********************************/
91 
98 #define TIVX_VPAC_MSC_CMD_SET_COEFF (0x20000000u)
99 
115 #define TIVX_VPAC_MSC_CMD_SET_INPUT_PARAMS (0x20000001u)
116 
135 #define TIVX_VPAC_MSC_CMD_SET_OUTPUT_PARAMS (0x20000002u)
136 
159 #define TIVX_VPAC_MSC_CMD_SET_CROP_PARAMS (0x20000003u)
160 
161 /*********************************
162  * VPAC_MSC Defines
163  *********************************/
164 
166 #define TIVX_VPAC_MSC_MAX_MP_COEFF_SET (4U)
167 
169 #define TIVX_VPAC_MSC_MAX_SP_COEFF_SET (2U)
170 
173 #define TIVX_VPAC_MSC_MAX_OUTPUT (10U)
174 
176 #define TIVX_VPAC_MSC_MAX_TAP (5U)
177 
179 #define TIVX_VPAC_MSC_32_PHASE_COEFF (32U)
180 
182 #define TIVX_VPAC_MSC_AUTOCOMPUTE (0xFFFFFFFFU)
183 
185 #define TIVX_VPAC_MSC_INTERPOLATION_GAUSSIAN_32_PHASE (0)
186 
187 /*********************************
188  * VPAC_MSC STRUCTURES
189  *********************************/
190 
197 typedef struct {
201  int32_t multi_phase[TIVX_VPAC_MSC_MAX_MP_COEFF_SET]
204 
211 typedef struct {
217  uint32_t horz_coef_src;
225  uint32_t horz_coef_sel;
231  uint32_t vert_coef_src;
239  uint32_t vert_coef_sel;
241 
248 typedef struct {
250  uint32_t phase_mode;
259  uint32_t horz_coef_sel;
268  uint32_t vert_coef_sel;
273  uint32_t init_phase_x;
278  uint32_t init_phase_y;
280 
286 typedef struct {
288  uint32_t crop_start_x;
290  uint32_t crop_start_y;
292  uint32_t crop_width;
294  uint32_t crop_height;
296 
302 typedef struct {
305  uint32_t signed_data;
308  uint32_t filter_mode;
311  uint32_t coef_shift;
315  uint32_t saturation_mode;
319  uint32_t offset_x;
323  uint32_t offset_y;
327 
333 
340 typedef struct {
342  uint32_t kern_sz;
344  uint32_t src_ln_inc_2;
349 
350 /*********************************
351  * Function Prototypes
352  *********************************/
353 
359 
365 
366 
417  vx_image in_img,
418  vx_image out0_img,
419  vx_image out1_img,
420  vx_image out2_img,
421  vx_image out3_img,
422  vx_image out4_img);
423 
456  vx_image in_img,
457  vx_pyramid out_pyramid);
458 
459 
474 
484 
494 
495 #ifdef __cplusplus
496 }
497 #endif
498 
499 #endif /* HWA_VPAC_MSC_H_ */
500 
struct _vx_image * vx_image
The coefficients input data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:197
#define TIVX_VPAC_MSC_32_PHASE_COEFF
Definition: hwa_vpac_msc.h:179
int32_t vx_enum
VX_API_ENTRY vx_node VX_API_CALL tivxVpacMscPyramidNode(vx_graph graph, vx_image in_img, vx_pyramid out_pyramid)
Creates a VPAC_MSC Node with multi-scale pyramid output.
void tivxRegisterHwaTargetVpacMscKernels(void)
Function to register HWA Kernels on the vpac_msc Target.
#define TIVX_VPAC_MSC_MAX_SP_COEFF_SET
Definition: hwa_vpac_msc.h:169
void tivx_vpac_msc_coefficients_params_init(tivx_vpac_msc_coefficients_t *coeff, vx_enum interpolation)
Function to initialize MSC Coefficients Parameters This initializes Coefficients to default values...
#define TIVX_VPAC_MSC_MAX_MP_COEFF_SET
Definition: hwa_vpac_msc.h:166
void tivxUnRegisterHwaTargetVpacMscKernels(void)
Function to un-register HWA Kernels on the vpac_msc Target.
The input config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:340
struct _vx_pyramid * vx_pyramid
The configuration data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:211
The output config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:302
VX_API_ENTRY vx_node VX_API_CALL tivxVpacMscScaleNode(vx_graph graph, vx_image in_img, vx_image out0_img, vx_image out1_img, vx_image out2_img, vx_image out3_img, vx_image out4_img)
Creates a VPAC_MSC Node with multi-scale outputs.
#define TIVX_VPAC_MSC_MAX_TAP
Definition: hwa_vpac_msc.h:176
void tivx_vpac_msc_input_params_init(tivx_vpac_msc_input_params_t *prms)
Function to initialize MSC input Parameters This is used for control command: TIVX_VPAC_MSC_CMD_SET_I...
struct _vx_graph * vx_graph
void tivx_vpac_msc_output_params_init(tivx_vpac_msc_output_params_t *prms)
Function to initialize MSC output Parameters This is used for control command: TIVX_VPAC_MSC_CMD_SET_...
struct _vx_node * vx_node
tivx_vpac_msc_single_phase_params_t single_phase
Definition: hwa_vpac_msc.h:329
The multi_phase data structure in the configuration data structure used by the TIVX_KERNEL_VPAC_MSC k...
Definition: hwa_vpac_msc.h:248
The crop config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:286
vx_status(* VX_API_CALL)(vx_reference *ref)
Callback type used to register release callbacks from object dervied from references.
Definition: vx_reference.h:56
tivx_vpac_msc_multi_phase_params_t multi_phase
Definition: hwa_vpac_msc.h:331