1 /********************************************************************
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. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
9 * by the Xiph.Org Foundation https://xiph.org/ *
11 ********************************************************************
13 function: bitrate tracking and management
15 ********************************************************************/
20 #include "vorbis/codec.h"
23 /* encode side bitrate tracking */
24 typedef struct bitrate_manager_state {
28 long minmax_reservoir;
38 } bitrate_manager_state;
40 typedef struct bitrate_manager_info{
45 double reservoir_bias;
49 } bitrate_manager_info;
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);