\doxysection{th\+\_\+info Struct Reference}
\label{structth__info}\index{th\_info@{th\_info}}


Theora bitstream information.  




{\ttfamily \#include $<$codec.\+h$>$}

\doxysubsubsection*{Data Fields}
\begin{Indent}\textbf{ Theora version}\par
{\em Bitstream version information. }\begin{DoxyCompactItemize}
\item 
unsigned char \textbf{ version\+\_\+major}
\item 
unsigned char \textbf{ version\+\_\+minor}
\item 
unsigned char \textbf{ version\+\_\+subminor}
\item 
ogg\+\_\+uint32\+\_\+t \textbf{ frame\+\_\+width}
\begin{DoxyCompactList}\small\item\em The encoded frame width. \end{DoxyCompactList}\item 
ogg\+\_\+uint32\+\_\+t \textbf{ frame\+\_\+height}
\begin{DoxyCompactList}\small\item\em The encoded frame height. \end{DoxyCompactList}\item 
ogg\+\_\+uint32\+\_\+t \textbf{ pic\+\_\+width}
\begin{DoxyCompactList}\small\item\em The displayed picture width. \end{DoxyCompactList}\item 
ogg\+\_\+uint32\+\_\+t \textbf{ pic\+\_\+height}
\begin{DoxyCompactList}\small\item\em The displayed picture height. \end{DoxyCompactList}\item 
ogg\+\_\+uint32\+\_\+t \textbf{ pic\+\_\+x}
\begin{DoxyCompactList}\small\item\em The X offset of the displayed picture. \end{DoxyCompactList}\item 
ogg\+\_\+uint32\+\_\+t \textbf{ pic\+\_\+y}
\begin{DoxyCompactList}\small\item\em The Y offset of the displayed picture. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}\textbf{ Frame rate}\par
{\em The frame rate, as a fraction.

If either is 0, the frame rate is undefined. }\begin{DoxyCompactItemize}
\item 
ogg\+\_\+uint32\+\_\+t \textbf{ fps\+\_\+numerator}
\item 
ogg\+\_\+uint32\+\_\+t \textbf{ fps\+\_\+denominator}
\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}\textbf{ 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{DoxyCode}{0}
\DoxyCodeLine{aspect\_numerator*pic\_width/(aspect\_denominator*pic\_height).}

\end{DoxyCode}
 }\begin{DoxyCompactItemize}
\item 
ogg\+\_\+uint32\+\_\+t \textbf{ aspect\+\_\+numerator}
\item 
ogg\+\_\+uint32\+\_\+t \textbf{ aspect\+\_\+denominator}
\item 
\textbf{ th\+\_\+colorspace} \textbf{ colorspace}
\begin{DoxyCompactList}\small\item\em The color space. \end{DoxyCompactList}\item 
\textbf{ th\+\_\+pixel\+\_\+fmt} \textbf{ pixel\+\_\+fmt}
\begin{DoxyCompactList}\small\item\em The pixel format. \end{DoxyCompactList}\item 
int \textbf{ target\+\_\+bitrate}
\begin{DoxyCompactList}\small\item\em The target bit-\/rate in bits per second. \end{DoxyCompactList}\item 
int \textbf{ quality}
\begin{DoxyCompactList}\small\item\em The target quality level. \end{DoxyCompactList}\item 
int \textbf{ keyframe\+\_\+granule\+\_\+shift}
\begin{DoxyCompactList}\small\item\em The amount to shift to extract the last keyframe number from the granule position. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}


\doxysubsection{Detailed Description}
Theora bitstream information. 

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

Encoded Theora frames must be a multiple of 16 in size; this is what the \doxyref{frame\+\_\+width}{p.}{structth__info_a6b8087a4d831da53011a43b8d74087a0} and \doxyref{frame\+\_\+height}{p.}{structth__info_a6b1adc3a16a8336a72692b0a5937214c} members represent. To handle arbitrary picture sizes, a crop rectangle is specified in the \doxyref{pic\+\_\+x}{p.}{structth__info_a5b3f834bcf141564e7bb14f49101870f}, \doxyref{pic\+\_\+y}{p.}{structth__info_a8aacc575cab2dfe3735001c2ad32aa14}, \doxyref{pic\+\_\+width}{p.}{structth__info_a5048edf77b141dd3e9a92ca85e317345} and \doxyref{pic\+\_\+height}{p.}{structth__info_a775178474283c5990ba73f9ba7f6b88b} members.

All frame buffers contain pointers to the full, padded frame. However, the current encoder {\itshape will not} reference pixels outside of the cropped picture region, and the application does not need to fill them in. The decoder {\itshape will} allocate storage for a full frame, but the application {\itshape 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 {\texttt{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. 

\label{doc-variable-members}
\doxysubsection{Field Documentation}
\index{th\_info@{th\_info}!aspect\_denominator@{aspect\_denominator}}
\index{aspect\_denominator@{aspect\_denominator}!th\_info@{th\_info}}
\doxysubsubsection{aspect\_denominator}
{\footnotesize\ttfamily \label{structth__info_a04c0bd477222d747a76085d8720322e2} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::aspect\+\_\+denominator}

\index{th\_info@{th\_info}!aspect\_numerator@{aspect\_numerator}}
\index{aspect\_numerator@{aspect\_numerator}!th\_info@{th\_info}}
\doxysubsubsection{aspect\_numerator}
{\footnotesize\ttfamily \label{structth__info_a5be65dac9f75e37864cf73dd543570cd} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::aspect\+\_\+numerator}

\index{th\_info@{th\_info}!colorspace@{colorspace}}
\index{colorspace@{colorspace}!th\_info@{th\_info}}
\doxysubsubsection{colorspace}
{\footnotesize\ttfamily \label{structth__info_a8c7828cd0e023e9d21108160d53659a6} 
\textbf{ th\+\_\+colorspace} th\+\_\+info\+::colorspace}



The color space. 

\index{th\_info@{th\_info}!fps\_denominator@{fps\_denominator}}
\index{fps\_denominator@{fps\_denominator}!th\_info@{th\_info}}
\doxysubsubsection{fps\_denominator}
{\footnotesize\ttfamily \label{structth__info_aa619408f70c03935529f1d3eda7a3ec2} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::fps\+\_\+denominator}

\index{th\_info@{th\_info}!fps\_numerator@{fps\_numerator}}
\index{fps\_numerator@{fps\_numerator}!th\_info@{th\_info}}
\doxysubsubsection{fps\_numerator}
{\footnotesize\ttfamily \label{structth__info_a20606e61676f585a7e59cfc96de190a5} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::fps\+\_\+numerator}

\index{th\_info@{th\_info}!frame\_height@{frame\_height}}
\index{frame\_height@{frame\_height}!th\_info@{th\_info}}
\doxysubsubsection{frame\_height}
{\footnotesize\ttfamily \label{structth__info_a6b1adc3a16a8336a72692b0a5937214c} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::frame\+\_\+height}



The encoded frame height. 

This must be a multiple of 16, and less than 1048576. \index{th\_info@{th\_info}!frame\_width@{frame\_width}}
\index{frame\_width@{frame\_width}!th\_info@{th\_info}}
\doxysubsubsection{frame\_width}
{\footnotesize\ttfamily \label{structth__info_a6b8087a4d831da53011a43b8d74087a0} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::frame\+\_\+width}



The encoded frame width. 

This must be a multiple of 16, and less than 1048576. \index{th\_info@{th\_info}!keyframe\_granule\_shift@{keyframe\_granule\_shift}}
\index{keyframe\_granule\_shift@{keyframe\_granule\_shift}!th\_info@{th\_info}}
\doxysubsubsection{keyframe\_granule\_shift}
{\footnotesize\ttfamily \label{structth__info_a693ca4ab11fbc0c3f32594b4bb8766ed} 
int th\+\_\+info\+::keyframe\+\_\+granule\+\_\+shift}



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.}{codec_8h_a430d9c605816a6ca0bdce3a0b965b926} will set this to a default value (currently {\ttfamily 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 {\ttfamily 1$<$$<$\doxyref{keyframe\+\_\+granule\+\_\+shift}{p.}{structth__info_a693ca4ab11fbc0c3f32594b4bb8766ed}}. The keyframe frequency can be more finely controlled with \doxyref{TH\+\_\+\+ENCCTL\+\_\+\+SET\+\_\+\+KEYFRAME\+\_\+\+FREQUENCY\+\_\+\+FORCE}{p.}{theora_8h_a27e755e15b4b5604c54974b304037a49}, 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. \index{th\_info@{th\_info}!pic\_height@{pic\_height}}
\index{pic\_height@{pic\_height}!th\_info@{th\_info}}
\doxysubsubsection{pic\_height}
{\footnotesize\ttfamily \label{structth__info_a775178474283c5990ba73f9ba7f6b88b} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::pic\+\_\+height}



The displayed picture height. 

This must be no larger than height. \index{th\_info@{th\_info}!pic\_width@{pic\_width}}
\index{pic\_width@{pic\_width}!th\_info@{th\_info}}
\doxysubsubsection{pic\_width}
{\footnotesize\ttfamily \label{structth__info_a5048edf77b141dd3e9a92ca85e317345} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::pic\+\_\+width}



The displayed picture width. 

This must be no larger than width. \index{th\_info@{th\_info}!pic\_x@{pic\_x}}
\index{pic\_x@{pic\_x}!th\_info@{th\_info}}
\doxysubsubsection{pic\_x}
{\footnotesize\ttfamily \label{structth__info_a5b3f834bcf141564e7bb14f49101870f} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::pic\+\_\+x}



The X offset of the displayed picture. 

This must be no larger than \doxyref{frame\+\_\+width}{p.}{structth__info_a6b8087a4d831da53011a43b8d74087a0}-\/\doxyref{pic\+\_\+width}{p.}{structth__info_a5048edf77b141dd3e9a92ca85e317345} or 255, whichever is smaller. \index{th\_info@{th\_info}!pic\_y@{pic\_y}}
\index{pic\_y@{pic\_y}!th\_info@{th\_info}}
\doxysubsubsection{pic\_y}
{\footnotesize\ttfamily \label{structth__info_a8aacc575cab2dfe3735001c2ad32aa14} 
ogg\+\_\+uint32\+\_\+t th\+\_\+info\+::pic\+\_\+y}



The Y offset of the displayed picture. 

This must be no larger than \doxyref{frame\+\_\+height}{p.}{structth__info_a6b1adc3a16a8336a72692b0a5937214c}-\/\doxyref{pic\+\_\+height}{p.}{structth__info_a775178474283c5990ba73f9ba7f6b88b}, and \doxyref{frame\+\_\+height}{p.}{structth__info_a6b1adc3a16a8336a72692b0a5937214c}-\/\doxyref{pic\+\_\+height}{p.}{structth__info_a775178474283c5990ba73f9ba7f6b88b}-\/\doxyref{pic\+\_\+y}{p.}{structth__info_a8aacc575cab2dfe3735001c2ad32aa14} 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}!pixel\_fmt@{pixel\_fmt}}
\index{pixel\_fmt@{pixel\_fmt}!th\_info@{th\_info}}
\doxysubsubsection{pixel\_fmt}
{\footnotesize\ttfamily \label{structth__info_a2301388ef3755c41ab12fd144c1fc54e} 
\textbf{ th\+\_\+pixel\+\_\+fmt} th\+\_\+info\+::pixel\+\_\+fmt}



The pixel format. 

\index{th\_info@{th\_info}!quality@{quality}}
\index{quality@{quality}!th\_info@{th\_info}}
\doxysubsubsection{quality}
{\footnotesize\ttfamily \label{structth__info_aa4cdcf96cb46b256821993e9a830ee02} 
int th\+\_\+info\+::quality}



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_a1d9c8d768a4ae623269f5bd8f6f7a015} is set to zero, VBR encoding at this quality will be activated by default. \index{th\_info@{th\_info}!target\_bitrate@{target\_bitrate}}
\index{target\_bitrate@{target\_bitrate}!th\_info@{th\_info}}
\doxysubsubsection{target\_bitrate}
{\footnotesize\ttfamily \label{structth__info_a1d9c8d768a4ae623269f5bd8f6f7a015} 
int th\+\_\+info\+::target\+\_\+bitrate}



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}!version\_major@{version\_major}}
\index{version\_major@{version\_major}!th\_info@{th\_info}}
\doxysubsubsection{version\_major}
{\footnotesize\ttfamily \label{structth__info_a60b3e2cac006fee0e105a918d6a5a9f9} 
unsigned char th\+\_\+info\+::version\+\_\+major}

\index{th\_info@{th\_info}!version\_minor@{version\_minor}}
\index{version\_minor@{version\_minor}!th\_info@{th\_info}}
\doxysubsubsection{version\_minor}
{\footnotesize\ttfamily \label{structth__info_abb1d4887a8079c6c5aaa6d7229f243d7} 
unsigned char th\+\_\+info\+::version\+\_\+minor}

\index{th\_info@{th\_info}!version\_subminor@{version\_subminor}}
\index{version\_subminor@{version\_subminor}!th\_info@{th\_info}}
\doxysubsubsection{version\_subminor}
{\footnotesize\ttfamily \label{structth__info_abfacc79b7cabae12b6ac2484f76602d3} 
unsigned char th\+\_\+info\+::version\+\_\+subminor}



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