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