vrshoot

diff libs/vorbis/envelope.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/vorbis/envelope.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,80 @@
     1.4 +/********************************************************************
     1.5 + *                                                                  *
     1.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
     1.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
     1.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
     1.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
    1.10 + *                                                                  *
    1.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
    1.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
    1.13 + *                                                                  *
    1.14 + ********************************************************************
    1.15 +
    1.16 + function: PCM data envelope analysis and manipulation
    1.17 + last mod: $Id: envelope.h 16227 2009-07-08 06:58:46Z xiphmont $
    1.18 +
    1.19 + ********************************************************************/
    1.20 +
    1.21 +#ifndef _V_ENVELOPE_
    1.22 +#define _V_ENVELOPE_
    1.23 +
    1.24 +#include "mdct.h"
    1.25 +
    1.26 +#define VE_PRE    16
    1.27 +#define VE_WIN    4
    1.28 +#define VE_POST   2
    1.29 +#define VE_AMP    (VE_PRE+VE_POST-1)
    1.30 +
    1.31 +#define VE_BANDS  7
    1.32 +#define VE_NEARDC 15
    1.33 +
    1.34 +#define VE_MINSTRETCH 2   /* a bit less than short block */
    1.35 +#define VE_MAXSTRETCH 12  /* one-third full block */
    1.36 +
    1.37 +typedef struct {
    1.38 +  float ampbuf[VE_AMP];
    1.39 +  int   ampptr;
    1.40 +
    1.41 +  float nearDC[VE_NEARDC];
    1.42 +  float nearDC_acc;
    1.43 +  float nearDC_partialacc;
    1.44 +  int   nearptr;
    1.45 +
    1.46 +} envelope_filter_state;
    1.47 +
    1.48 +typedef struct {
    1.49 +  int begin;
    1.50 +  int end;
    1.51 +  float *window;
    1.52 +  float total;
    1.53 +} envelope_band;
    1.54 +
    1.55 +typedef struct {
    1.56 +  int ch;
    1.57 +  int winlength;
    1.58 +  int searchstep;
    1.59 +  float minenergy;
    1.60 +
    1.61 +  mdct_lookup  mdct;
    1.62 +  float       *mdct_win;
    1.63 +
    1.64 +  envelope_band          band[VE_BANDS];
    1.65 +  envelope_filter_state *filter;
    1.66 +  int   stretch;
    1.67 +
    1.68 +  int                   *mark;
    1.69 +
    1.70 +  long storage;
    1.71 +  long current;
    1.72 +  long curmark;
    1.73 +  long cursor;
    1.74 +} envelope_lookup;
    1.75 +
    1.76 +extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);
    1.77 +extern void _ve_envelope_clear(envelope_lookup *e);
    1.78 +extern long _ve_envelope_search(vorbis_dsp_state *v);
    1.79 +extern void _ve_envelope_shift(envelope_lookup *e,long shift);
    1.80 +extern int  _ve_envelope_mark(vorbis_dsp_state *v);
    1.81 +
    1.82 +
    1.83 +#endif