1\section{theoraenc.h File Reference}
2\label{theoraenc_8h}\index{theoraenc.h@{theoraenc.h}}
3
4
5The {\ttfamily libtheoraenc} C encoding API.
6{\ttfamily \#include $<$stddef.h$>$}\par
7{\ttfamily \#include $<$ogg/ogg.h$>$}\par
8{\ttfamily \#include \char`\"{}codec.h\char`\"{}}\par
9\subsection*{Defines}
10\begin{DoxyCompactItemize}
11\item
12\#define {\bf \_\-O\_\-THEORA\_\-THEORAENC\_\-H\_\-}~(1)
13\end{DoxyCompactItemize}
14\begin{Indent}{\bf th\_\-encode\_\-ctl() codes}\par
15{\em \label{_amgrp652c8d6bf1cea216ce117704a398b5f8}
16\label{theoraenc_8h_encctlcodes}
17 These are the available request codes for \doxyref{th\_\-encode\_\-ctl()}{p.}{group__encfuncs_ga3a427f6514dfdc01ea72172c469d51d9}. By convention, these are even, to distinguish them from the \doxyref{decoder control codes}{p.}{theoradec_8h_decctlcodes}. Keep any experimental or vendor-\/specific values above {\ttfamily 0x8000}. }\begin{DoxyCompactItemize}
18\item
19\#define {\bf TH\_\-ENCCTL\_\-SET\_\-HUFFMAN\_\-CODES}~(0)
20\begin{DoxyCompactList}\small\item\em Sets the Huffman tables to use. \item\end{DoxyCompactList}\item
21\#define {\bf TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}~(2)
22\begin{DoxyCompactList}\small\item\em Sets the quantization parameters to use. \item\end{DoxyCompactList}\item
23\#define {\bf TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}~(4)
24\begin{DoxyCompactList}\small\item\em Sets the maximum distance between key frames. \item\end{DoxyCompactList}\item
25\#define {\bf TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}~(10)
26\begin{DoxyCompactList}\small\item\em Disables any encoder features that would prevent lossless transcoding back to VP3. \item\end{DoxyCompactList}\item
27\#define {\bf TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}~(12)
28\begin{DoxyCompactList}\small\item\em Gets the maximum speed level. \item\end{DoxyCompactList}\item
29\#define {\bf TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}~(14)
30\begin{DoxyCompactList}\small\item\em Sets the speed level. \item\end{DoxyCompactList}\item
31\#define {\bf TH\_\-ENCCTL\_\-GET\_\-SPLEVEL}~(16)
32\begin{DoxyCompactList}\small\item\em Gets the current speed level. \item\end{DoxyCompactList}\item
33\#define {\bf TH\_\-ENCCTL\_\-SET\_\-DUP\_\-COUNT}~(18)
34\begin{DoxyCompactList}\small\item\em Sets the number of duplicates of the next frame to produce. \item\end{DoxyCompactList}\item
35\#define {\bf TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS}~(20)
36\begin{DoxyCompactList}\small\item\em Modifies the default bitrate management behavior. \item\end{DoxyCompactList}\item
37\#define {\bf TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER}~(22)
38\begin{DoxyCompactList}\small\item\em Sets the size of the bitrate management bit reservoir as a function of number of frames. \item\end{DoxyCompactList}\item
39\#define {\bf TH\_\-ENCCTL\_\-2PASS\_\-OUT}~(24)
40\begin{DoxyCompactList}\small\item\em Enable pass 1 of two-\/pass encoding mode and retrieve the first pass metrics. \item\end{DoxyCompactList}\item
41\#define {\bf TH\_\-ENCCTL\_\-2PASS\_\-IN}~(26)
42\begin{DoxyCompactList}\small\item\em Submits two-\/pass encoding metric data collected the first encoding pass to the second pass. \item\end{DoxyCompactList}\item
43\#define {\bf TH\_\-ENCCTL\_\-SET\_\-QUALITY}~(28)
44\begin{DoxyCompactList}\small\item\em Sets the current encoding quality. \item\end{DoxyCompactList}\item
45\#define {\bf TH\_\-ENCCTL\_\-SET\_\-BITRATE}~(30)
46\begin{DoxyCompactList}\small\item\em Sets the current encoding bitrate. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
47\end{Indent}
48\begin{Indent}{\bf TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS flags}\par
49{\em \label{_amgrp6d70796e675cce22589d15a73cb3a16b}
50\label{theoraenc_8h_ratectlflags}
51 These are the flags available for use with \doxyref{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS}{p.}{theoraenc_8h_a026502e08fbe1af0a1063f39bd18129c}. }\begin{DoxyCompactItemize}
52\item
53\#define {\bf TH\_\-RATECTL\_\-DROP\_\-FRAMES}~(0x1)
54\begin{DoxyCompactList}\small\item\em Drop frames to keep within bitrate buffer constraints. \item\end{DoxyCompactList}\item
55\#define {\bf TH\_\-RATECTL\_\-CAP\_\-OVERFLOW}~(0x2)
56\begin{DoxyCompactList}\small\item\em Ignore bitrate buffer overflows. \item\end{DoxyCompactList}\item
57\#define {\bf TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW}~(0x4)
58\begin{DoxyCompactList}\small\item\em Ignore bitrate buffer underflows. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
59\end{Indent}
60\subsection*{Typedefs}
61\begin{Indent}{\bf Encoder state}\par
62{\em \label{_amgrp4ebc85bd8522a8b6128225c02b31c8b7}
63The following data structure is opaque, and its contents are not publicly defined by this API.
64
65Referring to its internals directly is unsupported, and may break without warning. }\begin{DoxyCompactItemize}
66\item
67typedef struct {\bf th\_\-enc\_\-ctx} {\bf th\_\-enc\_\-ctx}
68\begin{DoxyCompactList}\small\item\em The encoder context. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
69\end{Indent}
70\subsection*{Functions}
71\begin{Indent}{\bf Functions for encoding}\par
72{\em \label{_amgrpc58fb8743a7ca83eb895d57e29e032c8}
73You must link to {\ttfamily libtheoraenc} and {\ttfamily libtheoradec} if you use any of the functions in this section.
74
75The functions are listed in the order they are used in a typical encode. The basic steps are:
76\begin{DoxyItemize}
77\item Fill in a \doxyref{th\_\-info}{p.}{structth__info} structure with details on the format of the video you wish to encode.
78\item Allocate a \doxyref{th\_\-enc\_\-ctx}{p.}{theoraenc_8h_af5cc40472b925456d42526a035d66edd} handle with \doxyref{th\_\-encode\_\-alloc()}{p.}{group__encfuncs_gaa91e47bc9dd5f6ee52045bd7b815e5a7}.
79\item Perform any additional encoder configuration required with \doxyref{th\_\-encode\_\-ctl()}{p.}{group__encfuncs_ga3a427f6514dfdc01ea72172c469d51d9}.
80\item Repeatedly call \doxyref{th\_\-encode\_\-flushheader()}{p.}{group__encfuncs_ga9439d61b566039d194ff782681fbc408} to retrieve all the header packets.
81\item For each uncompressed frame:
82\begin{DoxyItemize}
83\item Submit the uncompressed frame via \doxyref{th\_\-encode\_\-ycbcr\_\-in()}{p.}{group__encfuncs_gadbe7dd66b411c2d61ab8153c15308750}
84\item Repeatedly call \doxyref{th\_\-encode\_\-packetout()}{p.}{group__encfuncs_ga96d8ac1dda53187455352f99bbb5b04b} to retrieve any video data packets that are ready.
85\end{DoxyItemize}
86\item Call \doxyref{th\_\-encode\_\-free()}{p.}{group__encfuncs_ga36b23d216532231925c4107894204680} to release all encoder memory.
87\end{DoxyItemize}}\begin{DoxyCompactItemize}
88\item
89{\bf th\_\-enc\_\-ctx} $\ast$ {\bf th\_\-encode\_\-alloc} (const {\bf th\_\-info} $\ast$\_\-info)
90\begin{DoxyCompactList}\small\item\em Allocates an encoder instance. \item\end{DoxyCompactList}\item
91int {\bf th\_\-encode\_\-ctl} ({\bf th\_\-enc\_\-ctx} $\ast$\_\-enc, int \_\-req, void $\ast$\_\-buf, size\_\-t \_\-buf\_\-sz)
92\begin{DoxyCompactList}\small\item\em Encoder control function. \item\end{DoxyCompactList}\item
93int {\bf th\_\-encode\_\-flushheader} ({\bf th\_\-enc\_\-ctx} $\ast$\_\-enc, {\bf th\_\-comment} $\ast$\_\-comments, ogg\_\-packet $\ast$\_\-op)
94\begin{DoxyCompactList}\small\item\em Outputs the next header packet. \item\end{DoxyCompactList}\item
95int {\bf th\_\-encode\_\-ycbcr\_\-in} ({\bf th\_\-enc\_\-ctx} $\ast$\_\-enc, {\bf th\_\-ycbcr\_\-buffer} \_\-ycbcr)
96\begin{DoxyCompactList}\small\item\em Submits an uncompressed frame to the encoder. \item\end{DoxyCompactList}\item
97int {\bf th\_\-encode\_\-packetout} ({\bf th\_\-enc\_\-ctx} $\ast$\_\-enc, int \_\-last, ogg\_\-packet $\ast$\_\-op)
98\begin{DoxyCompactList}\small\item\em Retrieves encoded video data packets. \item\end{DoxyCompactList}\item
99void {\bf th\_\-encode\_\-free} ({\bf th\_\-enc\_\-ctx} $\ast$\_\-enc)
100\begin{DoxyCompactList}\small\item\em Frees an allocated encoder instance. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
101\end{Indent}
102\subsection*{Variables}
103\begin{DoxyCompactItemize}
104\item
105const {\bf th\_\-quant\_\-info} {\bf TH\_\-VP31\_\-QUANT\_\-INFO}
106\begin{DoxyCompactList}\small\item\em The quantization parameters used by VP3. \item\end{DoxyCompactList}\item
107const {\bf th\_\-huff\_\-code} {\bf TH\_\-VP31\_\-HUFF\_\-CODES} [TH\_\-NHUFFMAN\_\-TABLES][TH\_\-NDCT\_\-TOKENS]
108\begin{DoxyCompactList}\small\item\em The Huffman tables used by VP3. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
109
110
111\subsection{Detailed Description}
112The {\ttfamily libtheoraenc} C encoding API.
113
114\subsection{Define Documentation}
115\index{theoraenc.h@{theoraenc.h}!\_\-O\_\-THEORA\_\-THEORAENC\_\-H\_\-@{\_\-O\_\-THEORA\_\-THEORAENC\_\-H\_\-}}
116\index{\_\-O\_\-THEORA\_\-THEORAENC\_\-H\_\-@{\_\-O\_\-THEORA\_\-THEORAENC\_\-H\_\-}!theoraenc.h@{theoraenc.h}}
117\subsubsection[{\_\-O\_\-THEORA\_\-THEORAENC\_\-H\_\-}]{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-O\_\-THEORA\_\-THEORAENC\_\-H\_\-~(1)}\label{theoraenc_8h_ab915dd90f069a2431454fd62365e9381}
118\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-2PASS\_\-IN@{TH\_\-ENCCTL\_\-2PASS\_\-IN}}
119\index{TH\_\-ENCCTL\_\-2PASS\_\-IN@{TH\_\-ENCCTL\_\-2PASS\_\-IN}!theoraenc.h@{theoraenc.h}}
120\subsubsection[{TH\_\-ENCCTL\_\-2PASS\_\-IN}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-2PASS\_\-IN~(26)}\label{theoraenc_8h_a4a84f982cdd9a3e3c803a29bbde9df0b}
121
122
123Submits two-\/pass encoding metric data collected the first encoding pass to the second pass. The first call must be made before the first frame is encoded, and a target bitrate must have already been specified to the encoder. It sets the encoder to pass 2 mode implicitly; this cannot be disabled. The encoder may require reading data from some or all of the frames in advance, depending on, e.g., the reservoir size used in the second pass. You must call this function repeatedly before each frame to provide data until either a) it fails to consume all of the data presented or b) all of the pass 1 data has been consumed. In the first case, you must save the remaining data to be presented after the next frame. You can call this function with a NULL argument to get an upper bound on the number of bytes that will be required before the next frame.
124
125When pass 2 is first enabled, the default bit reservoir is set to the entire file; this gives maximum flexibility but can lead to very high peak rates. You can subsequently set it to another value with \doxyref{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER}{p.}{theoraenc_8h_aaefb515876b2a180ad5c3120fc584a52} (e.g., to set it to the keyframe interval for non-\/live streaming), however, you may then need to provide more data before the next frame.
126
127
128\begin{DoxyParams}{Parameters}
129\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily char[]}: A buffer containing the data returned by \doxyref{TH\_\-ENCCTL\_\-2PASS\_\-OUT}{p.}{theoraenc_8h_ac3751b9c3838888ec2e3f0b0d2823282} in pass 1. You may pass {\ttfamily NULL} for {\itshape \_\-buf\/} to return an upper bound on the number of additional bytes needed before the next frame. The summary data returned at the end of pass 1 must be at the head of the buffer on the first call with a non-\/{\ttfamily NULL} {\itshape \_\-buf\/}, and the placeholder data returned at the start of pass 1 should be omitted. After each call you should advance this buffer by the number of bytes consumed. \end{DoxyParams}
130
131\begin{DoxyRetVals}{Return values}
132\item[{\em $>$0}]The number of bytes of metric data required/consumed. \item[{\em 0}]No more data is required before the next frame. \item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]No target bitrate has been set, or the first call was made after the first frame was submitted for encoding. \item[{\em TH\_\-ENOTFORMAT}]The data did not appear to be pass 1 from a compatible implementation of this library. \item[{\em TH\_\-EBADHEADER}]The data was invalid; this may be returned when attempting to read an aborted pass 1 file that still has the placeholder data in place of the summary data. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
133\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-2PASS\_\-OUT@{TH\_\-ENCCTL\_\-2PASS\_\-OUT}}
134\index{TH\_\-ENCCTL\_\-2PASS\_\-OUT@{TH\_\-ENCCTL\_\-2PASS\_\-OUT}!theoraenc.h@{theoraenc.h}}
135\subsubsection[{TH\_\-ENCCTL\_\-2PASS\_\-OUT}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-2PASS\_\-OUT~(24)}\label{theoraenc_8h_ac3751b9c3838888ec2e3f0b0d2823282}
136
137
138Enable pass 1 of two-\/pass encoding mode and retrieve the first pass metrics. Pass 1 mode must be enabled before the first frame is encoded, and a target bitrate must have already been specified to the encoder. Although this does not have to be the exact rate that will be used in the second pass, closer values may produce better results. The first call returns the size of the two-\/pass header data, along with some placeholder content, and sets the encoder into pass 1 mode implicitly. This call sets the encoder to pass 1 mode implicitly. Then, a subsequent call must be made after each call to \doxyref{th\_\-encode\_\-ycbcr\_\-in()}{p.}{group__encfuncs_gadbe7dd66b411c2d61ab8153c15308750} to retrieve the metrics for that frame. An additional, final call must be made to retrieve the summary data, containing such information as the total number of frames, etc. This must be stored in place of the placeholder data that was returned in the first call, before the frame metrics data. All of this data must be presented back to the encoder during pass 2 using \doxyref{TH\_\-ENCCTL\_\-2PASS\_\-IN}{p.}{theoraenc_8h_a4a84f982cdd9a3e3c803a29bbde9df0b}.
139
140
141\begin{DoxyParams}{Parameters}
142\item[\mbox{$\rightarrow$} {\em $<$tt$>$char}]$\ast$\_\-buf: Returns a pointer to internal storage containing the two pass metrics data. This storage is only valid until the next call, or until the encoder context is freed, and must be copied by the application. \end{DoxyParams}
143
144\begin{DoxyRetVals}{Return values}
145\item[{\em $>$=0}]The number of bytes of metric data available in the returned buffer. \item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(char $\ast$)}, no target bitrate has been set, or the first call was made after the first frame was submitted for encoding. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
146\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-GET\_\-SPLEVEL@{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL}}
147\index{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL@{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL}!theoraenc.h@{theoraenc.h}}
148\subsubsection[{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-GET\_\-SPLEVEL~(16)}\label{theoraenc_8h_a114b7c552f50b7b8d881a39489af1f61}
149
150
151Gets the current speed level. The default speed level may vary according to encoder implementation, but if this control code is not supported (it returns \doxyref{TH\_\-EIMPL}{p.}{codec_8h_a921c47accc17841f220af5a6afb79efe}), the default may be assumed to be the slowest available speed (0). The maximum encoding speed level may be implementation-\/ and encoding mode-\/specific, and can be obtained via \doxyref{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}{p.}{theoraenc_8h_a9baf5bdd206e80c78a8fd44687e89783}.
152
153
154\begin{DoxyParams}{Parameters}
155\item[\mbox{$\rightarrow$} {\em \_\-buf}]{\ttfamily int}: The current encoding speed level. 0 is slowest, larger values use less CPU. \end{DoxyParams}
156
157\begin{DoxyRetVals}{Return values}
158\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(int)}. \item[{\em TH\_\-EIMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
159\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX@{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}}
160\index{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX@{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}!theoraenc.h@{theoraenc.h}}
161\subsubsection[{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX~(12)}\label{theoraenc_8h_a9baf5bdd206e80c78a8fd44687e89783}
162
163
164Gets the maximum speed level. Higher speed levels favor quicker encoding over better quality per bit. Depending on the encoding mode, and the internal algorithms used, quality may actually improve, but in this case bitrate will also likely increase. In any case, overall rate/distortion performance will probably decrease. The maximum value, and the meaning of each value, may change depending on the current encoding mode (VBR vs. constant quality, etc.).
165
166
167\begin{DoxyParams}{Parameters}
168\item[\mbox{$\rightarrow$} {\em \_\-buf}]{\ttfamily int}: The maximum encoding speed level. \end{DoxyParams}
169
170\begin{DoxyRetVals}{Return values}
171\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(int)}. \item[{\em TH\_\-EIMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
172\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-BITRATE@{TH\_\-ENCCTL\_\-SET\_\-BITRATE}}
173\index{TH\_\-ENCCTL\_\-SET\_\-BITRATE@{TH\_\-ENCCTL\_\-SET\_\-BITRATE}!theoraenc.h@{theoraenc.h}}
174\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-BITRATE}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-BITRATE~(30)}\label{theoraenc_8h_a9b969df55ecad1acd1ae207fad42592e}
175
176
177Sets the current encoding bitrate. Once a bitrate is set, the encoder must use a rate-\/controlled mode for all future frames (this restriction may be relaxed in a future version). If it is set before the headers are emitted, the target bitrate encoded in them will be updated. Due to the buffer delay, the exact bitrate of each section of the encode is not guaranteed. The encoder may have already used more bits than allowed for the frames it has encoded, expecting to make them up in future frames, or it may have used fewer, holding the excess in reserve. The exact transition between the two bitrates is not well-\/defined by this API, but may be affected by flags set with \doxyref{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS}{p.}{theoraenc_8h_a026502e08fbe1af0a1063f39bd18129c}. After a number of frames equal to the buffer delay, one may expect further output to average at the target bitrate.
178
179
180\begin{DoxyParams}{Parameters}
181\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily long}: The new target bitrate, in bits per second. \end{DoxyParams}
182
183\begin{DoxyRetVals}{Return values}
184\item[{\em 0}]Success. \item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]The target bitrate was not positive. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
185\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-DUP\_\-COUNT@{TH\_\-ENCCTL\_\-SET\_\-DUP\_\-COUNT}}
186\index{TH\_\-ENCCTL\_\-SET\_\-DUP\_\-COUNT@{TH\_\-ENCCTL\_\-SET\_\-DUP\_\-COUNT}!theoraenc.h@{theoraenc.h}}
187\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-DUP\_\-COUNT}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-DUP\_\-COUNT~(18)}\label{theoraenc_8h_a8bb9b05471c42a09f8684a2583b8a1df}
188
189
190Sets the number of duplicates of the next frame to produce. Although libtheora can encode duplicate frames very cheaply, it costs some amount of CPU to detect them, and a run of duplicates cannot span a keyframe boundary. This control code tells the encoder to produce the specified number of extra duplicates of the next frame. This allows the encoder to make smarter keyframe placement decisions and rate control decisions, and reduces CPU usage as well, when compared to just submitting the same frame for encoding multiple times. This setting only applies to the next frame submitted for encoding. You MUST call \doxyref{th\_\-encode\_\-packetout()}{p.}{group__encfuncs_ga96d8ac1dda53187455352f99bbb5b04b} repeatedly until it returns 0, or the extra duplicate frames will be lost.
191
192
193\begin{DoxyParams}{Parameters}
194\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily int}: The number of duplicates to produce. If this is negative or zero, no duplicates will be produced. \end{DoxyParams}
195
196\begin{DoxyRetVals}{Return values}
197\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(int)}, or the number of duplicates is greater than or equal to the maximum keyframe interval. In the latter case, NO duplicate frames will be produced. You must ensure that the maximum keyframe interval is set larger than the maximum number of duplicates you will ever wish to insert prior to encoding. \item[{\em TH\_\-EIMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
198\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-HUFFMAN\_\-CODES@{TH\_\-ENCCTL\_\-SET\_\-HUFFMAN\_\-CODES}}
199\index{TH\_\-ENCCTL\_\-SET\_\-HUFFMAN\_\-CODES@{TH\_\-ENCCTL\_\-SET\_\-HUFFMAN\_\-CODES}!theoraenc.h@{theoraenc.h}}
200\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-HUFFMAN\_\-CODES}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-HUFFMAN\_\-CODES~(0)}\label{theoraenc_8h_a0165348788e560a19b7c61ae8f0c2283}
201
202
203Sets the Huffman tables to use. The tables are copied, not stored by reference, so they can be freed after this call. {\ttfamily NULL} may be specified to revert to the default tables.
204
205
206\begin{DoxyParams}{Parameters}
207\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily \doxyref{th\_\-huff\_\-code}{p.}{structth__huff__code}[\doxyref{TH\_\-NHUFFMAN\_\-TABLES}{p.}{codec_8h_a49bf449eae33c5320f0c308f32c6ae42}][\doxyref{TH\_\-NDCT\_\-TOKENS}{p.}{codec_8h_a2a44f48084e76a58cae48fb5d47cd422}]} \end{DoxyParams}
208
209\begin{DoxyRetVals}{Return values}
210\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]Encoding has already begun or one or more of the given tables is not full or prefix-\/free, {\itshape \_\-buf\/} is {\ttfamily NULL} and {\itshape \_\-buf\_\-sz\/} is not zero, or {\itshape \_\-buf\/} is non-\/{\ttfamily NULL} and {\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(\doxyref{th\_\-huff\_\-code}{p.}{structth__huff__code})$\ast$\doxyref{TH\_\-NHUFFMAN\_\-TABLES}{p.}{codec_8h_a49bf449eae33c5320f0c308f32c6ae42}$\ast$\doxyref{TH\_\-NDCT\_\-TOKENS}{p.}{codec_8h_a2a44f48084e76a58cae48fb5d47cd422}}. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
211\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE@{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}}
212\index{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE@{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}!theoraenc.h@{theoraenc.h}}
213\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE~(4)}\label{theoraenc_8h_a27e755e15b4b5604c54974b304037a49}
214
215
216Sets the maximum distance between key frames. This can be changed during an encode, but will be bounded by {\ttfamily 1$<$$<$\doxyref{th\_\-info::keyframe\_\-granule\_\-shift}{p.}{structth__info_a693ca4ab11fbc0c3f32594b4bb8766ed}}. If it is set before encoding begins, \doxyref{th\_\-info::keyframe\_\-granule\_\-shift}{p.}{structth__info_a693ca4ab11fbc0c3f32594b4bb8766ed} will be enlarged appropriately.
217
218
219\begin{DoxyParams}{Parameters}
220\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily ogg\_\-uint32\_\-t}: The maximum distance between key frames. \item[\mbox{$\rightarrow$} {\em \_\-buf}]{\ttfamily ogg\_\-uint32\_\-t}: The actual maximum distance set. \end{DoxyParams}
221
222\begin{DoxyRetVals}{Return values}
223\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(ogg\_\-uint32\_\-t)}. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
224\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-QUALITY@{TH\_\-ENCCTL\_\-SET\_\-QUALITY}}
225\index{TH\_\-ENCCTL\_\-SET\_\-QUALITY@{TH\_\-ENCCTL\_\-SET\_\-QUALITY}!theoraenc.h@{theoraenc.h}}
226\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-QUALITY}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-QUALITY~(28)}\label{theoraenc_8h_aac087983fa951b9148c9db6bc2e81ef4}
227
228
229Sets the current encoding quality. This is only valid so long as no bitrate has been specified, either through the \doxyref{th\_\-info}{p.}{structth__info} struct used to initialize the encoder or through \doxyref{TH\_\-ENCCTL\_\-SET\_\-BITRATE}{p.}{theoraenc_8h_a9b969df55ecad1acd1ae207fad42592e} (this restriction may be relaxed in a future version). If it is set before the headers are emitted, the target quality encoded in them will be updated.
230
231
232\begin{DoxyParams}{Parameters}
233\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily int}: The new target quality, in the range 0...63, inclusive. \end{DoxyParams}
234
235\begin{DoxyRetVals}{Return values}
236\item[{\em 0}]Success. \item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]A target bitrate has already been specified, or the quality index was not in the range 0...63. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
237\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS@{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}}
238\index{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS@{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}!theoraenc.h@{theoraenc.h}}
239\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS~(2)}\label{theoraenc_8h_a3befcdd66678f8d27034f9c4b16d1b9c}
240
241
242Sets the quantization parameters to use. The parameters are copied, not stored by reference, so they can be freed after this call. {\ttfamily NULL} may be specified to revert to the default parameters.
243
244
245\begin{DoxyParams}{Parameters}
246\item[\mbox{$\leftarrow$} {\em \_\-buf}]\doxyref{th\_\-quant\_\-info}{p.}{structth__quant__info} \end{DoxyParams}
247
248\begin{DoxyRetVals}{Return values}
249\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]Encoding has already begun, {\itshape \_\-buf\/} is {\ttfamily NULL} and {\itshape \_\-buf\_\-sz\/} is not zero, or {\itshape \_\-buf\/} is non-\/{\ttfamily NULL} and {\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(\doxyref{th\_\-quant\_\-info}{p.}{structth__quant__info})}. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
250\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER@{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER}}
251\index{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER@{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER}!theoraenc.h@{theoraenc.h}}
252\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-RATE\_\-BUFFER~(22)}\label{theoraenc_8h_aaefb515876b2a180ad5c3120fc584a52}
253
254
255Sets the size of the bitrate management bit reservoir as a function of number of frames. The reservoir size affects how quickly bitrate management reacts to instantaneous changes in the video complexity. Larger reservoirs react more slowly, and provide better overall quality, but require more buffering by a client, adding more latency to live streams. By default, libtheora sets the reservoir to the maximum distance between keyframes, subject to a minimum and maximum limit. This call may be used to increase or decrease the reservoir, increasing or decreasing the allowed temporary variance in bitrate. An implementation may impose some limits on the size of a reservoir it can handle, in which case the actual reservoir size may not be exactly what was requested. The actual value set will be returned.
256
257
258\begin{DoxyParams}{Parameters}
259\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily int}: Requested size of the reservoir measured in frames. \item[\mbox{$\rightarrow$} {\em \_\-buf}]{\ttfamily int}: The actual size of the reservoir set. \end{DoxyParams}
260
261\begin{DoxyRetVals}{Return values}
262\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(int)}, or rate control is not enabled. The buffer has an implementation defined minimum and maximum size and the value in \_\-buf will be adjusted to match the actual value set. \item[{\em TH\_\-EIMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
263\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS@{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS}}
264\index{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS@{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS}!theoraenc.h@{theoraenc.h}}
265\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-RATE\_\-FLAGS~(20)}\label{theoraenc_8h_a026502e08fbe1af0a1063f39bd18129c}
266
267
268Modifies the default bitrate management behavior. Use to allow or disallow frame dropping, and to enable or disable capping bit reservoir overflows and underflows. See \doxyref{the list of available flags}{p.}{theoraenc_8h_encctlcodes}. The flags are set by default to {\ttfamily \doxyref{TH\_\-RATECTL\_\-DROP\_\-FRAMES}{p.}{theoraenc_8h_a3e7fab53b902b54135522ba286f45e33}$|$\doxyref{TH\_\-RATECTL\_\-CAP\_\-OVERFLOW}{p.}{theoraenc_8h_a32f9983b344a431334493cefb0b9337c}}.
269
270
271\begin{DoxyParams}{Parameters}
272\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily int}: Any combination of \doxyref{the available flags}{p.}{theoraenc_8h_ratectlflags}:
273\begin{DoxyItemize}
274\item \doxyref{TH\_\-RATECTL\_\-DROP\_\-FRAMES}{p.}{theoraenc_8h_a3e7fab53b902b54135522ba286f45e33}: Enable frame dropping.
275\item \doxyref{TH\_\-RATECTL\_\-CAP\_\-OVERFLOW}{p.}{theoraenc_8h_a32f9983b344a431334493cefb0b9337c}: Don't bank excess bits for later use.
276\item \doxyref{TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW}{p.}{theoraenc_8h_ad0d62d9dce542caf5296b03b97e020a6}: Don't try to make up shortfalls later.
277\end{DoxyItemize}\end{DoxyParams}
278
279\begin{DoxyRetVals}{Return values}
280\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(int)} or rate control is not enabled. \item[{\em TH\_\-EIMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
281\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-SPLEVEL@{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}}
282\index{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL@{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}!theoraenc.h@{theoraenc.h}}
283\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-SPLEVEL~(14)}\label{theoraenc_8h_abd9fbcb6a25a77d991d3620164fe59d6}
284
285
286Sets the speed level. The current speed level may be retrieved using \doxyref{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL}{p.}{theoraenc_8h_a114b7c552f50b7b8d881a39489af1f61}.
287
288
289\begin{DoxyParams}{Parameters}
290\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily int}: The new encoding speed level. 0 is slowest, larger values use less CPU. \end{DoxyParams}
291
292\begin{DoxyRetVals}{Return values}
293\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(int)}, or the encoding speed level is out of bounds. The maximum encoding speed level may be implementation-\/ and encoding mode-\/specific, and can be obtained via \doxyref{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}{p.}{theoraenc_8h_a9baf5bdd206e80c78a8fd44687e89783}. \item[{\em TH\_\-EIMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
294\index{theoraenc.h@{theoraenc.h}!TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE@{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}}
295\index{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE@{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}!theoraenc.h@{theoraenc.h}}
296\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE~(10)}\label{theoraenc_8h_a382d685a39a34d8e6ba76b00d804efd8}
297
298
299Disables any encoder features that would prevent lossless transcoding back to VP3. This primarily means disabling block-\/adaptive quantization and always coding all four luma blocks in a macro block when 4MV is used. It also includes using the VP3 quantization tables and Huffman codes; if you set them explicitly after calling this function, the resulting stream will not be VP3-\/compatible. If you enable VP3-\/compatibility when encoding 4:2:2 or 4:4:4 source material, or when using a picture region smaller than the full frame (e.g. a non-\/multiple-\/of-\/16 width or height), then non-\/VP3 bitstream features will still be disabled, but the stream will still not be VP3-\/compatible, as VP3 was not capable of encoding such formats. If you call this after encoding has already begun, then the quantization tables and codebooks cannot be changed, but the frame-\/level features will be enabled or disabled as requested.
300
301
302\begin{DoxyParams}{Parameters}
303\item[\mbox{$\leftarrow$} {\em \_\-buf}]{\ttfamily int}: a non-\/zero value to enable VP3 compatibility, or 0 to disable it (the default). \item[\mbox{$\rightarrow$} {\em \_\-buf}]{\ttfamily int}: 1 if all bitstream features required for VP3-\/compatibility could be set, and 0 otherwise. The latter will be returned if the pixel format is not 4:2:0, the picture region is smaller than the full frame, or if encoding has begun, preventing the quantization tables and codebooks from being set. \end{DoxyParams}
304
305\begin{DoxyRetVals}{Return values}
306\item[{\em TH\_\-EFAULT}]{\itshape \_\-enc\_\-ctx\/} or {\itshape \_\-buf\/} is {\ttfamily NULL}. \item[{\em TH\_\-EINVAL}]{\itshape \_\-buf\_\-sz\/} is not {\ttfamily sizeof(int)}. \item[{\em TH\_\-EIMPL}]Not supported by this implementation. \end{DoxyRetVals}
307\index{theoraenc.h@{theoraenc.h}!TH\_\-RATECTL\_\-CAP\_\-OVERFLOW@{TH\_\-RATECTL\_\-CAP\_\-OVERFLOW}}
308\index{TH\_\-RATECTL\_\-CAP\_\-OVERFLOW@{TH\_\-RATECTL\_\-CAP\_\-OVERFLOW}!theoraenc.h@{theoraenc.h}}
309\subsubsection[{TH\_\-RATECTL\_\-CAP\_\-OVERFLOW}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-RATECTL\_\-CAP\_\-OVERFLOW~(0x2)}\label{theoraenc_8h_a32f9983b344a431334493cefb0b9337c}
310
311
312Ignore bitrate buffer overflows. If the encoder uses so few bits that the reservoir of available bits overflows, ignore the excess. The encoder will not try to use these extra bits in future frames. At high rates this may cause the result to be undersized, but allows a client to play the stream using a finite buffer; it should normally be enabled. \index{theoraenc.h@{theoraenc.h}!TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW@{TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW}}
313\index{TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW@{TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW}!theoraenc.h@{theoraenc.h}}
314\subsubsection[{TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-RATECTL\_\-CAP\_\-UNDERFLOW~(0x4)}\label{theoraenc_8h_ad0d62d9dce542caf5296b03b97e020a6}
315
316
317Ignore bitrate buffer underflows. If the encoder uses so many bits that the reservoir of available bits underflows, ignore the deficit. The encoder will not try to make up these extra bits in future frames. At low rates this may cause the result to be oversized; it should normally be disabled. \index{theoraenc.h@{theoraenc.h}!TH\_\-RATECTL\_\-DROP\_\-FRAMES@{TH\_\-RATECTL\_\-DROP\_\-FRAMES}}
318\index{TH\_\-RATECTL\_\-DROP\_\-FRAMES@{TH\_\-RATECTL\_\-DROP\_\-FRAMES}!theoraenc.h@{theoraenc.h}}
319\subsubsection[{TH\_\-RATECTL\_\-DROP\_\-FRAMES}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-RATECTL\_\-DROP\_\-FRAMES~(0x1)}\label{theoraenc_8h_a3e7fab53b902b54135522ba286f45e33}
320
321
322Drop frames to keep within bitrate buffer constraints. This can have a severe impact on quality, but is the only way to ensure that bitrate targets are met at low rates during sudden bursts of activity.
323
324\subsection{Typedef Documentation}
325\index{theoraenc.h@{theoraenc.h}!th\_\-enc\_\-ctx@{th\_\-enc\_\-ctx}}
326\index{th\_\-enc\_\-ctx@{th\_\-enc\_\-ctx}!theoraenc.h@{theoraenc.h}}
327\subsubsection[{th\_\-enc\_\-ctx}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf th\_\-enc\_\-ctx} {\bf th\_\-enc\_\-ctx}}\label{theoraenc_8h_af5cc40472b925456d42526a035d66edd}
328
329
330The encoder context.
331
332\subsection{Variable Documentation}
333\index{theoraenc.h@{theoraenc.h}!TH\_\-VP31\_\-HUFF\_\-CODES@{TH\_\-VP31\_\-HUFF\_\-CODES}}
334\index{TH\_\-VP31\_\-HUFF\_\-CODES@{TH\_\-VP31\_\-HUFF\_\-CODES}!theoraenc.h@{theoraenc.h}}
335\subsubsection[{TH\_\-VP31\_\-HUFF\_\-CODES}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf th\_\-huff\_\-code} {\bf TH\_\-VP31\_\-HUFF\_\-CODES}[TH\_\-NHUFFMAN\_\-TABLES][TH\_\-NDCT\_\-TOKENS]}\label{theoraenc_8h_aee1f7cb1fa0d3b7cc1d4ca0f17e6ae5e}
336
337
338The Huffman tables used by VP3. \index{theoraenc.h@{theoraenc.h}!TH\_\-VP31\_\-QUANT\_\-INFO@{TH\_\-VP31\_\-QUANT\_\-INFO}}
339\index{TH\_\-VP31\_\-QUANT\_\-INFO@{TH\_\-VP31\_\-QUANT\_\-INFO}!theoraenc.h@{theoraenc.h}}
340\subsubsection[{TH\_\-VP31\_\-QUANT\_\-INFO}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf th\_\-quant\_\-info} {\bf TH\_\-VP31\_\-QUANT\_\-INFO}}\label{theoraenc_8h_a3b1b462989f4e7a5a98e6e697f1a7f7d}
341
342
343The quantization parameters used by VP3.