annotate src/libvorbis-1.3.3/lib/envelope.h @ 17:59685d5285b1

Merge
author Chris Cannam <chris.cannam@eecs.qmul.ac.uk>
date Mon, 25 Mar 2013 12:24:36 +0000
parents 05aa0afa9217
children
rev   line source
Chris@1 1 /********************************************************************
Chris@1 2 * *
Chris@1 3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
Chris@1 4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
Chris@1 5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
Chris@1 6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
Chris@1 7 * *
Chris@1 8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
Chris@1 9 * by the Xiph.Org Foundation http://www.xiph.org/ *
Chris@1 10 * *
Chris@1 11 ********************************************************************
Chris@1 12
Chris@1 13 function: PCM data envelope analysis and manipulation
Chris@1 14 last mod: $Id: envelope.h 16227 2009-07-08 06:58:46Z xiphmont $
Chris@1 15
Chris@1 16 ********************************************************************/
Chris@1 17
Chris@1 18 #ifndef _V_ENVELOPE_
Chris@1 19 #define _V_ENVELOPE_
Chris@1 20
Chris@1 21 #include "mdct.h"
Chris@1 22
Chris@1 23 #define VE_PRE 16
Chris@1 24 #define VE_WIN 4
Chris@1 25 #define VE_POST 2
Chris@1 26 #define VE_AMP (VE_PRE+VE_POST-1)
Chris@1 27
Chris@1 28 #define VE_BANDS 7
Chris@1 29 #define VE_NEARDC 15
Chris@1 30
Chris@1 31 #define VE_MINSTRETCH 2 /* a bit less than short block */
Chris@1 32 #define VE_MAXSTRETCH 12 /* one-third full block */
Chris@1 33
Chris@1 34 typedef struct {
Chris@1 35 float ampbuf[VE_AMP];
Chris@1 36 int ampptr;
Chris@1 37
Chris@1 38 float nearDC[VE_NEARDC];
Chris@1 39 float nearDC_acc;
Chris@1 40 float nearDC_partialacc;
Chris@1 41 int nearptr;
Chris@1 42
Chris@1 43 } envelope_filter_state;
Chris@1 44
Chris@1 45 typedef struct {
Chris@1 46 int begin;
Chris@1 47 int end;
Chris@1 48 float *window;
Chris@1 49 float total;
Chris@1 50 } envelope_band;
Chris@1 51
Chris@1 52 typedef struct {
Chris@1 53 int ch;
Chris@1 54 int winlength;
Chris@1 55 int searchstep;
Chris@1 56 float minenergy;
Chris@1 57
Chris@1 58 mdct_lookup mdct;
Chris@1 59 float *mdct_win;
Chris@1 60
Chris@1 61 envelope_band band[VE_BANDS];
Chris@1 62 envelope_filter_state *filter;
Chris@1 63 int stretch;
Chris@1 64
Chris@1 65 int *mark;
Chris@1 66
Chris@1 67 long storage;
Chris@1 68 long current;
Chris@1 69 long curmark;
Chris@1 70 long cursor;
Chris@1 71 } envelope_lookup;
Chris@1 72
Chris@1 73 extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);
Chris@1 74 extern void _ve_envelope_clear(envelope_lookup *e);
Chris@1 75 extern long _ve_envelope_search(vorbis_dsp_state *v);
Chris@1 76 extern void _ve_envelope_shift(envelope_lookup *e,long shift);
Chris@1 77 extern int _ve_envelope_mark(vorbis_dsp_state *v);
Chris@1 78
Chris@1 79
Chris@1 80 #endif