-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpx.py
392 lines (336 loc) · 11.7 KB
/
vpx.py
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# generated by 'xml2py'
# flags 'vp8.xml -o vpx.py -l ../Release/vpxmt.dll -v'
from ctypes import *
cdecl = CFUNCTYPE
stdcall = WINFUNCTYPE
VPX_IMAGE_ABI_VERSION = 1
VPX_CODEC_ABI_VERSION = (2 + VPX_IMAGE_ABI_VERSION)
vpx_img_fmt = c_int # enum
VPX_IMG_FMT_NONE = 0
VPX_IMG_FMT_RGB24 = 1
VPX_IMG_FMT_RGB32 = 2
VPX_IMG_FMT_RGB565 = 3
VPX_IMG_FMT_RGB555 = 4
VPX_IMG_FMT_UYVY = 5
VPX_IMG_FMT_YUY2 = 6
VPX_IMG_FMT_YVYU = 7
VPX_IMG_FMT_BGR24 = 8
VPX_IMG_FMT_RGB32_LE = 9
VPX_IMG_FMT_ARGB = 10
VPX_IMG_FMT_ARGB_LE = 11
VPX_IMG_FMT_RGB565_LE = 12
VPX_IMG_FMT_RGB555_LE = 13
VPX_IMG_FMT_YV12 = 769
VPX_IMG_FMT_I420 = 258
VPX_IMG_FMT_VPXYV12 = 771
VPX_IMG_FMT_VPXI420 = 260
uint_least8_t = c_ubyte
VPX_CODEC_MEM_ERROR = 2
int_least16_t = c_short
VPX_CODEC_LIST_END = 9
# ../vpxmt/include/vpx/vpx_codec.h 477
class vpx_codec_mmap(Structure):
pass
vpx_codec_mmap._fields_ = [
# ../vpxmt/include/vpx/vpx_codec.h 477
('id', c_uint),
('sz', c_ulong),
('align', c_uint),
('flags', c_uint),
('base', c_void_p),
('dtor', CFUNCTYPE(None, POINTER(vpx_codec_mmap))),
('priv', c_void_p),
]
assert sizeof(vpx_codec_mmap) == 28, sizeof(vpx_codec_mmap)
assert alignment(vpx_codec_mmap) == 4, alignment(vpx_codec_mmap)
vpx_codec_err_t = c_int # enum
VPX_CODEC_OK = 0
VPX_CODEC_ERROR = 1
VPX_CODEC_ABI_MISMATCH = 3
VPX_CODEC_INCAPABLE = 4
VPX_CODEC_UNSUP_BITSTREAM = 5
VPX_CODEC_UNSUP_FEATURE = 6
VPX_CODEC_CORRUPT_FRAME = 7
VPX_CODEC_INVALID_PARAM = 8
# ../vpxmt/include/vpx/vpx_codec.h 194
class vpx_codec_ctx(Structure):
pass
vpx_codec_ctx_t = vpx_codec_ctx
LP_vpx_codec_ctx_t = POINTER(vpx_codec_ctx_t)
# ../vpxmt/include/vpx/vpx_codec.h 336
vpx_codec_destroy = cdecl(vpx_codec_err_t, LP_vpx_codec_ctx_t) (('vpx_codec_destroy', cdll.vpxmt,),)
vpx_codec_caps_t = c_long
size_t = c_uint
# ../vpxmt/include/vpx/vpx_image.h 98
class vpx_image(Structure):
pass
vpx_image_t = vpx_image
LP_vpx_image_t = POINTER(vpx_image_t)
# ../vpxmt/include/vpx/vpx_image.h 230
vpx_img_flip = cdecl(None, LP_vpx_image_t) (('vpx_img_flip', cdll.vpxmt,),)
# ../vpxmt/include/vpx/vp8.h 80
class vp8_postproc_cfg(Structure):
pass
vp8_postproc_cfg._fields_ = [
# ../vpxmt/include/vpx/vp8.h 80
('post_proc_flag', c_int),
('deblocking_level', c_int),
('noise_level', c_int),
]
assert sizeof(vp8_postproc_cfg) == 12, sizeof(vp8_postproc_cfg)
assert alignment(vp8_postproc_cfg) == 4, alignment(vp8_postproc_cfg)
VP8_SET_DBG_COLOR_B_MODES = 6
vp8_postproc_cfg_t = vp8_postproc_cfg
# ../vpxmt/include/vpx/vpx_codec.h 167
class vpx_codec_iface(Structure):
pass
vpx_codec_iface_t = vpx_codec_iface
LP_vpx_codec_iface_t = POINTER(vpx_codec_iface_t)
# ../vpxmt/include/vpx/vpx_codec.h 277
vpx_codec_iface_name = cdecl(POINTER(c_char), LP_vpx_codec_iface_t) (('vpx_codec_iface_name', cdll.vpxmt,),)
# ../vpxmt/include/vpx/vp8.h 103
class vpx_ref_frame(Structure):
pass
vpx_ref_frame_t = vpx_ref_frame
uint_fast16_t = c_uint
# ../vpxmt/include/vpx/vpx_codec.h 202
class vpx_codec_dec_cfg(Structure):
pass
# ../vpxmt/include/vpx/vpx_codec.h 203
class vpx_codec_enc_cfg(Structure):
pass
# ../vpxmt/include/vpx/vpx_encoder.h 200
class vpx_rational(Structure):
pass
vpx_rational._fields_ = [
# ../vpxmt/include/vpx/vpx_encoder.h 200
('num', c_int),
('den', c_int),
]
assert sizeof(vpx_rational) == 8, sizeof(vpx_rational)
assert alignment(vpx_rational) == 4, alignment(vpx_rational)
vpx_rational_t = vpx_rational
uint32_t = c_uint
vpx_codec_er_flags_t = uint32_t
vpx_enc_pass = c_int # enum
VPX_RC_ONE_PASS = 0
VPX_RC_FIRST_PASS = 1
VPX_RC_LAST_PASS = 2
vpx_rc_mode = c_int # enum
VPX_VBR = 0
VPX_CBR = 1
VPX_CQ = 2
# ../vpxmt/include/vpx/vpx_encoder.h 85
class vpx_fixed_buf(Structure):
pass
vpx_fixed_buf_t = vpx_fixed_buf
LP_vpx_fixed_buf_t = POINTER(vpx_fixed_buf_t)
vpx_fixed_buf._fields_ = [
# ../vpxmt/include/vpx/vpx_encoder.h 85
('buf', c_void_p),
('sz', size_t),
]
assert sizeof(vpx_fixed_buf) == 8, sizeof(vpx_fixed_buf)
assert alignment(vpx_fixed_buf) == 4, alignment(vpx_fixed_buf)
vpx_kf_mode = c_int # enum
VPX_KF_FIXED = 0
VPX_KF_AUTO = 1
VPX_KF_DISABLED = 0
vpx_codec_enc_cfg._fields_ = [
# ../vpxmt/include/vpx/vpx_encoder.h 258
('g_usage', c_uint),
('g_threads', c_uint),
('g_profile', c_uint),
('g_w', c_uint),
('g_h', c_uint),
('g_timebase', vpx_rational),
('g_error_resilient', vpx_codec_er_flags_t),
('g_pass', vpx_enc_pass),
('g_lag_in_frames', c_uint),
('rc_dropframe_thresh', c_uint),
('rc_resize_allowed', c_uint),
('rc_resize_up_thresh', c_uint),
('rc_resize_down_thresh', c_uint),
('rc_end_usage', vpx_rc_mode),
('rc_twopass_stats_in', vpx_fixed_buf),
('rc_target_bitrate', c_uint),
('rc_min_quantizer', c_uint),
('rc_max_quantizer', c_uint),
('rc_undershoot_pct', c_uint),
('rc_overshoot_pct', c_uint),
('rc_buf_sz', c_uint),
('rc_buf_initial_sz', c_uint),
('rc_buf_optimal_sz', c_uint),
('rc_2pass_vbr_bias_pct', c_uint),
('rc_2pass_vbr_minsection_pct', c_uint),
('rc_2pass_vbr_maxsection_pct', c_uint),
('kf_mode', vpx_kf_mode),
('kf_min_dist', c_uint),
('kf_max_dist', c_uint),
('ts_number_layers', c_uint),
('ts_target_bitrate', c_uint * 5),
('ts_rate_decimator', c_uint * 5),
('ts_periodicity', c_uint),
('ts_layer_id', c_uint * 16),
]
assert sizeof(vpx_codec_enc_cfg) == 236, sizeof(vpx_codec_enc_cfg)
assert alignment(vpx_codec_enc_cfg) == 4, alignment(vpx_codec_enc_cfg)
# ../vpxmt/include/vpx/vpx_image.h 145
class vpx_image_rect(Structure):
pass
vpx_image_rect_t = vpx_image_rect
# ../vpxmt/include/vpx/vpx_image.h 238
vpx_img_free = cdecl(None, LP_vpx_image_t) (('vpx_img_free', cdll.vpxmt,),)
int64_t = c_longlong
int_fast64_t = c_longlong
VP8_NOFILTERING = 0
vpx_ref_frame_type = c_int # enum
VP8_LAST_FRAME = 1
VP8_GOLD_FRAME = 2
VP8_ALTR_FRAME = 4
vpx_ref_frame_type_t = vpx_ref_frame_type
vpx_img_fmt_t = vpx_img_fmt
vpx_image._fields_ = [
# ../vpxmt/include/vpx/vpx_image.h 98
('fmt', vpx_img_fmt_t),
('w', c_uint),
('h', c_uint),
('d_w', c_uint),
('d_h', c_uint),
('x_chroma_shift', c_uint),
('y_chroma_shift', c_uint),
('planes', POINTER(c_ubyte) * 4),
('stride', c_int * 4),
('bps', c_int),
('user_priv', c_void_p),
('img_data', POINTER(c_ubyte)),
('img_data_owner', c_int),
('self_allocd', c_int),
]
assert sizeof(vpx_image) == 80, sizeof(vpx_image)
assert alignment(vpx_image) == 4, alignment(vpx_image)
vpx_ref_frame._fields_ = [
# ../vpxmt/include/vpx/vp8.h 103
('frame_type', vpx_ref_frame_type_t),
('img', vpx_image_t),
]
assert sizeof(vpx_ref_frame) == 84, sizeof(vpx_ref_frame)
assert alignment(vpx_ref_frame) == 4, alignment(vpx_ref_frame)
vpx_codec_mmap_t = vpx_codec_mmap
int_fast8_t = c_byte
VP8_DEBLOCK = 1
VP8_COMMON_CTRL_ID_MAX = 8
vpx_codec_iter_t = c_void_p
int_least8_t = c_byte
vpx_codec_flags_t = c_long
# ../vpxmt/include/vpx/vpx_codec.h 201
class N13vpx_codec_ctx3DOLLAR_2E(Union):
pass
N13vpx_codec_ctx3DOLLAR_2E._fields_ = [
# ../vpxmt/include/vpx/vpx_codec.h 201
('dec', POINTER(vpx_codec_dec_cfg)),
('enc', POINTER(vpx_codec_enc_cfg)),
('raw', c_void_p),
]
assert sizeof(N13vpx_codec_ctx3DOLLAR_2E) == 4, sizeof(N13vpx_codec_ctx3DOLLAR_2E)
assert alignment(N13vpx_codec_ctx3DOLLAR_2E) == 4, alignment(N13vpx_codec_ctx3DOLLAR_2E)
# ../vpxmt/include/vpx/vpx_codec.h 175
class vpx_codec_priv(Structure):
pass
vpx_codec_priv_t = vpx_codec_priv
vpx_codec_ctx._fields_ = [
# ../vpxmt/include/vpx/vpx_codec.h 194
('name', POINTER(c_char)),
('iface', LP_vpx_codec_iface_t),
('err', vpx_codec_err_t),
('err_detail', POINTER(c_char)),
('init_flags', vpx_codec_flags_t),
('config', N13vpx_codec_ctx3DOLLAR_2E),
('priv', POINTER(vpx_codec_priv_t)),
]
assert sizeof(vpx_codec_ctx) == 28, sizeof(vpx_codec_ctx)
assert alignment(vpx_codec_ctx) == 4, alignment(vpx_codec_ctx)
# ../vpxmt/include/vpx/vpx_image.h 174
vpx_img_alloc = cdecl(LP_vpx_image_t, LP_vpx_image_t, vpx_img_fmt_t, c_uint, c_uint, c_uint) (('vpx_img_alloc', cdll.vpxmt,),)
# ../vpxmt/include/vpx/vpx_image.h 220
vpx_img_set_rect = cdecl(c_int, LP_vpx_image_t, c_uint, c_uint, c_uint, c_uint) (('vpx_img_set_rect', cdll.vpxmt,),)
ptrdiff_t = c_int
VP8_DEMACROBLOCK = 2
int_fast16_t = c_int
uint_fast32_t = c_uint
# ../vpxmt/include/vpx/vpx_codec.h 545
vpx_codec_set_mem_map = cdecl(vpx_codec_err_t, LP_vpx_codec_ctx_t, POINTER(vpx_codec_mmap_t), c_uint) (('vpx_codec_set_mem_map', cdll.vpxmt,),)
# ../vpxmt/include/vpx/vpx_codec.h 316
vpx_codec_error_detail = cdecl(POINTER(c_char), LP_vpx_codec_ctx_t) (('vpx_codec_error_detail', cdll.vpxmt,),)
int_fast32_t = c_int
# ../vpxmt/include/vpx/vpx_codec.h 375
vpx_codec_control_ = cdecl(vpx_codec_err_t, LP_vpx_codec_ctx_t, c_int) (('vpx_codec_control_', cdll.vpxmt,),)
VP8_DEBUG_TXT_FRAME_INFO = 8
VP8_COPY_REFERENCE = 2
# ../vpxmt/include/vpx/vpx_codec.h 227
vpx_codec_version = cdecl(c_int, ) (('vpx_codec_version', cdll.vpxmt,),)
# ../vpxmt/include/vpx/vpx_codec.h 346
vpx_codec_get_caps = cdecl(vpx_codec_caps_t, LP_vpx_codec_iface_t) (('vpx_codec_get_caps', cdll.vpxmt,),)
uintptr_t = c_uint
uintmax_t = c_ulonglong
vp8_postproc_level = c_int # enum
VP8_ADDNOISE = 4
VP8_DEBUG_TXT_MBLK_MODES = 16
VP8_DEBUG_TXT_DC_DIFF = 32
VP8_DEBUG_TXT_RATE_INFO = 64
VP8_MFQE = 1024
# ../vpxmt/include/vpx/vpx_codec.h 267
vpx_codec_build_config = cdecl(POINTER(c_char), ) (('vpx_codec_build_config', cdll.vpxmt,),)
int32_t = c_int
# ../vpxmt/include/vpx/vpx_codec.h 303
vpx_codec_error = cdecl(POINTER(c_char), LP_vpx_codec_ctx_t) (('vpx_codec_error', cdll.vpxmt,),)
# ../vpxmt/include/vpx/vpx_image.h 200
vpx_img_wrap = cdecl(LP_vpx_image_t, LP_vpx_image_t, vpx_img_fmt_t, c_uint, c_uint, c_uint, POINTER(c_ubyte)) (('vpx_img_wrap', cdll.vpxmt,),)
uint16_t = c_ushort
intmax_t = c_longlong
int16_t = c_short
vpx_image_rect._fields_ = [
# ../vpxmt/include/vpx/vpx_image.h 145
('x', c_uint),
('y', c_uint),
('w', c_uint),
('h', c_uint),
]
assert sizeof(vpx_image_rect) == 16, sizeof(vpx_image_rect)
assert alignment(vpx_image_rect) == 4, alignment(vpx_image_rect)
uint_fast8_t = c_ubyte
uint_least16_t = c_ushort
uint_least32_t = c_uint
uint_fast64_t = c_ulonglong
uint8_t = c_ubyte
uint_least64_t = c_ulonglong
# ../vpxmt/include/vpx/vpx_codec.h 290
vpx_codec_err_to_string = cdecl(POINTER(c_char), vpx_codec_err_t) (('vpx_codec_err_to_string', cdll.vpxmt,),)
int_least64_t = c_longlong
int8_t = c_byte
# /usr/include/inttypes.h 233
class imaxdiv_t(Structure):
pass
imaxdiv_t._fields_ = [
# /usr/include/inttypes.h 233
('quot', intmax_t),
('rem', intmax_t),
]
assert sizeof(imaxdiv_t) == 16, sizeof(imaxdiv_t)
assert alignment(imaxdiv_t) == 8, alignment(imaxdiv_t)
# ../vpxmt/include/vpx/vpx_codec.h 249
vpx_codec_version_str = cdecl(POINTER(c_char), ) (('vpx_codec_version_str', cdll.vpxmt,),)
intptr_t = c_int
# ../vpxmt/include/vpx/vpx_codec.h 258
vpx_codec_version_extra_str = cdecl(POINTER(c_char), ) (('vpx_codec_version_extra_str', cdll.vpxmt,),)
# ../vpxmt/include/vpx/vpx_codec.h 519
vpx_codec_get_mem_map = cdecl(vpx_codec_err_t, LP_vpx_codec_ctx_t, POINTER(vpx_codec_mmap_t), POINTER(vpx_codec_iter_t)) (('vpx_codec_get_mem_map', cdll.vpxmt,),)
vp8_com_control_id = c_int # enum
VP8_SET_REFERENCE = 1
VP8_SET_POSTPROC = 3
VP8_SET_DBG_COLOR_REF_FRAME = 4
VP8_SET_DBG_COLOR_MB_MODES = 5
VP8_SET_DBG_DISPLAY_MV = 7
VP8_DECODER_CTRL_ID_START = 256
uint64_t = c_ulonglong
int_least32_t = c_int