]> git.tdb.fi Git - ext/vorbisfile.git/blob - lib/bitrate.h
Add headers to the library component so dependencies work correctly
[ext/vorbisfile.git] / lib / bitrate.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-2007             *
9  * by the Xiph.Org Foundation https://xiph.org/                     *
10  *                                                                  *
11  ********************************************************************
12
13  function: bitrate tracking and management
14
15  ********************************************************************/
16
17 #ifndef _V_BITRATE_H_
18 #define _V_BITRATE_H_
19
20 #include "vorbis/codec.h"
21 #include "os.h"
22
23 /* encode side bitrate tracking */
24 typedef struct bitrate_manager_state {
25   int            managed;
26
27   long           avg_reservoir;
28   long           minmax_reservoir;
29   long           avg_bitsper;
30   long           min_bitsper;
31   long           max_bitsper;
32
33   long           short_per_long;
34   double         avgfloat;
35
36   vorbis_block  *vb;
37   int            choice;
38 } bitrate_manager_state;
39
40 typedef struct bitrate_manager_info{
41   long           avg_rate;
42   long           min_rate;
43   long           max_rate;
44   long           reservoir_bits;
45   double         reservoir_bias;
46
47   double         slew_damp;
48
49 } bitrate_manager_info;
50
51 extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs);
52 extern void vorbis_bitrate_clear(bitrate_manager_state *bs);
53 extern int vorbis_bitrate_managed(vorbis_block *vb);
54 extern int vorbis_bitrate_addblock(vorbis_block *vb);
55 extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op);
56
57 #endif