\doxysection{codec.\+h}
\label{codec_8h_source}\index{codec.h@{codec.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{comment}{/********************************************************************}}
\DoxyCodeLine{2 \textcolor{comment}{ *                                                                  *}}
\DoxyCodeLine{3 \textcolor{comment}{ * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE.   *}}
\DoxyCodeLine{4 \textcolor{comment}{ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *}}
\DoxyCodeLine{5 \textcolor{comment}{ * GOVERNED BY A BSD-\/STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *}}
\DoxyCodeLine{6 \textcolor{comment}{ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *}}
\DoxyCodeLine{7 \textcolor{comment}{ *                                                                  *}}
\DoxyCodeLine{8 \textcolor{comment}{ * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-\/2009                *}}
\DoxyCodeLine{9 \textcolor{comment}{ * by the Xiph.Org Foundation http://www.xiph.org/                  *}}
\DoxyCodeLine{10 \textcolor{comment}{ *                                                                  *}}
\DoxyCodeLine{11 \textcolor{comment}{ ********************************************************************}}
\DoxyCodeLine{12 \textcolor{comment}{}}
\DoxyCodeLine{13 \textcolor{comment}{  function:}}
\DoxyCodeLine{14 \textcolor{comment}{  last mod: \$Id: theora.h,v 1.8 2004/03/15 22:17:32 derf Exp \$}}
\DoxyCodeLine{15 \textcolor{comment}{}}
\DoxyCodeLine{16 \textcolor{comment}{ ********************************************************************/}}
\DoxyCodeLine{17 }
\DoxyCodeLine{62 \textcolor{preprocessor}{\#if !defined(\_O\_THEORA\_CODEC\_H\_)}}
\DoxyCodeLine{63 \textcolor{preprocessor}{\# define \_O\_THEORA\_CODEC\_H\_ (1)}}
\DoxyCodeLine{64 \textcolor{preprocessor}{\# include <ogg/ogg.h>}}
\DoxyCodeLine{65 }
\DoxyCodeLine{66 \textcolor{preprocessor}{\#if defined(\_\_cplusplus)}}
\DoxyCodeLine{67 \textcolor{keyword}{extern} \textcolor{stringliteral}{"{}C"{}} \{}
\DoxyCodeLine{68 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{69 }
\DoxyCodeLine{70 }
\DoxyCodeLine{71 }
\DoxyCodeLine{75 \textcolor{preprocessor}{\#define TH\_EFAULT     (-\/1)}}
\DoxyCodeLine{77 \textcolor{preprocessor}{\#define TH\_EINVAL     (-\/10)}}
\DoxyCodeLine{79 \textcolor{preprocessor}{\#define TH\_EBADHEADER (-\/20)}}
\DoxyCodeLine{81 \textcolor{preprocessor}{\#define TH\_ENOTFORMAT (-\/21)}}
\DoxyCodeLine{83 \textcolor{preprocessor}{\#define TH\_EVERSION   (-\/22)}}
\DoxyCodeLine{85 \textcolor{preprocessor}{\#define TH\_EIMPL      (-\/23)}}
\DoxyCodeLine{87 \textcolor{preprocessor}{\#define TH\_EBADPACKET (-\/24)}}
\DoxyCodeLine{91 \textcolor{preprocessor}{\#define TH\_DUPFRAME   (1)}}
\DoxyCodeLine{98 \textcolor{keyword}{typedef} \textcolor{keyword}{enum}\{}
\DoxyCodeLine{101   TH\_CS\_UNSPECIFIED,}
\DoxyCodeLine{103   TH\_CS\_ITU\_REC\_470M,}
\DoxyCodeLine{105   TH\_CS\_ITU\_REC\_470BG,}
\DoxyCodeLine{107   TH\_CS\_NSPACES}
\DoxyCodeLine{108 \}th\_colorspace;}
\DoxyCodeLine{109 }
\DoxyCodeLine{114 \textcolor{keyword}{typedef} \textcolor{keyword}{enum}\{}
\DoxyCodeLine{118   TH\_PF\_420,}
\DoxyCodeLine{120   TH\_PF\_RSVD,}
\DoxyCodeLine{124   TH\_PF\_422,}
\DoxyCodeLine{127   TH\_PF\_444,}
\DoxyCodeLine{129   TH\_PF\_NFORMATS}
\DoxyCodeLine{130 \}th\_pixel\_fmt;}
\DoxyCodeLine{131 }
\DoxyCodeLine{132 }
\DoxyCodeLine{133 }
\DoxyCodeLine{142 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}\{}
\DoxyCodeLine{144   \textcolor{keywordtype}{int}            width;}
\DoxyCodeLine{146   \textcolor{keywordtype}{int}            height;}
\DoxyCodeLine{148   \textcolor{keywordtype}{int}            stride;}
\DoxyCodeLine{150   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *data;}
\DoxyCodeLine{151 \}th\_img\_plane;}
\DoxyCodeLine{152 }
\DoxyCodeLine{168 \textcolor{keyword}{typedef} th\_img\_plane th\_ycbcr\_buffer[3];}
\DoxyCodeLine{169 }
\DoxyCodeLine{204 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}\{}
\DoxyCodeLine{208   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} version\_major;}
\DoxyCodeLine{209   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} version\_minor;}
\DoxyCodeLine{210   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} version\_subminor;}
\DoxyCodeLine{214   ogg\_uint32\_t  frame\_width;}
\DoxyCodeLine{217   ogg\_uint32\_t  frame\_height;}
\DoxyCodeLine{220   ogg\_uint32\_t  pic\_width;}
\DoxyCodeLine{223   ogg\_uint32\_t  pic\_height;}
\DoxyCodeLine{227   ogg\_uint32\_t  pic\_x;}
\DoxyCodeLine{235   ogg\_uint32\_t  pic\_y;}
\DoxyCodeLine{240   ogg\_uint32\_t  fps\_numerator;}
\DoxyCodeLine{241   ogg\_uint32\_t  fps\_denominator;}
\DoxyCodeLine{252   ogg\_uint32\_t  aspect\_numerator;}
\DoxyCodeLine{253   ogg\_uint32\_t  aspect\_denominator;}
\DoxyCodeLine{256   th\_colorspace colorspace;}
\DoxyCodeLine{258   th\_pixel\_fmt  pixel\_fmt;}
\DoxyCodeLine{262   \textcolor{keywordtype}{int}           target\_bitrate;}
\DoxyCodeLine{268   \textcolor{comment}{/*Currently this is set so that a qi of 0 corresponds to distortions of 24}}
\DoxyCodeLine{269 \textcolor{comment}{     times the JND, and each increase by 16 halves that value.}}
\DoxyCodeLine{270 \textcolor{comment}{    This gives us fine discrimination at low qualities, yet effective rate}}
\DoxyCodeLine{271 \textcolor{comment}{     control at high qualities.}}
\DoxyCodeLine{272 \textcolor{comment}{    The qi value 63 is special, however.}}
\DoxyCodeLine{273 \textcolor{comment}{    For this, the highest quality, we use one half of a JND for our threshold.}}
\DoxyCodeLine{274 \textcolor{comment}{    Due to the lower bounds placed on allowable quantizers in Theora, we will}}
\DoxyCodeLine{275 \textcolor{comment}{     not actually be able to achieve quality this good, but this should}}
\DoxyCodeLine{276 \textcolor{comment}{     provide as close to visually lossless quality as Theora is capable of.}}
\DoxyCodeLine{277 \textcolor{comment}{    We could lift the quantizer restrictions without breaking VP3.1}}
\DoxyCodeLine{278 \textcolor{comment}{     compatibility, but this would result in quantized coefficients that are}}
\DoxyCodeLine{279 \textcolor{comment}{     too large for the current bitstream to be able to store.}}
\DoxyCodeLine{280 \textcolor{comment}{    We'd have to redesign the token syntax to store these large coefficients,}}
\DoxyCodeLine{281 \textcolor{comment}{     which would make transcoding complex.*/}}
\DoxyCodeLine{282   \textcolor{keywordtype}{int}           quality;}
\DoxyCodeLine{296   \textcolor{keywordtype}{int}           keyframe\_granule\_shift;}
\DoxyCodeLine{297 \}th\_info;}
\DoxyCodeLine{298 }
\DoxyCodeLine{323 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }th\_comment\{}
\DoxyCodeLine{325   \textcolor{keywordtype}{char} **user\_comments;}
\DoxyCodeLine{327   \textcolor{keywordtype}{int}   *comment\_lengths;}
\DoxyCodeLine{329   \textcolor{keywordtype}{int}    comments;}
\DoxyCodeLine{332   \textcolor{keywordtype}{char}  *vendor;}
\DoxyCodeLine{333 \}th\_comment;}
\DoxyCodeLine{334 }
\DoxyCodeLine{335 }
\DoxyCodeLine{336 }
\DoxyCodeLine{338 \textcolor{keyword}{typedef} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} th\_quant\_base[64];}
\DoxyCodeLine{339 }
\DoxyCodeLine{341 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}\{}
\DoxyCodeLine{343   \textcolor{keywordtype}{int}                  nranges;}
\DoxyCodeLine{346   \textcolor{keyword}{const} \textcolor{keywordtype}{int}           *sizes;}
\DoxyCodeLine{349   \textcolor{keyword}{const} th\_quant\_base *base\_matrices;}
\DoxyCodeLine{350 \}th\_quant\_ranges;}
\DoxyCodeLine{351 }
\DoxyCodeLine{409 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}\{}
\DoxyCodeLine{411   ogg\_uint16\_t    dc\_scale[64];}
\DoxyCodeLine{413   ogg\_uint16\_t    ac\_scale[64];}
\DoxyCodeLine{415   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}   loop\_filter\_limits[64];}
\DoxyCodeLine{417   th\_quant\_ranges qi\_ranges[2][3];}
\DoxyCodeLine{418 \}th\_quant\_info;}
\DoxyCodeLine{419 }
\DoxyCodeLine{420 }
\DoxyCodeLine{421 }
\DoxyCodeLine{423 \textcolor{preprocessor}{\#define TH\_NHUFFMAN\_TABLES (80)}}
\DoxyCodeLine{425 \textcolor{preprocessor}{\#define TH\_NDCT\_TOKENS     (32)}}
\DoxyCodeLine{426 }
\DoxyCodeLine{438 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}\{}
\DoxyCodeLine{441   ogg\_uint32\_t pattern;}
\DoxyCodeLine{444   \textcolor{keywordtype}{int}          nbits;}
\DoxyCodeLine{445 \}th\_huff\_code;}
\DoxyCodeLine{446 }
\DoxyCodeLine{447 }
\DoxyCodeLine{448 }
\DoxyCodeLine{456 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *th\_version\_string(\textcolor{keywordtype}{void});}
\DoxyCodeLine{466 \textcolor{keyword}{extern} ogg\_uint32\_t th\_version\_number(\textcolor{keywordtype}{void});}
\DoxyCodeLine{476 \textcolor{keyword}{extern} ogg\_int64\_t th\_granule\_frame(\textcolor{keywordtype}{void} *\_encdec,ogg\_int64\_t \_granpos);}
\DoxyCodeLine{488 \textcolor{keyword}{extern} \textcolor{keywordtype}{double} th\_granule\_time(\textcolor{keywordtype}{void} *\_encdec,ogg\_int64\_t \_granpos);}
\DoxyCodeLine{498 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} th\_packet\_isheader(ogg\_packet *\_op);}
\DoxyCodeLine{509 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} th\_packet\_iskeyframe(ogg\_packet *\_op);}
\DoxyCodeLine{519 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} th\_info\_init(th\_info *\_info);}
\DoxyCodeLine{524 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} th\_info\_clear(th\_info *\_info);}
\DoxyCodeLine{525 }
\DoxyCodeLine{530 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} th\_comment\_init(th\_comment *\_tc);}
\DoxyCodeLine{540 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} th\_comment\_add(th\_comment *\_tc, \textcolor{keywordtype}{char} *\_comment);}
\DoxyCodeLine{551 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} th\_comment\_add\_tag(th\_comment *\_tc,\textcolor{keywordtype}{char} *\_tag,\textcolor{keywordtype}{char} *\_val);}
\DoxyCodeLine{567 \textcolor{keyword}{extern} \textcolor{keywordtype}{char} *th\_comment\_query(th\_comment *\_tc,\textcolor{keywordtype}{char} *\_tag,\textcolor{keywordtype}{int} \_count);}
\DoxyCodeLine{575 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} th\_comment\_query\_count(th\_comment *\_tc,\textcolor{keywordtype}{char} *\_tag);}
\DoxyCodeLine{581 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} th\_comment\_clear(th\_comment *\_tc);}
\DoxyCodeLine{584 }
\DoxyCodeLine{585 }
\DoxyCodeLine{586 }
\DoxyCodeLine{587 \textcolor{preprocessor}{\#if defined(\_\_cplusplus)}}
\DoxyCodeLine{588 \}}
\DoxyCodeLine{589 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{590 }
\DoxyCodeLine{591 \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
