media/libvorbis/lib/envelope.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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.

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

mercurial