source: svn/newcon3bcm2_21bu/magnum/portinginterface/xvd/7552/bxvd_vdec_info.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 52.6 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-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_vdec_info.h $
11 * $brcm_Revision: Hydra_Software_Devel/94 $
12 * $brcm_Date: 2/27/12 5:15p $
13 *
14 * File Description: This file definitions for PPB data structure passed
15 *                   from 7401 decode FW to DM.
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/portinginterface/xvd/7401/bxvd_vdec_info.h $
20 *
21 * Hydra_Software_Devel/94   2/27/12 5:15p davidp
22 * SW7425-1680: Add support for early picture delivery mode.
23 *
24 * Hydra_Software_Devel/93   2/10/12 11:18a btosi
25 * SW7425-2247: add support for bar data
26 *
27 * Hydra_Software_Devel/92   1/10/12 11:39a btosi
28 * SW7425-1001: added flags_ext0 and BXVD_P_PPB_EXT0_FLAG_LAST_PICTURE
29 *
30 * Hydra_Software_Devel/91   12/16/11 8:32a btosi
31 * SWDTV-8681: add support for VP8 display size
32 *
33 * Hydra_Software_Devel/90   7/27/11 11:32a btosi
34 * SWDTV-7795: added PPB extensions for MP4, VP78 and RV9
35 *
36 * Hydra_Software_Devel/89   6/27/11 4:13p davidp
37 * SW7425-542: Merge devel branch to mainline.
38 *
39 * Hydra_Software_Devel/SW7425-542/8   6/13/11 2:43p btosi
40 * SW7425-542: added support for new PPB definition
41 *
42 * Hydra_Software_Devel/SW7425-542/7   6/9/11 4:20p davidp
43 * SW7425-542: Move BXVD_P_PPB_EXTENDED to top of file.
44 *
45 * Hydra_Software_Devel/SW7425-542/6   6/9/11 4:15p davidp
46 * SW7425-542: Increase context memory size for extended PPB.
47 *
48 * Hydra_Software_Devel/SW7425-542/5   6/9/11 3:57p davidp
49 * SW7425-542: Add AVD FW current major version symbolic constant.
50 *
51 * Hydra_Software_Devel/SW7425-542/4   6/9/11 1:19p btosi
52 * SW7425-542: added in support for the Host Memory Interface
53 *
54 * Hydra_Software_Devel/SW7425-542/3   6/7/11 5:47p davidp
55 * SW7425-542: Add BXVD_P_HIM_MAJOR_VERSION to validate correct FW is
56 * being loaded.
57 *
58 * Hydra_Software_Devel/SW7425-542/2   6/1/11 6:45p davidp
59 * SW7425-542: Add BXVD_P_STC_MAX macro.
60 *
61 * Hydra_Software_Devel/SW7425-542/1   5/31/11 3:58p davidp
62 * SW7425-542: Add support for Host Interface Memory (ARC Scratch memory)
63 * FW API changes.
64 *
65 * Hydra_Software_Devel/88   3/15/11 10:17a btosi
66 * SW7425-160: updated to use Broadcom standard types
67 *
68 * Hydra_Software_Devel/87   2/24/11 1:55p slauzon
69 * SW7572-277: Used local variable to restore the pic_out_id after "
70 * Backend_Reset". Changed video reference frame register initialization.
71 * First picture video buffer is used for initial video reference frame
72 * initialization.
73 * FWAVD-40: AVD does not support D-type pictures in MPEG. Set the
74 * "unsupported feature flag" in the AVD channel status.
75 * FWAVD-80: Added error identification and mitigation logic in AVD OL
76 * firmware.(SW35230-2647)
77 * VDEC_REL_0_21_3_47
78 *
79 * Hydra_Software_Devel/86   2/17/11 2:02p btosi
80 * SW7405-5135: if the SEI arrangement_cancel flag is set, set both the
81 * Unified and MFD picture orientations to 2D
82 *
83 * Hydra_Software_Devel/85   1/25/11 3:56p davidp
84 * SW7422-22: Add support for SVC Picture Order Count.
85 *
86 * Hydra_Software_Devel/84   11/3/10 10:29a slauzon
87 * SW7125-633: mmco1 error logic changed for start of stream for
88 * ePrognostic mode
89 * SW7405-4910: fix btp cleanup for mpeg size change
90 * SW7405-4953: increment reference count when creating sei3d packet
91 * VDEC_REL_0_21_3_44
92 *
93 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/12   10/21/10 1:11p slauzon
94 * SWCHECKFRAME-80: upleveled from hydra latest
95 *
96 * Hydra_Software_Devel/83   10/19/10 10:23a btosi
97 * SW7422-72: added constants for parsing the SEI messages
98 *
99 * Hydra_Software_Devel/82   10/19/10 9:08a delkert
100 * SW7405-4044: Add support for
101 * BAVC_TransferCharacteristics_eIec_61966_2_4 to support xvYCC
102 *
103 * Hydra_Software_Devel/81   8/30/10 2:02p delkert
104 * SW7405-4827: Add PPB Flag definition for bit 20 (error concealment)
105 *
106 * Hydra_Software_Devel/80   8/27/10 11:45a slauzon
107 * SW3548-3033: Added a file format support for MKV where for back to back
108 * SPS, we retain valid Aspect Ratio if the 2nd SPS has invalid  AR. This
109 * change introduces a new channel_mode bit to enable this feature. The
110 * api document updated accordingly.
111 * SWBLURAY-21421: Merged MVC error-handling code to the main-line. Files
112 * affected are outer\mvc: picture.c, sequence.c, mvc.h,channel.c.
113 * No-PR: Remove FGT from H264 and MVC protocol. No one uses it.
114 * SW3548-2967: Fixed Pan-scan bug which was corrupting channel core lsram
115 * by overwriting pass the lsram PPB structure. Also, added a check at
116 * PPB delivery time to make sure PPB is within a valid range. Otherwise
117 * a WD is forced.
118 *
119 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/11   8/3/10 2:27p slauzon
120 * SWCHECKFRAME-42: upleveled from Hydra
121 *
122 * Hydra_Software_Devel/79   7/29/10 11:22a btosi
123 * SW7405-4560: added support for the SEI "new message" flag.
124 *
125 * Hydra_Software_Devel/78   7/27/10 11:36a btosi
126 * SW7401-4426: added support for the H264 timecode
127 *
128 * Hydra_Software_Devel/77   5/10/10 12:18p slauzon
129 * SW7325-721: Fix avc AFD extraction
130 * SW7405-3996:  Add SEI 3D parsed frame-packing mode. This reuses the
131 * offset meta data pointer in ppb structure and changes the offset meta
132 * data structure to be a union with sei data.  This will require a
133 * parallel XVD change in order not to break DVD mvc playback- Ray's team
134 * are aware.
135 * No JIRA: Change H264 Direct Context size to be 4 MB align.
136 * Brickstone VOB label=VDEC_REL_0_21_3_36
137 *
138 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/10   5/10/10 11:02a slauzon
139 * SW7405-3996: added support for new SEI message format
140 *
141 * Hydra_Software_Devel/76   5/4/10 10:41a btosi
142 * SW7405-3996: added support for new SEI message format
143 *
144 * Hydra_Software_Devel/SW7405-3996/2   4/26/10 4:24p btosi
145 * SW7405-3996: added BXVD_P_PPB_SEI_MSG_MVC_GRAPHICS_OFFSET
146 *
147 * Hydra_Software_Devel/SW7405-3996/1   4/1/10 3:59p btosi
148 * SW7405-3996: first cut at generating picture extension callback from
149 * SEI data
150 *
151 * Hydra_Software_Devel/75   3/5/10 11:58a slauzon
152 * SW7400-2685: When BTP commands are sent across pictures that have
153 * different sizes (such as a scene change or commercial), we must
154 * release a stored-reference picture of a size that is no longer valid
155 * as predicting from that picture is not accurate.
156 *
157 * FWAVD-16: Merge IP licensing support; to avoid any backward
158 * compatibility issue, add IP enablement supports for 7405 family (7405,
159 * 7413, 7205, 7206) in this release.
160 *
161 * SW3556-1058 : AVC decoder functionality is modified to parameterize
162 * "dpb_output_delay" processing. By default the functionality is
163 * enabled.
164 *
165 * VDEC_REL_0_21_3_32
166 *
167 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/9   3/4/10 3:01p mdanke
168 * SWCHECKFRAME-42: upleveled from Hydra
169 *
170 * Hydra_Software_Devel/74   3/3/10 5:28p davidp
171 * SW7400-2704: Add SEI message frame packing support.
172 *
173 * Hydra_Software_Devel/73   1/19/10 12:40p slauzon
174 * SW7405-3749: Add check for un-initialized pointer for abandon picture
175 * else it could cause an memory corrupt. SW7400-2499: Fixed MPEG-2 P-
176 * skip MB with no prior reference frame.
177 * Release v0.21.3.29 (Brickston VOB label=VDEC_REL_0_21_3_29)."
178 *
179 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/8   1/18/10 2:40p slauzon
180 * SWCHECKFRAME-42: rebase merge from Hydra_Software_Devel
181 *
182 * Hydra_Software_Devel/72   1/8/10 11:50a btosi
183 * SW7405-3137: added support for extension data callback
184 *
185 * Hydra_Software_Devel/71   1/6/10 2:28p btosi
186 * SW7405-3137: merged branch into mainline
187 *
188 * Hydra_Software_Devel/70   12/23/09 12:54p slauzon
189 * SW7601-180 : Issue with Promise DVD. Pull down information was miscoded
190 * in the stream. Passed the "repeat_first_flag" to the Display manager
191 * through PPB_MPEG structure.
192 * Add sleep command for Flea low-power mode.
193 * Reset sparse mode picture processing variable correctly.
194 * VDEC_REL_0_21_3_28.
195 *
196 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/7   12/16/09 4:46p slauzon
197 * SWCHECKFRAME-42: upleveled dev branch from Hydra
198 *
199 * Hydra_Software_Devel/69   12/16/09 4:14p btosi
200 * SW7601-180: added BXVD_MPEGPulldownOverride routines/logic to
201 * conditionally override TB->TBT and BT->BTB
202 *
203 * Hydra_Software_Devel/68   11/18/09 10:40a slauzon
204 * SW7400-2466: (DRAM logging)  Debug ArcPrintf in DRAM logging command
205 * need to happen AFTER Dram logging setup because ArcPrintf uses DRAM
206 * logging.
207 *
208 * Added support to output pictures in decode-order if the appropriate
209 * flag is set in Channel_Start command. This mode should only be used
210 * internally for testing. The following codecs were changed: MPEG2, VC1,
211 * DivX and AVS.
212 *
213 * SW7405-3322: Fix IL code space corruption issue. In error concealment
214 * code, FW intends to write to scratch memory to initialize the direct
215 * context data content and accidently forget to add the IO_BASE addres
216 * that cause data write into code space.
217 *
218 * SW7405-3035: Adding support in AVC to start decode on I picture when a
219 * channel_mode bit is set.
220 *
221 * SW3556-836: Adding fixed frame rate flag in avc. Note that shared.h was
222 * also changed, hence bxvd_vdec_info needs to add the new flag
223 *
224 * Patch last MB of MPEG4 I frame followed by AVC I frame in mosaic mode
225 * cause decode error issue. Fix only is only enabled at rev J core and
226 * below.
227 *
228 * SW7420-421: DNR error message while playback MP4. Current MP4 FW uses
229 * only 16-bit to accumulate QP and overflow the data due to high QP and
230 * MB count.
231 *
232 * SW7405-2844: XVD error handling issues. Additional checks for gap in
233 * "frame_num" and errors in mmco commands were added and reported to
234 * display manager for each picture delivered.
235 *
236 * SW7601-173: Macro-blocking on Sunshine BD. AVC error concealment is off
237 * by default. Application can turn it on as required.
238 *
239 * VDEC_REL_0_21_3_26.
240 *
241 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/6   11/14/09 3:05p slauzon
242 * SWCHECKFRAME-42: rebase devel branch
243 *
244 * Hydra_Software_Devel/67   11/11/09 3:35p btosi
245 * SW3556-836: added support for returning the PPB fixed_frame_rate_flag
246 * in the BXVD_PictureParameterInfo structure
247 *
248 * Hydra_Software_Devel/66   10/20/09 10:56a slauzon
249 * SW7401-4223: Update the drop_count reported to XVD in the PPB structure
250 * with the latched drop count only if the value is non-zero. We were
251 * updating this value at every RAP and sometimes, the latched drop count
252 * of zero was being reported to XVD causing XVD to repeatedly make drop
253 * requests. This behaviour resulted in lipsync issues, especially in
254 * streams with errors. Note that this behaviour was only seen with DM
255 * v1, which handles drop requests differently than DM v2.
256 *
257 * No JIRA number: Add flea specific api to drop fields (flea does not
258 * have VSync so current mechanism for passing drop count would not
259 * work). API is not currently published to XVD and therefore does not
260 * require an increase in minor release number.
261 *
262 * No JIRA number :: Added AVC in AVI container functionality.
263 *
264 * SW7405-3052: AVD inner loop watchdog popup with customer provided
265 * stream. The inner watchdog is caused by the IL take too long during
266 * error re-recovering; IL did not lock up in this case. I disable the IL
267 * WD and see it running fine. This is a HD streams with 3 slice coded
268 * per row, in case of error, FW need to do a start code search (byte
269 * search) to locate the next slice boundary and resume decode, plus the
270 * error recovering code some time it exceed the watchdog timer budget. A
271 * suggest fix is to add WD reset during MPEG2 slice start code search.
272 *
273 * No PR:to be able to decode Base view of MVC streams, we need to chagne
274 * the reserved zero flags in SPS to only parse out 3 bits instead of 4
275 * bits.
276 *
277 * No PR: For DVD chips after Grain, the sixth bit used in the
278 * picture/video ID was taken away to be used for motion-compensation
279 * cache. As a result, video ID can only be in the range of 0-31. In
280 * prior chips, the sixth bit was used by the CCB to determine whether
281 * the video ID address was in memory bank A or B. Now, because there is
282 * no sixth bit, CCB will not be able to "steer" the video ID to bank A
283 * or B. Instead, all the picture buffers will either be in bank A or
284 * bank B but not in both at the same time. To enable steering again,
285 * hardware needs to assign the sixth bit back to video ID and we should
286 * program video_id_offset = 32   In Grain, in order to use memory bank
287 * B, we must set video_id_offset to 0 because a video ID > 32 will set
288 * the sixth bit, which will cause the memory controller to interpret the
289 *
290 * SW7405-3005:  Add overflow bit to PPB flags and status.
291 *
292 * VDEC_REL_0_21_3_25.
293 *
294 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/5   10/15/09 10:10a slauzon
295 * SW7405-3005: added "uiDecoderInputOverflow" i.e. reporting of CDB
296 * overflow
297 *
298 * Hydra_Software_Devel/65   10/13/09 11:22a btosi
299 * SW7405-3005: added "uiDecoderInputOverflow" i.e. reporting of CDB
300 * overflow
301 *
302 * Hydra_Software_Devel/63   9/14/09 3:42p slauzon
303 * SW7405-2844 :
304 *
305 *   No PR: for Cabac programc lip L0 and L1 count to 2. This is needed
306 * for SVC bu
307 * t to avoid a branch this cahnge can be applied to mainline with any
308 * side effect
309 *
310 *   No PR: Misc. code changes. (1) Preserve the work around for the
311 * possible top
312 * context corruption in SD only box (w SD IL-ARC RTS setting).  This is a
313 * HW bug a
314 * nd is fixed in Rev J.  Due to the performance impact, this work around
315 * is disabl
316 * e for now. (2) Remove dummy instrcution in VC1 OL FW.
317 *
318 *   PR 56809:  Fixes for OL TPD and Output-N processing
319 *
320 *   PR 57490 :: Modifications to code to implement BXVD_ERROR_HANDLING
321 * functional
322 * ity appropriately, especially for "eprognostic" mode.
323 *
324 *   VDEC_REL_0_21_3_23.
325 *
326 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/4   9/1/09 12:55p slauzon
327 * SW7405-2961: merged back from Hydra_Software_Devel to resolve build
328 * issue on AVD_Qual apps.
329 *
330 * Hydra_Software_Devel/62   8/28/09 10:15a btosi
331 * SW7405-2940: add BXVD_P_PPB_FLAG_DECODE_REF_ERROR
332 *
333 * Hydra_Software_Devel/61   7/31/09 11:04a nilesh
334 * PR57256: Changed 7.943 frame rate to 7.493
335 *
336 * Hydra_Software_Devel/60   3/10/09 1:53p nilesh
337 * PR52427: Removed unused MPEG PPB flag defines
338 *
339 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/2   3/4/09 1:27p mdanke
340 * PR 48843: Added IL instruction cache miss variable to PPB.
341 *
342 * Hydra_Software_Devel/XVD_Multi_Firmware_Devel/1   2/11/09 6:05p gauravs
343 * PR13053: Added overscan bits for AVC stream to vdec_info.h
344 *
345 * Hydra_Software_Devel/57   1/12/09 11:22a gaurava
346 * PR 48843: Added a new variable for CABAC cycle count that would be
347 * used for Rev J RTL and beyond for measuring hardware decode
348 * performance for CABAC.
349 *
350 * Hydra_Software_Devel/56   11/25/08 1:48p gaurava
351 * PR48843: moved the delta_pic_seen down by a word to leave
352 * room for future inner-loop performance monitoring.
353 *
354 * Hydra_Software_Devel/55   11/21/08 11:50a btosi
355 * PR48843: added in delta_pic_seen
356 *
357 * Hydra_Software_Devel/54   11/5/08 12:50p gaurava
358 * PR 47494: Added a bit in ppb->flags to tell the DM whenever a picture
359 * has a new picture_tag as opposed to a sticky picture tag.
360 *
361 * Hydra_Software_Devel/53   11/3/08 10:11a gaurava
362 * PR 43785: Added data structure for inner-loop performance monitoring.
363 *
364 * Hydra_Software_Devel/52   10/20/08 5:14p davidp
365 * PR46567: Extract profile and level data out of proper PPB field.
366 *
367 * Hydra_Software_Devel/51   10/16/08 3:19p gaurava
368 * PR 43785: Modified the poc_top and poc_bottom to be signed. These can
369 * be negative and there are some streams where they are.  We need to use
370 * the lower of the two and a comparison of poc values would be incorrect
371 * if declared as unsigned.
372 *
373 * Hydra_Software_Devel/50   10/6/08 11:49a btosi
374 * PR46567: removed BXVD_P_PPB_Protocol, BXVD_P_PPB_Protocol_Level and
375 * BXVD_P_PPB_Protocol_Profile
376 *
377 * Hydra_Software_Devel/49   10/3/08 3:47p btosi
378 * PR46567: added BXVD_P_PPB_Protocol, BXVD_P_PPB_Protocol_Level and
379 * BXVD_P_PPB_Protocol_Profile
380 *
381 * Hydra_Software_Devel/48   7/31/08 1:56p btosi
382 * PR41123: added BXVD_P_PPB_FLAG_PICTURE_TYPE_MASK
383 *
384 * Hydra_Software_Devel/47   7/30/08 10:29a btosi
385 * PR41123: added picture type constants
386 *
387 * Hydra_Software_Devel/46   6/4/08 3:18p gaurava
388 * PR 42134: Added parameter for AFD value from the stream for Active
389 * Format Descriptors
390 *
391 * Hydra_Software_Devel/45   5/27/08 11:12a gaurava
392 * PR 43036: Added parameter in PPB to forward the inner-loop decode
393 * time to the Host for gathering performance statistics
394 *
395 * Hydra_Software_Devel/44   3/17/08 5:28p davidp
396 * PR40316: Add BXVD_P_PPB_FLAG_BUFFER_TYPE_MASK and
397 * BXVD_P_PPB_FLAG_SOURCE_TYPE_MASK for access to these items in ppb-
398 * >flags.
399 *
400 * Hydra_Software_Devel/43   1/11/08 2:03p gaurava
401 * PR 37223: Added AVS Pan-Scan vectors
402 *
403 * Hydra_Software_Devel/42   1/10/08 5:31p otao
404 * PR37223: Added panscan support in AVS.
405 *
406 * Hydra_Software_Devel/41   11/15/07 4:54p gaurava
407 * PR 34981: Added PPB extensions for AVS
408 *
409 * Hydra_Software_Devel/40   10/22/07 2:23p gaurava
410 * PR 35408: Added new parameters to PPB for DigitalTV customers.
411 * Also added the absolute address for base of 8x8 block averages
412 * buffer useful for FGT in BVN.
413 *
414 * Hydra_Software_Devel/39   8/13/07 4:08p nilesh
415 * PR29915: Multi-decode merge to mainline
416 *
417 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/8   7/25/07 1:37p nilesh
418 * PR29915: Cleaned up bxvd_priv.h and bxvd_vdec_info.h constants to match
419 * XVD coding style
420 *
421 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/6   7/10/07 10:41a nilesh
422 * PR29915: Merged from mainline 07/10/2007
423 *
424 * Hydra_Software_Devel/37   6/28/07 10:32a gaurava
425 * PR 32432: Added bit in ppb->flags to tell XVD if a picture was
426 * decoded with errors.
427 * Release v7.3.18
428 *
429 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/5   7/3/07 3:47p nilesh
430 * PR29915: bxvd_priv.h cleanup
431 *
432 * Hydra_Software_Devel/xvd_PR29915_Rel_Mosaic_FW_API/4   6/19/07 12:13p nilesh
433 * PR29915: Merge from mainline
434 *
435 * Hydra_Software_Devel/36   5/22/07 1:27p gaurava
436 * PR 29143: Added second stc snapshot and removed H263 specific
437 * PPB.
438 *
439 * Hydra_Software_Devel/35   3/28/07 4:37p gaurava
440 * PR 29143: Added flag to PPB for picture_tag validity
441 *
442 * Hydra_Software_Devel/34   3/19/07 12:18p gaurava
443 * PR 28629: Added MPEG GopTimeCode to PPB
444 * Also modified the FGT data structs
445 *
446 * Hydra_Software_Devel/33   1/2/07 2:24p gaurava
447 * PR 26868: Added picture_tag support through BTP command. Also added ITB
448 * termination
449 * support for single-pass OTF.
450 * Release v7.3.2
451 *
452 * Hydra_Software_Devel/32   12/12/06 3:03p davidp
453 * PR25443: Merge Simplified FW API branch into mainline
454 *
455 * Hydra_Software_Devel/31   11/8/06 4:58p gaurava
456 * PR 22362: Added two new aspect ratio enum values as per new ISO
457 * spec received in email from Wesley Li.
458 *
459 * Hydra_Software_Devel/30   10/17/06 3:07p gaurava
460 * PR 24969: Modified the PPB definition to include a time_marker field
461 * that will be used to send time information synchronous with the stream.
462 *
463 * Hydra_Software_Devel/29   10/11/06 6:20a gaurava
464 * PR 24539: Added range remapping information in VC-1 PPB
465 *
466 * Hydra_Software_Devel/28   9/14/06 2:51p gaurava
467 * PR 24258: Cleaned the AVD header file.
468 *
469 * Hydra_Software_Devel/27   9/5/06 3:05p davidp
470 * PR22867: Merge secure heap (Cabac) support
471 *
472 * Hydra_Software_Devel/xvd_cabac_heap/1   8/30/06 5:12p davidp
473 * PR22867: Separate FW memory so Cabac bin memory can me moved to secure
474 * heap.
475 *
476 * Hydra_Software_Devel/26   8/23/06 3:09p gaurava
477 * PR 23787: Added picture_tag to MPEG PPB for BUD trick modes.
478 *
479 * Hydra_Software_Devel/25   6/16/06 5:48p gaurava
480 * PR 20017: PPB changes to align with new B0 firmware
481 *
482 * Hydra_Software_Devel/23   5/17/06 2:07p gaurava
483 * PR 20595: Fixed MPEG brcm trick modes. Also fixed DNR parameter
484 * extraction and a few H264 CRC failures related to RTS-limits on SI
485 * coeff generator.
486 *
487 * Hydra_Software_Devel/22   5/3/06 10:46a gaurava
488 * PR 17879: Changes for DNR feature-seq hdr and gop hdr.
489 *
490 * Hydra_Software_Devel/21   5/1/06 3:20p davidp
491 * PR20353: Checkin AVD FW to get latest 97401 FW changes that fix last
492 * slice not being decoded
493 *
494 * Hydra_Software_Devel/20   4/25/06 3:21p gaurava
495 * PR 18710: Added drop-at-decode feature in firmware.
496 *
497 * Hydra_Software_Devel/19   4/24/06 4:37p davidp
498 * PR18043: Add support for Sequence Header interrupt processing
499 *
500 * Hydra_Software_Devel/18   4/10/06 6:18p gaurava
501 * PR 20647: Fixed the crash of MIPS after channel change by reducing size
502 * of the PPB
503 * that caused scratch mem of outer-loop to get corrupted.
504 *
505 * Hydra_Software_Devel/17   3/31/06 3:34p gaurava
506 * PR 18749: Improvements in AVC RTS performance. PR 17879: Added DNR
507 * parameter extraction for MPEG-2. Added little-endian support through
508 * API, fixed PR 19485 for MPEG non-compliance stream
509 *
510 * Hydra_Software_Devel/16   3/15/06 5:15p gaurava
511 * PR 19749: Added a flag from DM to DMS to inform if pictures are running
512 * late.
513 *
514 * Hydra_Software_Devel/15   3/6/06 2:55p gaurava
515 * PR 19436: Added new elements for picture coding type and sequence
516 * header interrupt.
517 *
518 * Hydra_Software_Devel/14   2/15/06 1:56p pblanco
519 * PR18545: Extended user data types for 7401/7400 in the same manner Mai
520 * did for 7411.
521 *
522 * Hydra_Software_Devel/13   2/6/06 1:14p gaurava
523 * PR 19106: Fixed the header file change for the extended aspect_ratio
524 * that made the DM read the PPB incorrectly, leading to scaled video in
525 * the top-left.
526 *
527 * Hydra_Software_Devel/12   2/3/06 10:33p vijeth
528 * PR 19106 : Added the Extended A/R support in DM
529 *
530 * Hydra_Software_Devel/11   12/1/05 1:41p pblanco
531 * PR16052: Changed definition of UD_HDR to make it look like
532 * BXVD_P_Userdata.
533 *
534 * Hydra_Software_Devel/10   11/18/05 8:10p ssavekar
535 * PR 17811: Need idr_pic_id and PicOrderCnt with CRC values
536 * Adding code and data structure fields for passing CRC related
537 * parameters to VDC.
538 *
539 * Hydra_Software_Devel/9   10/26/05 9:21a davidp
540 * PR16052: Fix compiler warnings:
541 *
542 * Hydra_Software_Devel/8   10/20/05 5:26p pblanco
543 * PR16052: Removed all C++ style comments
544 *
545 * Hydra_Software_Devel/7   10/14/05 7:00p ssavekar
546 * PR 16052: New check-in for XVD
547 * Changes to get the code in sync with latest "vdec_info.h" file.
548 *
549 * Hydra_Software_Devel/7   10/14/05 6:59p ssavekar
550 * PR 16052: New check-in for XVD
551 * Changes to get the code in sync with latest "vdec_info.h" file.
552 *
553 * Hydra_Software_Devel/6   10/7/05 3:31p pblanco
554 * PR16052: Added definitions for more MPEG user data types.
555 *
556 * Hydra_Software_Devel/5   9/30/05 8:54p ssavekar
557 * PR 16052: New check-in for XVD
558 * Added a few elements in PPB data structures that were missing in the
559 * "bxvd" directory because of which display horizontal and vertical
560 * sizes were being read wrong from DM for MPEG.
561 *
562 * Hydra_Software_Devel/4   9/8/05 4:53p ssavekar
563 * PR 16052: New check-in for XVD
564 * Changes for DM integration with XVD and FW.
565 *
566 * Hydra_Software_Devel/3   8/2/05 5:24a ssavekar
567 * PR 16052: New check-in for XVD
568 * Changes after a code walk-through.
569 *
570 * Hydra_Software_Devel/1   7/29/05 9:05p ssavekar
571 * PR 16052: New check-in for XVD
572 * This file holds all the information about data structures passed from
573 * 7401 decode FW to DM and the data structures passed from 7401 DM to
574 * decode FW.
575 *
576 *
577 ***************************************************************************/
578
579#ifndef __INC_VDEC_INFO_H__
580#define __INC_VDEC_INFO_H__
581
582/* version information for PPB and other ancilliary data */
583#define VDEC_INFO_VERSION               1.8
584
585/* stripe-width used for output of decoded pixels */
586#define VIDEO_STRIPE_WIDTH              64
587
588/* buffer alignment required by hardware for luma, chroma in bytes */
589#define FRAME_BUFFER_ALIGNMENT          (4 * 1024)
590
591
592#if BXVD_P_FW_HIM_API
593
594#define BXVD_P_PPB_EXTENDED 1
595
596#endif
597
598/*
599 * SW7405-3996:: Constant and structure definitions for SEI messages.
600 */
601
602/*
603 *  Types of SEI messages
604 */
605#define  BXVD_P_PPB_SEI_MSG_FRAMEPACKING           0x2D
606#define  BXVD_P_PPB_SEI_MSG_MVC_GRAPHICS_OFFSET    0x80
607
608
609/* Graphics offset message */
610
611#define BXVD_P_MAX_MVC_OFFSET_META_SEQ 32
612
613typedef struct
614{
615    int32_t         size;
616    unsigned char   offset[BXVD_P_MAX_MVC_OFFSET_META_SEQ];
617} BXVD_P_MVC_Offset_Meta;
618
619
620/* Frame packing message */
621
622typedef struct
623{
624   uint32_t flags;
625   uint32_t frame_packing_arrangement_id;
626   uint32_t frame_packing_arrangement_type;
627   uint32_t content_interpretation_type;
628   uint32_t frame0_grid_position_x;
629   uint32_t frame0_grid_position_y;
630   uint32_t frame1_grid_position_x;
631   uint32_t frame1_grid_position_y;
632   uint32_t frame_packing_arrangement_reserved_byte;
633   uint32_t frame_packing_arrangement_repetition_period;
634
635} BXVD_P_SEI_FramePacking;
636
637/* Constants for interpreting the "flags" field in BXVD_P_SEI_FramePacking
638 *
639 * "arrangement_cancel":
640 * The H264 specification was not completely rigorous in the definition of this bit.  We are assuming
641 * that if this bit is set, none of the other fields in the message are valid.   This then implies
642 * that the picture is a 2D picture.  The orientation will be set to "2D" in both the Unified and
643 * MFD picture structures. (SW7405-5135)
644 */
645#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_ARRANGEMENT_CANCEL          (0x00000001)      /* if set, implies 2D */
646#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_QUINCUNX_SAMPLING           (0x00000002)
647#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_SPATIAL_FLIPPING            (0x00000004)
648#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_FRAME0_FLIPPED              (0x00000008)
649#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_FIELD_VIEWS                 (0x00000010)
650#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_CURRENT_FRAME_IS_FRAME0     (0x00000020)
651#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_FRAME0_SELF_CONTAINED       (0x00000040)
652#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_FRAME1_SELF_CONTAINED       (0x00000080)
653#define BXVD_P_PPB_FLAG_SEI_FRAMEPACK_ARRANGEMENT_EXTENSION       (0x00000100)
654
655
656/* Constants for interpreting the "frame_packing_arrangement_type" field in BXVD_P_SEI_FramePacking
657 */
658#define BXVD_P_PPB_SEI_FRAMEPACK_TYPE_CHECKER        0
659#define BXVD_P_PPB_SEI_FRAMEPACK_TYPE_COLUMN         1
660#define BXVD_P_PPB_SEI_FRAMEPACK_TYPE_ROW            2
661#define BXVD_P_PPB_SEI_FRAMEPACK_TYPE_SIDE_BY_SIDE   3
662#define BXVD_P_PPB_SEI_FRAMEPACK_TYPE_OVER_UNDER     4
663#define BXVD_P_PPB_SEI_FRAMEPACK_TYPE_ALTERNATING    5
664
665/* Constants for interpreting the "content_interpretation_type" field in BXVD_P_SEI_FramePacking
666 */
667#define BXVD_P_PPB_SEI_FRAMEPACK_INTERPRET_UNSPECIFIED  0
668#define BXVD_P_PPB_SEI_FRAMEPACK_INTERPRET_FRAME0_LEFT  1
669#define BXVD_P_PPB_SEI_FRAMEPACK_INTERPRET_FRAME0_RIGHT 2
670
671/* Generic wrapper for messages delivered by AVD */
672
673typedef struct BXVD_P_SEI_Message
674{
675   uint32_t uiMsgType;
676
677   /* Pointer to next message if sent. */
678
679   struct BXVD_P_SEI_Message * pstNextSEIMsgOffset;
680
681   union
682   {
683      BXVD_P_MVC_Offset_Meta  stOffsetMeta;
684      BXVD_P_SEI_FramePacking stSEIFramePacking;
685
686   } data;
687
688}  BXVD_P_SEI_Message;
689
690/*
691 * end:: SW7405-3996 add SEI messages
692 */
693
694/* SW7425-2247: constants for interpreting the "bar_data" field
695 *
696 * bits 13:0   top or left Bar Data
697 * bits 15:14  unused
698 * bits 29:16  bottom or right Bar Data
699 * bit 30      1 means Bar data is Top_Bottom, 0 means Bar Data is Left_Right
700 * bit 31      1 means Bar data is valid, 0 means invalid
701 */
702#define BXVD_P_PPB_BAR_DATA_TOP_LEFT_MASK    (0x00003FFF)
703#define BXVD_P_PPB_BAR_DATA_TOP_LEFT_SHIFT   0
704
705#define BXVD_P_PPB_BAR_DATA_BOT_RIGHT_MASK   (0x3FFF0000)
706#define BXVD_P_PPB_BAR_DATA_BOT_RIGHT_SHIFT  16
707
708#define BXVD_P_PPB_BAR_DATA_FLAG_TOP_BOTTOM  (0x40000000)
709#define BXVD_P_PPB_BAR_DATA_FLAG_VALID       (0x80000000)
710
711
712/* User Data Header */
713typedef struct user_data
714{
715   struct user_data  *next;
716   unsigned long      type;
717   unsigned long      size;
718} UD_HDR;
719
720/*------------------------------------------------------*
721 *    MPEG Extension to the BXVD_P_PPB                  *
722 *------------------------------------------------------*/
723#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_SEQ           (1)
724#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_GOP           (2)
725#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_PIC           (4)
726#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_TOP           (8)
727#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_BOT           (16)
728#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_I             (32)
729#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_P             (64)
730#define  BXVD_P_PPB_MPEG_USERDATA_TYPE_B             (128)
731
732/* GOP time code field extraction */
733#define BXVD_P_PPB_MPEG_GOP_HOUR_MASK    0xf80000
734#define BXVD_P_PPB_MPEG_GOP_MINUTE_MASK  0x7e000
735#define BXVD_P_PPB_MPEG_GOP_SECOND_MASK  0xfc0
736#define BXVD_P_PPB_MPEG_GOP_PICTURE_MASK 0x3f
737#define BXVD_P_PPB_MPEG_GOP_HOUR_SHIFT   0x13
738#define BXVD_P_PPB_MPEG_GOP_MINUTE_SHIFT 0x0d
739#define BXVD_P_PPB_MPEG_GOP_SECOND_SHIFT 0x06
740
741typedef struct
742{
743   uint32_t           pictype;   /* pict_coding_type (I=1, P=2, B=3) */
744
745   /* Always valid,  defaults to picture size if no
746      sequence display extension in the stream. */
747   uint32_t      display_horizontal_size;
748   uint32_t      display_vertical_size;
749
750   /* MPEG_VALID_PANSCAN
751      Offsets are a copy values from the MPEG stream. */
752   uint32_t      offset_count;
753   int32_t       horizontal_offset[3];
754   int32_t       vertical_offset[3];
755
756   /* GOP time code [23:19]=hour, [18:13]=minute, [11:6]=sec, [5:0]=frame */
757   uint32_t gop_time_code;
758
759   uint32_t      bit_rate_value;         /* bit-rate from sequence header */
760   uint32_t      low_delay_video_format; /* [17:16]=low_delay, [2:0]=video_format */
761   uint32_t      frame_rate_extension;   /* [6:5]=frame_rate_extn_n, [4:0]=frame_rate_extn_d */
762   unsigned char     repeat_first_field;    /*  MPEG-2 repeat first flag */
763   unsigned char     reserved[3];
764
765} BXVD_P_PPB_MPEG;
766
767
768/*------------------------------------------------------*
769 *    VC1 Extension to the PPB                          *
770 *------------------------------------------------------*/
771#define  BXVD_P_PPB_VC1_VALID_PANSCAN             (1)
772#define  BXVD_P_PPB_VC1_VALID_USER_DATA           (2)
773#define  BXVD_P_PPB_VC1_USER_DATA_OVERFLOW        (4)
774
775#define  BXVD_P_PPB_VC1_USERDATA_TYPE_SEQ        (1)
776#define  BXVD_P_PPB_VC1_USERDATA_TYPE_ENTRYPOINT (2)
777#define  BXVD_P_PPB_VC1_USERDATA_TYPE_FRM        (4)
778#define  BXVD_P_PPB_VC1_USERDATA_TYPE_FLD        (8)
779#define  BXVD_P_PPB_VC1_USERDATA_TYPE_SLICE      (16)
780
781typedef struct
782{
783   /* Always valid,  defaults to picture size if no
784      sequence display extension in the stream. */
785   uint32_t      display_horizontal_size;
786   uint32_t      display_vertical_size;
787
788  /* VC1 pan scan windows
789   */
790   uint32_t      num_panscan_windows;
791   uint32_t      ps_horiz_offset_width[4]; /* bits[31:14]=horiz_offset, [13:0]=width */
792   uint32_t      ps_vert_offset_height[4]; /* bits[31:14]=vert_offset, [13:0]=height */
793
794   uint32_t      range_remapping_ratio;    /* expansion/reduction information */
795
796} BXVD_P_PPB_VC1;
797
798
799/*------------------------------------------------------*
800 *    AVS Extension to the BXVD_P_PPB                   *
801 *------------------------------------------------------*/
802#define  BXVD_P_PPB_AVS_VALID_PANSCAN             (1)
803#define  BXVD_P_PPB_AVS_VALID_USER_DATA           (2)
804
805#define  BXVD_P_PPB_AVS_USER_DATA_TYPE_SEQ        (1)
806#define  BXVD_P_PPB_AVS_USER_DATA_TYPE_FRM        (2)
807#define  BXVD_P_PPB_AVS_USER_DATA_OVERFLOW        (4)
808
809typedef struct
810{
811   /* Always valid,  defaults to picture size if no
812      sequence display extension in the stream. */
813   uint32_t      display_horizontal_size;
814   uint32_t      display_vertical_size;
815
816   /* AVS_VALID_PANSCAN
817      Offsets are a copy values from the AVS stream. */
818   uint32_t      offset_count;
819   int32_t       horizontal_offset[3];
820   int32_t       vertical_offset[3];
821
822} BXVD_P_PPB_AVS;
823
824/*------------------------------------------------------*/
825/*    H.264 Extension to the BXVD_P_PPB                 */
826/*------------------------------------------------------*/
827
828/* userdata type flags */
829#define BXVD_P_PPB_H264_USERDATA_TYPE_REGISTERED      4
830#define BXVD_P_PPB_H264_USERDATA_TYPE_TOP             8
831#define BXVD_P_PPB_H264_USERDATA_TYPE_BOT            16
832#define BXVD_P_PPB_H264_USERDATA_TYPE_FRAME_PACK     45
833
834/**
835 * @brief Film grain SEI message.
836 *
837 * Content of the film grain SEI message.
838 */
839/*maximum number of model-values as for Thomson spec(standard says 5)*/
840#define MAX_FGT_MODEL_VALUE         (3)
841/* maximum number of intervals(as many as 256 intervals?) */
842#define MAX_FGT_VALUE_INTERVAL      (256)
843
844/* This is 3+3+(9*256)+(3*256)+(3*256) */
845#define MAX_FGT_VALS       3846
846
847/* Bit definitions for 'other.h264.valid' field */
848#define  BXVD_P_PPB_H264_VALID_PANSCAN             (1)
849#define  BXVD_P_PPB_H264_VALID_SPS_CROP            (2)
850#define  BXVD_P_PPB_H264_VALID_VUI                 (4)
851
852/* SW7401-4426: Bit defintions for the "time_code" field
853 * [24:20]=hour, [19:14]=minute, [13:8]=sec, [7:0]=frame
854 */
855#define BXVD_P_PPB_H264_GOP_HOUR_MASK    0x01F00000
856#define BXVD_P_PPB_H264_GOP_MINUTE_MASK  0x000FC000
857#define BXVD_P_PPB_H264_GOP_SECOND_MASK  0x00003F00
858#define BXVD_P_PPB_H264_GOP_PICTURE_MASK 0x000000FF
859#define BXVD_P_PPB_H264_GOP_HOUR_SHIFT   20
860#define BXVD_P_PPB_H264_GOP_MINUTE_SHIFT 14
861#define BXVD_P_PPB_H264_GOP_SECOND_SHIFT 8
862
863typedef struct
864{
865   /* 'valid' specifies which fields (or sets of
866    * fields) below are valid.  If the corresponding
867    * bit in 'valid' is NOT set then that field(s)
868    * is (are) not initialized. */
869   uint32_t      valid;
870
871   int32_t        poc_top;
872   int32_t        poc_bottom;
873   uint32_t      idr_pic_id;
874
875   /* H264_VALID_PANSCAN */
876   uint32_t      pan_scan_count;
877   uint32_t      pan_scan_horiz [3]; /* [31:16]=left, [15:0]=right */
878   uint32_t      pan_scan_vert  [3]; /* [31:16]=top, [15:0]=bottom */
879
880   /* H264_VALID_SPS_CROP */
881   uint32_t      sps_crop_horiz;     /* [31:16]=left, [15:0]=right */
882   uint32_t      sps_crop_vert;      /* [31:16]=top, [15:0]=bottom */
883
884   /* H264_VALID_VUI */
885   uint32_t      chroma_top;
886   uint32_t      chroma_bottom;
887
888   /* Offset to a BXVD_P_SEI_Message for the current frame */
889   BXVD_P_SEI_Message * pstSEIMessageOffset;
890
891} BXVD_P_PPB_H264;
892
893/* Bit definitions for 'other.h264.valid' field */
894#define  SVC_VALID_PANSCAN             (1)
895#define  SVC_VALID_SPS_CROP            (2)
896#define  SVC_VALID_VUI                 (4)
897
898typedef struct
899{
900   /* 'valid' specifies which fields (or sets of
901   * fields) below are valid.  If the corresponding
902   * bit in 'valid' is NOT set then that field(s)
903   * is (are) not initialized. */
904   uint32_t     valid;
905
906   int32_t       poc_top;
907   int32_t       poc_bottom;
908   uint32_t     idr_pic_id;
909
910   /* SVC_VALID_PANSCAN */
911   uint32_t     pan_scan_count;
912   uint32_t     pan_scan_horiz[3];  /* [31:16]=left, [15:0]=right */
913   uint32_t     pan_scan_vert[3];   /* [31:16]=top, [15:0]=bottom */
914
915   /* SVC_VALID_SPS_CROP */
916   uint32_t     sps_crop_horiz;     /* [31:16]=left, [15:0]=right */
917   uint32_t     sps_crop_vert;      /* [31:16]=top, [15:0]=bottom */
918
919   /* SVC_VALID_VUI */
920   uint32_t     chroma_top;
921   uint32_t     chroma_bottom;
922
923} BXVD_P_PPB_SVC;
924
925
926/*------------------------------------------------------*/
927/*   MPEG-4 Part-2 Extension to the BXVD_P_PPB          */
928/*------------------------------------------------------*/
929
930typedef struct
931{
932   uint32_t pictype;   /* pict_coding_type (I=0, P=1, B=2, S=3) */
933
934} BXVD_P_PPB_MP4;
935
936/*------------------------------------------------------*/
937/*    VP7/VP8 Extension to the BXVD_P_PPB               */
938/*------------------------------------------------------*/
939
940typedef struct
941{
942   /* 0: No upscaling (the most common case)
943    * 1: Upscale by 5/4
944    * 2: Upscale by 5/3
945    * 3: Upscale by 2 
946    */
947   uint32_t    horiz_scale_mode;
948   uint32_t    vert_scale_mode;
949
950   /* SWDTV-8681: add support for VP8 display size */
951   uint32_t display_horizontal_size;
952   uint32_t display_vertical_size;
953
954} BXVD_P_PPB_VP8;
955
956/*------------------------------------------------------*/
957/*    RV9 Extension to the BXVD_P_PPB                   */
958/*------------------------------------------------------*/
959
960typedef struct
961{
962   /* Always valid, defaults to picture size if no
963    * sequence display extension in the stream.
964    */
965    uint32_t   crop_horiz;     /* [31:16]=left, [15:0]=right */
966    uint32_t   crop_vert;      /* [31:16]=top, [15:0]=bottom */
967   
968} BXVD_P_PPB_RV9;
969
970
971/*------------------------------------------------------*
972 *    Picture Parameter Block                           *
973 *------------------------------------------------------*/
974
975/* Bit definitions for 'flags' field */
976
977
978#define  BXVD_P_PPB_FLAG_BUFFER_TYPE_MASK     (0x00000003)
979#define  BXVD_P_PPB_FLAG_FRAME                (0x00000000)
980#define  BXVD_P_PPB_FLAG_FIELDPAIR            (0x00000001)
981#define  BXVD_P_PPB_FLAG_TOPFIELD             (0x00000002)
982#define  BXVD_P_PPB_FLAG_BOTTOMFIELD          (0x00000003)
983
984#define  BXVD_P_PPB_FLAG_SOURCE_TYPE_MASK     (0x0000000c)
985#define  BXVD_P_PPB_FLAG_PROGRESSIVE_SRC      (0x00000000)
986#define  BXVD_P_PPB_FLAG_INTERLACED_SRC       (0x00000004)
987#define  BXVD_P_PPB_FLAG_UNKNOWN_SRC          (0x00000008)
988
989#define  BXVD_P_PPB_FLAG_BOTTOM_FIRST         (0x00000010)
990
991#define  BXVD_P_PPB_FLAG_PTS_PRESENT          (0x00000020)
992#define  BXVD_P_PPB_FLAG_PCR_OFFSET_PRESENT   (0x00000040)
993#define  BXVD_P_PPB_FLAG_DISCONT_PCR_OFFSET   (0x00000080)
994#define  BXVD_P_PPB_FLAG_PICTURE_LESS_PPB     (0x00000100)
995#define  BXVD_P_PPB_FLAG_PROG_SEQUENCE        (0x00000200)
996#define  BXVD_P_PPB_FLAG_PIC_TAG_PRESENT      (0x00000400)
997#define  BXVD_P_PPB_FLAG_DECODE_ERROR         (0x00000800)
998
999#define  BXVD_P_PPB_FLAG_AFD_VALID            (0x00001000)
1000
1001/* Bit 14:13 is a 2 bit enum for Picture type
1002 * 00 - Undefined (backward compatibility)
1003 * 01 - I Picture
1004 * 10 - P Picture
1005 * 11 - B Picture
1006 */
1007#define BXVD_P_PPB_FLAG_PICTURE_TYPE_MASK     (0x00006000)
1008#define BXVD_P_PPB_FLAG_I_PICTURE             (0x00002000)
1009#define BXVD_P_PPB_FLAG_P_PICTURE             (0x00004000)
1010#define BXVD_P_PPB_FLAG_B_PICTURE             (0x00006000)
1011
1012#define BXVD_P_PPB_FLAG_REF_PICTURE           (0x00008000)
1013#define BXVD_P_PPB_FLAG_RAP_PICTURE           (0x00010000)
1014
1015#define BXVD_P_PPB_NEW_PIC_TAG_AVAIL          (0x00020000)
1016#define BXVD_P_PPB_OVERSCAN_FLAG              (0x00040000)
1017#define BXVD_P_PPB_OVERSCAN_APPROPRIATE_FLAG  (0x00080000)
1018#define BXVD_P_PPB_FLAG_ERROR_CONCEAL         (0x00100000)
1019#define BXVD_P_PPB_FLAG_DECODE_REF_ERROR      (0x00200000)
1020#define BXVD_P_PPB_FLAG_INPUT_OVERFLOW        (0x00400000)
1021
1022/*
1023 * Bits 26:23: ( a 4-bit value of 0 means 2D PPB)
1024 *  These bits (enum) are used to indicate which view component PPB belongs to
1025 * Bit 26: When set to 1, indicates MVC Base View component, when set to 0
1026 *     indicates dependent view component
1027 * Bit 25:23: This three bit number indicates the view index number for the
1028 *     dependent view. This ranges from 1 to 7. 0 is not used, as Base view is
1029 *     view index 0. This number is only valid when Bit 26 is set to 0.
1030 *
1031 */
1032#define BXVD_P_PPB_MULTIVIEW_FIELD_MASK       (0x07800000)
1033#define BXVD_P_PPB_MULTIVIEW_COUNT_MASK       (0x03800000)
1034#define BXVD_P_PPB_MULTIVIEW_COUNT_SHIFT      23
1035#define BXVD_P_PPB_MULTIVIEW_BASE_FLAG        (0x04000000)
1036
1037#define BXVD_P_PPB_FLAG_FIXED_FRAME_RATE      (0x08000000)
1038
1039/* SW7405-4560:: Indicates that this is the first time the message is being delivered.
1040 * The 3D framepacking messages can be repeated for a 'N' pictures, this
1041 * flag can be used to filter repeated messages.
1042 */
1043#define BXVD_P_PPB_FLAG_NEW_SEI_MSG           (0x10000000)
1044
1045
1046#if BXVD_P_PPB_EXTENDED
1047
1048/* Bit definitions for the 'flags_ext0' field */
1049
1050/* SW7425-1001: effectively an EOS flag.  Currently defined to
1051 * only be delivered with a "picture-less" PPB.
1052 */
1053#define BXVD_P_PPB_EXT0_FLAG_LAST_PICTURE    (0x00000001)
1054
1055#endif
1056
1057
1058/* Values for 'pulldown' field.  '0' means no pulldown information
1059 * was present for this picture. */
1060typedef enum BXVD_P_PPB_PullDown
1061{
1062  BXVD_P_PPB_PullDown_eTop             = 1,
1063  BXVD_P_PPB_PullDown_eBottom          = 2,
1064  BXVD_P_PPB_PullDown_eTopBottom       = 3,
1065  BXVD_P_PPB_PullDown_eBottomTop       = 4,
1066  BXVD_P_PPB_PullDown_eTopBottomTop    = 5,
1067  BXVD_P_PPB_PullDown_eBottomTopBottom = 6,
1068  BXVD_P_PPB_PullDown_eFrameX2         = 7,
1069  BXVD_P_PPB_PullDown_eFrameX3         = 8,
1070  BXVD_P_PPB_PullDown_eFrameX1         = 9,
1071  BXVD_P_PPB_PullDown_eFrameX4         = 10
1072} BXVD_P_PPB_PullDown;
1073
1074/* Values for 'protocol' field. */
1075/* Use BAVC_VideoCompressionStd_eXXX values */
1076
1077/* Values for the 'frame_rate' field. */
1078typedef enum BXVD_P_PPB_FrameRate
1079{
1080  BXVD_P_PPB_FrameRate_eUnknown = 0,
1081  BXVD_P_PPB_FrameRate_e23_97,
1082  BXVD_P_PPB_FrameRate_e24,
1083  BXVD_P_PPB_FrameRate_e25,
1084  BXVD_P_PPB_FrameRate_e29_97,
1085  BXVD_P_PPB_FrameRate_e30,
1086  BXVD_P_PPB_FrameRate_e50,
1087  BXVD_P_PPB_FrameRate_e59_94,
1088  BXVD_P_PPB_FrameRate_e60,
1089  BXVD_P_PPB_FrameRate_e14_985,
1090  BXVD_P_PPB_FrameRate_e7_493
1091} BXVD_P_PPB_FrameRate;
1092
1093/* Values for the 'matrix_coeff' field. */
1094typedef enum BXVD_P_PPB_MatrixCoeff
1095{
1096  BXVD_P_PPB_MatrixCoeff_eUnknown   = 0,
1097  BXVD_P_PPB_MatrixCoeff_eBT709,
1098  BXVD_P_PPB_MatrixCoeff_eUnspecified,
1099  BXVD_P_PPB_MatrixCoeff_eReserved,
1100  BXVD_P_PPB_MatrixCoeff_eFCC       = 4,
1101  BXVD_P_PPB_MatrixCoeff_eBT740_2BG,
1102  BXVD_P_PPB_MatrixCoeff_eSMPTE170M,
1103  BXVD_P_PPB_MatrixCoeff_eSMPTE240M,
1104  BXVD_P_PPB_MatrixCoeff_eSMPTE293M
1105} BXVD_P_PPB_MatrixCoeff;
1106
1107/* Values for the 'aspect_ratio' field. */
1108typedef enum BXVD_P_PPB_AspectRatio
1109{
1110  BXVD_P_PPB_AspectRatio_eUnknown = 0,
1111  BXVD_P_PPB_AspectRatio_eSquare,
1112  BXVD_P_PPB_AspectRatio_e12_11,
1113  BXVD_P_PPB_AspectRatio_e10_11,
1114  BXVD_P_PPB_AspectRatio_e16_11,
1115  BXVD_P_PPB_AspectRatio_e40_33,
1116  BXVD_P_PPB_AspectRatio_e24_11,
1117  BXVD_P_PPB_AspectRatio_e20_11,
1118  BXVD_P_PPB_AspectRatio_e32_11,
1119  BXVD_P_PPB_AspectRatio_e80_33,
1120  BXVD_P_PPB_AspectRatio_e18_11,
1121  BXVD_P_PPB_AspectRatio_e15_11,
1122  BXVD_P_PPB_AspectRatio_e64_33,
1123  BXVD_P_PPB_AspectRatio_e160_99,
1124  BXVD_P_PPB_AspectRatio_e4_3,
1125  BXVD_P_PPB_AspectRatio_e3_2,
1126  BXVD_P_PPB_AspectRatio_e2_1,
1127  BXVD_P_PPB_AspectRatio_e16_9,
1128  BXVD_P_PPB_AspectRatio_e221_1,
1129  BXVD_P_PPB_AspectRatio_eOther = 255
1130} BXVD_P_PPB_AspectRatio;
1131
1132/* Values for the 'colour_primaries' field. */
1133typedef enum BXVD_P_PPB_ColorPrimaries
1134{
1135  BXVD_P_PPB_ColorPrimaries_eUnknown = 0,
1136  BXVD_P_PPB_ColorPrimaries_eBT709,
1137  BXVD_P_PPB_ColorPrimaries_eUnspecified,
1138  BXVD_P_PPB_ColorPrimaries_eReserved,
1139  BXVD_P_PPB_ColorPrimaries_eBT470_2M = 4,
1140  BXVD_P_PPB_ColorPrimaries_eBT470_2BG,
1141  BXVD_P_PPB_ColorPrimaries_eSMPTE170M,
1142  BXVD_P_PPB_ColorPrimaries_eSMPTE240M,
1143  BXVD_P_PPB_ColorPrimaries_eGenericFilm,
1144  BXVD_P_PPB_ColorPrimaries_eBT1361
1145} BXVD_P_PPB_ColorPrimaries;
1146
1147/* Values for the 'transfer_char' field. */
1148typedef enum BXVD_P_PPB_TransferChar
1149{
1150  BXVD_P_PPB_TransferChar_eUnknown = 0,
1151  BXVD_P_PPB_TransferChar_eBT709,
1152  BXVD_P_PPB_TransferChar_eUnspecified,
1153  BXVD_P_PPB_TransferChar_eReserved,
1154  BXVD_P_PPB_TransferChar_eBT479_2M = 4,
1155  BXVD_P_PPB_TransferChar_eBT479_2BG,
1156  BXVD_P_PPB_TransferChar_eSMPTE170M,
1157  BXVD_P_PPB_TransferChar_eSMPTE240M,
1158  BXVD_P_PPB_TransferChar_eLinear,
1159  BXVD_P_PPB_TransferChar_eLog100_1,
1160  BXVD_P_PPB_TransferChar_eLog31622777_1,
1161  BXVD_P_PPB_TransferChar_eIec_61966_2_4
1162} BXVD_P_PPB_TransferChar;
1163
1164/* Values for extracting the "protocol level" field from the PPB.
1165 * The "level" is the lower 16 bits.
1166 */
1167#define BXVD_P_PPB_PROTOCOL_LEVEL_MASK            0x0000FFFF
1168#define BXVD_P_PPB_PROTOCOL_LEVEL_SHIFT           0x0
1169
1170/* Values for extracting the "protocol profile" field from the PPB.
1171 * The "profile" is the upper 16 bits.
1172 */
1173#define BXVD_P_PPB_PROTOCOL_PROFILE_MASK          0xFFFF0000
1174#define BXVD_P_PPB_PROTOCOL_PROFILE_SHIFT         0x10
1175
1176
1177#define BXVD_P_PPB_DNR_FLAG_REFPIC                0x01
1178#define BXVD_P_PPB_DNR_FLAG_GOPHEADER             0x02
1179
1180typedef struct
1181{
1182   uint32_t      pic_flags;            /* Bit 2: GOP header seen. Bit 1: Sequence header seen Bit 0: reference pic  */
1183   uint32_t      sum_qp_cur;           /* sum of the quant params for this frame, or first field if interlaced */
1184   uint32_t      sum_qp_ref;           /* sum of the quant params for the reference pictures */
1185   uint32_t      num_mb_cur;           /* number of macroblocks included in sum_qp_cur */
1186   uint32_t      mb_count_intra_inter; /* number of  macroblocks in this picture: [31:16]=intra, [15:0]=non_intra */
1187   uint32_t      intra_qmat_sum_lo_hi; /* sum of intra quant matrix: [31:16]=first 36 entries, [15:0]=last 32 entries */
1188   uint32_t      inter_qmat_sum_lo_hi; /* sum of inter quant matrix: [31:16]=first 36 entries, [15:0]=last 32 entries */
1189   uint32_t      num_mb_ref;           /* number of macroblocks included in sum_qp_ref */
1190} BXVD_P_PPB_DNR;
1191
1192/* data structure with key statistics collected by inner-loop for a picture */
1193/* some are available only for newer AVD core revisions */
1194typedef struct
1195{
1196   /* Number of cycles taken just by the inner-loop decode.
1197    * Does not include cabac or outer-loop processing times. */
1198   uint32_t      decode_cycle_count;
1199
1200   /* the following are used/available for Rev J and later which
1201    * has a mocomp cache in there. will be 0 for earlier revisions. */
1202   uint32_t      pcache_hit;
1203   uint32_t      pcache_miss_1;
1204   uint32_t      pcache_miss_2;
1205
1206   uint32_t      cabac_cylces;
1207   uint32_t      inst_cache_miss;
1208} BXVD_P_PPB_IL_DATA;
1209
1210#if BXVD_P_PPB_EXTENDED
1211
1212typedef struct
1213{
1214    uint32_t      crc_luma;            /* frame or top field of LUMA CRC */
1215    uint32_t      crc_cb;              /* frame or top field of CHROMA CB CRC */
1216    uint32_t      crc_cr;              /* frame or top field of CHROMA CR CRC */
1217    uint32_t      crc_luma_bot;        /* bot field of LUMA CRC */
1218    uint32_t      crc_cb_bot;          /* bot field of CHROMA CB CRC */
1219    uint32_t      crc_cr_bot;          /* bot field of CHROMA CR CRC */   
1220} BXVD_P_PPB_CRC;
1221
1222/* Data structure with key statistics collected by outer-loop for a frame. */
1223/* For interlaced data,  statistics are accummulated over both fields-     */
1224/* statistics per field would go over 256 byte limit  */
1225
1226typedef struct
1227{
1228    uint32_t      idle_time;                  /* IL idle time; stall time while waiting for IL decode command */
1229    unsigned short    num_decod_mbs;              /* (H264 only) number of macroblock are decoded */
1230    unsigned short    num_recov_mbs;              /* (H264 only) Number Of Recovered Macroblocks: number of macroblocks which where error corrected */
1231    uint32_t      totalDecodeCycles;          /* total IL frame  decode cycle  */
1232    uint32_t      totalCabacCycles;           /* total CABAC frame cycle for pair field picture */
1233    uint32_t      totalILBLDecodeCycles;      /* svc IL frame decode cycle count include wait for BL */
1234    uint32_t      totalFrm2FrmDecodeCycles;   /* IL frame cycle count from frame to frame (include wit for (BL), OL) */
1235    uint32_t      reserved[4]; 
1236} BXVD_P_PPB_IL_LOG_DATA;
1237
1238
1239typedef struct
1240{
1241    uint32_t      decode_cycle_count;
1242    uint32_t      inst_cache_miss;
1243    uint32_t      display_time;
1244    uint32_t      cdb_size;
1245    uint32_t      reserved[4];
1246} BXVD_P_PPB_OL_LOG_DATA;
1247
1248typedef struct
1249{
1250    BXVD_P_PPB_IL_LOG_DATA il_log_data;
1251    BXVD_P_PPB_OL_LOG_DATA ol_log_data;
1252} BXVD_P_PPB_LOG_DATA;
1253
1254#endif /* #if BXVD_P_PPB_EXTENDED */
1255
1256typedef struct
1257{
1258   /* Common fields. */
1259   uint32_t      flags;            /* see above         */
1260   uint32_t      luma_video_address;    /* Address of picbuf Y     */
1261   uint32_t      chroma_video_address; /* Address of picbuf UV    */
1262   uint32_t      video_width;      /* Picbuf width      */
1263   uint32_t      video_height;     /* Picbuf height     */
1264
1265   uint32_t      luma_stripe_height;
1266   uint32_t      chroma_stripe_height;
1267   uint32_t      pulldown;         /* see above         */
1268   uint32_t      protocol;         /* protocolXXX (above)     */
1269
1270   uint32_t      frame_rate;       /* see above         */
1271   uint32_t      aspect_ratio;     /* see above         */
1272   uint32_t      custom_aspect_ratio_width_height; /* upper 16-bits is Y and lower 16-bits is X */
1273   uint32_t      display_info;     /* [31:24]=matrix_coeff, [23:16]=color_primaries, [15:8]=transfer_char */
1274
1275   uint32_t      pts;              /* 32 LSBs of PTS    */
1276   uint32_t      pcr_offset;       /* 45kHz if PCR type; else 27MHz */
1277   uint32_t      n_drop;           /* Number of pictures to be dropped */
1278
1279   /* User data is in the form of a linked list. */
1280   long               user_data_size;
1281   UD_HDR            *user_data;
1282
1283   /* DNR parameters */
1284   BXVD_P_PPB_DNR     dnr;              /* DNR parameters for entire frame */
1285
1286   uint32_t      timing_marker;
1287   uint32_t      picture_tag;      /* tag used during on-the-fly PVR, similar to PTS */
1288
1289   /* SW7425-2247: support for bar data. This field was
1290    * formerly fgt_block_avg_address
1291    */
1292   uint32_t      bar_data;         
1293   uint32_t      profile_level;
1294
1295   uint32_t      afd_val;         /* Active Format Descriptor */
1296
1297   /* IL decode information */
1298   BXVD_P_PPB_IL_DATA       il_perf_data;
1299
1300   uint32_t      delta_pic_seen;
1301
1302   /* W7401-4426: H264 time code [24:20]=hour, [19:14]=minute, [13:8]=sec, [7:0]=frame */
1303   uint32_t     time_code;
1304
1305   uint32_t      reserved[2];     /* may be removed if protocol-specific PPB requires more bytes */
1306
1307   /* Protocol-specific extensions. */
1308   union
1309   {
1310      BXVD_P_PPB_H264        h264;
1311      BXVD_P_PPB_SVC         svc;
1312      BXVD_P_PPB_MPEG        mpeg;
1313      BXVD_P_PPB_VC1         vc1;
1314      BXVD_P_PPB_AVS         avs;
1315      BXVD_P_PPB_MP4         mp4;
1316      BXVD_P_PPB_VP8         vp8;
1317      BXVD_P_PPB_RV9         rv9;
1318
1319#ifndef BXVD_P_PPB_EXTENDED
1320
1321   } other;
1322
1323#else
1324      uint32_t             stub[32];   /* to force this union to be a minimum of 32 words. */
1325
1326   } other;
1327
1328   BXVD_P_PPB_CRC          crc;
1329   uint32_t                flags_ext0;
1330   uint32_t                picture_latency;
1331   uint32_t                ppb_reserved[29];
1332   BXVD_P_PPB_LOG_DATA     data_log;
1333
1334#endif
1335
1336} BXVD_P_PPB;
1337
1338
1339/* Display Manager: STC and Parity Information in DRAM for host to use */
1340
1341#if BXVD_P_FW_HIM_API
1342
1343#define BXVD_P_CURRENT_MAJOR_VERSION 4
1344
1345#define BXVD_P_STC_MAX 8
1346
1347typedef struct
1348{
1349    uint32_t stc_snapshot[BXVD_P_STC_MAX];
1350    uint32_t vsync_parity;
1351} BXVD_P_DisplayInfo;
1352
1353#else
1354
1355#define BXVD_P_CURRENT_MAJOR_VERSION 3
1356
1357#define BXVD_P_STC_MAX 2
1358
1359typedef struct
1360{
1361      uint32_t stc_snapshot;
1362      uint32_t vsync_parity;
1363      uint32_t stc1_snapshot;
1364} BXVD_P_DisplayInfo;
1365
1366#endif   /* ~BXVD_P_FW_HIM_API */
1367
1368
1369#if BXVD_P_FW_HIM_API
1370#define BXVD_P_MAX_ELEMENTS_IN_DISPLAY_QUEUE              64
1371#define BXVD_P_INITIAL_OFFSET_DISPLAY_QUEUE                0
1372#else
1373#define BXVD_P_MAX_ELEMENTS_IN_DISPLAY_QUEUE              62
1374#define BXVD_P_INITIAL_OFFSET_DISPLAY_QUEUE                2
1375#endif
1376
1377#define BXVD_P_DISP_FIFO_DEPTH   ( BXVD_P_MAX_ELEMENTS_IN_DISPLAY_QUEUE + BXVD_P_INITIAL_OFFSET_DISPLAY_QUEUE )
1378
1379#if 0
1380/* Parameters passed from Display Manager (host) to DMS */
1381typedef struct
1382{
1383   uint32_t write_offset;
1384   uint32_t drop_count;
1385} BXVD_P_DMS_Info;
1386#endif
1387
1388typedef struct
1389{
1390
1391#if !BXVD_P_FW_HIM_API
1392    uint32_t queue_read_offset; /* offset is w.r.t base of this data struct so value of 0-1 prohibited */
1393    uint32_t queue_write_offset; /* offset is w.r.t base of this data struct so value of 0-1 prohibited */
1394#endif
1395
1396    /* queue if full if (write_offset+1 == read_offset) */
1397    /* write_offset modified by firmware and read_offset modified by Display Manager in host */
1398    BXVD_P_PPB *display_elements[BXVD_P_MAX_ELEMENTS_IN_DISPLAY_QUEUE];
1399
1400} BXVD_P_Avd_Queue_In_Memory;
1401
1402#define BXVD_P_PictureDeliveryQueue BXVD_P_Avd_Queue_In_Memory
1403#define BXVD_P_PictureReleaseQueue BXVD_P_Avd_Queue_In_Memory
1404
1405/* picture information block (PIB) */
1406typedef struct BXVD_P_PPB_PIB
1407{
1408        BXVD_P_PPB                sPPB;
1409        unsigned long      bFormatChange;
1410        unsigned long      ulResolution;
1411        unsigned long      ulChannelId;
1412        unsigned long      ppbPtr;
1413
1414} BXVD_P_PPB_PIB;
1415
1416
1417
1418/* The following two sections are mask and shift constant definitions based on FW team defined VDEC_FLAG above.
1419 * If the VDEC_FLAG bits change, these values will also need to change */
1420
1421/* picture structure is in bits 0 & 1 */
1422#define BXVD_P_PPB_FLAG_EXTRACT_PICT_STRUCT_MASK         0x03
1423#define BXVD_P_PPB_FLAG_EXTRACT_PICT_STRUCT_SHIFT        0x0
1424
1425/* progressive frame in bits 2 & 3 */
1426#define BXVD_P_PPB_FLAG_EXTRACT_SOURCE_FORMAT_MASK       0xc
1427#define BXVD_P_PPB_FLAG_EXTRACT_SOURCE_FORMAT_SHIFT      0x2
1428
1429/* Paramaters passed from DMS to DM */
1430typedef struct BXVD_P_DMS2DMInfo
1431{
1432        BXVD_P_DisplayInfo *pDisplayInfo ;
1433        BXVD_P_PictureDeliveryQueue *pPictureDeliveryQueue ;
1434        BXVD_P_PictureReleaseQueue  *pPictureReleaseQueue ;
1435} BXVD_P_DMS2DMInfo ;
1436
1437/* Parameters passed from DM to DMS */
1438typedef struct BXVD_P_DM2DMSInfo
1439{
1440   uint32_t pdq_write_offset ;
1441   uint32_t drop_count;
1442} BXVD_P_DM2DMSInfo ;
1443
1444typedef struct BXVD_P_DisplayElement
1445{
1446        BXVD_P_PPB *pPPB ;
1447        BXVD_P_PPB *pPPBPhysical ;
1448        BAVC_Polarity ePPBPolarity;
1449} BXVD_P_DisplayElement ;
1450
1451typedef struct BXVD_P_DisplayElementQueue
1452{
1453        BXVD_P_PPB *pPPBQArray[ BXVD_P_MAX_ELEMENTS_IN_DISPLAY_QUEUE ] ;
1454        uint32_t read_pointer ;
1455        uint32_t write_pointer ;
1456    uint32_t depth_pointer ;
1457} BXVD_P_DisplayElementQueue ;
1458/************************************************************************/
1459/* ABOVE ARE THE STRUCTURES ADDED BY SSAVEKAR FOR XVD INTEGRATION       */
1460/************************************************************************/
1461
1462#endif /* __INC_VDEC_INFO_H__ */
1463
1464
Note: See TracBrowser for help on using the repository browser.