source: svn/trunk/newcon3bcm2_21bu/magnum/commonutils/vdb/3548/B3/bvdb_priv.h

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 14.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2010, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bvdb_priv.h $
11 * $brcm_Revision: Hydra_Software_Devel/24 $
12 * $brcm_Date: 1/29/10 4:53p $
13 *
14 * Module Description:
15 *   See Module Overview below.
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/commonutils/vdb/3548/B0/bvdb_priv.h $
20 *
21 * Hydra_Software_Devel/24   1/29/10 4:53p jerrylim
22 * SW3548-2744: Add 3D RTS support to config 2
23 *
24 * Hydra_Software_Devel/23   1/19/10 8:34p jerrylim
25 * SW3548-2726: Added 3D support to config 14. The changes were made based
26 * on 3548_Usage_Modes.xls Rev.2.74
27 *
28 * Hydra_Software_Devel/22   12/24/09 3:09p jerrylim
29 * SW3548-2683: Changed cropping size to 36% in FULL.8 and recalculated
30 * PBP mode. The changes were maded based on 3548_Usage_Modes.xls
31 * Rev.2.65 2009.12.24
32 *
33 * Hydra_Software_Devel/21   12/18/09 6:47p jerrylim
34 * SW3556-933: added 1440x480p@60 to BVDB_GetInputFormatGroup()
35 *
36 * Hydra_Software_Devel/20   12/11/09 3:31p jerrylim
37 * SW3548-2656: RTS Settings were incorrectly applied to all PIP window
38 * cases. And this change is based on 3548_Usage_Modes.xls Rev2.64. Refer
39 * to the JIRA for more details
40 *
41 * Hydra_Software_Devel/19   12/5/09 4:49p jerrylim
42 * SW3556-846, SW3548-2621: Updated config 14. The changes are based on
43 * 3548_Usage_Modes.xls rev2.61
44 *
45 * Hydra_Software_Devel/18   11/20/09 2:17a jerrylim
46 * SW3548-2551: config11 updated. No GFD compression. MNR/BNR on/off
47 * allowed for all sources
48 *
49 * Hydra_Software_Devel/17   11/7/09 11:46a jerrylim
50 * SW3556-846: [LG-GP2][BCM3549B2][BCM3556C0] unification of config7(ATSC)
51 * and config14(DVB). Now config 14 covers config 7 meaning that the
52 * projects using config 7 can now use config 14. But there is a known
53 * issue that lines are missing in some VGA signals and refer to SW3556-
54 * 830 for more details, and will be addressed soon
55 *
56 * Hydra_Software_Devel/16   11/2/09 3:08p jerrylim
57 * SW3548-2551: [LG RM3 F-HD ATSC] DTV Questionnaire. Changes made based
58 * on the questionnaire - smooth viewmode change. changes in clipping and
59 * display size in PIG.
60 *
61 * Hydra_Software_Devel/15   4/13/09 3:40p jessem
62 * PR 51743: Modified  BVDB_GetDisplaySrcAs and BVDB_GetVideoDisplayModes
63 * to handle source aspect ratio and aspect ratio correction.
64 *
65 * Hydra_Software_Devel/14   4/3/09 3:51p jessem
66 * PR 53783: Moved BVDB_P_MAX/MIN macro from bvdc.c.
67 *
68 * Hydra_Software_Devel/13   3/30/09 2:53p jessem
69 * PR 53682: Added lookup for 1080p24/25/30 in BVDB_GetInputFormatGroup.
70 * Also added helper macro to determine if a given value is within
71 * tolerance of nominal.
72 *
73 * Hydra_Software_Devel/12   3/24/09 3:34p jessem
74 * PR 53388: Changed implementation of BVDB_GetInputFormatGroup.
75 *
76 * Hydra_Software_Devel/11   3/19/09 3:36p jessem
77 * PR 53388: Modified BVDB_GetInputFormatGroup()'s parameter list and
78 * implementation.
79 *
80 * Hydra_Software_Devel/10   2/25/09 5:57p jessem
81 * PR 52520: Added support to BVDB_GetVideoDisplayMode.
82 *
83 * Hydra_Software_Devel/9   2/20/09 4:17p jessem
84 * PR 51709: Added config 9 support. Removed BVDB_GetNumberOfConfigs and
85 * replaced it wth BVDB_ValidateConfigId. Removed BVDB_Handle parameter
86 * from BVDB_GetMemoryAllocation. Added RTS 161 to 177.
87 *
88 * Hydra_Software_Devel/8   2/18/09 11:49a jessem
89 * PR 51848: Removed references to VDC. Removed global access to config
90 * info. Added helper functions to access these instead.
91 *
92 * Hydra_Software_Devel/7   2/17/09 6:51p jessem
93 * PR 50031, PR 51848: Added config 8. Added BVDB_GetNumberOfConfigs() and
94 * BVDB_GetMemoryAllocation() functions to VDB API and support for these
95 * new functions.
96 *
97 * Hydra_Software_Devel/6   1/29/09 11:00a jessem
98 * PR 50327: Expanded MHEG FULL to MHEG FULL 1 and MHEG FULL 2 and
99 * expanded MHEG PIG to MHEG PIG 1 and MHEG PIG 2. Updated RTS 48 and
100 * added RTS 54 and 55 to support new MHEG modes. Updated config 3 usage
101 * modes to suppot new MHEG modes.
102 *
103 * Hydra_Software_Devel/5   1/16/09 4:34p jessem
104 * PR 51152: Changed scl-cap bias values for MONITOR OUT usage modes to
105 * scl-cap. This is to match the SCL-CAP orientation used by the RTS
106 * analysis for monitor out modes.
107 *
108 * Hydra_Software_Devel/4   1/5/09 12:39p jessem
109 * PR 50327: Updated config 3.
110 *
111 * Hydra_Software_Devel/3   11/19/08 5:56p jessem
112 * PR49427, PR49428, PR49429, PR49431, PR49432, PR49433, PR49434, PR49435,
113 * PR49436, PR49437, PR49438, PR49440: Fixed strcpy and strcat Coverity
114 * issues.
115 *
116 * Hydra_Software_Devel/2   11/13/08 7:00p jessem
117 * PR 48588: Added config 4 for 1080p/1080i/720p switchable output format.
118 *
119 * Hydra_Software_Devel/1   10/2/08 3:47p jessem
120 * PR 46299: Initial version
121 *
122 ***************************************************************************/
123 
124#ifndef __BVDB_PRIV_H__
125#define __BVDB_PRIV_H__
126
127#include "bvdb.h"
128#include "blst_circleq.h"
129
130#ifdef __cplusplus
131extern "C" {
132#endif
133
134#if BDBG_DEBUG_BUILD
135#define BVDB_P_GENERIC_GET_CONTEXT(handle, context, structname) \
136do { \
137    (context) = (handle); \
138    BDBG_ASSERT(context); \
139} while(0)
140#else
141#define BVDB_P_GENERIC_GET_CONTEXT(handle, context, structname) \
142    (context) = (handle)
143#endif
144
145#define BVDB_P_GET_CONTEXT(handle, context) \
146    BVDB_P_GENERIC_GET_CONTEXT(handle, context, BVDB_P_Context)
147   
148/* VDB list access */
149#define BVDB_P_UsageMode_GetNextNode(pNode)   \
150    BLST_CQ_NEXT(pNode, link)
151
152#define BVDB_P_UsageMode_GetPrevNode(pNode)   \
153    BLST_CQ_PREV(pNode, link)
154
155/* helper macros */
156#define BVDB_P_STRCPY(DSTR, SSTR) \
157    strncpy(DSTR, SSTR, BVDB_MAX_STRLEN)
158
159#define BVDB_P_STRCAT(DSTR, SSTR) \
160    strncat(DSTR, SSTR, BVDB_MAX_STRLEN)
161
162/* Compare value a == (b +/- delta) */
163#define BVDB_P_EQ_DELTA(value_a, value_b, delta) \
164 (((value_a) <= ((value_b) + (delta))) && \
165  ((value_b) <= ((value_a) + (delta))))
166
167/* Get the min / max of two numbers */
168#define BVDB_P_MIN(a, b)        (((a) < (b)) ? (a) : (b))
169#define BVDB_P_MAX(a, b)        (((a) > (b)) ? (a) : (b))
170
171/* constants */
172#define BVDB_P_NUM_WINDOW_HEAPS        4 /* MAIN(analog), MAIN(digital), PIP, MONITOR */
173#define BVDB_P_NUM_FULL_MODES         11
174#define BVDB_P_NUM_PIG_MODES           4
175#define BVDB_P_NUM_PIP_MODES           3
176#define BVDB_P_NUM_MON_MODES           4
177
178#define BVDB_P_ASPECT_RATIO_16_9       (16 * 100)/9
179#define BVDB_P_ASPECT_RATIO_15_9       (15 * 100)/9
180#define BVDB_P_ASPECT_RATIO_5_4        (5 * 100)/4
181#define BVDB_P_ASPECT_RATIO_4_3        (4 * 100)/3
182#define BVDB_P_ASPECT_RATIO_221        221
183
184
185/***************************************************************************
186 * BVDB_P_Context
187 *      Head of the doubly-linked list
188 ***************************************************************************/
189typedef struct BVDB_P_Context   BVDB_P_Context;
190BLST_CQ_HEAD(BVDB_P_Context, BVDB_UsageMode);
191
192typedef enum
193{
194    BVDB_ModeType_eFull = 0,
195    BVDB_ModeType_ePig,
196    BVDB_ModeType_ePip,
197    BVDB_ModeType_eMon,
198    BVDB_ModeType_eMheg_Full_1,
199    BVDB_ModeType_eMheg_Full_2, 
200    BVDB_ModeType_eMheg_Pig_1,
201    BVDB_ModeType_eMheg_Pig_2, 
202    BVDB_ModeType_ePbp, 
203    BVDB_ModeType_eInvalid 
204} BVDB_P_DispModeType;
205
206/* Source groups used in analysis document and these to be used in the
207 * validation functions because this is how sources are grouped for RTS
208 * settings, compression and CAP-SCL order in the analysis */
209typedef enum
210{
211    BVDB_AnalSourceGroup_eRP1080p = 1,
212    BVDB_AnalSourceGroup_eRP1080ps,
213    BVDB_AnalSourceGroup_eRP1080i,
214    BVDB_AnalSourceGroup_eRP720p,
215    BVDB_AnalSourceGroup_eRP576i,
216    BVDB_AnalSourceGroup_eRP480i,
217    BVDB_AnalSourceGroup_eAVC1080ps,
218    BVDB_AnalSourceGroup_eAVC1080i,
219    BVDB_AnalSourceGroup_eAVC720p,
220    BVDB_AnalSourceGroup_eAVC576i,
221    BVDB_AnalSourceGroup_eAVC480i,
222    BVDB_AnalSourceGroup_ePC,
223    BVDB_AnalSourceGroup_ePCHI,
224    BVDB_AnalSourceGroup_ePCLO,
225    BVDB_AnalSourceGroup_eAdcCalibration,
226    BVDB_AnalSourceGroup_eJPEG,
227    BVDB_AnalSourceGroup_eRP1080ps3d,
228    BVDB_AnalSourceGroup_eRP720p3d,
229    BVDB_AnalSourceGroup_eMax = BVDB_AnalSourceGroup_eRP720p3d,
230    BVDB_AnalSourceGroup_eInvalid
231} BVDB_P_AnalSourceGroup;
232
233typedef enum
234{
235    BVDB_AnalDispMode_eFull = 1,
236    BVDB_AnalDispMode_eSFull,
237    BVDB_AnalDispMode_eDot,
238    BVDB_AnalDispMode_ePig,
239    BVDB_AnalDispMode_ePigHi,
240    BVDB_AnalDispMode_ePigLo,
241    BVDB_AnalDispMode_ePbp,
242    BVDB_AnalDispMode_eSPip,
243    BVDB_AnalDispMode_ePip,
244    BVDB_AnalDispMode_eMhg,
245    BVDB_AnalDispMode_eMhgHi,
246    BVDB_AnalDispMode_eMhgLo,
247    BVDB_AnalDispMode_eMon,
248    BVDB_AnalDispMode_eMax = BVDB_AnalDispMode_eMon,
249    BVDB_AnalDispMode_eInvalid
250} BVDB_P_AnalDispMode;
251
252typedef struct
253{
254    uint32_t             ulConfigId;
255    BVDB_Window          eWindow;
256    BVDB_Input           eInput;
257    uint32_t             ulHeapSize;
258    BVDB_Heap_Settings   stHeapSettings;
259} BVDB_P_Config_MemAlloc;
260
261typedef struct 
262{
263    bool                         bEnabled;
264    BVDB_VideoDisplayModeInfo    stVideoDisplayMode;
265} BVDB_P_VideoDisplayMode;
266
267typedef struct
268{
269    uint32_t                     ulConfigId;
270    BVDB_P_VideoDisplayMode      astFullModes[BVDB_P_NUM_FULL_MODES];
271    BVDB_P_VideoDisplayMode      astPigModes[BVDB_P_NUM_PIG_MODES];
272    BVDB_P_VideoDisplayMode      astPipModes[BVDB_P_NUM_PIP_MODES];
273    BVDB_P_VideoDisplayMode      astMonitorModes[BVDB_P_NUM_MON_MODES];
274} BVDB_P_Config_VideoDisplayModes;
275
276/* This structure corresponds to the analysis document */
277typedef struct
278{
279    BVDB_P_AnalDispMode     eAnalDispMode;
280    BVDB_RtsSet             eRtsSet;
281    uint32_t                ulCompression;
282    BVDB_ScalerCaptureBias  eSclCap;
283} BVDB_P_AnalDataPerDispMode;
284
285typedef struct
286{
287    BVDB_P_AnalSourceGroup      eSourceGroup;
288    BVDB_P_AnalDataPerDispMode  analDataPerDispMode[BVDB_AnalDispMode_eMax];
289} BVDB_P_AnalResult;
290
291typedef struct
292{
293    uint32_t              width;
294    uint32_t              height;
295    bool                  bProgressive;
296    uint32_t              frameRate;
297    bool                  b3dSource;
298    BVDB_InputFormatGroup eInputFormatGroup;
299} BVDB_P_NonPcNonStandardFomat;
300
301/* Functions */
302bool BVDB_P_IsSd
303    (BVDB_InputFormatGroup      eInputFormatGroup );
304   
305bool BVDB_P_IsSourceProgressive
306    ( BVDB_InputFormatGroup     eInputFormatGroup );
307
308bool BVDB_P_IsDisplayPrimary
309    (BVDB_DisplayType           eDisplay);
310
311bool BVDB_P_HasOsd
312    ( BVDB_OsdInfo osdInfo );
313
314BERR_Code BVDB_P_GetDisplaySize
315    ( BVDB_OutputResolution     eDispResolution,
316      uint32_t                 *pDispHeight,
317      uint32_t                 *pDispWidth );
318
319uint32_t BVDB_P_GetConfigId
320    ( char                     *pcStr );
321
322BVDB_P_DispModeType BVDB_P_GetVideoDisplayModeType
323    ( BVDB_VideoDisplayMode    *pstVidDispMode );
324
325BERR_Code BVDB_P_GetIputFormatGroupId
326    ( BVDB_InputFormatGroup     eSrcFmt,
327      char                     *pcId );
328
329BERR_Code BVDB_P_CreateId
330    ( BVDB_P_Context           *pVdb,
331      BVDB_UsageMode           *pstUsageMode );
332
333BERR_Code BVDB_P_CreateRts
334    ( BVDB_UsageMode           *pstUsageMode,
335      char                     *acRts );
336
337void BVDB_P_GetInputFormatGroupStr
338    ( BVDB_InputFormatGroup     eInputFmtGrp,
339      char                     *pcStr );
340
341void BVDB_P_GetDisplayTypeStr
342    ( BVDB_DisplayType          eDisplay,
343      char                     *pcStr );
344
345void BVDB_P_GetOutputResolutionStr
346    ( BVDB_OutputResolution    eResolution,
347      char                    *pcStr );
348
349void BVDB_P_GetAspectRatioStr
350    ( BVDB_AspectRatio          eAspectRatio,
351      char                     *pcStr );
352
353void BVDB_P_GetWindowStr
354    ( BVDB_Window               eWin,
355      char                     *pcStr );
356
357void BVDB_P_GetInputStr
358    ( BVDB_Input                eInput,
359      char                     *pcStr );
360
361void BVDB_P_GetVideoDisplayModeStr
362    ( BVDB_VideoDisplayMode    *pstVidDispMode,
363      char                     *pcStr );
364
365void BVDB_P_GetPixelFormatStr
366    ( BVDB_PixelFormat          ePxlFormat,
367      BVDB_State                eState,
368      char                     *pcStr );
369
370void BVDB_P_GetFieldStoreCntStr
371    ( BVDB_DeinterlacerFieldStore           eFieldStore,
372      char                                 *pcStr );
373
374void BVDB_P_GetRtsSetStr
375    ( BVDB_RtsSet               stRtsSet,
376      char                     *pcStr );
377
378void BVDB_P_GetStateStr
379    ( BVDB_State                eState,
380      char                     *pcStr );
381
382void BVDB_P_GetSclCapBiasStr
383    ( BVDB_ScalerCaptureBias  eBias,
384      char                   *pcStr );
385
386BERR_Code BVDB_P_ValidateId
387    ( BVDB_P_Context           *pVdb,
388      BVDB_UsageMode           *pstUsageMode );
389
390BERR_Code BVDB_P_ValidateOsd
391    (  BVDB_UsageMode          *pstUsageMode );
392
393BERR_Code BVDB_P_Validate3dComb
394    (  BVDB_UsageMode          *pstUsageMode );
395   
396BERR_Code BVDB_P_ValidateRtsSet
397    ( BVDB_UsageMode           *pstUsageMode );
398
399BERR_Code BVDB_P_ValidateSclCapBias
400    (  BVDB_UsageMode           *pstUsageMode );
401
402BERR_Code BVDB_P_ValidateOversample
403    (  BVDB_UsageMode          *pstUsageMode );
404
405BERR_Code BVDB_P_ValidateMnrBnr
406    (  BVDB_UsageMode          *pstUsageMode );
407
408BERR_Code BVDB_P_ValidateDcr
409    (  BVDB_UsageMode          *pstUsageMode );
410
411BERR_Code BVDB_P_ValidateAnr
412    (  BVDB_UsageMode          *pstUsageMode );
413
414BERR_Code BVDB_P_ValidateCapVfd
415    (  BVDB_UsageMode          *pstUsageMode );
416
417BERR_Code BVDB_P_ValidateMad
418    (  BVDB_UsageMode          *pstUsageMode );
419
420BERR_Code BVDB_P_ValidateVdbEntry
421    ( BVDB_P_Context           *pVdb,
422      BVDB_UsageMode           *pstUsageMode );
423
424BERR_Code BVDB_P_GetConfigMemAllocArray
425    ( BVDB_P_Config_MemAlloc *pstConfigMemAllocArray );
426
427BERR_Code BVDB_P_GetNumConfigs
428    ( uint32_t               *pulNumConfigs);
429
430BERR_Code BVDB_P_GetVdbEntries
431    ( BVDB_UsageMode         *pVdbEntries );
432
433BERR_Code BVDB_P_GetVdbTableSize
434    ( uint32_t               *pulVdbTableSize );
435
436BERR_Code BVDB_P_GetConfigVideoDisplayModeInfo
437    ( uint32_t                          ulConfigId,
438      BVDB_P_Config_VideoDisplayModes  *pstCfgVidDispModes );
439
440#ifdef __cplusplus
441}
442#endif
443
444#endif /* __BVDB_PRIV_H__ */
Note: See TracBrowser for help on using the repository browser.