dbf-halloween2015
view libs/vorbis/bitrate.h @ 3:c37fe5d8a4ed
windows port
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Nov 2015 06:04:28 +0200 |
parents | |
children |
line source
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 http://www.xiph.org/ *
10 * *
11 ********************************************************************
13 function: bitrate tracking and management
14 last mod: $Id: bitrate.h 13293 2007-07-24 00:09:47Z xiphmont $
16 ********************************************************************/
18 #ifndef _V_BITRATE_H_
19 #define _V_BITRATE_H_
21 #include "vorbis/codec.h"
22 #include "codec_internal.h"
23 #include "os.h"
25 /* encode side bitrate tracking */
26 typedef struct bitrate_manager_state {
27 int managed;
29 long avg_reservoir;
30 long minmax_reservoir;
31 long avg_bitsper;
32 long min_bitsper;
33 long max_bitsper;
35 long short_per_long;
36 double avgfloat;
38 vorbis_block *vb;
39 int choice;
40 } bitrate_manager_state;
42 typedef struct bitrate_manager_info{
43 long avg_rate;
44 long min_rate;
45 long max_rate;
46 long reservoir_bits;
47 double reservoir_bias;
49 double slew_damp;
51 } bitrate_manager_info;
53 extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs);
54 extern void vorbis_bitrate_clear(bitrate_manager_state *bs);
55 extern int vorbis_bitrate_managed(vorbis_block *vb);
56 extern int vorbis_bitrate_addblock(vorbis_block *vb);
57 extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op);
59 #endif