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