| 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: bvdc_test.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/26 $ |
|---|
| 12 | * $brcm_Date: 1/27/12 3:53p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * Header file for Test functions. |
|---|
| 16 | * |
|---|
| 17 | * Revision History: |
|---|
| 18 | * |
|---|
| 19 | * $brcm_Log: /magnum/portinginterface/vdc/7038/bvdc_test.h $ |
|---|
| 20 | * |
|---|
| 21 | * Hydra_Software_Devel/26 1/27/12 3:53p pntruong |
|---|
| 22 | * SW7231-587: Allow Original PTS to be passed-through VDC and come out of |
|---|
| 23 | * GetBuffer() to Nexus to Raaga encode. |
|---|
| 24 | * |
|---|
| 25 | * Hydra_Software_Devel/25 10/27/11 4:29p syang |
|---|
| 26 | * SW7425-1429: move per vsync call back from window to display |
|---|
| 27 | * |
|---|
| 28 | * Hydra_Software_Devel/24 10/21/11 4:52p syang |
|---|
| 29 | * SW7425-1429: refined some name sof the data in |
|---|
| 30 | * BVDC_Test_Window_CapturedImage |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/23 10/21/11 11:16a syang |
|---|
| 33 | * SW7425-1429: added GetBuff_isr and ReturnBuff_isr and per vsync window |
|---|
| 34 | * call back |
|---|
| 35 | * |
|---|
| 36 | * Hydra_Software_Devel/22 4/12/07 5:37p tdo |
|---|
| 37 | * PR28837: Provide API to customize LAB LUT |
|---|
| 38 | * |
|---|
| 39 | * Hydra_Software_Devel/21 3/26/07 3:29p tdo |
|---|
| 40 | * PR 28401: Provide API to customize CAB LUT and enable/disable CAB |
|---|
| 41 | * |
|---|
| 42 | * Hydra_Software_Devel/20 12/18/06 11:32p pntruong |
|---|
| 43 | * PR22577: Merged back to mainline. |
|---|
| 44 | * |
|---|
| 45 | * Hydra_Software_Devel/Refsw_Devel_3563/2 11/20/06 3:20p tdo |
|---|
| 46 | * PR 23174: Add VDC function to overwrite HD_DVI color matrix to output |
|---|
| 47 | * fix color |
|---|
| 48 | * |
|---|
| 49 | * Hydra_Software_Devel/19 8/30/06 11:25p tdo |
|---|
| 50 | * PR 17994, PR 23383: Add support for DNR demo mode |
|---|
| 51 | * |
|---|
| 52 | * Hydra_Software_Devel/18 8/30/06 6:02p tdo |
|---|
| 53 | * PR 23212: Remove API for color clip and contrast stretch from test. |
|---|
| 54 | * They are now in bvdc.h |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/17 8/21/06 4:02p yuxiaz |
|---|
| 57 | * PR20875: Remove unused test API BVDC_Test_Source_SetFeederImageFormat. |
|---|
| 58 | * Use BVDC_Window_SetPixelFormat instead. |
|---|
| 59 | * |
|---|
| 60 | * Hydra_Software_Devel/16 5/19/06 2:29p hongtaoz |
|---|
| 61 | * PR17514: added bypass filter enum for DNR setting; disable extreme |
|---|
| 62 | * filter for 7401a0 due to PR16299; fixed range clamping for DNR |
|---|
| 63 | * settings; added DNR demo mode setting in test api; |
|---|
| 64 | * |
|---|
| 65 | * Hydra_Software_Devel/15 5/19/06 1:49p pntruong |
|---|
| 66 | * PR21560: Global symbols without BVDC prefix in the BVDC module. Reduce |
|---|
| 67 | * unnecessary global exported symbols. Tighten const params. |
|---|
| 68 | * |
|---|
| 69 | * Hydra_Software_Devel/14 2/23/06 2:32p tdo |
|---|
| 70 | * PR 16061: Add filter for max, mid, and min. Change some variable names |
|---|
| 71 | * to be more meaningful. Change the max point to 94 and 95 to reduce |
|---|
| 72 | * the affect of some white letters suddenly appear on screen. Increase |
|---|
| 73 | * precision of some incremental variables |
|---|
| 74 | * |
|---|
| 75 | * Hydra_Software_Devel/13 1/12/06 9:58a tdo |
|---|
| 76 | * PR 16061: Implementing dynamic contrast stretch in the PEP |
|---|
| 77 | * |
|---|
| 78 | * Hydra_Software_Devel/12 10/13/05 11:52a hongtaoz |
|---|
| 79 | * PR17532: added a test API to turn on OSD for deinterlacer; |
|---|
| 80 | * |
|---|
| 81 | * Hydra_Software_Devel/11 5/20/05 9:45a tdo |
|---|
| 82 | * PR 15183: Add sharpness control to the PEP and remove the old TAB |
|---|
| 83 | * setting |
|---|
| 84 | * |
|---|
| 85 | * Hydra_Software_Devel/10 7/28/04 11:55a tdo |
|---|
| 86 | * PR11971: Add CAB and LAB support |
|---|
| 87 | * |
|---|
| 88 | * Hydra_Software_Devel/9 7/26/04 6:03p tdo |
|---|
| 89 | * PR 11971: add TAB and color clip support |
|---|
| 90 | * |
|---|
| 91 | * Hydra_Software_Devel/8 4/30/04 2:28p hongtaoz |
|---|
| 92 | * PR8761: fixed C++ compiling errors; |
|---|
| 93 | * |
|---|
| 94 | * Hydra_Software_Devel/7 2/19/04 9:06a yuxiaz |
|---|
| 95 | * PR 9393: Added more comment. |
|---|
| 96 | * |
|---|
| 97 | * Hydra_Software_Devel/6 2/18/04 4:21p yuxiaz |
|---|
| 98 | * PR 9393: Add test API to support packed image format for Mpeg feeder. |
|---|
| 99 | * |
|---|
| 100 | * Hydra_Software_Devel/5 1/16/04 2:15p maivu |
|---|
| 101 | * PR 9375: Added BVDC_Test_Display_GetInterruptName |
|---|
| 102 | * |
|---|
| 103 | * Hydra_Software_Devel/4 10/30/03 4:36p maivu |
|---|
| 104 | * Added comments. |
|---|
| 105 | * |
|---|
| 106 | * Hydra_Software_Devel/3 10/30/03 3:16p maivu |
|---|
| 107 | * Changed the interface for BVDC_Test_Display_EnableCrc and |
|---|
| 108 | * BVDC_Test_Display_ResetCrc |
|---|
| 109 | * |
|---|
| 110 | * Hydra_Software_Devel/2 10/10/03 3:38p maivu |
|---|
| 111 | * Removed private header file |
|---|
| 112 | * |
|---|
| 113 | * Hydra_Software_Devel/1 10/10/03 12:54p maivu |
|---|
| 114 | * Initial revision |
|---|
| 115 | * |
|---|
| 116 | ***************************************************************************/ |
|---|
| 117 | #ifndef BVDC_TEST_H__ |
|---|
| 118 | #define BVDC_TEST_H__ |
|---|
| 119 | |
|---|
| 120 | #include "bvdc.h" |
|---|
| 121 | |
|---|
| 122 | #ifdef __cplusplus |
|---|
| 123 | extern "C" { |
|---|
| 124 | #endif |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | /*************************************************************************** |
|---|
| 128 | Summary: |
|---|
| 129 | A structure representing the captured field/frame that is provided to the |
|---|
| 130 | user application. |
|---|
| 131 | |
|---|
| 132 | Description: |
|---|
| 133 | pvBufAddr - captured image derived from a field or frame |
|---|
| 134 | pvBufAddrR - captured right image derived from a field or frame |
|---|
| 135 | ulWidth - width of the captued image |
|---|
| 136 | ulHeight - height of the captued image |
|---|
| 137 | ulPitch - pitch of the captued image |
|---|
| 138 | eFormat - pixel format in the captued image |
|---|
| 139 | eOutOrientation - display 3D orientation of the left and right surfaces |
|---|
| 140 | eCapturePolarity - the polarity of the captured image. |
|---|
| 141 | ulOrigPTS - Original PTS of the picture. Note this PTS value could be |
|---|
| 142 | either original coded PTS or interolated PTS by DM. See also |
|---|
| 143 | BAVC_MFD_Picture.ulOrigPTS. |
|---|
| 144 | |
|---|
| 145 | See Also: |
|---|
| 146 | BVDC_Test_Window_GetBuffer_isr |
|---|
| 147 | ****************************************************************************/ |
|---|
| 148 | typedef struct |
|---|
| 149 | { |
|---|
| 150 | void *pvBufAddr; |
|---|
| 151 | void *pvBufAddrR; |
|---|
| 152 | uint32_t ulWidth; |
|---|
| 153 | uint32_t ulHeight; |
|---|
| 154 | uint32_t ulPitch; |
|---|
| 155 | BPXL_Format ePxlFmt; |
|---|
| 156 | BFMT_Orientation eDispOrientation; |
|---|
| 157 | unsigned long ulCaptureNumVbiLines; |
|---|
| 158 | BAVC_Polarity eCapturePolarity; |
|---|
| 159 | uint32_t ulOrigPTS; |
|---|
| 160 | |
|---|
| 161 | } BVDC_Test_Window_CapturedImage; |
|---|
| 162 | |
|---|
| 163 | /*************************************************************************** |
|---|
| 164 | Summary: |
|---|
| 165 | Get the Display interrupt name for the new state |
|---|
| 166 | |
|---|
| 167 | Description: |
|---|
| 168 | This function returns the interrupt name associated with the Display |
|---|
| 169 | RUL when execution is completed. Applications can use the interrupt |
|---|
| 170 | name to register a callback with BINT. |
|---|
| 171 | |
|---|
| 172 | Input: |
|---|
| 173 | hDisplay - Display handle created earlier with BVDC_Display_Create. |
|---|
| 174 | eFieldPolarity - Field polarity for that interrupt (top or bottom) |
|---|
| 175 | |
|---|
| 176 | Output: |
|---|
| 177 | pInterruptName - The L2 interrupt name that can be use with BINT |
|---|
| 178 | to create the callback. |
|---|
| 179 | |
|---|
| 180 | Returns: |
|---|
| 181 | BERR_INVALID_PARAMETER - hDisplay is not a valid display handle. |
|---|
| 182 | BERR_SUCCESS - Function succeed |
|---|
| 183 | |
|---|
| 184 | See Also: |
|---|
| 185 | BINT_CreateCallback. |
|---|
| 186 | ****************************************************************************/ |
|---|
| 187 | BERR_Code BVDC_Test_Display_GetInterruptName |
|---|
| 188 | ( BVDC_Display_Handle hDisplay, |
|---|
| 189 | const BAVC_Polarity eFieldId, |
|---|
| 190 | BINT_Id *pInterruptName ); |
|---|
| 191 | |
|---|
| 192 | /*************************************************************************** |
|---|
| 193 | Summary: |
|---|
| 194 | This function show/hide OSD of MAD for a window if that window enables |
|---|
| 195 | deinterlace. |
|---|
| 196 | |
|---|
| 197 | Description: |
|---|
| 198 | Disable or enable OSD and set the OSD position. |
|---|
| 199 | |
|---|
| 200 | Input: |
|---|
| 201 | hWindow - A valid window handle created ealier. |
|---|
| 202 | bEnable - boolean to enable/disable OSD. |
|---|
| 203 | ulHpos - On screen display horizontal position. |
|---|
| 204 | Note: ulHPos must be an even number due to YUV422 format. |
|---|
| 205 | ulVpos - On screen display vertical position. |
|---|
| 206 | |
|---|
| 207 | Output: |
|---|
| 208 | |
|---|
| 209 | Returns: |
|---|
| 210 | BERR_SUCCESS - Successfully set the flag to shows/hides the OSD for the window. |
|---|
| 211 | |
|---|
| 212 | See Also: |
|---|
| 213 | **************************************************************************/ |
|---|
| 214 | BERR_Code BVDC_Test_Window_SetMadOsd |
|---|
| 215 | ( BVDC_Window_Handle hWindow, |
|---|
| 216 | bool bEnable, |
|---|
| 217 | uint32_t ulHpos, |
|---|
| 218 | uint32_t ulVpos); |
|---|
| 219 | |
|---|
| 220 | /*************************************************************************** |
|---|
| 221 | Summary: |
|---|
| 222 | This function gets OSD setting of MAD block if the window enables deinterlace. |
|---|
| 223 | |
|---|
| 224 | Description: |
|---|
| 225 | Get the OSD setting of window's MAD block. |
|---|
| 226 | |
|---|
| 227 | Input: |
|---|
| 228 | hWindow - A valid window handle created ealier. |
|---|
| 229 | bEnable - boolean to enable/disable OSD. |
|---|
| 230 | pulHpos - Pointer to the On screen display horizontal position. |
|---|
| 231 | pulVpos - Pointer to the On screen display vertical position. |
|---|
| 232 | |
|---|
| 233 | Output: |
|---|
| 234 | |
|---|
| 235 | Returns: |
|---|
| 236 | BERR_SUCCESS - Successfully Get the MAD's OSD status of the window. |
|---|
| 237 | |
|---|
| 238 | See Also: |
|---|
| 239 | **************************************************************************/ |
|---|
| 240 | BERR_Code BVDC_Test_Window_GetMadOsd |
|---|
| 241 | ( BVDC_Window_Handle hWindow, |
|---|
| 242 | bool *pbEnable, |
|---|
| 243 | uint32_t *pulHpos, |
|---|
| 244 | uint32_t *pulVpos); |
|---|
| 245 | |
|---|
| 246 | /*************************************************************************** |
|---|
| 247 | Summary: |
|---|
| 248 | This function sets source fix color output |
|---|
| 249 | |
|---|
| 250 | Description: |
|---|
| 251 | Overwrite the source color matrix to outputing a fix color |
|---|
| 252 | |
|---|
| 253 | Input: |
|---|
| 254 | hWindow - A valid window handle created ealier. |
|---|
| 255 | eFieldId - Field polarity to have this fix color. |
|---|
| 256 | bEnable - boolean to enable/disable fix color. |
|---|
| 257 | ucRed - The RED component of the fix color. |
|---|
| 258 | ucGreen - The GREEN component of the fix color. |
|---|
| 259 | ucBlue - The BLUE component of the fix color. |
|---|
| 260 | |
|---|
| 261 | Output: |
|---|
| 262 | |
|---|
| 263 | Returns: |
|---|
| 264 | BERR_SUCCESS - Successfully set the fix color for the source. |
|---|
| 265 | |
|---|
| 266 | See Also: |
|---|
| 267 | BVDC_Test_Source_GetFixColor |
|---|
| 268 | **************************************************************************/ |
|---|
| 269 | BERR_Code BVDC_Test_Source_SetFixColor |
|---|
| 270 | ( BVDC_Source_Handle hSource, |
|---|
| 271 | BAVC_Polarity eFieldId, |
|---|
| 272 | bool bEnable, |
|---|
| 273 | uint32_t ulRed, |
|---|
| 274 | uint32_t ulGreen, |
|---|
| 275 | uint32_t ulBlue ); |
|---|
| 276 | |
|---|
| 277 | /*************************************************************************** |
|---|
| 278 | Summary: |
|---|
| 279 | This function gets source fix color output |
|---|
| 280 | |
|---|
| 281 | Description: |
|---|
| 282 | Gets the source fix color for a field polarity if it is enable |
|---|
| 283 | |
|---|
| 284 | Input: |
|---|
| 285 | hWindow - A valid window handle created ealier. |
|---|
| 286 | eFieldId - Field polarity to have this fix color. |
|---|
| 287 | |
|---|
| 288 | Output: |
|---|
| 289 | pbEnable - boolean to enable/disable fix color. |
|---|
| 290 | pucRed - The RED component of the fix color. |
|---|
| 291 | pucGreen - The GREEN component of the fix color. |
|---|
| 292 | pucBlue - The BLUE component of the fix color. |
|---|
| 293 | |
|---|
| 294 | Returns: |
|---|
| 295 | BERR_SUCCESS - Successfully get the fix color for the source. |
|---|
| 296 | |
|---|
| 297 | See Also: |
|---|
| 298 | BVDC_Test_Source_SetFixColor |
|---|
| 299 | *************************************************************************/ |
|---|
| 300 | BERR_Code BVDC_Test_Source_GetFixColor |
|---|
| 301 | ( BVDC_Source_Handle hSource, |
|---|
| 302 | BAVC_Polarity eFieldId, |
|---|
| 303 | bool *pbEnable, |
|---|
| 304 | uint32_t *pulRed, |
|---|
| 305 | uint32_t *pulGreen, |
|---|
| 306 | uint32_t *pulBlue ); |
|---|
| 307 | |
|---|
| 308 | /*************************************************************************** |
|---|
| 309 | Summary: |
|---|
| 310 | Obtains the last captured buffer from the associated video window in |
|---|
| 311 | _isr context |
|---|
| 312 | |
|---|
| 313 | Description: |
|---|
| 314 | This is the _isr version of BVDC_Window_GetBuffer. Refer to it for |
|---|
| 315 | description first. |
|---|
| 316 | |
|---|
| 317 | An example application of this _isr version is for upper level software |
|---|
| 318 | to get the current VDC display buffer and to pass to Raaga encoder, |
|---|
| 319 | inside the callback function called from VDC at every display vsync. The |
|---|
| 320 | callback function is installed by upper level software to VDC display. |
|---|
| 321 | |
|---|
| 322 | When field inversion happens, the captured buffer's polarity will not |
|---|
| 323 | match the display polarity passed to the the callback function. |
|---|
| 324 | |
|---|
| 325 | Upper level software should call BVDC_Test_Window_GetBuffer_isr inside |
|---|
| 326 | or after the display's per vsync callback. It should only be called ONCE. |
|---|
| 327 | If more than once are called, the returned buffers are likely out of |
|---|
| 328 | time order. |
|---|
| 329 | |
|---|
| 330 | Input: |
|---|
| 331 | hWindow - the window handle created earlier with BVDC_Window_Create. |
|---|
| 332 | |
|---|
| 333 | Output: |
|---|
| 334 | pCapturedImage - the last captured buffer associated with hWindow. |
|---|
| 335 | |
|---|
| 336 | Returns: |
|---|
| 337 | BVDC_ERR_CAPTURED_BUFFER_NOT_FOUND - No valid capture buffer to return |
|---|
| 338 | BERR_INVALID_PARAMETER - Invalid function parameters. |
|---|
| 339 | BERR_SUCCESS - Function succeed |
|---|
| 340 | |
|---|
| 341 | See Also: |
|---|
| 342 | BVDC_Test_Window_ReturnBuffer_isr, BVDC_Test_Window_CapturedImage, |
|---|
| 343 | BVDC_Window_SetUserCaptureBufferCount, BVDC_Display_InstallCallback |
|---|
| 344 | BVDC_Open, BVDC_Window_SetPixelFormat, |
|---|
| 345 | **************************************************************************/ |
|---|
| 346 | BERR_Code BVDC_Test_Window_GetBuffer_isr |
|---|
| 347 | ( BVDC_Window_Handle hWindow, |
|---|
| 348 | BVDC_Test_Window_CapturedImage *pCapturedImage); |
|---|
| 349 | |
|---|
| 350 | /*************************************************************************** |
|---|
| 351 | Summary: |
|---|
| 352 | Returns a captured buffer to the associated window in _isr context. |
|---|
| 353 | |
|---|
| 354 | Description: |
|---|
| 355 | This is _isr verion of BVDC_Window_ReturnBuffer. Refer to it for |
|---|
| 356 | description first. |
|---|
| 357 | |
|---|
| 358 | Input: |
|---|
| 359 | hWindow - the window handle created earlier with BVDC_Window_Create. |
|---|
| 360 | pCapturedImage - the captured buffer associated with hWindow. |
|---|
| 361 | |
|---|
| 362 | Output: |
|---|
| 363 | None |
|---|
| 364 | |
|---|
| 365 | Returns: |
|---|
| 366 | BERR_INVALID_PARAMETER - Invalid function parameters. |
|---|
| 367 | BERR_SUCCESS - Function succeeds |
|---|
| 368 | |
|---|
| 369 | Note: |
|---|
| 370 | An outstanding capture buffer must be returned and freed if the |
|---|
| 371 | associated window is to be shut down or reconfigured. |
|---|
| 372 | |
|---|
| 373 | See Also: |
|---|
| 374 | BVDC_Test_Window_GetBuffer_isr, BVDC_Test_Window_CapturedImage, |
|---|
| 375 | BVDC_Window_SetUserCaptureBufferCount, BVDC_Display_InstallCallback |
|---|
| 376 | BVDC_Open, BVDC_Window_SetPixelFormat, |
|---|
| 377 | **************************************************************************/ |
|---|
| 378 | BERR_Code BVDC_Test_Window_ReturnBuffer_isr |
|---|
| 379 | ( BVDC_Window_Handle hWindow, |
|---|
| 380 | BVDC_Test_Window_CapturedImage *pCapturedImage ); |
|---|
| 381 | |
|---|
| 382 | |
|---|
| 383 | #ifdef __cplusplus |
|---|
| 384 | } |
|---|
| 385 | #endif |
|---|
| 386 | |
|---|
| 387 | #endif /* #ifndef BVDC_TEST_H__ */ |
|---|
| 388 | /* End of file. */ |
|---|