nuclear@0: /******************************************************************** nuclear@0: * * nuclear@0: * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * nuclear@0: * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * nuclear@0: * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * nuclear@0: * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * nuclear@0: * * nuclear@0: * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * nuclear@0: * by the Xiph.Org Foundation http://www.xiph.org/ * nuclear@0: * * nuclear@0: ******************************************************************** nuclear@0: nuclear@0: function: bitrate tracking and management nuclear@0: last mod: $Id: bitrate.h 13293 2007-07-24 00:09:47Z xiphmont $ nuclear@0: nuclear@0: ********************************************************************/ nuclear@0: nuclear@0: #ifndef _V_BITRATE_H_ nuclear@0: #define _V_BITRATE_H_ nuclear@0: nuclear@0: #include "vorbis/codec.h" nuclear@0: #include "codec_internal.h" nuclear@0: #include "os.h" nuclear@0: nuclear@0: /* encode side bitrate tracking */ nuclear@0: typedef struct bitrate_manager_state { nuclear@0: int managed; nuclear@0: nuclear@0: long avg_reservoir; nuclear@0: long minmax_reservoir; nuclear@0: long avg_bitsper; nuclear@0: long min_bitsper; nuclear@0: long max_bitsper; nuclear@0: nuclear@0: long short_per_long; nuclear@0: double avgfloat; nuclear@0: nuclear@0: vorbis_block *vb; nuclear@0: int choice; nuclear@0: } bitrate_manager_state; nuclear@0: nuclear@0: typedef struct bitrate_manager_info{ nuclear@0: long avg_rate; nuclear@0: long min_rate; nuclear@0: long max_rate; nuclear@0: long reservoir_bits; nuclear@0: double reservoir_bias; nuclear@0: nuclear@0: double slew_damp; nuclear@0: nuclear@0: } bitrate_manager_info; nuclear@0: nuclear@0: extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs); nuclear@0: extern void vorbis_bitrate_clear(bitrate_manager_state *bs); nuclear@0: extern int vorbis_bitrate_managed(vorbis_block *vb); nuclear@0: extern int vorbis_bitrate_addblock(vorbis_block *vb); nuclear@0: extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op); nuclear@0: nuclear@0: #endif