PDK API Guide for J721E
msc_cfg.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2019
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
49 #ifndef CFG_MSC_H_
50 #define CFG_MSC_H_
51 
52 /* ========================================================================== */
53 /* Include Files */
54 /* ========================================================================== */
55 
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /* ========================================================================== */
64 /* Macros & Typedefs */
65 /* ========================================================================== */
67 #define MSC_MAX_OUTPUT (10U)
68 
70 #define MSC_MAX_TAP (5U)
71 
73 #define MSC_MAX_SP_COEFF_SET (2U)
74 
76 #define MSC_MAX_MP_COEFF_SET (4U)
77 
78 
93 #define MSC_COEFF_SHIFT_5 (5U)
94 
95 #define MSC_COEFF_SHIFT_6 (6U)
96 
97 #define MSC_COEFF_SHIFT_7 (7U)
98 
99 #define MSC_COEFF_SHIFT_8 (8U)
100 
101 #define MSC_COEFF_SHIFT_9 (9U)
102 
117 #define MSC_MULTI_32PHASE_COEFF_SET_0 (0U)
118 
119 #define MSC_MULTI_32PHASE_COEFF_SET_1 (1U)
120 
121 #define MSC_MULTI_32PHASE_COEFF_SET_2 (2U)
122 
123 #define MSC_MULTI_32PHASE_COEFF_SET_3 (3U)
124 
125 #define MSC_MULTI_64PHASE_COEFF_SET_0 (0U)
126 
127 #define MSC_MULTI_64PHASE_COEFF_SET_2 (2U)
128 
142 #define MSC_TAP_SEL_3TAPS (0U)
143 
144 #define MSC_TAP_SEL_4TAPS (1U)
145 
146 #define MSC_TAP_SEL_5TAPS (2U)
147 
160 #define MSC_SINGLE_PHASE_SP_COEFF_0 (0U)
161 
162 #define MSC_SINGLE_PHASE_SP_COEFF_1 (1U)
163 
164 #define MSC_SINGLE_PHASE_MP_COEFF0_0 (2U)
165 
166 #define MSC_SINGLE_PHASE_MP_COEFF0_1 (3U)
167 
168 #define MSC_SINGLE_PHASE_MP_COEFF0_2 (4U)
169 
170 #define MSC_SINGLE_PHASE_MP_COEFF0_3 (5U)
171 
172 #define MSC_SINGLE_PHASE_MP_COEFF0_4 (6U)
173 
174 #define MSC_SINGLE_PHASE_MP_COEFF0_5 (7U)
175 
176 #define MSC_SINGLE_PHASE_MP_COEFF0_6 (8U)
177 
178 #define MSC_SINGLE_PHASE_MP_COEFF0_7 (9U)
179 
180 #define MSC_SINGLE_PHASE_MP_COEFF0_8 (10U)
181 
182 #define MSC_SINGLE_PHASE_MP_COEFF0_9 (11U)
183 
184 #define MSC_SINGLE_PHASE_MP_COEFF0_10 (12U)
185 
186 #define MSC_SINGLE_PHASE_MP_COEFF0_11 (13U)
187 
188 #define MSC_SINGLE_PHASE_MP_COEFF0_12 (14U)
189 
190 #define MSC_SINGLE_PHASE_MP_COEFF0_13 (15U)
191 
192 #define MSC_SINGLE_PHASE_MP_COEFF0_14 (16U)
193 
194 #define MSC_SINGLE_PHASE_MP_COEFF0_15 (17U)
195 
206 #define MSC_PHASE_MODE_64PHASE (0U)
207 
208 #define MSC_PHASE_MODE_32PHASE (1U)
209 
218 #define MSC_FILTER_MODE_SINGLE_PHASE (0U)
219 
220 #define MSC_FILTER_MODE_MULTI_PHASE (1U)
221 
236 #define VHWA_MSC_VBUSM_RD_ERR (0x4U)
237 
238 #define VHWA_MSC_SL2_WR_ERR (0x8U)
239 
241 /* ========================================================================== */
242 /* Structure Declarations */
243 /* ========================================================================== */
244 
258 typedef void (*Msc_ErrEventCbFxn)(Fvid2_Handle handle, uint32_t errEvents,
259  void *appData);
260 
265 typedef struct
266 {
267  uint32_t enable;
280  uint32_t outWidth;
282  uint32_t outHeight;
284  uint32_t horzAccInit;
286  uint32_t vertAccInit;
289  uint32_t filtMode;
292  uint32_t phaseMode;
294  uint32_t hsSpCoeffSel;
298  uint32_t vsSpCoeffSel;
302  uint32_t hsMpCoeffSel;
306  uint32_t vsMpCoeffSel;
311  uint32_t coeffShift;
314  uint32_t isSignedData;
324 } Msc_ScConfig;
325 
330 typedef struct
331 {
332  uint32_t tapSel;
336 } Msc_Config;
337 
343 typedef struct
344 {
345  uint32_t errEvents;
352  void *appData;
355 
360 typedef struct
361 {
362  int32_t *spCoeffSet[MSC_MAX_SP_COEFF_SET];
366  int32_t *mpCoeffSet[MSC_MAX_MP_COEFF_SET];
374 } Msc_Coeff;
375 
376 /* ========================================================================== */
377 /* Function Declarations */
378 /* ========================================================================== */
379 
388 static inline void Msc_configInit(Msc_Config *mscCfg);
389 
398 static inline void Msc_coeffInit(Msc_Coeff *coeffCfg);
399 
400 /* ========================================================================== */
401 /* Function Definitions */
402 /* ========================================================================== */
403 
404 static inline void Msc_coeffInit(Msc_Coeff *coeffCfg)
405 {
406  if (NULL != coeffCfg)
407  {
408  Fvid2Utils_memset(coeffCfg, 0, sizeof(Msc_Coeff));
409  }
410 }
411 
412 static inline void Msc_ConfigInit(Msc_Config *mscCfg)
413 {
414  uint32_t cnt;
415 
416  if (NULL != mscCfg)
417  {
418  mscCfg->tapSel = MSC_TAP_SEL_5TAPS;
419  for (cnt = 0; cnt < MSC_MAX_OUTPUT; cnt++)
420  {
421  mscCfg->scCfg[cnt].enable = FALSE;
422  mscCfg->scCfg[cnt].outWidth = 0U;
423  mscCfg->scCfg[cnt].outHeight = 0U;
424  mscCfg->scCfg[cnt].horzAccInit = 0U;
425  mscCfg->scCfg[cnt].vertAccInit = 0U;
427  mscCfg->scCfg[cnt].phaseMode = MSC_PHASE_MODE_64PHASE;
432  mscCfg->scCfg[cnt].coeffShift = MSC_COEFF_SHIFT_8;
433  mscCfg->scCfg[cnt].isSignedData = FALSE;
434  mscCfg->scCfg[cnt].isEnableFiltSatMode = FALSE;
435  mscCfg->scCfg[cnt].inRoi.cropStartX = 0U;
436  mscCfg->scCfg[cnt].inRoi.cropStartY = 0U;
437  mscCfg->scCfg[cnt].inRoi.cropWidth = 0U;
438  mscCfg->scCfg[cnt].inRoi.cropHeight = 0U;
439  }
440  }
441 }
442 
443 #ifdef __cplusplus
444 }
445 #endif
446 
447 #endif
uint32_t vsMpCoeffSel
Definition: msc_cfg.h:306
uint32_t cropStartX
Definition: csl_fvid2_dataTypes.h:1326
File containning defination for common configuration/API used across all VHWA modules.
#define FALSE
Definition: csl_types.h:55
Msc_ScConfig scCfg[MSC_MAX_OUTPUT]
Definition: msc_cfg.h:334
#define MSC_MAX_SP_COEFF_SET
Maximum number of single phase coefficients set.
Definition: msc_cfg.h:73
Structure for error event parameters Used to register callback for the given set of events.
Definition: msc_cfg.h:343
Msc_ErrEventCbFxn cbFxn
Definition: msc_cfg.h:350
#define MSC_MAX_MP_COEFF_SET
Maximum number of Multi phase coefficients set.
Definition: msc_cfg.h:76
uint32_t cropStartY
Definition: csl_fvid2_dataTypes.h:1328
#define MSC_SINGLE_PHASE_SP_COEFF_0
Use Dedicated Single phase coef-0.
Definition: msc_cfg.h:160
uint32_t isEnableFiltSatMode
Definition: msc_cfg.h:317
static void Msc_coeffInit(Msc_Coeff *coeffCfg)
This function should be used to initialize variable of type Msc_Coeff.
Definition: msc_cfg.h:404
Structure containing crop configuration - used in Scaler and VCOMP.
Definition: csl_fvid2_dataTypes.h:1324
#define MSC_MULTI_64PHASE_COEFF_SET_0
Coefficient Set 0 for 64phase coefficients.
Definition: msc_cfg.h:125
uint32_t cropHeight
Definition: csl_fvid2_dataTypes.h:1332
uint32_t tapSel
Definition: msc_cfg.h:332
uint32_t phaseMode
Definition: msc_cfg.h:292
#define MSC_FILTER_MODE_SINGLE_PHASE
Definition: msc_cfg.h:218
uint32_t cropWidth
Definition: csl_fvid2_dataTypes.h:1330
#define MSC_COEFF_SHIFT_8
Coefficient shift by 8bits, 8bit fraction.
Definition: msc_cfg.h:99
CSL FVID2 Datatypes.
void * appData
Definition: msc_cfg.h:352
uint32_t vertAccInit
Definition: msc_cfg.h:286
uint32_t horzAccInit
Definition: msc_cfg.h:284
uint32_t hsSpCoeffSel
Definition: msc_cfg.h:294
#define NULL
Define NULL if not defined.
Definition: csl_types.h:107
uint32_t outHeight
Definition: msc_cfg.h:282
#define MSC_PHASE_MODE_64PHASE
Definition: msc_cfg.h:206
Individual Scalar configuration.
Definition: msc_cfg.h:265
static void Msc_ConfigInit(Msc_Config *mscCfg)
Definition: msc_cfg.h:412
uint32_t filtMode
Definition: msc_cfg.h:289
static void Msc_configInit(Msc_Config *mscCfg)
This function should be used to initialize variable of type Msc_Config.
uint32_t vsSpCoeffSel
Definition: msc_cfg.h:298
uint32_t enable
Definition: msc_cfg.h:267
uint32_t isSignedData
Definition: msc_cfg.h:314
uint32_t hsMpCoeffSel
Definition: msc_cfg.h:302
void(* Msc_ErrEventCbFxn)(Fvid2_Handle handle, uint32_t errEvents, void *appData)
Prototype for the Error Event for MSC. The callback for the MSC error events can be registered using ...
Definition: msc_cfg.h:258
uint32_t isInterleaveFormat
Definition: msc_cfg.h:321
#define MSC_MAX_OUTPUT
Maximum number of scalar output supported in MSC.
Definition: msc_cfg.h:67
Structure used for setting scalar coefficients.
Definition: msc_cfg.h:360
Fvid2_CropConfig inRoi
Definition: msc_cfg.h:270
uint32_t outWidth
Definition: msc_cfg.h:280
Structure for complete MSC Configuration.
Definition: msc_cfg.h:330
uint32_t coeffShift
Definition: msc_cfg.h:311
#define MSC_TAP_SEL_5TAPS
Selects the 5 tap filter.
Definition: msc_cfg.h:146
uint32_t errEvents
Definition: msc_cfg.h:345