dbf-halloween2015

annotate libs/vorbis/envelope.h @ 3:c37fe5d8a4ed

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