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