6948a2201b41a19f1248a069b2c5b5c9d29fd84b
[platform/upstream/libvorbis.git] / include / vorbis / vorbisenc.h
1 /********************************************************************
2  *                                                                  *
3  * THIS FILE IS PART OF THE OggVorbis 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 OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
9  * by the Xiph.Org Foundation http://www.xiph.org/                  *
10  *                                                                  *
11  ********************************************************************
12
13  function: vorbis encode-engine setup
14  last mod: $Id$
15
16  ********************************************************************/
17
18 #ifndef _OV_ENC_H_
19 #define _OV_ENC_H_
20
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif /* __cplusplus */
25
26 #include "codec.h"
27
28 extern int vorbis_encode_init(vorbis_info *vi,
29                               long channels,
30                               long rate,
31
32                               long max_bitrate,
33                               long nominal_bitrate,
34                               long min_bitrate);
35
36 extern int vorbis_encode_setup_managed(vorbis_info *vi,
37                                        long channels,
38                                        long rate,
39
40                                        long max_bitrate,
41                                        long nominal_bitrate,
42                                        long min_bitrate);
43
44 extern int vorbis_encode_setup_vbr(vorbis_info *vi,
45                                   long channels,
46                                   long rate,
47
48                                   float quality /* quality level from 0. (lo) to 1. (hi) */
49                                   );
50
51 extern int vorbis_encode_init_vbr(vorbis_info *vi,
52                                   long channels,
53                                   long rate,
54
55                                   float base_quality /* quality level from 0. (lo) to 1. (hi) */
56                                   );
57
58 extern int vorbis_encode_setup_init(vorbis_info *vi);
59
60 extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
61
62 struct ovectl_ratemanage_arg {
63   int    management_active;
64
65   long   bitrate_hard_min;
66   long   bitrate_hard_max;
67   double bitrate_hard_window;
68
69   long   bitrate_av_lo;
70   long   bitrate_av_hi;
71   double bitrate_av_window;
72   double bitrate_av_window_center;
73 };
74
75 struct ovectl_ratemanage2_arg {
76   int    management_active;
77
78   long   bitrate_limit_min_kbps;
79   long   bitrate_limit_max_kbps;
80   long   bitrate_limit_reservoir_bits;
81   double bitrate_limit_reservoir_bias;
82
83   long   bitrate_average_kbps;
84   double bitrate_average_damping;
85 };
86
87
88   /* new rate setup */
89 #define OV_ECTL_RATEMANAGE2_GET      0x14
90 #define OV_ECTL_RATEMANAGE2_SET      0x15
91
92 #define OV_ECTL_LOWPASS_GET          0x20
93 #define OV_ECTL_LOWPASS_SET          0x21
94
95 #define OV_ECTL_IBLOCK_GET           0x30
96 #define OV_ECTL_IBLOCK_SET           0x31
97
98   /* deprecated rate management supported only for compatability */
99 #define OV_ECTL_RATEMANAGE_GET       0x10
100 #define OV_ECTL_RATEMANAGE_SET       0x11
101 #define OV_ECTL_RATEMANAGE_AVG       0x12
102 #define OV_ECTL_RATEMANAGE_HARD      0x13
103
104 #ifdef __cplusplus
105 }
106 #endif /* __cplusplus */
107
108 #endif
109
110