TI J721E Imaging 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 
91 #define TIVX_KERNEL_VPAC_MSC_MULTI_SCALE2_NAME "com.ti.hwa.vpac_msc_multi_scale2"
92 
93 /*********************************
94  * VPAC_MSC Control Commands
95  *********************************/
96 
103 #define TIVX_VPAC_MSC_CMD_SET_COEFF (0x20000000u)
104 
120 #define TIVX_VPAC_MSC_CMD_SET_INPUT_PARAMS (0x20000001u)
121 
140 #define TIVX_VPAC_MSC_CMD_SET_OUTPUT_PARAMS (0x20000002u)
141 
164 #define TIVX_VPAC_MSC_CMD_SET_CROP_PARAMS (0x20000003u)
165 
182 #define TIVX_VPAC_MSC_CMD_GET_ERR_STATUS (0x20000004u)
183 
187 #define TIVX_VPAC_MSC_CMD_GET_PSA_STATUS (0x20000005u)
188 
189 
190 /*********************************
191  * VPAC_MSC Defines
192  *********************************/
193 
201 #define TIVX_VPAC_MSC_MAX_MP_COEFF_SET (4U)
202 
204 #define TIVX_VPAC_MSC_MAX_SP_COEFF_SET (2U)
205 
208 #define TIVX_VPAC_MSC_MAX_OUTPUT (10U)
209 
211 #define TIVX_VPAC_MSC_MAX_TAP (5U)
212 
214 #define TIVX_VPAC_MSC_32_PHASE_COEFF (32U)
215 
217 #define TIVX_VPAC_MSC_AUTOCOMPUTE (0xFFFFFFFFU)
218 
220 #define TIVX_VPAC_MSC_INTERPOLATION_GAUSSIAN_32_PHASE (0)
221 
223 #define TIVX_VPAC_MSC_MODE_LUMA_ONLY (0U)
224 
226 #define TIVX_VPAC_MSC_MODE_CHROMA_ONLY (1U)
227 
228 #define TIVX_VPAC_MSC_INIT_DIV_FACTOR (1U)
229 
230 #define TIVX_VPAC_MSC_DEFAULT_MAX_DS_FACTOR (2U)
231 
233 #define TIVX_VPAC_MSC_VBUSM_RD_ERR (0x4U)
234 
235 #define TIVX_VPAC_MSC_SL2_WR_ERR (0x8U)
236 
237 #define TIVX_VPAC_MSC0_WDTIMER_ERR (0x40000000U)
238 
239 #define TIVX_VPAC_MSC1_WDTIMER_ERR (0x80000000U)
240 
241 #define TIVX_VPAC_MSC_MAX_COMP (2u)
242 
245 /*********************************
246  * VPAC_MSC STRUCTURES
247  *********************************/
248 
255 typedef struct {
259  int32_t multi_phase[TIVX_VPAC_MSC_MAX_MP_COEFF_SET]
262 
269 typedef struct {
275  uint32_t horz_coef_src;
283  uint32_t horz_coef_sel;
289  uint32_t vert_coef_src;
297  uint32_t vert_coef_sel;
299 
306 typedef struct {
308  uint32_t phase_mode;
317  uint32_t horz_coef_sel;
326  uint32_t vert_coef_sel;
331  uint32_t init_phase_x;
336  uint32_t init_phase_y;
338 
344 typedef struct {
346  uint32_t crop_start_x;
348  uint32_t crop_start_y;
350  uint32_t crop_width;
352  uint32_t crop_height;
354 
360 typedef struct {
363  uint32_t signed_data;
366  uint32_t filter_mode;
369  uint32_t coef_shift;
373  uint32_t saturation_mode;
377  uint32_t offset_x;
381  uint32_t offset_y;
385 
391 
398 typedef struct {
400  uint32_t kern_sz;
402  uint32_t src_ln_inc_2;
410  uint32_t yc_mode;
420  uint32_t max_ds_factor;
421  #if defined(VPAC3) || defined(VPAC3L)
422 
425  uint32_t is_enable_simul_processing;
430  uint32_t in_img0_yc_mode;
434  uint32_t in_img1_yc_mode;
435  #endif
436 
462  uint32_t enable_psa;
464 
470 typedef struct {
477 
483  uint64_t timestamp;
485 
486 /*********************************
487  * Function Prototypes
488  *********************************/
489 
495 
501 
567 VX_API_ENTRY vx_node VX_API_CALL tivxVpacMscScaleNode(vx_graph graph,
568  vx_image in_img0,
569  vx_image out0_img,
570  vx_image out1_img,
571  vx_image out2_img,
572  vx_image out3_img,
573  vx_image out4_img);
574 
685 VX_API_ENTRY vx_node VX_API_CALL tivxVpacMscScaleNode2(vx_graph graph,
686  vx_image in_img0,
687  vx_image out0_img,
688  vx_image out1_img,
689  vx_image out2_img,
690  vx_image out3_img,
691  vx_image out4_img,
692  vx_image in_img1,
693  vx_image out5_img,
694  vx_image out6_img,
695  vx_image out7_img,
696  vx_image out8_img,
697  vx_image out9_img);
698 
733 VX_API_ENTRY vx_node VX_API_CALL tivxVpacMscPyramidNode(vx_graph graph,
734  vx_image in_img,
735  vx_pyramid out_pyramid);
736 
737 
751 void tivx_vpac_msc_coefficients_params_init(tivx_vpac_msc_coefficients_t *coeff, vx_enum interpolation);
752 
762 
772 
773 #ifdef __cplusplus
774 }
775 #endif
776 
777 #endif /* HWA_VPAC_MSC_H_ */
778 
VX_API_ENTRY vx_node VX_API_CALL tivxVpacMscScaleNode(vx_graph graph, vx_image in_img0, 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 (at most 5 outputs).
uint32_t horz_coef_sel
Definition: hwa_vpac_msc.h:283
uint32_t saturation_mode
Definition: hwa_vpac_msc.h:373
uint32_t src_ln_inc_2
Definition: hwa_vpac_msc.h:402
uint32_t yc_mode
Definition: hwa_vpac_msc.h:410
The coefficients input data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:255
#define TIVX_VPAC_MSC_MAX_SP_COEFF_SET
Definition: hwa_vpac_msc.h:204
uint32_t crop_start_y
Definition: hwa_vpac_msc.h:348
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.
Structure to hold PSA timestamp data.
Definition: hwa_vpac_msc.h:470
void tivxRegisterHwaTargetVpacMscKernels(void)
Function to register HWA Kernels on the vpac_msc Target.
#define TIVX_VPAC_MSC_MAX_TAP
Definition: hwa_vpac_msc.h:211
uint32_t enable_psa
Definition: hwa_vpac_msc.h:462
uint32_t init_phase_x
Definition: hwa_vpac_msc.h:331
uint32_t horz_coef_src
Definition: hwa_vpac_msc.h:275
uint32_t vert_coef_sel
Definition: hwa_vpac_msc.h:297
uint32_t kern_sz
Definition: hwa_vpac_msc.h:400
uint64_t timestamp
Timestamp value.
Definition: hwa_vpac_msc.h:483
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...
uint32_t vert_coef_src
Definition: hwa_vpac_msc.h:289
uint32_t vert_coef_sel
Definition: hwa_vpac_msc.h:326
void tivxUnRegisterHwaTargetVpacMscKernels(void)
Function to un-register HWA Kernels on the vpac_msc Target.
uint32_t crop_start_x
Definition: hwa_vpac_msc.h:346
The input config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:398
uint32_t offset_x
Definition: hwa_vpac_msc.h:377
The configuration data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:269
uint32_t max_ds_factor
Definition: hwa_vpac_msc.h:420
#define TIVX_VPAC_MSC_MAX_COMP
Maximum possible MSC iteration for a simgle request (Luma + Chroma)
Definition: hwa_vpac_msc.h:241
uint32_t coef_shift
Definition: hwa_vpac_msc.h:369
The output config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:360
#define TIVX_VPAC_MSC_MAX_OUTPUT
Definition: hwa_vpac_msc.h:208
uint32_t offset_y
Definition: hwa_vpac_msc.h:381
#define TIVX_VPAC_MSC_32_PHASE_COEFF
Definition: hwa_vpac_msc.h:214
uint32_t filter_mode
Definition: hwa_vpac_msc.h:366
uint32_t horz_coef_sel
Definition: hwa_vpac_msc.h:317
uint32_t crop_height
Definition: hwa_vpac_msc.h:352
VX_API_ENTRY vx_node VX_API_CALL tivxVpacMscScaleNode2(vx_graph graph, vx_image in_img0, vx_image out0_img, vx_image out1_img, vx_image out2_img, vx_image out3_img, vx_image out4_img, vx_image in_img1, vx_image out5_img, vx_image out6_img, vx_image out7_img, vx_image out8_img, vx_image out9_img)
Creates a VPAC_MSC Node with multi-scale outputs (at most 10 outputs). This node takes at most 2 sing...
uint32_t crop_width
Definition: hwa_vpac_msc.h:350
uint32_t signed_data
Definition: hwa_vpac_msc.h:363
uint32_t init_phase_y
Definition: hwa_vpac_msc.h:336
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...
uint32_t phase_mode
Definition: hwa_vpac_msc.h:308
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_...
uint32_t input_align_12bit
Definition: hwa_vpac_msc.h:405
tivx_vpac_msc_single_phase_params_t single_phase
Definition: hwa_vpac_msc.h:387
The multi_phase data structure in the configuration data structure used by the TIVX_KERNEL_VPAC_MSC k...
Definition: hwa_vpac_msc.h:306
The crop config data structure used by the TIVX_KERNEL_VPAC_MSC kernel.
Definition: hwa_vpac_msc.h:344
uint32_t enable_error_events
Definition: hwa_vpac_msc.h:457
uint32_t output_align_12bit
Definition: hwa_vpac_msc.h:384
#define TIVX_VPAC_MSC_MAX_MP_COEFF_SET
Definition: hwa_vpac_msc.h:201
tivx_vpac_msc_multi_phase_params_t multi_phase
Definition: hwa_vpac_msc.h:389