source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/xvd/7552/bxvd.h

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

first commit

  • Property svn:executable set to *
File size: 222.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2004-2012, 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: bxvd.h $
11 * $brcm_Revision: Hydra_Software_Devel/283 $
12 * $brcm_Date: 2/27/12 5:14p $
13 *
14 * Module Description:
15 *   See Module Overview below.
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/portinginterface/xvd/7401/bxvd.h $
20 *
21 * Hydra_Software_Devel/283   2/27/12 5:14p davidp
22 * SW7425-1680: Add bEarlyPictureDeliveryMode to BXVD_DecodeSettings, set
23 * appropriate bit in FW channel start command.
24 *
25 * Hydra_Software_Devel/282   1/20/12 3:46p davidp
26 * SW7208-175: Add support for 1920 portrait decode.
27 *
28 * Hydra_Software_Devel/281   11/10/11 2:37p davidp
29 * SW7425-1599: Add bSVCProgressiveOnly flag to BXVD_ChannelSettings.
30 *
31 * Hydra_Software_Devel/280   11/9/11 9:44a btosi
32 * SW7425-1690: fixed enums
33 *
34 * Hydra_Software_Devel/279   10/20/11 4:29p davidp
35 * SW7335-1364: Add bDecodeError to BXVD_StillPictureBuffers, set true if
36 * error occured during still decode.
37 *
38 * Hydra_Software_Devel/278   10/20/11 3:16p rayshap
39 * SW7125-98: Update comments on memory allocation
40 *
41 * Hydra_Software_Devel/277   10/20/11 3:00p davidp
42 * SW7425-1564: Support for SVC interlaced decode.
43 *
44 * Hydra_Software_Devel/276   10/3/11 2:43p btosi
45 * SW7425-1264: support for a SW STC internal to XDM
46 *
47 * Hydra_Software_Devel/275   8/18/11 3:19p btosi
48 * SW7425-966: added support for eLeftRightEnhancedResolution
49 *
50 * Hydra_Software_Devel/274   7/26/11 1:57p davidp
51 * SW7405-5424: Add bIgnoreNumReorderFramesEqZero to BXVD_DecodeSettings
52 * to workaround issue with certain encoded AVC streams.
53 *
54 * Hydra_Software_Devel/273   7/20/11 3:03p davidp
55 * SW7420-2001: Remove bxvd_platform.h include dependency.
56 *
57 * Hydra_Software_Devel/272   6/27/11 4:13p davidp
58 * SW7425-542: Merge devel branch to mainline.
59 *
60 * Hydra_Software_Devel/SW7425-542/1   6/7/11 5:42p davidp
61 * SW7425-542: Add support for 7 STCs.
62 *
63 * Hydra_Software_Devel/271   6/24/11 12:16p rayshap
64 * SW7425-764: Fix BXVD_MONITOR_REFRSH_RATE defines to be compatible with
65 * BFMT
66 *
67 * Hydra_Software_Devel/270   3/21/11 4:48p davidp
68 * SWBLURAY-23744: Add SW Coef AVC Decode channel mode to
69 * BXVD_DecodeSettings and FW ChannelStart command.
70 *
71 * Hydra_Software_Devel/269   2/24/11 4:42p davidp
72 * SW7422-185: Add support for 3D SVC decode in BXVD_StartDecode.
73 *
74 * Hydra_Software_Devel/268   2/17/11 4:10p rayshap
75 * SW7125-98: Update comments on memory allocation
76 *
77 * Hydra_Software_Devel/267   2/15/11 5:32p davidp
78 * SW7422-22: Add support for AVD Boot callback and AVD Reset Callback.
79 *
80 * Hydra_Software_Devel/266   1/25/11 10:40a rayshap
81 * SW7400-2997: Add unsupported temporal direct mode flag
82 *
83 * Hydra_Software_Devel/265   1/11/11 8:08p davidp
84 * SW7400-2992: Add BXVD_GetChannelMemoryConfig, used to determine channel
85 * memory heap sizes.
86 *
87 * Hydra_Software_Devel/264   11/22/10 3:12p btosi
88 * SW7422-72: renamed flag in BXDM_PictureProvider_3DSettings
89 *
90 * Hydra_Software_Devel/263   11/17/10 9:37a btosi
91 * SW7422-72: added new BXVD and XDM 3D API's
92 *
93 * Hydra_Software_Devel/262   10/27/10 5:34p davidp
94 * SW7422-22: Add VICH IL and BL interrupt support, add external boot
95 * callback support.
96 *
97 * Hydra_Software_Devel/261   10/20/10 2:14p davidp
98 * SW7425-16: Remove FGT support.
99 *
100 * Hydra_Software_Devel/260   10/15/10 6:35p davidp
101 * SW7425-16: Add support for base layer ARC, new memory config,
102 * additional FW api memory arguments.
103 *
104 * Hydra_Software_Devel/259   10/1/10 5:55p rayshap
105 * SWDEPRECATED-1003: added support for FrameRateSettings
106 *
107 * Hydra_Software_Devel/258   10/1/10 5:23p rayshap
108 * SWDEPRECATED-1003: added support for FrameRateSettings so labels can
109 * move
110 *
111 * Hydra_Software_Devel/257   10/1/10 2:53p btosi
112 * SWDEPRECATED-1003: added support for bTreatAsSingleElement
113 *
114 * Hydra_Software_Devel/256   9/27/10 12:31p davidp
115 * SW3548-3033: Add bAVCAspectRatioOverrideMode to BXVD_DecodeSettings.
116 *
117 * Hydra_Software_Devel/255   9/15/10 12:06p btosi
118 * SWDEPRECATED-1003: added BXVD_SetFrameRateOverride
119 *
120 * Hydra_Software_Devel/254   8/20/10 1:47p davidp
121 * SWBLURAY-22113: Change name to bExternalPictureProviderMode.
122 *
123 * Hydra_Software_Devel/253   8/19/10 5:57p davidp
124 * SWBLURAY-22113: Add BXVD_DecodeSettings field,
125 * bExternalPictureProviderInUse flag to support DVD app.
126 *
127 * Hydra_Software_Devel/252   8/11/10 2:49p davidp
128 * SW7405-4628: Add STEREO_SEQ_ERROR to AVD status block bit flag
129 * definitions.
130 *
131 * Hydra_Software_Devel/251   8/5/10 8:34a delkert
132 * SW7405-4703: Added BXVD_Set/GetHorizontalOverscanMode and
133 * BXVD_Set/GetHorizontalOverscanMode APIs to allow bypass of horizontal
134 * overscan calcs.
135 *
136 * Hydra_Software_Devel/250   8/3/10 2:03p btosi
137 * SW7400-2870: added BXVD_[Set/Get]PlaybackRate(_isr)
138 *
139 * Hydra_Software_Devel/249   7/21/10 4:30p btosi
140 * SWCHECKFRAME-42: added comment about "bHwPcrOffsetEnable" usage
141 *
142 * Hydra_Software_Devel/248   7/14/10 3:07p davidp
143 * SW7405-4429: Remove channel BXVD_Interrupt_ePictureDataReady1 interrupt
144 * callback.
145 *
146 * Hydra_Software_Devel/247   7/13/10 4:24p davidp
147 * SW7405-4628: Remove seq header callback support, add stereo seq error
148 * callback support.
149 *
150 * Hydra_Software_Devel/246   5/24/10 3:53p btosi
151 * SW7405-4378: Return the unaltered source width and height in the
152 * BXVD_PictureParameterInfo structure.
153 *
154 * Hydra_Software_Devel/245   5/14/10 9:33p delkert
155 * SWCHECKFRAME-42: Restore changes from a previous revision (243) that
156 * were accidentally overwritten
157 *
158 * Hydra_Software_Devel/244   5/14/10 4:15p delkert
159 * SWCHECKFRAME-42: Add missing PPB Parameter info symbols caused by
160 * migration to XDM, and return callback tests to using generic XVD APIs
161 *
162 * Hydra_Software_Devel/243   5/11/10 1:37p btosi
163 * SW7405-4117: added usage note
164 *
165 * Hydra_Software_Devel/242   4/29/10 11:20a btosi
166 * SW7405-4117: added support for ...DisplayFieldMode_eAuto
167 *
168 * Hydra_Software_Devel/241   4/27/10 4:09p davidp
169 * SW7400-2747: Add bPFrameSkipDisable field to decode settings to disable
170 * P frame skip mode.
171 *
172 * Hydra_Software_Devel/240   4/19/10 2:26p rayshap
173 * SW35230-178: Fix names in profiles
174 *
175 * Hydra_Software_Devel/239   4/19/10 2:14p rayshap
176 * SW35230-178: Fix names in profiles
177 *
178 * Hydra_Software_Devel/238   3/29/10 3:41p btosi
179 * SW7405-4051: document how the callbacks are enabled
180 *
181 * Hydra_Software_Devel/237   3/3/10 5:24p davidp
182 * SW7400-2704: Add uiSEIMessagesFlags to BXVD_DecodeSettings.
183 *
184 * Hydra_Software_Devel/236   2/25/10 4:24p nilesh
185 * SW7405-2993: XDM Merge
186 *
187 * Hydra_Software_Devel/235   2/25/10 1:52p btosi
188 * SW3556-1058: added bIgnoreDPBOutputDelaySyntax to the decode settings
189 *
190 * Hydra_Software_Devel/234   2/16/10 11:44a rayshap
191 * SW7405-3924: Clarify timestamp mode
192 *
193 * Hydra_Software_Devel/233   2/5/10 4:10p btosi
194 * SW7405-3137: return the virtual address of BXVD_P_MVC_Offset_Meta
195 *
196 * Hydra_Software_Devel/232   1/11/10 3:24p btosi
197 * SW7550-177: copy the Afd info into the picture parameter struct.
198 *
199 * Hydra_Software_Devel/231   1/8/10 11:50a btosi
200 * SW7405-3137: added support for extension data callback
201 *
202 * Hydra_Software_Devel/230   1/6/10 2:28p btosi
203 * SW7405-3137: merged branch into mainline
204 *
205 * Hydra_Software_Devel/229   12/16/09 4:14p btosi
206 * SW7601-180: added BXVD_MPEGPulldownOverride routines/logic to
207 * conditionally override TB->TBT and BT->BTB
208 *
209 * Hydra_Software_Devel/228   12/14/09 11:27a nilesh
210 * SW7405-3358: Added Jitter Tolerance Improvement (JTI) logic to prevent
211 * cadence issues caused when deltaStcPts is near 0 and STC snapshot is
212 * jittery
213 *
214 * Hydra_Software_Devel/227   11/23/09 5:17p davidp
215 * SW7335-616: Add bIonlyFieldOutputMode to BXVD_DecodeSettings.
216 *
217 * Hydra_Software_Devel/226   11/19/09 5:45p davidp
218 * SW7601-173: Add bAVCErrorConcealmentMode to decode_settings structure,
219 * pass to FW if enabled.
220 *
221 * Hydra_Software_Devel/225   11/11/09 3:35p btosi
222 * SW3556-836: added support for returning the PPB fixed_frame_rate_flag
223 * in the BXVD_PictureParameterInfo structure
224 *
225 * Hydra_Software_Devel/224   11/5/09 4:11p davidp
226 * SW7405-3053: Add support to use IFrame as RAP indicator for AVC in
227 * BXVD_StartDecode settings.
228 *
229 * Hydra_Software_Devel/223   10/13/09 11:22a btosi
230 * SW7405-3005: added "uiDecoderInputOverflow" i.e. reporting of CDB
231 * overflow
232 *
233 * Hydra_Software_Devel/222   10/9/09 10:35a nilesh
234 * SW7405-3085: Added a way to disable forced progressive scanout of
235 * 240i/288i content
236 *
237 * Hydra_Software_Devel/221   10/2/09 4:06p davidp
238 * SW7405-3049: Change default timestamp mode to decoder order.
239 *
240 * Hydra_Software_Devel/220   9/29/09 4:05p davidp
241 * SW7405-3049: Add support for AVC in AVI container files. Add new
242 * eTimestampMode to DecodeSettings.
243 *
244 * Hydra_Software_Devel/219   9/3/09 12:22p davidp
245 * SW7405-2929: Return aspect ratio related data in
246 * BXVD_StillPictureBuffers.
247 *
248 * Hydra_Software_Devel/218   8/28/09 3:07p btosi
249 * SW7405-2940: added BXVD_GetErrorHandlingMode
250 *
251 * Hydra_Software_Devel/217   8/28/09 11:59a btosi
252 * SW7405-2940: added logic to use BXVD_P_PPB_FLAG_DECODE_REF_ERROR
253 *
254 * Hydra_Software_Devel/216   8/27/09 1:40p btosi
255 * SW7405-2940: added BXVD_SetErrorHandlingMode
256 *
257 * Hydra_Software_Devel/215   8/3/09 10:26a rayshap
258 * PR42177: Change comment for ePicDepth interrupts
259 *
260 * Hydra_Software_Devel/214   7/23/09 3:39p nilesh
261 * PR55446: Updated 480p/576p/1080p interlaced scanout override to be
262 * deterministic.  Added BXVD_DecodeSettings.eProgressiveOverrideMode to
263 * control override.
264 *
265 * Hydra_Software_Devel/213   5/26/09 3:34p nilesh
266 * PR52424: Added BXVD_Interrupt_eTSMResult callback and
267 * BXVD_GetPPBParameterQueueInfo() function
268 *
269 * Hydra_Software_Devel/212   5/14/09 4:55p nilesh
270 * PR54254: Added advanced clip support
271 *
272 * Hydra_Software_Devel/211   4/30/09 4:52p nilesh
273 * PR54677: Added BXVD_GetPPBParameterInfo().  Added overscan flags to
274 * BXVD_PPBParameterInfo struct.
275 *
276 * Hydra_Software_Devel/210   4/15/09 9:56a slauzon
277 * PR 54140: Recalculate DM storage when direct_8x8_inference_flag
278 * changes.
279 * No PR: Enhance VC1 error handling; added code to detect false start
280 * code in Simple/Main profile picture parsing; detects false BITPLANE
281 * decode in sliced coded picture.
282 * PR 53861: Populate custom aspect ratio width and height. it was mssing
283 * from vc1
284 * PR 13895: num_ref_frames was being adjusted in the SPS structure so
285 * that parsing a SPS causes the value to be overwritten. There is now a
286 * separate location that contains the adjusted num_ref_frames.
287 * No PR: Enhancing AVDStatus by providing bits to indicate DPB resizing
288 * due to lack of memory and other misc protocol specific errors found
289 * during decode.
290 * No PR: Enhance VC1 error handling; wait for VecGen idle before context
291 * flush. This is to prevent context flush during error stream is
292 * decoded. Also reduce the time out counter to a lower value to prevent
293 * un-wanted IL watchdog timeout.
294 * No PR: Fix B field picture error handling problem. If the abandoned top
295 * field picture is B, FW needed to release the frame storage properly
296 * for dangling field. This is found by running vc1 field error streams
297 * generated by DV team.
298 * PR52906: Latch drop count logic issue. Latch drop count was not copied
299 * from field1 to field2 in case of field pairs.
300 * PR 53769: Quant matrices were not being stored for context swapping.
301 * Added this and now the muti-channel decode with divx works
302 * PR 13706: (DVDPR) Increase PCM allowance from 12.5% to 15.6% to
303 * accomodate yet another BD title that violates bits to bin ratio (Title
304 * name: The Deal)
305 * Release v0.21.3.17 (Brickston VOB label=VDEC_REL_0_21_3_17)
306 *
307 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/1   4/12/09 4:05p ahmad
308 * PR 53861: Populate custom aspect ratio width and height. it was mssing
309 * from vc1
310 *
311 * PR 13895:  num_ref_frames was being adjusted in the SPS structure so
312 * that parsing a SPS causes the value to be overwritten.  There is now a
313 * separate location that contains the adjusted  num_ref_frames.
314 *
315 * No PR: Enhancing AVDStatus by providing bits to indicate DPB resizing
316 * due to lack of memory and other misc protocol specific errors found
317 * during decode.
318 *
319 * No PR: Enhance VC1 error handling; wait for VecGen idle before context
320 * flush. This is to prevent context flush during error stream is
321 * decoded. Also reduce the time out counter to a lower value to prevent
322 * un-wanted IL watchdog timeout.
323 *
324 * No PR: Fix B field picture error handling problem. If the abandoned top
325 * field picture is B, FW needed to release the frame storage properly
326 * for dangling field. This is found by running vc1 field error streams
327 * generated by DV team.
328 *
329 * PR52906: Latch drop count logic issue. Latch drop count was not copied
330 * from field1 to field2 in case of field pairs.
331 *
332 * PR 53769: Quant matrices were not being stored for context swapping.
333 * Added this and now the muti-channel decode with divx works
334 *
335 * PR 13706: (DVDPR) Increase PCM allowance from 12.5% to 15.6% to
336 * accomodate yet another BD title that violates bits to bin ratio (Title
337 * name: The Deal)
338 *
339 * Release v0.21.3.17 (Brickston VOB label=VDEC_REL_0_21_3_17)
340 *
341 * Hydra_Software_Devel/209   4/3/09 2:20p btosi
342 * PR52959: removed BXVD_GetVsyncPlaybackRateDefault
343 *
344 * Hydra_Software_Devel/208   3/31/09 5:29p davidp
345 * PR52344: Add bAVC51Enable flag to channel settings to use more memory
346 * for AVC 5.1 compliant streams.
347 *
348 * Hydra_Software_Devel/207   3/27/09 3:01p btosi
349 * PR52959: added support for programmable playback rate in vsync mode
350 *
351 * Hydra_Software_Devel/206   3/24/09 4:52p nilesh
352 * PR52905: Added ISR versions of most get/set functions.  Cleaned up
353 * formatting.  Removed critical sections for some get functions.
354 *
355 * Hydra_Software_Devel/205   3/12/09 10:58a btosi
356 * PR52950: added "BXVD_SetDisplayFieldMode_isr()"
357 *
358 * Hydra_Software_Devel/204   3/9/09 5:40p davidp
359 * PR52977: Added bBluRayDecode boolean to BXVD_DecodeSettings
360 *
361 * Hydra_Software_Devel/203   3/6/09 2:00p otao
362 * PR46567: A new level for AVC "protocol_level_51" is added in the enum,
363 * bxvd.h is modified accordingly.
364 *
365 * Hydra_Software_Devel/202   2/25/09 11:53a btosi
366 * PR52205: added a comment about BXVD_Interrupt_eDecodeError
367 *
368 * Hydra_Software_Devel/201   2/23/09 3:09p nilesh
369 * PR50462: Added ISR version of BXVD_SetClipTime()
370 *
371 * Hydra_Software_Devel/200   2/23/09 2:40p btosi
372 * PR52205: added BXVD_Interrupt_eDecodeError callback
373 *
374 * Hydra_Software_Devel/199   2/17/09 5:23p nilesh
375 * PR51134: Make bxvd.h compatible with older bfmt.h
376 *
377 * Hydra_Software_Devel/198   2/17/09 4:05p nilesh
378 * PR51134: Added BXVD_DM_P_MonitorRefreshRate_e29_97 constant
379 *
380 * Hydra_Software_Devel/197   2/17/09 3:57p btosi
381 * PR50623: added uiSwPcrOffset and bUseHwPcrOffset to BXVD_PTSInfo
382 *
383 * Hydra_Software_Devel/196   2/12/09 1:58p nilesh
384 * PR52053: Added BXVD_GetDisplayFieldMode_isr() call
385 *
386 * Hydra_Software_Devel/195   2/6/09 12:47p btosi
387 * PR51743: added bStreamProgressive to BXVD_PictureParameterInfo
388 *
389 * Hydra_Software_Devel/194   2/4/09 5:12p rayshap
390 * PR51835: BXVD_GetGopTimeCode should make it obvious when no timecode is
391 * present
392 *
393 * Hydra_Software_Devel/193   1/16/09 1:16p btosi
394 * PR50623: removed BXVD_[Get/Set]STCOffset
395 *
396 * Hydra_Software_Devel/192   1/14/09 3:04p btosi
397 * PR50623: added BXVD_[Set/Get]SwPcrOffset() and
398 * BXVD_[Set/Get]HwPcrOffsetEnable()
399 *
400 * Hydra_Software_Devel/191   1/13/09 3:58p nilesh
401 * PR47456: Added Frame Rate Detection (FRD) logic
402 *
403 * Hydra_Software_Devel/190   1/6/09 10:29a gaurava
404 * PR 45080: Added define for BAD_STREAM where some syntax element in the
405 * stream is incorrect, either t due to encode error or due to
406 * transmission
407 * error.
408 *
409 * Hydra_Software_Devel/189   12/15/08 1:56p rayshap
410 * PR27168: Fix comment on heaps
411 *
412 * Hydra_Software_Devel/188   12/9/08 5:15p davidp
413 * PR50033: Add bZeroDelayOutputMode to decodeSettings to be passed to FW
414 * in ChannelStart command.
415 *
416 * Hydra_Software_Devel/187   12/9/08 10:18a btosi
417 * PR38467: enhanced comment for BXVD_ChannelStatus
418 *
419 * Hydra_Software_Devel/186   11/25/08 1:59p nilesh
420 * PR48726: Added API to tell DM whether to drop fields or frames
421 *
422 * Hydra_Software_Devel/185   11/24/08 4:57p rayshap
423 * PR38467: Ehhnace comments on picture parameters structure
424 *
425 * Hydra_Software_Devel/184   11/21/08 11:49a btosi
426 * PR48843: added in support for uiPicturesReceivedCount
427 *
428 * Hydra_Software_Devel/183   11/18/08 5:05p nilesh
429 * PR47494: Added bNewTagAvailable field to the BXVD_PPB_PictureTag struct
430 * returned in the BXVD_Interrupt_ePPBParameters interrupt
431 *
432 * Hydra_Software_Devel/182   10/28/08 12:29p davidp
433 * PR47278: Add bExcessDirModeEnable BXVD_OpenChannel settings flag to
434 * allocate more direct memory for FW to decode certain non conpliant AVC
435 * streams.
436 *
437 * Hydra_Software_Devel/181   10/20/08 5:19p nilesh
438 * PR47758: Added ui32EffectivePTS to BXVD_PTSInfo struct
439 *
440 * Hydra_Software_Devel/180   10/20/08 11:28a rayshap
441 * PR4797: Add BXVD_GetVdcDeviceInterruptDefaultSettings to bxvd.h
442 *
443 * Hydra_Software_Devel/179   10/17/08 1:26p nilesh
444 * PR47758: Added BXVD_GetDisplayOffset_isr()
445 *
446 * Hydra_Software_Devel/178   10/9/08 11:02a nilesh
447 * PR47494: Merged BXVD_Interrupt_ePPBParameters callback support
448 *
449 * Hydra_Software_Devel/PR47494/2   10/8/08 4:23p nilesh
450 * PR47494: Removed stPCROffset from BXVD_PPBParameterInfo. Added
451 * stPictureType and stError to BXVD_PPBParameterInfo.
452 *
453 * Hydra_Software_Devel/PR47494/1   10/8/08 1:28p nilesh
454 * PR47494: Added BXVD_Interrupt_ePPBParameters callback support
455 *
456 * Hydra_Software_Devel/177   10/6/08 11:51a btosi
457 * PR46567: modified BXVD_ChannelStatus, added BXVD_Protocol_Level and
458 * BXVD_Video_Protocol_Profile
459 *
460 * Hydra_Software_Devel/176   9/17/08 9:20a btosi
461 * PR39962: updated PTSInfo structure
462 *
463 * Hydra_Software_Devel/175   9/9/08 3:14p davidp
464 * PR46566: Add ISR version of
465 * BXVD_SetInterpolationModeForStill/MovingContent.
466 *
467 * Hydra_Software_Devel/174   9/3/08 11:35a btosi
468 * PR39962: updated PTSInfo structure
469 *
470 * Hydra_Software_Devel/173   8/6/08 12:00p rayshap
471 * PR45453: Addd isr version of set display offset
472 *
473 * Hydra_Software_Devel/172   8/5/08 2:22p davidp
474 * PR45080: Add AVD status block support to BXVD_GetChannelStatus.
475 *
476 * Hydra_Software_Devel/171   8/1/08 4:57p davidp
477 * PR43272: Merge PR43272 branch to mainline, new FW memory configuration
478 * API.
479 * Hydra_Software_Devel/PR43272/1   7/17/08 12:35p davidp
480 *
481 * PR43272: Add support for additional FW memory configuration parameters,
482 * Direct mode and IL Work list memory.
483 *
484 * Hydra_Software_Devel/170   7/29/08 3:00p nilesh
485 * PR37222: Added BXVD_GetNextPTS() support
486 *
487 * Hydra_Software_Devel/169   7/29/08 1:32p btosi
488 * PR41123: added support for picture error handling
489 *
490 * Hydra_Software_Devel/168   7/24/08 4:37p nilesh
491 * PR44761: Added 1080p pulldown scan mode support
492 *
493 * Hydra_Software_Devel/167   7/24/08 11:21a btosi
494 * PR38467: finished up pre-roll logic
495 *
496 * Hydra_Software_Devel/166   7/8/08 1:49p btosi
497 * PR38467: added support for PPBReceived callback
498 *
499 * Hydra_Software_Devel/165   7/1/08 4:44p nilesh
500 * PR43585: Update to allow bxvd_dispmgr_dvd.c to compile
501 *
502 * Hydra_Software_Devel/164   7/1/08 1:36p nilesh
503 * PR43585: Merge DVD Development branch to mainline
504 *
505 * Hydra_Software_Devel/PR43585/3   6/23/08 8:32p nilesh
506 * PR43585: Merge from mainline
507 *
508 * Hydra_Software_Devel/163   6/19/08 6:20p davidp
509 * PR43222: Add support for Mpeg4Part2/DivX still picture decode.
510 *
511 * Hydra_Software_Devel/PR43585/2   6/20/08 5:03p nilesh
512 * PR43585: Added initial clip support (eRequestSTC, eClipStart,
513 * eClipStop, and ePictureMarker)
514 *
515 * Hydra_Software_Devel/PR43585/1   6/18/08 12:48p nilesh
516 * PR43585: XVD now compiles with BDVD build
517 *
518 * Hydra_Software_Devel/162   6/12/08 4:47p nilesh
519 * PR43585: Updated multi-decode XVD to compile with 7440
520 *
521 * Hydra_Software_Devel/161   5/28/08 1:49p davidp
522 * PR39004: Add eDefaultFrameRate to BXVD_StartDecode settings.
523 *
524 * Hydra_Software_Devel/160   5/14/08 12:29p davidp
525 * PR21390: Add support for Aegis video instruction checker interrupt and
526 * callback.
527 *
528 * Hydra_Software_Devel/159   4/30/08 5:39p davidp
529 * PR41983: Add HITS mode to decode settings to be passed to FW in
530 * StartDecode command.
531 *
532 * Hydra_Software_Devel/158   4/24/08 1:43p nilesh
533 * PR32273: Rename bIgnorePcrDiscontinuity to
534 * bVsyncModeOnPcrDiscontinuity. Set default to true.
535 *
536 * Hydra_Software_Devel/157   4/11/08 4:51p davidp
537 * PR40234: Merge decoder debug logging from branch.
538 *
539 * Hydra_Software_Devel/PR40234/1   4/10/08 3:34p davidp
540 * PR40234: Add decoder debug log memory size to BXVD_Open BXVD_Settings,
541 * set default size to 0.
542 *
543 * Hydra_Software_Devel/156   3/28/08 12:48p davidp
544 * PR39528: Remove unsupported/unused BXVD_MONITOR_REFRESH_RATE_xxxx
545 * symbolic constants.
546 *
547 * Hydra_Software_Devel/155   3/25/08 12:37p davidp
548 * PR40316: Add BXVD_DecodeStillPictureReset to reset processing still
549 * picture decode after a timeout has occurred.
550 *
551 * Hydra_Software_Devel/154   3/17/08 4:40p davidp
552 * PR40316: Add BXVD_SourceType and BXVD_BufferType data to
553 * BXVD_StillPictureBuffers structure.
554 *
555 * Hydra_Software_Devel/153   3/5/08 4:18p davidp
556 * PR39528: Create new BXVD_MONITOR_REFRESH_RATE_xxxx symbolic contants to
557 * use in addition to BFMT_VERT_xxxx values.
558 *
559 * Hydra_Software_Devel/152   2/26/08 1:19p nilesh
560 * PR31682: Added BXVD_DisplayFieldType_eSingleField enum
561 *
562 * Hydra_Software_Devel/151   2/8/08 6:14p rayshap
563 * PR38467:Enhnace overview in bxvd.h
564 *
565 * Hydra_Software_Devel/150   2/8/08 3:14p davidp
566 * PR38626: Add UseFieldAsFrame flag to BXVD_DeviceVdcInterruptSettings.
567 *
568 * Hydra_Software_Devel/149   1/18/08 5:57p davidp
569 * PR38735: Put uiChainedISR item back in BXVD_DeviceVdcInterruptSettings
570 * to support old and new for a while.
571 *
572 * Hydra_Software_Devel/148   1/17/08 6:06p davidp
573 * PR38735: Create and use BXVD_DeviceVdcIntrSettingsFlags_None.
574 *
575 * Hydra_Software_Devel/147   1/15/08 5:21p davidp
576 * PR38735: Add BXVD_LinkDecoders/UnlinkDecoders and associated data
577 * structures.
578 *
579 * Hydra_Software_Devel/146   11/8/07 10:48a btosi
580 * PR32273: added support bIgnorePcrDiscontinuity
581 *
582 * Hydra_Software_Devel/145   11/6/07 11:41a btosi
583 * PR35408: changed uiDelayFlag to uiLowDelayFlag
584 *
585 * Hydra_Software_Devel/144   11/6/07 10:50a nilesh
586 * PR36735: XVD : Need to add support for Adaptive System Time Management
587 * (ASTM)
588 *
589 * Hydra_Software_Devel/143   11/5/07 11:01a btosi
590 * PR35408: added requested elements to "BXVD_PictureParameterInfo".
591 *
592 * Hydra_Software_Devel/142   10/31/07 11:07a btosi
593 * PR36545: added uiCabacBinDepth to BXVD_ChannelStatus
594 *
595 * Hydra_Software_Devel/141   10/26/07 1:27p nilesh
596 * PR36480: Added bFGTEnable setting in BXVD_Settings to enable/disable
597 * FGT SEI message parsing for a particular decoder
598 *
599 * Hydra_Software_Devel/140   9/28/07 4:12p nilesh
600 * PR27168: Improved BDBG_MSG output for BXVD_Open(), BXVD_OpenChannel(),
601 * and BXVD_StartDecode()
602 *
603 * Hydra_Software_Devel/139   9/21/07 10:33a btosi
604 * PR34980: added uiVsyncCount to BXVD_ChannelStatus
605 *
606 * Hydra_Software_Devel/138   9/18/07 1:35p btosi
607 * PR34979: added "uiDisplayManagerDroppedCount" and
608 * "uiPicturesDecodedCount" to "BXVD_PTSInfo"
609 *
610 * Hydra_Software_Devel/137   8/29/07 1:08p nilesh
611 * PR34430: Added support for channel specific memory heaps
612 *
613 * Hydra_Software_Devel/136   8/22/07 11:49a nilesh
614 * PR34240: Support moving eDisplayInterrupt and uiVDCRectangleNumber
615 * settings from BXVD_ChannelSettings to BXVD_DecodeSettings
616 *
617 * Hydra_Software_Devel/135   8/13/07 4:06p nilesh
618 * PR29915: Multi-decode merge to mainline
619 *
620 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/17   8/10/07 2:49p nilesh
621 * PR29915: Merge from mainline
622 *
623 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/16   8/10/07 1:02p davidp
624 * PR29915: Move VDCRectangleNum from BXVD_StartDecode settings to
625 * BXVD_OpenChannel settings.
626 *
627 * Hydra_Software_Devel/134   7/27/07 12:33p nilesh
628 * PR 4727: TDL_0002 Title 30 Subpicture on - step doesn't always advance
629 * time
630 *
631 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/15   8/8/07 1:17p nilesh
632 * PR29915: Changed BXVD_GetDecodeDefaultSettings() to take an XVD channel
633 * handle instead of an XVD device handle
634 *
635 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/14   7/26/07 4:00p nilesh
636 * PR29915: Add MPEG2 w/o BTP support
637 *
638 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/13   7/25/07 11:40a nilesh
639 * PR29915: Merge from mainline
640 *
641 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/12   7/25/07 5:09p vijeth
642 * PR 32507: XVD : DM in PI : Require to support 7401 style mosaic mode
643 * TSM
644 *
645 * Hydra_Software_Devel/133   7/24/07 9:56a btosi
646 * PR32432: added BXVD_GetChannelStatus_isr()" variant
647 *
648 * Hydra_Software_Devel/132   7/23/07 3:41p rayshap
649 * PR33334: fix name of BXVD_SetPulldownMode
650 *
651 * Hydra_Software_Devel/131   7/19/07 5:24p rayshap
652 * PR 28227: Fix typo in enum
653 *
654 * Hydra_Software_Devel/130   7/19/07 1:33p btosi
655 * PR32432: expanded "BXVD_ChannelStatus" to support the new
656 * "stCurrentDMInfo" data
657 *
658 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/11   7/19/07 2:43p nilesh
659 * PR29915: Cleaned up variable naming style
660 *
661 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/10   7/19/07 8:44p vijeth
662 * PR 32507: XVD : DM in PI : Require to support 7401 style mosaic mode
663 * TSM
664 *
665 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/9   7/3/07 12:08p nilesh
666 * PR29915: Added FGT support
667 *
668 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/8   6/19/07 2:33p nilesh
669 * PR29915: Changed VideoCmprCount -> uiVideoCmprCount to match notation
670 * of other fields in BXVD_ChannelSettings
671 *
672 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/7   6/19/07 12:12p nilesh
673 * PR29915: Merge from mainline.
674 *
675 * Hydra_Software_Devel/129   6/13/07 4:06p nilesh
676 * PR30249: Added dual STC support
677 *
678 * Hydra_Software_Devel/128   6/12/07 12:37p rayshap
679 * PR31988: Add support for enable/disable of 3-2 pulldown
680 *
681 * Hydra_Software_Devel/127   5/30/07 8:14a rayshap
682 * PR31529: Add support for 7411 style bStreamProgressive
683 *
684 * Hydra_Software_Devel/126   5/29/07 9:58a rayshap
685 * PR31593: Add panscan to picture parameters
686 *
687 * Hydra_Software_Devel/125   5/23/07 12:42p nilesh
688 * PR29874: Consolidate TSM threshold code
689 *
690 * Hydra_Software_Devel/124   5/15/07 10:53a nilesh
691 * PR30249: Display interrupt polarity is now returned by GetSTCValue()
692 *
693 * Hydra_Software_Devel/123   5/14/07 5:16p nilesh
694 * PR30249: Changed BXVD_GetSTCValue() to return both the STC value and
695 * polarity
696 *
697 * Hydra_Software_Devel/122   5/14/07 11:30a nilesh
698 * PR30249: Merged UOD 2.x changes to mainline
699 *
700 * Hydra_Software_Devel/121   5/2/07 11:56a nilesh
701 * PR29649: Moved BXVD_EnableInterrupt() prototype outside of
702 * BXVD_ENABLE_DVD_API #ifdef
703 *
704 * Hydra_Software_Devel/120   4/24/07 4:50p rayshap
705 * PR26186: Add better docuementation on DM callbacks
706 *
707 * Hydra_Software_Devel/119   4/11/07 2:35p pblanco
708 * PR29649: Added _isr version of BXVD_EnableInterrupt.
709 *
710 * Hydra_Software_Devel/118   4/11/07 11:03a pblanco
711 * PR29649: Added BXVD_EnableInterrupt prototype and associated enum
712 * BXVD_InterruptEnable.
713 *
714 * Hydra_Software_Devel/117   4/4/07 9:21a pblanco
715 * PR27168: Updated documentation for BXVD_GetPTS and BXVD_GetPTS_isr.
716 *
717 * Hydra_Software_Devel/116   3/20/07 1:48p rayshap
718 * PR 28227: Add first picture preview enumeration
719 *
720 * Hydra_Software_Devel/115   3/20/07 12:09p pblanco
721 * PR28629: Added function prototype and support for BXVD_GetGopTimeCode.
722 *
723 * Hydra_Software_Devel/114   2/27/07 4:31p rayshap
724 * PR28082: Added display size to picture info struct
725 *
726 * Hydra_Software_Devel/113   2/23/07 2:58p rayshap
727 * PR28082: Added data structure for PictureParameter callback
728 *
729 * Hydra_Software_Devel/112   2/23/07 1:46p rayshap
730 * PR28082: Added enumeration for picture parameter callback
731 *
732 * Hydra_Software_Devel/111   2/7/07 1:24p nilesh
733 * PR27373: Added user-settable default frame rate if unknown from stream
734 *
735 * Hydra_Software_Devel/110   1/30/07 8:13a pblanco
736 * PR27168: More review based changes.
737 *
738 * Hydra_Software_Devel/109   1/23/07 2:49p pblanco
739 * PR27168: Added maximum values to all enums that didn't have one.
740 *
741 * Hydra_Software_Devel/108   12/13/06 7:15p davidp
742 * PR25443: Remove deprecated API routines and associated data structures.
743 *
744 * Hydra_Software_Devel/107   12/12/06 2:43p davidp
745 * PR25443: Merge Simplified FW API branch into mainline
746 *
747 * Hydra_Software_Devel/106   12/11/06 2:42p pblanco
748 * PR26433: Added units comment to BXVD_SetDisplayOffset description.
749 *
750 * Hydra_Software_Devel/105   12/6/06 11:38a pblanco
751 * PR26199: Added note to BXVD_SetDiscardThreshold API documenting the
752 * interaction
753 * between it and BXVD_StartDecode.
754 *
755 * Hydra_Software_Devel/104   11/21/06 1:47p davidp
756 * PR25724: Add DM Picture Delivery Count to BXVD_GetChannelStatus.
757 *
758 * Hydra_Software_Devel/103   11/17/06 4:50p nilesh
759 * PR25868: Merged authenticated image support to mainline
760 *
761 * Hydra_Software_Devel/PR25868/1   11/16/06 3:38p nilesh
762 * PR25868: Added authenticated image support
763 *
764 * Hydra_Software_Devel/102   11/14/06 8:17p vijeth
765 * PR 24816: XVD DM in PI : Interpolated PTS, being pre-used, should be
766 * fixed
767 *
768 * Hydra_Software_Devel/101   11/13/06 2:01p nilesh
769 * PR25365: Merged BIMG support to mainline
770 *
771 * Hydra_Software_Devel/PR25365/1   11/10/06 11:04a nilesh
772 * PR25365: Added BIMG support
773 *
774 * Hydra_Software_Devel/100   10/10/06 2:10p davidp
775 * PR19436: Add I-Frame detect interrupt callback enum to be used by DM to
776 * tell app when a I-Frame is detected.
777 *
778 * Hydra_Software_Devel/99   10/9/06 6:28p nilesh
779 * PR23113: Added DVD-specific API calls: SetClipTime() and
780 * [Set/Get]PtsErrorReport[Upper/Lower]Threshold()
781 *
782 * Hydra_Software_Devel/98   9/22/06 2:21p davidp
783 * PR22867: Update FW memory usage table, add secure memory heap support.
784 *
785 * Hydra_Software_Devel/97   9/13/06 6:39p davidp
786 * PR22817: Update CDB/ITB memory usage table, also FW decode mode memory
787 * usage table.
788 *
789 * Hydra_Software_Devel/96   9/12/06 4:26p davidp
790 * PR24126: BXVD_GetPictureTag api added.
791 *
792 * Hydra_Software_Devel/95   7/14/06 1:22p pblanco
793 * PR22638: Changed Get/SetPtsStcDiffThreshold to match 7411 with a long
794 * thresholdargument.
795 *
796 * Hydra_Software_Devel/94   7/13/06 12:47p pblanco
797 * PR22638: Added BXVD_Get/SetPtsStcDiffThreshold prototypes.
798 *
799 * Hydra_Software_Devel/93   6/30/06 11:15a pblanco
800 * PR22398: Added function protoype for BXVD_GetVideoFreezeStatus.
801 *
802 * Hydra_Software_Devel/92   6/29/06 2:21p pblanco
803 * PR22398: Added function prototypes for video freeze/unfreeze.
804 *
805 * Hydra_Software_Devel/91   6/13/06 10:16a pblanco
806 * PR20017: Removed unused BXVD_FillDisplayBuffers function prototype.
807 *
808 * Hydra_Software_Devel/90   5/23/06 8:34a pblanco
809 * PR21472: Enhanced comment for BXVD_SetMonitorRefreshRate so that the
810 * use of the
811 * rate argument is clarified.
812 *
813 * Hydra_Software_Devel/89   5/11/06 6:08p davidp
814 * PR21532: Created new BXVD_[Un]InstallDeviceInterruptCallback to handle
815 * device instance interrupts for DecodeStillPicture and Watchdog.
816 *
817 * Hydra_Software_Devel/88   5/10/06 4:49p davidp
818 * PR20566: Change BXVD_SetSTCInvalidFlag to BXVD_SetSTCInvalid_isr
819 *
820 * Hydra_Software_Devel/87   5/9/06 11:44a pblanco
821 * PR21472: Added Set/Get function prototypes for monitor refresh rate
822 * APIs.
823 *
824 * Hydra_Software_Devel/86   5/1/06 1:51p pblanco
825 * PR21320: Removed definition of
826 * BXVD_ChannelChangeMode_eFirstFrameNewChannel.
827 *
828 * Hydra_Software_Devel/85   4/25/06 4:08p pblanco
829 * PR20649: Added new interrupt for VCI,
830 * BXVD_Interrupt_eVideoInstructionChecker.
831 *
832 * Hydra_Software_Devel/84   4/24/06 2:11p davidp
833 * PR18043: Add support for Sequence Header interrupt processing
834 *
835 * Hydra_Software_Devel/83   4/20/06 1:33p pblanco
836 * PR19284: Removed definition of BXVD_Interrupt_eNewPtsStcOffset.
837 *
838 * Hydra_Software_Devel/82   4/14/06 2:17p davidp
839 * PR19600: Move 7400 AVD FW load address to 62MB
840 *
841 * Hydra_Software_Devel/81   4/12/06 12:49p davidp
842 * PR19600: Move 7401 FW load address to 48mb, also decrease size to 1mb
843 *
844 * Hydra_Software_Devel/80   4/5/06 2:08p pblanco
845 * PR15434: Added RACE endianess enum and corresponding XVD settings
846 * structure member.
847 *
848 * Hydra_Software_Devel/79   4/3/06 10:07a pblanco
849 * PR20566: Added BXVD_<Get/Set>STCInvalidFlag function prototypes.
850 *
851 * Hydra_Software_Devel/78   3/30/06 1:38p pblanco
852 * PR19284: Added definitions to support vsync diff threshold and it's
853 * interrupt.
854 *
855 * Hydra_Software_Devel/77   3/29/06 12:42p vijeth
856 * PR 19284: add BXVD_Interrupt_eNewPtsStcOffset for higher precision
857 * lipsync
858 *
859 * Hydra_Software_Devel/76   3/29/06 10:31a pblanco
860 * PR19877: Changed sequence header structure members to unpacked values.
861 *
862 * Hydra_Software_Devel/75   3/28/06 9:47a pblanco
863 * PR19877: Removed prototypes for unused and deprecated functions.
864 *
865 * Hydra_Software_Devel/74   3/28/06 8:34a pblanco
866 * PR19877: Added new interrupt index BXVD_Interrupt_ePtcStcOffset.
867 *
868 * Hydra_Software_Devel/73   3/27/06 4:21p pblanco
869 * PR19877: Fixed GOP time code structure definition and added sequence
870 * header structure.
871 *
872 * Hydra_Software_Devel/72   3/27/06 3:11p pblanco
873 * PR19877: Removed unused BXVD_VideoParams structure.
874 *
875 * Hydra_Software_Devel/71   3/23/06 2:47p pblanco
876 * PR19877: Cleaned up some structure definitions for DocJet.
877 *
878 * Hydra_Software_Devel/70   3/23/06 1:10p pblanco
879 * PR19877: Added unit comment to BXVD_DisplayThresholds comment. The
880 * values are expressed as 45KHz clock ticks.
881 *
882 * Hydra_Software_Devel/69   3/23/06 8:56a pblanco
883 * PR19877: Added units to known channel state members.
884 *
885 * Hydra_Software_Devel/68   3/21/06 5:18p pblanco
886 * PR20246: Added flag to channel settings to allow context reset to be
887 * disabled.
888 *
889 * Hydra_Software_Devel/67   3/21/06 1:33p pblanco
890 * PR20202: Added ulRemovalDelay member to BXVD_ChannelSettings.
891 *
892 * Hydra_Software_Devel/66   3/10/06 9:36a pblanco
893 * PR20080: Added missing parameter direction tags to prototypes.
894 *
895 * Hydra_Software_Devel/65   3/9/06 4:15p davidp
896 * PR18862: Added BXVD)DisableForFlush and modified functionality of
897 * BXVD_FlushDecode, now a stop/start decode:
898 *
899 * Hydra_Software_Devel/64   3/7/06 11:49a pblanco
900 * PR19785: Changed skip picture enums to a more intuitive semantic.
901 *
902 * Hydra_Software_Devel/63   3/6/06 1:19p pblanco
903 * PR19875: Moved skip modes to their own enum and changed API prototypes
904 * accordingly.
905 *
906 * Hydra_Software_Devel/62   3/6/06 9:27a pblanco
907 * PR19785: Added two decode mode enums to support skip picture mode.
908 *
909 * Hydra_Software_Devel/61   2/28/06 10:31a pblanco
910 * PR19877: Additional structure and code cleanup.
911 *
912 * Hydra_Software_Devel/60   2/27/06 3:33p pblanco
913 * PR19877: Removed redundant structure members.
914 *
915 * Hydra_Software_Devel/59   2/22/06 11:37a pblanco
916 * PR19785: Re-checked in to fix ClearCase 0 length file problem.
917 *
918 * Hydra_Software_Devel/57   2/21/06 1:46p pblanco
919 * PR19785: Implemented BXVD_SetSkipPictureMode API. This also needs FW
920 * support.
921 *
922 * Hydra_Software_Devel/56   2/17/06 3:17p davidp
923 * PR16792: Modify FW API for Still Picture Decode, feature now working:
924 *
925 * Hydra_Software_Devel/55   2/2/06 2:34p pblanco
926 * PR19123: Code and data structure clean up. Benefits both 7401 and 7400.
927 *
928 * Hydra_Software_Devel/54   1/20/06 10:01a pblanco
929 * PR19123: Added decoder instance to settings structure.
930 *
931 * Hydra_Software_Devel/53   1/16/06 1:27p davidp
932 * PR16792: BXVD_Open now uses two heap pointers, one for FW code (2MB)
933 * the other for FW picture buffers.:
934 *
935 * Hydra_Software_Devel/52   12/23/05 6:50p davidp
936 * PR16878: Reset Decoder in Watchdog ISR, add BXVD_Open setting for
937 * watchdog timer value, pass WD info to FW:
938 *
939 * Hydra_Software_Devel/51   12/21/05 5:59p davidp
940 * PR16052: Add Still picture support:
941 *
942 * Hydra_Software_Devel/50   12/15/05 3:21p davidp
943 * PR16052: Add image and striped dimensions to still picture
944 * BXVD_StillPictureBuffers callback structure:
945 *
946 * Hydra_Software_Devel/49   12/14/05 2:57p davidp
947 * PR16052: Rename still picture interrupt callback enum:
948 *
949 * Hydra_Software_Devel/48   12/14/05 2:22p pblanco
950 * PR16052: Added still picture buffer structure and callback function
951 * definition.
952 *
953 * Hydra_Software_Devel/47   12/13/05 2:50p pblanco
954 * PR16052: Removed unused code based on David E's review.
955 *
956 * Hydra_Software_Devel/46   12/9/05 11:10a pblanco
957 * PR16052: Added enums and prototype for still picture decode API.
958 *
959 * Hydra_Software_Devel/45   12/7/05 5:26p davidp
960 * PR16878: Add XVD Watchdog routines:
961 *
962 * Hydra_Software_Devel/44   12/7/05 10:37a pblanco
963 * PR16052: Implemented BXVD_GetDisplayThresholds and
964 * BXVD_SetDiscardThreshold prototypes.
965 *
966 * Hydra_Software_Devel/43   12/2/05 4:07p pblanco
967 * PR16052: Implemented new API prototypes.
968 *
969 * Hydra_Software_Devel/42   12/2/05 12:33p pblanco
970 * PR16052: Cleaned up enums and structures (preliminary pass).
971 *
972 * Hydra_Software_Devel/41   12/2/05 9:57a pblanco
973 * PR16052: Moved BXVD_ReleasePPB to private API.
974 *
975 * Hydra_Software_Devel/40   11/22/05 6:29p davidp
976 * PR17568: Add CrcMode setting to BXVD_StartDecode routine:
977 *
978 * Hydra_Software_Devel/39   11/3/05 3:18p pblanco
979 * PR16052: Added comment to new BXVD_ChannelStatus member.
980 *
981 * Hydra_Software_Devel/38   11/3/05 2:05p pblanco
982 * PR16052: Added DM underflow member to BXVD_ChannelStatus.
983 *
984 * Hydra_Software_Devel/37   10/3/05 1:12p pblanco
985 * PR16052: Added prototype for BXVD_ReleasePPB.
986 *
987 * Hydra_Software_Devel/36   9/30/05 9:39a pblanco
988 * PR17380: Added prototype for BXVD_GetBufferConfig.
989 *
990 * Hydra_Software_Devel/35   9/27/05 11:49a pblanco
991 * PR16052: Added BXVD_GetIPictureFoundStatus prototype.
992 *
993 * Hydra_Software_Devel/34   9/27/05 11:35a pblanco
994 * PR16052: Added function prototypes for BXVD_Get/SetChannelChangeMode.
995 *
996 * Hydra_Software_Devel/33   9/26/05 2:22p pblanco
997 * PR16052: Changed BXVD_DisplayMode enums to the correct type for the new
998 * DM.
999 *
1000 * Hydra_Software_Devel/32   9/21/05 5:44p davidp
1001 * PR16052:  Add additional func parameter to BXVD_CallbackFunc
1002 * definition.:
1003 *
1004 * Hydra_Software_Devel/31   9/19/05 6:43a pblanco
1005 * PR16052: Added prototypes for GetPTS_isr and GetSTC_isr. Also, added
1006 * [in] and [out] parameter tags to functions that didn't have them.
1007 *
1008 * Hydra_Software_Devel/30   9/16/05 1:46p pblanco
1009 * PR16052: Added function prototypes for BXVD_SetSTC and BXVD_GetSTC.
1010 *
1011 * Hydra_Software_Devel/29   9/16/05 8:38a pblanco
1012 * PR16052: Moved decoder functions pause, resume and reset to private
1013 * functions in bxvd_priv.h.
1014 *
1015 * Hydra_Software_Devel/28   9/15/05 3:14p pblanco
1016 * PR16052: Replace an accidentally removed data structure.
1017 *
1018 * Hydra_Software_Devel/27   9/15/05 10:27a pblanco
1019 * PR16052: Clean up comments for DocJet.
1020 *
1021 * Hydra_Software_Devel/25   9/15/05 9:14a pblanco
1022 * PR16052: Removed unused data structures.
1023 *
1024 * Hydra_Software_Devel/24   9/14/05 1:12p pblanco
1025 * PR16052: Changed funtion prototype of BXVD_GetDisplayFieldMode to use a
1026 * pointer to a BXVD_DisplayFieldType.
1027 *
1028 * Hydra_Software_Devel/23   8/24/05 1:09p pblanco
1029 * PR16052: Added function prototype for generic callback.
1030 *
1031 * Hydra_Software_Devel/22   8/23/05 1:45p pblanco
1032 * PR16052: Additional host command support, code cleanup and bug fixes.
1033 *
1034 * Hydra_Software_Devel/21   8/12/05 6:50a pblanco
1035 * PR16052: Temporarily commented out BXVD_GetBufferInfo prototype.
1036 *
1037 * Hydra_Software_Devel/20   8/5/05 12:12p ebrakus
1038 * PR16052: Updated function descriptions
1039 *
1040 * Hydra_Software_Devel/19   8/4/05 3:23p ebrakus
1041 * PR16052: fixed minor compile problem
1042 *
1043 * Hydra_Software_Devel/18   8/4/05 3:18p ebrakus
1044 * PR16052: add support for BufferConfig
1045 *
1046 * Hydra_Software_Devel/17   7/30/05 1:07a ssavekar
1047 * PR 16052: New check-in for XVD
1048 * Modified a few enums for integration with DM.
1049 *
1050 * Hydra_Software_Devel/16   7/26/05 11:32a pblanco
1051 * PR16052: Changed remaining 7411 variable tags to 7401.
1052 *
1053 * Hydra_Software_Devel/15   7/26/05 8:26a pblanco
1054 * PR16052: Removed relative include path for bimg.h
1055 *
1056 * Hydra_Software_Devel/14   7/22/05 11:52a ebrakus
1057 * PR16052: test check in
1058 *
1059 * Hydra_Software_Devel/13   7/22/05 11:35a pblanco
1060 * PR16052: Code cleanup and data structure factoring.
1061 *
1062 * Hydra_Software_Devel/12   7/19/05 3:08p pblanco
1063 * PR16052: Additional development.
1064 *
1065 * Hydra_Software_Devel/11   7/18/05 3:15p pblanco
1066 * PR16052: Additional code development.
1067 *
1068 * Hydra_Software_Devel/10   7/15/05 1:06p pblanco
1069 * PR16052: Clean build with new code and data.
1070 *
1071 * Hydra_Software_Devel/9   7/14/05 10:53a pblanco
1072 * PR16052: Fix compilation errors caused by merge.
1073 *
1074 * Hydra_Software_Devel/8   7/13/05 4:19p pblanco
1075 * PR16052: Formatting and name fixups for merge.
1076 *
1077 * Hydra_Software_Devel/7   7/13/05 2:45p pblanco
1078 * PR16052: Merging with Santosh.
1079 *
1080 * Hydra_Software_Devel/6   7/7/05 8:59a pblanco
1081 * PR16052: Added new interrupt callback typedef
1082 *
1083 * Hydra_Software_Devel/5   7/6/05 1:37p pblanco
1084 * PR16052: Buildable but mostly non-functional version of API. Note that
1085 * bxvd_temp_defs.h will disappear in the near future.
1086 *
1087 * Hydra_Software_Devel/4   6/24/05 9:33a maivu
1088 * PR 15894: Modifications based on feedback from XVD API review on
1089 * 6/23/05.
1090 *
1091 * Hydra_Software_Devel/3   6/21/05 3:30p maivu
1092 * PR 15894: Added
1093 * BXVD_InstallInterruptCallback/BXVD_UninstallInterruptCallback
1094 *
1095 * Hydra_Software_Devel/2   6/21/05 1:03p maivu
1096 * PR 15894: Added BXVD_RegisterVdcInterrupt, and updated public structs
1097 *
1098 * Hydra_Software_Devel/1   6/15/05 11:02a maivu
1099 * PR 15894: Initial revision
1100 *
1101  ***************************************************************************/
1102/*=************************ Module Overview ********************************
1103<verbatim>
1104Overview
1105
1106The XVD (X Video Decoder) API is a library used to control the advanced video
1107decoder on integrated chipsets using the AVD core. It has two primary
1108functions:
1109
1110 - Initialization and control of the AVD core to decode data from the
1111   compressed data buffers.
1112
1113 - Managing picture delivery to VDC for display.  An internal module called
1114   the "display manager" is responsible for TSM and picture delivery.
1115
1116There is a single instance of XVD instantiated per hardware decoder in the
1117system. An instance is created by a call to BXVD_Open that returns a
1118BXVD_Handle.  The BXVD_Handle refers to an opaque structure that is used by
1119other API routines to maintain the state of XVD. An decode channel is created
1120and associated with a decoder instance by a call to BXVD_OpenChannel.  In
1121general, a channel encapsulates the state required to perform a decode.
1122
1123The call to BXVD_OpenChannel will return a BXVD_ChannelHandle which is used in
1124subsequent API calls that operate on a per channel basis which actually
1125constitute the majority of the XVD API for live decode. See the definitions of
1126BXVD_Handle and BXVD_ChannelHandle for a description of which calls use each of
1127these different handles.
1128
1129XVD supports multiple channels to be opened on a single decoder.  While the
1130API supports a maximum of 16 channels, in practice the number of channels
1131will be limited by the size of the decodes being performed.  The XVD API allows
1132flexibility in the creation of channels, so that the number of channels and
1133the amount of memory which channels consume is largely under the control of
1134the application when calling BXVD_ChannelOpen.
1135
1136XVD has the ability to support up to 4 different memory pools when BXVD_Open is
1137called.  Whether all of these pools are required is dependent on the
1138application and the system.  Basic applications running on unified memory
1139systems (UMA) will not have to be concerned with the different memory pools.
1140In addition, the application may specify memory on a per channel basis via
1141BXVD_OpenChannel.
1142
1143The 4 pools of memory XVD uses are 1.) firmware code, 2.) general heap,
11443.) secure or CABAC heap, and 4.) picture heap.  The firmware code heap
1145is only used when the decoder firmware has been relocated off-line to a
1146fixed location.  BXVD_Open accepts a hXvdFmHeap handle to indicate the location
1147of the firmware; the heap must be defined to exactly match the relocated code
1148for all systems before AVD Rev K (7422).  For later systems, the relocation logic
1149has been changed and this retriction does not apply.
1150Notes: a.) the general heap and firmware code heap (if specified) need to be accessible
1151by the host processor. b.) applications need to be aware of the system implications
1152of heap placement.  For example, a particular platfrom may restrict certain AVD
1153clients to a particular memory controller in hardware or via RTS.  Trying to
1154configure XVD without an understanding of these restrictions may result in unpredictable
1155behaviors. c.) The first 2 MB of system address space cannot be accessed by the AVD.
1156
1157If the target system is configured with dedicated picture buffers, then the
1158application is required to create a heap for the picture buffers and provide
1159that heap to XVD.  In unified memory systems, it is permitted to provide a
1160picture buffer heap, but if none is provided XVD will attempt to allocate
1161picture buffers from the general heap.  The heaps are specified at BXVD_Open,
1162in the formal arguement list and in the BXVD_Settings structure.
1163
1164The secure or CABAC heap is only required to be specified when the target
1165system has enhanced security enabled.  Like the picture buffer heap, the
1166application may provide a secure heap, however, it is not recommended to
1167specify a secure heap unless enhanced security is enabled.
1168
1169The general heap is used for context and other storage on a per channel basis.
1170The application must specify a general heap to provide working storage for the
1171firmware.  This heap will also be used when the application has not specified
1172picture or secure heaps.
1173
1174The application is responsible for calculating the sizes of the various heaps
1175and providing those sizes to XVD by filling in the xvdSettings.stFWMemConfig
1176structure at BXVD_Open.  The size of the various members will vary, depending
1177on the kind and number of channels the application will be using and the memory
1178characteristics of the target system.  The sChannelFWMemCfg and sVideoAtomSize
1179structures defined in bxvd_priv.c reflect the memory requirements for currently
1180defined configurations.  XVD will sub-allocate and free the memory provided to
1181BXVD_Open on a LIFO basis when BXVD_OpenChannel and BXVD_CloseChannel are
1182called.
1183
1184It should be noted here that the term channel as used by XVD does not refer
1185to a broadcast program channel, but to a path within XVD that exists from a
1186RAVE (transport controller) context through the decoder. A channel is normally
1187associated with a single VDC (Video Display Controller) source.
1188
1189On many platforms, XVD supports two independent display interrupts to allow
1190for two VDC sources to be assigned for display.  The use of two VDC sources
1191requires the configuration of a complete display path from VDC through XVD.
1192The application is required to install device callbacks for each display
1193interrupt/VDC source being used.  Also, in most cases where two display
1194interrupts are employed, the application will have to associate the appropriate
1195STC with a channel.  The association of display interrupt and STC is made at
1196BXVD_StartDecode.  The the default settings support single display
1197interrupt operation without additional configuration.
1198
1199A fairly simple example of XVD usage is presented here. It will cover the
1200opening, closing and usage of an XVD and XVD channel instance. It is assumed
1201that all necessary calls to other porting interface APIs have been made and
1202all necessary memory has been allocated by a higher level application.
1203Please refer to the individual API call's documentation for more details.
1204
1205void main()
1206{
1207   XVD_Handle hXvd;
1208   BXVD_Settings xvdSettings;
1209   BXVD_ChannelHandle hXvdChannel[NUM_XVD_CHANNELS];
1210   BXVD_ChannelSettings xvdChannelSettings;
1211   BAVC_VideoCompressionStd stVideoCompressionList[NUM_XVD_CHANNELS][1];
1212   BXVD_DecodeSettings xvdDecodeSettings;
1213
1214   BINT_Id  TopInterruptName;
1215   BINT_Id  BotInterruptName;
1216   BINT_Id  ProgressiveInterruptName;
1217
1218   BXVD_DeviceVdcInterruptSettings VDCDevIntrSettings;
1219   BXVD_DeviceInterrupt eXvdDeviceInterrupt;
1220
1221   BXVD_DecodeMode aeDecodeModes[] =
1222   {
1223           BXVD_DecodeMode_eCustom,
1224           BXVD_DecodeMode_eTerminateList
1225   };
1226
1227   ********************************************************************
1228
1229   Open XVD - usage of xvdSettings.stFWMemConfig is discussed above
1230
1231   ********************************************************************
1232
1233   BXVD_GetDefaultSettings(&xvdSettings);
1234   xvdSettings.pDecodeModes = aeDecodeModes;
1235   xvdSettings.stFWMemConfig.uiGeneralHeapSize = WORST_CASE_GENERAL_HEAP_SIZE;
1236   xvdSettings.stFWMemConfig.uiCabacHeapSize = WORST_CASE_CABAC_HEAP_SIZE;
1237   xvdSettings.stFWMemConfig.uiPictureHeapSize = WORST_CASE_PICTURE_HEAP_SIZE;
1238
1239   BXVD_Open(&hXvd,
1240      hChp,
1241      hReg,
1242      NULL,
1243      hMem,
1244      hInt,
1245      &xvdSettings);
1246
1247   ...
1248
1249   ***************************************
1250
1251   Configure callback interface to VDC
1252
1253   ***************************************
1254
1255   BVDC_Source_GetInterruptName(
1256      hVdcSource,
1257      BAVC_Polarity_eTopField,
1258      &TopInterruptName);
1259
1260   BVDC_Source_GetInterruptName(
1261      hVdcSource,
1262      BAVC_Polarity_eBotField,
1263      &BotInterruptName);
1264
1265   BVDC_Source_GetInterruptName(
1266      hVdcSource,
1267      BAVC_Polarity_eFrame,
1268      &ProgressiveInterruptName);
1269
1270   VDCDevIntrSettings.VDCIntId_Topfield = TopInterruptName;
1271   VDCDevIntrSettings.VDCIntId_Botfield = BotInterruptName;
1272   VDCDevIntrSettings.VDCIntId_Frame = ProgressiveInterruptName;
1273
1274   VDCDevIntrSettings.eDisplayInterrupt = BXVD_DisplayInterrupt_eZero;
1275   VDCDevIntrSettings.uiFlags = BXVD_DeviceVdcIntrSettingsFlags_None;
1276
1277   BXVD_RegisterVdcDeviceInterrupt(hXvd,
1278      &VDCDevIntrSettings);
1279
1280   ************************************
1281
1282   Install MPEG data ready callback
1283
1284   ************************************
1285
1286   BXVD_InstallDeviceInterruptCallback(
1287      hCheckXvdInfo->hXvd,
1288      BXVD_DisplayInterrupt_eZero,
1289      BVDC_Source_MpegDataReady_isr,
1290      (void *)hVdcSource,
1291      0);
1292
1293   *********************
1294
1295   Open XVD channels
1296
1297   *********************
1298
1299   for (uiChannelNum = 0; uiChannelNum < NUM_XVD_CHANNELS; uiChannelNum++)
1300   {
1301           BXVD_GetChannelDefaultSettings(hXvd,
1302              uiChannelNum,
1303              &xvdChannelSettings);
1304
1305           * The following code sets up the following channels:
1306           Channel 0: MPEG 2 HD Still
1307           Channel 1: AVC SD Video
1308           Channel 2: AVD HD Video
1309           *
1310           switch(uiChannelNum)
1311           {
1312                   case 0: * MPEG 2 HD Still *
1313                   xvdChannelSettings.eDecodeResolution = BXVD_DecodeResolution_eHD;
1314
1315                   stVideoCompressionList[uiChannelNum][0] = BAVC_VideoCompressionStd_eMPEG2;
1316                   xvdChannelSettings.peVideoCmprStdList = stVideoCompressionList[uiChannelNum];
1317                   xvdChannelSettings.uiVideoCmprCount = 1;
1318
1319                   xvdChannelSettings.eChannelMode = BXVD_ChannelMode_eStill;
1320                   break;
1321
1322                   case 1: * AVC SD Video *
1323                   xvdChannelSettings.eDecodeResolution = BXVD_DecodeResolution_eSD;
1324
1325                   stVideoCompressionList[uiChannelNum][0] = BAVC_VideoCompressionStd_eH264;
1326                   xvdChannelSettings.peVideoCmprStdList = stVideoCompressionList[uiChannelNum];
1327                   xvdChannelSettings.uiVideoCmprCount = 1;
1328
1329                   xvdChannelSettings.eChannelMode = BXVD_ChannelMode_eVideo;
1330                   break;
1331
1332                   case 2: * AVC HD Video *
1333                   xvdChannelSettings.eDecodeResolution = BXVD_DecodeResolution_eHD;
1334
1335                   stVideoCompressionList[uiChannelNum][0] = BAVC_VideoCompressionStd_eH264;
1336                   xvdChannelSettings.peVideoCmprStdList = stVideoCompressionList[uiChannelNum];
1337                   xvdChannelSettings.uiVideoCmprCount = 1;
1338
1339                   xvdChannelSettings.eChannelMode = BXVD_ChannelMode_eVideo;
1340                   break;
1341
1342                   default:
1343                   BDBG_ERR("Error: unsupported channel");
1344                   return;
1345           }
1346
1347           BXVD_OpenChannel(hXvd,
1348              &hXvdChannel[uiChannelNum],
1349              uiChannelNum,
1350              &xvdChannelSettings);
1351   }
1352
1353   * ... *
1354
1355   ****************************************************************
1356
1357   Start decodes Note, RAVE contexts would be acquired from XPT
1358
1359   ****************************************************************
1360
1361   for (uiChannelNum = 0; uiChannelNum < NUM_XVD_CHANNELS; uiChannelNum++)
1362   {
1363           BXVD_GetDecodeDefaultSettings(hXvd, &xvdDecodeSettings);
1364
1365           switch(uiChannelNum)
1366           {
1367                   case 0:
1368                   xvdDecodeSettings.eVideoCmprStd = BAVC_VideoCompressionStd_eMPEG2;
1369                   xvdDecodeSettings.pContextMap = CHANNEL_0_XPT_RAVE_CONTEXT_MAP;
1370                   break;
1371
1372                   case 1:
1373                   xvdDecodeSettings.eVideoCmprStd = BAVC_VideoCompressionStd_eH264;
1374                   xvdDecodeSettings.pContextMap = CHANNEL_1_XPT_RAVE_CONTEXT_MAP;
1375                   break;
1376
1377                   case 1:
1378                   xvdDecodeSettings.eVideoCmprStd = BAVC_VideoCompressionStd_eH264;
1379                   xvdDecodeSettings.pContextMap = CHANNEL_2_XPT_RAVE_CONTEXT_MAP;
1380                   break;
1381
1382                   default:
1383                   BDBG_ERR("Error: unsupported channel");
1384                   return;
1385           }
1386
1387           BXVD_StartDecode(hXvdChannel[uiChannelNum], &xvdDecodeSettings);
1388   }
1389
1390
1391   * ... *
1392
1393}
1394</verbatim>
1395****************************************************************************/
1396#ifndef BXVD_H__
1397#define BXVD_H__
1398
1399#include "bchp.h"          /* Chip information */
1400#include "bmem.h"          /* Chip memory access. */
1401#include "breg_mem.h"      /* Chip register access */
1402#include "bfmt.h"          /* Video timing format */
1403#include "bavc.h"          /* Analog Video Common */
1404#include "bint.h"          /* Interrupt access */
1405#include "bxvd_errors.h"   /* XVD defined errors */
1406#include "bimg.h"          /* FW image interface */
1407#include "btmr.h"          /* Timer access */
1408
1409#include "bxdm_pp.h"
1410#include "bxdm_picture.h"
1411#include "bxdm_dih.h"
1412
1413#if BXVD_P_AVD_ARC600
1414#include "bafl.h"
1415#endif
1416
1417#ifdef __cplusplus
1418extern "C" {
1419#endif
1420
1421/*****************************************************************************
1422Summary:
1423    Main XVD Context Handle. This handle represents a single instance of a
1424 hardware decoder. BXVD_Open returns an initialized BXVD_Handle that is
1425 used in subsequent calls to the API.
1426
1427See also:
1428 BXVD_Open
1429 BXVD_Close
1430 BXVD_GetChannelDefaultSettings
1431 BXVD_ProcessWatchdog
1432 BXVD_OpenChannel
1433 BXVD_GetTotalChannels
1434 BXVD_GetRevision
1435 BXVD_InstallDeviceInterruptCallback
1436 BXVD_UnInstallDeviceInterruptCallback
1437 BXVD_GetBufferConfig
1438*****************************************************************************/
1439typedef struct BXVD_P_Context *BXVD_Handle;
1440
1441/***************************************************************************
1442Summary:
1443    XVD channel handle. The channel handle represents a logical decode path
1444 from RAVE (XPT) through to VDC via the Display Mananger (DM).
1445
1446See also:
1447  BXVD_ChannelOpen
1448  BXVD_ChannelClose
1449  BXVD_StartDecode
1450  BXVD_StopDecode
1451  BXVD_GetChannelStatus
1452  BXVD_DisableForFlush
1453  BXVD_FlushDecode
1454  BXVD_GetDecodeSettings
1455  BXVD_EnableMute
1456  BXVD_SetDisplayOffset
1457  BXVD_GetDisplayOffset
1458  BXVD_SetVideoDisplayMode
1459  BXVD_GetVideoDisplayMode
1460  BXVD_GetPTS_isr
1461  BXVD_GetPTS
1462  BXVD_SetDisplayFieldMode
1463  BXVD_GetDisplayFieldMode
1464  BXVD_RegisterVdcInterrupt
1465  BXVD_InstallInterruptCallbac
1466  BXVD_UnInstallInterruptCallback
1467  BXVD_SetChannelChangeMode
1468  BXVD_GetChannelChangeMode
1469  BXVD_GetIPictureFoundStatus
1470  BXVD_SetTSMPassWindow
1471  BXVD_DisplayUntoPTS
1472  BXVD_PauseUntoPTS
1473  BXVD_SetInterpolationModeForStillContent
1474  BXVD_GetInterpolationModeForStillContent
1475  BXVD_SetInterpolationModeForMovingContent
1476  BXVD_GetInterpolationModeForMovingContent
1477  BXVD_GetLastCodedPTS
1478  BXVD_GetDisplayThresholds
1479  BXVD_SetDiscardThreshold
1480  BXVD_DecodeStillPicture
1481  BXVD_SetSkipPictureModeDecode
1482  BXVD_GetSkipPictureModeConfig
1483  BXVD_SetSTCInvalidFlag_isr
1484  BXVD_GetSTCInvalidFlag
1485  BXVD_SetMonitorRefreshRate
1486  BXVD_GetMonitorRefreshRate
1487  BXVD_EnableVideoFreeze
1488  BXVD_DisableVideoFreeze
1489  BXVD_GetVideoFreezeState
1490  BXVD_SetPtsStcDiffThreshold
1491  BXVD_GetPtsStcDiffThreshold
1492  BXVD_GetPictureTag
1493  BXVD_SetClipTime
1494  BXVD_SetPtsErrorReportLowerThreshold
1495  BXVD_GetPtsErrorReportLowerThreshold
1496  BXVD_SetPtsErrorReportUpperThreshold
1497  BXVD_GetPtsErrorReportUpperThreshold
1498  BXVD_EnableInterrupt
1499
1500**************************************************************************/
1501typedef struct BXVD_P_Channel *BXVD_ChannelHandle;
1502
1503#include "bxvd_userdata.h"
1504
1505/*************************************************************************
1506Summary:
1507 Used to specify the still picture decode mode.
1508
1509See also:
1510 BXVD_DecodeStillPicture.
1511**************************************************************************/
1512typedef enum BXVD_DecodeStillMode
1513{
1514   BXVD_DecodeModeStill_eTerminateList = 0,  /* used to mark the end of list */
1515   BXVD_DecodeModeStill_eAll,
1516   BXVD_DecodeModeStill_eMPEG_SD,
1517   BXVD_DecodeModeStill_eMPEG_HD,
1518   BXVD_DecodeModeStill_eAVC_SD,
1519   BXVD_DecodeModeStill_eAVC_HD,
1520   BXVD_DecodeModeStill_eVC1_SD,
1521   BXVD_DecodeModeStill_eVC1_HD,
1522   BXVD_DecodeModeStill_eMPEG4Part2_SD,
1523   BXVD_DecodeModeStill_eMPEG4Part2_HD,
1524   BXVD_DecodeModeStill_MaxModes
1525} BXVD_DecodeStillMode;
1526
1527/*************************************************************************
1528Summary:
1529 Addresses and other info of buffers used for still picture decode. This is
1530 used in the "Still Picture Ready"  interrupt handler.
1531**************************************************************************/
1532
1533/*
1534 * enums to indicate the still picture Source/BufferType.
1535 *
1536 * The picture can be decoded from a progressive, interlaced or unknown
1537 * source type.
1538 *
1539 *    BXVD_SourceType_eInterlaced  - Source data interlaced
1540 *    BXVD_SourceType_eProgressive - Source data progressive
1541 *    BXVD_SourceType_eUnknown     - Source type not specified
1542 *
1543 * Independent of the SourceType, the BufferType will be frame, field-pair,
1544 * top-field or bottom-field.
1545 *
1546 *    BXVD_BufferType_eFrame     - frame decoded
1547 *    BXVD_BufferType_eFieldPair - both fields decoded
1548 *    BXVD_BufferType_eTopField  - top field only decode
1549 *    BXVD_BufferType_eBotFiel   - bottom field only decode.
1550 */
1551typedef enum BXVD_SourceType
1552{
1553   BXVD_SourceType_eInterlaced = 1,
1554   BXVD_SourceType_eProgressive,
1555   BXVD_SourceType_eUnknown,
1556   BXVD_SourceType_eMax
1557} BXVD_SourceType;
1558
1559typedef enum BXVD_BufferType
1560{
1561   BXVD_BufferType_eFrame = 1,
1562   BXVD_BufferType_eFieldPair,
1563   BXVD_BufferType_eTopField,
1564   BXVD_BufferType_eBotField,
1565   BXVD_BufferType_eMax
1566} BXVD_BufferType;
1567
1568typedef struct BXVD_StillPictureBuffers
1569{
1570   void             *pLumaBuffer;
1571   void             *pChromaBuffer;
1572   unsigned long    ulImageWidth;
1573   unsigned long    ulImageHeight;
1574   unsigned long    ulStripedWidth;
1575   unsigned long    ulLumaStripedHeight;
1576   unsigned long    ulChromaStripedHeight;
1577   BXVD_SourceType  eSourceType;
1578   BXVD_BufferType  eBufferType;
1579   BFMT_AspectRatio eAspectRatio;
1580   uint16_t         uiSampleAspectRatioX;
1581   uint16_t         uiSampleAspectRatioY;
1582   bool             bDecodeError;
1583} BXVD_StillPictureBuffers;
1584
1585#define BXVD_DECODE_MODE_RECT_NUM_INVALID UINT32_C (-1)
1586
1587/***************************************************************************
1588Summary:
1589    Enum used to select the type of decode mode.
1590
1591Description:
1592    Decoder modes used by the app to be used to determine how large the
1593    FW Pictures buffers and CDB/ITB need to be.
1594
1595See also:
1596 BXVD_GetBufferConfig
1597****************************************************************************/
1598typedef enum BXVD_DecodeMode
1599{
1600   BXVD_DecodeMode_eTerminateList = 0,  /* used to mark the end of list */
1601   BXVD_DecodeMode_eAll,
1602   BXVD_DecodeMode_eAVC_HD,
1603   BXVD_DecodeMode_eAVC_SD,
1604   BXVD_DecodeMode_eMPEG2_HD,
1605   BXVD_DecodeMode_eMPEG2_SD,
1606   BXVD_DecodeMode_eVC1_HD,
1607   BXVD_DecodeMode_eVC1_SD,
1608   BXVD_DecodeMode_eStill_HD,
1609   BXVD_DecodeMode_eStill_SD,
1610   BXVD_DecodeMode_eCustom,
1611   BXVD_DecodeMode_eMaxModes
1612} BXVD_DecodeMode;
1613
1614
1615
1616/***************************************************************************
1617Summary:
1618    Enum used to select the size of the picture buffers
1619
1620Description:
1621        Max video decode resolution used by this channel
1622
1623    Decode max resolution used by the channel to determine the size of
1624    FW Pictures buffers
1625
1626See also:
1627****************************************************************************/
1628typedef enum BXVD_DecodeResolution
1629{
1630   BXVD_DecodeResolution_eHD,
1631   BXVD_DecodeResolution_eSD,
1632   BXVD_DecodeResolution_eCIF,
1633   BXVD_DecodeResolution_eQCIF,
1634   BXVD_DecodeResolution_eMaxModes
1635} BXVD_DecodeResolution;
1636
1637
1638/***************************************************************************
1639Summary:
1640    Enum used to select the type of decoder skip mode.
1641
1642Description:
1643    The decoder can be instructed to skip B pictures only or B and P pictures
1644    to effectively achieve a fast forward mode.
1645See Also:
1646    BXVD_SetTrickModeDecode
1647****************************************************************************/
1648typedef enum BXVD_SkipMode
1649{
1650    BXVD_SkipMode_eDecode_I_Only=0,
1651    BXVD_SkipMode_eDecode_IP_Only,
1652    BXVD_SkipMode_eDecode_IPB,
1653    BXVD_SkipMode_eDecode_Ref_Only,
1654    BXVD_SkipMode_eDecode_MaxModes
1655} BXVD_SkipMode;
1656
1657/***************************************************************************
1658Summary:
1659    Enum used to select RAVE endianess
1660
1661Description:
1662    The endianess of the RAVE is specified by setting the eRaveEndianess value
1663  in the BXVD_Settings structure prior to the call to BXVD_Open. The default
1664  value is BXVD_RaveEndianess_eBig.
1665
1666See Also:
1667    BXVD_Settings structure
1668****************************************************************************/
1669typedef enum BXVD_RaveEndianess
1670{
1671    BXVD_RaveEndianess_eBig,
1672    BXVD_RaveEndianess_eLittle,
1673    BXVD_RaveEndianess_eMaxValue
1674} BXVD_RaveEndianess;
1675
1676
1677/***************************************************************************
1678Summary:
1679    Enum used to select timestamp mode.
1680
1681Description:
1682    This is to support AVC in AVI container files. The default is
1683  BXVD_TimestampMode_eDecode.
1684
1685See Also:
1686    BXVD_Settings structure
1687****************************************************************************/
1688
1689typedef enum BXVD_TimestampMode
1690{
1691    BXVD_TimestampMode_eDecode = 0, /* Timestamps are expected in decode order - default use for normal streams */
1692    BXVD_TimestampMode_eDisplay,    /* Timestamps are expected in display order - primarily for AVC in AVI containers */
1693    BXVD_TimestampMode_eMaxModes
1694} BXVD_TimestampMode;
1695
1696
1697/***************************************************************************
1698 Summary:
1699  Enum used to specify AVD core boot mode.
1700
1701 Description:
1702  This enum is used to determine if an AVD core boot is the result of a
1703  "normal" bootup sequence or the result of a watchdog restart.
1704
1705****************************************************************************/
1706typedef enum BXVD_AVDBootMode
1707{
1708    BXVD_AVDBootMode_eNormal = 0,   /* Normal boot */
1709    BXVD_AVDBootMode_eWatchdog,      /* Watchdog reboot */
1710    BXVD_AVDBootMode_eMaxModes
1711} BXVD_AVDBootMode;
1712
1713
1714/***************************************************************************
1715Summary:
1716
1717   Application can specify the memory sizes used by video decoder.
1718***************************************************************************/
1719typedef struct BXVD_FWMemConfig
1720{
1721  uint32_t uiGeneralHeapSize;
1722  uint32_t uiCabacHeapSize;
1723  uint32_t uiPictureHeapSize;
1724} BXVD_FWMemConfig;
1725
1726
1727/***************************************************************************
1728 Summary:
1729  Enum used to specify Display Manager mode.
1730
1731 Description:
1732  This enum is used to specify which flavor of DM that should be used
1733
1734****************************************************************************/
1735typedef enum BXVD_DisplayMgrMode
1736{
1737   BXVD_DisplayMgrMode_eSTB = 0,  /* STB flavor of DM */
1738   BXVD_DisplayMgrMode_eUOD1,     /* UOD 1.x flavor of DM */
1739   BXVD_DisplayMgrMode_eUOD2,     /* UOD 2.x flavor of DM */
1740
1741   BXVD_DisplayMgrMode_eMaxModes
1742} BXVD_DisplayMgrMode;
1743
1744/***************************************************************************
1745 Summary:
1746  Enum used to specify Display Manager pulldown mode.
1747 See also:
1748  BXVD_SetPulldown
1749****************************************************************************/
1750typedef enum BXVD_PulldownMode
1751{
1752   BXVD_PulldownMode_e3to2 = 0,  /* enable 3:2 pulldown */
1753   BXVD_PulldownMode_e2to2,      /* disable 3:2 pulldown */
1754   BXVD_PulldownMode_eMaxPulldownMode
1755} BXVD_PulldownMode;
1756
1757/***************************************************************************
1758 Summary:
1759  Enum used to specify Display Manager picture error handling.
1760****************************************************************************/
1761typedef enum BXVD_Picture_ErrorHandling
1762{
1763   BXVD_ErrorHandling_eOff = 0,     /* display all pictures */
1764   BXVD_ErrorHandling_ePicture,     /* drop pictures if BXVD_P_PPB_FLAG_DECODE_ERROR is set  */
1765   BXVD_ErrorHandling_ePrognostic,   /* ~drop pictures from BXVD_P_PPB_FLAG_DECODE_ERROR to the next RAP */
1766   BXVD_ErrorHandling_eMaxErrorHandling
1767} BXVD_Picture_ErrorHandling;
1768
1769/***************************************************************************
1770 Summary:
1771  Enum used to evaluate the video protocol level.
1772
1773 Description:
1774  The video decoder writes the video protocol level into the PPB structure.
1775  This information is saved by the display manager and can be retrieved
1776  with the BXVD_GetChannelStatus() command.
1777
1778 See also:
1779  BXVD_GetChannelStatus
1780
1781****************************************************************************/
1782typedef enum BXVD_Protocol_Level
1783{
1784   BXVD_Video_Protocol_eLevel_Unknown = 0,
1785   BXVD_Video_Protocol_eLevel_00,
1786   BXVD_Video_Protocol_eLevel_10,
1787   BXVD_Video_Protocol_eLevel_1B,
1788   BXVD_Video_Protocol_eLevel_11,
1789   BXVD_Video_Protocol_eLevel_12,
1790   BXVD_Video_Protocol_eLevel_13,
1791   BXVD_Video_Protocol_eLevel_20,
1792   BXVD_Video_Protocol_eLevel_21,
1793   BXVD_Video_Protocol_eLevel_22,
1794   BXVD_Video_Protocol_eLevel_30,
1795   BXVD_Video_Protocol_eLevel_31,
1796   BXVD_Video_Protocol_eLevel_32,
1797   BXVD_Video_Protocol_eLevel_40,
1798   BXVD_Video_Protocol_eLevel_41,
1799   BXVD_Video_Protocol_eLevel_42,
1800   BXVD_Video_Protocol_eLevel_50,
1801   BXVD_Video_Protocol_eLevel_51,
1802   BXVD_Video_Protocol_eLevel_60,
1803   BXVD_Video_Protocol_eLevel_62,
1804   BXVD_Video_Protocol_eLevel_low,
1805   BXVD_Video_Protocol_eLevel_main,
1806   BXVD_Video_Protocol_eLevel_high,
1807   BXVD_Video_Protocol_eLevel_high1440,
1808   BXVD_Video_Protocol_eLevel_MaxLevel
1809
1810} BXVD_Video_Protocol_Level;
1811
1812/***************************************************************************
1813 Summary:
1814  Enum used to evaluate the video profile.
1815
1816 Description:
1817  The video decoder writes the video profile into the PPB structure.
1818  This information is saved by the display manager and can be retrieved
1819  with the BXVD_GetChannelStatus() command.
1820
1821 See also:
1822  BXVD_GetChannelStatus
1823
1824****************************************************************************/
1825typedef enum BXVD_Video_Protocol_Profile
1826{
1827   BXVD_Video_Protocol_eProfile_Unknown = 0,
1828   BXVD_Video_Protocol_eProfile_Simple,
1829   BXVD_Video_Protocol_eProfile_Main,
1830   BXVD_Video_Protocol_eProfile_High,
1831   BXVD_Video_Protocol_eProfile_Advanced,
1832   BXVD_Video_Protocol_eProfile_Jizhun,
1833   BXVD_Video_Protocol_eProfile_SnrScalable,
1834   BXVD_Video_Protocol_eProfile_SpatiallyScalable,
1835   BXVD_Video_Protocol_eProfile_AdvancedSimple,
1836   BXVD_Video_Protocol_eProfile_Baseline,
1837   BXVD_Video_Protocol_eProfile_MaxProfile
1838
1839} BXVD_Video_Protocol_Profile;
1840
1841
1842/***************************************************************************
1843 Summary:
1844  Enum used to set XVD DM's picture drop mode
1845
1846 Description:
1847  DM may need to drop pictures in order to perform rate matching.  DM
1848  can be set into a field-drop or frame-drop mode with the
1849  BXVD_SetPictureDropMode() command and/or in
1850  BXVD_DecodeSettings.ePictureDropMode
1851
1852 See also:
1853  BXVD_SetPictureDropMode
1854
1855****************************************************************************/
1856typedef enum BXVD_PictureDropMode
1857{
1858   BXVD_PictureDropMode_eField,
1859   BXVD_PictureDropMode_eFrame,
1860
1861   /* Add more enums ABOVE this line */
1862   BXVD_PictureDropMode_eMax
1863} BXVD_PictureDropMode;
1864
1865/***************************************************************************
1866Summary:
1867  Enum used to set XVD DM's Horizontal Overscan mode
1868
1869 Description:
1870  it may be desired to change the default behavior of the Horizontal Overscan
1871  calculations within the DM.  Thus the DM can be configured to bypass the
1872  Horizonal Overscan calculation using the BXVD_SetHorizontalOverscanMode()
1873  command.
1874  Default behavior is specified by eAuto.
1875
1876 See also:
1877  BXVD_SetHorizontalOverscanMode
1878
1879****************************************************************************/
1880typedef enum BXVD_HorizontalOverscanMode
1881{
1882   BXVD_HorizontalOverscanMode_eAuto,
1883   BXVD_HorizontalOverscanMode_eDisable,
1884
1885   /* Add more enums ABOVE this line */
1886   BXVD_HorizontalOverscanMode_eMax
1887} BXVD_HorizontalOverscanMode;
1888
1889/***************************************************************************
1890Summary:
1891    XVD settings used in BXVD_Open
1892
1893NOTE:
1894The following members are deprecated and should not be used in new code:
1895
1896   bSelfTest
1897   hTimerDev
1898   ulWatchdogTimeValue;
1899
1900See also:
1901 BXVD_Open
1902 BXVD_GetDefaultSettings
1903***************************************************************************/
1904typedef struct BXVD_Settings
1905{
1906      bool               bSelfTest;           /* Depreciated - run internal FW memory diagnostic */
1907      BTMR_Handle        hTimerDev;           /* Depreciated - Temporary watchdog timer */
1908      unsigned long      ulWatchdogTimeValue; /* Depreciated  - Watchdog timeout value */
1909      BXVD_DecodeMode    *pDecodeModes;       /* List of Decode modes being used */
1910      unsigned int       uiAVDInstance;       /* Decoder instance. Always 0 for 7401 and single decoder systems  */
1911      BXVD_RaveEndianess eRaveEndianess;      /* RAVE endianess. Default is big */
1912      BMEM_Handle        hFrmMemory;          /* General memory heap handle - needs host access/mapping */
1913      BMEM_Handle        hSecureMemory;       /* Secure memory heap handle */
1914
1915      /* Add BIMG Interface support */
1916
1917      /* Interface to access firmware image. This interface must be
1918       * implemented and the function pointers must be stored here.
1919       */
1920      const BIMG_Interface *pImgInterface;
1921
1922      /* Context for the Image Interface. This is also provided by
1923       * the implementation of the Image interface
1924       */
1925      void **pImgContext;
1926
1927      /* Add Authenticated image support */
1928
1929      /* Pointer to the AVD boot callback function. If non-NULL,
1930       * XVD will call this function after the firmware has been
1931       * loaded into memory instead of booting the AVD. If this
1932       * function is NULL, then the XVD will boot the AVD
1933       * normally. This function should return BERR_SUCCESS if
1934       * successful.
1935       */
1936
1937#if BXVD_P_AVD_ARC600
1938      BERR_Code (*pAVDBootCallback)(void* pPrivateData,
1939                                    BAFL_BootInfo *pstAVDBootInfo);
1940#else
1941      BERR_Code (*pAVDBootCallback)(void* pPrivateData,
1942                                    BXVD_AVDBootMode eAVDBootMode);
1943#endif
1944
1945      /* Pointer to AVD boot callback private data that is passed
1946       * back into the callback. Can be used to store any
1947       * information necessary for the application to boot the
1948       * core.
1949       */
1950      void *pAVDBootCallbackData;
1951
1952      /* Pointer to the AVD reset callback function. If non-NULL,
1953       * XVD will call this function in the chip reset routine.
1954       * If this function is NULL, then the XVD will reset the AVD
1955       * normally. This function should return BERR_SUCCESS if
1956       * successful.
1957       */
1958      BERR_Code (*pAVDResetCallback)(void* pPrivateData);
1959
1960      /* Pointer to AVD reset callback private data that is passed
1961       * back into the callback. Can be used to store any
1962       * information necessary for the application to reset the
1963       * core.
1964       */
1965      void *pAVDResetCallbackData;
1966
1967      /* PR30249: Add UOD2 support */
1968      /* The following configuration flag specifies the DM mode to be
1969       * used */
1970      BXVD_DisplayMgrMode eDisplayMgrMode;
1971
1972      BXVD_FWMemConfig stFWMemConfig; /* Custom FW video memory configuration */
1973
1974      /* Size of Decoder debug logging buffer */
1975      uint32_t  uiDecoderDebugLogBufferSize;
1976
1977      bool bInterLayerBandwidthOptimized; 
1978} BXVD_Settings;
1979
1980/**************************************************************************
1981Summary:
1982  Used to specify 7401 still content interpolation mode
1983****************************************************************************/
1984typedef enum BXVD_StillContentInterpolationMode
1985{
1986  BXVD_StillContentInterpolationMode_eDefault, /* This is the default state wherein XVD is instructed to use the correct display reccomendations */
1987  BXVD_StillContentInterpolationMode_eSingleField,/* Last Valid Field Display on Pause */
1988  BXVD_StillContentInterpolationMode_eBothField,/* Both Field Display on Pause */
1989  BXVD_StillContentInterpolationMode_eFrame, /* Frame Display (conditional) on Pause */
1990  BXVD_StillContentInterpolationMode_eMaxModes
1991} BXVD_StillContentInterpolationMode;
1992
1993/**************************************************************************
1994Summary:
1995  Used to specify 7401 moving content interpolation mode
1996****************************************************************************/
1997typedef enum BXVD_MovingContentInterpolationMode
1998{
1999  BXVD_MovingContentInterpolationMode_eDefault,
2000  BXVD_MovingContentInterpolationMode_eInterlacedScanout,
2001  BXVD_MovingContentInterpolationMode_eProgressiveScanout,
2002  BXVD_MovingContentInterpolationMode_eMaxModes
2003} BXVD_MovingContentInterpolationMode;
2004
2005
2006/**************************************************************************
2007Summary:
2008  Used to specify the channel change mode. This instructs the display
2009  manager to either mute video during a channel change or to display
2010  the last frame of the previous channel.
2011
2012  FirstPicturePreview allows for the first picture of the new channel
2013  to be displayed as soon as it is available, while TSM lock is in
2014  the process of being acquired.  The first picture will remain on
2015  screen until display can continue with TSM, if TSM is enabled.
2016****************************************************************************/
2017typedef enum BXVD_ChannelChangeMode
2018{
2019  BXVD_ChannelChangeMode_eMute,                                /* Mute on Channel change */
2020  BXVD_ChannelChangeMode_eLastFramePreviousChannel,            /* Display last frame of previous channel */
2021  BXVD_ChannelChangeMode_eMuteWithFirstPicturePreview,         /* Mute until first picture of new channel */
2022  BXVD_ChannelChangeMode_eLastFramePreviousWithFirstPicturePreview, /* Show last picture until first picture of new channel */
2023  BXVD_ChannelChangeMode_eMaxModes
2024} BXVD_ChannelChangeMode;
2025
2026/**************************************************************************
2027Summary:
2028  Used to specify the PTS type
2029****************************************************************************/
2030
2031#define BXVD_PTSType BXDM_PictureProvider_PTSType
2032
2033#define BXVD_PTSType_eCoded                        BXDM_PictureProvider_PTSType_eCoded
2034#define BXVD_PTSType_eInterpolatedFromValidPTS     BXDM_PictureProvider_PTSType_eInterpolatedFromValidPTS
2035#define BXVD_PTSType_eHostProgrammedPTS            BXDM_PictureProvider_PTSType_eHostProgrammedPTS_Deprecated
2036#define BXVD_PTSType_eInterpolatedFromInvalidPTS   BXDM_PictureProvider_PTSType_eInterpolatedFromInvalidPTS
2037#define BXVD_PTSType_eMaxPTSType                   BXDM_PictureProvider_PTSType_eMax
2038
2039
2040/**************************************************************************
2041Summary:
2042  Used to specify a display interrupt number from the video display.
2043  Depening on the platform, each AVD may get multiple display
2044  interrupts.
2045****************************************************************************/
2046typedef enum BXVD_DisplayInterrupt
2047{
2048   BXVD_DisplayInterrupt_eZero,
2049   BXVD_DisplayInterrupt_eOne,
2050
2051   BXVD_DisplayInterrupt_eMax
2052} BXVD_DisplayInterrupt;
2053
2054/**************************************************************************
2055Summary:
2056  Used to specify an STC number. On a display interrupt, the AVD core
2057  may snapshot multiple STC counters. Not all platforms support eight STCs
2058****************************************************************************/
2059typedef enum BXVD_STC
2060{
2061   BXVD_STC_eZero,
2062   BXVD_STC_eOne,
2063   BXVD_STC_eTwo,
2064   BXVD_STC_eThree,
2065   BXVD_STC_eFour,
2066   BXVD_STC_eFive,
2067   BXVD_STC_eSix,
2068   BXVD_STC_eSeven,
2069
2070   BXVD_STC_eMax
2071} BXVD_STC;
2072
2073typedef struct BXVD_STCInfo
2074{
2075      uint32_t ui32STCValue;
2076      BAVC_Polarity eInterruptPolarity;
2077} BXVD_STCInfo;
2078
2079typedef enum BXVD_HITSMode
2080{
2081   BXVD_HITSMode_eDisabled,  /* Off, default */
2082   BXVD_HITSMode_eLegacy,    /* HITS enabled without progressive/banded display */
2083   BXVD_HITSMode_eClean      /* Clean HITS mode builds the display progressively */
2084} BXVD_HITSMode;
2085
2086/*
2087 * Summary: Enum for Video Instruction Checker Interrupts
2088 */
2089
2090typedef enum BXVD_VICHInt
2091{
2092   BXVD_VICHInt_eRegAccess,  /* Register access address violation */
2093   BXVD_VICHInt_eSCBWrite,   /* SCB write address violation */
2094   BXVD_VICHInt_eInstrRead   /* instruction read address violation */
2095} BXVD_VICHInt;
2096
2097/**************************************************************************
2098Summary:
2099  7401 device interrupts.
2100
2101Description:
2102  These interrupts are for the XVD device, they are not for channel specific
2103  interrupts.
2104
2105   BXVD_Interrupt_eVideoInstructionChecker:
2106     This callback is triggered when one of the Video Instruction Checker Interrupts occur.
2107
2108     The parameter passed by this callback is the BXVD_VICHInt enum to indicate which
2109     VICH interrupt occured.
2110
2111****************************************************************************/
2112typedef enum BXVD_DeviceInterrupt
2113{
2114   BXVD_DeviceInterrupt_eWatchdog,                /* Video Decoder WatchDog Interrupt */
2115   BXVD_DeviceInterrupt_eDecodedStillBufferReady, /* Decoded Buffer Ready interrupt for Still picture mode */
2116   BXVD_DeviceInterrupt_eDisplayInterrupt0,       /* Display Interrupt number 0 (from source feeder) */
2117   BXVD_DeviceInterrupt_eDisplayInterrupt1,       /* Display Interrupt number 1 (from source feeder) */
2118
2119   BXVD_DeviceInterrupt_ePictureDataReady0,       /* Picture Data Ready Interrupt 0 */
2120   BXVD_DeviceInterrupt_ePictureDataReady1,       /* Picture Data Ready Interrupt 1 */
2121   BXVD_DeviceInterrupt_eVidInstrChecker,         /* Video Instruction Checker */
2122   BXVD_DeviceInterrupt_eStereoSeqError,          /* Stereo Sequence Error */
2123   BXVD_DeviceInterrupt_eMaxInterrupts            /* Not a Real interrupt just the max no of XVD Device interrupts */
2124} BXVD_DeviceInterrupt;
2125
2126/**************************************************************************
2127Summary:
2128  7401 channel interrupts.
2129
2130Description:
2131  These interrupts are for the XVD channel events. The events that occur are
2132  handled on a per channel basis.
2133
2134NOTE:
2135  As interrupts are added to or removed from this list, the corresponding
2136  entries in BXVD_EnableInterrupt's case statement should be maintained
2137  accordingly. Note that not all interrupts can be disabled or enabled via
2138  the BXVD_EnableInterrupt API.
2139
2140  Information on specific callbacks
2141
2142  BXVD_Interrupt_ePtsStcOffset:
2143     This callback is triggered when the difference between the STC and the running PTS is greater than
2144     the uiVsyncDiffThreshDefault value specified at BXVD_OpenChannel.  The threshold need to be programmed
2145     appropriately taking the clock domain of MPEG or legacy clock domains into consideration.  The
2146     callback is not generated if the BXVD_DisplayMode is BXVD_DisplayMode_eVSYNCMode.
2147
2148     The parameter passed by this callback is the PTS to PCR difference.  This value is always positive.
2149
2150  BXVD_Interrupt_eFirstPTSReady:
2151     This callback is triggered by either of two events: when the first picture
2152     is delivered from the decoder to the display manager or when the display manager
2153     sees the first picture with a "coded PTS", that is, a PTS directly encoded for the
2154     picture being evaluated by the display manager.  If both these triggers occur on
2155     the same vsync interrupt, then the callback will only be made once.  If these
2156     triggers occur on different interrupts than the callback will be made twice.
2157     BXVD_Interrupt_eFirstPTSReady always gets generated for the very first picture
2158     even if STCInvalid is set, the first picture fails to qualify for display, and regardless
2159     of the BXVD_DisplayMode setting.
2160
2161     The parameter passed by this callback is the BXVD_PTSInfo structure.
2162
2163   BXVD_Interrupt_eFirstPTSPassed:
2164     This is callback is triggered when a picture with either coded PTS or interpolated
2165     from valid PTS, matures (i.e. passes TSM and parity check) for display, for the
2166     first time.  The callback is not generated if the BXVD_DisplayMode is BXVD_DisplayMode_eVSYNCMode.
2167
2168     The parameter passed by this callback is the BXVD_PTSInfo structure.
2169
2170  BXVD_Interrupt_ePTSError:
2171     This callback is triggered when the display manager detects a PTS error.  If either
2172     the picture is too early for display or too late for display, time stamp management
2173     will fail and this callback is invoked. Typically this callback is invoked to denote
2174     that there is some error in the PTS of the picture or the STC is not matching the PTS.
2175     The callback is not generated if the BXVD_DisplayMode is BXVD_DisplayMode_eVSYNCMode.
2176
2177     The parameter passed by this callback is the BXVD_PTSInfo structure.
2178
2179  BXVD_Interrupt_ePauseUntoPTS:
2180     This callback is triggered when the running PTS value exceeds the PTS value specified
2181     by BXVD_PauseUntoPTS.  The display will be paused and this callback is generated.
2182     Note, BXVD_PauseUntoPTS allows the application can specify a value for "counter", such
2183     that the DM performs the above action only after the stream wraps around as many times
2184     as specified in the "counter".  The callback is generated regardless of the BXVD_DisplayMode
2185     setting.
2186
2187     The parameter passed by this callback is the BXVD_PTSInfo structure.
2188
2189  BXVD_Interrupt_eDisplayUntoPTS:
2190     This callback is triggered when the running PTS value exceeds the PTS value specified
2191     by BXVD_DisplayUntoPTS.  The display will be unpaused and this callback is generated.
2192     Note, BXVD_DisplayUntoPTS allows the application can specify a value for "counter", such
2193     that the DM performs the above action only after the stream wraps around as many times
2194     as specified in the "counter".  The callback is generated regardless of the BXVD_DisplayMode
2195     setting.
2196
2197     The parameter passed by this callback is the BXVD_PTSInfo structure.
2198
2199   BXVD_Interrupt_eIFrame:
2200     This callback is triggered when the first iframe is detected after a channel change.  It is
2201     useful to detect streams which do not contain iframes (HITS).  The callback is generated regardless
2202     of the BXVD_DisplayMode setting.
2203
2204     The parameter passed by this callback is a boolean, always true.
2205
2206   BXVD_Interrupt_ePictureParameters:
2207     This callback is triggered on every vsync to inform the application of current picture parameters.
2208     The callback is generated regardless of the BXVD_DisplayMode setting.
2209
2210     The parameter passed by this callback is the BXVD_PictureParameterInfo structure.
2211
2212   BXVD_Interrupt_ePPBParameters:
2213      This callback is triggered every time a PPB is evaluated from
2214      the AVD picture delivery queue. The callback is generated
2215      regardless of the BXVD_DisplayMode setting.
2216
2217      The parameter passed by this callback is a pointer to the
2218      BXVD_PPBParameterInfo structure.
2219
2220   BXVD_Interrupt_eDecodeError
2221      This callback is triggered on any vsync that the Display Manager
2222      encounters a PPB with a decode error.
2223
2224      The parameter passed is the running total of decode errors.
2225
2226   BXVD_Interrupt_eTSMResult
2227      This callback is triggered for every TSM evaluation on each
2228      undisplayed picture that the Display Manager evaluates.  It is
2229      possible that the same picture can generate multiple TSMResult
2230      callbacks (E.g. if the picture's TSMResult is eWait).  The app
2231      can override how the Display Manager handles the picture by
2232      changing the ePictureHandlingMode of the picture.
2233
2234      The parameter passed by this callback is a pointer to the
2235      BXVD_TSMInfo structure.
2236
2237   BXVD_Interrupt_PictureExtensionData
2238      Generic data callback mechanism, called when a picture has extension data.
2239
2240      The parameter pass by this callback is a "BXDM_Picture_ExtensionInfo *".
2241
2242   **************************************************************
2243   ** Below is a description of how the callbacks are enabled. **
2244   **************************************************************
2245
2246   The following callbacks are ENABLED by default.
2247   They are enabled/disabled by calling "BXVD_EnableInterrupt".
2248   They are "continuous" and must be explicitly disabled.
2249
2250      BXVD_Interrupt_ePtsStcOffset
2251      BXVD_Interrupt_ePTSError
2252      BXVD_Interrupt_ePictureParameters
2253      BXVD_Interrupt_eTSMPassInASTMMode
2254      BXVD_Interrupt_eTSMResult
2255      BXVD_Interrupt_ePPBParameters
2256
2257   The following callbacks are ENABLED by default.
2258   They are enabled/disabled by calling "BXVD_EnableInterrupt".
2259   They are "one shots", i.e. they are disabled after being executed.
2260
2261      BXVD_Interrupt_eRequestSTC
2262      BXVD_Interrupt_eFirstPTSReady
2263      BXVD_Interrupt_eFirstPTSPassed
2264      BXVD_Interrupt_eIFrame
2265
2266   The following callbacks are DISABLED by default.
2267   They are enabled/disabled by calling "BXVD_EnableInterrupt".
2268   They are "continuous" and must be explicitly disabled.
2269
2270      BXVD_Interrupt_eMarker
2271      BXVD_Interrupt_PictureExtensionData
2272      BXVD_Interrupt_eDecodeError
2273
2274   The following callbacks are DISABLED by default.
2275   They are enabled when "BXVD_SetClipTime" is called.
2276   They are "one shots", i.e. they are disabled after being executed.
2277
2278      BXVD_Interrupt_eClipStart
2279      BXVD_Interrupt_eClipStop
2280      BXVD_Interrupt_ePictureMarker
2281
2282****************************************************************************/
2283typedef enum BXVD_Interrupt
2284{
2285   BXVD_Interrupt_ePtsStcOffset,            /* STC offset changed interrupt */
2286   BXVD_Interrupt_ePictureDataReady,        /* Picture Data Ready Display Interrupt for legacy API only.
2287                                             * New apps should use the device interrupts when more than one
2288                                             * Display Interrupt is needed. */
2289   BXVD_Interrupt_eUserData,                /* User Data Available */
2290   BXVD_Interrupt_ePicDepthLowerThreshold,  /* DEPRECATED: Picture Depth Lower Thresold Crossed */
2291   BXVD_Interrupt_ePicDepthHigherThreshold, /* DEPRECATED: Picture Depth Higher Thresold Crossed */
2292   BXVD_Interrupt_eFirstPTSReady,           /* First Picture Ready */
2293   BXVD_Interrupt_eFirstPTSPassed,          /* First PTS Passed */
2294   BXVD_Interrupt_ePTSError,                /* PTS mismatch */
2295   BXVD_Interrupt_ePauseUntoPTS,            /* DEPRECATED: PauseUntoPTS event occured notification */
2296   BXVD_Interrupt_eDisplayUntoPTS,          /* DEPRECATED: DisplayUntoPTS event occured notification */
2297   BXVD_Interrupt_ePTS1Match,               /* DEPRECATED: EnableInterruptOnPTS1Match event occured notification */
2298   BXVD_Interrupt_ePTS2Match,               /* DEPRECATED: EnableInterruptOnPTS2Match event occured notification */
2299   BXVD_Interrupt_eIFrame,                  /* I-Frame detect event occured notification */
2300   BXVD_Interrupt_ePictureParameters,       /* Called when first picture is queued to the display manager from
2301                                               the firmware to inform application of size, framerate, etc. */
2302   BXVD_Interrupt_eTSMPassInASTMMode,       /* Called when DM is in
2303                                             * vsync mode, configured
2304                                             * for ASTM mode, and DM
2305                                             * sees a TSM pass */
2306   BXVD_Interrupt_eVideoInstructionChecker, /* VIC interrupt */
2307   BXVD_Interrupt_eClipStart,               /* ClipStart event occured notification */
2308   BXVD_Interrupt_eClipStop,                /* ClipStop event occured notification */
2309   BXVD_Interrupt_ePictureMarker,           /* PictureMarker event occurred notification */
2310   BXVD_Interrupt_eMarker,                  /* Generic Marker event occurred notification. Pointer to marker value passed as pXVD_data during callback */
2311   BXVD_Interrupt_eRequestSTC,              /* Called when DM needs the application to provide a valid STC before proceeding with TSM calculations */
2312
2313   BXVD_Interrupt_ePPBReceived,             /* Called when the "next" PPB is */
2314
2315   BXVD_Interrupt_ePPBParameters,           /* Called when a PPB is first evaluated for display */
2316
2317   BXVD_Interrupt_eDecodeError,             /* Called when the decode error bit is set in the PPB */
2318
2319   BXVD_Interrupt_eTSMResult,               /* Called for each TSM evaluation before a picture is displayed */
2320
2321   BXVD_Interrupt_ePictureExtensionData,     /* Generic data callback mechanism, called when a picture has extension data. */
2322
2323   BXVD_Interrupt_eMaxInterrupts            /* Not a Real interrupt just the max no of XVD interrupts */
2324} BXVD_Interrupt;
2325
2326
2327typedef enum BXVD_ChannelMode
2328{
2329   BXVD_ChannelMode_eVideo = 0,
2330   BXVD_ChannelMode_eStill,
2331
2332   BXVD_ChannelMode_eMax
2333} BXVD_ChannelMode;
2334
2335typedef enum BXVD_1080pScanMode
2336{
2337   /* eDefault: 1080p pass-thru, else 1080i
2338    *
2339    * 1080p pass-thru cases:
2340    *   - 1080p23.97/24 --> 23.97/24 Hz
2341    *   - 1080p25 --> 25 Hz
2342    *   - 1080p29.97/30 --> 29.97/30 Hz
2343    */
2344   BXVD_1080pScanMode_eDefault = 0,
2345
2346   /* eAdvanced: 1080p pass-thru + 1080p pulldown, else 1080i
2347    *
2348    * 1080p pulldown cases:
2349    *   - 1080p23.97/24 --> 59.94/60 Hz (3:2 frame cadence)
2350    *   - 1080p29.97/30 --> 59.94/60 Hz (2:2 frame cadence)
2351    *   - 1080p25 --> 50Hz (2:2 frame cadence)
2352    */
2353   BXVD_1080pScanMode_eAdvanced,
2354
2355   /* Add new enums ABOVE this line */
2356   BXVD_1080pScanMode_eMax
2357} BXVD_1080pScanMode;
2358
2359/***************************************************************************
2360Summary:
2361BXVD_SetMonitorRefreshRate symbolic constants. Used as alternative to
2362BFMT_VERT_xxHz constants for uiMonitorRefreshRate argument.
2363
2364If BFMT_VERT_INVALID is defined, use equivalent symbolic constants.
2365BFMT_VERT_XX contants maybe deprecated with new refresh rates being
2366unsupported by this group of symbolic contants. If not defined, create own
2367values solely used by XVD
2368****************************************************************************/
2369
2370#ifdef BFMT_VERT_INVALID
2371#define BXVD_MONITOR_REFRESH_RATE_INVALID   BFMT_VERT_INVALID
2372#define BXVD_MONITOR_REFRESH_RATE_50Hz      BFMT_VERT_50Hz
2373#define BXVD_MONITOR_REFRESH_RATE_59_94Hz   BFMT_VERT_59_94Hz
2374#define BXVD_MONITOR_REFRESH_RATE_60Hz      BFMT_VERT_60Hz
2375#define BXVD_MONITOR_REFRESH_RATE_23_976Hz  BFMT_VERT_23_976Hz
2376#define BXVD_MONITOR_REFRESH_RATE_24Hz      BFMT_VERT_24Hz
2377#define BXVD_MONITOR_REFRESH_RATE_25Hz      BFMT_VERT_25Hz
2378#define BXVD_MONITOR_REFRESH_RATE_30Hz      BFMT_VERT_30Hz
2379#ifdef BFMT_VERT_48Hz
2380#define BXVD_MONITOR_REFRESH_RATE_48Hz      BFMT_VERT_48Hz
2381#else
2382#define BXVD_MONITOR_REFRESH_RATE_48Hz      0x00004000
2383#endif
2384#ifdef BFMT_VERT_29_97Hz
2385#define BXVD_MONITOR_REFRESH_RATE_29_97Hz   BFMT_VERT_29_97Hz
2386#else
2387#define BXVD_MONITOR_REFRESH_RATE_29_97Hz   0x00000400
2388#endif
2389#else
2390#define BXVD_MONITOR_REFRESH_RATE_INVALID   0
2391#define BXVD_MONITOR_REFRESH_RATE_50Hz      1
2392#define BXVD_MONITOR_REFRESH_RATE_59_94Hz   2
2393#define BXVD_MONITOR_REFRESH_RATE_60Hz      3
2394#define BXVD_MONITOR_REFRESH_RATE_23_976Hz  4
2395#define BXVD_MONITOR_REFRESH_RATE_24Hz      5
2396#define BXVD_MONITOR_REFRESH_RATE_25Hz      6
2397#define BXVD_MONITOR_REFRESH_RATE_30Hz      7
2398#define BXVD_MONITOR_REFRESH_RATE_48Hz      8
2399#define BXVD_MONITOR_REFRESH_RATE_29_97Hz   9
2400#endif
2401
2402
2403/***************************************************************************
2404Summary:
2405XVD callback function typedef. Different from the BINT_CallbackFunc, returns
2406one extra parameter, which contains XVD data
2407****************************************************************************/
2408typedef void (*BXVD_CallbackFunc)( void *pParm1, int parm2, void *pXVD_data);
2409
2410/***************************************************************************
2411Summary:
2412    Channel specific settings to BXVD_OpenChannel() call. The monitor refresh rate
2413  is specified in Hertz and the removal delay is specified in vsync units.
2414****************************************************************************/
2415typedef struct BXVD_ChannelSettings
2416{
2417  uint32_t ui32MonitorRefreshRate;              /* The monitor Refresh Rate in Hertz*/
2418  unsigned long ulRemovalDelay;                 /* Initial removal delay in vsync units */
2419  uint32_t uiVsyncDiffThreshDefault;            /* Lip Sync fix */
2420  BAVC_FrameRateCode eDefaultFrameRate;         /* User-settable default frame rate if unknown from stream */
2421  BXVD_DecodeResolution eDecodeResolution;      /* Max video decode resolution used by this channel */
2422  BAVC_VideoCompressionStd *peVideoCmprStdList; /* List of Video compression standards used by this channel */
2423  uint32_t                   uiVideoCmprCount;  /* Number of video compression standards in list */
2424  BXVD_DisplayInterrupt eDisplayInterrupt;      /* FW PictDataRdy Interrupt to be used by this channel */
2425  uint32_t uiVDCRectangleNum;                   /* VDC rectangle number, multi-decode mode */
2426  BXVD_ChannelMode eChannelMode;                /* The type of decode for this channel (video or still) */
2427  bool bMPEG2BTPEnable;                         /* Enable MPEG2 BTP mode for this channel */
2428  bool bAVC41Enable;                            /* Enable AVC 4.1 mode for this channel */
2429  bool bAVC51Enable;                            /* Enable AVC 5.1 mode for this channel */
2430  bool bBluRayEnable;                           /* Enable Blu Ray mode for this channel */
2431  bool bExcessDirModeEnable;                    /* Enable Excess Direct memory mode for this channel */
2432  bool bSVC3DModeEnable;                        /* Enable 3D decode for SVC decodes on this channel */
2433  bool bSVCProgressiveOnly;                     /* SVC progressive decode only on this channel */
2434  bool b1920PortraitModeEnable;                 /* 1080x1920 portrait mode */
2435  BMEM_Handle hChannelSystemHeap;               /* General/System memory heap handle for this channel */
2436  BMEM_Handle hChannelCabacHeap;                /* Cabac/Secure memory heap handle for this channel */
2437  BMEM_Handle hChannelPictureHeap;              /* Picture memory heap handle for this channel */
2438  BXVD_1080pScanMode e1080pScanMode;            /* 1080p scan mode for this channel */
2439  BXVD_PictureDropMode ePictureDropMode;        /* PR48726: Indicates whether DM should drop pictures on field or frame boundaries */
2440} BXVD_ChannelSettings;
2441
2442/***************************************************************
2443 BXVD_ChannelStatus AVD Status Block bit flags.
2444****************************************************************/
2445#define BXVD_CHANNELSTATUS_AVD_STALLED_ON_INPUT              0x001
2446#define BXVD_CHANNELSTATUS_AVD_STALLED_ON_PIF                0x002
2447#define BXVD_CHANNELSTATUS_AVD_STALLED_ON_CABAC_WORKLIST     0x004
2448#define BXVD_CHANNELSTATUS_AVD_STALLED_ON_IL_WORKLIST        0x008
2449#define BXVD_CHANNELSTATUS_AVD_STALLED_ON_PPB                0x010
2450#define BXVD_CHANNELSTATUS_AVD_STALLED_ON_CABAC_BINBUFFER    0x020
2451#define BXVD_CHANNELSTATUS_AVD_DECODE_STALLED                0x040
2452#define BXVD_CHANNELSTATUS_AVD_STALLED_ON_USERDATA_BUFFER    0x080
2453#define BXVD_CHANNELSTATUS_AVD_RAP_NOT_DETECTED              0x100
2454#define BXVD_CHANNELSTATUS_AVD_UNSUPPORTED_FEATURE_DETECTED  0x200
2455#define BXVD_CHANNELSTATUS_AVD_IMAGE_SIZE_TOO_BIG            0x400
2456#define BXVD_CHANNELSTATUS_AVD_BAD_STREAM                    0x800
2457#define BXVD_CHANNELSTATUS_AVD_LESS_MEM_RESTRICT_BUFF        0x1000
2458#define BXVD_CHANNELSTATUS_AVD_DECODE_WARNING                0x2000
2459#define BXVD_CHANNELSTATUS_AVD_INPUT_OVERFLOW                0x4000
2460#define BXVD_CHANNELSTATUS_AVD_DECODE_STEREO_SEQ_ERROR       0x8000
2461#define BXVD_CHANNELSTATUS_AVD_STATE_DROP_UNSUPP_TEMP_DM     0x10000
2462
2463/***************************************************************************
2464Summary:
2465  Individual channel status information.
2466****************************************************************************/
2467/*
2468 * Most of the following counts are reset to '0' whenever "BXVD_StartDecode()" is called (with exceptions).
2469 *
2470 * The counts ARE reset when;
2471 * - "BXVD_StartDecode()" is called directly by the application
2472 * - "BXVD_StartDecode()" is called from within "BXVD_FlushDecode()" or "BXVD_DecodeStillPicture()"
2473 *
2474 * The counts ARE NOT reset when;
2475 * - "BXVD_StartDecode()" is called from within "BXVD_ProcessWatchdog()", "BXVD_SetSkipPictureModeDecode()"
2476 *   or "BXVD_PVR_SetHostSparseMode()"
2477 */
2478typedef struct BXVD_ChannelStatus
2479{
2480
2481   /*
2482    * "Picture Delivery Queue" underflow count, for debugging purposes.
2483    * Reset as described above.
2484    */
2485   uint32_t ulUnderflowCount;
2486
2487   /*
2488    * A snap shot of the number of pictures "currently" in the "Picture Delivery Queue".
2489    * This is a very dynamic value which may be stale by the time the
2490    * application evaluates it.
2491    * Since this is a dynamic value, it never needs to be reset.
2492    */
2493   uint32_t ulPictureDeliveryCount;
2494
2495   /*
2496    * A running count of the number of elements (fields/frames) dropped by
2497    * the "Display Manager" due to "Time Stamp Management" failures.
2498    * Reset as described above.
2499    */
2500   uint32_t uiDisplayManagerDroppedCount;
2501
2502   /*
2503    * A running count of the number of elements (fields/frames) the "Display Manager"
2504    * requests the decoder to drop.  Some drops may be pending.
2505    * Reset as described above.
2506    */
2507   uint32_t uiDecoderDroppedCount;
2508
2509   /*
2510    * A running count of the number of elements (fields/frames) the "Display Manager"
2511    * displayed even though there was a parity failure.
2512    * Reset as described above.
2513    */
2514   uint32_t uiDisplayedParityFailureCount;
2515
2516   /*
2517    * A running count of the number of elements (fields/frames) the "Display Manager"
2518    * delivered to the "Video Display Controller".
2519    * Reset as described above.
2520    */
2521   uint32_t uiDisplayedCount;
2522
2523   /*
2524    * A running count of the number of pictures the decoder delivered to
2525    * the "Display Manager". Reset as described above.
2526    */
2527   uint32_t uiPicturesDecodedCount;
2528
2529   /*
2530    * A running count of the number vsyncs where the "Display Manager" input
2531    * queue (Picture Delivery Queue) underflowed.
2532    * Reset as described above.
2533    */
2534   uint32_t uiVsyncUnderflowCount;
2535
2536   /*
2537    * A running count of the number decode errors reported by the decoder.
2538    * Reset as described above.
2539    */
2540   uint32_t uiDecodeErrorCount;
2541
2542   /*
2543    * A running count of number of times the DM vsync callback has been executed for this channel.
2544    * Reset as described above.
2545    */
2546   uint32_t uiVsyncCount;
2547
2548   /*
2549    * A snap shot of the depth of the CABAC bin buffer.  This is a dynamic value
2550    * which may be stale by the time the application evaluates it.
2551    * Since this is a dynamic value, it never needs to be reset.
2552    */
2553   uint32_t uiCabacBinDepth;
2554
2555   /*
2556    * A snap shot of the AVD channel status. The AVD FW updates this status
2557    * ten times a second.
2558    */
2559   uint32_t uiAVDStatusBlock;
2560
2561   /*
2562    * A running count of the number of I frames (inclusive of errors) delivered to the Display Manager.
2563    * Reset as described above.
2564    */
2565   uint32_t uiIFrameCount;
2566
2567   /*
2568    * A running count of the number of I frames with the error bit set delivered to the Display Manager .
2569    * Reset as described above.
2570    */
2571    uint32_t uiErrorIFrameCount;
2572
2573   /*
2574    * Video protocol for the picture being delivered to VDC.
2575    */
2576    BAVC_VideoCompressionStd eVideoProtocol;
2577
2578   /*
2579    * Video protocol level for the picture being delivered to VDC.
2580    */
2581    BXVD_Video_Protocol_Level eProtocolLevel;
2582
2583   /*
2584    * Video protocol profile for the picture being delivered to VDC.
2585    */
2586    BXVD_Video_Protocol_Profile eProtocolProfile;
2587
2588    /* Count of all the pictures received by the video decoder.
2589     * This includes those that are skipped, dropped and decoded.
2590     * Reset as described above.
2591     */
2592    uint32_t uiPicturesReceivedCount;
2593
2594    /* Number of times the decoder input has gotten into an overflow state.
2595     * Reset as described above.
2596     */
2597    uint32_t uiDecoderInputOverflow;
2598
2599} BXVD_ChannelStatus;
2600
2601/***************************************************************************
2602Summary:
2603  PTS information structure.
2604****************************************************************************/
2605#define BXVD_PTSInfo BXDM_PictureProvider_PTSInfo
2606
2607/***************************************************************************
2608Summary:
2609  Callback structure for BXVD_Interrupt_ePictureParameters.  This structure
2610  contains stream specific picture information and is delivered when the
2611  first picture is dequeued by the display manager.  It is to replace the
2612  deprecated sequence header interrupt, and is how applications should get
2613  notified of stream parameters at the earliest opportunity.
2614
2615  Many of the fields in this structure are the same as corresponding fields
2616  in BAVC_MFD_Picture.  Refer to the documentation in bavc.h for details as to
2617  what these fields mean.
2618
2619  The contents of identical fields in BAVC_MFD_Picture and
2620  BXVD_PictureParameterInfo may be different when the channel is first started,
2621  because the BXVD_PictureParameterInfo describes pictures which are being
2622  processed from the display queue, while BAVC_MFD_Picture describes pictures
2623  that are actively being displayed.  For example, BAVC_MFD_Picture may have
2624  bMute == true, which would allow certain fields to be undefined, whereas the
2625  BXVD_PictureParameterInfo would be populated with information from the decoder.
2626
2627  The BXVD_P_PPB_FLAG_PROG_SEQUENCE flag in the PPB indicates whether a stream is
2628  progressive or interlaced.  Two copies of this flag are maintained in the
2629  BXVD_PictureParameterInfo structure.
2630
2631  "bStreamProgressive_7411" is a filtered copy of BXVD_P_PPB_FLAG_PROG_SEQUENCE.
2632  It is initially loaded when playback begins.  It is reloaded when any of the
2633  following stream parameters change: eFrameRateCode, ulSourceHorizontalSize,
2634  ulSourceVerticalSize, eAspectRatio or eColorPrimaries.  It is being maintained
2635  for legacy applications.
2636
2637  "bStreamProgressive" tracks BXVD_P_PPB_FLAG_PROG_SEQUENCE directly.  It is
2638  copied from the picture being delivered to VDC.
2639
2640****************************************************************************/
2641typedef struct BXVD_PictureParameterInfo
2642{
2643  uint32_t ulSourceHorizontalSize;     /* see bavc.h BAVC_MFD_Picture */
2644  uint32_t ulSourceVerticalSize;       /* see bavc.h BAVC_MFD_Picture */
2645  uint32_t ulDisplayHorizontalSize;    /* see bavc.h BAVC_MFD_Picture */
2646  uint32_t ulDisplayVerticalSize;      /* see bavc.h BAVC_MFD_Picture */
2647  BFMT_AspectRatio eAspectRatio;       /* see bavc.h BAVC_MFD_Picture */
2648  uint16_t uiSampleAspectRatioX;       /* see bavc.h BAVC_MFD_Picture */
2649  uint16_t uiSampleAspectRatioY;       /* see bavc.h BAVC_MFD_Picture */
2650  BAVC_FrameRateCode eFrameRateCode;   /* see bavc.h BAVC_MFD_Picture */
2651  BAVC_ColorPrimaries eColorPrimaries; /* see bavc.h BAVC_MFD_Picture */
2652  BAVC_TransferCharacteristics eTransferCharacteristics;  /* see bavc.h */
2653  BAVC_MatrixCoefficients eMatrixCoefficients; /* see bavc.h BAVC_MFD_Picture */
2654  bool bFrameProgressive;              /* see bavc.h BAVC_MFD_Picture */
2655  int32_t i32_HorizontalPanScan;       /* see bavc.h BAVC_MFD_Picture */
2656  int32_t i32_VerticalPanScan;         /* see bavc.h BAVC_MFD_Picture */
2657
2658  bool bStreamProgressive;             /* unfiltered version of BXVD_P_PPB_FLAG_PROG_SEQUENCE */
2659
2660  bool bStreamProgressive_7411;        /* 7411 style progressive indication */
2661                                       /* i.e. filtered version of BXVD_P_PPB_FLAG_PROG_SEQUENCE */
2662
2663  uint32_t  uiProfile;                 /* stream encoding profile from the sequence extension */
2664  uint32_t  uiLevel;                   /* stream encoding level from the sequence extension */
2665
2666  uint32_t  uiBitRate;                 /* bit rate from sequence header */
2667  uint32_t  uiVideoFormat;             /* video format from the sequence display extension */
2668  uint32_t  uiLowDelayFlag;            /* delay flag from the sequence extension */
2669  uint32_t  uiFrameRateExtN;           /* frame rate extension N from the sequence extension */
2670  uint32_t  uiFrameRateExtD;           /* frame rate extension D from the sequence extension */
2671  uint32_t  uiPictureCodingType;       /* frame type from the picture header */
2672  uint32_t  uiFixedFrameRateFlag;      /* fixed frame rate flag delivered in the PPB */
2673
2674  uint32_t  uiMacroBlockCntInter;      /* inter macro block count calculated by the video decoder */
2675  uint32_t  uiMacroBlockCntIntra;      /* intra macro block count calculated by the video decoder */
2676  uint32_t  uiMacroBlockCntTotal;      /* total macro block count calculated by the video decoder */
2677
2678   /* This field indicate if valid AFD present present in the stream or not.
2679    * if bValidAfd=true, then ulAfd can then be used. */
2680   bool bValidAfd;
2681
2682   /* AFD values defined by User data registered by ITU-T Recommendation T.35
2683    * SEI message (see ISO/IEC 14496-10:2005, Subclauses D.8.5 and D.9.5).
2684    * The AFD value describe the area of interest of the stream. */
2685   uint32_t uiAfd;
2686
2687   /* SW7405-4378: save the unaltered width and height for use by the application. */
2688   uint32_t uiCodedSourceHeight;
2689   uint32_t uiCodedSourceWidth;
2690
2691} BXVD_PictureParameterInfo;
2692
2693/***************************************************************************
2694Summary:
2695  Callback structure for BXVD_Interrupt_ePPBParameters.  This
2696  structure contains PPB specific information and is delivered each
2697  time a PPB is evaluated from the picture delivery queue.
2698****************************************************************************/
2699/* the following provide a mapping for the symbol names of the types used in
2700   this structure and its members to the new XDM structuring
2701   ***** IMPORTANT ****
2702   It is expected that the *names* of the members of the structures are IDENTICAL
2703*/
2704#define BXVD_PPBParameterInfo BXDM_Picture
2705#define BXVD_PPB_PTS          BXDM_Picture_PTS
2706#define BXVD_PPB_PictureTag   BXDM_Picture_Tag
2707#define BXVD_PPB_Marker       BXDM_Picture_Marker
2708#define BXVD_PPB_PictureType  BXDM_Picture_Type
2709#define BXVD_PPB_Error        BXDM_Picture_Error
2710#define BXVD_PPB_Overscan     BXDM_Picture_Overscan
2711#define BXVD_PPB_PCROffset    BXDM_Picture_PCROffset
2712
2713#define BXVD_PictureCoding    BXDM_Picture_Coding
2714
2715#define BXVD_PictureCoding_eUnknown    BXDM_Picture_Coding_eUnknown
2716#define BXVD_PictureCoding_eI          BXDM_Picture_Coding_eI
2717#define BXVD_PictureCoding_eP          BXDM_Picture_Coding_eP
2718#define BXVD_PictureCoding_eB          BXDM_Picture_Coding_eB
2719#define BXVD_PictureCoding_eMax        BXDM_Picture_Coding_eMax
2720
2721
2722#define BXVD_TSMResult BXDM_PictureProvider_TSMResult
2723
2724#define BXVD_TSMResult_eTooEarly BXDM_PictureProvider_TSMResult_eTooEarly /* (PTS > STC)  and ((PTS - STC) > discard threshold) */
2725#define BXVD_TSMResult_eWait     BXDM_PictureProvider_TSMResult_eWait     /* (PTS > STC)  and ((PTS - STC) <= discard threshold) */
2726#define BXVD_TSMResult_ePass     BXDM_PictureProvider_TSMResult_ePass     /* (PTS <= STC) and ((STC - PTS) <= too late threshold) */
2727#define BXVD_TSMResult_eTooLate  BXDM_PictureProvider_TSMResult_eTooLate  /* (PTS < STC)  and ((STC - PTS) > too late threshold) */
2728#define BXVD_TSMResult_eDrop     BXDM_PictureProvider_TSMResult_eDrop     /* Drop for non-TSM reason (freeze, pts filtering, invalid pts, invalid pcr, etc) */
2729#define BXVD_TSMResult_eMax      BXDM_PictureProvider_TSMResult_eMax
2730
2731
2732#define BXVD_PictureHandlingMode BXDM_PictureProvider_PictureHandlingMode
2733
2734/* In Broadcast:
2735   - TooEarly --> eDrop
2736   - TooLate --> eHonorPTS
2737   In Playback:
2738   - TooEarly --> eHonorPTS for 3 vsyncs.  eDrop after 3 vsyncs.  Reset on non-TooEarly.
2739   - TooLate --> eIgnorePTS for first picture.  eHonorPTS for susequent pictures.  Reset on non-TooLate.
2740*/
2741#define BXVD_PictureHandlingMode_eDefault    BXDM_PictureProvider_PictureHandlingMode_eDefault
2742
2743/* Honor the PTS of the picture and assume it is correct */
2744#define BXVD_PictureHandlingMode_eHonorPTS   BXDM_PictureProvider_PictureHandlingMode_eHonorPTS
2745
2746/* Ignore the PTS of the picture and instead interpolate from the previous PTS */
2747#define BXVD_PictureHandlingMode_eIgnorePTS  BXDM_PictureProvider_PictureHandlingMode_eIgnorePTS
2748
2749/* Drop the picture immediately */
2750#define BXVD_PictureHandlingMode_eDrop       BXDM_PictureProvider_PictureHandlingMode_eDrop
2751
2752/* SW7635-51: give the middleware/application the option to hold off processing a picture. */
2753#define BXVD_PictureHandlingMode_eWait       BXDM_PictureProvider_PictureHandlingMode_eWait
2754
2755#define BXVD_PictureHandlingMode_eMax        BXDM_PictureProvider_PictureHandlingMode_eMax
2756
2757typedef struct BXVD_TSMInfo
2758{
2759   BXVD_TSMResult eTSMResult; /* The TSM Result for the currently evaluated picture.  *read only* */
2760   BXVD_PictureHandlingMode ePictureHandlingMode; /* The picture handling mode for the currently evaluated picture */
2761} BXVD_TSMInfo;
2762
2763
2764#define BXVD_FrameRateDetectionMode BXDM_PictureProvider_FrameRateDetectionMode
2765
2766/* Disable frame rate detection.  Will always return unknown */
2767#define BXVD_FrameRateDetectionMode_eOff  BXDM_PictureProvider_FrameRateDetectionMode_eOff
2768
2769/* Fast frame rate detection.  Will return best guess as soon as
2770 * possible.  Result may oscillate initially for very close frame
2771 * rates (e.g. 29.97 vs 30 fps)
2772 */
2773#define BXVD_FrameRateDetectionMode_eFast BXDM_PictureProvider_FrameRateDetectionMode_eFast
2774
2775/* Stable frame rate detection.  Will return "unknown" until frame
2776 * rate stabilizes.  Good for differentiating between close frame
2777 * rates (e.g. 29.97 vs 30 fps)
2778 */
2779#define BXVD_FrameRateDetectionMode_eStable  BXDM_PictureProvider_FrameRateDetectionMode_eStable
2780
2781#define BXVD_FrameRateDetectionMode_eMax  BXDM_PictureProvider_FrameRateDetectionMode_eMax
2782
2783
2784typedef enum BXVD_ProgressiveOverrideMode
2785{
2786   /* Assume 480p/576p/1080p content with pulldown="F" is
2787    * pulldown="TB" + source_format="Progressive" */
2788   BXVD_ProgressiveOverrideMode_eTopBottom,
2789
2790   /* Assume 480p/576p/1080p content with pulldown="F" is
2791    * pulldown="BT" + source_format="Progressive" */
2792   BXVD_ProgressiveOverrideMode_eBottomTop,
2793
2794   /* Assume 480p/576p/1080p content with pulldown="F" is
2795    * correct */
2796   BXVD_ProgressiveOverrideMode_eDisable,
2797
2798   BXVD_ProgressiveOverrideMode_eMax
2799} BXVD_ProgressiveOverrideMode;
2800
2801/* By default, 240i content is scanned out as progressive.
2802 *
2803 * Basically the content on MPEG-1 and VCD used 352x240
2804 * progressive for video. The transition to MPEG-2 caused
2805 * confusion to the encoders at the time, and they
2806 * mis-labeled some streams 240i for some streams, but we
2807 * found the content was actually progressive in almost every
2808 * case we could find. It was just experimental evidence that
2809 * showed better performance scanning out progressive.
2810 *
2811 * The customer can disable 240i force progressive scanout
2812 * if they know their content is encoded properly (e.g. a mosaic
2813 * channel, or a transcoded downsampled video sequence)
2814 */
2815typedef enum BXVD_240iScanMode
2816{
2817   /* Assume non-AVC 240i/288i has pulldown="F" (default) */
2818   BXVD_240iScanMode_eForceProgressive,
2819
2820   /* Assume non-AVC 240i/288i is coded correctly */
2821   BXVD_240iScanMode_eUseEncodedFormat,
2822
2823   BXVD_240iScanMode_eMax
2824} BXVD_240iScanMode;
2825
2826/***************************************************************************
2827Summary:
2828XVD callback function typedef. This is different from the BINT_CallbackFunc
2829definition in that it allows for an extra parameter to be passed to the
2830callback which contains XVD specific data.
2831****************************************************************************/
2832typedef void (*BXVD_IntCallbackFunc)(void *pParm1, int parm2, void *pXVD_data);
2833
2834#define BXVD_NUM_EXT_RAVE_CONTEXT 1
2835
2836/***************************************************************************
2837 * Summary:
2838 *  Input structure to the BXVD_StartDecode() call.
2839 *  ulFrameRate - bitmask specifying multiple refresh rates to choose from
2840 *  Defined in bfmt.h(BFMT_VERT_50Hz, BFMT_VERT_59_94Hz, BFMT_VERT_60Hz)
2841 *
2842 * NOTE:
2843 *  The following structure members are deprecated and should not be referenced
2844 *  in new code:
2845 *     uint32_t ulMultiStreamId;
2846 *     uint32_t ulVideoSubStreamId;
2847 *     BAVC_XptOutput stDataXprtOutput;
2848 *     BAVC_Timebase  eTimeBase;
2849 *
2850 */
2851typedef struct BXVD_DecodeSettings
2852{
2853  BAVC_VideoCompressionStd  eVideoCmprStd;  /* Video compression standard */
2854  uint32_t ulMultiStreamId;                 /* DEPRECATED: StreamId for compressed multistream */
2855  uint32_t ulVideoSubStreamId;              /* DEPRECATED: PES header streamID for DirectTV TS */
2856
2857  bool bPlayback;                           /* decoder is in playback mode */
2858  bool bCrcMode;                            /* DM is in CRC checking mode */
2859
2860  BAVC_XptOutput stDataXprtOutput;          /* DEPRECATED: Data Xpt output and Playback info */
2861  BAVC_Timebase  eTimeBase;                 /* DEPRECATED: Time base info */
2862
2863  BAVC_XptContextMap *pContextMap;      /* RAVE context used for this stream */
2864  BAVC_XptContextMap *aContextMapExtended[BXVD_NUM_EXT_RAVE_CONTEXT]; /* RAVE exxtended context used for this stream */
2865  uint32_t uiContextMapExtNum;               /* Number of extended rave contexts */
2866  uint32_t uiSignature;                     /* Signature written if BXVD_GetDecodeDefaultSettings is called */
2867
2868  BXVD_STC eSTC;                            /* STC used by this channel */
2869  BXVD_DisplayInterrupt eDisplayInterrupt;  /* FW PictDataRdy Interrupt to be used by this channel */
2870  uint32_t uiVDCRectangleNum;               /* VDC rectangle number, multi-decode mode */
2871  bool bAstmMode;                           /* Set DM to Adaptive System Time Management (ASTM) mode */
2872
2873  /* if the STC is valid, continue displaying pictures even if the PCR
2874   * offset becomes invalid. */
2875  bool bVsyncModeOnPcrDiscontinuity;
2876
2877  BXVD_HITSMode eHITSMode;                  /* MPEG HITS mode */
2878  bool bZeroDelayOutputMode;                /* Deliver pictures when decoded, no delay */
2879  BAVC_FrameRateCode eDefaultFrameRate;     /* User-settable default frame rate if unknown from stream */
2880
2881  uint32_t uiPreRollRate;                   /* essentially a slow motion rate to be applied until a PPB passes TSM test */
2882
2883  BXVD_Picture_ErrorHandling eErrorHandling;  /* Display Manager picture error handling.  */
2884
2885  BXVD_FrameRateDetectionMode eFrameRateDetectionMode; /* Frame Rate Detection Mode that should be
2886                                                        * used if both the coded frame rate and
2887                                                        * eDefaultFrameRate are unknown */
2888  bool bBluRayDecode;                       /* Blu-ray decode mode */
2889  BXVD_ProgressiveOverrideMode eProgressiveOverrideMode; /* 480p/576p/1080p override mode */
2890  BXVD_TimestampMode eTimestampMode;        /* Timestamps can be either Decode or Display order */
2891  bool bIFrameAsRAP;                        /* Treat I Frame as a RAP when decoding AVC */
2892  bool bAVCErrorConcealmentMode;            /* Enable AVC error concealment */
2893  bool bIOnlyFieldOutputMode;               /* Enable AVC I only field output mode */
2894  bool bIgnoreDPBOutputDelaySyntax;         /* SW3556-1058:: ignore the DPB output delay syntax */
2895  uint32_t uiSEIMessageFlags;               /* Enable various Userdata SEI message features */
2896  bool bPFrameSkipDisable;                  /* Disable P frame skip mode */
2897  bool bExternalPictureProviderMode;        /* An external picture provider interface is being used */
2898  bool bAVCAspectRatioOverrideMode;         /* Use current decode previous valid AR if not specified in SPS */
2899  bool bSVC3DModeEnable;                    /* Enable 3D decode for SVC protocol */
2900  bool bSWCoefAVCDecodeModeEnable;          /* Enable SW coefficient decode of AVC streams */
2901  bool bIgnoreNumReorderFramesEqZero;       /* Ignore AVC Num Reorder Frames equal zero */ 
2902  bool bEarlyPictureDeliveryMode;           /* Enable Early Picture Delivery Mode */
2903} BXVD_DecodeSettings;
2904
2905/*
2906 * SEI Message flag definitions
2907 */
2908#define BXVD_DECODESETTINGS_SEI_MESSAGE_FRAMEPACKING 1
2909
2910/***************************************************************************
2911Summary:
2912  Structure for setting device VDC interrupts.
2913
2914Description:
2915
2916  Some of the platforms have the capability to generate more than one
2917  PictureDataReady interrupt to a decoder. Also, one interrupt may trigger
2918  more than one decoder. One decoder could be linked to another decoder. If
2919  the decoder is linked to another decoder, the interrupt service routine
2920  will be invoked via XVD device ISR context of primary decoder.
2921
2922See Also:
2923****************************************************************************/
2924typedef struct BXVD_DeviceVdcInterruptSettings
2925{
2926  BINT_Id                 VDCIntId_Topfield; /* [in] VDC interrupt for Top field */
2927  BINT_Id                 VDCIntId_Botfield; /* [in] VDC interrupt for Bottom field */
2928  BINT_Id                 VDCIntId_Frame;    /* [in] VDC interrupt for Frame */
2929  BXVD_DisplayInterrupt   eDisplayInterrupt; /* To indicate which
2930                                              * picture data ready interrupt */
2931  uint32_t                uiFlags;           /* Various flags */
2932  BXDM_DisplayInterruptHandler_Handle hAppXdmDih; /* Application supplied Display Interrupt Handle */
2933} BXVD_DeviceVdcInterruptSettings;
2934
2935/* Linked - to disable the ISR for this Display interrupt */
2936/* UseFieldAsFrame - to treat top/bot fields as frame  */
2937
2938#define BXVD_DeviceVdcIntrSettingsFlags_None              0
2939#define BXVD_DeviceVdcIntrSettingsFlags_Linked            1
2940#define BXVD_DeviceVdcIntrSettingsFlags_UseFieldAsFrame   2
2941
2942
2943/***************************************************************************
2944Summary:
2945    Struct return in BXVD_GetRevision
2946****************************************************************************/
2947typedef struct BXVD_RevisionInfo
2948{
2949  unsigned long             ulDecoderFwRev;  /* Decoder ARC FW version */
2950} BXVD_RevisionInfo;
2951
2952/***************************************************************************
2953Summary:
2954  Structure for returning all display threshold values (in 45KHz clock ticks)
2955
2956Description:
2957  This structure contains display thresholds that were returned by separate
2958  calls in XVD. This structure can be added to if new display thresholds
2959  become available. The values are all expressed as ticks of the 45KHz clock.
2960
2961See Also:
2962  BXVD_GetDisplayThresholds
2963****************************************************************************/
2964typedef struct BXVD_DisplayThresholds
2965{
2966  uint32_t  ui32ThresholdLo;
2967  uint32_t  ui32ThresholdHi;
2968  uint32_t  ui32DiscardThreshold;
2969  uint32_t  ui32VeryLateThreshold;
2970} BXVD_DisplayThresholds;
2971
2972/***************************************************************************
2973Summary:
2974    Enum used to select the type of field display.
2975
2976Description:
2977    We can select top field only, bottom field or both field display.
2978
2979See Also:
2980    BXVD_SetDisplayFieldMode, BXVD_GetDisplayFieldMode, BXVD_GetDisplayFieldMode_isr
2981
2982Below is an explanation of the new eDisplayFieldMode mode "BXVD_DisplayFieldType_eAuto" and
2983the supporting API "BXVD_SetDeinterlacerMaxHeight".
2984
2985For normal play and fast forward, eDisplayFieldMode should be set to "eBothField". 
2986The question is how to set eDisplayFieldMode for slow motion and pause.
2987If there is an "appropriate" deinterlacer in the output path, it should be set to
2988"eBothField" for the best results.  If there is NOT an "appropriate" deinterlacer,
2989it should be set to "eSingleField"; this will minimize jitter at the expense of a lower
2990resolution image. The new eDisplayFieldMode of "BXVD_DisplayFieldType_eAuto" solves this
2991problem by automatically selecting either "eBothField" or "eSingleField" during slow
2992motion and pause.
2993
2994Having an "appropriate" deinterlacer is defined as:
2995- every output is driven by a deinterlacer
2996- AND the least capable deinterlacer can support the stream height
2997- AND the deinterlacer(s) are enabled
2998
2999The API "BXVD_SetDeinterlacerMaxHeight" is used to set the variable "uiMaxHeightSupportedByDeinterlacer". 
3000The application/middleware will use "uiMaxHeightSupportedByDeinterlacer" to indicate if there
3001is an "appropriate" deinterlacer.  If "uiMaxHeightSupportedByDeinterlacer" is set to "0",
3002there is NOT an "appropriate" deinterlacer and the scan out will be "eSingleField".
3003If "uiMaxHeightSupportedByDeinterlacer" is set to a non-zero value, the scan out will be "eBothField" if
3004the stream height is less than or equal to "uiMaxHeightSupportedByDeinterlacer". 
3005If the height is greater than "uiMaxHeightSupportedByDeinterlacer", the scan out will be "eSingleField". 
3006
3007The following pseudo code summaries the behavior:
3008
3009   if ( stGlobal.eDisplayFieldMode == BXDM_PictureProvider_DisplayFieldMode_eAuto )
3010   {
3011      // Default to eBothField
3012
3013      stLocal.eDisplayFieldMode = BXDM_PictureProvider_DisplayFieldMode_eBothField;
3014
3015      // When paused or in slow motion, revert to eSingleField if the deinterlacer cannot support the stream.
3016
3017      if ( stSource.uiHeight > uiMaxHeightSupportedByDeinterlacer
3018            && true == bPausedOrSlowMotion
3019         )
3020      {
3021         stLocal.eDisplayFieldMode = BXDM_PictureProvider_DisplayFieldMode_eSingleField;
3022      }
3023
3024   }
3025   
3026
3027****************************************************************************/
3028typedef enum BXVD_DisplayFieldType
3029{
3030  BXVD_DisplayFieldType_eBothField,       /* regular both field display */
3031  BXVD_DisplayFieldType_eTopFieldOnly,    /* Display Top fld only */
3032  BXVD_DisplayFieldType_eBottomFieldOnly,  /* Display Bottom fld only */
3033  BXVD_DisplayFieldType_eSingleField, /* Display single field only.
3034                                       * The field that is displayed
3035                                       * is the same as the one that
3036                                       * is currently being
3037                                       * displayed. */
3038  BXVD_DisplayFieldType_eAuto,     /* SW7405-4117: select either eSingleField or eBothField based on the
3039                                        * steam height during slow motion (and preroll). */
3040  BXVD_DisplayFieldType_eMaxFieldType
3041} BXVD_DisplayFieldType;
3042
3043/***************************************************************************
3044Summary:
3045    Enum used to select display modes
3046
3047Description:
3048    We can select either to use PTS or ignore PTS, time-stamp or non time-stamp
3049 mode.
3050
3051See Also:
3052    BXVD_SetVideoDisplayMode, BXVD_GetVideoDisplayMode
3053
3054****************************************************************************/
3055/* Display timing mode */
3056typedef enum BXVD_DisplayMode
3057{
3058  BXVD_DisplayMode_eTSMMode,   /* Use PTS for display timing */
3059  BXVD_DisplayMode_eVSYNCMode, /* Ignore PTS and follow pulldown */
3060  BXVD_DisplayMode_eMaxModes
3061} BXVD_DisplayMode;
3062
3063/***************************************************************************
3064Summary:
3065    Structure for returning the GOP time code value
3066
3067Description:
3068    SMPTE time codes coming in the MPEG stream as per ISO/IEC 13818-2
3069        standard.
3070See Also:
3071    BXVD_GetGopTimeCode
3072
3073****************************************************************************/
3074typedef struct BXVD_GopTimeCode
3075{
3076  unsigned long ulTimeCodeHours;    /* The hours field */
3077  unsigned long ulTimeCodeMinutes;  /* The minutes field */
3078  unsigned long ulTimeCodeSeconds;  /* The seconds field */
3079  unsigned long ulTimeCodePictures; /* The pictures (frames) field */
3080  bool bTimeCodeValid;              /* Valid timecode in input stream */
3081} BXVD_GopTimeCode;
3082
3083/***************************************************************************
3084Summary:
3085    Enum used to specify interrupt enable/disable status.
3086
3087Description:
3088    This enum is used in calls to BXVD_EnableInterrupt. This enum
3089        along with the interrupt specified sets the enabled or disabled
3090        status of the interrupt.
3091
3092See Also:
3093    BXVD_EnableInterrupt
3094
3095****************************************************************************/
3096typedef enum BXVD_InterruptEnable
3097{
3098   BXVD_InterruptEnable_eDisable = 0,
3099   BXVD_InterruptEnable_eEnable
3100} BXVD_InterruptEnable;
3101
3102
3103#define BXVD_ClipTimeType BXDM_PictureProvider_ClipTimeType
3104
3105 /* Disables all clip logic. If clipping is currently active, it
3106  * will be disabled and normal TSM will resume. If a clip time was
3107  * previously set (but not yet used), it will be reset
3108  */
3109#define BXVD_ClipTimeType_eDisable  BXDM_PictureProvider_ClipTimeType_eDisable
3110
3111/* Both clip start and stop times are valid w/ DVD specific
3112 * functionality:
3113 * - Pictures causing PTS Errors are displayed in vsync mode
3114 * - Start Time of 0 means start immediately     
3115 * - Stop Time of 0xFFFFFFFF means stop on a marker
3116 * - Stop Event:
3117 *   - TSM Mode: STC value is compared to stop time
3118 *   - vTSM Mode: PTS value is compared to stop time
3119 *   - EOC/VSYNC Mode: stop time is ignored.  Marker is used to indicate stop.
3120 */
3121#define BXVD_ClipTimeType_eEnableBothWithDVDCompatibility   BXDM_PictureProvider_ClipTimeType_eEnableBothWithDVDCompatibility
3122
3123/* Both clip start and stop times are valid */
3124#define BXVD_ClipTimeType_eEnableBoth     BXDM_PictureProvider_ClipTimeType_eEnableBoth
3125
3126/* Only clip start time is valid */
3127#define BXVD_ClipTimeType_eClipStartOnly  BXDM_PictureProvider_ClipTimeType_eClipStartOnly
3128
3129/* Only clip stop time is valid */
3130#define BXVD_ClipTimeType_eClipStopOnly   BXDM_PictureProvider_ClipTimeType_eClipStopOnly
3131
3132#define BXVD_ClipTimeType_eMax            BXDM_PictureProvider_ClipTimeType_eMax
3133
3134
3135
3136/***************************************************************************
3137Summary:
3138    Enum used to specify the pulldown override mode for MPEG content.
3139
3140Description:
3141
3142    This enum is used in calls to BXVD_SetMPEGPulldownOverride.
3143    When "BXVD_MPEGPulldownOverride_eRFF" is specified, the Display Manager
3144    will look at the "RepeatFirstField" flag delivered with the picture.
3145    If "RepeatFirstField" is set for a given picture, the pulldown will
3146    be overridden as follows;
3147      TB -> TBT
3148      BT -> BTB
3149
3150See Also:
3151
3152****************************************************************************/
3153
3154typedef enum BXVD_MPEGPulldownOverride
3155{
3156
3157   BXVD_MPEGPulldownOverride_eDefault,    /* use the pulldown information as supplied with the PPB */
3158   BXVD_MPEGPulldownOverride_eRFF,        /* override the pulldown based on the RepeatFirstField flag
3159                                             delivered with the PPB. */
3160   BXVD_MPEGPulldownOverride_eMax
3161
3162} BXVD_MPEGPulldownOverride;
3163
3164/***************************************************************************
3165Summary:
3166
3167Description:
3168
3169See Also:
3170
3171****************************************************************************/
3172
3173typedef struct BXVD_PlaybackRateSettings
3174{
3175   uint16_t uiNumerator;   /* a value of '0' will cause the system to pause */
3176   uint16_t uiDenominator; /* a value of '0' will generate an BERR_INVALID_PARAMETER error */
3177
3178} BXVD_PlaybackRateSettings;
3179
3180/***************************************************************************
3181Summary:
3182
3183Description:
3184
3185See Also:
3186
3187****************************************************************************/
3188
3189typedef struct BXVD_FrameRate
3190{
3191      uint16_t uiNumerator;   /* 0 indicates unknown rate */
3192      uint16_t uiDenominator; /* 0 indicates unknown rate */
3193} BXVD_FrameRate;
3194
3195/* Temporarily add this define for backward compatibility with Nexus */
3196#define BXVD_FrameRateSettings BXVD_FrameRateOverride
3197
3198typedef struct BXVD_FrameRateOverride
3199{
3200   bool           bValid;
3201   BXVD_FrameRate stRate;
3202
3203   bool           bTreatAsSingleElement;  /* SWDEPRECATED-1003: assume FrameX1 when calculating
3204                                             the predicted PTS value of the next picture. */
3205} BXVD_FrameRateOverride;
3206
3207/***************************************************************************
3208Summary:
3209SW7422-72: structure and constant defintions for setting the 3D orientation
3210of pictures.
3211
3212See Also:
3213See comment at BXVD_Set3D
3214
3215****************************************************************************/
3216
3217#define BXVD_3DSetting  BXDM_PictureProvider_3DSettings
3218
3219#define BXVD_Orientation     BXDM_PictureProvider_Orientation
3220
3221#define BXVD_Orientation_e2D                             BXDM_PictureProvider_Orientation_e2D
3222#define BXVD_Orientation_eLeftRight                      BXDM_PictureProvider_Orientation_eLeftRight
3223#define BXVD_Orientation_eOverUnder                      BXDM_PictureProvider_Orientation_eOverUnder
3224#define BXVD_Orientation_eLeftRightFullFrame             BXDM_PictureProvider_Orientation_eLeftRightFullFrame
3225#define BXVD_Orientation_eRightLeftFullFrame             BXDM_PictureProvider_Orientation_eRightLeftFullFrame
3226#define BXVD_Orientation_eLeftRightEnhancedResolution    BXDM_PictureProvider_Orientation_eLeftRightEnhancedResolution
3227#define BXVD_Orientation_eMax                            BXDM_PictureProvider_Orientation_eMax
3228
3229/***************************************************************************
3230Summary:
3231SW7425-1264: support for a synthesized STC; can create a clock that run backwards.
3232See bxdm_pp.h for the definition of BXDM_PictureProvider_ClockOverride.
3233
3234****************************************************************************/
3235
3236#define BXVD_ClockOverride BXDM_PictureProvider_ClockOverride
3237
3238
3239/*******************/
3240/* XVD Device APIs */
3241/*******************/
3242
3243/******************************************************************************
3244Summary:
3245    Get the default settings for the XVD device.
3246
3247Returns:
3248    BERR_SUCCESS - Successfully opened XVD connection.
3249    BERR_INVALID_PARAMETER - Invalid function parameter.
3250
3251See Also:
3252*******************************************************************************/
3253BERR_Code BXVD_GetDefaultSettings
3254(
3255  BXVD_Settings    *pDefaultSetings   /* [out] Default XVD settings */
3256);
3257
3258/***************************************************************************
3259Summary:
3260    Opens and initializes XVD
3261
3262Description:
3263    Applications are required to call this function once, prior to any
3264    other XVD calls.
3265
3266Returns:
3267    BERR_INVALID_PARAMETER - Invalid function parameters.
3268    BERR_SUCCESS - Successfully opened XVD.
3269
3270See Also:
3271    BXVD_Close, BXVD_GetDefaultSettings.
3272**************************************************************************/
3273BERR_Code BXVD_Open
3274(
3275   BXVD_Handle                *phXvd,       /* [out] XVD handle returned */
3276   BCHP_Handle                 hChip,       /* [in] chip handle */
3277   BREG_Handle                 hRegister,   /* [in] register handle */
3278   BMEM_Handle                 hFWMemory,   /* [in] FW Code memory handle */
3279   BMEM_Handle                 hMemory,     /* [in] 7401 General heap memory handle
3280                                             *      non-UMA Private Picture buffer heap memory handle */
3281   BINT_Handle                 hInterrupt,  /* [in] interrupt handle */
3282   const BXVD_Settings        *pDefSettings /* [in] default XVD settings */
3283   );
3284
3285/******************************************************************************
3286Summary:
3287    Release allocated resources and close XVD
3288
3289Description:
3290    Applications must call this function before it terminates.
3291
3292Returns:
3293    BERR_SUCCESS - Successfully closed the XVD connection.
3294    BERR_INVALID_PARAMETER - Invalid function parameter.
3295
3296See Also:
3297    BXVD_Open
3298*******************************************************************************/
3299BERR_Code BXVD_Close
3300(
3301   BXVD_Handle     hXvd    /* [in] XVD handle */
3302   );
3303
3304
3305/******************************************************************************
3306Summary:
3307    Put decoder in Standby mode.
3308
3309Description:
3310    Save current power state, set power state to power Off
3311
3312Returns:
3313    BERR_SUCCESS - Successfully closed the XVD connection.
3314    BERR_INVALID_PARAMETER - Invalid function parameter.
3315
3316See Also:
3317    BXVD_Resume
3318*******************************************************************************/
3319
3320BERR_Code BXVD_Standby
3321   (
3322   BXVD_Handle     hXvd    /* [in] XVD handle */
3323   );
3324
3325/******************************************************************************
3326Summary:
3327    Restore decoder to pre-standby state.
3328
3329Description:
3330    Set power state to on, boot decoder and restore power state to saved
3331    standby power state
3332
3333Returns:
3334    BERR_SUCCESS - Successfully closed the XVD connection.
3335    BERR_INVALID_PARAMETER - Invalid function parameter.
3336
3337See Also:
3338    BXVD_Standby
3339
3340*******************************************************************************/
3341BERR_Code BXVD_Resume
3342   (
3343   BXVD_Handle     hXvd    /* [in] XVD handle */
3344   );
3345
3346
3347
3348/***************************************************************************
3349Summary:
3350    API used to retrieve the max video channels supported.
3351Description:
3352    returns the number of video channels supported.
3353Returns:
3354    BERR_SUCCESS
3355
3356See Also:
3357****************************************************************************/
3358BERR_Code BXVD_GetTotalChannels
3359(
3360   BXVD_Handle       hXvd,                /* [in] XVD device handle */
3361   unsigned         *puiTotalChannels     /* [out] Total channels available */
3362   );
3363
3364/***************************************************************************
3365Summary:
3366    ISR version of BXVD_GetTotalChannels
3367
3368See Also:
3369   BXVD_GetTotalChannels
3370***************************************************************************/
3371BERR_Code BXVD_GetTotalChannels_isr
3372(
3373   BXVD_Handle       hXvd,                /* [in] XVD device handle */
3374   unsigned         *puiTotalChannels     /* [out] Total channels available */
3375   );
3376
3377/***************************************************************************
3378Summary:
3379    API used to retrieve the 7401 FW version
3380Description:
3381    Returns Decoder ARC FW revision
3382Returns:
3383    BERR_SUCCESS
3384
3385See Also:
3386****************************************************************************/
3387BERR_Code BXVD_GetRevision
3388(
3389   BXVD_Handle              hXvd,       /* [in] XVD device handle */
3390   BXVD_RevisionInfo       *psRevInfo   /* [out] FW and HW revision info */
3391   );
3392
3393/***************************************************************************
3394Summary:
3395    ISR version of BXVD_GetRevision
3396
3397See Also:
3398   BXVD_GetRevision
3399***************************************************************************/
3400BERR_Code BXVD_GetRevision_isr
3401(
3402   BXVD_Handle              hXvd,       /* [in] XVD device handle */
3403   BXVD_RevisionInfo       *psRevInfo   /* [out] FW and HW revision info */
3404   );
3405
3406/***************************************************************************
3407 Summary:
3408         Link two decoders picture procssing
3409
3410 Description:
3411         Routine used to link the primary decoder picture processing
3412 with the processing of the secondary decoders pictures. Two decoders
3413 are needed to decode 12 CIF video streams which will be displayed on
3414 a single display device.
3415***************************************************************************/
3416void BXVD_LinkDecoders
3417(
3418   BXVD_Handle hXvd_Primary,
3419   BXVD_Handle hXvd_Secondary,
3420   BXVD_DisplayInterrupt eDisplayInterrupt
3421   );
3422
3423/***************************************************************************
3424Summary:
3425        Unlink two decoders picture procssing
3426
3427Description:
3428        Routine used to unlink the primary decoder picture processing
3429with the processing of the secondary decoders pictures.
3430***************************************************************************/
3431void BXVD_UnlinkDecoders(
3432   BXVD_Handle hXvd_Primary
3433   );
3434
3435/***************************************************************************************
3436Summary:
3437    BXVD_GetVdcDeviceInterruptDefaultSettings:
3438    Gets the DeviceVdcInterrupt default settings.
3439Description:
3440    This API is used to initialize the VDC interrupt structure.
3441Returns:
3442    BERR_SUCCESS
3443
3444See Also:
3445    BXVD_RegisterVdcDeviceInterrupt
3446
3447***************************************************************************************/
3448BERR_Code BXVD_GetVdcDeviceInterruptDefaultSettings
3449(
3450   BXVD_Handle                      hXvd,                   /* [in] XVD */
3451   BXVD_DeviceVdcInterruptSettings  *pDefDevVdcIntrSettings /* [out] default settings */
3452   );
3453
3454/***************************************************************************
3455Summary:
3456    This API is used to register the VDC interrupt with the video firmware.
3457Description:
3458    The VDC PI uses this API to register the channel specific RDMA done
3459    interrupt with the firmware. The firmware then waits on this interrupt to
3460    issue the Picture data ready interrupt.
3461
3462        BXVD_DeviceVdcIntrSettingsFlags_Linked:
3463
3464        Used to link two decoders picture delivery processing.
3465
3466        BXVD_DeviceVdcIntrSettingsFlags_UseFieldAsFrame:
3467
3468        Used to interpret top/bottom fields as frame. This is used by VDC to use
3469        the GRC block to read the pixel data. GRC functionality requires XVD to be
3470        configured to change from interpreting top/bottom pixel data to frame pixel
3471        data. This is done by interpreting the device top or bottom vsyncs as frame
3472        vsyncs for GRC's use. The decoder does not have to be stopped to change from
3473        normal interpretation to this UseFieldAsFrame intpretation or back to normal
3474        again. If the same RULIDMask bits for top/bottom fields are being used, the
3475        decoder does not have to be in the idle state.
3476
3477Returns:
3478    BERR_SUCCESS
3479
3480See Also:
3481
3482****************************************************************************/
3483BERR_Code BXVD_RegisterVdcDeviceInterrupt
3484(
3485   BXVD_Handle                      hXvd,                /* [in] XVD */
3486   BXVD_DeviceVdcInterruptSettings  *pDevVdcIntrSettings /* [in] Settings to control VDC Interrupt */
3487   );
3488
3489/***************************************************************************
3490Summary:
3491    Used to enable and install an application callback for a decoder
3492    device relevant interrupt.
3493
3494Description:
3495    This API should be used by the application /syslib to enable an XVD
3496    decoder specific interrupt enumerated by the BXVD_DeviceInterrupt enum.
3497
3498Returns:
3499    BERR_SUCCESS
3500        BERR_INVALID_PARAMETER
3501
3502See Also:
3503****************************************************************************/
3504BERR_Code BXVD_InstallDeviceInterruptCallback
3505(
3506   BXVD_Handle hXvd,                /* [in] XVD device handle */
3507   BXVD_DeviceInterrupt eInterrupt, /* [in] Desired interrupt that needs to be activated */
3508   BXVD_CallbackFunc fCallBack,     /* [in] XVD callback function */
3509   void *pParm1,                    /* [in] application specified parameter */
3510   int  parm2                       /* [in] application specified parameter */
3511   );
3512
3513/***************************************************************************
3514Summary:
3515    Used to disable and un-install an application callback for a decoder
3516    device relevant interrupt.
3517
3518Description:
3519    This API should be used by the application /syslib to disable an XVD
3520    decoder specific interrupt, handle enumerated by the
3521    BXVD_Device Interrupt enum.
3522
3523Returns:
3524    BERR_SUCCESS
3525        BERR_INVALID_PARAMETER
3526
3527See Also:
3528
3529****************************************************************************/
3530BERR_Code BXVD_UnInstallDeviceInterruptCallback
3531(
3532   BXVD_Handle hXvd,               /* [in] XVD channel handle */
3533   BXVD_DeviceInterrupt eInterrupt /* [in] Desired interrupt to disable */
3534   );
3535
3536/**************************************************************************
3537 Summary:
3538    API returns the buffer requirements for CDB and ITB.
3539 Description:
3540    Retrieve maximum ITB/CDB buffer and Picture Buffer configuration for list of decoder
3541    modes passed required by the application.
3542 
3543 Parameters:
3544     BXVD_Handle              hXvd           Xvd handle
3545     BAVC_CdbItbBufferConfig  *CdbItbBufcfg  pointer to AVC common structure to receive maximum size and allignment configuration
3546     int32_t                  *PicBuflength  pointer to receive maximum size needed for picture buffers
3547 
3548 Returns:
3549        BERR_SUCCESS  Buffer configuration generated successfully.
3550        BERR_INVALID_PARAMETER  Bad input parameter
3551**************************************************************************/
3552
3553BERR_Code BXVD_GetBufferConfig
3554(
3555   BXVD_Handle        hXvd,               /* [in] XVD handle  */
3556   BAVC_CdbItbConfig  *pCdbItbConfigInfo, /* [out] ptr to size and alignment config structure */
3557   int32_t            *PicBuflength     /* [out] ptr to picture buffer maximum size */
3558);
3559
3560/***************************************************************************
3561 Summary: BXVD_GetChannelMemoryConfig
3562    Returns the FW Memory needed for the specified channel settings.
3563 
3564 Description:
3565    Using the specified channel settings resolution and decode mode, the FW
3566    memory configuration is determined and returned.
3567
3568 Returns:
3569    BERR_SUCCESS  Memory configuration generated successfully.
3570    BERR_INVALID_PARAMETER  Bad input parameter
3571**************************************************************************/
3572 
3573BERR_Code BXVD_GetChannelMemoryConfig
3574(
3575   BXVD_Handle                hXvd,           /* [in] XVD handle */
3576   const BXVD_ChannelSettings *pChSettings,   /* [in] channel settings */
3577   BXVD_FWMemConfig           *pFWMemConfig   /* [out] memory configuration for this channel */
3578);
3579
3580/***************************************************************************
3581Summary:
3582  Resets Video Decoder.
3583
3584Description:
3585  When the Video Decoder stops updating the Watchdog counter the device needs
3586  to be reset. This is accomplished by initiializing the hardware state of the
3587  decoder followed by reloading the decoder firmware. The decoder is started
3588  using the previously configured Rave context.
3589
3590Returns:
3591  BERR_SUCCESS  Decoder reset successful
3592
3593See Also:
3594***************************************************************************/
3595BERR_Code BXVD_ProcessWatchdog
3596(
3597   BXVD_Handle hXvd /* [in] XVD context handle */
3598   );
3599
3600
3601/********************/
3602/* XVD Channel APIs */
3603/********************/
3604
3605/***************************************************************************
3606Summary:
3607    Gets the default settings of the desired XVD channel.
3608
3609Description:
3610
3611Returns:
3612    BERR_SUCCESS
3613
3614See Also:
3615****************************************************************************/
3616BERR_Code BXVD_GetChannelDefaultSettings
3617(
3618   BXVD_Handle             hXvd,           /* [in] XVD handle */
3619   unsigned int            uiChannelNum,   /* [in] channel Id */
3620   BXVD_ChannelSettings   *pChnDefSettings /* [out] default channel settings */
3621   );
3622
3623/***************************************************************************
3624Summary:
3625    API used to open a video channel.
3626
3627Description:
3628
3629Returns:
3630    BERR_SUCCESS
3631
3632See Also:
3633    BXVD_CloseChannel
3634****************************************************************************/
3635BERR_Code BXVD_OpenChannel
3636(
3637   BXVD_Handle                hXvd,           /* [in] XVD handle */
3638   BXVD_ChannelHandle         *phXvdCh,       /* [out] channel handle returned */
3639   unsigned int               uiChannelNum,   /* [in] channel# (starts with zero) */
3640   const BXVD_ChannelSettings *pChDefSettings /* [in] channel default settings */
3641   );
3642
3643/***************************************************************************
3644Summary:
3645    API used to close a channel
3646
3647Description:
3648
3649Returns:
3650    BERR_SUCCESS
3651
3652See Also:
3653    BXVD_OpenChannel
3654***************************************************************************/
3655BERR_Code BXVD_CloseChannel
3656(
3657   BXVD_ChannelHandle      hXvdCh          /* [in] The XVD Channel handle */
3658   );
3659
3660/***************************************************************************
3661Summary:
3662  Gets the status of the specified channel.
3663
3664Description:
3665  This API returns the status of the channel specified by the channel handle.
3666  The picture delivery queue count and picture delivery underflow count is returned
3667  in the ChannelStatus structure.
3668
3669
3670Returns:
3671  BERR_SUCCESS
3672  BERR_INVALID_PARAMETER
3673
3674See Also:
3675****************************************************************************/
3676BERR_Code BXVD_GetChannelStatus
3677(
3678   BXVD_ChannelHandle hXvdCh,          /* [in] channel handle */
3679   BXVD_ChannelStatus *psChannelStatus /* [out] channel status */
3680   );
3681
3682/***************************************************************************
3683Summary:
3684  ISR version of BXVD_GetChannelStatus
3685
3686See Also:
3687  BXVD_GetChannelStatus
3688****************************************************************************/
3689BERR_Code BXVD_GetChannelStatus_isr
3690(
3691   BXVD_ChannelHandle hXvdCh,          /* [in] channel handle */
3692   BXVD_ChannelStatus *psChannelStatus /* [out] channel status */
3693   );
3694
3695/***************************************************************************
3696Summary:
3697    This API is used to register the VDC interrupt with the video firmware.
3698Description:
3699    The VDC PI uses this API to register the channel specific RDMA done
3700    interrupt with the firmware. The firmware then waits on this interrupt to
3701    issue the Picture data ready interrupt.
3702Returns:
3703    BERR_SUCCESS
3704
3705See Also:
3706
3707
3708****************************************************************************/
3709BERR_Code BXVD_RegisterVdcInterrupt
3710(
3711   BXVD_ChannelHandle  hXvdChn,       /* [in] XVD Channel handle */
3712   BINT_Id             VDCIntId,      /* [in] VDC interrupt needs to be registered in FW */
3713   BAVC_Polarity       eFieldPolarity /* [in] Display Polarity for interrupt coming to FW */
3714   );
3715
3716/***************************************************************************
3717Summary:
3718    Used to enable and install an application callback for channel
3719    relevant interrupt.
3720
3721Description:
3722    This API should be used by the application /syslib to enable an XVD
3723    channel specific interrupt enumerated by the BXVD_Interrupt enum and
3724    can also optionally install a callback.
3725
3726Returns:
3727    BERR_SUCCESS
3728        BERR_INVALID_PARAMETER
3729
3730See Also:
3731****************************************************************************/
3732BERR_Code BXVD_InstallInterruptCallback
3733(
3734   BXVD_ChannelHandle hXvdCh,    /* [in] XVD device handle */
3735   BXVD_Interrupt eInterrupt,    /* [in] Desired interrupt that needs to be activated */
3736   BXVD_CallbackFunc fCallBack,  /* [in] XVD callback function */
3737   void *pParm1,                 /* [in] application specified parameter */
3738   int  parm2                    /* [in] application specified parameter */
3739   );
3740
3741
3742/***************************************************************************
3743Summary:
3744    Used to disable and un-install an application callback for a channel
3745    relevant interrupt.
3746
3747Description:
3748    This API should be used by the application /syslib to disable an XVD
3749    specific interrupt for a given channe; handle enumerated by the
3750    BXVD_Interrupt enum and can also optionally uninstall the callback for
3751    the same.
3752
3753Returns:
3754    BERR_SUCCESS
3755        BERR_INVALID_PARAMETER
3756
3757See Also:
3758
3759****************************************************************************/
3760BERR_Code BXVD_UnInstallInterruptCallback
3761(
3762   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
3763   BXVD_Interrupt eInterrupt  /* [in] Desired interrupt to disable */
3764   );
3765
3766/***************************************************************************
3767Summary:
3768  Used to enable or disable the specified interrupt. ISR version
3769
3770Description:
3771  This function is used to either enable or disable the interrupt specified
3772  in the eInterrupt argument.
3773
3774Returns:
3775  BERR_SUCCESS
3776  BERR_INVALID_PARAMETER
3777
3778See Also:
3779  BXVD_EnableInterrupt
3780****************************************************************************/
3781BERR_Code BXVD_EnableInterrupt_isr(
3782   BXVD_ChannelHandle hXvdCh,
3783   BXVD_Interrupt eInterrupt,
3784   BXVD_InterruptEnable eEnable
3785   );
3786
3787/***************************************************************************
3788Summary:
3789  Used to enable or disable the specified interrupt. Non-ISR version
3790
3791Description:
3792  This function is used to either enable or disable the interrupt specified
3793  in the eInterrupt argument.
3794
3795Returns:
3796  BERR_SUCCESS
3797  BERR_INVALID_PARAMETER
3798
3799See Also:
3800  BXVD_EnableInterrupt_isr
3801****************************************************************************/
3802BERR_Code BXVD_EnableInterrupt(
3803   BXVD_ChannelHandle hXvdCh,
3804   BXVD_Interrupt eInterrupt,
3805   BXVD_InterruptEnable eEnable
3806   );
3807
3808
3809/*******************/
3810/* XVD Decode APIs */
3811/*******************/
3812
3813/***************************************************************************
3814Summary:
3815    Gets the default settings of a XVD channel decode.
3816
3817Description:
3818
3819Returns:
3820    BERR_SUCCESS
3821
3822See Also:
3823****************************************************************************/
3824BERR_Code BXVD_GetDecodeDefaultSettings
3825(
3826   BXVD_ChannelHandle   hXvdCh,             /* [in] XVD channel handle */
3827   BXVD_DecodeSettings  *pdecodeDefSettings /* [out] default channel settings */
3828   );
3829
3830/***************************************************************************
3831Summary:
3832    Starts decode on a given channel.
3833
3834Description:
3835    This API is required to start the decode of the selected channel (stream)
3836    Sets the pid in the Video Transport and enables the specified Decode
3837    Channel of the Decoder. All the relevant channel/stream  information
3838    needs to conveyed through the BXVD_BXVD_DecodeSettings struct.
3839
3840Returns:
3841    BERR_SUCCESS
3842
3843See Also:
3844****************************************************************************/
3845BERR_Code BXVD_StartDecode
3846(
3847   BXVD_ChannelHandle               hXvdChannel,      /* [in] channel handle */
3848   const BXVD_DecodeSettings       *psDecodeSettings  /* [in] video info */
3849   );
3850
3851/***************************************************************************
3852Summary:
3853    Stops the decode on a channel.
3854
3855Description:
3856    This API stops the decode of the specified channel(stream)
3857    Disables the pid in the Video Transport and closes the specified Decode
3858    Channel of the Decoder.
3859
3860Returns:
3861    BERR_SUCCESS
3862
3863See Also:
3864****************************************************************************/
3865BERR_Code BXVD_StopDecode
3866(
3867   BXVD_ChannelHandle  hXvdChannel    /* [in] channel handle */
3868   );
3869
3870/***************************************************************************
3871Summary:
3872    Returns the last decode settings for a specific channel.
3873
3874Description:
3875    Applications can query the current decode settings for a specific channel.
3876
3877Returns:
3878    BERR_SUCCESS
3879
3880See Also:
3881****************************************************************************/
3882BERR_Code BXVD_GetDecodeSettings
3883(
3884   const BXVD_ChannelHandle      hXvdCh,             /* [in] channel handle */
3885   BXVD_DecodeSettings          *psDecodeSettings    /* [out] decode settings */
3886   );
3887
3888/***************************************************************************
3889Summary:
3890    Disables the decode on a channel, preparing for a flush.
3891
3892Description:
3893    This API flushes all state of the decoder channel. Functionally it's
3894    equalient to Stop decode, however _all_ decoder state programmed
3895    by a host is preserved after flush. This function is usually used during
3896    transitions, when host have introduced discontinuity in the stream, e.g.
3897    it's often case for transitions between trickmodes.
3898
3899Returns:
3900    BERR_SUCCESS
3901
3902See Also:
3903   BXVD_StopDecode, BXVD_StartDecode
3904****************************************************************************/
3905BERR_Code BXVD_DisableForFlush
3906(
3907   BXVD_ChannelHandle  hXvdChannel    /* [in] channel handle */
3908   );
3909
3910/***************************************************************************
3911Summary:
3912    Flushes the decode on a channel.
3913
3914Description:
3915    This API flushes all state of the decoder channel. Functionally it's
3916    equalient to Start decode, however _all_ decoder state programmed
3917    by a host is preserved after flush. This function is usually used during
3918    transitions, when host have introduced discontinuity in the stream, e.g.
3919    it's often case for transitions between trickmodes.
3920
3921Returns:
3922    BERR_SUCCESS
3923
3924See Also:
3925   BXVD_StopDecode, BXVD_StartDecode
3926****************************************************************************/
3927BERR_Code BXVD_FlushDecode
3928(
3929   BXVD_ChannelHandle  hXvdChannel    /* [in] channel handle */
3930   );
3931
3932/***************************************************************************
3933Summary:
3934  Decodes a still picture specified by RaveContext and type.
3935
3936Description:
3937  Decodes a still picture specified by RaveContext and type. The Rave context
3938  will be passed to the decoder firmware to initiate a still picture decode.
3939
3940Returns:
3941  BERR_SUCCESS  Still picture decode in progress
3942  BERR_INVALID_PARAMETER  Bad input parameter
3943
3944See Also:
3945
3946****************************************************************************/
3947BERR_Code BXVD_DecodeStillPicture
3948(
3949   BXVD_ChannelHandle   hXvdCh,       /* [in] The XVD Channel handle */
3950   BXVD_DecodeStillMode ePictureType, /* [in] Still picture type */
3951   BAVC_XptContextMap   *pContextMap  /* [in] Rave context map */
3952   );
3953
3954/***************************************************************************
3955Summary:
3956
3957This routine is used to reset the still picture decoder state.
3958
3959Description:
3960
3961When a still picture decode fails a
3962BXVD_DeviceInterrupt_eDecodedStillBufferReady callback will not be invoked.
3963This most likely is caused by an error that occurred performing the still picture
3964decode operation. This routine will reset still picture state, the still
3965picture channel will be stopped, ready for the next still picture to be decoded
3966using BXVD_DecodeStillPicture.
3967
3968Returns:
3969  BERR_SUCCESS
3970****************************************************************************/
3971BERR_Code BXVD_DecodeStillPictureReset
3972(
3973   BXVD_ChannelHandle   hXvdCh
3974   );
3975
3976/***************************************************************************
3977Summary:
3978    Used to set skip picture mode decode.
3979Description:
3980    This API can be used to configure the decoder into skipping B pictures
3981    or B and P pictures to achieve a kind of fastforward.
3982Returns:
3983    BERR_SUCCESS
3984
3985See Also:
3986****************************************************************************/
3987BERR_Code BXVD_SetSkipPictureModeDecode
3988(
3989   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
3990   BXVD_SkipMode eSkipMode    /* [in] new skip mode */
3991   );
3992
3993/***************************************************************************
3994Summary:
3995    Used to get the current skip picture mode decode.
3996Description:
3997    This API is used to get the current skip picture decode mode.
3998Returns:
3999    BERR_SUCCESS
4000
4001See Also:
4002****************************************************************************/
4003BERR_Code BXVD_GetSkipPictureModeConfig
4004(
4005   BXVD_ChannelHandle hXvdCh,     /* [in] XVD channel handle */
4006   BXVD_SkipMode      *peSkipMode /* [out] ptr to current skip mode */
4007   );
4008
4009
4010/************************/
4011/* Display Manager APIs */
4012/************************/
4013
4014/*********************************/
4015/* Display Manager APIs - Status */
4016/*********************************/
4017
4018/***************************************************************************
4019Summary:
4020    API used to get the current PTS.
4021Description:
4022    This API is used to get the running Presentation Time Stamp from the
4023    video decoder. The running PTS value and PTS type are updated in the
4024        BXVD_PTSInfo structure provided by the caller.
4025
4026Returns:
4027    BERR_SUCCESS
4028
4029See Also:
4030        BXVD_GetPTS_isr
4031****************************************************************************/
4032BERR_Code BXVD_GetPTS
4033(
4034   BXVD_ChannelHandle      hXvdCh,   /* [in] XVD Channel handle */
4035   BXVD_PTSInfo           *pPTSInfo  /* [out] PTS Info is returned*/
4036   );
4037
4038/***************************************************************************
4039Summary:
4040    ISR version of BXVD_GetPTS
4041
4042See Also:
4043    BXVD_GetPTS
4044****************************************************************************/
4045BERR_Code BXVD_GetPTS_isr
4046(
4047   BXVD_ChannelHandle      hXvdCh,   /* [in] XVD Channel handle */
4048   BXVD_PTSInfo           *pPTSInfo  /* [out] PTS Info is returned*/
4049   );
4050
4051/***************************************************************************
4052Summary:
4053    API used to get the last coded PTS.
4054Description:
4055    This API is used to get the last coded Presentation Time STamp from the
4056    video decoder. The PTS value returned by this API corresponds to the
4057    to the last coded PTS that arrived in the stream.
4058Returns:
4059    BERR_SUCCESS
4060
4061See Also:
4062
4063
4064****************************************************************************/
4065BERR_Code BXVD_GetLastCodedPTS
4066(
4067   BXVD_ChannelHandle   hXvdCh,   /* [in] The XVD Channel handle */
4068   BXVD_PTSInfo         *pPTSInfo /* [out] PTS Info is returned*/
4069   );
4070
4071/***************************************************************************
4072Summary:
4073    ISR version of BXVD_GetLastCodedPTS
4074
4075See Also:
4076   BXVD_GetLastCodedPTS
4077***************************************************************************/
4078BERR_Code BXVD_GetLastCodedPTS_isr
4079(
4080   BXVD_ChannelHandle   hXvdCh,   /* [in] The XVD Channel handle */
4081   BXVD_PTSInfo         *pPTSInfo /* [out] PTS Info is returned*/
4082   );
4083
4084/***************************************************************************
4085Summary:
4086  Used to get the PTS value of the next picture in the picture
4087  delivery queue.  A coded PTS is returned if one exists, otherwise an
4088  interpolated PTS is returned.
4089
4090  If there isn't a next picture available in the queue, an error
4091  result code is returned.
4092
4093See Also:
4094  BXVD_GetNextPTS_isr
4095****************************************************************************/
4096BERR_Code BXVD_GetNextPTS
4097(
4098   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4099   BXVD_PTSInfo *pPTSInfo /* [out] PTS Info is returned*/
4100   );
4101
4102/***************************************************************************
4103Summary:
4104  ISR version of BXVD_GetNextPTS
4105
4106See Also:
4107  BXVD_GetNextPTS
4108****************************************************************************/
4109BERR_Code BXVD_GetNextPTS_isr
4110(
4111   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4112   BXVD_PTSInfo *pPTSInfo /* [out] PTS Info is returned*/
4113   );
4114
4115/***************************************************************************
4116Summary:
4117  This API retrieves the I picture found status.
4118
4119Description:
4120  Used to indicate the presents of a HITS type stream. This is a stream with
4121  no I pictures and progressive I slice refresh.
4122
4123Returns:
4124  BERR_SUCCESS
4125
4126See Also:
4127
4128****************************************************************************/
4129BERR_Code BXVD_GetIPictureFoundStatus
4130(
4131   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
4132   bool *pbIPictureFound /* [out] current I picture found status */
4133   );
4134
4135/***************************************************************************
4136Summary:
4137    ISR version of BXVD_GetIPictureFoundStatus
4138
4139See Also:
4140    BXVD_GetIPictureFoundStatus
4141****************************************************************************/
4142BERR_Code BXVD_GetIPictureFoundStatus_isr
4143(
4144   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
4145   bool *pbIPictureFound /* [out] current I picture found status */
4146   );
4147
4148/***************************************************************************
4149Summary:
4150    Get the picture tag last seen in the stream
4151Description:
4152    This API reads the picture tag that was last seen in the stream
4153    by decoder. Picture tag is injected by host in bud packets.
4154Returns:
4155    BERR_SUCCESS
4156See Also:
4157****************************************************************************/
4158BERR_Code BXVD_GetPictureTag
4159(
4160   BXVD_ChannelHandle  hXvdCh,          /* [in] XVD Channel handle */
4161   unsigned long       *pulPictureTag   /* [Out] current PictureTag */
4162   );
4163
4164/***************************************************************************
4165Summary:
4166    ISR version of BXVD_GetPictureTag
4167
4168See Also:
4169    BXVD_GetPictureTag
4170****************************************************************************/
4171BERR_Code BXVD_GetPictureTag_isr
4172(
4173   BXVD_ChannelHandle  hXvdCh,          /* [in] XVD Channel handle */
4174   unsigned long       *pulPictureTag   /* [Out] current PictureTag */
4175   );
4176
4177/***************************************************************************
4178Summary:
4179    Get the current SMPTE time code as per ISO/IEC 13818-2
4180Description:
4181    This API reads the current SMPTE time codes coming in the MPEG stream
4182        as per the standard ISO/IEC 13818-2. This value typically comes in once
4183        in every GOP or approximately 15 pictures.
4184Returns:
4185    BERR_SUCCESS
4186See Also:
4187        None
4188****************************************************************************/
4189BERR_Code BXVD_GetGopTimeCode
4190(
4191   BXVD_ChannelHandle hXvdCh,       /* [in]  The XVD channel handle    */
4192   BXVD_GopTimeCode   *pGopTimeCode /* [out] The current GOP time code */
4193   );
4194
4195/***************************************************************************
4196Summary:
4197    ISR version of BXVD_GetGopTimeCode
4198
4199See Also:
4200    BXVD_GetGopTimeCode
4201****************************************************************************/
4202BERR_Code BXVD_GetGopTimeCode_isr
4203(
4204   BXVD_ChannelHandle hXvdCh,       /* [in]  The XVD channel handle    */
4205   BXVD_GopTimeCode   *pGopTimeCode /* [out] The current GOP time code */
4206   );
4207
4208/**********************************/
4209/* Display Manager APIs - Display */
4210/**********************************/
4211
4212/***************************************************************************
4213Summary:
4214    The Application can override the decoder mute with this API.
4215Description:
4216    The user can typically mute the video for Pay Per View/Parental Control
4217    applications. If enabled, XVD will pass a mute request to VDC in the
4218    call back. If disabled, XVD will pass back the info received from FW.
4219
4220Returns:
4221    BERR_SUCCESS
4222
4223See Also:
4224***************************************************************************/
4225BERR_Code BXVD_EnableMute
4226(
4227   BXVD_ChannelHandle hXvdCh,   /* [in] channel handle */
4228   bool bEnable                 /* [in] true=force mute, false=use info passed back from FW */
4229   );
4230
4231/***************************************************************************
4232Summary:
4233    ISR version of BXVD_EnableMute
4234
4235See Also:
4236   BXVD_EnableMute
4237***************************************************************************/
4238BERR_Code BXVD_EnableMute_isr
4239(
4240   BXVD_ChannelHandle hXvdCh,   /* [in] channel handle */
4241   bool bEnable                 /* [in] true=force mute, false=use info passed back from FW */
4242   );
4243
4244/***************************************************************************
4245Summary:
4246    API used to set the display field mode.
4247Description:
4248    This function enables various types of field display enumerated by the
4249    BXVD_DisplayFieldType enum. The various options available are Top field
4250    only display, Bottom field only display and normal display(both field).
4251
4252Returns:
4253    BERR_SUCCESS
4254
4255See Also:
4256****************************************************************************/
4257BERR_Code BXVD_SetDisplayFieldMode
4258(
4259   BXVD_ChannelHandle     hXvdCh,           /* [in] XVD Channel handle */
4260   BXVD_DisplayFieldType  eDisplayFieldType /* [in] display field type */
4261   );
4262
4263/***************************************************************************
4264Summary:
4265    ISR version of BXVD_SetDisplayFieldMode
4266
4267See Also:
4268    BXVD_SetDisplayFieldMode
4269****************************************************************************/
4270BERR_Code BXVD_SetDisplayFieldMode_isr
4271(
4272   BXVD_ChannelHandle    hXvdCh,
4273   BXVD_DisplayFieldType eDisplayFieldType
4274   );
4275
4276/***************************************************************************
4277Summary:
4278    Gets the video display mode status.
4279Description:
4280    This API is used to get the display mode status enumerated by the
4281    BXVD_DisplayMode.
4282
4283Returns:
4284    BERR_SUCCESS
4285
4286See Also:
4287****************************************************************************/
4288BERR_Code BXVD_GetDisplayFieldMode
4289(
4290   BXVD_ChannelHandle     hXvdCh,             /* [in] XVD Channel handle */
4291   BXVD_DisplayFieldType  *peDisplayFieldType /* [out] video display mode */
4292   );
4293
4294/***************************************************************************
4295Summary:
4296    ISR version pf BXVD_GetDisplayFieldMode
4297
4298See Also:
4299    BXVD_GetDisplayFieldMode
4300****************************************************************************/
4301BERR_Code BXVD_GetDisplayFieldMode_isr
4302(
4303   BXVD_ChannelHandle     hXvdCh,             /* [in] XVD Channel handle */
4304   BXVD_DisplayFieldType  *peDisplayFieldType /* [out] video display mode */
4305   );
4306
4307/***************************************************************************
4308Summary:
4309  This API sets the channel change mode for DM.
4310
4311Description:
4312  DM needs to know how to handle video during/after a channel change. This
4313  API allows you to set the channel change mode to the type specified by the
4314  eChChangeMode argument.
4315
4316Returns:
4317  BERR_SUCCESS
4318  BERR_INVALID_PARAMETER
4319
4320See Also:
4321  BXVD_GetChannelChangeMode
4322
4323****************************************************************************/
4324BERR_Code BXVD_SetChannelChangeMode
4325(
4326   BXVD_ChannelHandle hXvdCh,           /* [in] XVD channel handle */
4327   BXVD_ChannelChangeMode eChChangeMode /* [in] desired channel change mode */
4328   );
4329
4330/***************************************************************************
4331Summary:
4332    ISR version of BXVD_SetChannelChangeMode
4333
4334See Also:
4335    BXVD_SetSetChannelChangeMode
4336****************************************************************************/
4337BERR_Code BXVD_SetChannelChangeMode_isr
4338(
4339   BXVD_ChannelHandle hXvdCh,           /* [in] XVD channel handle */
4340   BXVD_ChannelChangeMode eChChangeMode /* [in] desired channel change mode */
4341   );
4342
4343/***************************************************************************
4344Summary:
4345  This API retrieves the current channel change mode.
4346
4347Description:
4348  Returns the current channel change mode in the peChChangeMode argument.
4349
4350Returns:
4351  BERR_SUCCESS
4352  BERR_INVALID_PARAMETER
4353
4354See Also:
4355  BXVD_SetChannelChangeMode
4356
4357****************************************************************************/
4358BERR_Code BXVD_GetChannelChangeMode
4359(
4360   BXVD_ChannelHandle hXvdCh,             /* [in] XVD channel handle */
4361   BXVD_ChannelChangeMode *peChChangeMode /* [out] current channel change mode */
4362   );
4363
4364/***************************************************************************
4365Summary:
4366    ISR version of BXVD_GetChannelChangeMode
4367
4368See Also:
4369    BXVD_GetChannelChangeMode
4370****************************************************************************/
4371BERR_Code BXVD_GetChannelChangeMode_isr
4372(
4373   BXVD_ChannelHandle hXvdCh,             /* [in] XVD channel handle */
4374   BXVD_ChannelChangeMode *peChChangeMode /* [out] current channel change mode */
4375   );
4376
4377/***************************************************************************
4378Summary:
4379    This API sets the SPIM for the video decoder.
4380
4381Description:
4382    This function overrides the internally computed interpolation mode
4383    which decides how the scanout should be in when a single picture is
4384    repeatedly displayed i.e. when
4385    the user see still picture in the display. This will be required during
4386    Video Pause, Video Freeze or when MTPMV has not got a new pictures to
4387    display but repeat what was displayed last. Depending on this intepolation
4388    mode setting the display manager keeps on displaying field or frame.
4389    In field it can be either last displayed field, or both fields.
4390
4391    Note: This API needs to be used only in a experimental mode. It is
4392    recommended to use the XVD's internal correct display algo to make
4393    decisions for the SPIM and MPIM.
4394Returns:
4395    BERR_SUCCESS
4396
4397See Also:
4398
4399****************************************************************************/
4400BERR_Code BXVD_SetInterpolationModeForStillContent
4401(
4402   BXVD_ChannelHandle hXvdCh,          /* [in] The XVD Channel handle */
4403   BXVD_StillContentInterpolationMode  eNewInterpolation  /* [in] The still
4404                                                             content interpolation
4405                                                             mode */
4406   );
4407
4408/***************************************************************************
4409Summary:
4410    ISR version of BXVD_SetInterpolationModeForStillContent
4411
4412See Also:
4413    BXVD_SetInterpolationModeForStillContent
4414****************************************************************************/
4415BERR_Code BXVD_SetInterpolationModeForStillContent_isr
4416(
4417   BXVD_ChannelHandle hXvdCh,          /* [in] The XVD Channel handle */
4418   BXVD_StillContentInterpolationMode  eNewInterpolation  /* [in] The still
4419                                                             content interpolation
4420                                                             mode */
4421   );
4422
4423/***************************************************************************
4424Summary:
4425    This function gets the still content interpolation mode(SPIM).
4426
4427Description:
4428    The possible SPIMs are enumerated in BXVD_StillContentInterpolationMode.
4429    CDB underflows, trick mode conditions like pause are also considered as
4430    still content.
4431
4432Returns:
4433    BERR_SUCCESS
4434
4435See Also:
4436
4437****************************************************************************/
4438BERR_Code  BXVD_GetInterpolationModeForStillContent
4439(
4440   BXVD_ChannelHandle hXvdChn,  /* [in] The XVD Channel handle */
4441   BXVD_StillContentInterpolationMode *peStillContentIntrpMode /* [out]
4442                                                                  The still content interpolation mode */
4443   );
4444
4445/***************************************************************************
4446Summary:
4447    ISR version of BXVD_GetInterpolationModeForStillContent
4448
4449See Also:
4450    BXVD_GetInterpolationModeForStillContent
4451****************************************************************************/
4452BERR_Code  BXVD_GetInterpolationModeForStillContent_isr
4453(
4454   BXVD_ChannelHandle hXvdChn,  /* [in] The XVD Channel handle */
4455   BXVD_StillContentInterpolationMode *peStillContentIntrpMode /* [out]
4456                                                                  The still content interpolation mode */
4457   );
4458
4459/***************************************************************************
4460Summary:
4461    This API sets the MPIM for the video decoder.
4462
4463Description:
4464    This function overrides the internally computed interpolation mode
4465    which decides how the scanout
4466    should be in normal running video. Depending on intepolation mode
4467    display manager displays interlaced or progressive video.
4468
4469    Note: This API needs to be used only in a experimental mode. It is
4470    recommended to use the XVD's internal correct display algo to make
4471    decisions for the SPIM and MPIM.
4472
4473Returns:
4474    BERR_SUCCESS
4475
4476See Also:
4477
4478
4479****************************************************************************/
4480BERR_Code BXVD_SetInterpolationModeForMovingContent
4481(
4482   BXVD_ChannelHandle hXvdChn,     /* [in] The XVD Channel handle */
4483   BXVD_MovingContentInterpolationMode    eNewInterpolation  /* [in] The interpolation
4484                                                                mode for motion content.*/
4485   );
4486
4487/***************************************************************************
4488Summary:
4489   ISR version of BXVD_SetInterpolationModeForMovingContent
4490
4491See Also:
4492   BXVD_SetInterpolationModeForMovingContent
4493****************************************************************************/
4494BERR_Code BXVD_SetInterpolationModeForMovingContent_isr
4495(
4496   BXVD_ChannelHandle hXvdChn,     /* [in] The XVD Channel handle */
4497   BXVD_MovingContentInterpolationMode    eNewInterpolation  /* [in] The interpolation
4498                                                                mode for motion content.*/
4499   );
4500
4501/***************************************************************************
4502Summary:
4503    This function gets interpolation mode for moving content.
4504Description:
4505    The possible MPIMs are enumerated in BXVD_MovingContentInterpolationMode.
4506Returns:
4507    BERR_SUCCESS
4508
4509See Also:
4510
4511
4512****************************************************************************/
4513BERR_Code BXVD_GetInterpolationModeForMovingContent
4514(
4515   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4516   BXVD_MovingContentInterpolationMode    *peNewInterpolation /* [out] Moving
4517                                                                 content interpolation Mode */
4518   );
4519
4520/***************************************************************************
4521Summary:
4522   ISR version of BXVD_GetInterpolationModeForMovingContent
4523
4524See Also:
4525   BXVD_GetInterpolationModeForMovingContent
4526****************************************************************************/
4527BERR_Code BXVD_GetInterpolationModeForMovingContent_isr
4528(
4529   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4530   BXVD_MovingContentInterpolationMode    *peNewInterpolation /* [out] Moving
4531                                                                 content interpolation Mode */
4532   );
4533
4534/***************************************************************************
4535Summary:
4536    Used to set the monitor refresh rate
4537
4538Description:
4539    This API is used to set the value of the monitor refresh rate. The refresh
4540  rate is specified as ONE of the following values:
4541
4542    BFMT_VERT_50Hz
4543    BFMT_VERT_59_94Hz
4544    BFMT_VERT_60Hz
4545    BFMT_VERT_70Hz
4546    BFMT_VERT_72Hz
4547    BFMT_VERT_75Hz
4548    BFMT_VERT_85Hz
4549    BFMT_VERT_23_976Hz
4550    BFMT_VERT_24Hz
4551    BFMT_VERT_25Hz
4552    BFMT_VERT_30Hz
4553
4554These values are specified one at a time to BXVD_SetMonitorRefreshRate.
4555Although each of these values is capable of being OR'ed to form a bit mask,
4556doing so will produce unspecified results.
4557
4558Returns:
4559    BERR_SUCCESS
4560
4561See Also:
4562  BXVD_GetMonitorRefreshRate
4563****************************************************************************/
4564BERR_Code BXVD_SetMonitorRefreshRate
4565(
4566   BXVD_ChannelHandle hXvdCh,      /* [in] XVD channel handle */
4567   uint32_t ui32MonitorRefreshRate /* [in] monitor refresh rate value */
4568   );
4569
4570/***************************************************************************
4571Summary:
4572   ISR version of BXVD_SetMonitorRefreshRate
4573
4574See Also:
4575   BXVD_SetMonitorRefreshRate
4576****************************************************************************/
4577BERR_Code BXVD_SetMonitorRefreshRate_isr
4578(
4579   BXVD_ChannelHandle hXvdCh,      /* [in] XVD channel handle */
4580   uint32_t ui32MonitorRefreshRate /* [in] monitor refresh rate value */
4581   );
4582
4583/***************************************************************************
4584Summary:
4585    Used to get the current value of the monitor refresh rate
4586
4587Description:
4588    This API is used to get the current value of the monitor refresh rate.
4589  See the description of BXVD_SetMonitorRefreshRate for a summary of the
4590  values that will be returned from this API.
4591
4592Returns:
4593    BERR_SUCCESS
4594
4595See Also:
4596  BXVD_SetMonitorRefreshRate
4597****************************************************************************/
4598BERR_Code BXVD_GetMonitorRefreshRate
4599(
4600   BXVD_ChannelHandle hXvdCh,        /* [in] XVD channel handle */
4601   uint32_t *pui32MonitorRefreshRate /* [out] monitor refresh rate value */
4602   );
4603
4604/***************************************************************************
4605Summary:
4606   ISR version of BXVD_GetMonitorRefreshRate
4607
4608See Also:
4609   BXVD_GetMonitorRefreshRate
4610****************************************************************************/
4611BERR_Code BXVD_GetMonitorRefreshRate_isr
4612(
4613   BXVD_ChannelHandle hXvdCh,        /* [in] XVD channel handle */
4614   uint32_t *pui32MonitorRefreshRate /* [out] monitor refresh rate value */
4615   );
4616
4617/***************************************************************************
4618Summary:
4619  Used to freeze video while the decoder continues to run
4620
4621Description:
4622  This function is used during live decode to freeze video. The decoder will
4623  continue to run in the background.
4624
4625Returns:
4626    BERR_SUCCESS
4627
4628See Also:
4629  BXVD_DisableVideoFreeze, BXVD_GetVideoFreezeState
4630****************************************************************************/
4631BERR_Code BXVD_EnableVideoFreeze
4632(
4633   BXVD_ChannelHandle hXvdCh /* [in] XVD channel handle */
4634   );
4635
4636/***************************************************************************
4637Summary:
4638   ISR version of BXVD_EnableVideoFreeze
4639
4640See Also:
4641   BXVD_EnableVideoFreeze
4642****************************************************************************/
4643BERR_Code BXVD_EnableVideoFreeze_isr
4644(
4645   BXVD_ChannelHandle hXvdCh /* [in] XVD channel handle */
4646   );
4647
4648/***************************************************************************
4649Summary:
4650  Used to re-enable previously frozen video
4651
4652Description:
4653  This function resumes the display of video previously stopped by a call to
4654  BXVD_EnableVideoFreeze.
4655
4656Returns:
4657    BERR_SUCCESS
4658
4659See Also:
4660  BXVD_DisableVideoFreeze, BXVD_GetVideoFreezeState
4661****************************************************************************/
4662BERR_Code BXVD_DisableVideoFreeze
4663(
4664   BXVD_ChannelHandle hXvdCh /* [in] XVD channel handle */
4665   );
4666
4667/***************************************************************************
4668Summary:
4669   ISR version of BXVD_DisableVideoFreeze
4670
4671See Also:
4672   BXVD_DisableVideoFreeze
4673****************************************************************************/
4674BERR_Code BXVD_DisableVideoFreeze_isr
4675(
4676   BXVD_ChannelHandle hXvdCh /* [in] XVD channel handle */
4677   );
4678
4679/***************************************************************************
4680Summary:
4681  Used to get the video freeze state
4682
4683Description:
4684  This function returns the current state of video freeze. True is returned
4685  the supplied return parameter if freeze is enabled, false otherwise.
4686
4687Returns:
4688    BERR_SUCCESS
4689
4690See Also:
4691  BXVD_EnableVideoFreeze, BXVD_DisableVideoFreeze
4692****************************************************************************/
4693BERR_Code BXVD_GetVideoFreezeState
4694(
4695   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
4696   bool             *bVFState /* [out] current video freeze state */
4697   );
4698
4699/***************************************************************************
4700Summary:
4701   ISR version of BXVD_GetVideoFreezeState
4702
4703See Also:
4704   BXVD_GetVideoFreezeState
4705****************************************************************************/
4706BERR_Code BXVD_GetVideoFreezeState_isr
4707(
4708   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
4709   bool             *bVFState /* [out] current video freeze state */
4710   );
4711
4712/***************************************************************************
4713Summary:
4714  Used to set the 1080p scan mode
4715
4716See Also:
4717  BXVD_Get1080pScanMode
4718****************************************************************************/
4719BERR_Code BXVD_Set1080pScanMode
4720(
4721   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4722   BXVD_1080pScanMode e1080pScanMode /* [in] The new 1080p scan mode */
4723   );
4724
4725/***************************************************************************
4726Summary:
4727   ISR version of BXVD_Set1080pScanMode
4728
4729See Also:
4730   BXVD_Set1080pScanMode
4731****************************************************************************/
4732BERR_Code BXVD_Set1080pScanMode_isr
4733(
4734   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4735   BXVD_1080pScanMode e1080pScanMode /* [in] The new 1080p scan mode */
4736   );
4737
4738/***************************************************************************
4739Summary:
4740  Used to get the 1080p scan mode
4741
4742See Also:
4743  BXVD_Set1080pScanMode
4744****************************************************************************/
4745BERR_Code BXVD_Get1080pScanMode
4746(
4747   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4748   BXVD_1080pScanMode *pe1080pScanMode /* [out] The current 1080p scan mode */
4749   );
4750
4751/***************************************************************************
4752Summary:
4753   ISR version of BXVD_Get1080pScanMode
4754
4755See Also:
4756   BXVD_Set1080pScanMode
4757****************************************************************************/
4758BERR_Code BXVD_Get1080pScanMode_isr
4759(
4760   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4761   BXVD_1080pScanMode *pe1080pScanMode /* [out] The current 1080p scan mode */
4762   );
4763
4764/***************************************************************************
4765Summary:
4766  Used to set the picture drop mode for the channel
4767
4768See Also:
4769  BXVD_SetPictureDropMode
4770  BXVD_GetPictureDropMode_isr
4771****************************************************************************/
4772BERR_Code BXVD_SetPictureDropMode
4773(
4774   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4775   BXVD_PictureDropMode ePictureDropMode /* [in] the picture drop mode */
4776   );
4777
4778/***************************************************************************
4779Summary:
4780  ISR version of BXVD_SetPictureDropMode
4781
4782See Also:
4783  BXVD_SetPictureDropMode
4784****************************************************************************/
4785BERR_Code BXVD_SetPictureDropMode_isr
4786(
4787   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4788   BXVD_PictureDropMode ePictureDropMode /* [in] the picture drop mode */
4789   );
4790
4791/***************************************************************************
4792Summary:
4793  Used to get the current picture drop mode for the channel
4794
4795See Also:
4796  BXVD_SetPictureDropMode
4797  BXVD_GetPictureDropMode_isr
4798****************************************************************************/
4799BERR_Code BXVD_GetPictureDropMode
4800(
4801   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4802   BXVD_PictureDropMode *pePictureDropMode /* [out] the current picture drop mode */
4803   );
4804
4805/***************************************************************************
4806Summary:
4807  ISR version of BXVD_GetPictureDropMode
4808
4809See Also:
4810  BXVD_GetPictureDropMode
4811****************************************************************************/
4812BERR_Code BXVD_GetPictureDropMode_isr
4813(
4814   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4815   BXVD_PictureDropMode *pePictureDropMode /* [out] the current picture drop mode */
4816   );
4817
4818/***************************************************************************
4819Summary:
4820  Used to set the 240i scan mode
4821
4822See Also:
4823  BXVD_Get240iScanMode
4824****************************************************************************/
4825BERR_Code BXVD_Set240iScanMode
4826(
4827   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4828   BXVD_240iScanMode e240iScanMode /* [in] The new 240i scan mode */
4829   );
4830
4831/***************************************************************************
4832Summary:
4833   ISR version of BXVD_Set240iScanMode
4834
4835See Also:
4836   BXVD_Set240iScanMode
4837****************************************************************************/
4838BERR_Code BXVD_Set240iScanMode_isr
4839(
4840   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4841   BXVD_240iScanMode e240iScanMode /* [in] The new 240i scan mode */
4842   );
4843
4844/***************************************************************************
4845Summary:
4846  Used to get the 240i scan mode
4847
4848See Also:
4849  BXVD_Set240iScanMode
4850****************************************************************************/
4851BERR_Code BXVD_Get240iScanMode
4852(
4853   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4854   BXVD_240iScanMode *pe240iScanMode /* [out] The current 240i scan mode */
4855   );
4856
4857/***************************************************************************
4858Summary:
4859   ISR version of BXVD_Get240iScanMode
4860
4861See Also:
4862   BXVD_Set240iScanMode
4863****************************************************************************/
4864BERR_Code BXVD_Get240iScanMode_isr
4865(
4866   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
4867   BXVD_240iScanMode *pe240iScanMode /* [out] The current 240i scan mode */
4868   );
4869
4870/******************************/
4871/* Display Manager APIs - TSM */
4872/******************************/
4873
4874/***************************************************************************
4875Summary:
4876    API used to set the display offset.
4877Description:
4878    The display offset supplied is applied for the specified channel.
4879    The Presentation Offset is a value used to compensate for any additional
4880    delay that arises from the data flow through the Compressed data buffer
4881    and Video Decoder and the Video back end display.
4882
4883 If decoding standard MPEG the display offset value is 1/45KHz.
4884 If decoding Direct-TV the display offset value is 1/27MHz.
4885
4886Returns:
4887    BERR_SUCCESS
4888
4889See Also:
4890    BXVD_GetDisplayOffset
4891    BXVD_SetDisplayOffset_isr
4892
4893****************************************************************************/
4894BERR_Code BXVD_SetDisplayOffset
4895(
4896   BXVD_ChannelHandle    hXvdCh,               /* [in] XVD Channel handle */
4897   long                  lDisplayOffsetValue   /* [in] display offset */
4898   );
4899
4900/***************************************************************************
4901Summary:
4902    ISR verion of API used to set the display offset.
4903Description:
4904    See BXVD_SetDisplayOffset
4905Returns:
4906    BERR_SUCCESS
4907
4908See Also:
4909    BXVD_GetDisplayOffset
4910    BXVD_SetDisplayOffset
4911
4912****************************************************************************/
4913BERR_Code BXVD_SetDisplayOffset_isr
4914(
4915   BXVD_ChannelHandle    hXvdCh,               /* [in] XVD Channel handle */
4916   long                  lDisplayOffsetValue   /* [in] display offset */
4917   );
4918
4919/***************************************************************************
4920Summary:
4921    API used to get the display offset.
4922Description:
4923    Use to retrieve display offset value
4924Returns:
4925    BERR_SUCCESS
4926
4927See Also:
4928    BXVD_SetDisplayOffset
4929    BXVD_SetDisplayOffset_isr
4930
4931****************************************************************************/
4932BERR_Code BXVD_GetDisplayOffset
4933(
4934   BXVD_ChannelHandle    hXvdCh,               /* [in] XVD Channel handle */
4935   long                 *plDisplayOffsetValue  /* [out] display offset */
4936   );
4937
4938/***************************************************************************
4939Summary:
4940    API used to get the display offset in isr context.
4941Description:
4942    See BXVD_GetDisplayOffset
4943Returns:
4944    BERR_SUCCESS
4945
4946See Also:
4947    BXVD_SetDisplayOffset
4948    BXVD_SetDisplayOffset_isr
4949
4950****************************************************************************/
4951BERR_Code BXVD_GetDisplayOffset_isr
4952(
4953   BXVD_ChannelHandle    hXvdCh,               /* [in] XVD Channel handle */
4954   long                 *plDisplayOffsetValue  /* [out] display offset */
4955   );
4956
4957/***************************************************************************
4958Summary:
4959    Used to set the display mode.
4960Description:
4961    This API is used to set the display mode enumerated by the
4962    BXVD_DisplayMode. The display can be configure to follow the STC ie in
4963    Time Stamp managed mode or in non Time Stamp mode ie in VSync mode.
4964
4965Returns:
4966    BERR_SUCCESS
4967
4968See Also:
4969****************************************************************************/
4970BERR_Code BXVD_SetVideoDisplayMode
4971(
4972   BXVD_ChannelHandle      hXvdCh,        /* [in] XVD Channel handle */
4973   BXVD_DisplayMode        eDisplayMode  /* [in] display mode requested */
4974   );
4975
4976/***************************************************************************
4977Summary:
4978   ISR version of BXVD_SetVideoDisplayMode
4979
4980See Also:
4981   BXVD_SetVideoDisplayMode
4982***************************************************************************/
4983BERR_Code BXVD_SetVideoDisplayMode_isr
4984(
4985   BXVD_ChannelHandle      hXvdCh,        /* [in] XVD Channel handle */
4986   BXVD_DisplayMode        eDisplayMode  /* [in] display mode requested */
4987   );
4988
4989/***************************************************************************
4990Summary:
4991    Used to get the display mode.
4992Description:
4993    This function is used to retrieve the video display mode
4994Returns:
4995    BERR_SUCCESS
4996
4997See Also:
4998****************************************************************************/
4999BERR_Code BXVD_GetVideoDisplayMode
5000(
5001   BXVD_ChannelHandle     hXvdCh,          /* [in] XVD Channel handle */
5002   BXVD_DisplayMode      *peDisplayMode   /* [out] display mode */
5003   );
5004
5005/***************************************************************************
5006Summary:
5007   ISR version of BXVD_GetVideoDisplayMode
5008
5009See Also:
5010   BXVD_GetVideoDisplayMode
5011***************************************************************************/
5012BERR_Code BXVD_GetVideoDisplayMode_isr
5013(
5014   BXVD_ChannelHandle     hXvdCh,          /* [in] XVD Channel handle */
5015   BXVD_DisplayMode      *peDisplayMode   /* [out] display mode */
5016   );
5017
5018/***************************************************************************
5019Summary:
5020    API used to get display threshold values
5021Description:
5022    This API is used to get current display thresholds. This was implemented
5023  by separate APIs for high and low thresholds and discard thresholds in XVD.
5024Returns:
5025    BERR_SUCCESS
5026
5027See Also:
5028
5029****************************************************************************/
5030BERR_Code BXVD_GetDisplayThresholds
5031(
5032   BXVD_ChannelHandle     hXvdCh,          /* [in] The XVD Channel handle */
5033   BXVD_DisplayThresholds *pDispThresholds /* [out] returned threshold info */
5034   );
5035
5036/***************************************************************************
5037Summary:
5038   ISR version of BXVD_GetDisplayThresholds
5039
5040See Also:
5041   BXVD_GetDisplayThresholds
5042***************************************************************************/
5043BERR_Code BXVD_GetDisplayThresholds_isr
5044(
5045   BXVD_ChannelHandle     hXvdCh,          /* [in] The XVD Channel handle */
5046   BXVD_DisplayThresholds *pDispThresholds /* [out] returned threshold info */
5047   );
5048
5049/***************************************************************************
5050Summary:
5051    API used to supply the decoder with display discard threshold.
5052
5053Description:
5054    The discard threshold can be specified through this API. If PTS-STC
5055    difference (STC lagging behind PTS) is more than display discard
5056    threshold, video decoder doesn't wait for STC to mature to PTS value
5057    for that field/frame and drops it.
5058
5059 Note that the value passed as a threshold to this API will be overwritten
5060 by the default value determined in BXVD_StartDecode. Therefore, this API
5061 must be called after BXVD_StartDecode in order to use a user-supplied
5062 discard threshold.
5063
5064Returns:
5065    BERR_SUCCESS
5066
5067See Also:
5068    BXVD_SetDisplayOffset
5069        BXVD_SetVeryLateThreshold
5070
5071****************************************************************************/
5072BERR_Code BXVD_SetDiscardThreshold
5073(
5074   BXVD_ChannelHandle hXvdChn,             /* [in] The XVD Channel handle */
5075   uint32_t           ui32DiscardThreshold /* [in] The discard thresshold */
5076   );
5077
5078/***************************************************************************
5079Summary:
5080   ISR version of BXVD_SetDiscardThreshold
5081
5082See Also:
5083   BXVD_SetDiscardThreshold
5084***************************************************************************/
5085BERR_Code BXVD_SetDiscardThreshold_isr
5086(
5087   BXVD_ChannelHandle hXvdChn,             /* [in] The XVD Channel handle */
5088   uint32_t           ui32DiscardThreshold /* [in] The discard thresshold */
5089   );
5090
5091/***************************************************************************
5092Summary:
5093    API used to supply the decoder with display very late threshold.
5094
5095Description:
5096    The very late threshold can be specified through this API. If PTS-STC
5097    difference (STC lagging behind PTS) is more than display very late
5098    threshold, the STC is set invalid and DM switches to non-TSM mode.
5099
5100 Note that the value passed as a threshold to this API will be overwritten
5101 by the default value determined in BXVD_StartDecode. Therefore, this API
5102 must be called after BXVD_StartDecode in order to use a user-supplied
5103 very late threshold.
5104
5105Returns:
5106    BERR_SUCCESS
5107
5108See Also:
5109        BXVD_SetDisplayOffset
5110        BXVD_SetDiscardThreshold
5111
5112****************************************************************************/
5113BERR_Code BXVD_SetVeryLateThreshold
5114(
5115   BXVD_ChannelHandle hXvdChn,              /* [in] The XVD Channel handle */
5116   uint32_t           ui32VeryLateThreshold /* [in] The very late thresshold */
5117   );
5118
5119/***************************************************************************
5120Summary:
5121   ISR version of BXVD_SetVeryLateThreshold
5122
5123See Also:
5124   BXVD_SetVeryLateThreshold
5125***************************************************************************/
5126BERR_Code BXVD_SetVeryLateThreshold_isr
5127(
5128   BXVD_ChannelHandle hXvdChn,              /* [in] The XVD Channel handle */
5129   uint32_t           ui32VeryLateThreshold /* [in] The very late thresshold */
5130   );
5131
5132/***************************************************************************
5133Summary:
5134    Used to set the state of the STC invalid flag
5135Description:
5136    This API is used to set the state of the STC invalid flag to true or false.
5137Returns:
5138    BERR_SUCCESS
5139
5140See Also:
5141****************************************************************************/
5142BERR_Code BXVD_SetSTCInvalidFlag
5143(
5144   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
5145   bool bStcInvalidFlag       /* [in] STC invalid flag state */
5146   );
5147
5148/***************************************************************************
5149Summary:
5150   ISR version of BXVD_SetSTCInvalidFlag
5151
5152See Also:
5153   BXVD_SetSTCInvalidFlag
5154***************************************************************************/
5155BERR_Code BXVD_SetSTCInvalidFlag_isr
5156(
5157   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
5158   bool bStcInvalidFlag       /* [in] STC invalid flag state */
5159   );
5160
5161/***************************************************************************
5162Summary:
5163    Used to get the current state of the STC invalid flag
5164Description:
5165    This API is used to get the current state of the STC invalid flag.
5166Returns:
5167    BERR_SUCCESS
5168
5169See Also:
5170****************************************************************************/
5171BERR_Code BXVD_GetSTCInvalidFlag
5172(
5173   BXVD_ChannelHandle hXvdCh,           /* [in] XVD channel handle */
5174   bool               *pbStcInvalidFlag /* [out] STC invalid flag value */
5175   );
5176
5177/***************************************************************************
5178Summary:
5179   ISR version of BXVD_GetSTCInvalidFlag
5180
5181See Also:
5182   BXVD_GetSTCInvalidFlag
5183***************************************************************************/
5184BERR_Code BXVD_GetSTCInvalidFlag_isr
5185(
5186   BXVD_ChannelHandle hXvdCh,           /* [in] XVD channel handle */
5187   bool               *pbStcInvalidFlag /* [out] STC invalid flag value */
5188   );
5189
5190/***************************************************************************
5191Summary:
5192  Used to set the Pts/Stc difference threshold
5193
5194Description:
5195  This function is used to set the Pts/Stc difference threshold.
5196
5197Returns:
5198    BERR_SUCCESS
5199
5200See Also:
5201  BXVD_GetPtsStcDiffThreshold
5202****************************************************************************/
5203BERR_Code BXVD_SetPtsStcDiffThreshold
5204(
5205   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
5206   long uiPtsStcDiffThreshold /* [in] Stc difference threshold */
5207   );
5208
5209/***************************************************************************
5210Summary:
5211   ISR version of BXVD_SetPtsStcDiffThreshold
5212
5213See Also:
5214   BXVD_SetPtsStcDiffThreshold
5215***************************************************************************/
5216BERR_Code BXVD_SetPtsStcDiffThreshold_isr
5217(
5218   BXVD_ChannelHandle hXvdCh, /* [in] XVD channel handle */
5219   long uiPtsStcDiffThreshold /* [in] Stc difference threshold */
5220   );
5221
5222/***************************************************************************
5223Summary:
5224  Used to get the Pts/Stc difference threshold
5225
5226Description:
5227  This function returns the current value of the Pts/Stc difference threshold.
5228
5229Returns:
5230    BERR_SUCCESS
5231
5232See Also:
5233  BXVD_SetPtsStcDiffThreshold
5234****************************************************************************/
5235BERR_Code BXVD_GetPtsStcDiffThreshold
5236(
5237   BXVD_ChannelHandle hXvdCh,   /* [in] XVD channel handle */
5238   long *puiPtsStcDiffThreshold /* [out] Stc difference threshold */
5239   );
5240
5241/***************************************************************************
5242Summary:
5243   ISR version of BXVD_GetPtsStcDiffThreshold
5244
5245See Also:
5246   BXVD_GetPtsStcDiffThreshold
5247***************************************************************************/
5248BERR_Code BXVD_GetPtsStcDiffThreshold_isr
5249(
5250   BXVD_ChannelHandle hXvdCh,   /* [in] XVD channel handle */
5251   long *puiPtsStcDiffThreshold /* [out] Stc difference threshold */
5252   );
5253
5254/***************************************************************************
5255Summary:
5256  Used to set the source STC time base. (Non-ISR version)
5257
5258Description:
5259  TSM calculations will be based on the STC counter value of the
5260  specified time base.  This permanently overrides the time base
5261  specified in BXVD_StartDecode.
5262
5263Returns:
5264  BERR_SUCCESS
5265  BERR_INVALID_PARAMETER
5266
5267See Also:
5268  BXVD_StartDecode
5269  BXVD_SetSTCSource_isr
5270****************************************************************************/
5271BERR_Code BXVD_SetSTCSource
5272(
5273   BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
5274   BXVD_STC eSTC               /* [in] STC Time base */
5275   );
5276
5277/***************************************************************************
5278Summary:
5279  ISR version of BXVD_SetSTCSource
5280
5281See Also:
5282  BXVD_SetSTCSource
5283****************************************************************************/
5284BERR_Code BXVD_SetSTCSource_isr
5285(
5286   BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
5287   BXVD_STC eSTC               /* [in] STC Time base */
5288   );
5289
5290
5291/***************************************************************************
5292Summary:
5293  Used to get the source STC time base. (Non-ISR version)
5294
5295Description:
5296  Returns the source STC for the specified channel
5297
5298Returns:
5299  BERR_SUCCESS
5300  BERR_INVALID_PARAMETER
5301
5302See Also:
5303  BXVD_GetSTCSource_isr
5304  BXVD_SetSTCSource
5305  BXVD_SetSTCSource_isr
5306****************************************************************************/
5307BERR_Code BXVD_GetSTCSource
5308(
5309   BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
5310   BXVD_STC *peSTC             /* [out] STC Time base */
5311   );
5312
5313/***************************************************************************
5314Summary:
5315  ISR version of BXVD_GetSTCSource
5316
5317See Also:
5318  BXVD_GetSTCSource
5319****************************************************************************/
5320BERR_Code BXVD_GetSTCSource_isr
5321(
5322   BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
5323   BXVD_STC *peSTC             /* [out] STC Time base */
5324   );
5325
5326
5327/***************************************************************************
5328Summary:
5329  Used to retrieve the captured STC for the specified time
5330  base. (Non-ISR version)
5331
5332Description:
5333 Returns the STC value.
5334
5335Returns:
5336  BERR_SUCCESS
5337  BERR_INVALID_PARAMETER
5338
5339See Also:
5340  BXVD_GetSTCValue_isr
5341****************************************************************************/
5342BERR_Code BXVD_GetSTCValue
5343(
5344   BXVD_Handle hXvd,                         /* [in] The XVD Channel handle */
5345   BXVD_DisplayInterrupt eDisplayInterrupt,  /* [in] Display Interrupt number */
5346   BXVD_STC eSTC,                            /* [in] STC Time base */
5347   BXVD_STCInfo *pSTCInfo                    /* [out] STC info */
5348   );
5349
5350
5351/***************************************************************************
5352Summary:
5353  ISR version of BXVD_GetSTCValue
5354
5355See Also:
5356  BXVD_GetSTCValue
5357****************************************************************************/
5358BERR_Code BXVD_GetSTCValue_isr
5359(
5360   BXVD_Handle hXvd,                         /* [in] The XVD Channel handle */
5361   BXVD_DisplayInterrupt eDisplayInterrupt,  /* [in] Display Interrupt number */
5362   BXVD_STC eSTC,                            /* [in] STC Time base */
5363   BXVD_STCInfo *pSTCInfo                    /* [out] STC info */
5364   );
5365
5366/***************************************************************************
5367Summary:
5368  Starts display when the specified time has been reached.  Stops
5369  display when the specified time has been reached.
5370
5371Description:
5372  Keeps the decode in background and shows the last valid picture on
5373  display until the specified start time is reached then resumes
5374  decode and display of the stream.  The stream is decoded and
5375  displayed until the specified stop time is reached.  Then the
5376  display repeats the last valid picture.  The next stop time is
5377  automatically used after a picture marker event has been processed.
5378  To ensure a seamless connection between clips, the next start time
5379  is automatically used after a picture marker event has been
5380  processed.
5381
5382
5383Returns:
5384  BERR_SUCCESS
5385
5386See Also:
5387  BXVD_Interrupt_eClipStart
5388  BXVD_Interrupt_eClipStop
5389
5390****************************************************************************/
5391BERR_Code BXVD_SetClipTime
5392(
5393   BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
5394   BXVD_ClipTimeType eClipTimeType, /* [in] Clip Time Type */
5395   uint32_t      ui32StartTime, /* [in] Start display from the specified time/PTS */
5396   uint32_t       ui32StopTime  /* [in] Stop display at the specified time/PTS */
5397   );
5398
5399
5400/***************************************************************************
5401Summary:
5402  ISR version of BXVD_SetClipTime
5403
5404Description:
5405 See BXVD_SetClipTime
5406
5407Returns:
5408  BERR_SUCCESS
5409
5410See Also:
5411  BXVD_SetClipTime
5412
5413****************************************************************************/
5414BERR_Code BXVD_SetClipTime_isr
5415(
5416   BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
5417   BXVD_ClipTimeType eClipTimeType, /* [in] Clip Time Type */
5418   uint32_t    ui32StartTime, /* [in] Start display from the specified time/PTS */
5419   uint32_t    ui32StopTime /* [in] Stop display at the specified time/PTS */
5420   );
5421
5422
5423/***************************************************************************
5424Summary:
5425  Used to pause DM TSM processing until the STC is set.  This call
5426  will:
5427   - invalidate STC
5428   - pause DM picture processing (all pictures will be held)
5429   - enable the RequestSTC callback
5430
5431  The application must have the BXVD_Interrupt_eRequestSTC callback
5432  installed.  After the application receives the RequestSTC callback,
5433  it must validate the STC before DM processing will continue.
5434
5435See Also:
5436  BXVD_SetTSMWaitForRequestSTC
5437  BXVD_Interrupt_eRequestSTC
5438  BXVD_SetSTCInvalidFlag_isr
5439****************************************************************************/
5440BERR_Code BXVD_SetTSMWaitForValidSTC
5441(
5442   BXVD_ChannelHandle hXvdCh /* [in] The XVD Channel handle */
5443   );
5444
5445/***************************************************************************
5446Summary:
5447  ISR version of BXVD_SetTSMWaitForRequestSTC
5448
5449See Also:
5450  BXVD_SetTSMWaitForRequestSTC
5451****************************************************************************/
5452BERR_Code BXVD_SetTSMWaitForValidSTC_isr
5453(
5454   BXVD_ChannelHandle hXvdCh /* [in] The XVD Channel handle */
5455   );
5456
5457/***************************************************************************
5458Summary:
5459  Used to set the software PCR offset, s programmable offset added to
5460  the STC prior to TSM evaluation.
5461
5462See Also:
5463  BXVD_GetSwPcrOffset
5464****************************************************************************/
5465BERR_Code BXVD_SetSwPcrOffset
5466(
5467   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
5468   uint32_t uiSwPcrOffset     /* [in] software PCR offset */
5469   );
5470
5471/***************************************************************************
5472Summary:
5473  ISR version of BXVD_SetSwPcrOffset.
5474
5475See Also:
5476  BXVD_GetSwPcrOffset
5477****************************************************************************/
5478BERR_Code BXVD_SetSwPcrOffset_isr
5479(
5480   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
5481   uint32_t uiSwPcrOffset     /* [in] software PCR offset */
5482   );
5483
5484/***************************************************************************
5485Summary:
5486  Used to get the software PCR offset, s programmable offset added to
5487  the STC prior to TSM evaluation.
5488
5489See Also:
5490  BXVD_SetSwPcrOffset
5491****************************************************************************/
5492BERR_Code BXVD_GetSwPcrOffset
5493(
5494   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
5495   uint32_t * puiSwPcrOffset  /* [out] software PCR offset */
5496   );
5497
5498/***************************************************************************
5499Summary:
5500  ISR version of BXVD_GetSwPcrOffset.
5501
5502See Also:
5503  BXVD_SetSwPcrOffset
5504****************************************************************************/
5505BERR_Code BXVD_GetSwPcrOffset_isr
5506(
5507   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
5508   uint32_t * puiSwPcrOffset  /* [out] software PCR offset */
5509   );
5510
5511/***************************************************************************
5512Summary:
5513  Used to set a programmable flag which indicates whether or not to
5514  include the HW PCR offset in the TSM equation.
5515  Note: this only applies to "live" mode. When "playback" is enabled, the
5516  PCR offset is set to '0' in the TSM equation; in this case
5517  "bHwPcrOffsetEnable" is a "don't care".
5518
5519See Also:
5520  BXVD_GetHwPcrOffsetEnable
5521****************************************************************************/
5522BERR_Code BXVD_SetHwPcrOffsetEnable
5523(
5524   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
5525   bool bHwPcrOffsetEnable    /* [in] hardware PCR offset enable flag */
5526   );
5527
5528/***************************************************************************
5529Summary:
5530  ISR version of BXVD_SetHwPcrOffsetEnable.
5531
5532See Also:
5533  BXVD_GetHwPcrOffsetEnable
5534****************************************************************************/
5535BERR_Code BXVD_SetHwPcrOffsetEnable_isr
5536(
5537   BXVD_ChannelHandle hXvdCh, /* [in] The XVD Channel handle */
5538   bool bHwPcrOffsetEnable    /* [in] hardware PCR offset enable flag */
5539   );
5540
5541/***************************************************************************
5542Summary:
5543  Used to get a programmable flag which indicates whether or not to
5544  include the HW PCR offset in the TSM equation.
5545
5546See Also:
5547  BXVD_SetHwPcrOffsetEnable
5548****************************************************************************/
5549BERR_Code BXVD_GetHwPcrOffsetEnable
5550(
5551   BXVD_ChannelHandle hXvdCh,    /* [in] The XVD Channel handle */
5552   bool * pbHwPcrOffsetEnable    /* [out] hardware PCR offset enable flag */
5553   );
5554
5555/***************************************************************************
5556Summary:
5557  ISR version of BXVD_GetHwPcrOffsetEnable.
5558
5559See Also:
5560  BXVD_SetHwPcrOffsetEnable
5561****************************************************************************/
5562BERR_Code BXVD_GetHwPcrOffsetEnable_isr
5563(
5564   BXVD_ChannelHandle hXvdCh,    /* [in] The XVD Channel handle */
5565   bool * pbHwPcrOffsetEnable    /* [out] hardware PCR offset enable flag */
5566   );
5567
5568
5569/***************************************************************************
5570Summary:
5571  SW7400-2870:
5572  DEPRECATED: use BXVD_SetPlaybackRate(isr) instead
5573
5574  Used to set the playback rate when in vsync mode.
5575  "uiVsyncPlaybackRate" is a percentage.
5576
5577  "uiVsyncPlaybackRate" == 100 // is normal
5578  "uiVsyncPlaybackRate" < 100  // is slow motion
5579  "uiVsyncPlaybackRate" > 100  // is fast motion
5580
5581See Also:
5582  BXVD_GetVsyncPlaybackRate
5583****************************************************************************/
5584
5585BERR_Code BXVD_SetVsyncPlaybackRate(
5586   BXVD_ChannelHandle hXvdCh,
5587   uint32_t uiVsyncPlaybackRate
5588   );
5589
5590BERR_Code BXVD_SetVsyncPlaybackRate_isr(
5591   BXVD_ChannelHandle hXvdCh,
5592   uint32_t uiVsyncPlaybackRate
5593   );
5594
5595
5596/***************************************************************************
5597Summary:
5598  SW7400-2870:
5599  DEPRECATED: use BXVD_GetPlaybackRate(isr) instead
5600
5601  Used to get the playback rate when in vsync mode.
5602
5603See Also:
5604  BXVD_SetVsyncPlaybackRate
5605****************************************************************************/
5606
5607BERR_Code BXVD_GetVsyncPlaybackRate(
5608   BXVD_ChannelHandle hXvdCh,
5609   uint32_t * puiVsyncPlaybackRate
5610   );
5611
5612BERR_Code BXVD_GetVsyncPlaybackRate_isr(
5613   BXVD_ChannelHandle hXvdCh,
5614   uint32_t * puiVsyncPlaybackRate
5615   );
5616
5617/***************************************************************************
5618Summary:
5619  SW7400-2870:
5620  Sets the playback rate for vsync mode. The rate is expressed as the ratio
5621  of stPlaybackRateSettings.uiNumerator/stPlaybackRateSettings.uiDenominator.
5622 
5623  Note: setting the rate to a ratio not equal to '1' will result in pictures
5624  being evaluated in vsync mode even if the system is still in TSM mode.
5625
5626  This ratio is applied as a multiplier to the vsync STC delta. Take for
5627  example a playback rate of 60 Hz, the vsync STC delta would be 750.
5628  A ratio of 1/2 will result in a delta of 375 and playback at half speed.
5629
5630  If stPlaybackRateSettings.uiNumerator is set to '0', the system will pause.
5631
5632  If stPlaybackRateSettings.uiDenominator is set to '0', the XDM state will
5633  not be modified and BERR_INVALID_PARAMETER will be returned.
5634
5635  This playback rate is intended to be used for slow motion.  It could be
5636  used for slight fast forward, however there is the risk of underflowing
5637  buffers if the ratio is too large.
5638
5639  In addition, the playback rate is only intended to be used when playing
5640  back from disk.  If ratio is something other than '1' during live
5641  playback, there is the risk of either buffer under or overflows.
5642
5643  "uiNumerator" and " uiDenominator" are uint16_t's to prevent arithmetic
5644  overflows.
5645
5646  This API supplants BXVD_SetVsyncPlaybackRate(_isr) and
5647  BXVD_PVR_SetSlowMotionRate(_isr). 
5648
5649See Also:
5650  BXVD_GetVsyncPlaybackRate
5651****************************************************************************/
5652
5653BERR_Code BXVD_SetPlaybackRate(
5654   BXVD_ChannelHandle hXvdCh,
5655   BXVD_PlaybackRateSettings stPlaybackRateSettings
5656   );
5657
5658BERR_Code BXVD_SetPlaybackRate_isr(
5659   BXVD_ChannelHandle hXvdCh,
5660   BXVD_PlaybackRateSettings stPlaybackRateSettings
5661   );
5662
5663
5664/***************************************************************************
5665Summary:
5666  Used to get the playback rate when in vsync mode.
5667
5668  This API supplants BXVD_GetVsyncPlaybackRate(_isr) and
5669  BXVD_PVR_GetSlowMotionRate(_isr). 
5670
5671See Also:
5672  BXVD_SetPlaybackRate
5673****************************************************************************/
5674
5675BERR_Code BXVD_GetPlaybackRate(
5676   BXVD_ChannelHandle hXvdCh,
5677   BXVD_PlaybackRateSettings * pstPlaybackRateSettings
5678   );
5679
5680BERR_Code BXVD_GetPlaybackRate_isr(
5681   BXVD_ChannelHandle hXvdCh,
5682   BXVD_PlaybackRateSettings * pstPlaybackRateSettings
5683   );
5684
5685
5686/***************************************************************************
5687Summary:
5688  Used to get the PPB Parameter info for the currently displayed
5689  picture. Returns an error if a picture is not being displayed
5690
5691See Also:
5692****************************************************************************/
5693BERR_Code BXVD_GetPPBParameterInfo(
5694   BXVD_ChannelHandle hXvdCh, /* [in] XVD Channel handle */
5695   BXVD_PPBParameterInfo *pPPBParameterInfo /* [out] PPB Parameter Info is returned */
5696   );
5697
5698BERR_Code BXVD_GetPPBParameterInfo_isr(
5699   BXVD_ChannelHandle hXvdCh, /* [in] XVD Channel handle */
5700   BXVD_PPBParameterInfo *pPPBParameterInfo /* [out] PPB Parameter Info is returned */
5701   );
5702
5703/***************************************************************************
5704Summary:
5705  Used to get the PPB Parameter info for the pictures that are on the
5706  delivery queue.
5707
5708See Also:
5709****************************************************************************/
5710BERR_Code BXVD_GetPPBParameterQueueInfo(
5711   BXVD_ChannelHandle hXvdCh, /* [in] XVD Channel handle */
5712   const BXVD_PPBParameterInfo* astPPBParameterInfo[], /* [out] pointers to const PPB Parameter info structs are returned in this array */
5713   uint32_t uiPPBParameterInfoCount, /* size of PPB Parameter Info array */
5714   uint32_t *puiValidPPBParameterInfoCount /* number of valid entries returned in the PPB Parameter Info array */
5715   );
5716
5717BERR_Code BXVD_GetPPBParameterQueueInfo_isr(
5718   BXVD_ChannelHandle hXvdCh, /* [in] XVD Channel handle */
5719   const BXVD_PPBParameterInfo* astPPBParameterInfo[], /* [out] pointers to const PPB Parameter info structs are returned in this array */
5720   uint32_t uiPPBParameterInfoCount, /* size of PPB Parameter Info array */
5721   uint32_t *puiValidPPBParameterInfoCount /* number of valid entries returned in the PPB Parameter Info array */
5722   );
5723
5724/***************************************************************************
5725Summary:
5726  Used to set the picture error handling mode.
5727
5728See Also:
5729  BXVD_Picture_ErrorHandling for the definition of the modes.
5730****************************************************************************/
5731
5732BERR_Code BXVD_SetErrorHandlingMode(
5733   BXVD_ChannelHandle hXvdCh,
5734   BXVD_Picture_ErrorHandling eErrorMode
5735   );
5736
5737BERR_Code BXVD_SetErrorHandlingMode_isr(
5738   BXVD_ChannelHandle hXvdCh,
5739   BXVD_Picture_ErrorHandling eErrorMode
5740   );
5741
5742/***************************************************************************
5743Summary:
5744  Used to get the picture error handling mode.
5745
5746See Also:
5747  BXVD_Picture_ErrorHandling for the definition of the modes.
5748****************************************************************************/
5749
5750BERR_Code BXVD_GetErrorHandlingMode(
5751   BXVD_ChannelHandle hXvdCh,
5752   BXVD_Picture_ErrorHandling * peErrorMode
5753   );
5754
5755BERR_Code BXVD_GetErrorHandlingMode_isr(
5756   BXVD_ChannelHandle hXvdCh,
5757   BXVD_Picture_ErrorHandling * peErrorMode
5758   );
5759
5760
5761/***************************************************************************
5762Summary:
5763  Used to enable/disable XVD DM's Jitter Tolerance Improvement (JTI) logic.
5764
5765See Also:
5766****************************************************************************/
5767
5768BERR_Code BXVD_SetJitterToleranceImprovementEnable(
5769   BXVD_ChannelHandle hXvdCh,
5770   bool bEnable
5771   );
5772
5773BERR_Code BXVD_SetJitterToleranceImprovementEnable_isr(
5774   BXVD_ChannelHandle hXvdCh,
5775   bool bEnable
5776   );
5777
5778BERR_Code BXVD_GetJitterToleranceImprovementEnable(
5779   BXVD_ChannelHandle hXvdCh,
5780   bool *pbEnable
5781   );
5782
5783BERR_Code BXVD_GetJitterToleranceImprovementEnable_isr(
5784   BXVD_ChannelHandle hXvdCh,
5785   bool *pbEnable
5786   );
5787
5788
5789/***************************************************************************
5790Summary:
5791    Set the pulldown override mode for MPEG content.
5792
5793See Also:
5794   typedef enum BXVD_MPEGPulldownOverride
5795****************************************************************************/
5796
5797BERR_Code BXVD_SetMPEGPulldownOverride(
5798   BXVD_ChannelHandle hXvdCh,
5799   BXVD_MPEGPulldownOverride ePulldownOverride
5800   );
5801
5802BERR_Code BXVD_SetMPEGPulldownOverride_isr(
5803   BXVD_ChannelHandle hXvdCh,
5804   BXVD_MPEGPulldownOverride ePulldownOverride
5805   );
5806
5807BERR_Code BXVD_GetMPEGPulldownOverride(
5808   BXVD_ChannelHandle hXvdCh,
5809   BXVD_MPEGPulldownOverride * pePulldownOverride
5810   );
5811
5812BERR_Code BXVD_GetMPEGPulldownOverride_isr(
5813   BXVD_ChannelHandle hXvdCh,
5814   BXVD_MPEGPulldownOverride * pePulldownOverride
5815   );
5816
5817/***************************************************************************
5818
5819Summary:
5820
5821   SW7405-4117: deinterlacer max height is used in conjuction with
5822   BXVD_DisplayFieldType_eAuto to choose either eSingleField or eBothField
5823   based on the steam height during slow motion (and preroll).
5824
5825   See the usage note above at the defintion of "BXVD_DisplayFieldType".
5826
5827****************************************************************************/
5828
5829BERR_Code BXVD_SetDeinterlacerMaxHeight(
5830   BXVD_ChannelHandle hXvdCh,
5831   uint32_t uiMaxHeight
5832   );
5833
5834BERR_Code BXVD_SetDeinterlacerMaxHeight_isr(
5835   BXVD_ChannelHandle hXvdCh,
5836   uint32_t uiMaxHeight
5837   );
5838
5839BERR_Code BXVD_GetDeinterlacerMaxHeight(
5840   BXVD_ChannelHandle hXvdCh,
5841   uint32_t * puiMaxHeight
5842   );
5843
5844BERR_Code BXVD_GetDeinterlacerMaxHeight_isr(
5845   BXVD_ChannelHandle hXvdCh,
5846   uint32_t * puiMaxHeight
5847   );
5848
5849/***************************************************************************
5850
5851Summary:
5852   SW7405-4703: API to Set Horizontal Overscan calculation mode
5853
5854Description:
5855   This API can be used to change the default behavior of the Horizontal Overscan
5856   calculations within the DM.  Thus the DM can be configured to bypass the
5857   Horizonal Overscan calculation if desired.
5858   Default behavior is specified by BXVD_HorizontalOverscanMode_eAuto.
5859
5860See Also:
5861   BXVD_GetHorizontalOverscanMode
5862
5863****************************************************************************/
5864BERR_Code BXVD_SetHorizontalOverscanMode
5865(
5866   BXVD_ChannelHandle     hXvdCh,                  /* [in] XVD Channel handle */
5867   BXVD_HorizontalOverscanMode  eHorizOverscanMode /* [in] Horizontal Overscan mode  */
5868);
5869
5870BERR_Code BXVD_SetHorizontalOverscanMode_isr
5871(
5872   BXVD_ChannelHandle     hXvdCh,                  /* [in] XVD Channel handle */
5873   BXVD_HorizontalOverscanMode  eHorizOverscanMode /* [in] Horizontal Overscan mode  */
5874);
5875
5876
5877/***************************************************************************
5878
5879Summary:
5880   SW7405-4703: API to Get current Horizontal Overscan mode
5881
5882Description:
5883   This API can be used to query the current behavior of the Horizontal Overscan
5884   calculations within the DM.
5885
5886See Also:
5887   BXVD_SetHorizontalOverscanMode
5888
5889****************************************************************************/
5890BERR_Code BXVD_GetHorizontalOverscanMode
5891(
5892   BXVD_ChannelHandle     hXvdCh,                  /* [in] XVD Channel handle */
5893   BXVD_HorizontalOverscanMode  *peHorizOverscanMode /* [out] Horizontal Overscan mode  */
5894);
5895
5896BERR_Code BXVD_GetHorizontalOverscanMode_isr
5897(
5898   BXVD_ChannelHandle     hXvdCh,                  /* [in] XVD Channel handle */
5899   BXVD_HorizontalOverscanMode  *peHorizOverscanMode /* [out] Horizontal Overscan mode  */
5900);
5901
5902/***************************************************************************
5903
5904Summary:
5905   SWDEPRECATED-1003:
5906   API to specify the video frame rate as a numerator / denominator. 
5907   This value will override any frame rate coded in the steam was well as
5908   the "default" specified in the decode settings.
5909   
5910Description:
5911
5912   The BXVD_FrameRateOverride structure contains two elements; "bValid"
5913   and "stRate".  If "bValid" is TRUE, the values specified in "stRate"
5914   will be used as the frame rate.  If "bValid" is FALSE, the system will
5915   use either the coded or default frame rate.
5916
5917   "stRate" consists of a numerator and a denominator.  If either element
5918   is equal to "0", "bValid" will be set to FALSE.
5919
5920   There are a number of scenarios when this API might be useful.  It could
5921   be used when a stream has an incorrectly coded frame rate.  It could be
5922   used to control the playback rate when the system is in vsync mode; by
5923   setting the frame rate equal to the display rate, pictures will be
5924   scanned out one element per vsync.
5925
5926   Internal to XDM, the result of the numerator/denominator is mapped to
5927   one of the BAVC_FrameRateCode values specified in bavc.h.  Eventually
5928   XDM will be modified to handle arbitrary frame rates to support all
5929   the new internet protocols.
5930         
5931See Also:
5932
5933****************************************************************************/
5934
5935
5936BERR_Code BXVD_SetFrameRateOverride(
5937   BXVD_ChannelHandle hXvdCh,
5938   BXVD_FrameRateOverride * pstFrameRateOverrideSettings
5939   );
5940
5941BERR_Code BXVD_SetFrameRateOverride_isr(
5942   BXVD_ChannelHandle hXvdCh,
5943   BXVD_FrameRateOverride * pstFrameRateOverrideSettings
5944   );
5945
5946BERR_Code BXVD_GetFrameRateOverride(
5947   BXVD_ChannelHandle hXvdCh,
5948   BXVD_FrameRateOverride * pstFrameRateOverrideSettings
5949   );
5950
5951BERR_Code BXVD_GetFrameRateOverride_isr(
5952   BXVD_ChannelHandle hXvdCh,
5953   BXVD_FrameRateOverride * pstFrameRateOverrideSettings
5954   );
5955
5956/***************************************************************************
5957
5958Summary:
5959   SW7422-72: API to set the 3D orientation of pictures.
5960   
5961Description:
5962   In general the XVD Decoder simply passes content through as is. It has
5963   no knowledge of what formats are supported by VDC.  The "fix up" of
5964   unsupported or unspecified formats falls upon XDM in concert with the
5965   middleware/application.  To support "fix up", the following XDM API's
5966   have been added.
5967
5968   BXVD_Set3D(_isr) takes a pointer to a BXVD_3DSetting structure.  This
5969   structure contains two elements, bOverrideOrientation and eOrientation.   
5970   When bOverrideOrientation is set to true, XDM will use the eOrientation
5971   element to populate the MFD picture structure.  When
5972   bOverrideOrientation is set to false, XDM will use in-band information
5973   (SEI messages) to  populate the MFD picture structure.  The default
5974   setting of bOverrideOrientation is false.
5975
5976   The SEI message callback will be generated before filling in the MFD
5977   picture structure.  The middleware/application can use the contents of
5978   the SEI message to determine if BXVD _Set3D(_isr) needs to be called to
5979   force a specific  3D orientation.
5980
5981   The values set by BXVD_Set3D(_isr) are sticky and will persist until
5982   BXVD_Set3D(_isr) is called again.  The values will be reset to the default
5983   when BXVD_StopDecode is called.
5984
5985   BXVD_Get3D(_isr) returns the current 3D settings.
5986
5987   BXVD_GetDefault3D returns the default settings.
5988       
5989See Also:
5990
5991****************************************************************************/
5992
5993BERR_Code BXVD_Set3D(
5994   BXVD_ChannelHandle hXvdCh,
5995   const BXVD_3DSetting * pst3DSettings
5996   );
5997
5998BERR_Code BXVD_Set3D_isr(
5999   BXVD_ChannelHandle hXvdCh,
6000   const BXVD_3DSetting * pst3DSettings
6001   );
6002
6003BERR_Code BXVD_Get3D(
6004   BXVD_ChannelHandle hXvdCh,
6005   BXVD_3DSetting * pst3DSettings
6006   );
6007
6008BERR_Code BXVD_Get3D_isr(
6009   BXVD_ChannelHandle hXvdCh,
6010   BXVD_3DSetting * pst3DSettings
6011   );
6012
6013BERR_Code BXVD_GetDefault3D(
6014   BXVD_ChannelHandle hXvdCh,
6015   BXVD_3DSetting * pst3DSettings
6016   );
6017
6018/***************************************************************************
6019
6020Summary:
6021   SW7425-1264: support for a synthesized SW STC, can create a clock
6022   internal to XDM that run backwards.
6023
6024   The clock override is set by calling "BXVD_SetClockOverride".
6025   "BXVD_GetClockOverride" returns the most recently written values.
6026
6027   See bxdm_pp.h for the definition of BXDM_PictureProvider_ClockOverride.
6028
6029   When "bEnableClockOverride" is true, XDM will use an internal SW STC.
6030
6031   When "bLoadSwStc" is true, the SW STC will be initialized with "uiStcValue".
6032   This loading occurs at the beginning of XDM's execution.  If "bLoadSwStc"
6033   is false, the SW STC will not be loaded.  This mechanism allows
6034   "BXVD_SetClockOverride" to be called without changing the current value
6035   of the SW STC.
6036
6037   "iStcDelta" is added to the SW STC every vsync, effectively at the end of
6038   XDM's execution.  "iStcDelta" can be negative, this will cause the clock to
6039   run backwards.  The units of "iStcDelta" are clock ticks; for example to
6040   achieve a 60 Hz display rate, "iStcDelta" would be set to 750.
6041
6042   The current SW STC can be retrieved by calling BXVD_GetPTS_isr or
6043   BXDM_PictureProvider_GetCurrentPTSInfo_isr with "bEnableClockOverride" set
6044   to true.  The SW STC will be returned in "stPTSInfo.uiSTCSnapShot".
6045
6046****************************************************************************/
6047
6048BERR_Code BXVD_SetClockOverride(
6049   BXVD_ChannelHandle hXvdCh,
6050   const BXVD_ClockOverride * pstClockOverride
6051   );
6052
6053BERR_Code BXVD_SetClockOverride_isr(
6054   BXVD_ChannelHandle hXvdCh,
6055   const BXVD_ClockOverride * pstClockOverride
6056   );
6057
6058BERR_Code BXVD_GetClockOverride(
6059   BXVD_ChannelHandle hXvdCh,
6060   BXVD_ClockOverride * pstClockOverride
6061   );
6062
6063BERR_Code BXVD_GetClockOverride_isr(
6064   BXVD_ChannelHandle hXvdCh,
6065   BXVD_ClockOverride * pstClockOverride
6066   );
6067
6068
6069/*******************/
6070/* Deprecated APIs */
6071/*******************/
6072
6073/***************************************************************************
6074Summary:
6075    [DEPRECATED] Sets the TSM Pass Display Threshold in number of decodable units of
6076    display decided by the Correct Display Algorithm
6077Description:
6078    Sets the TSM Pass Display Threshold to a fractional number of frames
6079    of display decided by the Correct Display Algorithm
6080    For example to set the window to 1.5 frames you need to set the
6081    numerator to 3 and denominator to 2.
6082    The input accepts the fraction as a numerator and a denominator. If
6083    this API is not called it defaults to one unit
6084Returns:
6085    BERR_SUCCESS
6086See Also:
6087    None
6088
6089****************************************************************************/
6090BERR_Code BXVD_SetTSMPassWindow
6091(
6092 BXVD_ChannelHandle     hXvdCh,    /* [in] The XVD Channel handle */
6093 uint32_t ui32PassFractNumerator,  /* [in] The numerator of the fraction of frame multiple */
6094 uint32_t ui32PassFractDenominator /* [in] The denominator of the fraction of frame multiple */
6095);
6096
6097/***************************************************************************
6098Summary:
6099    [DEPRECATED] Decodes and displays until the specified PTS is reached.
6100Description:
6101    Decodes and displays until the specified PTS is reached.
6102Returns:
6103    BERR_SUCCESS
6104See Also:
6105    BXVD_PauseUntoPTS
6106
6107****************************************************************************/
6108BERR_Code BXVD_DisplayUntoPTS
6109(
6110  BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
6111  bool               bEnable, /* [in] Enables Display upto the specified PTS */
6112  uint32_t       ui32PTS, /* [in] Display upto the specified  PTS */
6113  uint32_t ui32ThreshLoopAroundCntr /* [in] how much apart (after how many
6114                       loop arounds) the Disp PTS is programmed */
6115);
6116
6117
6118/***************************************************************************
6119Summary:
6120    [DEPRECATED] Decodes and displays until the specified PTS is reached.
6121Description:
6122    Keeps the decode in background and shows the last valid
6123    picture on display until the specified PTS is reached then resumes
6124    decode and display of the stream.
6125Returns:
6126    BERR_SUCCESS
6127See Also:
6128    BXVD_DisplayUntoPTS
6129
6130****************************************************************************/
6131BERR_Code BXVD_PauseUntoPTS
6132(
6133 BXVD_ChannelHandle hXvdCh,  /* [in] The XVD Channel handle */
6134 bool             bEnable, /* [in] Enables Pause upto the specified PTS */
6135 uint32_t      ui32PTS, /* [in] Pause till the specified PTS is reached */
6136 uint32_t ui32ThreshLoopAroundCntr /* [in] how much apart (after how many loop
6137                    arounds) the Pause PTS is programmed*/
6138);
6139
6140/***************************************************************************
6141Summary:
6142  [DEPRECATED] Allows enable and disable of 3:2 pulldown processing in display manager
6143
6144See Also:
6145  BXVD_GetPulldown
6146****************************************************************************/
6147BERR_Code BXVD_SetPulldownMode(
6148   BXVD_ChannelHandle hXvdCh,          /* [in] The XVD Channel handle */
6149   BXVD_PulldownMode ePulldownMode     /* [in] Pulldown state */
6150   );
6151
6152/***************************************************************************
6153Summary:
6154  [DEPRECATED] Returns enable and disable of 3:2 pulldown processing in display manager
6155
6156See Also:
6157  BXVD_SetPulldown
6158****************************************************************************/
6159BERR_Code BXVD_GetPulldown(
6160   BXVD_ChannelHandle hXvdCh,          /* [in] The XVD Channel handle */
6161   BXVD_PulldownMode *pePulldownMode   /* [in] Pulldown state */
6162   );
6163
6164#ifdef __cplusplus
6165}
6166#endif
6167
6168#endif /* BXVD_H__ */
6169/* End of file. */
Note: See TracBrowser for help on using the repository browser.