\doxysection{theora.\+h}
\label{theora_8h_source}\index{theora.h@{theora.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.17 2003/12/06 18:06:19 arc Exp \$}}
\DoxyCodeLine{15 \textcolor{comment}{}}
\DoxyCodeLine{16 \textcolor{comment}{ ********************************************************************/}}
\DoxyCodeLine{17 }
\DoxyCodeLine{18 \textcolor{preprocessor}{\#ifndef \_O\_THEORA\_H\_}}
\DoxyCodeLine{19 \textcolor{preprocessor}{\#define \_O\_THEORA\_H\_}}
\DoxyCodeLine{20 }
\DoxyCodeLine{21 \textcolor{preprocessor}{\#ifdef \_\_cplusplus}}
\DoxyCodeLine{22 \textcolor{keyword}{extern} \textcolor{stringliteral}{"{}C"{}}}
\DoxyCodeLine{23 \{}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_\_cplusplus */}\textcolor{preprocessor}{}}
\DoxyCodeLine{25 }
\DoxyCodeLine{26 \textcolor{preprocessor}{\#include <stddef.h>}     \textcolor{comment}{/* for size\_t */}}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{preprocessor}{\#include <ogg/ogg.h>}}
\DoxyCodeLine{29 }
\DoxyCodeLine{121 \textcolor{comment}{/*  @\{ */}}
\DoxyCodeLine{122 }
\DoxyCodeLine{147 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\{}
\DoxyCodeLine{148     \textcolor{keywordtype}{int}   y\_width;      }
\DoxyCodeLine{149     \textcolor{keywordtype}{int}   y\_height;     }
\DoxyCodeLine{150     \textcolor{keywordtype}{int}   y\_stride;     }
\DoxyCodeLine{152     \textcolor{keywordtype}{int}   uv\_width;     }
\DoxyCodeLine{153     \textcolor{keywordtype}{int}   uv\_height;    }
\DoxyCodeLine{154     \textcolor{keywordtype}{int}   uv\_stride;    }
\DoxyCodeLine{155     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *y;   }
\DoxyCodeLine{156     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *u;   }
\DoxyCodeLine{157     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *v;   }
\DoxyCodeLine{159 \} yuv\_buffer;}
\DoxyCodeLine{160 }
\DoxyCodeLine{164 \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{165   OC\_CS\_UNSPECIFIED,    }
\DoxyCodeLine{166   OC\_CS\_ITU\_REC\_470M,   }
\DoxyCodeLine{167   OC\_CS\_ITU\_REC\_470BG,  }
\DoxyCodeLine{168   OC\_CS\_NSPACES         }
\DoxyCodeLine{169 \} theora\_colorspace;}
\DoxyCodeLine{170 }
\DoxyCodeLine{178 \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{179   OC\_PF\_420,    }
\DoxyCodeLine{180   OC\_PF\_RSVD,   }
\DoxyCodeLine{181   OC\_PF\_422,    }
\DoxyCodeLine{182   OC\_PF\_444,    }
\DoxyCodeLine{183 \} theora\_pixelformat;}
\DoxyCodeLine{184 }
\DoxyCodeLine{206 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\{}
\DoxyCodeLine{207   ogg\_uint32\_t  width;             }
\DoxyCodeLine{208   ogg\_uint32\_t  height;           }
\DoxyCodeLine{209   ogg\_uint32\_t  frame\_width; }
\DoxyCodeLine{210   ogg\_uint32\_t  frame\_height;       }
\DoxyCodeLine{211   ogg\_uint32\_t  offset\_x;       }
\DoxyCodeLine{212   ogg\_uint32\_t  offset\_y;       }
\DoxyCodeLine{213   ogg\_uint32\_t  fps\_numerator;         }
\DoxyCodeLine{214   ogg\_uint32\_t  fps\_denominator;    }
\DoxyCodeLine{215   ogg\_uint32\_t  aspect\_numerator;   }
\DoxyCodeLine{216   ogg\_uint32\_t  aspect\_denominator; }
\DoxyCodeLine{217   theora\_colorspace colorspace;          }
\DoxyCodeLine{218   \textcolor{keywordtype}{int}           target\_bitrate;       }
\DoxyCodeLine{219   \textcolor{keywordtype}{int}           quality;  }
\DoxyCodeLine{220   \textcolor{keywordtype}{int}           quick\_p;  }
\DoxyCodeLine{222   \textcolor{comment}{/* decode only */}}
\DoxyCodeLine{223   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} version\_major;}
\DoxyCodeLine{224   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} version\_minor;}
\DoxyCodeLine{225   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} version\_subminor;}
\DoxyCodeLine{226 }
\DoxyCodeLine{227   \textcolor{keywordtype}{void} *codec\_setup;}
\DoxyCodeLine{228 }
\DoxyCodeLine{229   \textcolor{comment}{/* encode only */}}
\DoxyCodeLine{230   \textcolor{keywordtype}{int}           dropframes\_p;}
\DoxyCodeLine{231   \textcolor{keywordtype}{int}           keyframe\_auto\_p;}
\DoxyCodeLine{232   ogg\_uint32\_t  keyframe\_frequency;}
\DoxyCodeLine{233   ogg\_uint32\_t  keyframe\_frequency\_force;  \textcolor{comment}{/* also used for decode init to}}
\DoxyCodeLine{234 \textcolor{comment}{                                              get granpos shift correct */}}
\DoxyCodeLine{235   ogg\_uint32\_t  keyframe\_data\_target\_bitrate;}
\DoxyCodeLine{236   ogg\_int32\_t   keyframe\_auto\_threshold;}
\DoxyCodeLine{237   ogg\_uint32\_t  keyframe\_mindistance;}
\DoxyCodeLine{238   ogg\_int32\_t   noise\_sensitivity;}
\DoxyCodeLine{239   ogg\_int32\_t   sharpness;}
\DoxyCodeLine{240 }
\DoxyCodeLine{241   theora\_pixelformat pixelformat;  }
\DoxyCodeLine{243 \} theora\_info;}
\DoxyCodeLine{244 }
\DoxyCodeLine{247 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}\{}
\DoxyCodeLine{248   theora\_info *i;}
\DoxyCodeLine{249   ogg\_int64\_t granulepos;}
\DoxyCodeLine{250 }
\DoxyCodeLine{251   \textcolor{keywordtype}{void} *internal\_encode;}
\DoxyCodeLine{252   \textcolor{keywordtype}{void} *internal\_decode;}
\DoxyCodeLine{253 }
\DoxyCodeLine{254 \} theora\_state;}
\DoxyCodeLine{255 }
\DoxyCodeLine{275 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }theora\_comment\{}
\DoxyCodeLine{276   \textcolor{keywordtype}{char} **user\_comments;         }
\DoxyCodeLine{277   \textcolor{keywordtype}{int}   *comment\_lengths;       }
\DoxyCodeLine{278   \textcolor{keywordtype}{int}    comments;              }
\DoxyCodeLine{279   \textcolor{keywordtype}{char}  *vendor;                }
\DoxyCodeLine{281 \} theora\_comment;}
\DoxyCodeLine{282 }
\DoxyCodeLine{283 }
\DoxyCodeLine{285 \textcolor{comment}{/* \(\backslash\)anchor decctlcodes\_old}}
\DoxyCodeLine{286 \textcolor{comment}{ * These are the available request codes for theora\_control()}}
\DoxyCodeLine{287 \textcolor{comment}{ * when called with a decoder instance.}}
\DoxyCodeLine{288 \textcolor{comment}{ * By convention decoder control codes are odd, to distinguish }}
\DoxyCodeLine{289 \textcolor{comment}{ * them from \(\backslash\)ref encctlcodes\_old "{}encoder control codes"{} which}}
\DoxyCodeLine{290 \textcolor{comment}{ * are even.}}
\DoxyCodeLine{291 \textcolor{comment}{ *}}
\DoxyCodeLine{292 \textcolor{comment}{ * Note that since the 1.0 release, both the legacy and the final}}
\DoxyCodeLine{293 \textcolor{comment}{ * implementation accept all the same control codes, but only the}}
\DoxyCodeLine{294 \textcolor{comment}{ * final API declares the newer codes.}}
\DoxyCodeLine{295 \textcolor{comment}{ *}}
\DoxyCodeLine{296 \textcolor{comment}{ * Keep any experimental or vendor-\/specific values above \(\backslash\)c 0x8000.*/}}
\DoxyCodeLine{297 }
\DoxyCodeLine{306 \textcolor{preprocessor}{\#define TH\_DECCTL\_GET\_PPLEVEL\_MAX (1)}}
\DoxyCodeLine{307 }
\DoxyCodeLine{313 \textcolor{preprocessor}{\#define TH\_DECCTL\_SET\_PPLEVEL (3)}}
\DoxyCodeLine{314 }
\DoxyCodeLine{327 \textcolor{preprocessor}{\#define TH\_ENCCTL\_SET\_KEYFRAME\_FREQUENCY\_FORCE (4)}}
\DoxyCodeLine{328 }
\DoxyCodeLine{336 \textcolor{preprocessor}{\#define TH\_DECCTL\_SET\_GRANPOS (5)}}
\DoxyCodeLine{337 }
\DoxyCodeLine{353 \textcolor{preprocessor}{\#define TH\_ENCCTL\_SET\_QUANT\_PARAMS (2)}}
\DoxyCodeLine{354 }
\DoxyCodeLine{382 \textcolor{preprocessor}{\#define TH\_ENCCTL\_SET\_VP3\_COMPATIBLE (10)}}
\DoxyCodeLine{383 }
\DoxyCodeLine{397 \textcolor{preprocessor}{\#define TH\_ENCCTL\_GET\_SPLEVEL\_MAX (12)}}
\DoxyCodeLine{398 }
\DoxyCodeLine{412 \textcolor{preprocessor}{\#define TH\_ENCCTL\_SET\_SPLEVEL (14)}}
\DoxyCodeLine{413 }
\DoxyCodeLine{416 \textcolor{preprocessor}{\#define OC\_FAULT       -\/1       }}
\DoxyCodeLine{417 \textcolor{preprocessor}{\#define OC\_EINVAL      -\/10      }}
\DoxyCodeLine{418 \textcolor{preprocessor}{\#define OC\_DISABLED    -\/11      }}
\DoxyCodeLine{419 \textcolor{preprocessor}{\#define OC\_BADHEADER   -\/20      }}
\DoxyCodeLine{420 \textcolor{preprocessor}{\#define OC\_NOTFORMAT   -\/21      }}
\DoxyCodeLine{421 \textcolor{preprocessor}{\#define OC\_VERSION     -\/22      }}
\DoxyCodeLine{422 \textcolor{preprocessor}{\#define OC\_IMPL        -\/23      }}
\DoxyCodeLine{423 \textcolor{preprocessor}{\#define OC\_BADPACKET   -\/24      }}
\DoxyCodeLine{424 \textcolor{preprocessor}{\#define OC\_NEWPACKET   -\/25      }}
\DoxyCodeLine{425 \textcolor{preprocessor}{\#define OC\_DUPFRAME    1        }}
\DoxyCodeLine{431 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *theora\_version\_string(\textcolor{keywordtype}{void});}
\DoxyCodeLine{432 }
\DoxyCodeLine{442 \textcolor{keyword}{extern} ogg\_uint32\_t theora\_version\_number(\textcolor{keywordtype}{void});}
\DoxyCodeLine{443 }
\DoxyCodeLine{450 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_encode\_init(theora\_state *th, theora\_info *ti);}
\DoxyCodeLine{451 }
\DoxyCodeLine{462 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_encode\_YUVin(theora\_state *t, yuv\_buffer *yuv);}
\DoxyCodeLine{463 }
\DoxyCodeLine{476 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_encode\_packetout( theora\_state *t, \textcolor{keywordtype}{int} last\_p,}
\DoxyCodeLine{477                                     ogg\_packet *op);}
\DoxyCodeLine{478 }
\DoxyCodeLine{489 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_encode\_header(theora\_state *t, ogg\_packet *op);}
\DoxyCodeLine{490 }
\DoxyCodeLine{502 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_encode\_comment(theora\_comment *tc, ogg\_packet *op);}
\DoxyCodeLine{503 }
\DoxyCodeLine{514 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_encode\_tables(theora\_state *t, ogg\_packet *op);}
\DoxyCodeLine{515 }
\DoxyCodeLine{557 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_decode\_header(theora\_info *ci, theora\_comment *cc,}
\DoxyCodeLine{558                                 ogg\_packet *op);}
\DoxyCodeLine{559 }
\DoxyCodeLine{568 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_decode\_init(theora\_state *th, theora\_info *c);}
\DoxyCodeLine{569 }
\DoxyCodeLine{577 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_decode\_packetin(theora\_state *th,ogg\_packet *op);}
\DoxyCodeLine{578 }
\DoxyCodeLine{589 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_decode\_YUVout(theora\_state *th,yuv\_buffer *yuv);}
\DoxyCodeLine{590 }
\DoxyCodeLine{603 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_packet\_isheader(ogg\_packet *op);}
\DoxyCodeLine{604 }
\DoxyCodeLine{615 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_packet\_iskeyframe(ogg\_packet *op);}
\DoxyCodeLine{616 }
\DoxyCodeLine{642 \textcolor{keywordtype}{int} theora\_granule\_shift(theora\_info *ti);}
\DoxyCodeLine{643 }
\DoxyCodeLine{660 \textcolor{keyword}{extern} ogg\_int64\_t theora\_granule\_frame(theora\_state *th,ogg\_int64\_t granulepos);}
\DoxyCodeLine{661 }
\DoxyCodeLine{677 \textcolor{keyword}{extern} \textcolor{keywordtype}{double} theora\_granule\_time(theora\_state *th,ogg\_int64\_t granulepos);}
\DoxyCodeLine{678 }
\DoxyCodeLine{685 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} theora\_info\_init(theora\_info *c);}
\DoxyCodeLine{686 }
\DoxyCodeLine{692 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} theora\_info\_clear(theora\_info *c);}
\DoxyCodeLine{693 }
\DoxyCodeLine{698 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} theora\_clear(theora\_state *t);}
\DoxyCodeLine{699 }
\DoxyCodeLine{704 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} theora\_comment\_init(theora\_comment *tc);}
\DoxyCodeLine{705 }
\DoxyCodeLine{718 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} theora\_comment\_add(theora\_comment *tc, \textcolor{keywordtype}{char} *comment);}
\DoxyCodeLine{719 }
\DoxyCodeLine{732 \textcolor{keyword}{extern} \textcolor{keywordtype}{void} theora\_comment\_add\_tag(theora\_comment *tc,}
\DoxyCodeLine{733                                        \textcolor{keywordtype}{char} *tag, \textcolor{keywordtype}{char} *value);}
\DoxyCodeLine{734 }
\DoxyCodeLine{749 \textcolor{keyword}{extern} \textcolor{keywordtype}{char} *theora\_comment\_query(theora\_comment *tc, \textcolor{keywordtype}{char} *tag, \textcolor{keywordtype}{int} count);}
\DoxyCodeLine{750 }
\DoxyCodeLine{760 \textcolor{keyword}{extern} \textcolor{keywordtype}{int}   theora\_comment\_query\_count(theora\_comment *tc, \textcolor{keywordtype}{char} *tag);}
\DoxyCodeLine{761 }
\DoxyCodeLine{766 \textcolor{keyword}{extern} \textcolor{keywordtype}{void}  theora\_comment\_clear(theora\_comment *tc);}
\DoxyCodeLine{767 }
\DoxyCodeLine{776 \textcolor{keyword}{extern} \textcolor{keywordtype}{int} theora\_control(theora\_state *th,\textcolor{keywordtype}{int} req,\textcolor{keywordtype}{void} *buf,\textcolor{keywordtype}{size\_t} buf\_sz);}
\DoxyCodeLine{777 }
\DoxyCodeLine{778 \textcolor{comment}{/* @\} */} \textcolor{comment}{/* end oldfuncs doxygen group */}}
\DoxyCodeLine{779 }
\DoxyCodeLine{780 \textcolor{preprocessor}{\#ifdef \_\_cplusplus}}
\DoxyCodeLine{781 \}}
\DoxyCodeLine{782 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_\_cplusplus */}\textcolor{preprocessor}{}}
\DoxyCodeLine{783 }
\DoxyCodeLine{784 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_O\_THEORA\_H\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
