source: svn/branches/kctv/newcon3bcm2_21bu/magnum/commonutils/avc/7552/bavc_xpt.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.8 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2011, 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: bavc_xpt.h $
11 * $brcm_Revision: Hydra_Software_Devel/20 $
12 * $brcm_Date: 10/12/11 6:47p $
13 *
14 * Module Description:
15 *   XPT related defines,removed from bavc.h and included in this file
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/commonutils/avc/7425/bavc_xpt.h $
19 *
20 * Hydra_Software_Devel/20   10/12/11 6:47p jtna
21 * SW7422-452: add BAVC_ItbEsType_eVp6Video
22 *
23 * Hydra_Software_Devel/19   6/7/11 2:27p gmullen
24 * SW7425-653: Return STC INC HI and LO registers
25 *
26 * Hydra_Software_Devel/18   2/14/11 1:18p gmullen
27 * SW7420-1459: Force CDB and ITB alignment per decoder requirements
28 *
29 * Hydra_Software_Devel/17   12/7/10 2:17p gmullen
30 * SW7425-15: Updated BAVC_TsMux_DescConfig
31 *
32 * Hydra_Software_Devel/16   12/1/10 7:57a gmullen
33 * SW7425-15: Added TS muxing playback descriptor
34 *
35 * Hydra_Software_Devel/15   10/13/09 11:40a gmullen
36 * SW7405-3199: Added audio descriptor support for other codecs.
37 *
38 * Hydra_Software_Devel/14   9/30/09 9:34a gmullen
39 * SW3548-2188: Added AMR support
40 *
41 * Hydra_Software_Devel/13   6/10/08 8:31a gmullen
42 * PR43467: Added DRA enum.
43 *
44 * Hydra_Software_Devel/12   5/19/08 8:18a gmullen
45 * PR42623: Changed audio descriptor enum to note MPEG audio support.
46 *
47 * Hydra_Software_Devel/11   5/12/08 12:30p gmullen
48 * PR42623: Added audio descriptor suppor
49 *
50 * Hydra_Software_Devel/10   3/25/08 2:20p vsilyaev
51 * PR 39818: Added MKV stream type
52 *
53 * Hydra_Software_Devel/9   1/24/08 11:33a gmullen
54 * PR38907: Added CDB and ITB END registers to BAVC_XptContextMap
55 *
56 * Hydra_Software_Devel/8   1/24/08 11:28a katrep
57 * PR38429: Added ITB types for AVS video and Audio
58 *
59 * Hydra_Software_Devel/7   11/29/07 3:36p gmullen
60 * PR37062: Removed BAVC_ItbEsType_eDvdMpeg2Video.
61 *
62 * Hydra_Software_Devel/6   11/28/07 4:57p gmullen
63 * PR37062: Added BAVC_ItbEsType_eDvdMpeg2Video for 7401 and 7118 only.
64 *
65 * Hydra_Software_Devel/5   10/31/07 4:44p piyushg
66 * PR32599: Add new ITB entry type enums for 7440 graphics and HLI format.
67 * Add new API BXPT_Rave_AddBppChannel to add multiple pid in the same
68 * context without overwriting the previous SCD values.
69 *
70 * Hydra_Software_Devel/4   5/30/07 5:50p shyam
71 * PR 31696 : Remove redundancies in the BAVC_StreamType enum
72 *
73 * Hydra_Software_Devel/3   3/26/07 4:11p katrep
74 * PR29067: Added BAVC_ItbEsType_eMlpAudio itb type
75 *
76 * Hydra_Software_Devel/2   2/13/07 6:26p shyam
77 * PR 27542 : Move some transcoder types into AVC
78 *
79 * Hydra_Software_Devel/1   2/8/07 4:57p katrep
80 * PR25430: Moved the xpt related defines from bavc.h to bavc_xpt.h
81 *
82 *
83 ***************************************************************************/
84
85#ifndef BAVC_XPT_H__
86#define BAVC_XPT_H__
87
88/***************************************************************************
89Summary:
90An enumeration describing the transport (xpt) outputs that feed data to the
91audio and video decoders.
92
93Description:
94Data flows between the transport (xpt) and the audio/video decoders in bands.
95The xpt, audio, and video blocks must be told which bands are carrying data.
96This enumeration is used to specify those bands.
97
98Note:
99Not all BAVC_XptOutputId values may exist for all chips and platforms.
100
101See Also:
102BAVC_XptOutput
103***************************************************************************/
104typedef enum BAVC_XptOutputId
105{
106    BAVC_XptOutputId_eParserBand0 = 0,   /* band 0 */
107    BAVC_XptOutputId_eParserBand1,       /* band 1 */
108    BAVC_XptOutputId_eParserBand2,       /* band 2 */
109    BAVC_XptOutputId_eParserBand3,       /* band 3 */
110    BAVC_XptOutputId_eParserBand4,       /* band 4 */
111
112    BAVC_XptOutputId_eParserBand5,       /* band 5 */
113    BAVC_XptOutputId_eParserBand6,       /* band 6 */
114    BAVC_XptOutputId_eParserBand7,       /* band 7 */
115    BAVC_XptOutputId_eParserBand8,       /* band 8 */
116
117    BAVC_XptOutputId_ePlayback0 = 100,   /* playback 0 */
118    BAVC_XptOutputId_ePlayback1,         /* playback 1 */
119    BAVC_XptOutputId_ePlayback2,         /* playback 2 */
120    BAVC_XptOutputId_ePlayback3          /* playback 3 */
121} BAVC_XptOutputId;
122
123/***************************************************************************
124Summary:
125A structure that is used to communicate the data path between the transport
126and audio/video decoders.
127
128Description:
129Data can be routed from the transport to the audio/video deocers in the
130following ways:
131
132 1. Broadcast source through parser band
133 2. Directly from playback channel
134 3. Playback channel routed through parser band
135
136During playback operation the audio/video decoders must be able to throttle
137the data flow to prevent buffer overflows.  Therefore, the A/V decoders must
138be aware of this routing in order to properly configure themselves.
139
140In order to handle all of the above routes two source values are required.
141This structure is used as the standard method for passing these two values
142to routines.
143
144Example:
145
146// Broadcast decode from parser band 0:
147
148BAVC_XptOutput xptOutput;
149xptOutput.eXptOutputId = BAVC_XptOutputId_eParserBand0;
150xptOutput.eXptSourceId = BAVC_XptOutputId_eParserBand0;
151
152
153// Playback directly from playback channel 0:
154
155BAVC_XptOutput xptOutput;
156xptOutput.eXptOutputId = BAVC_XptOutputId_ePlayback0;
157xptOutput.eXptSourceId = BAVC_XptOutputId_ePlayback0;
158
159
160// Playback from playback channel 0 through pid parser band 2:
161
162BAVC_XptOutput xptOutput;
163xptOutput.eXptOutputId = BAVC_XptOutputId_eParserBand2;
164xptOutput.eXptSourceId = BAVC_XptOutputId_ePlayback0;
165
166
167See Also:
168BAVC_XptOutputId
169***************************************************************************/
170typedef struct BAVC_XptOutput
171{
172    BAVC_XptOutputId   eXptOutputId;     /* input band which is used to
173                                           send data to audio or video
174                                           modules */
175    BAVC_XptOutputId   eXptSourceId;     /* the source id that is sourcing
176                                           eXptOutputId  */
177} BAVC_XptOutput;
178
179/***************************************************************************
180Summary:
181A structure that is used to communicate the data path between the transport
182and audio/video decoders.
183
184Description:
185The data transport will deliver the coded elementary stream data into DRAM
186buffers, whose locations and sizes can be changed by software. This structure
187provides a means of communicating the location of the buffers from the
188transport to the decoders.
189***************************************************************************/
190typedef struct BAVC_XptContextMap
191{
192    uint32_t CDB_Read;      /* Address of the coded data buffer READ register */
193    uint32_t CDB_Base;      /* Address of the coded data buffer BASE register */
194    uint32_t CDB_Wrap;      /* Address of the coded data buffer WRAPAROUND register */
195    uint32_t CDB_Valid;     /* Address of the coded data buffer VALID register */
196    uint32_t CDB_End;           /* Address of the coded data buffer END register */
197
198    uint32_t ITB_Read;      /* Address of the index table buffer READ register */
199    uint32_t ITB_Base;      /* Address of the index table buffer BASE register */
200    uint32_t ITB_Wrap;      /* Address of the index table buffer WRAPAROUND register */
201    uint32_t ITB_Valid;     /* Address of the index table buffer VALID register */
202    uint32_t ITB_End;           /* Address of the index table buffer END register */
203
204    unsigned ContextIdx;        /* Which RAVE context contains the pointers given herein */
205    uint32_t PictureCounter;    /* Address of picture counter reg, 0 if no counter is allocated */
206    uint32_t PicIncDecCtrl;     /* Picture Counter Increment/Decrement/Reset Control Register */
207}
208BAVC_XptContextMap;
209
210/***************************************************************************
211Summary:
212    Defines supported MPEG streaming, packetization or container formats
213
214Description:
215    This enum is used to set strean format in audio and video decoders.
216
217See Also:
218****************************************************************************/
219typedef enum BAVC_StreamType
220{
221    BAVC_StreamType_eTsMpeg,        /* MPEG Transport Stream*/
222    BAVC_StreamType_eDssEs,         /* DSS(DirecTV Transport) ES Stream */
223    BAVC_StreamType_ePes,           /* PES Stream */
224    BAVC_StreamType_eEs,            /* ES Stream */
225    BAVC_StreamType_eBes,           /* BES Stream format */
226    BAVC_StreamType_eDssPes ,       /* DSS(DirecTV Transport) PES (Video HD) Stream */
227    BAVC_StreamType_ePS,            /* Program Stream */
228    BAVC_StreamType_eCms,           /* Compressed multi-stream */
229    BAVC_StreamType_eTsBDRay,       /* Blue Ray Transport Stream*/
230    BAVC_StreamType_eMpeg1System,   /* MPEG-1 system stream */
231    BAVC_StreamType_eAVI,           /* AVI format */
232    BAVC_StreamType_eMPEG4,         /* MP4 (MPEG-4 Part 12 & 14) container format */
233    BAVC_StreamType_eMKV            /* matroska container format */
234}BAVC_StreamType;
235
236/***************************************************************************
237Summary:
238    Defines the supported Index Table types.
239
240Description:
241    This enum is used to set the type of elementary stream that index table
242    entries will be built for. Hardware cannot guess this value.
243
244See Also:
245****************************************************************************/
246typedef enum BAVC_ItbEsType
247{
248    BAVC_ItbEsType_eMpeg2Video = 0,
249    BAVC_ItbEsType_eAvcVideo = 1,
250    BAVC_ItbEsType_eMpegAudio = 2,
251    BAVC_ItbEsType_eAacAudio,
252    BAVC_ItbEsType_eAc3gAudio,
253    BAVC_ItbEsType_eDtsAudio,
254    BAVC_ItbEsType_eLpcmAudio,
255    BAVC_ItbEsType_eVc1Video,
256    BAVC_ItbEsType_eAacHe,
257    BAVC_ItbEsType_eAc3Plus,
258    BAVC_ItbEsType_eWma,
259    BAVC_ItbEsType_eH263,
260    BAVC_ItbEsType_eVC1SimpleMain,
261    BAVC_ItbEsType_eMpeg4Part2,
262    BAVC_ItbEsType_eMpeg1Video,
263    BAVC_ItbEsType_eOTFVideo = 0x0f,
264    BAVC_ItbEsType_eVp6Video,
265    BAVC_ItbEsType_eMpegAudioLayer3,
266    BAVC_ItbEsType_eMpegAudio2_5,
267    BAVC_ItbEsType_eMlpAudio,
268    BAVC_ItbEsType_DVD_Subpicture,
269    BAVC_ItbEsType_DVD_HLI,
270    BAVC_ItbEsType_eAvsVideo,
271    BAVC_ItbEsType_eAvsAudio,
272    BAVC_ItbEsType_eMpegAudioWithDescriptor,
273    BAVC_ItbEsType_eDra,
274    BAVC_ItbEsType_eAmr,
275    BAVC_ItbEsType_eAudioDescriptor     /* Generic AD support for all audio codecs. Replaces BAVC_ItbEsType_eMpegAudioWithDescriptor */
276}       
277BAVC_ItbEsType;
278
279/***************************************************************************
280Summary:
281Transport (XPT) stream IDs.
282
283Description:
284ID for the individual streams in the packet multiplex output from the
285transport block. See BAVC_GetXptId() for more details.
286
287See Also:
288BAVC_GetXptId
289****************************************************************************/
290typedef int BAVC_XptId;
291
292/***************************************************************************
293Summary:
294Map a XPT band to a A/V bus ID.
295
296Description:
297There is a bus between the data transport and the audio and video decoders.
298This bus multiplexes data from all XPT bands into a single packet stream.
299Associated with each packet is an ID. The audio and video decoders use this
300ID field to differentiate the muxed streams. This function provides a mapping
301between the XPT bands and these ID fields.
302
303Returns:
304Stream ID for the given XPT band.
305
306See Also:
307****************************************************************************/
308BAVC_XptId BAVC_GetXptId(
309    BAVC_XptOutputId outputId  /* [in] Transport (xpt) band to map. */
310    );
311
312
313/***************************************************************************
314Summary:
315Defines DRAM buffer requirements.
316
317Description:
318This structure may be used to convey DRAM buffer requirements between
319software modules.
320
321The Alignment member gives the required byte alignment, expressed as the
322power of 2. For example, to require aligment on a 1kB boundary, Alignment
323should be set to 10 (pow( 2, 10 ) = 1024).
324****************************************************************************/
325typedef struct BAVC_BufferConfig
326{
327    size_t Length;          /* Buffer length, expressed in bytes. */
328
329    /* Buffer aligment, in bytes, expressed as a power of 2. For audio and video
330    ** decoders, this value can be overriden by the BXPT rave portinginterface.
331    ** See BXPT_Rave_AllocContext() in bxpt_rave.h
332    */ 
333    unsigned Alignment;     
334
335    bool LittleEndian;      /* Buffer endianess. Little endian if true, Big endian if false. */
336}
337BAVC_BufferConfig;
338
339/***************************************************************************
340Summary:
341Defines DRAM buffer requirements between the transport RAVE and the
342audio/video decoders.
343
344Description:
345The
346****************************************************************************/
347typedef struct BAVC_CdbItbConfig
348{
349    BAVC_BufferConfig Cdb, Itb;
350    bool UsePictureCounter;
351}
352BAVC_CdbItbConfig;
353
354/***************************************************************************
355Summary:
356Define the video modes that have unique ITB/CDB size requirements.
357Description:
358
359Todo:  Move the actual definition of the strucutre here from the decoder
360       private h file.  Need to resolve sharing of this structure
361       between the code bases.
362****************************************************************************/
363#define BAVC_Vmode_Max (10)
364
365/***************************************************************************
366Summary:
367Aggregates the definitions of DRAM buffer requirements between the transport
368RAVE and the video decoder for each of the video modes.
369audio/video decoders.
370
371Description:
372****************************************************************************/
373typedef struct BAVC_ContextSizes
374{
375    uint32_t        a;
376    BAVC_CdbItbConfig modes[BAVC_Vmode_Max];
377    uint32_t        b;
378} BAVC_ContextSizes;
379
380/***************************************************************************
381Summary:
382Values for various flags and muxing parameters in the playback descriptor. 
383****************************************************************************/
384typedef struct BAVC_TsMux_DescConfig
385{
386    unsigned uiNextPacketPacingTimestamp;
387    unsigned uiPacket2PacketTimestampDelta;
388    bool bNextPacketPacingTimestampValid;
389    bool bPacket2PacketTimestampDeltaValid;
390    bool bRandomAccessIndication;
391}
392BAVC_TsMux_DescConfig;
393
394/***************************************************************************
395Summary:
396Address of STC increment registers used by the audio fw during non-realtime
397transcoding. 
398***************************************************************************/
399typedef struct BAVC_StcSoftIncRegisters
400{
401    /* See the RDB for the bitfield layouts */
402    uint32_t StcIncLo;      /* BCHP_XPT_PCROFFSET_STC0_INC_LO */
403    uint32_t StcIncHi;      /* BCHP_XPT_PCROFFSET_STC0_INC_HI */
404    uint32_t IncTrigger;    /* BCHP_XPT_PCROFFSET_STC0_INC_TRIG */
405}
406BAVC_Xpt_StcSoftIncRegisters;
407#endif
Note: See TracBrowser for help on using the repository browser.