-
Notifications
You must be signed in to change notification settings - Fork 1
/
libve_typedef.h
265 lines (234 loc) · 9.33 KB
/
libve_typedef.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#ifndef LIBVE_TYPEDEF_H
#define LIBVE_TYPEDEF_H
#ifdef __cplusplus
extern "C" {
#endif
//*******************************************************//
//*************** Basic type definition. ****************//
//*******************************************************//
#ifndef u8
typedef unsigned char u8;
#endif
#ifndef u16
typedef unsigned short u16;
#endif
#ifndef u32
typedef unsigned int u32;
#endif
#ifndef u64
#ifdef COMPILER_ARMCC
typedef unsigned __int64 u64;
#else
typedef unsigned long long u64;
#endif
#endif
#ifndef s8
typedef signed char s8;
#endif
#ifndef s16
typedef signed short s16;
#endif
#ifndef s32
typedef signed int s32;
#endif
#ifndef s64
#ifdef COMPILER_ARMCC
typedef signed __int64 s64;
#else
typedef signed long long s64;
#endif
#endif
#ifndef Handle
typedef void* Handle;
#endif
#ifndef NULL
#define NULL ((void*)0)
#endif
//*******************************************************//
//************ Define Stream Coding Formats. ************//
//*******************************************************//
typedef enum STREAM_FORMAT
{
STREAM_FORMAT_UNKNOW,
STREAM_FORMAT_MPEG2,
STREAM_FORMAT_MPEG4,
STREAM_FORMAT_REALVIDEO,
STREAM_FORMAT_H264,
STREAM_FORMAT_VC1,
STREAM_FORMAT_AVS,
STREAM_FORMAT_MJPEG,
STREAM_FORMAT_VP8
}stream_format_e;
typedef enum STREAM_SUB_FORMAT
{
STREAM_SUB_FORMAT_UNKNOW = 0,
MPEG2_SUB_FORMAT_MPEG1,
MPEG2_SUB_FORMAT_MPEG2,
MPEG4_SUB_FORMAT_XVID,
MPEG4_SUB_FORMAT_DIVX3,
MPEG4_SUB_FORMAT_DIVX4,
MPEG4_SUB_FORMAT_DIVX5,
MPEG4_SUB_FORMAT_SORENSSON_H263,
MPEG4_SUB_FORMAT_H263,
MPEG4_SUB_FORMAT_RMG2, //* H263 coded video stream muxed in '.rm' file.
MPEG4_SUB_FORMAT_VP6,
MPEG4_SUB_FORMAT_WMV1,
MPEG4_SUB_FORMAT_WMV2,
MPEG4_SUB_FORMAT_DIVX2, //MSMPEGV2
MPEG4_SUB_FORMAT_DIVX1 //MSMPEGV1
}stream_sub_format_e;
typedef enum CONTAINER_FORMAT
{
CONTAINER_FORMAT_UNKNOW,
CONTAINER_FORMAT_AVI,
CONTAINER_FORMAT_ASF,
CONTAINER_FORMAT_DAT,
CONTAINER_FORMAT_FLV,
CONTAINER_FORMAT_MKV,
CONTAINER_FORMAT_MOV,
CONTAINER_FORMAT_MPG,
CONTAINER_FORMAT_PMP,
CONTAINER_FORMAT_RM,
CONTAINER_FORMAT_TS,
CONTAINER_FORMAT_VOB,
CONTAINER_FORMAT_WEBM,
CONTAINER_FORMAT_OGM,
}container_format_e;
//*******************************************************//
//**************** Define Pixel Formats. ****************//
//*******************************************************//
typedef enum PIXEL_FORMAT
{
PIXEL_FORMAT_1BPP = 0x0,
PIXEL_FORMAT_2BPP = 0x1,
PIXEL_FORMAT_4BPP = 0x2,
PIXEL_FORMAT_8BPP = 0x3,
PIXEL_FORMAT_RGB655 = 0x4,
PIXEL_FORMAT_RGB565 = 0x5,
PIXEL_FORMAT_RGB556 = 0x6,
PIXEL_FORMAT_ARGB1555 = 0x7,
PIXEL_FORMAT_RGBA5551 = 0x8,
PIXEL_FORMAT_RGB888 = 0x9,
PIXEL_FORMAT_ARGB8888 = 0xa,
PIXEL_FORMAT_YUV444 = 0xb,
PIXEL_FORMAT_YUV422 = 0xc,
PIXEL_FORMAT_YUV420 = 0xd,
PIXEL_FORMAT_YUV411 = 0xe,
PIXEL_FORMAT_CSIRGB = 0xf,
PIXEL_FORMAT_AW_YUV420 = 0x10,
PIXEL_FORMAT_AW_YUV422 = 0x11,
PIXEL_FORMAT_AW_YUV411 = 0x12
}pixel_format_e;
//*******************************************************//
//************** Define DRAM Memory Type. ***************//
//*******************************************************//
typedef enum MEMORY_TYPE
{
MEMTYPE_DDR1_16BITS,
MEMTYPE_DDR1_32BITS,
MEMTYPE_DDR2_16BITS,
MEMTYPE_DDR2_32BITS,
MEMTYPE_DDR3_16BITS,
MEMTYPE_DDR3_32BITS
}memtype_e;
typedef enum LIBVE_3D_MODE
{
//* for 2D pictures.
_3D_MODE_NONE = 0,
//* for double stream video like MVC and MJPEG.
_3D_MODE_DOUBLE_STREAM,
//* for single stream video.
_3D_MODE_SIDE_BY_SIDE,
_3D_MODE_TOP_TO_BOTTOM,
_3D_MODE_LINE_INTERLEAVE,
_3D_MODE_COLUME_INTERLEAVE,
_3D_MODE_MAX
}_3d_mode_e;
typedef enum LIBVE_ANAGLAGH_TRANSFORM_MODE
{
ANAGLAGH_RED_BLUE = 0,
ANAGLAGH_RED_GREEN,
ANAGLAGH_RED_CYAN,
ANAGLAGH_COLOR,
ANAGLAGH_HALF_COLOR,
ANAGLAGH_OPTIMIZED,
ANAGLAGH_YELLOW_BLUE,
ANAGLAGH_NONE,
}anaglath_trans_mode_e;
#define CEDARV_PICT_PROP_NO_SYNC 0x1
#define CEDARV_FLAG_DECODE_NO_DELAY 0x40000000
//*******************************************************//
//************ Define Video Frame Structure. ************//
//*******************************************************//
typedef struct VIDEO_PICTURE
{
u32 id; //* picture id assigned by outside, decoder do not use this field;
u32 width; //* width of picture content;
u32 height; //* height of picture content;
u32 store_width; //* stored picture width;
u32 store_height; //* stored picture height;
u32 top_offset; //* display region top offset;
u32 left_offset; //* display region left offset;
u32 display_width; //* display region width;
u32 display_height; //* display region height;
u8 rotate_angle; //* how this picture has been rotated, 0: no rotate, 1: 90 degree (clock wise), 2: 180, 3: 270, 4: horizon flip, 5: vertical flig;
u8 horizontal_scale_ratio; //* what ratio this picture has been scaled down at horizon size, 0: 1/1, 1: 1/2, 2: 1/4, 3: 1/8;
u8 vertical_scale_ratio; //* what ratio this picture has been scaled down at vetical size, 0: 1/1, 1: 1/2, 2: 1/4, 3: 1/8;
u32 frame_rate; //* frame_rate, multiplied by 1000;
u32 aspect_ratio; //* pixel width to pixel height ratio, multiplied by 1000;
u32 pict_prop; //* picture property flags
u8 is_progressive; //* progressive or interlace picture;
u8 top_field_first; //* display top field first;
u8 repeat_top_field; //* if interlace picture, whether repeat the top field when display;
u8 repeat_bottom_field; //* if interlace picture, whether repeat the bottom field when display;
pixel_format_e pixel_format;
u64 pts; //* presentation time stamp, in unit of milli-second;
u64 pcr; //* program clock reference;
_3d_mode_e _3d_mode;
anaglath_trans_mode_e anaglath_transform_mode;
u32 size_y;
u32 size_u;
u32 size_v;
u32 size_alpha;
u8* y; //* pixel data, it is interpreted based on pixel_format;
u8* u; //* pixel data, it is interpreted based on pixel_format;
u8* v; //* pixel data, it is interpreted based on pixel_format;
u8* alpha; //* pixel data, it is interpreted based on pixel_format;
u32 size_y2;
u32 size_u2;
u32 size_v2;
u32 size_alpha2;
u8* y2; //* pixel data, it is interpreted based on pixel_format;
u8* u2; //* pixel data, it is interpreted based on pixel_format;
u8* v2; //* pixel data, it is interpreted based on pixel_format;
u8* alpha2; //* pixel data, it is interpreted based on pixel_format;
u32 flag_addr;//dit maf flag address
u32 flag_stride;//dit maf flag line stride
u8 maf_valid;
u8 pre_frame_valid;
}vpicture_t;
//*******************************************************//
//********** Define Bitstream Frame Structure. **********//
//*******************************************************//
//* define stream type for double stream video, such as MVC.
//* in that case two video streams is send into libve.
typedef enum CEDARV_STREAM_TYPE
{
CEDARV_STREAM_TYPE_MAJOR,
CEDARV_STREAM_TYPE_MINOR,
}cedarv_stream_type_e;
typedef struct VIDEO_STREAM_DATA
{
u8* data; //* stream data start address;
u32 length; //* stream length in unit of byte;
u64 pts; //* presentation time stamp, in unit of milli-second;
u64 pcr; //* program clock reference;
u8 valid; //* whether this stream frame is valid;
u32 id; //* stream frame identification.
cedarv_stream_type_e stream_type; //* major or minor stream in MVC.
u32 pict_prop;
}vstream_data_t;
#ifdef __cplusplus
}
#endif
#endif