TI J721E Imaging User Guide
hwa_vpac_fc.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2025 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_FC_H_
64 #define HWA_VPAC_FC_H_
65 
66 #include <VX/vx.h>
67 #include <VX/vx_kernels.h>
68 #include "TI/hwa_vpac_viss.h"
69 #include "TI/hwa_vpac_msc.h"
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
83 #define TIVX_KERNEL_VPAC_FC_NAME "com.ti.hwa.vpac_fc"
84 
85 
86 /*********************************
87  * VPAC_FC Control Commands
88  *********************************/
89 
96 #define TIVX_VPAC_FC_MSC_CMD_SET_COEFF (0x10000000u)
97 
113 #define TIVX_VPAC_FC_MSC_CMD_SET_INPUT_PARAMS (0x10000001u)
114 
133 #define TIVX_VPAC_FC_MSC_CMD_SET_OUTPUT_PARAMS (0x10000002u)
134 
157 #define TIVX_VPAC_FC_MSC_CMD_SET_CROP_PARAMS (0x10000003u)
158 
177 #define TIVX_VPAC_FC_VISS_CMD_SET_DCC_PARAMS (0x10000004u)
178 
190 #define TIVX_VPAC_FC_DELETE_GRAPH (0x10000005u)
191 
192 /*********************************
193  * VPAC_FC Defines
194  *********************************/
195 
196 #define TIVX_KERNEL_VPAC_FC_MAX_MSC_INPUT_THREADS (4U)
197 #define TIVX_VPAC_FC_VISS_OUT0 (0U)
198 #define TIVX_VPAC_FC_VISS_OUT1 (1U)
199 #define TIVX_VPAC_FC_VISS_OUT2 (2U)
200 #define TIVX_VPAC_FC_VISS_OUT3 (3U)
201 #define TIVX_VPAC_FC_MSC_CH_INVALID (4U)
202 #define TIVX_VPAC_FC_MSC0 (0U)
203 #define TIVX_VPAC_FC_MSC1 (1U)
204 #define TIVX_VPAC_FC_MSC_TH_INVALID (2U)
205 
206 /*********************************
207  * VPAC_FC STRUCTURES
208  *********************************/
209 
216 typedef struct {
217 
218  /*
219  *
220  * | val | msc0_input0 | msc0_input1 | msc1_input0 | msc1_input1 |
221  * |:--------:|:-----------:|:-----------:| :----------:|:-----------:|
222  * | 0 | VISS_OUT0 | VISS_OUT0 | VISS_OUT0 | VISS_OUT0 |
223  * | 1 | VISS_OUT1 | VISS_OUT1 | VISS_OUT1 | VISS_OUT1 |
224  * | 2 | VISS_OUT2 | VISS_OUT2 | VISS_OUT2 | VISS_OUT2 |
225  * | 3 | VISS_OUT3 | VISS_OUT3 | VISS_OUT3 | VISS_OUT3 |
226  * | 4 | INVALID | INVALID | INVALID | INVALID |
227  * | -------- | ---------- | ---------- | ---------- | ---------- |
228  *
229  * Note:
230  * - YUV420, YUV422, Luma+Chroma uses output_0 or output_2
231  * - output_1 or output_3 is unusable respectively
232  * - Single plane Luma uses output_0 or output_2
233  * - Single plane Chroma uses output_1 or output_3
234  * - Any other value is INVALID
235  * - For VPAC3L devices VISS_OUT2 and VISS_OUT3 is enabled at 1.5 bytes per pixel for Flexconnect; VISS_OUT0 and VISS_OUT1 is enabled at 2 bytes per pixel
236  * - For VPAC1 devices, Flexconnect is supported with LUMA only outputs on MSC0; Chroma only outputs on MSC1 will be enabled in upcoming release
237  */
238  uint32_t msc_in_thread_viss_out_map[TIVX_KERNEL_VPAC_FC_MAX_MSC_INPUT_THREADS];
239 
240  /*
241  * | val | msc_output0 | msc_output1 | .. | msc_output7 | msc_output8 | msc_output9 |
242  * |:---:|:-----------:|:-----------:|:--:|:-----------:|:-----------:|:-----------:|
243  * | 0 | MSC_0 | MSC_0 | .. | MSC_0 | MSC_0 | MSC_0 |
244  * | 1 | MSC_1 | MSC_1 | .. | MSC_1 | MSC_1 | MSC_1 |
245  * | 2 | INVALID | INVALID | .. | INVALID | INVALID | INVALID |*
246  * | ----| ----------- | ----------- | -- | ----------- | ----------- | ----------- |
247  *
248  * Note:
249  * - A single YUV420 uses 2 MSC outputs
250  * - mapped to even outputs (0/2/4/6/8)
251  * - odd outputs (1/3/5/7/9) are unusable
252  * - Any other value is INVALID
253  * - For VPAC3L devices only MSC0 is enabled for Flexconnect
254  * - For VPAC1 devices, Flexconnect is supported only on MSC0; MSC1 will be enabled in upcoming release
255  */
256  uint32_t msc_out_msc_in_map[TIVX_VPAC_MSC_MAX_OUTPUT];
257 
259 
261 
262 /*********************************
263  * Function Prototypes
264  *********************************/
265 
267 
273 
279 
496 VX_API_ENTRY vx_node VX_API_CALL tivxVpacFcVissMscNode(vx_graph graph,
497  vx_user_data_object configuration,
498  vx_user_data_object viss_ae_awb_result,
499  vx_user_data_object dcc_buf,
500  tivx_raw_image viss_raw,
501  vx_image viss_out0,
502  vx_image viss_out1,
503  vx_image viss_out2,
504  vx_image viss_out3,
505  vx_user_data_object viss_h3a_out,
506  vx_distribution viss_histogram0,
507  vx_distribution viss_histogram1,
508  vx_distribution viss_raw_histogram,
509  vx_image msc_scale_out0_img,
510  vx_image msc_scale_out1_img,
511  vx_image msc_scale_out2_img,
512  vx_image msc_scale_out3_img,
513  vx_image msc_scale_out4_img,
514  vx_image msc_scale_out5_img,
515  vx_image msc_scale_out6_img,
516  vx_image msc_scale_out7_img,
517  vx_image msc_scale_out8_img,
518  vx_image msc_scale_out9_img);
519 
520 #ifdef __cplusplus
521 }
522 #endif
523 
524 #endif /* HWA_VPAC_FC_H_ */
525 
void tivxRegisterHwaTargetVpacFcKernels(void)
Function to register HWA Kernels on the vpac_fc Target.
#define TIVX_KERNEL_VPAC_FC_MAX_MSC_INPUT_THREADS
Definition: hwa_vpac_fc.h:196
The input config data structure used by the TIVX_KERNEL_VPAC_FC kernel.
Definition: hwa_vpac_fc.h:216
The MSC kernels in this kernel extension.
tivx_vpac_viss_params_t tivxVissPrms
Definition: hwa_vpac_fc.h:258
void tivx_vpac_fc_params_init(tivx_vpac_fc_viss_msc_params_t *prms)
#define TIVX_VPAC_MSC_MAX_OUTPUT
Definition: hwa_vpac_msc.h:208
The configuration data structure used by the TIVX_KERNEL_VISS kernel.
Definition: hwa_vpac_viss1.h:93
The VISS kernels in this kernel extension.
VX_API_ENTRY vx_node VX_API_CALL tivxVpacFcVissMscNode(vx_graph graph, vx_user_data_object configuration, vx_user_data_object viss_ae_awb_result, vx_user_data_object dcc_buf, tivx_raw_image viss_raw, vx_image viss_out0, vx_image viss_out1, vx_image viss_out2, vx_image viss_out3, vx_user_data_object viss_h3a_out, vx_distribution viss_histogram0, vx_distribution viss_histogram1, vx_distribution viss_raw_histogram, vx_image msc_scale_out0_img, vx_image msc_scale_out1_img, vx_image msc_scale_out2_img, vx_image msc_scale_out3_img, vx_image msc_scale_out4_img, vx_image msc_scale_out5_img, vx_image msc_scale_out6_img, vx_image msc_scale_out7_img, vx_image msc_scale_out8_img, vx_image msc_scale_out9_img)
[Graph] Creates a VPAC_FC Node.
void tivxUnRegisterHwaTargetVpacFcKernels(void)
Function to un-register HWA Kernels on the vpac_fc Target.