vrshoot

annotate libs/vorbis/psy.h @ 2:334d17aed7de

visual studio project files
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 18:36:38 +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: random psychoacoustics (not including preecho)
nuclear@0 14 last mod: $Id: psy.h 16946 2010-03-03 16:12:40Z xiphmont $
nuclear@0 15
nuclear@0 16 ********************************************************************/
nuclear@0 17
nuclear@0 18 #ifndef _V_PSY_H_
nuclear@0 19 #define _V_PSY_H_
nuclear@0 20 #include "smallft.h"
nuclear@0 21
nuclear@0 22 #include "backends.h"
nuclear@0 23 #include "envelope.h"
nuclear@0 24
nuclear@0 25 #ifndef EHMER_MAX
nuclear@0 26 #define EHMER_MAX 56
nuclear@0 27 #endif
nuclear@0 28
nuclear@0 29 /* psychoacoustic setup ********************************************/
nuclear@0 30 #define P_BANDS 17 /* 62Hz to 16kHz */
nuclear@0 31 #define P_LEVELS 8 /* 30dB to 100dB */
nuclear@0 32 #define P_LEVEL_0 30. /* 30 dB */
nuclear@0 33 #define P_NOISECURVES 3
nuclear@0 34
nuclear@0 35 #define NOISE_COMPAND_LEVELS 40
nuclear@0 36 typedef struct vorbis_info_psy{
nuclear@0 37 int blockflag;
nuclear@0 38
nuclear@0 39 float ath_adjatt;
nuclear@0 40 float ath_maxatt;
nuclear@0 41
nuclear@0 42 float tone_masteratt[P_NOISECURVES];
nuclear@0 43 float tone_centerboost;
nuclear@0 44 float tone_decay;
nuclear@0 45 float tone_abs_limit;
nuclear@0 46 float toneatt[P_BANDS];
nuclear@0 47
nuclear@0 48 int noisemaskp;
nuclear@0 49 float noisemaxsupp;
nuclear@0 50 float noisewindowlo;
nuclear@0 51 float noisewindowhi;
nuclear@0 52 int noisewindowlomin;
nuclear@0 53 int noisewindowhimin;
nuclear@0 54 int noisewindowfixed;
nuclear@0 55 float noiseoff[P_NOISECURVES][P_BANDS];
nuclear@0 56 float noisecompand[NOISE_COMPAND_LEVELS];
nuclear@0 57
nuclear@0 58 float max_curve_dB;
nuclear@0 59
nuclear@0 60 int normal_p;
nuclear@0 61 int normal_start;
nuclear@0 62 int normal_partition;
nuclear@0 63 double normal_thresh;
nuclear@0 64 } vorbis_info_psy;
nuclear@0 65
nuclear@0 66 typedef struct{
nuclear@0 67 int eighth_octave_lines;
nuclear@0 68
nuclear@0 69 /* for block long/short tuning; encode only */
nuclear@0 70 float preecho_thresh[VE_BANDS];
nuclear@0 71 float postecho_thresh[VE_BANDS];
nuclear@0 72 float stretch_penalty;
nuclear@0 73 float preecho_minenergy;
nuclear@0 74
nuclear@0 75 float ampmax_att_per_sec;
nuclear@0 76
nuclear@0 77 /* channel coupling config */
nuclear@0 78 int coupling_pkHz[PACKETBLOBS];
nuclear@0 79 int coupling_pointlimit[2][PACKETBLOBS];
nuclear@0 80 int coupling_prepointamp[PACKETBLOBS];
nuclear@0 81 int coupling_postpointamp[PACKETBLOBS];
nuclear@0 82 int sliding_lowpass[2][PACKETBLOBS];
nuclear@0 83
nuclear@0 84 } vorbis_info_psy_global;
nuclear@0 85
nuclear@0 86 typedef struct {
nuclear@0 87 float ampmax;
nuclear@0 88 int channels;
nuclear@0 89
nuclear@0 90 vorbis_info_psy_global *gi;
nuclear@0 91 int coupling_pointlimit[2][P_NOISECURVES];
nuclear@0 92 } vorbis_look_psy_global;
nuclear@0 93
nuclear@0 94
nuclear@0 95 typedef struct {
nuclear@0 96 int n;
nuclear@0 97 struct vorbis_info_psy *vi;
nuclear@0 98
nuclear@0 99 float ***tonecurves;
nuclear@0 100 float **noiseoffset;
nuclear@0 101
nuclear@0 102 float *ath;
nuclear@0 103 long *octave; /* in n.ocshift format */
nuclear@0 104 long *bark;
nuclear@0 105
nuclear@0 106 long firstoc;
nuclear@0 107 long shiftoc;
nuclear@0 108 int eighth_octave_lines; /* power of two, please */
nuclear@0 109 int total_octave_lines;
nuclear@0 110 long rate; /* cache it */
nuclear@0 111
nuclear@0 112 float m_val; /* Masking compensation value */
nuclear@0 113
nuclear@0 114 } vorbis_look_psy;
nuclear@0 115
nuclear@0 116 extern void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
nuclear@0 117 vorbis_info_psy_global *gi,int n,long rate);
nuclear@0 118 extern void _vp_psy_clear(vorbis_look_psy *p);
nuclear@0 119 extern void *_vi_psy_dup(void *source);
nuclear@0 120
nuclear@0 121 extern void _vi_psy_free(vorbis_info_psy *i);
nuclear@0 122 extern vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i);
nuclear@0 123
nuclear@0 124 extern void _vp_noisemask(vorbis_look_psy *p,
nuclear@0 125 float *logmdct,
nuclear@0 126 float *logmask);
nuclear@0 127
nuclear@0 128 extern void _vp_tonemask(vorbis_look_psy *p,
nuclear@0 129 float *logfft,
nuclear@0 130 float *logmask,
nuclear@0 131 float global_specmax,
nuclear@0 132 float local_specmax);
nuclear@0 133
nuclear@0 134 extern void _vp_offset_and_mix(vorbis_look_psy *p,
nuclear@0 135 float *noise,
nuclear@0 136 float *tone,
nuclear@0 137 int offset_select,
nuclear@0 138 float *logmask,
nuclear@0 139 float *mdct,
nuclear@0 140 float *logmdct);
nuclear@0 141
nuclear@0 142 extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
nuclear@0 143
nuclear@0 144 extern void _vp_couple_quantize_normalize(int blobno,
nuclear@0 145 vorbis_info_psy_global *g,
nuclear@0 146 vorbis_look_psy *p,
nuclear@0 147 vorbis_info_mapping0 *vi,
nuclear@0 148 float **mdct,
nuclear@0 149 int **iwork,
nuclear@0 150 int *nonzero,
nuclear@0 151 int sliding_lowpass,
nuclear@0 152 int ch);
nuclear@0 153
nuclear@0 154 #endif