doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
psy.h
Go to the documentation of this file.
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-2002 *
9  * by the XIPHOPHORUS Company http://www.xiph.org/ *
10  * *
11  ********************************************************************
12 
13  function: random psychoacoustics (not including preecho)
14  last mod: $Id: psy.h,v 1.32 2002/07/13 06:12:47 xiphmont Exp $
15 
16  ********************************************************************/
17 
18 #ifndef _V_PSY_H_
19 #define _V_PSY_H_
20 #include "smallft.h"
21 
22 #include "backends.h"
23 #include "envelope.h"
24 
25 #ifndef EHMER_MAX
26 #define EHMER_MAX 56
27 #endif
28 
29 /* psychoacoustic setup ********************************************/
30 #define P_BANDS 17 /* 62Hz to 16kHz */
31 #define P_LEVELS 8 /* 30dB to 100dB */
32 #define P_LEVEL_0 30. /* 30 dB */
33 #define P_NOISECURVES 3
34 
35 #define NOISE_COMPAND_LEVELS 40
36 typedef struct vorbis_info_psy{
37  int blockflag;
38 
39  float ath_adjatt;
40  float ath_maxatt;
41 
44  float tone_decay;
46  float toneatt[P_BANDS];
47 
49  float noisemaxsupp;
57 
58  float max_curve_dB;
59 
64  double normal_thresh;
66 
67 typedef struct{
69 
70  /* for block long/short tuning; encode only */
71  float preecho_thresh[VE_BANDS];
72  float postecho_thresh[VE_BANDS];
75 
77 
78  /* channel coupling config */
79  int coupling_pkHz[PACKETBLOBS];
80  int coupling_pointlimit[2][PACKETBLOBS];
81  int coupling_prepointamp[PACKETBLOBS];
82  int coupling_postpointamp[PACKETBLOBS];
83  int sliding_lowpass[2][PACKETBLOBS];
84 
86 
87 typedef struct {
88  float ampmax;
89  int channels;
90 
92  int coupling_pointlimit[2][P_NOISECURVES];
94 
95 
96 typedef struct {
97  int n;
99 
100  float ***tonecurves;
101  float **noiseoffset;
102 
103  float *ath;
104  long *octave; /* in n.ocshift format */
105  long *bark;
106 
107  long firstoc;
108  long shiftoc;
109  int eighth_octave_lines; /* power of two, please */
111  long rate; /* cache it */
113 
115  vorbis_info_psy_global *gi,int n,long rate);
116 extern void _vp_psy_clear(vorbis_look_psy *p);
117 extern void *_vi_psy_dup(void *source);
118 
119 extern void _vi_psy_free(vorbis_info_psy *i);
121 
122 extern void _vp_remove_floor(vorbis_look_psy *p,
123  float *mdct,
124  int *icodedflr,
125  float *residue,
126  int sliding_lowpass);
127 
128 extern void _vp_noisemask(vorbis_look_psy *p,
129  float *logmdct,
130  float *logmask);
131 
132 extern void _vp_tonemask(vorbis_look_psy *p,
133  float *logfft,
134  float *logmask,
135  float global_specmax,
136  float local_specmax);
137 
139  float *noise,
140  float *tone,
141  int offset_select,
142  float *logmask);
143 
144 extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
145 
146 extern float **_vp_quantize_couple_memo(vorbis_block *vb,
150  float **mdct);
151 
152 extern void _vp_couple(int blobno,
156  float **res,
157  float **mag_memo,
158  int **mag_sort,
159  int **ifloor,
160  int *nonzero,
161  int sliding_lowpass);
162 
164  float *in,float *out,int *sortedindex);
165 
167  float *magnitudes,int *sortedindex);
168 
169 extern int **_vp_quantize_couple_sort(vorbis_block *vb,
172  float **mags);
173 
174 #endif
175 
float ** _vp_quantize_couple_memo(vorbis_block *vb, vorbis_info_psy_global *g, vorbis_look_psy *p, vorbis_info_mapping0 *vi, float **mdct)
Definition: psy.c:944
GLubyte g
Definition: glext.h:4662
#define PACKETBLOBS
float ** noiseoffset
Definition: psy.h:101
vorbis_info_psy * _vi_psy_copy(vorbis_info_psy *i)
#define VE_BANDS
Definition: envelope.h:28
float ath_adjatt
Definition: psy.h:39
float * ath
Definition: psy.h:103
int noisewindowlomin
Definition: psy.h:52
long * bark
Definition: psy.h:105
void _vp_remove_floor(vorbis_look_psy *p, float *mdct, int *icodedflr, float *residue, int sliding_lowpass)
Definition: psy.c:752
GLenum GLsizei n
Definition: glext.h:3705
void _vp_noise_normalize_sort(vorbis_look_psy *p, float *magnitudes, int *sortedindex)
Definition: psy.c:1000
int noisewindowhimin
Definition: psy.h:53
void _vp_offset_and_mix(vorbis_look_psy *p, float *noise, float *tone, int offset_select, float *logmask)
Definition: psy.c:844
float noisewindowhi
Definition: psy.h:51
long rate
Definition: psy.h:111
int eighth_octave_lines
Definition: psy.h:68
#define P_BANDS
Definition: psy.h:30
float tone_centerboost
Definition: psy.h:43
int normal_point_p
Definition: psy.h:61
long firstoc
Definition: psy.h:107
float noisemaxsupp
Definition: psy.h:49
long * octave
Definition: psy.h:104
int i
Definition: process.py:33
struct vorbis_info_psy * vi
Definition: psy.h:98
float noiseoff[P_NOISECURVES][P_BANDS]
Definition: psy.h:55
float ath_maxatt
Definition: psy.h:40
double normal_thresh
Definition: psy.h:64
int ** _vp_quantize_couple_sort(vorbis_block *vb, vorbis_look_psy *p, vorbis_info_mapping0 *vi, float **mags)
Definition: psy.c:974
vorbis_info_psy_global * gi
Definition: psy.h:91
GLsizei GLsizei GLcharARB * source
Definition: glext.h:3633
float noisewindowlo
Definition: psy.h:50
float *** tonecurves
Definition: psy.h:100
float ampmax_att_per_sec
Definition: psy.h:76
int blockflag
Definition: psy.h:37
void _vp_tonemask(vorbis_look_psy *p, float *logfft, float *logmask, float global_specmax, float local_specmax)
Definition: psy.c:819
void _vp_psy_clear(vorbis_look_psy *p)
Definition: psy.c:350
int noisemaskp
Definition: psy.h:48
int normal_partition
Definition: psy.h:63
#define NOISE_COMPAND_LEVELS
Definition: psy.h:35
#define P_NOISECURVES
Definition: psy.h:33
int normal_channel_p
Definition: psy.h:60
long shiftoc
Definition: psy.h:108
float noisecompand[NOISE_COMPAND_LEVELS]
Definition: psy.h:56
int eighth_octave_lines
Definition: psy.h:109
float _vp_ampmax_decay(float amp, vorbis_dsp_state *vd)
Definition: psy.c:859
float tone_decay
Definition: psy.h:44
int noisewindowfixed
Definition: psy.h:54
float toneatt[P_BANDS]
Definition: psy.h:46
void _vp_noise_normalize(vorbis_look_psy *p, float *in, float *out, int *sortedindex)
Definition: psy.c:1018
float tone_masteratt[P_NOISECURVES]
Definition: psy.h:42
struct vorbis_info_psy vorbis_info_psy
void _vi_psy_free(vorbis_info_psy *i)
Definition: psy.c:61
void _vp_psy_init(vorbis_look_psy *p, vorbis_info_psy *vi, vorbis_info_psy_global *gi, int n, long rate)
Definition: psy.c:266
GLuint in
Definition: glext.h:5388
float tone_abs_limit
Definition: psy.h:45
void * _vi_psy_dup(void *source)
GLuint res
Definition: glext.h:5385
float preecho_minenergy
Definition: psy.h:74
float max_curve_dB
Definition: psy.h:58
GLfloat GLfloat p
Definition: glext.h:4674
int total_octave_lines
Definition: psy.h:110
void _vp_couple(int blobno, vorbis_info_psy_global *g, vorbis_look_psy *p, vorbis_info_mapping0 *vi, float **res, float **mag_memo, int **mag_sort, int **ifloor, int *nonzero, int sliding_lowpass)
Definition: psy.c:1064
void _vp_noisemask(vorbis_look_psy *p, float *logmdct, float *logmask)
Definition: psy.c:771
float stretch_penalty
Definition: psy.h:73
int normal_start
Definition: psy.h:62