\section{Legacy pre-\/1.0 C API}
\label{group__oldfuncs}\index{Legacy pre-\/1.0 C API@{Legacy pre-\/1.0 C API}}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf yuv\_\-buffer}
\begin{DoxyCompactList}\small\item\em A YUV buffer for passing uncompressed frames to and from the codec. \item\end{DoxyCompactList}\item 
struct {\bf theora\_\-info}
\begin{DoxyCompactList}\small\item\em Theora bitstream info. \item\end{DoxyCompactList}\item 
struct {\bf theora\_\-state}
\begin{DoxyCompactList}\small\item\em Codec internal state and context. \item\end{DoxyCompactList}\item 
struct {\bf theora\_\-comment}
\begin{DoxyCompactList}\small\item\em Comment header metadata. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item 
file {\bf theora.h}


\begin{DoxyCompactList}\small\item\em The libtheora pre-\/1.0 legacy C API. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\#define {\bf OC\_\-FAULT}~-\/1
\begin{DoxyCompactList}\small\item\em General failure. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-EINVAL}~-\/10
\begin{DoxyCompactList}\small\item\em Library encountered invalid internal data. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-DISABLED}~-\/11
\begin{DoxyCompactList}\small\item\em Requested action is disabled. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-BADHEADER}~-\/20
\begin{DoxyCompactList}\small\item\em Header packet was corrupt/invalid. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-NOTFORMAT}~-\/21
\begin{DoxyCompactList}\small\item\em Packet is not a theora packet. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-VERSION}~-\/22
\begin{DoxyCompactList}\small\item\em Bitstream version is not handled. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-IMPL}~-\/23
\begin{DoxyCompactList}\small\item\em Feature or action not implemented. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-BADPACKET}~-\/24
\begin{DoxyCompactList}\small\item\em Packet is corrupt. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-NEWPACKET}~-\/25
\begin{DoxyCompactList}\small\item\em Packet is an (ignorable) unhandled extension. \item\end{DoxyCompactList}\item 
\#define {\bf OC\_\-DUPFRAME}~1
\begin{DoxyCompactList}\small\item\em Packet is a dropped frame. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum {\bf theora\_\-colorspace} \{ {\bf OC\_\-CS\_\-UNSPECIFIED}, 
{\bf OC\_\-CS\_\-ITU\_\-REC\_\-470M}, 
{\bf OC\_\-CS\_\-ITU\_\-REC\_\-470BG}, 
{\bf OC\_\-CS\_\-NSPACES}
 \}
\begin{DoxyCompactList}\small\item\em A Colorspace. \item\end{DoxyCompactList}\item 
enum {\bf theora\_\-pixelformat} \{ {\bf OC\_\-PF\_\-420}, 
{\bf OC\_\-PF\_\-RSVD}, 
{\bf OC\_\-PF\_\-422}, 
{\bf OC\_\-PF\_\-444}
 \}
\begin{DoxyCompactList}\small\item\em A Chroma subsampling. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
const char $\ast$ {\bf theora\_\-version\_\-string} (void)
\begin{DoxyCompactList}\small\item\em Retrieve a human-\/readable string to identify the encoder vendor and version. \item\end{DoxyCompactList}\item 
ogg\_\-uint32\_\-t {\bf theora\_\-version\_\-number} (void)
\begin{DoxyCompactList}\small\item\em Retrieve a 32-\/bit version number. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-encode\_\-init} ({\bf theora\_\-state} $\ast$th, {\bf theora\_\-info} $\ast$ti)
\begin{DoxyCompactList}\small\item\em Initialize the theora encoder. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-encode\_\-YUVin} ({\bf theora\_\-state} $\ast$t, {\bf yuv\_\-buffer} $\ast$yuv)
\begin{DoxyCompactList}\small\item\em Submit a YUV buffer to the theora encoder. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-encode\_\-packetout} ({\bf theora\_\-state} $\ast$t, int last\_\-p, ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Request the next packet of encoded video. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-encode\_\-header} ({\bf theora\_\-state} $\ast$t, ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Request a packet containing the initial header. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-encode\_\-comment} ({\bf theora\_\-comment} $\ast$tc, ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Request a comment header packet from provided metadata. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-encode\_\-tables} ({\bf theora\_\-state} $\ast$t, ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Request a packet containing the codebook tables for the stream. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-decode\_\-header} ({\bf theora\_\-info} $\ast$ci, {\bf theora\_\-comment} $\ast$cc, ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Decode an Ogg packet, with the expectation that the packet contains an initial header, comment data or codebook tables. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-decode\_\-init} ({\bf theora\_\-state} $\ast$th, {\bf theora\_\-info} $\ast$c)
\begin{DoxyCompactList}\small\item\em Initialize a \doxyref{theora\_\-state}{p.}{structtheora__state} handle for decoding. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-decode\_\-packetin} ({\bf theora\_\-state} $\ast$th, ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Input a packet containing encoded data into the theora decoder. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-decode\_\-YUVout} ({\bf theora\_\-state} $\ast$th, {\bf yuv\_\-buffer} $\ast$yuv)
\begin{DoxyCompactList}\small\item\em Output the next available frame of decoded YUV data. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-packet\_\-isheader} (ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Report whether a theora packet is a header or not This function does no verification beyond checking the header flag bit so it should not be used for bitstream identification; use \doxyref{theora\_\-decode\_\-header()}{p.}{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82} for that. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-packet\_\-iskeyframe} (ogg\_\-packet $\ast$op)
\begin{DoxyCompactList}\small\item\em Report whether a theora packet is a keyframe or not. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-granule\_\-shift} ({\bf theora\_\-info} $\ast$ti)
\begin{DoxyCompactList}\small\item\em Report the granulepos shift radix. \item\end{DoxyCompactList}\item 
ogg\_\-int64\_\-t {\bf theora\_\-granule\_\-frame} ({\bf theora\_\-state} $\ast$th, ogg\_\-int64\_\-t granulepos)
\begin{DoxyCompactList}\small\item\em Convert a granulepos to an absolute frame index, starting at 0. \item\end{DoxyCompactList}\item 
double {\bf theora\_\-granule\_\-time} ({\bf theora\_\-state} $\ast$th, ogg\_\-int64\_\-t granulepos)
\begin{DoxyCompactList}\small\item\em Convert a granulepos to absolute time in seconds. \item\end{DoxyCompactList}\item 
void {\bf theora\_\-info\_\-init} ({\bf theora\_\-info} $\ast$c)
\begin{DoxyCompactList}\small\item\em Initialize a \doxyref{theora\_\-info}{p.}{structtheora__info} structure. \item\end{DoxyCompactList}\item 
void {\bf theora\_\-info\_\-clear} ({\bf theora\_\-info} $\ast$c)
\begin{DoxyCompactList}\small\item\em Clear a \doxyref{theora\_\-info}{p.}{structtheora__info} structure. \item\end{DoxyCompactList}\item 
void {\bf theora\_\-clear} ({\bf theora\_\-state} $\ast$t)
\begin{DoxyCompactList}\small\item\em Free all internal data associated with a \doxyref{theora\_\-state}{p.}{structtheora__state} handle. \item\end{DoxyCompactList}\item 
void {\bf theora\_\-comment\_\-init} ({\bf theora\_\-comment} $\ast$tc)
\begin{DoxyCompactList}\small\item\em Initialize an allocated \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure. \item\end{DoxyCompactList}\item 
void {\bf theora\_\-comment\_\-add} ({\bf theora\_\-comment} $\ast$tc, char $\ast$comment)
\begin{DoxyCompactList}\small\item\em Add a comment to an initialized \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure. \item\end{DoxyCompactList}\item 
void {\bf theora\_\-comment\_\-add\_\-tag} ({\bf theora\_\-comment} $\ast$tc, char $\ast$tag, char $\ast$value)
\begin{DoxyCompactList}\small\item\em Add a comment to an initialized \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure. \item\end{DoxyCompactList}\item 
char $\ast$ {\bf theora\_\-comment\_\-query} ({\bf theora\_\-comment} $\ast$tc, char $\ast$tag, int count)
\begin{DoxyCompactList}\small\item\em Look up a comment value by tag. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-comment\_\-query\_\-count} ({\bf theora\_\-comment} $\ast$tc, char $\ast$tag)
\begin{DoxyCompactList}\small\item\em Look up the number of instances of a tag. \item\end{DoxyCompactList}\item 
void {\bf theora\_\-comment\_\-clear} ({\bf theora\_\-comment} $\ast$tc)
\begin{DoxyCompactList}\small\item\em Clear an allocated \doxyref{theora\_\-comment}{p.}{structtheora__comment} struct so that it can be freed. \item\end{DoxyCompactList}\item 
int {\bf theora\_\-control} ({\bf theora\_\-state} $\ast$th, int req, void $\ast$buf, size\_\-t buf\_\-sz)
\begin{DoxyCompactList}\small\item\em Encoder control function. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{theora\_\-control() codes}
\label{_amgrp13fd61986cff4566fe89a40e30b74ad9}
 \begin{DoxyCompactItemize}
\item 
\#define {\bf TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX}~(1)
\begin{DoxyCompactList}\small\item\em Get the maximum post-\/processing level. \item\end{DoxyCompactList}\item 
\#define {\bf TH\_\-DECCTL\_\-SET\_\-PPLEVEL}~(3)
\begin{DoxyCompactList}\small\item\em Set the post-\/processing level. \item\end{DoxyCompactList}\item 
\#define {\bf TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}~(4)
\begin{DoxyCompactList}\small\item\em Sets the maximum distance between key frames. \item\end{DoxyCompactList}\item 
\#define {\bf TH\_\-DECCTL\_\-SET\_\-GRANPOS}~(5)
\begin{DoxyCompactList}\small\item\em Set the granule position. \item\end{DoxyCompactList}\item 
\#define {\bf TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}~(2)
\begin{DoxyCompactList}\small\item\em Sets the quantization parameters to use. \item\end{DoxyCompactList}\item 
\#define {\bf TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}~(10)
\begin{DoxyCompactList}\small\item\em Disables any encoder features that would prevent lossless transcoding back to VP3. \item\end{DoxyCompactList}\item 
\#define {\bf TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}~(12)
\begin{DoxyCompactList}\small\item\em Gets the maximum speed level. \item\end{DoxyCompactList}\item 
\#define {\bf TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}~(14)
\begin{DoxyCompactList}\small\item\em Sets the speed level. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Define Documentation}
\index{oldfuncs@{oldfuncs}!OC\_\-BADHEADER@{OC\_\-BADHEADER}}
\index{OC\_\-BADHEADER@{OC\_\-BADHEADER}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-BADHEADER}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-BADHEADER~-\/20}\label{group__oldfuncs_ga809cbad2eb36be17a235a3cadfb737ba}


Header packet was corrupt/invalid. \index{oldfuncs@{oldfuncs}!OC\_\-BADPACKET@{OC\_\-BADPACKET}}
\index{OC\_\-BADPACKET@{OC\_\-BADPACKET}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-BADPACKET}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-BADPACKET~-\/24}\label{group__oldfuncs_ga117774c062a63dfad2a5b4d092fa2bb1}


Packet is corrupt. \index{oldfuncs@{oldfuncs}!OC\_\-DISABLED@{OC\_\-DISABLED}}
\index{OC\_\-DISABLED@{OC\_\-DISABLED}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-DISABLED}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-DISABLED~-\/11}\label{group__oldfuncs_ga38b9fa0af856d5930c534db26e2ac2d1}


Requested action is disabled. \index{oldfuncs@{oldfuncs}!OC\_\-DUPFRAME@{OC\_\-DUPFRAME}}
\index{OC\_\-DUPFRAME@{OC\_\-DUPFRAME}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-DUPFRAME}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-DUPFRAME~1}\label{group__oldfuncs_ga84a8d2f5080ad62b415a4e7551941cbb}


Packet is a dropped frame. \index{oldfuncs@{oldfuncs}!OC\_\-EINVAL@{OC\_\-EINVAL}}
\index{OC\_\-EINVAL@{OC\_\-EINVAL}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-EINVAL}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-EINVAL~-\/10}\label{group__oldfuncs_ga43d15091b1a03a734a124e9a04d3be55}


Library encountered invalid internal data. \index{oldfuncs@{oldfuncs}!OC\_\-FAULT@{OC\_\-FAULT}}
\index{OC\_\-FAULT@{OC\_\-FAULT}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-FAULT}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-FAULT~-\/1}\label{group__oldfuncs_gaa4370e13ed3aea6441ccf69dcab2506e}


General failure. \index{oldfuncs@{oldfuncs}!OC\_\-IMPL@{OC\_\-IMPL}}
\index{OC\_\-IMPL@{OC\_\-IMPL}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-IMPL}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-IMPL~-\/23}\label{group__oldfuncs_ga895dc2597b3bf9c97bf7701c6eff5b0c}


Feature or action not implemented. \index{oldfuncs@{oldfuncs}!OC\_\-NEWPACKET@{OC\_\-NEWPACKET}}
\index{OC\_\-NEWPACKET@{OC\_\-NEWPACKET}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-NEWPACKET}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-NEWPACKET~-\/25}\label{group__oldfuncs_ga60be4dc92c933eac3542bce3ce076496}


Packet is an (ignorable) unhandled extension. \index{oldfuncs@{oldfuncs}!OC\_\-NOTFORMAT@{OC\_\-NOTFORMAT}}
\index{OC\_\-NOTFORMAT@{OC\_\-NOTFORMAT}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-NOTFORMAT}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-NOTFORMAT~-\/21}\label{group__oldfuncs_ga9558d6d9eacd2273c8da27f945d725ad}


Packet is not a theora packet. \index{oldfuncs@{oldfuncs}!OC\_\-VERSION@{OC\_\-VERSION}}
\index{OC\_\-VERSION@{OC\_\-VERSION}!oldfuncs@{oldfuncs}}
\subsubsection[{OC\_\-VERSION}]{\setlength{\rightskip}{0pt plus 5cm}\#define OC\_\-VERSION~-\/22}\label{group__oldfuncs_ga4611cfd61160405721d1e2ab0ec2564b}


Bitstream version is not handled. \index{oldfuncs@{oldfuncs}!TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX@{TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX}}
\index{TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX@{TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX~(1)}\label{group__oldfuncs_gab31f251c9319f2140d247585d30b3d07}


Get the maximum post-\/processing level. The decoder supports a post-\/processing filter that can improve the appearance of the decoded images. This returns the highest level setting for this post-\/processor, corresponding to maximum improvement and computational expense. \index{oldfuncs@{oldfuncs}!TH\_\-DECCTL\_\-SET\_\-GRANPOS@{TH\_\-DECCTL\_\-SET\_\-GRANPOS}}
\index{TH\_\-DECCTL\_\-SET\_\-GRANPOS@{TH\_\-DECCTL\_\-SET\_\-GRANPOS}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-DECCTL\_\-SET\_\-GRANPOS}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-DECCTL\_\-SET\_\-GRANPOS~(5)}\label{group__oldfuncs_ga1e870c654d35394f0d490045df04e0f5}


Set the granule position. Call this after a seek, to update the internal granulepos in the decoder, to insure that subsequent frames are marked properly. If you track timestamps yourself and do not use the granule postion returned by the decoder, then you do not need to use this control. \index{oldfuncs@{oldfuncs}!TH\_\-DECCTL\_\-SET\_\-PPLEVEL@{TH\_\-DECCTL\_\-SET\_\-PPLEVEL}}
\index{TH\_\-DECCTL\_\-SET\_\-PPLEVEL@{TH\_\-DECCTL\_\-SET\_\-PPLEVEL}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-DECCTL\_\-SET\_\-PPLEVEL}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-DECCTL\_\-SET\_\-PPLEVEL~(3)}\label{group__oldfuncs_ga87774c35e1a755a84e2d705b38ebef0d}


Set the post-\/processing level. Sets the level of post-\/processing to use when decoding the compressed stream. This must be a value between zero (off) and the maximum returned by TH\_\-DECCTL\_\-GET\_\-PPLEVEL\_\-MAX. \index{oldfuncs@{oldfuncs}!TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX@{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}}
\index{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX@{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-GET\_\-SPLEVEL\_\-MAX~(12)}\label{group__oldfuncs_ga9baf5bdd206e80c78a8fd44687e89783}


Gets 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. CQI, etc.).


\begin{DoxyParams}{Parameters}
\item[\mbox{$\rightarrow$} {\em buf}]int: The maximum encoding speed level. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em OC\_\-FAULT}]{\itshape \doxyref{theora\_\-state}{p.}{structtheora__state}\/} or {\itshape buf\/} is {\ttfamily NULL}. \item[{\em OC\_\-EINVAL}]{\itshape buf\_\-sz\/} is not {\ttfamily sizeof(int)}. \item[{\em OC\_\-IMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE@{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}}
\index{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE@{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE~(4)}\label{group__oldfuncs_ga27e755e15b4b5604c54974b304037a49}


Sets 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.


\begin{DoxyParams}{Parameters}
\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}

\begin{DoxyRetVals}{Return values}
\item[{\em OC\_\-FAULT}]{\itshape \doxyref{theora\_\-state}{p.}{structtheora__state}\/} or {\itshape buf\/} is {\ttfamily NULL}. \item[{\em OC\_\-EINVAL}]{\itshape buf\_\-sz\/} is not {\ttfamily sizeof(ogg\_\-uint32\_\-t)}. \item[{\em OC\_\-IMPL}]Not supported by this implementation. \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS@{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}}
\index{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS@{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-QUANT\_\-PARAMS~(2)}\label{group__oldfuncs_ga3befcdd66678f8d27034f9c4b16d1b9c}


Sets the quantization parameters to use. \label{group__oldfuncs_encctlcodes_old}
 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.


\begin{DoxyParams}{Parameters}
\item[\mbox{$\leftarrow$} {\em buf}]\doxyref{th\_\-quant\_\-info}{p.}{structth__quant__info} \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em OC\_\-FAULT}]{\itshape \doxyref{theora\_\-state}{p.}{structtheora__state}\/} is {\ttfamily NULL}. \item[{\em OC\_\-EINVAL}]Encoding has already begun, the quantization parameters are not acceptable to this version of the encoder, {\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 OC\_\-IMPL}]Not supported by this implementation. \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!TH\_\-ENCCTL\_\-SET\_\-SPLEVEL@{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}}
\index{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL@{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-SPLEVEL}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-SPLEVEL~(14)}\label{group__oldfuncs_gabd9fbcb6a25a77d991d3620164fe59d6}


Sets the speed level. By default a speed value of 1 is used.


\begin{DoxyParams}{Parameters}
\item[\mbox{$\leftarrow$} {\em buf}]int: The new encoding speed level. 0 is slowest, larger values use less CPU. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em OC\_\-FAULT}]{\itshape \doxyref{theora\_\-state}{p.}{structtheora__state}\/} or {\itshape buf\/} is {\ttfamily NULL}. \item[{\em OC\_\-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 OC\_\-IMPL}]Not supported by this implementation in the current encoding mode. \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE@{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}}
\index{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE@{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}!oldfuncs@{oldfuncs}}
\subsubsection[{TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE}]{\setlength{\rightskip}{0pt plus 5cm}\#define TH\_\-ENCCTL\_\-SET\_\-VP3\_\-COMPATIBLE~(10)}\label{group__oldfuncs_ga382d685a39a34d8e6ba76b00d804efd8}


Disables any encoder features that would prevent lossless transcoding back to VP3. This primarily means disabling block-\/level QI values and not using 4MV mode when any of the luma blocks in a macro block are not coded. 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.


\begin{DoxyParams}{Parameters}
\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}

\begin{DoxyRetVals}{Return values}
\item[{\em OC\_\-FAULT}]{\itshape \doxyref{theora\_\-state}{p.}{structtheora__state}\/} or {\itshape buf\/} is {\ttfamily NULL}. \item[{\em OC\_\-EINVAL}]{\itshape buf\_\-sz\/} is not {\ttfamily sizeof(int)}. \item[{\em OC\_\-IMPL}]Not supported by this implementation. \end{DoxyRetVals}


\subsection{Enumeration Type Documentation}
\index{oldfuncs@{oldfuncs}!theora\_\-colorspace@{theora\_\-colorspace}}
\index{theora\_\-colorspace@{theora\_\-colorspace}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-colorspace}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf theora\_\-colorspace}}\label{group__oldfuncs_gaa567da4ce591f7373149ce3ef3acdac9}


A Colorspace. \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{OC\_\-CS\_\-UNSPECIFIED@{OC\_\-CS\_\-UNSPECIFIED}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-CS\_\-UNSPECIFIED@{OC\_\-CS\_\-UNSPECIFIED}}\item[{\em 
OC\_\-CS\_\-UNSPECIFIED\label{group__oldfuncs_ggaa567da4ce591f7373149ce3ef3acdac9abf217cf83d7d7cbf73295e6689f5cf5f}
}]The colorspace is unknown or unspecified. \index{OC\_\-CS\_\-ITU\_\-REC\_\-470M@{OC\_\-CS\_\-ITU\_\-REC\_\-470M}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-CS\_\-ITU\_\-REC\_\-470M@{OC\_\-CS\_\-ITU\_\-REC\_\-470M}}\item[{\em 
OC\_\-CS\_\-ITU\_\-REC\_\-470M\label{group__oldfuncs_ggaa567da4ce591f7373149ce3ef3acdac9ab20c9851a21ab148fef0bf2c00c0a294}
}]This is the best option for 'NTSC' content. \index{OC\_\-CS\_\-ITU\_\-REC\_\-470BG@{OC\_\-CS\_\-ITU\_\-REC\_\-470BG}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-CS\_\-ITU\_\-REC\_\-470BG@{OC\_\-CS\_\-ITU\_\-REC\_\-470BG}}\item[{\em 
OC\_\-CS\_\-ITU\_\-REC\_\-470BG\label{group__oldfuncs_ggaa567da4ce591f7373149ce3ef3acdac9a04f8fa2da26f9ec513f514163705666a}
}]This is the best option for 'PAL' content. \index{OC\_\-CS\_\-NSPACES@{OC\_\-CS\_\-NSPACES}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-CS\_\-NSPACES@{OC\_\-CS\_\-NSPACES}}\item[{\em 
OC\_\-CS\_\-NSPACES\label{group__oldfuncs_ggaa567da4ce591f7373149ce3ef3acdac9a640b572f11fa7102d434e1c605aaa186}
}]This marks the end of the defined colorspaces. \end{description}
\end{Desc}

\index{oldfuncs@{oldfuncs}!theora\_\-pixelformat@{theora\_\-pixelformat}}
\index{theora\_\-pixelformat@{theora\_\-pixelformat}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-pixelformat}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf theora\_\-pixelformat}}\label{group__oldfuncs_gae169da05bfaaf4e964a6866552d45079}


A Chroma subsampling. These enumerate the available chroma subsampling options supported by the theora format. See Section 4.4 of the specification for exact definitions. \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{OC\_\-PF\_\-420@{OC\_\-PF\_\-420}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-PF\_\-420@{OC\_\-PF\_\-420}}\item[{\em 
OC\_\-PF\_\-420\label{group__oldfuncs_ggae169da05bfaaf4e964a6866552d45079a4e451af01be2645511b0e431f5225d2b}
}]Chroma subsampling by 2 in each direction (4:2:0). \index{OC\_\-PF\_\-RSVD@{OC\_\-PF\_\-RSVD}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-PF\_\-RSVD@{OC\_\-PF\_\-RSVD}}\item[{\em 
OC\_\-PF\_\-RSVD\label{group__oldfuncs_ggae169da05bfaaf4e964a6866552d45079a7d21c63341ad299766839c83ed1216eb}
}]Reserved value. \index{OC\_\-PF\_\-422@{OC\_\-PF\_\-422}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-PF\_\-422@{OC\_\-PF\_\-422}}\item[{\em 
OC\_\-PF\_\-422\label{group__oldfuncs_ggae169da05bfaaf4e964a6866552d45079a36a88c55b7ddd5aedeac2d61d57fee5b}
}]Horizonatal chroma subsampling by 2 (4:2:2). \index{OC\_\-PF\_\-444@{OC\_\-PF\_\-444}!oldfuncs@{oldfuncs}}\index{oldfuncs@{oldfuncs}!OC\_\-PF\_\-444@{OC\_\-PF\_\-444}}\item[{\em 
OC\_\-PF\_\-444\label{group__oldfuncs_ggae169da05bfaaf4e964a6866552d45079a1d5c6d1b0365e06b4a87880b7825f044}
}]No chroma subsampling at all (4:4:4). \end{description}
\end{Desc}



\subsection{Function Documentation}
\index{oldfuncs@{oldfuncs}!theora\_\-clear@{theora\_\-clear}}
\index{theora\_\-clear@{theora\_\-clear}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-clear}]{\setlength{\rightskip}{0pt plus 5cm}void theora\_\-clear ({\bf theora\_\-state} $\ast$ {\em t})}\label{group__oldfuncs_gab252d5d81b925136dda72e8f1c09c5eb}


Free all internal data associated with a \doxyref{theora\_\-state}{p.}{structtheora__state} handle. 
\begin{DoxyParams}{Parameters}
\item[{\em t}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle. \end{DoxyParams}
\index{oldfuncs@{oldfuncs}!theora\_\-comment\_\-add@{theora\_\-comment\_\-add}}
\index{theora\_\-comment\_\-add@{theora\_\-comment\_\-add}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-comment\_\-add}]{\setlength{\rightskip}{0pt plus 5cm}void theora\_\-comment\_\-add ({\bf theora\_\-comment} $\ast$ {\em tc}, \/  char $\ast$ {\em comment})}\label{group__oldfuncs_ga650642ed23894e41109bbc42ec393ed4}


Add a comment to an initialized \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure. 
\begin{DoxyParams}{Parameters}
\item[{\em tc}]A previously initialized theora comment structure \item[{\em comment}]A null-\/terminated string encoding the comment in the form \char`\"{}TAG=the value\char`\"{}\end{DoxyParams}
Neither \doxyref{theora\_\-comment\_\-add()}{p.}{group__oldfuncs_ga650642ed23894e41109bbc42ec393ed4} nor \doxyref{theora\_\-comment\_\-add\_\-tag()}{p.}{group__oldfuncs_ga339bd80b5bf4bb168b7052d8ec0b5a92} support comments containing null values, although the bitstream format supports this. To add such comments you will need to manipulate the \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure directly. \index{oldfuncs@{oldfuncs}!theora\_\-comment\_\-add\_\-tag@{theora\_\-comment\_\-add\_\-tag}}
\index{theora\_\-comment\_\-add\_\-tag@{theora\_\-comment\_\-add\_\-tag}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-comment\_\-add\_\-tag}]{\setlength{\rightskip}{0pt plus 5cm}void theora\_\-comment\_\-add\_\-tag ({\bf theora\_\-comment} $\ast$ {\em tc}, \/  char $\ast$ {\em tag}, \/  char $\ast$ {\em value})}\label{group__oldfuncs_ga339bd80b5bf4bb168b7052d8ec0b5a92}


Add a comment to an initialized \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure. 
\begin{DoxyParams}{Parameters}
\item[{\em tc}]A previously initialized theora comment structure \item[{\em tag}]A null-\/terminated string containing the tag associated with the comment. \item[{\em value}]The corresponding value as a null-\/terminated string\end{DoxyParams}
Neither \doxyref{theora\_\-comment\_\-add()}{p.}{group__oldfuncs_ga650642ed23894e41109bbc42ec393ed4} nor \doxyref{theora\_\-comment\_\-add\_\-tag()}{p.}{group__oldfuncs_ga339bd80b5bf4bb168b7052d8ec0b5a92} support comments containing null values, although the bitstream format supports this. To add such comments you will need to manipulate the \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure directly. \index{oldfuncs@{oldfuncs}!theora\_\-comment\_\-clear@{theora\_\-comment\_\-clear}}
\index{theora\_\-comment\_\-clear@{theora\_\-comment\_\-clear}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-comment\_\-clear}]{\setlength{\rightskip}{0pt plus 5cm}void theora\_\-comment\_\-clear ({\bf theora\_\-comment} $\ast$ {\em tc})}\label{group__oldfuncs_ga04c07c2eefba3a433e43f9fbde14719f}


Clear an allocated \doxyref{theora\_\-comment}{p.}{structtheora__comment} struct so that it can be freed. 
\begin{DoxyParams}{Parameters}
\item[{\em tc}]An allocated \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure. \end{DoxyParams}
\index{oldfuncs@{oldfuncs}!theora\_\-comment\_\-init@{theora\_\-comment\_\-init}}
\index{theora\_\-comment\_\-init@{theora\_\-comment\_\-init}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-comment\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void theora\_\-comment\_\-init ({\bf theora\_\-comment} $\ast$ {\em tc})}\label{group__oldfuncs_ga811b92785df3bdbbebb3de612d9d6ce0}


Initialize an allocated \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure. 
\begin{DoxyParams}{Parameters}
\item[{\em tc}]An allocated \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure \end{DoxyParams}
\index{oldfuncs@{oldfuncs}!theora\_\-comment\_\-query@{theora\_\-comment\_\-query}}
\index{theora\_\-comment\_\-query@{theora\_\-comment\_\-query}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-comment\_\-query}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ theora\_\-comment\_\-query ({\bf theora\_\-comment} $\ast$ {\em tc}, \/  char $\ast$ {\em tag}, \/  int {\em count})}\label{group__oldfuncs_ga4361f6001abb5c83c36a2ddfb648a8dc}


Look up a comment value by tag. 
\begin{DoxyParams}{Parameters}
\item[{\em tc}]Tn initialized \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure \item[{\em tag}]The tag to look up \item[{\em count}]The instance of the tag. The same tag can appear multiple times, each with a distinct and ordered value, so an index is required to retrieve them all. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the queried tag's value 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
\item[{\em NULL}]No matching tag is found\end{DoxyRetVals}
\begin{DoxyNote}{Note}
Use \doxyref{theora\_\-comment\_\-query\_\-count()}{p.}{group__oldfuncs_ga10f66a3c752442a3e0c0098e0f88df8b} to get the legal range for the count parameter. 
\end{DoxyNote}
\index{oldfuncs@{oldfuncs}!theora\_\-comment\_\-query\_\-count@{theora\_\-comment\_\-query\_\-count}}
\index{theora\_\-comment\_\-query\_\-count@{theora\_\-comment\_\-query\_\-count}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-comment\_\-query\_\-count}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-comment\_\-query\_\-count ({\bf theora\_\-comment} $\ast$ {\em tc}, \/  char $\ast$ {\em tag})}\label{group__oldfuncs_ga10f66a3c752442a3e0c0098e0f88df8b}


Look up the number of instances of a tag. 
\begin{DoxyParams}{Parameters}
\item[{\em tc}]An initialized \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure \item[{\em tag}]The tag to look up \end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number on instances of a particular tag.
\end{DoxyReturn}
Call this first when querying for a specific tag and then interate over the number of instances with separate calls to \doxyref{theora\_\-comment\_\-query()}{p.}{group__oldfuncs_ga4361f6001abb5c83c36a2ddfb648a8dc} to retrieve all instances in order. \index{oldfuncs@{oldfuncs}!theora\_\-control@{theora\_\-control}}
\index{theora\_\-control@{theora\_\-control}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-control}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-control ({\bf theora\_\-state} $\ast$ {\em th}, \/  int {\em req}, \/  void $\ast$ {\em buf}, \/  size\_\-t {\em buf\_\-sz})}\label{group__oldfuncs_ga186773db3bc8cd550047e7df1b2ba2c9}


Encoder control function. This is used to provide advanced control the encoding process. 
\begin{DoxyParams}{Parameters}
\item[{\em th}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle. \item[{\em req}]The control code to process. See \doxyref{the list of available }{p.}{group__oldfuncs_encctlcodes_old} control codes for details. \item[{\em buf}]The parameters for this control code. \item[{\em buf\_\-sz}]The size of the parameter buffer. \end{DoxyParams}
\index{oldfuncs@{oldfuncs}!theora\_\-decode\_\-header@{theora\_\-decode\_\-header}}
\index{theora\_\-decode\_\-header@{theora\_\-decode\_\-header}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-decode\_\-header}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-decode\_\-header ({\bf theora\_\-info} $\ast$ {\em ci}, \/  {\bf theora\_\-comment} $\ast$ {\em cc}, \/  ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82}


Decode an Ogg packet, with the expectation that the packet contains an initial header, comment data or codebook tables. 
\begin{DoxyParams}{Parameters}
\item[{\em ci}]A \doxyref{theora\_\-info}{p.}{structtheora__info} structure to fill. This must have been previously initialized with \doxyref{theora\_\-info\_\-init()}{p.}{group__oldfuncs_ga3091c87d48f1faba018c5956379a6d90}. If {\itshape op\/} contains an initial header, \doxyref{theora\_\-decode\_\-header()}{p.}{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82} will fill {\itshape ci\/} with the parsed header values. If {\itshape op\/} contains codebook tables, \doxyref{theora\_\-decode\_\-header()}{p.}{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82} will parse these and attach an internal representation to {\itshape ci-\/$>$codec\_\-setup\/}. \item[{\em cc}]A \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure to fill. If {\itshape op\/} contains comment data, \doxyref{theora\_\-decode\_\-header()}{p.}{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82} will fill {\itshape cc\/} with the parsed comments. \item[{\em op}]An ogg\_\-packet structure which you expect contains an initial header, comment data or codebook tables.\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em OC\_\-BADHEADER}]{\itshape op\/} is NULL; OR the first byte of {\itshape op-\/$>$packet\/} has the signature of an initial packet, but op is not a b\_\-o\_\-s packet; OR this packet has the signature of an initial header packet, but an initial header packet has already been seen; OR this packet has the signature of a comment packet, but the initial header has not yet been seen; OR this packet has the signature of a comment packet, but contains invalid data; OR this packet has the signature of codebook tables, but the initial header or comments have not yet been seen; OR this packet has the signature of codebook tables, but contains invalid data; OR the stream being decoded has a compatible version but this packet does not have the signature of a theora initial header, comments, or codebook packet \item[{\em OC\_\-VERSION}]The packet data of {\itshape op\/} is an initial header with a version which is incompatible with this version of libtheora. \item[{\em OC\_\-NEWPACKET}]the stream being decoded has an incompatible (future) version and contains an unknown signature. \item[{\em 0}]Success\end{DoxyRetVals}
\begin{DoxyNote}{Note}
The normal usage is that \doxyref{theora\_\-decode\_\-header()}{p.}{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82} be called on the first three packets of a theora logical bitstream in succession. 
\end{DoxyNote}
\index{oldfuncs@{oldfuncs}!theora\_\-decode\_\-init@{theora\_\-decode\_\-init}}
\index{theora\_\-decode\_\-init@{theora\_\-decode\_\-init}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-decode\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-decode\_\-init ({\bf theora\_\-state} $\ast$ {\em th}, \/  {\bf theora\_\-info} $\ast$ {\em c})}\label{group__oldfuncs_ga264907c66003799ff77ecbd09eb33d2c}


Initialize a \doxyref{theora\_\-state}{p.}{structtheora__state} handle for decoding. 
\begin{DoxyParams}{Parameters}
\item[{\em th}]The \doxyref{theora\_\-state}{p.}{structtheora__state} handle to initialize. \item[{\em c}]A \doxyref{theora\_\-info}{p.}{structtheora__info} struct filled with the desired decoding parameters. This is of course usually obtained from a previous call to \doxyref{theora\_\-decode\_\-header()}{p.}{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82}. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-decode\_\-packetin@{theora\_\-decode\_\-packetin}}
\index{theora\_\-decode\_\-packetin@{theora\_\-decode\_\-packetin}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-decode\_\-packetin}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-decode\_\-packetin ({\bf theora\_\-state} $\ast$ {\em th}, \/  ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_gaa65a9e53b46fd54ab344bd599fa96975}


Input a packet containing encoded data into the theora decoder. 
\begin{DoxyParams}{Parameters}
\item[{\em th}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle previously initialized for decoding. \item[{\em op}]An ogg\_\-packet containing encoded theora data. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]Success \item[{\em OC\_\-BADPACKET}]{\itshape op\/} does not contain encoded video data \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-decode\_\-YUVout@{theora\_\-decode\_\-YUVout}}
\index{theora\_\-decode\_\-YUVout@{theora\_\-decode\_\-YUVout}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-decode\_\-YUVout}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-decode\_\-YUVout ({\bf theora\_\-state} $\ast$ {\em th}, \/  {\bf yuv\_\-buffer} $\ast$ {\em yuv})}\label{group__oldfuncs_ga09d47c80e1e94bff0a46a496816b8daa}


Output the next available frame of decoded YUV data. 
\begin{DoxyParams}{Parameters}
\item[{\em th}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle previously initialized for decoding. \item[{\em yuv}]A \doxyref{yuv\_\-buffer}{p.}{structyuv__buffer} in which libtheora should place the decoded data. Note that the buffer struct itself is allocated by the user, but that the luma and chroma pointers will be filled in by the library. Also note that these luma and chroma regions should be considered read-\/only by the user. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-encode\_\-comment@{theora\_\-encode\_\-comment}}
\index{theora\_\-encode\_\-comment@{theora\_\-encode\_\-comment}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-encode\_\-comment}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-encode\_\-comment ({\bf theora\_\-comment} $\ast$ {\em tc}, \/  ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_ga45e8db0713eaaca0f1144f3724cb834a}


Request a comment header packet from provided metadata. A pointer to the comment data is placed in a user-\/provided ogg\_\-packet structure. 
\begin{DoxyParams}{Parameters}
\item[{\em tc}]A \doxyref{theora\_\-comment}{p.}{structtheora__comment} structure filled with the desired metadata \item[{\em op}]An ogg\_\-packet structure to fill. libtheora will set all elements of this structure, including a pointer to the encoded comment data. The memory for the comment data is owned by libtheora. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-encode\_\-header@{theora\_\-encode\_\-header}}
\index{theora\_\-encode\_\-header@{theora\_\-encode\_\-header}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-encode\_\-header}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-encode\_\-header ({\bf theora\_\-state} $\ast$ {\em t}, \/  ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_ga451feb58d6bde726edbae193689887be}


Request a packet containing the initial header. A pointer to the header data is placed in a user-\/provided ogg\_\-packet structure. 
\begin{DoxyParams}{Parameters}
\item[{\em t}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle previously initialized for encoding. \item[{\em op}]An ogg\_\-packet structure to fill. libtheora will set all elements of this structure, including a pointer to the header data. The memory for the header data is owned by libtheora. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-encode\_\-init@{theora\_\-encode\_\-init}}
\index{theora\_\-encode\_\-init@{theora\_\-encode\_\-init}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-encode\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-encode\_\-init ({\bf theora\_\-state} $\ast$ {\em th}, \/  {\bf theora\_\-info} $\ast$ {\em ti})}\label{group__oldfuncs_ga0f7ad4d4b2343278cb4ba8fb2bd5109a}


Initialize the theora encoder. 
\begin{DoxyParams}{Parameters}
\item[{\em th}]The \doxyref{theora\_\-state}{p.}{structtheora__state} handle to initialize for encoding. \item[{\em ti}]A \doxyref{theora\_\-info}{p.}{structtheora__info} struct filled with the desired encoding parameters. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-encode\_\-packetout@{theora\_\-encode\_\-packetout}}
\index{theora\_\-encode\_\-packetout@{theora\_\-encode\_\-packetout}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-encode\_\-packetout}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-encode\_\-packetout ({\bf theora\_\-state} $\ast$ {\em t}, \/  int {\em last\_\-p}, \/  ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_ga5f4929677a735bc2198c2309d235f1b3}


Request the next packet of encoded video. The encoded data is placed in a user-\/provided ogg\_\-packet structure. 
\begin{DoxyParams}{Parameters}
\item[{\em t}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle previously initialized for encoding. \item[{\em last\_\-p}]whether this is the last packet the encoder should produce. \item[{\em op}]An ogg\_\-packet structure to fill. libtheora will set all elements of this structure, including a pointer to encoded data. The memory for the encoded data is owned by libtheora. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]No internal storage exists OR no packet is ready \item[{\em -\/1}]The encoding process has completed \item[{\em 1}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-encode\_\-tables@{theora\_\-encode\_\-tables}}
\index{theora\_\-encode\_\-tables@{theora\_\-encode\_\-tables}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-encode\_\-tables}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-encode\_\-tables ({\bf theora\_\-state} $\ast$ {\em t}, \/  ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_ga5085baf20855b283fa01fc948505d9d2}


Request a packet containing the codebook tables for the stream. A pointer to the codebook data is placed in a user-\/provided ogg\_\-packet structure. 
\begin{DoxyParams}{Parameters}
\item[{\em t}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle previously initialized for encoding. \item[{\em op}]An ogg\_\-packet structure to fill. libtheora will set all elements of this structure, including a pointer to the codebook data. The memory for the header data is owned by libtheora. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 0}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-encode\_\-YUVin@{theora\_\-encode\_\-YUVin}}
\index{theora\_\-encode\_\-YUVin@{theora\_\-encode\_\-YUVin}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-encode\_\-YUVin}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-encode\_\-YUVin ({\bf theora\_\-state} $\ast$ {\em t}, \/  {\bf yuv\_\-buffer} $\ast$ {\em yuv})}\label{group__oldfuncs_gac0d33d896ca70cedfc94c5986d947078}


Submit a YUV buffer to the theora encoder. 
\begin{DoxyParams}{Parameters}
\item[{\em t}]A \doxyref{theora\_\-state}{p.}{structtheora__state} handle previously initialized for encoding. \item[{\em yuv}]A buffer of YUV data to encode. Note that both the \doxyref{yuv\_\-buffer}{p.}{structyuv__buffer} struct and the luma/chroma buffers within should be allocated by the user. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em OC\_\-EINVAL}]Encoder is not ready, or is finished. \item[{\em -\/1}]The size of the given frame differs from those previously input \item[{\em 0}]Success \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-granule\_\-frame@{theora\_\-granule\_\-frame}}
\index{theora\_\-granule\_\-frame@{theora\_\-granule\_\-frame}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-granule\_\-frame}]{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-int64\_\-t theora\_\-granule\_\-frame ({\bf theora\_\-state} $\ast$ {\em th}, \/  ogg\_\-int64\_\-t {\em granulepos})}\label{group__oldfuncs_ga7bfa3ceb2fb4b41a282456c56e1dd269}


Convert a granulepos to an absolute frame index, starting at 0. The granulepos is interpreted in the context of a given \doxyref{theora\_\-state}{p.}{structtheora__state} handle.

Note that while the granulepos encodes the frame count (i.e. starting from 1) this call returns the frame index, starting from zero. Thus One can calculate the presentation time by multiplying the index by the rate.


\begin{DoxyParams}{Parameters}
\item[{\em th}]A previously initialized \doxyref{theora\_\-state}{p.}{structtheora__state} handle (encode or decode) \item[{\em granulepos}]The granulepos to convert. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
The frame index corresponding to {\itshape granulepos\/}. 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
\item[{\em -\/1}]The given granulepos is undefined (i.e. negative)\end{DoxyRetVals}
Thus function was added in the 1.0alpha4 release. \index{oldfuncs@{oldfuncs}!theora\_\-granule\_\-shift@{theora\_\-granule\_\-shift}}
\index{theora\_\-granule\_\-shift@{theora\_\-granule\_\-shift}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-granule\_\-shift}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-granule\_\-shift ({\bf theora\_\-info} $\ast$ {\em ti})}\label{group__oldfuncs_gacd9360e6a47139c761002410af457a02}


Report the granulepos shift radix. When embedded in Ogg, Theora uses a two-\/part granulepos, splitting the 64-\/bit field into two pieces. The more-\/significant section represents the frame count at the last keyframe, and the less-\/significant section represents the count of frames since the last keyframe. In this way the overall field is still non-\/decreasing with time, but usefully encodes a pointer to the last keyframe, which is necessary for correctly restarting decode after a seek.

This function reports the number of bits used to represent the distance to the last keyframe, and thus how the granulepos field must be shifted or masked to obtain the two parts.

Since libtheora returns compressed data in an ogg\_\-packet structure, this may be generally useful even if the Theora packets are not being used in an Ogg container.


\begin{DoxyParams}{Parameters}
\item[{\em ti}]A previously initialized \doxyref{theora\_\-info}{p.}{structtheora__info} struct \end{DoxyParams}
\begin{DoxyReturn}{Returns}
The bit shift dividing the two granulepos fields
\end{DoxyReturn}
This function was added in the 1.0alpha5 release. \index{oldfuncs@{oldfuncs}!theora\_\-granule\_\-time@{theora\_\-granule\_\-time}}
\index{theora\_\-granule\_\-time@{theora\_\-granule\_\-time}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-granule\_\-time}]{\setlength{\rightskip}{0pt plus 5cm}double theora\_\-granule\_\-time ({\bf theora\_\-state} $\ast$ {\em th}, \/  ogg\_\-int64\_\-t {\em granulepos})}\label{group__oldfuncs_ga4376358b12b9fa23ce6fe21cb5c65ac6}


Convert a granulepos to absolute time in seconds. The granulepos is interpreted in the context of a given \doxyref{theora\_\-state}{p.}{structtheora__state} handle, and gives the end time of a frame's presentation as used in Ogg mux ordering.


\begin{DoxyParams}{Parameters}
\item[{\em th}]A previously initialized \doxyref{theora\_\-state}{p.}{structtheora__state} handle (encode or decode) \item[{\em granulepos}]The granulepos to convert. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
The absolute time in seconds corresponding to {\itshape granulepos\/}. This is the \char`\"{}end time\char`\"{} for the frame, or the latest time it should be displayed. It is not the presentation time. 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
\item[{\em -\/1.}]The given granulepos is undefined (i.e. negative), or \item[{\em -\/1.}]The function has been disabled because floating point support is not available. \end{DoxyRetVals}
\index{oldfuncs@{oldfuncs}!theora\_\-info\_\-clear@{theora\_\-info\_\-clear}}
\index{theora\_\-info\_\-clear@{theora\_\-info\_\-clear}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-info\_\-clear}]{\setlength{\rightskip}{0pt plus 5cm}void theora\_\-info\_\-clear ({\bf theora\_\-info} $\ast$ {\em c})}\label{group__oldfuncs_gaba7022d58edbc4825cacad03f68b3e0d}


Clear a \doxyref{theora\_\-info}{p.}{structtheora__info} structure. All values within the given \doxyref{theora\_\-info}{p.}{structtheora__info} structure are cleared, and associated internal codec setup data is freed. 
\begin{DoxyParams}{Parameters}
\item[{\em c}]A \doxyref{theora\_\-info}{p.}{structtheora__info} struct to initialize. \end{DoxyParams}
\index{oldfuncs@{oldfuncs}!theora\_\-info\_\-init@{theora\_\-info\_\-init}}
\index{theora\_\-info\_\-init@{theora\_\-info\_\-init}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-info\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void theora\_\-info\_\-init ({\bf theora\_\-info} $\ast$ {\em c})}\label{group__oldfuncs_ga3091c87d48f1faba018c5956379a6d90}


Initialize a \doxyref{theora\_\-info}{p.}{structtheora__info} structure. All values within the given \doxyref{theora\_\-info}{p.}{structtheora__info} structure are initialized, and space is allocated within libtheora for internal codec setup data. 
\begin{DoxyParams}{Parameters}
\item[{\em c}]A \doxyref{theora\_\-info}{p.}{structtheora__info} struct to initialize. \end{DoxyParams}
\index{oldfuncs@{oldfuncs}!theora\_\-packet\_\-isheader@{theora\_\-packet\_\-isheader}}
\index{theora\_\-packet\_\-isheader@{theora\_\-packet\_\-isheader}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-packet\_\-isheader}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-packet\_\-isheader (ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_gab969f9d0407683f0e5abe73d0839a25b}


Report whether a theora packet is a header or not This function does no verification beyond checking the header flag bit so it should not be used for bitstream identification; use \doxyref{theora\_\-decode\_\-header()}{p.}{group__oldfuncs_ga02915e63c1bd733ee291f577a8b75a82} for that. 
\begin{DoxyParams}{Parameters}
\item[{\em op}]An ogg\_\-packet containing encoded theora data. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 1}]The packet is a header packet \item[{\em 0}]The packet is not a header packet (and so contains frame data)\end{DoxyRetVals}
Thus function was added in the 1.0alpha4 release. \index{oldfuncs@{oldfuncs}!theora\_\-packet\_\-iskeyframe@{theora\_\-packet\_\-iskeyframe}}
\index{theora\_\-packet\_\-iskeyframe@{theora\_\-packet\_\-iskeyframe}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-packet\_\-iskeyframe}]{\setlength{\rightskip}{0pt plus 5cm}int theora\_\-packet\_\-iskeyframe (ogg\_\-packet $\ast$ {\em op})}\label{group__oldfuncs_ga39ccc8f847a748d7074c926b4fdd12b2}


Report whether a theora packet is a keyframe or not. 
\begin{DoxyParams}{Parameters}
\item[{\em op}]An ogg\_\-packet containing encoded theora data. \end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em 1}]The packet contains a keyframe image \item[{\em 0}]The packet is contains an interframe delta \item[{\em -\/1}]The packet is not an image data packet at all\end{DoxyRetVals}
Thus function was added in the 1.0alpha4 release. \index{oldfuncs@{oldfuncs}!theora\_\-version\_\-number@{theora\_\-version\_\-number}}
\index{theora\_\-version\_\-number@{theora\_\-version\_\-number}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-version\_\-number}]{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t theora\_\-version\_\-number (void)}\label{group__oldfuncs_gad181f4b19d455dcc2bef2533530b84c8}


Retrieve a 32-\/bit version number. This number is composed of a 16-\/bit major version, 8-\/bit minor version and 8 bit sub-\/version, composed as follows: 
\begin{DoxyPre}
   (VERSION\_MAJOR<<16) + (VERSION\_MINOR<<8) + (VERSION\_SUB)
\end{DoxyPre}
 \begin{DoxyReturn}{Returns}
The version number. 
\end{DoxyReturn}
\index{oldfuncs@{oldfuncs}!theora\_\-version\_\-string@{theora\_\-version\_\-string}}
\index{theora\_\-version\_\-string@{theora\_\-version\_\-string}!oldfuncs@{oldfuncs}}
\subsubsection[{theora\_\-version\_\-string}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ theora\_\-version\_\-string (void)}\label{group__oldfuncs_ga5a3da8fd262a60f055f96536eec06df2}


Retrieve a human-\/readable string to identify the encoder vendor and version. \begin{DoxyReturn}{Returns}
A version string. 
\end{DoxyReturn}
