libtheora  1.2.0
theoraenc.h
Go to the documentation of this file.
1 /********************************************************************
2  * *
3  * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7  * *
8  * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
9  * by the Xiph.Org Foundation https://www.xiph.org/ *
10  * *
11  ********************************************************************
12 
13  function:
14 
15  ********************************************************************/
16 
20 #if !defined(OGG_THEORA_THEORAENC_HEADER)
21 # define OGG_THEORA_THEORAENC_HEADER (1)
22 # include <stddef.h>
23 # include <ogg/ogg.h>
24 # include "codec.h"
25 
26 #if defined(__cplusplus)
27 extern "C" {
28 #endif
29 
30 
31 
52 #define TH_ENCCTL_SET_HUFFMAN_CODES (0)
53 
65 #define TH_ENCCTL_SET_QUANT_PARAMS (2)
66 
78 #define TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE (4)
79 
106 #define TH_ENCCTL_SET_VP3_COMPATIBLE (10)
107 
120 #define TH_ENCCTL_GET_SPLEVEL_MAX (12)
121 
134 #define TH_ENCCTL_SET_SPLEVEL (14)
135 
148 #define TH_ENCCTL_GET_SPLEVEL (16)
149 
174 #define TH_ENCCTL_SET_DUP_COUNT (18)
175 
194 #define TH_ENCCTL_SET_RATE_FLAGS (20)
195 
220 #define TH_ENCCTL_SET_RATE_BUFFER (22)
221 
250 #define TH_ENCCTL_2PASS_OUT (24)
251 
296 #define TH_ENCCTL_2PASS_IN (26)
297 
312 #define TH_ENCCTL_SET_QUALITY (28)
313 
337 #define TH_ENCCTL_SET_BITRATE (30)
338 
377 #define TH_ENCCTL_SET_COMPAT_CONFIG (32)
378 
390 #define TH_RATECTL_DROP_FRAMES (0x1)
391 
398 #define TH_RATECTL_CAP_OVERFLOW (0x2)
399 
405 #define TH_RATECTL_CAP_UNDERFLOW (0x4)
406 
411 extern const th_quant_info TH_VP31_QUANT_INFO;
412 
414 extern const th_huff_code
416 
417 
418 
426 typedef struct th_enc_ctx th_enc_ctx;
456 extern th_enc_ctx *th_encode_alloc(const th_info *_info);
468 extern int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,size_t _buf_sz);
486 extern int th_encode_flushheader(th_enc_ctx *_enc,
487  th_comment *_comments,ogg_packet *_op);
510 extern int th_encode_ycbcr_in(th_enc_ctx *_enc,th_ycbcr_buffer _ycbcr);
534 extern int th_encode_packetout(th_enc_ctx *_enc,int _last,ogg_packet *_op);
537 extern void th_encode_free(th_enc_ctx *_enc);
540 
541 
542 
543 #if defined(__cplusplus)
544 }
545 #endif
546 
547 #endif /* OGG_THEORA_THEORAENC_HEADER */
int th_encode_ctl(th_enc_ctx *_enc, int _req, void *_buf, size_t _buf_sz)
Encoder control function.
A complete set of quantization parameters.
Definition: codec.h:411
Theora bitstream information.
Definition: codec.h:206
A Huffman code for a Theora DCT token.
Definition: codec.h:440
The comment information.
Definition: codec.h:325
const th_huff_code TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]
The Huffman tables used by VP3.
The shared libtheoradec and libtheoraenc C API.
int th_encode_packetout(th_enc_ctx *_enc, int _last, ogg_packet *_op)
Retrieves encoded video data packets.
void th_encode_free(th_enc_ctx *_enc)
Frees an allocated encoder instance.
#define TH_NHUFFMAN_TABLES
The number of Huffman tables used by Theora.
Definition: codec.h:425
const th_quant_info TH_VP31_QUANT_INFO
The quantization parameters used by VP3.
#define TH_NDCT_TOKENS
The number of DCT token values in each table.
Definition: codec.h:427
struct th_enc_ctx th_enc_ctx
The encoder context.
Definition: theoraenc.h:426
th_img_plane th_ycbcr_buffer[3]
A complete image buffer for an uncompressed frame.
Definition: codec.h:170
int th_encode_ycbcr_in(th_enc_ctx *_enc, th_ycbcr_buffer _ycbcr)
Submits an uncompressed frame to the encoder.
th_enc_ctx * th_encode_alloc(const th_info *_info)
Allocates an encoder instance.
int th_encode_flushheader(th_enc_ctx *_enc, th_comment *_comments, ogg_packet *_op)
Outputs the next header packet.