1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
|
/********************************************************************
* Copyright(c) 2006-2009 Broadcom Corporation.
*
* Name: bc_dts_defs.h
*
* Description: Common definitions for all components. Only types
* is allowed to be included from this file.
*
* AU
*
* HISTORY:
*
********************************************************************
* This header is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 2.1 of the License.
*
* This header is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this header. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************/
#ifndef _BC_DTS_DEFS_H_
#define _BC_DTS_DEFS_H_
#include <linux/types.h>
/* BIT Mask */
#define BC_BIT(_x) (1 << (_x))
enum BC_STATUS {
BC_STS_SUCCESS = 0,
BC_STS_INV_ARG = 1,
BC_STS_BUSY = 2,
BC_STS_NOT_IMPL = 3,
BC_STS_PGM_QUIT = 4,
BC_STS_NO_ACCESS = 5,
BC_STS_INSUFF_RES = 6,
BC_STS_IO_ERROR = 7,
BC_STS_NO_DATA = 8,
BC_STS_VER_MISMATCH = 9,
BC_STS_TIMEOUT = 10,
BC_STS_FW_CMD_ERR = 11,
BC_STS_DEC_NOT_OPEN = 12,
BC_STS_ERR_USAGE = 13,
BC_STS_IO_USER_ABORT = 14,
BC_STS_IO_XFR_ERROR = 15,
BC_STS_DEC_NOT_STARTED = 16,
BC_STS_FWHEX_NOT_FOUND = 17,
BC_STS_FMT_CHANGE = 18,
BC_STS_HIF_ACCESS = 19,
BC_STS_CMD_CANCELLED = 20,
BC_STS_FW_AUTH_FAILED = 21,
BC_STS_BOOTLOADER_FAILED = 22,
BC_STS_CERT_VERIFY_ERROR = 23,
BC_STS_DEC_EXIST_OPEN = 24,
BC_STS_PENDING = 25,
BC_STS_CLK_NOCHG = 26,
/* Must be the last one.*/
BC_STS_ERROR = -1
};
/*------------------------------------------------------*
* Registry Key Definitions *
*------------------------------------------------------*/
#define BC_REG_KEY_MAIN_PATH "Software\\Broadcom\\MediaPC\\70010"
#define BC_REG_KEY_FWPATH "FirmwareFilePath"
#define BC_REG_KEY_SEC_OPT "DbgOptions"
/*
* Options:
*
* b[5] = Enable RSA KEY in EEPROM Support
* b[6] = Enable Old PIB scheme. (0 = Use PIB with video scheme)
*
* b[12] = Enable send message to NotifyIcon
*
*/
enum BC_SW_OPTIONS {
BC_OPT_DOSER_OUT_ENCRYPT = BC_BIT(3),
BC_OPT_LINK_OUT_ENCRYPT = BC_BIT(29),
};
struct BC_REG_CONFIG {
uint32_t DbgOptions;
};
#if defined(__KERNEL__) || defined(__LINUX_USER__)
#else
/* Align data structures */
#define ALIGN(x) __declspec(align(x))
#endif
/* mode
* b[0]..b[7] = _DtsDeviceOpenMode
* b[8] = Load new FW
* b[9] = Load file play back FW
* b[10] = Disk format (0 for HD DVD and 1 for BLU ray)
* b[11]-b[15] = default output resolution
* b[16] = Skip TX CPB Buffer Check
* b[17] = Adaptive Output Encrypt/Scramble Scheme
* b[18]-b[31] = reserved for future use
*/
/* To allow multiple apps to open the device. */
enum DtsDeviceOpenMode {
DTS_PLAYBACK_MODE = 0,
DTS_DIAG_MODE,
DTS_MONITOR_MODE,
DTS_HWINIT_MODE
};
/* To enable the filter to selectively enable/disable fixes or erratas */
enum DtsDeviceFixMode {
DTS_LOAD_NEW_FW = BC_BIT(8),
DTS_LOAD_FILE_PLAY_FW = BC_BIT(9),
DTS_DISK_FMT_BD = BC_BIT(10),
/* b[11]-b[15] : Default output resolution */
DTS_SKIP_TX_CHK_CPB = BC_BIT(16),
DTS_ADAPTIVE_OUTPUT_PER = BC_BIT(17),
DTS_INTELLIMAP = BC_BIT(18),
/* b[19]-b[21] : select clock frequency */
DTS_PLAYBACK_DROP_RPT_MODE = BC_BIT(22)
};
#define DTS_DFLT_RESOLUTION(x) (x<<11)
#define DTS_DFLT_CLOCK(x) (x<<19)
/* F/W File Version corresponding to S/W Releases */
enum FW_FILE_VER {
/* S/W release: 02.04.02 F/W release 2.12.2.0 */
BC_FW_VER_020402 = ((12<<16) | (2<<8) | (0))
};
/*------------------------------------------------------*
* Stream Types for DtsOpenDecoder() *
*------------------------------------------------------*/
enum DtsOpenDecStreamTypes {
BC_STREAM_TYPE_ES = 0,
BC_STREAM_TYPE_PES = 1,
BC_STREAM_TYPE_TS = 2,
BC_STREAM_TYPE_ES_TSTAMP = 6,
};
/*------------------------------------------------------*
* Video Algorithms for DtsSetVideoParams() *
*------------------------------------------------------*/
enum DtsSetVideoParamsAlgo {
BC_VID_ALGO_H264 = 0,
BC_VID_ALGO_MPEG2 = 1,
BC_VID_ALGO_VC1 = 4,
BC_VID_ALGO_VC1MP = 7,
};
/*------------------------------------------------------*
* MPEG Extension to the PPB *
*------------------------------------------------------*/
#define BC_MPEG_VALID_PANSCAN (1)
struct BC_PIB_EXT_MPEG {
uint32_t valid;
/* Always valid, defaults to picture size if no
* sequence display extension in the stream. */
uint32_t display_horizontal_size;
uint32_t display_vertical_size;
/* MPEG_VALID_PANSCAN
* Offsets are a copy values from the MPEG stream. */
uint32_t offset_count;
int32_t horizontal_offset[3];
int32_t vertical_offset[3];
};
/*------------------------------------------------------*
* H.264 Extension to the PPB *
*------------------------------------------------------*/
/* Bit definitions for 'other.h264.valid' field */
#define H264_VALID_PANSCAN (1)
#define H264_VALID_SPS_CROP (2)
#define H264_VALID_VUI (4)
struct BC_PIB_EXT_H264 {
/* 'valid' specifies which fields (or sets of
* fields) below are valid. If the corresponding
* bit in 'valid' is NOT set then that field(s)
* is (are) not initialized. */
uint32_t valid;
/* H264_VALID_PANSCAN */
uint32_t pan_scan_count;
int32_t pan_scan_left[3];
int32_t pan_scan_right[3];
int32_t pan_scan_top[3];
int32_t pan_scan_bottom[3];
/* H264_VALID_SPS_CROP */
int32_t sps_crop_left;
int32_t sps_crop_right;
int32_t sps_crop_top;
int32_t sps_crop_bottom;
/* H264_VALID_VUI */
uint32_t chroma_top;
uint32_t chroma_bottom;
};
/*------------------------------------------------------*
* VC1 Extension to the PPB *
*------------------------------------------------------*/
#define VC1_VALID_PANSCAN (1)
struct BC_PIB_EXT_VC1 {
uint32_t valid;
/* Always valid, defaults to picture size if no
* sequence display extension in the stream. */
uint32_t display_horizontal_size;
uint32_t display_vertical_size;
/* VC1 pan scan windows */
uint32_t num_panscan_windows;
int32_t ps_horiz_offset[4];
int32_t ps_vert_offset[4];
int32_t ps_width[4];
int32_t ps_height[4];
};
/*------------------------------------------------------*
* Picture Information Block *
*------------------------------------------------------*/
#if defined(__LINUX_USER__)
/* Values for 'pulldown' field. '0' means no pulldown information
* was present for this picture. */
enum {
vdecNoPulldownInfo = 0,
vdecTop = 1,
vdecBottom = 2,
vdecTopBottom = 3,
vdecBottomTop = 4,
vdecTopBottomTop = 5,
vdecBottomTopBottom = 6,
vdecFrame_X2 = 7,
vdecFrame_X3 = 8,
vdecFrame_X1 = 9,
vdecFrame_X4 = 10,
};
/* Values for the 'frame_rate' field. */
enum {
vdecFrameRateUnknown = 0,
vdecFrameRate23_97,
vdecFrameRate24,
vdecFrameRate25,
vdecFrameRate29_97,
vdecFrameRate30,
vdecFrameRate50,
vdecFrameRate59_94,
vdecFrameRate60,
};
/* Values for the 'aspect_ratio' field. */
enum {
vdecAspectRatioUnknown = 0,
vdecAspectRatioSquare,
vdecAspectRatio12_11,
vdecAspectRatio10_11,
vdecAspectRatio16_11,
vdecAspectRatio40_33,
vdecAspectRatio24_11,
vdecAspectRatio20_11,
vdecAspectRatio32_11,
vdecAspectRatio80_33,
vdecAspectRatio18_11,
vdecAspectRatio15_11,
vdecAspectRatio64_33,
vdecAspectRatio160_99,
vdecAspectRatio4_3,
vdecAspectRatio16_9,
vdecAspectRatio221_1,
vdecAspectRatioOther = 255,
};
/* Values for the 'colour_primaries' field. */
enum {
vdecColourPrimariesUnknown = 0,
vdecColourPrimariesBT709,
vdecColourPrimariesUnspecified,
vdecColourPrimariesReserved,
vdecColourPrimariesBT470_2M = 4,
vdecColourPrimariesBT470_2BG,
vdecColourPrimariesSMPTE170M,
vdecColourPrimariesSMPTE240M,
vdecColourPrimariesGenericFilm,
};
/**
* @vdecRESOLUTION_CUSTOM: custom
* @vdecRESOLUTION_480i: 480i
* @vdecRESOLUTION_1080i: 1080i (1920x1080, 60i)
* @vdecRESOLUTION_NTSC: NTSC (720x483, 60i)
* @vdecRESOLUTION_480p: 480p (720x480, 60p)
* @vdecRESOLUTION_720p: 720p (1280x720, 60p)
* @vdecRESOLUTION_PAL1: PAL_1 (720x576, 50i)
* @vdecRESOLUTION_1080i25: 1080i25 (1920x1080, 50i)
* @vdecRESOLUTION_720p50: 720p50 (1280x720, 50p)
* @vdecRESOLUTION_576p: 576p (720x576, 50p)
* @vdecRESOLUTION_1080i29_97: 1080i (1920x1080, 59.94i)
* @vdecRESOLUTION_720p59_94: 720p (1280x720, 59.94p)
* @vdecRESOLUTION_SD_DVD: SD DVD (720x483, 60i)
* @vdecRESOLUTION_480p656: 480p (720x480, 60p),
* output bus width 8 bit, clock 74.25MHz
* @vdecRESOLUTION_1080p23_976: 1080p23_976 (1920x1080, 23.976p)
* @vdecRESOLUTION_720p23_976: 720p23_976 (1280x720p, 23.976p)
* @vdecRESOLUTION_240p29_97: 240p (1440x240, 29.97p )
* @vdecRESOLUTION_240p30: 240p (1440x240, 30p)
* @vdecRESOLUTION_288p25: 288p (1440x288p, 25p)
* @vdecRESOLUTION_1080p29_97: 1080p29_97 (1920x1080, 29.97p)
* @vdecRESOLUTION_1080p30: 1080p30 (1920x1080, 30p)
* @vdecRESOLUTION_1080p24: 1080p24 (1920x1080, 24p)
* @vdecRESOLUTION_1080p25: 1080p25 (1920x1080, 25p)
* @vdecRESOLUTION_720p24: 720p24 (1280x720, 25p)
* @vdecRESOLUTION_720p29_97: 720p29.97 (1280x720, 29.97p)
* @vdecRESOLUTION_480p23_976: 480p23.976 (720*480, 23.976)
* @vdecRESOLUTION_480p29_97: 480p29.976 (720*480, 29.97p)
* @vdecRESOLUTION_576p25: 576p25 (720*576, 25p)
* @vdecRESOLUTION_480p0: 480p (720x480, 0p)
* @vdecRESOLUTION_480i0: 480i (720x480, 0i)
* @vdecRESOLUTION_576p0: 576p (720x576, 0p)
* @vdecRESOLUTION_720p0: 720p (1280x720, 0p)
* @vdecRESOLUTION_1080p0: 1080p (1920x1080, 0p)
* @vdecRESOLUTION_1080i0: 1080i (1920x1080, 0i)
*/
enum {
vdecRESOLUTION_CUSTOM = 0x00000000,
vdecRESOLUTION_480i = 0x00000001,
vdecRESOLUTION_1080i = 0x00000002,
vdecRESOLUTION_NTSC = 0x00000003,
vdecRESOLUTION_480p = 0x00000004,
vdecRESOLUTION_720p = 0x00000005,
vdecRESOLUTION_PAL1 = 0x00000006,
vdecRESOLUTION_1080i25 = 0x00000007,
vdecRESOLUTION_720p50 = 0x00000008,
vdecRESOLUTION_576p = 0x00000009,
vdecRESOLUTION_1080i29_97 = 0x0000000A,
vdecRESOLUTION_720p59_94 = 0x0000000B,
vdecRESOLUTION_SD_DVD = 0x0000000C,
vdecRESOLUTION_480p656 = 0x0000000D,
vdecRESOLUTION_1080p23_976 = 0x0000000E,
vdecRESOLUTION_720p23_976 = 0x0000000F,
vdecRESOLUTION_240p29_97 = 0x00000010,
vdecRESOLUTION_240p30 = 0x00000011,
vdecRESOLUTION_288p25 = 0x00000012,
vdecRESOLUTION_1080p29_97 = 0x00000013,
vdecRESOLUTION_1080p30 = 0x00000014,
vdecRESOLUTION_1080p24 = 0x00000015,
vdecRESOLUTION_1080p25 = 0x0000001
|