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 
188 #define TIVX_VPAC_MSC_MODE_LUMA_ONLY (0U)
189 
191 #define TIVX_VPAC_MSC_MODE_CHROMA_ONLY (1U)
192 
193 #define TIVX_VPAC_MSC_INIT_DIV_FACTOR (1U)
194 
195 /*********************************
196  * VPAC_MSC STRUCTURES
197  *********************************/
198 
205 typedef struct {
209  int32_t multi_phase[TIVX_VPAC_MSC_MAX_MP_COEFF_SET]
212 
219 typedef struct {
225  uint32_t horz_coef_src;
233  uint32_t horz_coef_sel;
239  uint32_t vert_coef_src;
247  uint32_t vert_coef_sel;
249 
256 typedef struct {
258  uint32_t phase_mode;
267  uint32_t horz_coef_sel;
276  uint32_t vert_coef_sel;
281  uint32_t init_phase_x;
286  uint32_t init_phase_y;
288 
294 typedef struct {
296  uint32_t crop_start_x;
298  uint32_t crop_start_y;
300  uint32_t crop_width;
302  uint32_t crop_height;
304 
310 typedef struct {
313  uint32_t signed_data;
316  uint32_t filter_mode;
319  uint32_t coef_shift;
323  uint32_t saturation_mode;
327  uint32_t offset_x;
331  uint32_t offset_y;
335 
341 
348 typedef struct {
350  uint32_t kern_sz;
352  uint32_t src_ln_inc_2;
360  uint32_t yc_mode;
362 
363 /*********************************
364  * Function Prototypes
365  *********************************/
366 
372 
378 
379 
435  vx_image in_img,
436  vx_image out0_img,
437  vx_image out1_img,
438  vx_image out2_img,
439  vx_image out3_img,
440  vx_image out4_img);
441 
474  vx_image in_img,
475  vx_pyramid out_pyramid);
476 
477 
492 
502 
512 
513 #ifdef __cplusplus
514 }
515 #endif
516 
517 #endif /* HWA_VPAC_MSC_H_ */
518 
struct _vx_image * vx_image
The coefficients input data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:205
#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:348
struct _vx_pyramid * vx_pyramid
The configuration data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:219
The output config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:310
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:337
The multi_phase data structure in the configuration data structure used by the TIVX_KERNEL_VPAC_MSC k...
Definition: hwa_vpac_msc.h:256
The crop config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:294
vx_status(* VX_API_CALL)(vx_reference *ref)
Callback type used to register release callbacks from object derived from references.
Definition: vx_reference.h:56
tivx_vpac_msc_multi_phase_params_t multi_phase
Definition: hwa_vpac_msc.h:339