examples/SFExamples/oggvorbiscodec94/src/libvorbis/lib/envelope.h

00001 /********************************************************************
00002  *                                                                  *
00003  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
00004  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
00005  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
00006  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
00007  *                                                                  *
00008  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002             *
00009  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
00010  *                                                                  *
00011  ********************************************************************
00012 
00013  function: PCM data envelope analysis and manipulation
00014  last mod: $Id: envelope.h 7187 2004-07-20 07:24:27Z xiphmont $
00015 
00016  ********************************************************************/
00017 
00018 #ifndef _V_ENVELOPE_
00019 #define _V_ENVELOPE_
00020 
00021 #include "mdct.h"
00022 
00023 #define VE_PRE    16
00024 #define VE_WIN    4
00025 #define VE_POST   2
00026 #define VE_AMP    (VE_PRE+VE_POST-1)
00027 
00028 #define VE_BANDS  7
00029 #define VE_NEARDC 15
00030 
00031 #define VE_MINSTRETCH 2   /* a bit less than short block */
00032 #define VE_MAXSTRETCH 12  /* one-third full block */
00033 
00034 typedef struct {
00035   float ampbuf[VE_AMP];
00036   int   ampptr;
00037 
00038   float nearDC[VE_NEARDC];
00039   float nearDC_acc;
00040   float nearDC_partialacc;
00041   int   nearptr;
00042 
00043 } envelope_filter_state;
00044 
00045 typedef struct {
00046   int begin;
00047   int end;
00048   float *window;
00049   float total;
00050 } envelope_band;
00051 
00052 typedef struct {
00053   int ch;
00054   int winlength;
00055   int searchstep;
00056   float minenergy;
00057 
00058   mdct_lookup  mdct;
00059   float       *mdct_win;
00060 
00061   envelope_band          band[VE_BANDS];
00062   envelope_filter_state *filter;
00063   int   stretch;
00064 
00065   int                   *mark;
00066 
00067   long storage;
00068   long current;
00069   long curmark;
00070   long cursor;
00071 } envelope_lookup;
00072 
00073 extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);
00074 extern void _ve_envelope_clear(envelope_lookup *e);
00075 extern long _ve_envelope_search(vorbis_dsp_state *v);
00076 extern void _ve_envelope_shift(envelope_lookup *e,long shift);
00077 extern int  _ve_envelope_mark(vorbis_dsp_state *v);
00078 
00079 
00080 #endif
00081 

Generated by  doxygen 1.6.2