| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2010-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bm2mc_packet.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/33 $ |
|---|
| 12 | * $brcm_Date: 12/16/11 6:54p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: M2MC Packet header |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/grc/7405/bm2mc_packet.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/33 12/16/11 6:54p nissen |
|---|
| 21 | * SW7038-3520: Added flag to force fixed scale factor of 0. |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/32 9/16/11 1:11p nissen |
|---|
| 24 | * SW7425-1207: Added support for UpdateScaleBlit packet. |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/31 9/1/11 5:35p nissen |
|---|
| 27 | * SW7405-3671: Added FixedScale macro. |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/30 7/27/11 5:58p nissen |
|---|
| 30 | * SW7405-3671: Added support for fixed scaling with 420 destriping. |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/29 5/11/11 1:23p nissen |
|---|
| 33 | * SW7401-4501: Added L8 pixel format. |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/28 4/25/11 3:59p nissen |
|---|
| 36 | * SW7630-104: Added support for A8_Y8, Cb8 and Cr8 formats. |
|---|
| 37 | * |
|---|
| 38 | * Hydra_Software_Devel/27 3/18/11 7:32p nissen |
|---|
| 39 | * SW7038-3500: Fixing header size. |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/26 3/18/11 3:02p nissen |
|---|
| 42 | * SW7420-1575: Switch format field back to uint8_t. |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/25 3/7/11 3:59p nissen |
|---|
| 45 | * SW7420-1575: Added support for surface rectangle verification. |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/24 3/7/11 2:11p nissen |
|---|
| 48 | * SW7038-3500: Switched header size back. |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/23 3/5/11 4:47p nissen |
|---|
| 51 | * SW7038-3500: Changed header size to fit filter table. |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/22 3/4/11 1:41p nissen |
|---|
| 54 | * SW7038-3500: Fixed header size. |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/21 3/3/11 4:49p nissen |
|---|
| 57 | * SW7038-3500: Fixed build error for 7038. |
|---|
| 58 | * |
|---|
| 59 | * Hydra_Software_Devel/20 3/3/11 3:11p nissen |
|---|
| 60 | * SW7038-3500: Fixed build error for 7038. |
|---|
| 61 | * |
|---|
| 62 | * Hydra_Software_Devel/19 3/2/11 4:55p nissen |
|---|
| 63 | * SW7405-3671: Added new luma pixel formats. |
|---|
| 64 | * |
|---|
| 65 | * Hydra_Software_Devel/18 3/1/11 1:39p nissen |
|---|
| 66 | * SW7038-3500: Removed include file. |
|---|
| 67 | * |
|---|
| 68 | * Hydra_Software_Devel/17 2/28/11 2:01p nissen |
|---|
| 69 | * SW7038-3500: Added include file to fix structure sizing for filter |
|---|
| 70 | * packet. |
|---|
| 71 | * |
|---|
| 72 | * Hydra_Software_Devel/16 2/25/11 5:09p nissen |
|---|
| 73 | * SW7038-3500: Added initial support for 7038. |
|---|
| 74 | * |
|---|
| 75 | * Hydra_Software_Devel/15 11/15/10 3:07p nissen |
|---|
| 76 | * SW7335-916: Added linear destripe field to source control packet. |
|---|
| 77 | * |
|---|
| 78 | * Hydra_Software_Devel/14 11/11/10 1:41p nissen |
|---|
| 79 | * SW7335-916: Added support for FixedScale packet. |
|---|
| 80 | * |
|---|
| 81 | * Hydra_Software_Devel/13 10/6/10 2:23p nissen |
|---|
| 82 | * SW7405-3671: Added DestinationColor packet. |
|---|
| 83 | * |
|---|
| 84 | * Hydra_Software_Devel/12 9/27/10 7:15p nissen |
|---|
| 85 | * SW7405-3671: Fixed typos in write macros. |
|---|
| 86 | * |
|---|
| 87 | * Hydra_Software_Devel/11 9/23/10 2:42p nissen |
|---|
| 88 | * SW7405-3671: Changed macro params to caps. |
|---|
| 89 | * |
|---|
| 90 | * Hydra_Software_Devel/10 9/23/10 2:02p nissen |
|---|
| 91 | * SW7405-3671: Fixed write macros. |
|---|
| 92 | * |
|---|
| 93 | * Hydra_Software_Devel/9 8/9/10 5:05p nissen |
|---|
| 94 | * SW7405-3671: Removed pixel formats that are not in PXL. |
|---|
| 95 | * |
|---|
| 96 | * Hydra_Software_Devel/8 8/6/10 1:53p nissen |
|---|
| 97 | * SW7405-3671: Added max value for packet type enum. |
|---|
| 98 | * |
|---|
| 99 | * Hydra_Software_Devel/7 8/1/10 12:03p nissen |
|---|
| 100 | * SW7405-3671: Fixed macro that writes scale blit packet. |
|---|
| 101 | * |
|---|
| 102 | * Hydra_Software_Devel/6 7/21/10 4:31p nissen |
|---|
| 103 | * SW7405-3671: Fixed init macro and removed dst color macro. |
|---|
| 104 | * |
|---|
| 105 | * Hydra_Software_Devel/5 7/19/10 6:49p nissen |
|---|
| 106 | * SW7405-3671: Added more packets and macros to write packets. |
|---|
| 107 | * |
|---|
| 108 | * Hydra_Software_Devel/4 7/12/10 2:23p nissen |
|---|
| 109 | * SW7405-3671: Updated packet structures and types and added |
|---|
| 110 | * documentation. |
|---|
| 111 | * |
|---|
| 112 | * Hydra_Software_Devel/3 6/30/10 9:26p nissen |
|---|
| 113 | * SW7405-3671: Updated filter and color matrix packets. |
|---|
| 114 | * |
|---|
| 115 | * Hydra_Software_Devel/2 6/30/10 7:49p nissen |
|---|
| 116 | * SW7405-3671: Added blending and pixel format enums. |
|---|
| 117 | * |
|---|
| 118 | * Hydra_Software_Devel/1 6/21/10 11:19a nissen |
|---|
| 119 | * SW7405-3671: Initial version. |
|---|
| 120 | * |
|---|
| 121 | ***************************************************************************/ |
|---|
| 122 | |
|---|
| 123 | #ifndef BM2MC_PACKET_H__ |
|---|
| 124 | #define BM2MC_PACKET_H__ |
|---|
| 125 | |
|---|
| 126 | #ifdef __cplusplus |
|---|
| 127 | extern "C" { |
|---|
| 128 | #endif |
|---|
| 129 | |
|---|
| 130 | /*************************************************************************** |
|---|
| 131 | PACKET TYPE ENUMERATION |
|---|
| 132 | ***************************************************************************/ |
|---|
| 133 | typedef enum BM2MC_PACKET_PacketType |
|---|
| 134 | { |
|---|
| 135 | BM2MC_PACKET_PacketType_eSourceFeeder = 1, /* source plane and color */ |
|---|
| 136 | BM2MC_PACKET_PacketType_eSourceFeeders, /* source planes and color */ |
|---|
| 137 | BM2MC_PACKET_PacketType_eSourceColor, /* source color */ |
|---|
| 138 | BM2MC_PACKET_PacketType_eSourceNone, /* source none (default) */ |
|---|
| 139 | BM2MC_PACKET_PacketType_eSourceControl, /* source control of zero_pad and chroma_filter */ |
|---|
| 140 | BM2MC_PACKET_PacketType_eDestinationFeeder, /* destination plane and color */ |
|---|
| 141 | BM2MC_PACKET_PacketType_eDestinationColor, /* destination color */ |
|---|
| 142 | BM2MC_PACKET_PacketType_eDestinationNone, /* destination none (default) */ |
|---|
| 143 | BM2MC_PACKET_PacketType_eDestinationControl, /* destination control of zero_pad and chroma_filter */ |
|---|
| 144 | BM2MC_PACKET_PacketType_eOutputFeeder, /* output plane */ |
|---|
| 145 | BM2MC_PACKET_PacketType_eOutputControl, /* output control of dither and chroma_filter */ |
|---|
| 146 | BM2MC_PACKET_PacketType_eBlend, /* color and alpha blend, and blend color */ |
|---|
| 147 | BM2MC_PACKET_PacketType_eBlendColor, /* blend color */ |
|---|
| 148 | BM2MC_PACKET_PacketType_eRop, /* ternary raster operation */ |
|---|
| 149 | BM2MC_PACKET_PacketType_eSourceColorkey, /* source colorkeys, masks, and replacements */ |
|---|
| 150 | BM2MC_PACKET_PacketType_eSourceColorkeyEnable, /* source colorkey enable */ |
|---|
| 151 | BM2MC_PACKET_PacketType_eDestinationColorkey, /* destination colorkeys, masks, and replacements */ |
|---|
| 152 | BM2MC_PACKET_PacketType_eDestinationColorkeyEnable, /* destination colorkey enable */ |
|---|
| 153 | BM2MC_PACKET_PacketType_eFilter, /* filter coefficient table */ |
|---|
| 154 | BM2MC_PACKET_PacketType_eFilterEnable, /* filter enable */ |
|---|
| 155 | BM2MC_PACKET_PacketType_eFilterControl, /* filter control of rounding, channel adjustment and ordering */ |
|---|
| 156 | BM2MC_PACKET_PacketType_eSourceColorMatrix, /* source color matrix */ |
|---|
| 157 | BM2MC_PACKET_PacketType_eSourceColorMatrixEnable, /* source color matrix enable */ |
|---|
| 158 | BM2MC_PACKET_PacketType_eSourcePalette, /* source palette address */ |
|---|
| 159 | BM2MC_PACKET_PacketType_eAlphaPremultiply, /* multiply pixel color by pixel alpha before blending */ |
|---|
| 160 | BM2MC_PACKET_PacketType_eMirror, /* reverse read/write order for source, destination and output feeders */ |
|---|
| 161 | BM2MC_PACKET_PacketType_eFixedScale, /* initial phase and fixed scale factor (cannot be used with execute=true) */ |
|---|
| 162 | BM2MC_PACKET_PacketType_eDestripeFixedScale, /* initial phase and fixed scale factor for YCbCr420 destriping (cannot be used with execute=true) */ |
|---|
| 163 | BM2MC_PACKET_PacketType_eFillBlit, /* fill output rectangle */ |
|---|
| 164 | BM2MC_PACKET_PacketType_eCopyBlit, /* copy source rectangle to output point */ |
|---|
| 165 | BM2MC_PACKET_PacketType_eBlendBlit, /* blend/rop/colorkey source rectangle to output point */ |
|---|
| 166 | BM2MC_PACKET_PacketType_eScaleBlit, /* scale source rectangle to output rectangle */ |
|---|
| 167 | BM2MC_PACKET_PacketType_eScaleBlendBlit, /* scale and blend/rop/colorkey source rectangle to output rectangle */ |
|---|
| 168 | BM2MC_PACKET_PacketType_eUpdateScaleBlit, /* scale source rectangle to output rectangle with partial update to output */ |
|---|
| 169 | BM2MC_PACKET_PacketType_eDestripeBlit, /* YCbCr420 destripe blit */ |
|---|
| 170 | BM2MC_PACKET_PacketType_eResetState, /* reset state to default */ |
|---|
| 171 | BM2MC_PACKET_PacketType_eSaveState, /* save state (state must be restored before sync/checkpoint) */ |
|---|
| 172 | BM2MC_PACKET_PacketType_eRestoreState, /* restore state */ |
|---|
| 173 | BM2MC_PACKET_PacketType_eMax /* maximum enum value */ |
|---|
| 174 | } |
|---|
| 175 | BM2MC_PACKET_PacketType; |
|---|
| 176 | |
|---|
| 177 | /*************************************************************************** |
|---|
| 178 | PACKET HEADER STRUCTURE |
|---|
| 179 | ***************************************************************************/ |
|---|
| 180 | typedef struct |
|---|
| 181 | { |
|---|
| 182 | uint8_t type; /* BM2MC_PACKET_PacketType enum */ |
|---|
| 183 | uint8_t size; /* size of packet structure */ |
|---|
| 184 | bool execute; /* execute blit operation after packet */ |
|---|
| 185 | bool sync; /* reserved */ |
|---|
| 186 | } |
|---|
| 187 | BM2MC_PACKET_Header; |
|---|
| 188 | |
|---|
| 189 | /*************************************************************************** |
|---|
| 190 | PACKET MACROS |
|---|
| 191 | |
|---|
| 192 | Usage: BM2MC_PACKET_INIT( packet, BlendColor, false ); |
|---|
| 193 | (write blend color packet) |
|---|
| 194 | BM2MC_PACKET_TERM( packet ); |
|---|
| 195 | BM2MC_PACKET_INIT( packet, FillBlit, true ); |
|---|
| 196 | (write fill packet) |
|---|
| 197 | BM2MC_PACKET_TERM( packet ); |
|---|
| 198 | ***************************************************************************/ |
|---|
| 199 | #define BM2MC_PACKET_INIT( \ |
|---|
| 200 | PACKET, /* ptr to packet */ \ |
|---|
| 201 | TYPE, /* BM2MC_PACKET_PacketType enum */ \ |
|---|
| 202 | EXECUTE ) /* execute blit operation after packet */ \ |
|---|
| 203 | do { \ |
|---|
| 204 | BDBG_CASSERT((sizeof (*(PACKET)) % sizeof (uint32_t)) == 0); \ |
|---|
| 205 | BDBG_CASSERT((sizeof (*(PACKET)) == sizeof (BM2MC_PACKET_Packet##TYPE))); \ |
|---|
| 206 | (PACKET)->header.type = BM2MC_PACKET_PacketType_e##TYPE; \ |
|---|
| 207 | (PACKET)->header.size = sizeof (*(PACKET)) / sizeof (uint32_t); \ |
|---|
| 208 | (PACKET)->header.execute = EXECUTE; \ |
|---|
| 209 | (PACKET)->header.sync = 0; \ |
|---|
| 210 | } \ |
|---|
| 211 | while(0) |
|---|
| 212 | |
|---|
| 213 | /***************************************************************************/ |
|---|
| 214 | #define BM2MC_PACKET_TERM( packet ) (packet)++ |
|---|
| 215 | |
|---|
| 216 | /*************************************************************************** |
|---|
| 217 | PACKET STRUCTURES |
|---|
| 218 | ***************************************************************************/ |
|---|
| 219 | typedef enum BM2MC_PACKET_PixelFormat |
|---|
| 220 | { |
|---|
| 221 | BM2MC_PACKET_PixelFormat_eUnknown = 0, |
|---|
| 222 | BM2MC_PACKET_PixelFormat_eR5_G6_B5, /* 16-bit RGB565, (constant alpha) */ |
|---|
| 223 | BM2MC_PACKET_PixelFormat_eB5_G6_R5, /* 16-bit BGR565, (constant alpha) */ |
|---|
| 224 | BM2MC_PACKET_PixelFormat_eA1_R5_G5_B5, /* 16-bit ARGB1555 */ |
|---|
| 225 | BM2MC_PACKET_PixelFormat_eX1_R5_G5_B5, /* 16-bit XRGB1555 */ |
|---|
| 226 | BM2MC_PACKET_PixelFormat_eA1_B5_G5_R5, /* 16-bit ABGR1555 */ |
|---|
| 227 | BM2MC_PACKET_PixelFormat_eX1_B5_G5_R5, /* 16-bit XBGR1555 */ |
|---|
| 228 | BM2MC_PACKET_PixelFormat_eR5_G5_B5_A1, /* 16-bit RGBA5551 */ |
|---|
| 229 | BM2MC_PACKET_PixelFormat_eR5_G5_B5_X1, /* 16-bit RGBX5551 */ |
|---|
| 230 | BM2MC_PACKET_PixelFormat_eB5_G5_R5_A1, /* 16-bit BGRA5551 */ |
|---|
| 231 | BM2MC_PACKET_PixelFormat_eB5_G5_R5_X1, /* 16-bit BGRX5551 */ |
|---|
| 232 | BM2MC_PACKET_PixelFormat_eA4_R4_G4_B4, /* 16-bit ARGB4444 */ |
|---|
| 233 | BM2MC_PACKET_PixelFormat_eX4_R4_G4_B4, /* 16-bit XRGB4444 */ |
|---|
| 234 | BM2MC_PACKET_PixelFormat_eA4_B4_G4_R4, /* 16-bit ABGR4444 */ |
|---|
| 235 | BM2MC_PACKET_PixelFormat_eX4_B4_G4_R4, /* 16-bit XBGR4444 */ |
|---|
| 236 | BM2MC_PACKET_PixelFormat_eR4_G4_B4_A4, /* 16-bit RGBA4444 */ |
|---|
| 237 | BM2MC_PACKET_PixelFormat_eR4_G4_B4_X4, /* 16-bit RGBX4444 */ |
|---|
| 238 | BM2MC_PACKET_PixelFormat_eB4_G4_R4_A4, /* 16-bit BGRA4444 */ |
|---|
| 239 | BM2MC_PACKET_PixelFormat_eB4_G4_R4_X4, /* 16-bit BGRX4444 */ |
|---|
| 240 | BM2MC_PACKET_PixelFormat_eA8_R8_G8_B8, /* 32-bit ARGB8888 */ |
|---|
| 241 | BM2MC_PACKET_PixelFormat_eX8_R8_G8_B8, /* 32-bit XRGB8888 */ |
|---|
| 242 | BM2MC_PACKET_PixelFormat_eA8_B8_G8_R8, /* 32-bit ABGR8888 */ |
|---|
| 243 | BM2MC_PACKET_PixelFormat_eX8_B8_G8_R8, /* 32-bit XBGR8888 */ |
|---|
| 244 | BM2MC_PACKET_PixelFormat_eR8_G8_B8_A8, /* 32-bit RGBA8888 */ |
|---|
| 245 | BM2MC_PACKET_PixelFormat_eR8_G8_B8_X8, /* 32-bit RGBX8888 */ |
|---|
| 246 | BM2MC_PACKET_PixelFormat_eB8_G8_R8_A8, /* 32-bit BGRA8888 */ |
|---|
| 247 | BM2MC_PACKET_PixelFormat_eB8_G8_R8_X8, /* 32-bit BGRX8888 */ |
|---|
| 248 | BM2MC_PACKET_PixelFormat_eA8, /* 8-bit alpha-only surface (constant color) */ |
|---|
| 249 | BM2MC_PACKET_PixelFormat_eA4, /* 4-bit alpha-only surface (constant color) */ |
|---|
| 250 | BM2MC_PACKET_PixelFormat_eA2, /* 2-bit alpha-only surface (constant color) */ |
|---|
| 251 | BM2MC_PACKET_PixelFormat_eA1, /* 1-bit alpha-only surface (constant color) */ |
|---|
| 252 | BM2MC_PACKET_PixelFormat_eW1, /* 1-bit window alpha-only surface (constant color) */ |
|---|
| 253 | BM2MC_PACKET_PixelFormat_eA8_P8, /* 8-bit alpha and 8-bit palette index */ |
|---|
| 254 | BM2MC_PACKET_PixelFormat_eP8, /* 8-bit palette index */ |
|---|
| 255 | BM2MC_PACKET_PixelFormat_eP4, /* 4-bit palette index */ |
|---|
| 256 | BM2MC_PACKET_PixelFormat_eP2, /* 2-bit palette index */ |
|---|
| 257 | BM2MC_PACKET_PixelFormat_eP1, /* 1-bit palette index */ |
|---|
| 258 | BM2MC_PACKET_PixelFormat_eY8_P8, /* 8-bit luma and 8-bit palette index */ |
|---|
| 259 | BM2MC_PACKET_PixelFormat_eY8, /* 8-bit luma-only, for YCbCr420 */ |
|---|
| 260 | BM2MC_PACKET_PixelFormat_eA8_Y8, /* 8-bit alpha and 8-bit luma, for YCbCr420 */ |
|---|
| 261 | BM2MC_PACKET_PixelFormat_eCb8_Cr8, /* 16-bit chroma-only, for YCbCr420 */ |
|---|
| 262 | BM2MC_PACKET_PixelFormat_eCr8_Cb8, /* 16-bit chroma-only, for YCbCr420 */ |
|---|
| 263 | BM2MC_PACKET_PixelFormat_eCb8, /* 8-bit chroma-only (Cb) */ |
|---|
| 264 | BM2MC_PACKET_PixelFormat_eCr8, /* 8-bit chroma-only (Cr) */ |
|---|
| 265 | BM2MC_PACKET_PixelFormat_eY08_Cb8_Y18_Cr8, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 266 | BM2MC_PACKET_PixelFormat_eY08_Cr8_Y18_Cb8, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 267 | BM2MC_PACKET_PixelFormat_eY18_Cb8_Y08_Cr8, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 268 | BM2MC_PACKET_PixelFormat_eY18_Cr8_Y08_Cb8, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 269 | BM2MC_PACKET_PixelFormat_eCb8_Y08_Cr8_Y18, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 270 | BM2MC_PACKET_PixelFormat_eCb8_Y18_Cr8_Y08, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 271 | BM2MC_PACKET_PixelFormat_eCr8_Y18_Cb8_Y08, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 272 | BM2MC_PACKET_PixelFormat_eCr8_Y08_Cb8_Y18, /* 32-bit for 2 pixels, YCbCr422 w/ 8-bit values */ |
|---|
| 273 | BM2MC_PACKET_PixelFormat_eX2_Cr10_Y10_Cb10, /* 32-bit for 1 pixel, YCbCr444 w/ 10-bit values */ |
|---|
| 274 | BM2MC_PACKET_PixelFormat_eA8_Y8_Cb8_Cr8, /* YCbCr444 w/ 8-bit values */ |
|---|
| 275 | BM2MC_PACKET_PixelFormat_eA8_Cr8_Cb8_Y8, /* YCbCr444 w/ 8-bit values */ |
|---|
| 276 | BM2MC_PACKET_PixelFormat_eCr8_Cb8_Y8_A8, /* YCbCr444 w/ 8-bit values */ |
|---|
| 277 | BM2MC_PACKET_PixelFormat_eY8_Cb8_Cr8_A8, /* YCbCr444 w/ 8-bit values */ |
|---|
| 278 | BM2MC_PACKET_PixelFormat_eY010_Cb10_Y110_Cr10, /* YCbCr422 w/ 10-bit values */ |
|---|
| 279 | BM2MC_PACKET_PixelFormat_eY010_Cr10_Y110_Cb10, /* YCbCr422 w/ 10-bit values */ |
|---|
| 280 | BM2MC_PACKET_PixelFormat_eY110_Cb10_Y010_Cr10, /* YCbCr422 w/ 10-bit values */ |
|---|
| 281 | BM2MC_PACKET_PixelFormat_eY110_Cr10_Y010_Cb10, /* YCbCr422 w/ 10-bit values */ |
|---|
| 282 | BM2MC_PACKET_PixelFormat_eCb10_Y010_Cr10_Y110, /* YCbCr422 w/ 10-bit values */ |
|---|
| 283 | BM2MC_PACKET_PixelFormat_eCb10_Y110_Cr10_Y010, /* YCbCr422 w/ 10-bit values */ |
|---|
| 284 | BM2MC_PACKET_PixelFormat_eCr10_Y110_Cb10_Y010, /* YCbCr422 w/ 10-bit values */ |
|---|
| 285 | BM2MC_PACKET_PixelFormat_eCr10_Y010_Cb10_Y110, /* YCbCr422 w/ 10-bit values */ |
|---|
| 286 | BM2MC_PACKET_PixelFormat_eL8, /* 8-bit luma */ |
|---|
| 287 | BM2MC_PACKET_PixelFormat_eL4_A4, /* 4-bit luma and 4-bit alpha */ |
|---|
| 288 | BM2MC_PACKET_PixelFormat_eL8_A8, /* 8-bit luma and 8-bit alpha */ |
|---|
| 289 | BM2MC_PACKET_PixelFormat_eL15_L05_A6, /* 5-bit luma1, 5-bit luma0, 6-bit alpha */ |
|---|
| 290 | BM2MC_PACKET_PixelFormat_eMax |
|---|
| 291 | } |
|---|
| 292 | BM2MC_PACKET_PixelFormat; |
|---|
| 293 | |
|---|
| 294 | /***************************************************************************/ |
|---|
| 295 | typedef struct |
|---|
| 296 | { |
|---|
| 297 | uint32_t address; /* physical memory offset of plane */ |
|---|
| 298 | uint16_t pitch; /* pitch of plane */ |
|---|
| 299 | uint8_t format; /* BM2MC_PACKET_PixelFormat enum */ |
|---|
| 300 | uint16_t width; /* surface width, optional for verification */ |
|---|
| 301 | uint16_t height; /* surface height, optional for verification */ |
|---|
| 302 | } |
|---|
| 303 | BM2MC_PACKET_Plane; |
|---|
| 304 | |
|---|
| 305 | /***************************************************************************/ |
|---|
| 306 | typedef struct |
|---|
| 307 | { |
|---|
| 308 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 309 | BM2MC_PACKET_Plane plane; /* source plane (defaults to none) */ |
|---|
| 310 | uint32_t color; /* 32-bit color (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 311 | } |
|---|
| 312 | BM2MC_PACKET_PacketSourceFeeder; |
|---|
| 313 | |
|---|
| 314 | /***************************************************************************/ |
|---|
| 315 | typedef struct |
|---|
| 316 | { |
|---|
| 317 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 318 | BM2MC_PACKET_Plane plane0; /* primary source plane (defaults to none) */ |
|---|
| 319 | BM2MC_PACKET_Plane plane1; /* secondary source plane (defaults to none) */ |
|---|
| 320 | uint32_t color; /* 32-bit color (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 321 | } |
|---|
| 322 | BM2MC_PACKET_PacketSourceFeeders; |
|---|
| 323 | |
|---|
| 324 | /***************************************************************************/ |
|---|
| 325 | typedef struct |
|---|
| 326 | { |
|---|
| 327 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 328 | uint32_t color; /* 32-bit color (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 329 | } |
|---|
| 330 | BM2MC_PACKET_PacketSourceColor; |
|---|
| 331 | |
|---|
| 332 | /***************************************************************************/ |
|---|
| 333 | typedef struct |
|---|
| 334 | { |
|---|
| 335 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 336 | } |
|---|
| 337 | BM2MC_PACKET_PacketSourceNone; |
|---|
| 338 | |
|---|
| 339 | /***************************************************************************/ |
|---|
| 340 | typedef struct |
|---|
| 341 | { |
|---|
| 342 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 343 | bool zero_pad; /* zero pad lower bits when expanding pixel channels */ |
|---|
| 344 | /* instead of replicating upper bits (defaults to false) */ |
|---|
| 345 | bool chroma_filter; /* filter chroma's when converting YCbCr422 source */ |
|---|
| 346 | /* format into internal YCbCr444 format (defaults to true) */ |
|---|
| 347 | bool linear_destripe; /* YCbCr 420 image is linear (not striped) */ |
|---|
| 348 | uint8_t reserved[1]; /* align to 4-bytes */ |
|---|
| 349 | } |
|---|
| 350 | BM2MC_PACKET_PacketSourceControl; |
|---|
| 351 | |
|---|
| 352 | /***************************************************************************/ |
|---|
| 353 | typedef struct |
|---|
| 354 | { |
|---|
| 355 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 356 | BM2MC_PACKET_Plane plane; /* destination plane (defaults to none) */ |
|---|
| 357 | uint32_t color; /* 32-bit color (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 358 | } |
|---|
| 359 | BM2MC_PACKET_PacketDestinationFeeder; |
|---|
| 360 | |
|---|
| 361 | /***************************************************************************/ |
|---|
| 362 | typedef struct |
|---|
| 363 | { |
|---|
| 364 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 365 | uint32_t color; /* 32-bit color (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 366 | } |
|---|
| 367 | BM2MC_PACKET_PacketDestinationColor; |
|---|
| 368 | |
|---|
| 369 | /***************************************************************************/ |
|---|
| 370 | typedef struct |
|---|
| 371 | { |
|---|
| 372 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 373 | } |
|---|
| 374 | BM2MC_PACKET_PacketDestinationNone; |
|---|
| 375 | |
|---|
| 376 | /***************************************************************************/ |
|---|
| 377 | typedef struct |
|---|
| 378 | { |
|---|
| 379 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 380 | bool zero_pad; /* zero pad lower bits when expanding pixel channels */ |
|---|
| 381 | /* instead of replicating upper bits (defaults to false) */ |
|---|
| 382 | bool chroma_filter; /* filter chroma's when converting YCbCr422 source */ |
|---|
| 383 | /* format into internal YCbCr444 format (defaults to true) */ |
|---|
| 384 | uint8_t reserved[2]; /* align to 4-bytes */ |
|---|
| 385 | } |
|---|
| 386 | BM2MC_PACKET_PacketDestinationControl; |
|---|
| 387 | |
|---|
| 388 | /***************************************************************************/ |
|---|
| 389 | typedef struct |
|---|
| 390 | { |
|---|
| 391 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 392 | BM2MC_PACKET_Plane plane; /* output plane (defaults to none) */ |
|---|
| 393 | } |
|---|
| 394 | BM2MC_PACKET_PacketOutputFeeder; |
|---|
| 395 | |
|---|
| 396 | /***************************************************************************/ |
|---|
| 397 | typedef struct |
|---|
| 398 | { |
|---|
| 399 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 400 | bool dither; /* dither pixel channels less than 8-bits (defaults to false) */ |
|---|
| 401 | bool chroma_filter; /* filter chroma's when converting YCbCr422 source */ |
|---|
| 402 | /* format into output YCbCr444 format (defaults to true) */ |
|---|
| 403 | uint8_t reserved[2]; /* align to 4-bytes */ |
|---|
| 404 | } |
|---|
| 405 | BM2MC_PACKET_PacketOutputControl; |
|---|
| 406 | |
|---|
| 407 | /***************************************************************************/ |
|---|
| 408 | typedef enum BM2MC_PACKET_BlendFactor |
|---|
| 409 | { |
|---|
| 410 | BM2MC_PACKET_BlendFactor_eZero = 0, /* Zero */ |
|---|
| 411 | BM2MC_PACKET_BlendFactor_eHalf, /* 1/2 */ |
|---|
| 412 | BM2MC_PACKET_BlendFactor_eOne, /* One */ |
|---|
| 413 | BM2MC_PACKET_BlendFactor_eSourceColor, /* Color from source */ |
|---|
| 414 | BM2MC_PACKET_BlendFactor_eInverseSourceColor, /* 1-color from source */ |
|---|
| 415 | BM2MC_PACKET_BlendFactor_eSourceAlpha, /* Alpha from source */ |
|---|
| 416 | BM2MC_PACKET_BlendFactor_eInverseSourceAlpha, /* 1-alpha from source */ |
|---|
| 417 | BM2MC_PACKET_BlendFactor_eDestinationColor, /* Color from destination */ |
|---|
| 418 | BM2MC_PACKET_BlendFactor_eInverseDestinationColor, /* 1-color from destination */ |
|---|
| 419 | BM2MC_PACKET_BlendFactor_eDestinationAlpha, /* Alpha from destination */ |
|---|
| 420 | BM2MC_PACKET_BlendFactor_eInverseDestinationAlpha, /* 1-alpha from destination */ |
|---|
| 421 | BM2MC_PACKET_BlendFactor_eConstantColor, /* Color from blend color */ |
|---|
| 422 | BM2MC_PACKET_BlendFactor_eInverseConstantColor, /* 1-color from blend color */ |
|---|
| 423 | BM2MC_PACKET_BlendFactor_eConstantAlpha, /* Alpha from blend color */ |
|---|
| 424 | BM2MC_PACKET_BlendFactor_eInverseConstantAlpha /* 1-alpha from blend color */ |
|---|
| 425 | } |
|---|
| 426 | BM2MC_PACKET_BlendFactor; |
|---|
| 427 | |
|---|
| 428 | /***************************************************************************/ |
|---|
| 429 | /* The blend equation is "a*b +/- c*d +/- e" */ |
|---|
| 430 | typedef struct |
|---|
| 431 | { |
|---|
| 432 | uint8_t a; /* BM2MC_PACKET_BlendFactor */ |
|---|
| 433 | uint8_t b; /* BM2MC_PACKET_BlendFactor */ |
|---|
| 434 | bool sub_cd; /* add or subtract cd*/ |
|---|
| 435 | uint8_t c; /* BM2MC_PACKET_BlendFactor */ |
|---|
| 436 | uint8_t d; /* BM2MC_PACKET_BlendFactor */ |
|---|
| 437 | bool sub_e; /* add or subtract e*/ |
|---|
| 438 | uint8_t e; /* BM2MC_PACKET_BlendFactor */ |
|---|
| 439 | } |
|---|
| 440 | BM2MC_PACKET_Blend; |
|---|
| 441 | |
|---|
| 442 | /***************************************************************************/ |
|---|
| 443 | typedef struct |
|---|
| 444 | { |
|---|
| 445 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 446 | BM2MC_PACKET_Blend color_blend; /* color blend equation (defaults to eSourceColor) */ |
|---|
| 447 | BM2MC_PACKET_Blend alpha_blend; /* alpha blend equation (defaults to eSourceAlpha)*/ |
|---|
| 448 | uint32_t color; /* 32-bit color (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 449 | } |
|---|
| 450 | BM2MC_PACKET_PacketBlend; |
|---|
| 451 | |
|---|
| 452 | /***************************************************************************/ |
|---|
| 453 | typedef struct |
|---|
| 454 | { |
|---|
| 455 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 456 | uint32_t color; /* 32-bit color (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 457 | } |
|---|
| 458 | BM2MC_PACKET_PacketBlendColor; |
|---|
| 459 | |
|---|
| 460 | /***************************************************************************/ |
|---|
| 461 | typedef struct |
|---|
| 462 | { |
|---|
| 463 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 464 | uint32_t rop; /* ternary raster operation (defaults to 0) */ |
|---|
| 465 | uint32_t pattern0; /* output aligned 1-bit pattern 0 (8x4) top (defaults to 0) */ |
|---|
| 466 | uint32_t pattern1; /* output aligned 1-bit pattern 1 (8x4) bottom (defaults to 0) */ |
|---|
| 467 | uint32_t color0; /* 32-bit pattern color 0 (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 468 | uint32_t color1; /* 32-bit pattern color 1 (A, R/Y, G/Cb, B/Cr/P) (defaults to 0) */ |
|---|
| 469 | } |
|---|
| 470 | BM2MC_PACKET_PacketRop; |
|---|
| 471 | |
|---|
| 472 | /***************************************************************************/ |
|---|
| 473 | typedef struct |
|---|
| 474 | { |
|---|
| 475 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 476 | uint32_t high; /* 32-bit colorkey high range (defaults to 0) */ |
|---|
| 477 | uint32_t low; /* 32-bit colorkey low range (defaults to 0) */ |
|---|
| 478 | uint32_t mask; /* 32-bit mask, used an pixel before compare (defaults to 0) */ |
|---|
| 479 | uint32_t replacement; /* 32-bit replacement color, when colorkeyed (defaults to 0) */ |
|---|
| 480 | uint32_t replacement_mask; /* 32-bit replacement mask, when colorkeyed (defaults to 0) */ |
|---|
| 481 | bool exclusive; /* exclusive high compare (defaults to false) */ |
|---|
| 482 | } |
|---|
| 483 | BM2MC_PACKET_PacketSourceColorkey; |
|---|
| 484 | |
|---|
| 485 | /***************************************************************************/ |
|---|
| 486 | typedef struct |
|---|
| 487 | { |
|---|
| 488 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 489 | bool enable; /* enable colorkey (defaults to false) */ |
|---|
| 490 | uint8_t reserved[3]; /* align to 4-bytes */ |
|---|
| 491 | } |
|---|
| 492 | BM2MC_PACKET_PacketSourceColorkeyEnable; |
|---|
| 493 | |
|---|
| 494 | /***************************************************************************/ |
|---|
| 495 | typedef struct |
|---|
| 496 | { |
|---|
| 497 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 498 | uint32_t high; /* 32-bit colorkey high range (defaults to 0) */ |
|---|
| 499 | uint32_t low; /* 32-bit colorkey low range (defaults to 0) */ |
|---|
| 500 | uint32_t mask; /* 32-bit mask, used an pixel before compare (defaults to 0) */ |
|---|
| 501 | uint32_t replacement; /* 32-bit replacement color, when colorkeyed (defaults to 0) */ |
|---|
| 502 | uint32_t replacement_mask; /* 32-bit replacement mask, when colorkeyed (defaults to 0) */ |
|---|
| 503 | bool exclusive; /* exclusive high compare (defaults to false) */ |
|---|
| 504 | } |
|---|
| 505 | BM2MC_PACKET_PacketDestinationColorkey; |
|---|
| 506 | |
|---|
| 507 | /***************************************************************************/ |
|---|
| 508 | typedef struct |
|---|
| 509 | { |
|---|
| 510 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 511 | bool enable; /* enable colorkey (defaults to false) */ |
|---|
| 512 | uint8_t reserved[3]; /* align to 4-bytes */ |
|---|
| 513 | } |
|---|
| 514 | BM2MC_PACKET_PacketDestinationColorkeyEnable; |
|---|
| 515 | |
|---|
| 516 | /***************************************************************************/ |
|---|
| 517 | typedef struct |
|---|
| 518 | { |
|---|
| 519 | #if (BCHP_CHIP!=7038) |
|---|
| 520 | int16_t coeffs[2][3]; /* fixed point in S1.8 format */ |
|---|
| 521 | #else |
|---|
| 522 | int16_t coeffs[8][8]; /* fixed point in S1.8 format */ |
|---|
| 523 | #endif |
|---|
| 524 | } |
|---|
| 525 | BM2MC_PACKET_FilterCoeffs; |
|---|
| 526 | |
|---|
| 527 | /***************************************************************************/ |
|---|
| 528 | typedef struct |
|---|
| 529 | { |
|---|
| 530 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 531 | BM2MC_PACKET_FilterCoeffs hor; /* horizontal filter coefficients (defaults to bilinear coeffs) */ |
|---|
| 532 | BM2MC_PACKET_FilterCoeffs ver; /* vertical filter coefficients (defaults to bilinear coeffs) */ |
|---|
| 533 | } |
|---|
| 534 | BM2MC_PACKET_PacketFilter; |
|---|
| 535 | |
|---|
| 536 | /***************************************************************************/ |
|---|
| 537 | typedef struct |
|---|
| 538 | { |
|---|
| 539 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 540 | bool enable; /* enable filter (defaults to false) */ |
|---|
| 541 | uint8_t reserved[3]; /* align to 4-bytes */ |
|---|
| 542 | } |
|---|
| 543 | BM2MC_PACKET_PacketFilterEnable; |
|---|
| 544 | |
|---|
| 545 | /***************************************************************************/ |
|---|
| 546 | typedef enum BM2MC_PACKET_eFilterOrder |
|---|
| 547 | { |
|---|
| 548 | BM2MC_PACKET_eFilterOrder_FilterColorkeyMatrix = 0, |
|---|
| 549 | BM2MC_PACKET_eFilterOrder_FilterMatrixColorkey, |
|---|
| 550 | BM2MC_PACKET_eFilterOrder_ColorkeyMatrixFilter, |
|---|
| 551 | BM2MC_PACKET_eFilterOrder_ColorkeyFilterMatrix, |
|---|
| 552 | BM2MC_PACKET_eFilterOrder_MatrixFilterColorkey, |
|---|
| 553 | BM2MC_PACKET_eFilterOrder_MatrixColorkeyFilter, |
|---|
| 554 | BM2MC_PACKET_eFilterOrder_BypassAll |
|---|
| 555 | } |
|---|
| 556 | BM2MC_PACKET_eFilterOrder; |
|---|
| 557 | |
|---|
| 558 | /***************************************************************************/ |
|---|
| 559 | typedef struct |
|---|
| 560 | { |
|---|
| 561 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 562 | bool round; /* round pixel channels instead of truncating when filtering (defaults to true) */ |
|---|
| 563 | bool adjust_color; /* subtract value from color channels before filtering (defaults to false) */ |
|---|
| 564 | bool sub_alpha; /* use alpha/2 as subtract value instead of 128 (defaults to false) */ |
|---|
| 565 | uint8_t order; /* colorkey/filter/matrix ordering (defaults to colorkey/filter/matrix) */ |
|---|
| 566 | } |
|---|
| 567 | BM2MC_PACKET_PacketFilterControl; |
|---|
| 568 | |
|---|
| 569 | /***************************************************************************/ |
|---|
| 570 | /* Color Matrix Formula: |
|---|
| 571 | C2out = m[0][0]*C2in + m[0][1]*C1in + m[0][2]*C0in + m[0][3]*C3in + m[0][4] |
|---|
| 572 | C1out = m[1][0]*C2in + m[1][1]*C1in + m[1][2]*C0in + m[1][3]*C3in + m[1][4] |
|---|
| 573 | C0out = m[2][0]*C2in + m[2][1]*C1in + m[2][2]*C0in + m[2][3]*C3in + m[2][4] |
|---|
| 574 | C3out = m[3][0]*C2in + m[3][1]*C1in + m[3][2]*C0in + m[3][3]*C3in + m[3][4] |
|---|
| 575 | */ |
|---|
| 576 | typedef struct |
|---|
| 577 | { |
|---|
| 578 | int16_t m[4][5]; /* fixed point in S3.10 format for multipliers, |
|---|
| 579 | fixed point in S9.4 format for adders */ |
|---|
| 580 | } |
|---|
| 581 | BM2MC_PACKET_ColorMatrix; |
|---|
| 582 | |
|---|
| 583 | /***************************************************************************/ |
|---|
| 584 | typedef struct |
|---|
| 585 | { |
|---|
| 586 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 587 | BM2MC_PACKET_ColorMatrix matrix; /* color matrix (defaults to all 0s) */ |
|---|
| 588 | } |
|---|
| 589 | BM2MC_PACKET_PacketSourceColorMatrix; |
|---|
| 590 | |
|---|
| 591 | /***************************************************************************/ |
|---|
| 592 | typedef struct |
|---|
| 593 | { |
|---|
| 594 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 595 | bool enable; /* enable color matrix (defaults to false) */ |
|---|
| 596 | uint8_t reserved[3]; /* align to 4-bytes */ |
|---|
| 597 | } |
|---|
| 598 | BM2MC_PACKET_PacketSourceColorMatrixEnable; |
|---|
| 599 | |
|---|
| 600 | /***************************************************************************/ |
|---|
| 601 | typedef struct |
|---|
| 602 | { |
|---|
| 603 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 604 | uint32_t address; /* physical memory offset of palette (defaults to null) */ |
|---|
| 605 | } |
|---|
| 606 | BM2MC_PACKET_PacketSourcePalette; |
|---|
| 607 | |
|---|
| 608 | /***************************************************************************/ |
|---|
| 609 | typedef struct |
|---|
| 610 | { |
|---|
| 611 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 612 | bool enable; /* multiply pixel's color by its alpha (defaults to false) */ |
|---|
| 613 | uint8_t reserved[3]; /* align to 4-bytes */ |
|---|
| 614 | } |
|---|
| 615 | BM2MC_PACKET_PacketAlphaPremultiply; |
|---|
| 616 | |
|---|
| 617 | /***************************************************************************/ |
|---|
| 618 | typedef struct |
|---|
| 619 | { |
|---|
| 620 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 621 | bool src_hor; /* reverse horizontal direction of src (defaults to false) */ |
|---|
| 622 | bool src_ver; /* reverse vertical direction of src (defaults to false) */ |
|---|
| 623 | bool dst_hor; /* reverse horizontal direction of dst (defaults to false) */ |
|---|
| 624 | bool dst_ver; /* reverse vertical direction of dst (defaults to false) */ |
|---|
| 625 | bool out_hor; /* reverse horizontal direction of out (defaults to false) */ |
|---|
| 626 | bool out_ver; /* reverse vertical direction of out (defaults to false) */ |
|---|
| 627 | uint8_t reserved[2]; /* align to 4-bytes */ |
|---|
| 628 | } |
|---|
| 629 | BM2MC_PACKET_PacketMirror; |
|---|
| 630 | |
|---|
| 631 | /***************************************************************************/ |
|---|
| 632 | typedef struct |
|---|
| 633 | { |
|---|
| 634 | uint16_t x; /* x coordinate (0-8191) */ |
|---|
| 635 | uint16_t y; /* y coordinate (0-8191) */ |
|---|
| 636 | } |
|---|
| 637 | BM2MC_PACKET_Point; |
|---|
| 638 | |
|---|
| 639 | /***************************************************************************/ |
|---|
| 640 | typedef struct |
|---|
| 641 | { |
|---|
| 642 | uint16_t width; /* width (1-8191) */ |
|---|
| 643 | uint16_t height; /* height (1-8191) */ |
|---|
| 644 | } |
|---|
| 645 | BM2MC_PACKET_Size; |
|---|
| 646 | |
|---|
| 647 | /***************************************************************************/ |
|---|
| 648 | typedef struct |
|---|
| 649 | { |
|---|
| 650 | uint16_t x; /* x coordinate (0-8191) */ |
|---|
| 651 | uint16_t y; /* y coordinate (0-8191) */ |
|---|
| 652 | uint16_t width; /* width (1-8191) */ |
|---|
| 653 | uint16_t height; /* height (1-8191) */ |
|---|
| 654 | } |
|---|
| 655 | BM2MC_PACKET_Rectangle; |
|---|
| 656 | |
|---|
| 657 | /***************************************************************************/ |
|---|
| 658 | #define BM2MC_PACKET_FIXED_SCALE_STEP_ZERO 0x80000000 /* set hor_step or ver_step to this value to use 0 as fixed scale */ |
|---|
| 659 | |
|---|
| 660 | /***************************************************************************/ |
|---|
| 661 | typedef struct |
|---|
| 662 | { |
|---|
| 663 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 664 | int32_t hor_phase; /* horizontal initial phase adjustment (0=ignore) */ |
|---|
| 665 | int32_t ver_phase; /* vertical initial phase adjustment (0=ignore) */ |
|---|
| 666 | uint32_t hor_step; /* horizontal fixed source step (0=ignore) */ |
|---|
| 667 | uint32_t ver_step; /* vertical fixed source step (0=ignore) */ |
|---|
| 668 | uint32_t shift; /* amount of factional bits in values (max is 20) */ |
|---|
| 669 | } |
|---|
| 670 | BM2MC_PACKET_PacketFixedScale; |
|---|
| 671 | |
|---|
| 672 | /***************************************************************************/ |
|---|
| 673 | typedef struct |
|---|
| 674 | { |
|---|
| 675 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 676 | BM2MC_PACKET_Rectangle chroma_rect; /* source chroma rect */ |
|---|
| 677 | int32_t hor_luma_phase; /* horizontal luma initial phase adjustment (0=ignore) */ |
|---|
| 678 | int32_t ver_luma_phase; /* vertical luma initial phase adjustment (0=ignore) */ |
|---|
| 679 | int32_t hor_chroma_phase; /* horizontal chroma initial phase adjustment (0=ignore) */ |
|---|
| 680 | int32_t ver_chroma_phase; /* vertical chroma initial phase adjustment (0=ignore) */ |
|---|
| 681 | uint32_t hor_luma_step; /* horizontal luma fixed source step (0=ignore) */ |
|---|
| 682 | uint32_t ver_luma_step; /* vertical luma fixed source step (0=ignore) */ |
|---|
| 683 | uint32_t shift; /* amount of factional bits in values (max is 20) */ |
|---|
| 684 | } |
|---|
| 685 | BM2MC_PACKET_PacketDestripeFixedScale; |
|---|
| 686 | |
|---|
| 687 | /***************************************************************************/ |
|---|
| 688 | typedef struct |
|---|
| 689 | { |
|---|
| 690 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 691 | BM2MC_PACKET_Rectangle rect; /* output rect */ |
|---|
| 692 | } |
|---|
| 693 | BM2MC_PACKET_PacketFillBlit; |
|---|
| 694 | |
|---|
| 695 | /***************************************************************************/ |
|---|
| 696 | typedef struct |
|---|
| 697 | { |
|---|
| 698 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 699 | BM2MC_PACKET_Rectangle src_rect; /* source rect */ |
|---|
| 700 | BM2MC_PACKET_Point out_point; /* output point */ |
|---|
| 701 | } |
|---|
| 702 | BM2MC_PACKET_PacketCopyBlit; |
|---|
| 703 | |
|---|
| 704 | /***************************************************************************/ |
|---|
| 705 | typedef struct |
|---|
| 706 | { |
|---|
| 707 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 708 | BM2MC_PACKET_Rectangle src_rect; /* source rect */ |
|---|
| 709 | BM2MC_PACKET_Point out_point; /* output point */ |
|---|
| 710 | BM2MC_PACKET_Point dst_point; /* destintation point */ |
|---|
| 711 | } |
|---|
| 712 | BM2MC_PACKET_PacketBlendBlit; |
|---|
| 713 | |
|---|
| 714 | /***************************************************************************/ |
|---|
| 715 | typedef struct |
|---|
| 716 | { |
|---|
| 717 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 718 | BM2MC_PACKET_Rectangle src_rect; /* source rect */ |
|---|
| 719 | BM2MC_PACKET_Rectangle out_rect; /* output rect */ |
|---|
| 720 | } |
|---|
| 721 | BM2MC_PACKET_PacketScaleBlit; |
|---|
| 722 | |
|---|
| 723 | /***************************************************************************/ |
|---|
| 724 | typedef struct |
|---|
| 725 | { |
|---|
| 726 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 727 | BM2MC_PACKET_Rectangle src_rect; /* source rect */ |
|---|
| 728 | BM2MC_PACKET_Rectangle out_rect; /* output rect */ |
|---|
| 729 | BM2MC_PACKET_Point dst_point; /* destintation point */ |
|---|
| 730 | } |
|---|
| 731 | BM2MC_PACKET_PacketScaleBlendBlit; |
|---|
| 732 | |
|---|
| 733 | /***************************************************************************/ |
|---|
| 734 | typedef struct |
|---|
| 735 | { |
|---|
| 736 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 737 | BM2MC_PACKET_Rectangle src_rect; /* source rect */ |
|---|
| 738 | BM2MC_PACKET_Rectangle out_rect; /* output rect */ |
|---|
| 739 | BM2MC_PACKET_Rectangle update_rect; /* update rect for output */ |
|---|
| 740 | } |
|---|
| 741 | BM2MC_PACKET_PacketUpdateScaleBlit; |
|---|
| 742 | |
|---|
| 743 | /***************************************************************************/ |
|---|
| 744 | typedef struct |
|---|
| 745 | { |
|---|
| 746 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 747 | BM2MC_PACKET_Rectangle src_rect; /* source rect */ |
|---|
| 748 | BM2MC_PACKET_Rectangle out_rect; /* output rect */ |
|---|
| 749 | BM2MC_PACKET_Point dst_point; /* destintation point */ |
|---|
| 750 | uint16_t source_stripe_width; /* source stripe width */ |
|---|
| 751 | uint16_t luma_stripe_height; /* luma (Y) stripe height */ |
|---|
| 752 | uint16_t chroma_stripe_height; /* chroma (CbCr) stripe height */ |
|---|
| 753 | uint8_t reserved[2]; /* align to 4-bytes */ |
|---|
| 754 | } |
|---|
| 755 | BM2MC_PACKET_PacketDestripeBlit; |
|---|
| 756 | |
|---|
| 757 | /***************************************************************************/ |
|---|
| 758 | typedef struct |
|---|
| 759 | { |
|---|
| 760 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 761 | } |
|---|
| 762 | BM2MC_PACKET_PacketResetState; |
|---|
| 763 | |
|---|
| 764 | /***************************************************************************/ |
|---|
| 765 | typedef struct |
|---|
| 766 | { |
|---|
| 767 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 768 | } |
|---|
| 769 | BM2MC_PACKET_PacketSaveState; |
|---|
| 770 | |
|---|
| 771 | /***************************************************************************/ |
|---|
| 772 | typedef struct |
|---|
| 773 | { |
|---|
| 774 | BM2MC_PACKET_Header header; /* packet header */ |
|---|
| 775 | } |
|---|
| 776 | BM2MC_PACKET_PacketRestoreState; |
|---|
| 777 | |
|---|
| 778 | /*************************************************************************** |
|---|
| 779 | PACKET WRITE MACROS |
|---|
| 780 | |
|---|
| 781 | The following macros are an optional method for writing packets and |
|---|
| 782 | incrementing the packet pointer. Please be aware that the BUFFER param is |
|---|
| 783 | an [in,out] param. Use as follows: |
|---|
| 784 | |
|---|
| 785 | current_buffer = first_buffer; |
|---|
| 786 | BM2MC_PACKET_WRITE_SourceFeeder( current_buffer, plane, color, false ); |
|---|
| 787 | BM2MC_PACKET_WRITE_Blend( current_buffer, alphaBlend, colorBlend, color, true ); |
|---|
| 788 | size = current_buffer - first_buffer; |
|---|
| 789 | ***************************************************************************/ |
|---|
| 790 | |
|---|
| 791 | #define BM2MC_PACKET_WRITE_SourceFeeder( BUFFER, PLANE, COLOR, EXECUTE ) do \ |
|---|
| 792 | { \ |
|---|
| 793 | BM2MC_PACKET_PacketSourceFeeder *packet = (BM2MC_PACKET_PacketSourceFeeder *) (BUFFER); \ |
|---|
| 794 | BM2MC_PACKET_INIT( packet, SourceFeeder, EXECUTE ); \ |
|---|
| 795 | packet->plane = (PLANE); \ |
|---|
| 796 | packet->color = (COLOR); \ |
|---|
| 797 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 798 | (BUFFER) = (void *) packet; \ |
|---|
| 799 | } \ |
|---|
| 800 | while(0) |
|---|
| 801 | |
|---|
| 802 | /***************************************************************************/ |
|---|
| 803 | #define BM2MC_PACKET_WRITE_SourceFeeders( BUFFER, PLANE0, PLANE1, COLOR, EXECUTE ) do \ |
|---|
| 804 | { \ |
|---|
| 805 | BM2MC_PACKET_PacketSourceFeeders *packet = (BM2MC_PACKET_PacketSourceFeeders *) (BUFFER); \ |
|---|
| 806 | BM2MC_PACKET_INIT( packet, SourceFeeders, EXECUTE ); \ |
|---|
| 807 | packet->plane0 = (PLANE0); \ |
|---|
| 808 | packet->plane1 = (PLANE1); \ |
|---|
| 809 | packet->color = (COLOR); \ |
|---|
| 810 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 811 | (BUFFER) = (void *) packet; \ |
|---|
| 812 | } \ |
|---|
| 813 | while(0) |
|---|
| 814 | |
|---|
| 815 | /***************************************************************************/ |
|---|
| 816 | #define BM2MC_PACKET_WRITE_SourceColor( BUFFER, COLOR, EXECUTE ) do \ |
|---|
| 817 | { \ |
|---|
| 818 | BM2MC_PACKET_PacketSourceColor *packet = (BM2MC_PACKET_PacketSourceColor *) (BUFFER); \ |
|---|
| 819 | BM2MC_PACKET_INIT( packet, SourceColor, EXECUTE ); \ |
|---|
| 820 | packet->color = (COLOR); \ |
|---|
| 821 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 822 | (BUFFER) = (void *) packet; \ |
|---|
| 823 | } \ |
|---|
| 824 | while(0) |
|---|
| 825 | |
|---|
| 826 | /***************************************************************************/ |
|---|
| 827 | #define BM2MC_PACKET_WRITE_SourceNone( BUFFER, EXECUTE ) do \ |
|---|
| 828 | { \ |
|---|
| 829 | BM2MC_PACKET_PacketSourceNone *packet = (BM2MC_PACKET_PacketSourceNone *) (BUFFER); \ |
|---|
| 830 | BM2MC_PACKET_INIT( packet, SourceNone, EXECUTE ); \ |
|---|
| 831 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 832 | (BUFFER) = (void *) packet; \ |
|---|
| 833 | } \ |
|---|
| 834 | while(0) |
|---|
| 835 | |
|---|
| 836 | /***************************************************************************/ |
|---|
| 837 | #define BM2MC_PACKET_WRITE_SourceControl( BUFFER, ZERO_PAD, CHROMA_FILTER, EXECUTE ) do \ |
|---|
| 838 | { \ |
|---|
| 839 | BM2MC_PACKET_PacketSourceControl *packet = (BM2MC_PACKET_PacketSourceControl *) (BUFFER); \ |
|---|
| 840 | BM2MC_PACKET_INIT( packet, SourceControl, EXECUTE ); \ |
|---|
| 841 | packet->zero_pad = (ZERO_PAD); \ |
|---|
| 842 | packet->chroma_filter = (CHROMA_FILTER); \ |
|---|
| 843 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 844 | (BUFFER) = (void *) packet; \ |
|---|
| 845 | } \ |
|---|
| 846 | while(0) |
|---|
| 847 | |
|---|
| 848 | /***************************************************************************/ |
|---|
| 849 | #define BM2MC_PACKET_WRITE_DestinationFeeder( BUFFER, PLANE, COLOR, EXECUTE ) do \ |
|---|
| 850 | { \ |
|---|
| 851 | BM2MC_PACKET_PacketDestinationFeeder *packet = (BM2MC_PACKET_PacketDestinationFeeder *) (BUFFER); \ |
|---|
| 852 | BM2MC_PACKET_INIT( packet, DestinationFeeder, EXECUTE ); \ |
|---|
| 853 | packet->plane = (PLANE); \ |
|---|
| 854 | packet->color = (COLOR); \ |
|---|
| 855 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 856 | (BUFFER) = (void *) packet; \ |
|---|
| 857 | } \ |
|---|
| 858 | while(0) |
|---|
| 859 | |
|---|
| 860 | /***************************************************************************/ |
|---|
| 861 | #define BM2MC_PACKET_WRITE_DestinationColor( BUFFER, COLOR, EXECUTE ) do \ |
|---|
| 862 | { \ |
|---|
| 863 | BM2MC_PACKET_PacketDestinationColor *packet = (BM2MC_PACKET_PacketDestinationColor *) (BUFFER); \ |
|---|
| 864 | BM2MC_PACKET_INIT( packet, DestinationColor, EXECUTE ); \ |
|---|
| 865 | packet->color = (COLOR); \ |
|---|
| 866 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 867 | (BUFFER) = (void *) packet; \ |
|---|
| 868 | } \ |
|---|
| 869 | while(0) |
|---|
| 870 | |
|---|
| 871 | /***************************************************************************/ |
|---|
| 872 | #define BM2MC_PACKET_WRITE_DestinationNone( BUFFER, EXECUTE ) do \ |
|---|
| 873 | { \ |
|---|
| 874 | BM2MC_PACKET_PacketDestinationNone *packet = (BM2MC_PACKET_PacketDestinationNone *) (BUFFER); \ |
|---|
| 875 | BM2MC_PACKET_INIT( packet, DestinationNone, EXECUTE ); \ |
|---|
| 876 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 877 | (BUFFER) = (void *) packet; \ |
|---|
| 878 | } \ |
|---|
| 879 | while(0) |
|---|
| 880 | |
|---|
| 881 | /***************************************************************************/ |
|---|
| 882 | #define BM2MC_PACKET_WRITE_DestinationControl( BUFFER, ZERO_PAD, CHROMA_FILTER, EXECUTE ) do \ |
|---|
| 883 | { \ |
|---|
| 884 | BM2MC_PACKET_PacketDestinationControl *packet = (BM2MC_PACKET_PacketDestinationControl *) (BUFFER); \ |
|---|
| 885 | BM2MC_PACKET_INIT( packet, DestinationControl, EXECUTE ); \ |
|---|
| 886 | packet->zero_pad = (ZERO_PAD); \ |
|---|
| 887 | packet->chroma_filter = (CHROMA_FILTER); \ |
|---|
| 888 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 889 | (BUFFER) = (void *) packet; \ |
|---|
| 890 | } \ |
|---|
| 891 | while(0) |
|---|
| 892 | |
|---|
| 893 | /***************************************************************************/ |
|---|
| 894 | #define BM2MC_PACKET_WRITE_OutputFeeder( BUFFER, PLANE, EXECUTE ) do \ |
|---|
| 895 | { \ |
|---|
| 896 | BM2MC_PACKET_PacketOutputFeeder *packet = (BM2MC_PACKET_PacketOutputFeeder *) (BUFFER); \ |
|---|
| 897 | BM2MC_PACKET_INIT( packet, OutputFeeder, EXECUTE ); \ |
|---|
| 898 | packet->plane = (PLANE); \ |
|---|
| 899 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 900 | (BUFFER) = (void *) packet; \ |
|---|
| 901 | } \ |
|---|
| 902 | while(0) |
|---|
| 903 | |
|---|
| 904 | /***************************************************************************/ |
|---|
| 905 | #define BM2MC_PACKET_WRITE_OutputControl( BUFFER, DITHER, CHROMA_FILTER, EXECUTE ) do \ |
|---|
| 906 | { \ |
|---|
| 907 | BM2MC_PACKET_PacketOutputControl *packet = (BM2MC_PACKET_PacketOutputControl *) (BUFFER); \ |
|---|
| 908 | BM2MC_PACKET_INIT( packet, OutputControl, EXECUTE ); \ |
|---|
| 909 | packet->dither = (DITHER); \ |
|---|
| 910 | packet->chroma_filter = (CHROMA_FILTER); \ |
|---|
| 911 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 912 | (BUFFER) = (void *) packet; \ |
|---|
| 913 | } \ |
|---|
| 914 | while(0) |
|---|
| 915 | |
|---|
| 916 | /***************************************************************************/ |
|---|
| 917 | #define BM2MC_PACKET_WRITE_Blend( BUFFER, COLOR_BLEND, ALPHA_BLEND, COLOR, EXECUTE ) do \ |
|---|
| 918 | { \ |
|---|
| 919 | BM2MC_PACKET_PacketBlend *packet = (BM2MC_PACKET_PacketBlend *) (BUFFER); \ |
|---|
| 920 | BM2MC_PACKET_INIT( packet, Blend, EXECUTE ); \ |
|---|
| 921 | packet->color_blend = (COLOR_BLEND); \ |
|---|
| 922 | packet->alpha_blend = (ALPHA_BLEND); \ |
|---|
| 923 | packet->color = (COLOR); \ |
|---|
| 924 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 925 | (BUFFER) = (void *) packet; \ |
|---|
| 926 | } \ |
|---|
| 927 | while(0) |
|---|
| 928 | |
|---|
| 929 | /***************************************************************************/ |
|---|
| 930 | #define BM2MC_PACKET_WRITE_BlendColor( BUFFER, COLOR, EXECUTE ) do \ |
|---|
| 931 | { \ |
|---|
| 932 | BM2MC_PACKET_PacketBlendColor *packet = (BM2MC_PACKET_PacketBlendColor *) (BUFFER); \ |
|---|
| 933 | BM2MC_PACKET_INIT( packet, BlendColor, EXECUTE ); \ |
|---|
| 934 | packet->color = (COLOR); \ |
|---|
| 935 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 936 | (BUFFER) = (void *) packet; \ |
|---|
| 937 | } \ |
|---|
| 938 | while(0) |
|---|
| 939 | |
|---|
| 940 | /***************************************************************************/ |
|---|
| 941 | #define BM2MC_PACKET_WRITE_Rop( BUFFER, ROP, PATTERN0, PATTERN1, COLOR0, COLOR1, EXECUTE ) do \ |
|---|
| 942 | { \ |
|---|
| 943 | BM2MC_PACKET_PacketRop *packet = (BM2MC_PACKET_PacketRop *) (BUFFER); \ |
|---|
| 944 | BM2MC_PACKET_INIT( packet, Rop, EXECUTE ); \ |
|---|
| 945 | packet->rop = (ROP); \ |
|---|
| 946 | packet->pattern0 = (PATTERN0); \ |
|---|
| 947 | packet->pattern1 = (PATTERN1); \ |
|---|
| 948 | packet->color0 = (COLOR0); \ |
|---|
| 949 | packet->color1 = (COLOR1); \ |
|---|
| 950 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 951 | (BUFFER) = (void *) packet; \ |
|---|
| 952 | } \ |
|---|
| 953 | while(0) |
|---|
| 954 | |
|---|
| 955 | /***************************************************************************/ |
|---|
| 956 | #define BM2MC_PACKET_WRITE_SourceColorkey( BUFFER, HIGH, LOW, MASK, REPLACEMENT, REPLACEMENT_MASK, EXCLUSIVE, EXECUTE ) do \ |
|---|
| 957 | { \ |
|---|
| 958 | BM2MC_PACKET_PacketSourceColorkey *packet = (BM2MC_PACKET_PacketSourceColorkey *) (BUFFER); \ |
|---|
| 959 | BM2MC_PACKET_INIT( packet, SourceColorkey, EXECUTE ); \ |
|---|
| 960 | packet->high = (HIGH); \ |
|---|
| 961 | packet->low = (LOW); \ |
|---|
| 962 | packet->mask = (MASK); \ |
|---|
| 963 | packet->replacement = (REPLACEMENT); \ |
|---|
| 964 | packet->replacement_mask = (REPLACEMENT_MASK); \ |
|---|
| 965 | packet->exclusive = (EXCLUSIVE); \ |
|---|
| 966 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 967 | (BUFFER) = (void *) packet; \ |
|---|
| 968 | } \ |
|---|
| 969 | while(0) |
|---|
| 970 | |
|---|
| 971 | /***************************************************************************/ |
|---|
| 972 | #define BM2MC_PACKET_WRITE_SourceColorkeyEnable( BUFFER, ENABLE, EXECUTE ) do \ |
|---|
| 973 | { \ |
|---|
| 974 | BM2MC_PACKET_PacketSourceColorkeyEnable *packet = (BM2MC_PACKET_PacketSourceColorkeyEnable *) (BUFFER); \ |
|---|
| 975 | BM2MC_PACKET_INIT( packet, SourceColorkeyEnable, EXECUTE ); \ |
|---|
| 976 | packet->enable = (ENABLE); \ |
|---|
| 977 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 978 | (BUFFER) = (void *) packet; \ |
|---|
| 979 | } \ |
|---|
| 980 | while(0) |
|---|
| 981 | |
|---|
| 982 | /***************************************************************************/ |
|---|
| 983 | #define BM2MC_PACKET_WRITE_DestinationColorkey( BUFFER, HIGH, LOW, MASK, REPLACEMENT, REPLACEMENT_MASK, EXCLUSIVE, EXECUTE ) do \ |
|---|
| 984 | { \ |
|---|
| 985 | BM2MC_PACKET_PacketDestinationColorkey *packet = (BM2MC_PACKET_PacketDestinationColorkey *) (BUFFER); \ |
|---|
| 986 | BM2MC_PACKET_INIT( packet, DestinationColorkey, EXECUTE ); \ |
|---|
| 987 | packet->high = (HIGH); \ |
|---|
| 988 | packet->low = (LOW); \ |
|---|
| 989 | packet->mask = (MASK); \ |
|---|
| 990 | packet->replacement = (REPLACEMENT); \ |
|---|
| 991 | packet->replacement_mask = (REPLACEMENT_MASK); \ |
|---|
| 992 | packet->exclusive = (EXCLUSIVE); \ |
|---|
| 993 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 994 | (BUFFER) = (void *) packet; \ |
|---|
| 995 | } \ |
|---|
| 996 | while(0) |
|---|
| 997 | |
|---|
| 998 | /***************************************************************************/ |
|---|
| 999 | #define BM2MC_PACKET_WRITE_DestinationColorkeyEnable( BUFFER, ENABLE, EXECUTE ) do \ |
|---|
| 1000 | { \ |
|---|
| 1001 | BM2MC_PACKET_PacketDestinationColorkeyEnable *packet = (BM2MC_PACKET_PacketDestinationColorkeyEnable *) (BUFFER); \ |
|---|
| 1002 | BM2MC_PACKET_INIT( packet, DestinationColorkeyEnable, EXECUTE ); \ |
|---|
| 1003 | packet->enable = (ENABLE); \ |
|---|
| 1004 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1005 | (BUFFER) = (void *) packet; \ |
|---|
| 1006 | } \ |
|---|
| 1007 | while(0) |
|---|
| 1008 | |
|---|
| 1009 | /***************************************************************************/ |
|---|
| 1010 | #define BM2MC_PACKET_WRITE_Filter( BUFFER, HOR, VER, EXECUTE ) do \ |
|---|
| 1011 | { \ |
|---|
| 1012 | BM2MC_PACKET_PacketFilter *packet = (BM2MC_PACKET_PacketFilter *) (BUFFER); \ |
|---|
| 1013 | BM2MC_PACKET_INIT( packet, Filter, EXECUTE ); \ |
|---|
| 1014 | packet->hor = (HOR); \ |
|---|
| 1015 | packet->ver = (VER); \ |
|---|
| 1016 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1017 | (BUFFER) = (void *) packet; \ |
|---|
| 1018 | } \ |
|---|
| 1019 | while(0) |
|---|
| 1020 | |
|---|
| 1021 | /***************************************************************************/ |
|---|
| 1022 | #define BM2MC_PACKET_WRITE_FilterEnable( BUFFER, ENABLE, EXECUTE ) do \ |
|---|
| 1023 | { \ |
|---|
| 1024 | BM2MC_PACKET_PacketFilterEnable *packet = (BM2MC_PACKET_PacketFilterEnable *) (BUFFER); \ |
|---|
| 1025 | BM2MC_PACKET_INIT( packet, FilterEnable, EXECUTE ); \ |
|---|
| 1026 | packet->enable = (ENABLE); \ |
|---|
| 1027 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1028 | (BUFFER) = (void *) packet; \ |
|---|
| 1029 | } \ |
|---|
| 1030 | while(0) |
|---|
| 1031 | |
|---|
| 1032 | /***************************************************************************/ |
|---|
| 1033 | #define BM2MC_PACKET_WRITE_FilterControl( BUFFER, ROUNDING, ADJUST_COLOR, SUB_ALPHA, ORDER, EXECUTE ) do \ |
|---|
| 1034 | { \ |
|---|
| 1035 | BM2MC_PACKET_PacketFilterControl *packet = (BM2MC_PACKET_PacketFilterControl *) (BUFFER); \ |
|---|
| 1036 | BM2MC_PACKET_INIT( packet, FilterControl, EXECUTE ); \ |
|---|
| 1037 | packet->rounding = (ROUNDING); \ |
|---|
| 1038 | packet->adjust_color = (ADJUST_COLOR); \ |
|---|
| 1039 | packet->sub_alpha = (SUB_ALPHA); \ |
|---|
| 1040 | packet->order = (ORDER); \ |
|---|
| 1041 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1042 | (BUFFER) = (void *) packet; \ |
|---|
| 1043 | } \ |
|---|
| 1044 | while(0) |
|---|
| 1045 | |
|---|
| 1046 | /***************************************************************************/ |
|---|
| 1047 | #define BM2MC_PACKET_WRITE_SourceColorMatrix( BUFFER, MATRIX, EXECUTE ) do \ |
|---|
| 1048 | { \ |
|---|
| 1049 | BM2MC_PACKET_PacketSourceColorMatrix *packet = (BM2MC_PACKET_PacketSourceColorMatrix *) (BUFFER); \ |
|---|
| 1050 | BM2MC_PACKET_INIT( packet, SourceColorMatrix, EXECUTE ); \ |
|---|
| 1051 | packet->matrix = (MATRIX); \ |
|---|
| 1052 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1053 | (BUFFER) = (void *) packet; \ |
|---|
| 1054 | } \ |
|---|
| 1055 | while(0) |
|---|
| 1056 | |
|---|
| 1057 | /***************************************************************************/ |
|---|
| 1058 | #define BM2MC_PACKET_WRITE_SourceColorMatrixEnable( BUFFER, ENABLE, EXECUTE ) do \ |
|---|
| 1059 | { \ |
|---|
| 1060 | BM2MC_PACKET_PacketSourceColorMatrixEnable *packet = (BM2MC_PACKET_PacketSourceColorMatrixEnable *) (BUFFER); \ |
|---|
| 1061 | BM2MC_PACKET_INIT( packet, SourceColorMatrixEnable, EXECUTE ); \ |
|---|
| 1062 | packet->enable = (ENABLE); \ |
|---|
| 1063 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1064 | (BUFFER) = (void *) packet; \ |
|---|
| 1065 | } \ |
|---|
| 1066 | while(0) |
|---|
| 1067 | |
|---|
| 1068 | /***************************************************************************/ |
|---|
| 1069 | #define BM2MC_PACKET_WRITE_SourcePalette( BUFFER, ADDRESS, EXECUTE ) do \ |
|---|
| 1070 | { \ |
|---|
| 1071 | BM2MC_PACKET_PacketSourcePalette *packet = (BM2MC_PACKET_PacketSourcePalette *) (BUFFER); \ |
|---|
| 1072 | BM2MC_PACKET_INIT( packet, SourcePalette, EXECUTE ); \ |
|---|
| 1073 | packet->address = (ADDRESS); \ |
|---|
| 1074 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1075 | (BUFFER) = (void *) packet; \ |
|---|
| 1076 | } \ |
|---|
| 1077 | while(0) |
|---|
| 1078 | |
|---|
| 1079 | /***************************************************************************/ |
|---|
| 1080 | #define BM2MC_PACKET_WRITE_AlphaPremultiply( BUFFER, ENABLE, EXECUTE ) do \ |
|---|
| 1081 | { \ |
|---|
| 1082 | BM2MC_PACKET_PacketAlphaPremultiply *packet = (BM2MC_PACKET_PacketAlphaPremultiply *) (BUFFER); \ |
|---|
| 1083 | BM2MC_PACKET_INIT( packet, AlphaPremultiply, EXECUTE ); \ |
|---|
| 1084 | packet->enable = (ENABLE); \ |
|---|
| 1085 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1086 | (BUFFER) = (void *) packet; \ |
|---|
| 1087 | } \ |
|---|
| 1088 | while(0) |
|---|
| 1089 | |
|---|
| 1090 | /***************************************************************************/ |
|---|
| 1091 | #define BM2MC_PACKET_WRITE_Mirror( BUFFER, SRC_HOR, SRC_VER, DST_HOR, DST_VER, OUT_HOR, OUT_VER, EXECUTE ) do \ |
|---|
| 1092 | { \ |
|---|
| 1093 | BM2MC_PACKET_PacketMirror *packet = (BM2MC_PACKET_PacketMirror *) (BUFFER); \ |
|---|
| 1094 | BM2MC_PACKET_INIT( packet, Mirror, EXECUTE ); \ |
|---|
| 1095 | packet->src_hor = (SRC_HOR); \ |
|---|
| 1096 | packet->src_ver = (SRC_VER); \ |
|---|
| 1097 | packet->dst_hor = (DST_HOR); \ |
|---|
| 1098 | packet->dst_ver = (DST_VER); \ |
|---|
| 1099 | packet->out_hor = (OUT_HOR); \ |
|---|
| 1100 | packet->out_ver = (OUT_VER); \ |
|---|
| 1101 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1102 | (BUFFER) = (void *) packet; \ |
|---|
| 1103 | } \ |
|---|
| 1104 | while(0) |
|---|
| 1105 | |
|---|
| 1106 | /***************************************************************************/ |
|---|
| 1107 | #define BM2MC_PACKET_WRITE_FixedScale( BUFFER, HPHASE, VPHASE, HSTEP, VSTEP, SHIFT, EXECUTE ) do \ |
|---|
| 1108 | { \ |
|---|
| 1109 | BM2MC_PACKET_PacketFixedScale *packet = (BM2MC_PACKET_PacketFixedScale *) (BUFFER); \ |
|---|
| 1110 | BM2MC_PACKET_INIT( packet, FixedScale, EXECUTE ); \ |
|---|
| 1111 | packet->hor_phase = (HPHASE); \ |
|---|
| 1112 | packet->ver_phase = (VPHASE); \ |
|---|
| 1113 | packet->hor_step = (HSTEP); \ |
|---|
| 1114 | packet->ver_step = (VSTEP); \ |
|---|
| 1115 | packet->shift = (SHIFT); \ |
|---|
| 1116 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1117 | (BUFFER) = (void *) packet; \ |
|---|
| 1118 | } \ |
|---|
| 1119 | while(0) |
|---|
| 1120 | |
|---|
| 1121 | /***************************************************************************/ |
|---|
| 1122 | #define BM2MC_PACKET_WRITE_FillBlit( BUFFER, RECT, EXECUTE ) do \ |
|---|
| 1123 | { \ |
|---|
| 1124 | BM2MC_PACKET_PacketFillBlit *packet = (BM2MC_PACKET_PacketFillBlit *) (BUFFER); \ |
|---|
| 1125 | BM2MC_PACKET_INIT( packet, FillBlit, EXECUTE ); \ |
|---|
| 1126 | packet->rect = (RECT); \ |
|---|
| 1127 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1128 | (BUFFER) = (void *) packet; \ |
|---|
| 1129 | } \ |
|---|
| 1130 | while(0) |
|---|
| 1131 | |
|---|
| 1132 | /***************************************************************************/ |
|---|
| 1133 | #define BM2MC_PACKET_WRITE_CopyBlit( BUFFER, SRC_RECT, OUT_POINT, EXECUTE ) do \ |
|---|
| 1134 | { \ |
|---|
| 1135 | BM2MC_PACKET_PacketCopyBlit *packet = (BM2MC_PACKET_PacketCopyBlit *) (BUFFER); \ |
|---|
| 1136 | BM2MC_PACKET_INIT( packet, CopyBlit, EXECUTE ); \ |
|---|
| 1137 | packet->src_rect = (SRC_RECT); \ |
|---|
| 1138 | packet->out_point = (OUT_POINT); \ |
|---|
| 1139 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1140 | (BUFFER) = (void *) packet; \ |
|---|
| 1141 | } \ |
|---|
| 1142 | while(0) |
|---|
| 1143 | |
|---|
| 1144 | /***************************************************************************/ |
|---|
| 1145 | #define BM2MC_PACKET_WRITE_BlendBlit( BUFFER, SRC_RECT, OUT_POINT, DST_POINT, EXECUTE ) do \ |
|---|
| 1146 | { \ |
|---|
| 1147 | BM2MC_PACKET_PacketBlendBlit *packet = (BM2MC_PACKET_PacketBlendBlit *) (BUFFER); \ |
|---|
| 1148 | BM2MC_PACKET_INIT( packet, BlendBlit, EXECUTE ); \ |
|---|
| 1149 | packet->src_rect = (SRC_RECT); \ |
|---|
| 1150 | packet->out_point = (OUT_POINT); \ |
|---|
| 1151 | packet->dst_point = (DST_POINT); \ |
|---|
| 1152 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1153 | (BUFFER) = (void *) packet; \ |
|---|
| 1154 | } \ |
|---|
| 1155 | while(0) |
|---|
| 1156 | |
|---|
| 1157 | /***************************************************************************/ |
|---|
| 1158 | #define BM2MC_PACKET_WRITE_ScaleBlit( BUFFER, SRC_RECT, OUT_RECT, EXECUTE ) do \ |
|---|
| 1159 | { \ |
|---|
| 1160 | BM2MC_PACKET_PacketScaleBlit *packet = (BM2MC_PACKET_PacketScaleBlit *) (BUFFER); \ |
|---|
| 1161 | BM2MC_PACKET_INIT( packet, ScaleBlit, EXECUTE ); \ |
|---|
| 1162 | packet->src_rect = (SRC_RECT); \ |
|---|
| 1163 | packet->out_rect = (OUT_RECT); \ |
|---|
| 1164 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1165 | (BUFFER) = (void *) packet; \ |
|---|
| 1166 | } \ |
|---|
| 1167 | while(0) |
|---|
| 1168 | |
|---|
| 1169 | /***************************************************************************/ |
|---|
| 1170 | #define BM2MC_PACKET_WRITE_ScaleBlendBlit( BUFFER, SRC_RECT, OUT_RECT, DST_POINT, EXECUTE ) do \ |
|---|
| 1171 | { \ |
|---|
| 1172 | BM2MC_PACKET_PacketScaleBlendBlit *packet = (BM2MC_PACKET_PacketScaleBlendBlit *) (BUFFER); \ |
|---|
| 1173 | BM2MC_PACKET_INIT( packet, ScaleBlendBlit, EXECUTE ); \ |
|---|
| 1174 | packet->src_rect = (SRC_RECT); \ |
|---|
| 1175 | packet->out_rect = (OUT_RECT); \ |
|---|
| 1176 | packet->dst_point = (DST_POINT); \ |
|---|
| 1177 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1178 | (BUFFER) = (void *) packet; \ |
|---|
| 1179 | } \ |
|---|
| 1180 | while(0) |
|---|
| 1181 | |
|---|
| 1182 | /***************************************************************************/ |
|---|
| 1183 | #define BM2MC_PACKET_WRITE_UpdateScaleBlit( BUFFER, SRC_RECT, OUT_RECT, UPDATE_RECT, EXECUTE ) do \ |
|---|
| 1184 | { \ |
|---|
| 1185 | BM2MC_PACKET_PacketUpdateScaleBlit *packet = (BM2MC_PACKET_PacketUpdateScaleBlit *) (BUFFER); \ |
|---|
| 1186 | BM2MC_PACKET_INIT( packet, UpdateScaleBlit, EXECUTE ); \ |
|---|
| 1187 | packet->src_rect = (SRC_RECT); \ |
|---|
| 1188 | packet->out_rect = (OUT_RECT); \ |
|---|
| 1189 | packet->update_rect = (UPDATE_RECT); \ |
|---|
| 1190 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1191 | (BUFFER) = (void *) packet; \ |
|---|
| 1192 | } \ |
|---|
| 1193 | while(0) |
|---|
| 1194 | |
|---|
| 1195 | /***************************************************************************/ |
|---|
| 1196 | #define BM2MC_PACKET_WRITE_DestripeBlit( BUFFER, SRC_RECT, OUT_RECT, DST_POINT, SOURCE_STRIPE_WIDTH, LUMA_STRIPE_HEIGHT, CHROMA_STRIPE_HEIGHT, EXECUTE ) do \ |
|---|
| 1197 | { \ |
|---|
| 1198 | BM2MC_PACKET_PacketDestripeBlit *packet = (BM2MC_PACKET_PacketDestripeBlit *) (BUFFER); \ |
|---|
| 1199 | BM2MC_PACKET_INIT( packet, DestripeBlit, EXECUTE ); \ |
|---|
| 1200 | packet->src_rect = (SRC_RECT); \ |
|---|
| 1201 | packet->out_rect = (OUT_RECT); \ |
|---|
| 1202 | packet->dst_point = (DST_POINT); \ |
|---|
| 1203 | packet->source_stripe_width = (SOURCE_STRIPE_WIDTH); \ |
|---|
| 1204 | packet->luma_stripe_height = (LUMA_STRIPE_HEIGHT); \ |
|---|
| 1205 | packet->chroma_stripe_height = (CHROMA_STRIPE_HEIGHT); \ |
|---|
| 1206 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1207 | (BUFFER) = (void *) packet; \ |
|---|
| 1208 | } \ |
|---|
| 1209 | while(0) |
|---|
| 1210 | |
|---|
| 1211 | /***************************************************************************/ |
|---|
| 1212 | #define BM2MC_PACKET_WRITE_ResetState( BUFFER, EXECUTE ) do \ |
|---|
| 1213 | { \ |
|---|
| 1214 | BM2MC_PACKET_PacketResetState *packet = (BM2MC_PACKET_PacketResetState *) (BUFFER); \ |
|---|
| 1215 | BM2MC_PACKET_INIT( packet, ResetState, EXECUTE ); \ |
|---|
| 1216 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1217 | (BUFFER) = (void *) packet; \ |
|---|
| 1218 | } \ |
|---|
| 1219 | while(0) |
|---|
| 1220 | |
|---|
| 1221 | /***************************************************************************/ |
|---|
| 1222 | #define BM2MC_PACKET_WRITE_SaveState( BUFFER, EXECUTE ) do \ |
|---|
| 1223 | { \ |
|---|
| 1224 | BM2MC_PACKET_PacketSaveState *packet = (BM2MC_PACKET_PacketSaveState *) (BUFFER); \ |
|---|
| 1225 | BM2MC_PACKET_INIT( packet, SaveState, EXECUTE ); \ |
|---|
| 1226 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1227 | (BUFFER) = (void *) packet; \ |
|---|
| 1228 | } \ |
|---|
| 1229 | while(0) |
|---|
| 1230 | |
|---|
| 1231 | /***************************************************************************/ |
|---|
| 1232 | #define BM2MC_PACKET_WRITE_RestoreState( BUFFER, EXECUTE ) do \ |
|---|
| 1233 | { \ |
|---|
| 1234 | BM2MC_PACKET_PacketRestoreState *packet = (BM2MC_PACKET_PacketRestoreState *) (BUFFER); \ |
|---|
| 1235 | BM2MC_PACKET_INIT( packet, RestoreState, EXECUTE ); \ |
|---|
| 1236 | BM2MC_PACKET_TERM( packet ); \ |
|---|
| 1237 | (BUFFER) = (void *) packet; \ |
|---|
| 1238 | } \ |
|---|
| 1239 | while(0) |
|---|
| 1240 | |
|---|
| 1241 | /***************************************************************************/ |
|---|
| 1242 | |
|---|
| 1243 | #ifdef __cplusplus |
|---|
| 1244 | } |
|---|
| 1245 | #endif |
|---|
| 1246 | |
|---|
| 1247 | #endif /* BM2MC_PACKET_H__ */ |
|---|
| 1248 | |
|---|
| 1249 | /* end of file */ |
|---|