1 ! Copyright (C) 2007 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
19 { [ os windows? ] [ "theoradec.dll" ] }
20 { [ os macosx? ] [ "libtheoradec.0.dylib" ] }
21 { [ os unix? ] [ "libtheoradec.so" ] }
22 } cond cdecl add-library
25 { [ os windows? ] [ "theoraenc.dll" ] }
26 { [ os macosx? ] [ "libtheoraenc.0.dylib" ] }
27 { [ os unix? ] [ "libtheoraenc.so" ] }
28 } cond cdecl add-library
31 CONSTANT: TH-EFAULT -1
32 CONSTANT: TH-EINVAL -10
33 CONSTANT: TH-EBADHEADER -20
34 CONSTANT: TH-ENOTFORMAT -21
35 CONSTANT: TH-EVERSION -22
36 CONSTANT: TH-EIMPL -23
37 CONSTANT: TH-EBADPACKET -24
38 CONSTANT: TH-DUPFRAME 1
40 TYPEDEF: int th-colorspace
41 CONSTANT: TH-CS-UNSPECIFIED 0
42 CONSTANT: TH-CS-ITU-REC-470M 1
43 CONSTANT: TH-CS-ITU-REC-470BG 2
44 CONSTANT: TH-CS-NSPACES 3
46 TYPEDEF: int th-pixelformat
47 CONSTANT: TH-PF-RSVD 0
50 CONSTANT: TH-PF-NFORMATS 3
59 TYPEDEF: th-img-plane[3] th-ycbcr-buffer
62 { version-major uchar }
63 { version-minor uchar }
64 { version-subminor uchar }
71 { fps-numerator uint }
72 { fps-denominator uint }
73 { aspect-numerator uint }
74 { aspect-denominator uint }
75 { colorspace th-colorspace }
76 { pixel-fmt th-pixelformat }
77 { target-bitrate int }
79 { keyframe-granule-shift int }
83 { user-comments c-string* }
84 { comment-lengths int* }
89 TYPEDEF: uchar[64] th-quant-base
91 STRUCT: th-quant-ranges
94 { base-matrices th-quant-base* }
98 { dc-scale { short 64 } }
99 { ac-scale { short 64 } }
100 { loop-filter-limits { uchar 64 } }
101 { qi-ranges { th-quant-ranges 2 3 } }
104 CONSTANT: TH-NHUFFMANE-TABLES 80
105 CONSTANT: TH-NDCT-TOKENS 32
113 FUNCTION: c-string th_version_string ( ) ;
114 FUNCTION: uint th_version_number ( ) ;
115 FUNCTION: longlong th_granule_frame ( void* encdec, longlong granpos) ;
116 FUNCTION: int th_packet_isheader ( ogg-packet* op ) ;
117 FUNCTION: int th_packet_iskeyframe ( ogg-packet* op ) ;
118 FUNCTION: void th_info_init ( th-info* info ) ;
119 FUNCTION: void th_info_clear ( th-info* info ) ;
120 FUNCTION: void th_comment_init ( th-comment* tc ) ;
121 FUNCTION: void th_comment_add ( th-comment* tc, c-string comment ) ;
122 FUNCTION: void th_comment_add_tag ( th-comment* tc, c-string tag, c-string value ) ;
123 FUNCTION: c-string th_comment_query ( th-comment* tc, c-string tag, int count ) ;
124 FUNCTION: int th_comment_query_count ( th-comment* tc, c-string tag ) ;
125 FUNCTION: void th_comment_clear ( th-comment* tc ) ;
127 CONSTANT: TH-ENCCTL-SET-HUFFMAN-CODES 0
128 CONSTANT: TH-ENCCTL-SET-QUANT-PARAMS 2
129 CONSTANT: TH-ENCCTL-SET-KEYFRAME-FREQUENCY-FORCE 4
130 CONSTANT: TH-ENCCTL-SET-VP3-COMPATIBLE 10
131 CONSTANT: TH-ENCCTL-GET-SPLEVEL-MAX 12
132 CONSTANT: TH-ENCCTL-SET-SPLEVEL 14
133 CONSTANT: TH-ENCCTL-SET-DUP-COUNT 18
134 CONSTANT: TH-ENCCTL-SET-RATE-FLAGS 20
135 CONSTANT: TH-ENCCTL-SET-RATE-BUFFER 22
136 CONSTANT: TH-ENCCTL-2PASS-OUT 24
137 CONSTANT: TH-ENCCTL-2PASS-IN 26
138 CONSTANT: TH-ENCCTL-SET-QUALITY 28
139 CONSTANT: TH-ENCCTL-SET-BITRATE 30
141 CONSTANT: TH-RATECTL-DROP-FRAMES 1
142 CONSTANT: TH-RATECTL-CAP-OVERFLOW 2
143 CONSTANT: TH-RATECTL-CAP-UNDERFOW 4
145 TYPEDEF: void* th-enc-ctx
148 FUNCTION: th-enc-ctx* th_encode_alloc ( th-info* info ) ;
149 FUNCTION: int th_encode_ctl ( th-enc-ctx* enc, int req, void* buf, int buf_sz ) ;
150 FUNCTION: int th_encode_flushheader ( th-enc-ctx* enc, th-comment* comments, ogg-packet* op ) ;
151 FUNCTION: int th_encode_ycbcr_in ( th-enc-ctx* enc, th-ycbcr-buffer ycbcr ) ;
152 FUNCTION: int th_encode_packetout ( th-enc-ctx* enc, int last, ogg-packet* op ) ;
153 FUNCTION: void th_encode_free ( th-enc-ctx* enc ) ;
155 CONSTANT: TH-DECCTL-GET-PPLEVEL-MAX 1
156 CONSTANT: TH-DECCTL-SET-PPLEVEL 3
157 CONSTANT: TH-DECCTL-SET-GRANPOS 5
158 CONSTANT: TH-DECCTL-SET-STRIPE-CB 7
159 CONSTANT: TH-DECCTL-SET-TELEMETRY-MBMODE 9
160 CONSTANT: TH-DECCTL-SET-TELEMETRY-MV 11
161 CONSTANT: TH-DECCTL-SET-TELEMETRY-QI 13
162 CONSTANT: TH-DECCTL-SET-TELEMETRY-BITS 15
164 TYPEDEF: void* th-stripe-decoded-func
166 STRUCT: th-stripe-callback
168 { stripe-decoded th-stripe-decoded-func }
171 TYPEDEF: void* th-dec-ctx
172 TYPEDEF: void* th-setup-info
175 FUNCTION: int th_decode_headerin ( th-info* info, th-comment* tc, th-setup-info** setup, ogg-packet* op ) ;
176 FUNCTION: th-dec-ctx* th_decode_alloc ( th-info* info, th-setup-info* setup ) ;
177 FUNCTION: void th_setup_free ( th-setup-info* setup ) ;
178 FUNCTION: int th_decode_ctl ( th-dec-ctx* dec, int req, void* buf, int buf_sz ) ;
179 FUNCTION: int th_decode_packetin ( th-dec-ctx* dec, ogg-packet* op, longlong granpos ) ;
180 FUNCTION: int th_decode_ycbcr_out ( th-dec-ctx* dec, th-ycbcr-buffer ycbcr ) ;
181 FUNCTION: void th_decode_free ( th-dec-ctx* dec ) ;