\section{th\_\-info Struct Reference}
\label{structth__info}\index{th_info@{th\_\-info}}
Theora bitstream information.  


{\tt \#include $<$codec.h$>$}

\subsection*{Data Fields}
\begin{CompactItemize}
\item 
ogg\_\-uint32\_\-t {\bf frame\_\-width}
\begin{CompactList}\small\item\em The encoded frame width. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf frame\_\-height}
\begin{CompactList}\small\item\em The encoded frame height. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-width}
\begin{CompactList}\small\item\em The displayed picture width. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-height}
\begin{CompactList}\small\item\em The displayed picture height. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-x}
\begin{CompactList}\small\item\em The X offset of the displayed picture. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-y}
\begin{CompactList}\small\item\em The Y offset of the displayed picture. \item\end{CompactList}\item 
{\bf th\_\-colorspace} {\bf colorspace}\label{structth__info_7f375d964dded81bf37dc8c6c31d483e}

\begin{CompactList}\small\item\em The color space. \item\end{CompactList}\item 
{\bf th\_\-pixel\_\-fmt} {\bf pixel\_\-fmt}\label{structth__info_b1966565a00135ddd50fa196ff45310e}

\begin{CompactList}\small\item\em The pixel format. \item\end{CompactList}\item 
int {\bf target\_\-bitrate}
\begin{CompactList}\small\item\em The target bit-rate in bits per second. \item\end{CompactList}\item 
int {\bf quality}
\begin{CompactList}\small\item\em The target quality level. \item\end{CompactList}\item 
int {\bf keyframe\_\-granule\_\-shift}
\begin{CompactList}\small\item\em The amount to shift to extract the last keyframe number from the granule position. \item\end{CompactList}\end{CompactItemize}
\begin{Indent}{\bf Theora version}\par
{\em Bitstream version information. }\begin{CompactItemize}
\item 
unsigned char \textbf{version\_\-major}\label{structth__info_72355363c35219b5b1ce1880936410f8}

\item 
unsigned char \textbf{version\_\-minor}\label{structth__info_a9e152dcf8864a796e05be3239e3957e}

\item 
unsigned char \textbf{version\_\-subminor}\label{structth__info_fb5b9ea778fc47a14da481933f997e48}

\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Frame rate}\par
{\em The frame rate, as a fraction.

If either is 0, the frame rate is undefined. }\begin{CompactItemize}
\item 
ogg\_\-uint32\_\-t \textbf{fps\_\-numerator}\label{structth__info_c8e3d6dac894b60b766143ea84e17a0a}

\item 
ogg\_\-uint32\_\-t \textbf{fps\_\-denominator}\label{structth__info_8d02b8fbd5861571c656052a07f384a4}

\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Aspect ratio}\par
{\em The aspect ratio of the pixels.

If either value is zero, the aspect ratio is undefined. If not specified by any external means, 1:1 should be assumed. The aspect ratio of the full picture can be computed as 

\begin{Code}\begin{verbatim}  aspect_numerator*pic_width/(aspect_denominator*pic_height).
\end{verbatim}\end{Code}

 }\begin{CompactItemize}
\item 
ogg\_\-uint32\_\-t \textbf{aspect\_\-numerator}\label{structth__info_aa3ed104bcde75178891fe91de67768d}

\item 
ogg\_\-uint32\_\-t \textbf{aspect\_\-denominator}\label{structth__info_a22ecc44c5adde6e70273b9ea305a74a}

\end{CompactItemize}
\end{Indent}


\subsection{Detailed Description}
Theora bitstream information. 

This contains the basic playback parameters for a stream, and corresponds to the initial 'info' header packet. To initialize an encoder, the application fills in this structure and passes it to th\_\-encode\_\-alloc(). A default encoding mode is chosen based on the values of the \doxyref{quality}{p.}{structth__info_7ae1e52dab5b6286415d55b3f4e6d03c} and \doxyref{target\_\-bitrate}{p.}{structth__info_f72aebb0b60d58afe50d505970f65a51} fields. On decode, it is filled in by \doxyref{th\_\-decode\_\-headerin()}{p.}{group__decfuncs_gb6616614374d049781bf883f995b43d8}, and then passed to \doxyref{th\_\-decode\_\-alloc()}{p.}{group__decfuncs_g48da74f31b3d34387d14760a41c5da89}.

Encoded Theora frames must be a multiple of 16 in size; this is what the \doxyref{frame\_\-width}{p.}{structth__info_b9f95ca367fa1094d0a5fb721d3c393b} and \doxyref{frame\_\-height}{p.}{structth__info_f75ca9edd0a60001aa56763a45fc0954} members represent. To handle arbitrary picture sizes, a crop rectangle is specified in the \doxyref{pic\_\-x}{p.}{structth__info_61f578d14183bb428525e84b9c07dedd}, \doxyref{pic\_\-y}{p.}{structth__info_a768fdac6fd834588be82823b56fd9a5}, \doxyref{pic\_\-width}{p.}{structth__info_65159959b98e3df2e759fccc6e468671} and \doxyref{pic\_\-height}{p.}{structth__info_5ac85f41e0b49e387d26422210f23ae2} members.

All frame buffers contain pointers to the full, padded frame. However, the current encoder {\em will not\/} reference pixels outside of the cropped picture region, and the application does not need to fill them in. The decoder {\em will\/} allocate storage for a full frame, but the application {\em should not\/} rely on the padding containing sensible data.

It is also generally recommended that the offsets and sizes should still be multiples of 2 to avoid chroma sampling shifts when chroma is sub-sampled. See {\tt the Theora specification}, Section 4.4, for more details.

Frame rate, in frames per second, is stored as a rational fraction, as is the pixel aspect ratio. Note that this refers to the aspect ratio of the individual pixels, not of the overall frame itself. The frame aspect ratio can be computed from pixel aspect ratio using the image dimensions. 



\subsection{Field Documentation}
\index{th_info@{th\_\-info}!frame_width@{frame\_\-width}}
\index{frame_width@{frame\_\-width}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::frame\_\-width}}\label{structth__info_b9f95ca367fa1094d0a5fb721d3c393b}


The encoded frame width. 

This must be a multiple of 16, and less than 1048576. \index{th_info@{th\_\-info}!frame_height@{frame\_\-height}}
\index{frame_height@{frame\_\-height}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::frame\_\-height}}\label{structth__info_f75ca9edd0a60001aa56763a45fc0954}


The encoded frame height. 

This must be a multiple of 16, and less than 1048576. \index{th_info@{th\_\-info}!pic_width@{pic\_\-width}}
\index{pic_width@{pic\_\-width}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-width}}\label{structth__info_65159959b98e3df2e759fccc6e468671}


The displayed picture width. 

This must be no larger than width. \index{th_info@{th\_\-info}!pic_height@{pic\_\-height}}
\index{pic_height@{pic\_\-height}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-height}}\label{structth__info_5ac85f41e0b49e387d26422210f23ae2}


The displayed picture height. 

This must be no larger than height. \index{th_info@{th\_\-info}!pic_x@{pic\_\-x}}
\index{pic_x@{pic\_\-x}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-x}}\label{structth__info_61f578d14183bb428525e84b9c07dedd}


The X offset of the displayed picture. 

This must be no larger than \doxyref{frame\_\-width}{p.}{structth__info_b9f95ca367fa1094d0a5fb721d3c393b}-\doxyref{pic\_\-width}{p.}{structth__info_65159959b98e3df2e759fccc6e468671} or 255, whichever is smaller. \index{th_info@{th\_\-info}!pic_y@{pic\_\-y}}
\index{pic_y@{pic\_\-y}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-y}}\label{structth__info_a768fdac6fd834588be82823b56fd9a5}


The Y offset of the displayed picture. 

This must be no larger than \doxyref{frame\_\-height}{p.}{structth__info_f75ca9edd0a60001aa56763a45fc0954}-\doxyref{pic\_\-height}{p.}{structth__info_5ac85f41e0b49e387d26422210f23ae2}, and \doxyref{frame\_\-height}{p.}{structth__info_f75ca9edd0a60001aa56763a45fc0954}-\doxyref{pic\_\-height}{p.}{structth__info_5ac85f41e0b49e387d26422210f23ae2}-\doxyref{pic\_\-y}{p.}{structth__info_a768fdac6fd834588be82823b56fd9a5} must be no larger than 255. This slightly funny restriction is due to the fact that the offset is specified from the top of the image for consistency with the standard graphics left-handed coordinate system used throughout this API, while it is stored in the encoded stream as an offset from the bottom. \index{th_info@{th\_\-info}!target_bitrate@{target\_\-bitrate}}
\index{target_bitrate@{target\_\-bitrate}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf th\_\-info::target\_\-bitrate}}\label{structth__info_f72aebb0b60d58afe50d505970f65a51}


The target bit-rate in bits per second. 

If initializing an encoder with this struct, set this field to a non-zero value to activate CBR encoding by default. \index{th_info@{th\_\-info}!quality@{quality}}
\index{quality@{quality}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf th\_\-info::quality}}\label{structth__info_7ae1e52dab5b6286415d55b3f4e6d03c}


The target quality level. 

Valid values range from 0 to 63, inclusive, with higher values giving higher quality. If initializing an encoder with this struct, and \doxyref{target\_\-bitrate}{p.}{structth__info_f72aebb0b60d58afe50d505970f65a51} is set to zero, VBR encoding at this quality will be activated by default. \index{th_info@{th\_\-info}!keyframe_granule_shift@{keyframe\_\-granule\_\-shift}}
\index{keyframe_granule_shift@{keyframe\_\-granule\_\-shift}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf th\_\-info::keyframe\_\-granule\_\-shift}}\label{structth__info_2794d9b9f71fce17ab1ab2d6d47c9153}


The amount to shift to extract the last keyframe number from the granule position. 

This can be at most 31. \doxyref{th\_\-info\_\-init()}{p.}{group__basefuncs_g47dd4fd90382e1fcf11f27c8b8eeb860} will set this to a default value (currently {\tt 6}, which is good for streaming applications), but you can set it to 0 to make every frame a keyframe. The maximum distance between key frames is {\tt 1$<$$<$\doxyref{keyframe\_\-granule\_\-shift}{p.}{structth__info_2794d9b9f71fce17ab1ab2d6d47c9153}}. The keyframe frequency can be more finely controlled with \doxyref{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}{p.}{theora_8h_7102eda810b38358f8ffda8342e08a1f}, which can also be adjusted during encoding (for example, to force the next frame to be a keyframe), but it cannot be set larger than the amount permitted by this field after the headers have been output. 

The documentation for this struct was generated from the following file:\begin{CompactItemize}
\item 
{\bf codec.h}\end{CompactItemize}
