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