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