1 #ifndef _XVMC_H_ 2 #define _XVMC_H_ 3 4 #include <X11/X.h> 5 #include <X11/extensions/Xv.h> 6 7 #define XvMCName "XVideo-MotionCompensation" 8 #define XvMCNumEvents 0 9 #define XvMCNumErrors 3 10 #define XvMCVersion 1 11 #define XvMCRevision 1 12 13 #define XvMCBadContext 0 14 #define XvMCBadSurface 1 15 #define XvMCBadSubpicture 2 16 17 /* Chroma formats */ 18 #define XVMC_CHROMA_FORMAT_420 0x00000001 19 #define XVMC_CHROMA_FORMAT_422 0x00000002 20 #define XVMC_CHROMA_FORMAT_444 0x00000003 21 22 /* XvMCSurfaceInfo Flags */ 23 #define XVMC_OVERLAID_SURFACE 0x00000001 24 #define XVMC_BACKEND_SUBPICTURE 0x00000002 25 #define XVMC_SUBPICTURE_INDEPENDENT_SCALING 0x00000004 26 #define XVMC_INTRA_UNSIGNED 0x00000008 27 28 /* Motion Compensation types */ 29 #define XVMC_MOCOMP 0x00000000 30 #define XVMC_IDCT 0x00010000 31 32 #define XVMC_MPEG_1 0x00000001 33 #define XVMC_MPEG_2 0x00000002 34 #define XVMC_H263 0x00000003 35 #define XVMC_MPEG_4 0x00000004 36 37 #define XVMC_MB_TYPE_MOTION_FORWARD 0x02 38 #define XVMC_MB_TYPE_MOTION_BACKWARD 0x04 39 #define XVMC_MB_TYPE_PATTERN 0x08 40 #define XVMC_MB_TYPE_INTRA 0x10 41 42 #define XVMC_PREDICTION_FIELD 0x01 43 #define XVMC_PREDICTION_FRAME 0x02 44 #define XVMC_PREDICTION_DUAL_PRIME 0x03 45 #define XVMC_PREDICTION_16x8 0x02 46 #define XVMC_PREDICTION_4MV 0x04 47 48 #define XVMC_SELECT_FIRST_FORWARD 0x01 49 #define XVMC_SELECT_FIRST_BACKWARD 0x02 50 #define XVMC_SELECT_SECOND_FORWARD 0x04 51 #define XVMC_SELECT_SECOND_BACKWARD 0x08 52 53 #define XVMC_DCT_TYPE_FRAME 0x00 54 #define XVMC_DCT_TYPE_FIELD 0x01 55 56 #define XVMC_TOP_FIELD 0x00000001 57 #define XVMC_BOTTOM_FIELD 0x00000002 58 #define XVMC_FRAME_PICTURE (XVMC_TOP_FIELD | XVMC_BOTTOM_FIELD) 59 60 #define XVMC_SECOND_FIELD 0x00000004 61 62 #define XVMC_DIRECT 0x00000001 63 64 #define XVMC_RENDERING 0x00000001 65 #define XVMC_DISPLAYING 0x00000002 66 67 68 typedef struct { 69 int surface_type_id; 70 int chroma_format; 71 unsigned short max_width; 72 unsigned short max_height; 73 unsigned short subpicture_max_width; 74 unsigned short subpicture_max_height; 75 int mc_type; 76 int flags; 77 } XvMCSurfaceInfo; 78 79 typedef struct { 80 XID context_id; 81 int surface_type_id; 82 unsigned short width; 83 unsigned short height; 84 XvPortID port; 85 int flags; 86 void * privData; /* private to the library */ 87 } XvMCContext; 88 89 typedef struct { 90 XID surface_id; 91 XID context_id; 92 int surface_type_id; 93 unsigned short width; 94 unsigned short height; 95 void *privData; /* private to the library */ 96 } XvMCSurface; 97 98 typedef struct { 99 XID subpicture_id; 100 XID context_id; 101 int xvimage_id; 102 unsigned short width; 103 unsigned short height; 104 int num_palette_entries; 105 int entry_bytes; 106 char component_order[4]; 107 void *privData; /* private to the library */ 108 } XvMCSubpicture; 109 110 typedef struct { 111 unsigned int num_blocks; 112 XID context_id; 113 void *privData; 114 short *blocks; 115 } XvMCBlockArray; 116 117 typedef struct { 118 unsigned short x; 119 unsigned short y; 120 unsigned char macroblock_type; 121 unsigned char motion_type; 122 unsigned char motion_vertical_field_select; 123 unsigned char dct_type; 124 short PMV[2][2][2]; 125 unsigned int index; 126 unsigned short coded_block_pattern; 127 unsigned short pad0; 128 } XvMCMacroBlock; 129 130 131 typedef struct { 132 unsigned int num_blocks; 133 XID context_id; 134 void *privData; 135 XvMCMacroBlock *macro_blocks; 136 } XvMCMacroBlockArray; 137 138 #endif 139