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-2009 * nuclear@0: * by the Xiph.Org Foundation http://www.xiph.org/ * nuclear@0: * * nuclear@0: ******************************************************************** nuclear@0: nuclear@0: function: PCM data envelope analysis and manipulation nuclear@0: last mod: $Id: envelope.h 16227 2009-07-08 06:58:46Z xiphmont $ nuclear@0: nuclear@0: ********************************************************************/ nuclear@0: nuclear@0: #ifndef _V_ENVELOPE_ nuclear@0: #define _V_ENVELOPE_ nuclear@0: nuclear@0: #include "mdct.h" nuclear@0: nuclear@0: #define VE_PRE 16 nuclear@0: #define VE_WIN 4 nuclear@0: #define VE_POST 2 nuclear@0: #define VE_AMP (VE_PRE+VE_POST-1) nuclear@0: nuclear@0: #define VE_BANDS 7 nuclear@0: #define VE_NEARDC 15 nuclear@0: nuclear@0: #define VE_MINSTRETCH 2 /* a bit less than short block */ nuclear@0: #define VE_MAXSTRETCH 12 /* one-third full block */ nuclear@0: nuclear@0: typedef struct { nuclear@0: float ampbuf[VE_AMP]; nuclear@0: int ampptr; nuclear@0: nuclear@0: float nearDC[VE_NEARDC]; nuclear@0: float nearDC_acc; nuclear@0: float nearDC_partialacc; nuclear@0: int nearptr; nuclear@0: nuclear@0: } envelope_filter_state; nuclear@0: nuclear@0: typedef struct { nuclear@0: int begin; nuclear@0: int end; nuclear@0: float *window; nuclear@0: float total; nuclear@0: } envelope_band; nuclear@0: nuclear@0: typedef struct { nuclear@0: int ch; nuclear@0: int winlength; nuclear@0: int searchstep; nuclear@0: float minenergy; nuclear@0: nuclear@0: mdct_lookup mdct; nuclear@0: float *mdct_win; nuclear@0: nuclear@0: envelope_band band[VE_BANDS]; nuclear@0: envelope_filter_state *filter; nuclear@0: int stretch; nuclear@0: nuclear@0: int *mark; nuclear@0: nuclear@0: long storage; nuclear@0: long current; nuclear@0: long curmark; nuclear@0: long cursor; nuclear@0: } envelope_lookup; nuclear@0: nuclear@0: extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi); nuclear@0: extern void _ve_envelope_clear(envelope_lookup *e); nuclear@0: extern long _ve_envelope_search(vorbis_dsp_state *v); nuclear@0: extern void _ve_envelope_shift(envelope_lookup *e,long shift); nuclear@0: extern int _ve_envelope_mark(vorbis_dsp_state *v); nuclear@0: nuclear@0: nuclear@0: #endif