zenilib: zenilib/jni/external/libvorbis/lib/psy.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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-2009 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
10 * *
11 ********************************************************************
12
13 function: random psychoacoustics (not including preecho)
14 last mod: $Id: psy.h 16946 2010-03-03 16:12:40Z xiphmont $
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
42 float tone_masteratt[P_NOISECURVES];
43 float tone_centerboost;
44 float tone_decay;
45 float tone_abs_limit;
46 float toneatt[P_BANDS];
47
48 int noisemaskp;
49 float noisemaxsupp;
50 float noisewindowlo;
51 float noisewindowhi;
52 int noisewindowlomin;
53 int noisewindowhimin;
54 int noisewindowfixed;
55 float noiseoff[P_NOISECURVES][P_BANDS];
56 float noisecompand[NOISE_COMPAND_LEVELS];
57
58 float max_curve_dB;
59
60 int normal_p;
61 int normal_start;
62 int normal_partition;
63 double normal_thresh;
64 } vorbis_info_psy;
65
66 typedef struct{
67 int eighth_octave_lines;
68
69 /* for block long/short tuning; encode only */
70 float preecho_thresh[VE_BANDS];
71 float postecho_thresh[VE_BANDS];
72 float stretch_penalty;
73 float preecho_minenergy;
74
75 float ampmax_att_per_sec;
76
77 /* channel coupling config */
78 int coupling_pkHz[PACKETBLOBS];
79 int coupling_pointlimit[2][PACKETBLOBS];
80 int coupling_prepointamp[PACKETBLOBS];
81 int coupling_postpointamp[PACKETBLOBS];
82 int sliding_lowpass[2][PACKETBLOBS];
83
84 } vorbis_info_psy_global;
85
86 typedef struct {
87 float ampmax;
88 int channels;
89
90 vorbis_info_psy_global *gi;
91 int coupling_pointlimit[2][P_NOISECURVES];
92 } vorbis_look_psy_global;
93
94
95 typedef struct {
96 int n;
97 struct vorbis_info_psy *vi;
98
99 float ***tonecurves;
100 float **noiseoffset;
101
102 float *ath;
103 long *octave; /* in n.ocshift format */
104 long *bark;
105
106 long firstoc;
107 long shiftoc;
108 int eighth_octave_lines; /* power of two, please */
109 int total_octave_lines;
110 long rate; /* cache it */
111
112 float m_val; /* Masking compensation value */
113
114 } vorbis_look_psy;
115
116 extern void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
117 vorbis_info_psy_global *gi,int n,long rate);
118 extern void _vp_psy_clear(vorbis_look_psy *p);
119 extern void *_vi_psy_dup(void *source);
120
121 extern void _vi_psy_free(vorbis_info_psy *i);
122 extern vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i);
123
124 extern void _vp_noisemask(vorbis_look_psy *p,
125 float *logmdct,
126 float *logmask);
127
128 extern void _vp_tonemask(vorbis_look_psy *p,
129 float *logfft,
130 float *logmask,
131 float global_specmax,
132 float local_specmax);
133
134 extern void _vp_offset_and_mix(vorbis_look_psy *p,
135 float *noise,
136 float *tone,
137 int offset_select,
138 float *logmask,
139 float *mdct,
140 float *logmdct);
141
142 extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
143
144 extern void _vp_couple_quantize_normalize(int blobno,
145 vorbis_info_psy_global *g,
146 vorbis_look_psy *p,
147 vorbis_info_mapping0 *vi,
148 float **mdct,
149 int **iwork,
150 int *nonzero,
151 int sliding_lowpass,
152 int ch);
153
154 #endif
PACKETBLOBS
#define PACKETBLOBS
Definition: codec_internal.h:29
vorbis_info_psy
Definition: psy.h:36
_vp_tonemask
void _vp_tonemask(vorbis_look_psy *p, float *logfft, float *logmask, float global_specmax, float local_specmax)
Definition: psy.c:747
vorbis_look_psy::noiseoffset
float ** noiseoffset
Definition: psy.h:100
_vi_psy_copy
vorbis_info_psy * _vi_psy_copy(vorbis_info_psy *i)
VE_BANDS
#define VE_BANDS
Definition: envelope.h:28
vorbis_info_psy::ath_adjatt
float ath_adjatt
Definition: psy.h:39
g
GLboolean GLboolean g
Definition: glew.h:8736
vorbis_look_psy::ath
float * ath
Definition: psy.h:102
vorbis_info_psy::noisewindowlomin
int noisewindowlomin
Definition: psy.h:52
vorbis_look_psy::bark
long * bark
Definition: psy.h:104
n
GLclampd n
Definition: glew.h:7287
_vp_offset_and_mix
void _vp_offset_and_mix(vorbis_look_psy *p, float *noise, float *tone, int offset_select, float *logmask, float *mdct, float *logmdct)
Definition: psy.c:772
_vp_ampmax_decay
float _vp_ampmax_decay(float amp, vorbis_dsp_state *vd)
Definition: psy.c:830
vorbis_info_psy::noisewindowhimin
int noisewindowhimin
Definition: psy.h:53
vorbis_look_psy
Definition: psy.h:95
vorbis_info_psy::noisewindowhi
float noisewindowhi
Definition: psy.h:51
vorbis_look_psy::rate
long rate
Definition: psy.h:110
vorbis_look_psy_global
Definition: psy.h:86
vorbis_info_psy_global::eighth_octave_lines
int eighth_octave_lines
Definition: psy.h:67
P_BANDS
#define P_BANDS
Definition: psy.h:30
vorbis_info_psy::tone_centerboost
float tone_centerboost
Definition: psy.h:43
vorbis_look_psy::firstoc
long firstoc
Definition: psy.h:106
vorbis_info_psy::noisemaxsupp
float noisemaxsupp
Definition: psy.h:49
vorbis_info_psy::normal_p
int normal_p
Definition: psy.h:60
vorbis_look_psy::octave
long * octave
Definition: psy.h:103
vorbis_look_psy::vi
struct vorbis_info_psy * vi
Definition: psy.h:97
vorbis_info_psy::noiseoff
float noiseoff[P_NOISECURVES][P_BANDS]
Definition: psy.h:55
vorbis_info_psy::ath_maxatt
float ath_maxatt
Definition: psy.h:40
smallft.h
vorbis_look_psy::n
int n
Definition: psy.h:96
_vp_couple_quantize_normalize
void _vp_couple_quantize_normalize(int blobno, vorbis_info_psy_global *g, vorbis_look_psy *p, vorbis_info_mapping0 *vi, float **mdct, int **iwork, int *nonzero, int sliding_lowpass, int ch)
Definition: psy.c:1007
vorbis_info_psy::normal_thresh
double normal_thresh
Definition: psy.h:63
vorbis_look_psy_global::gi
vorbis_info_psy_global * gi
Definition: psy.h:90
vorbis_look_psy_global::channels
int channels
Definition: psy.h:88
backends.h
vorbis_info_psy::noisewindowlo
float noisewindowlo
Definition: psy.h:50
vorbis_look_psy::tonecurves
float *** tonecurves
Definition: psy.h:99
vorbis_info_psy_global::ampmax_att_per_sec
float ampmax_att_per_sec
Definition: psy.h:75
_vp_psy_clear
void _vp_psy_clear(vorbis_look_psy *p)
Definition: psy.c:361
_vp_psy_init
void _vp_psy_init(vorbis_look_psy *p, vorbis_info_psy *vi, vorbis_info_psy_global *gi, int n, long rate)
Definition: psy.c:267
vorbis_info_psy::blockflag
int blockflag
Definition: psy.h:37
vorbis_info_psy::noisemaskp
int noisemaskp
Definition: psy.h:48
p
GLfloat GLfloat p
Definition: glew.h:14938
vorbis_info_psy::normal_partition
int normal_partition
Definition: psy.h:62
NOISE_COMPAND_LEVELS
#define NOISE_COMPAND_LEVELS
Definition: psy.h:35
envelope.h
P_NOISECURVES
#define P_NOISECURVES
Definition: psy.h:33
_vi_psy_free
void _vi_psy_free(vorbis_info_psy *i)
Definition: psy.c:62
vorbis_look_psy::shiftoc
long shiftoc
Definition: psy.h:107
vorbis_info_psy::noisecompand
float noisecompand[NOISE_COMPAND_LEVELS]
Definition: psy.h:56
vorbis_info_psy_global
Definition: psy.h:66
vorbis_look_psy::eighth_octave_lines
int eighth_octave_lines
Definition: psy.h:108
vorbis_info_psy::tone_decay
float tone_decay
Definition: psy.h:44
vorbis_info_psy::noisewindowfixed
int noisewindowfixed
Definition: psy.h:54
vorbis_info_psy::toneatt
float toneatt[P_BANDS]
Definition: psy.h:46
vorbis_look_psy_global::ampmax
float ampmax
Definition: psy.h:87
vorbis_info_mapping0
Definition: backends.h:131
vi
XVisualInfo * vi
Definition: glewinfo_tail.c:221
vorbis_info_psy::tone_masteratt
float tone_masteratt[P_NOISECURVES]
Definition: psy.h:42
vorbis_info_psy
struct vorbis_info_psy vorbis_info_psy
vorbis_info_psy::tone_abs_limit
float tone_abs_limit
Definition: psy.h:45
_vi_psy_dup
void * _vi_psy_dup(void *source)
i
int i
Definition: pngrutil.c:1377
vorbis_info_psy_global::preecho_minenergy
float preecho_minenergy
Definition: psy.h:73
vorbis_info_psy::max_curve_dB
float max_curve_dB
Definition: psy.h:58
_vp_noisemask
void _vp_noisemask(vorbis_look_psy *p, float *logmdct, float *logmask)
Definition: psy.c:699
vorbis_look_psy::m_val
float m_val
Definition: psy.h:112
source
GLsizei GLsizei GLchar * source
Definition: gl2ext.h:994
vorbis_look_psy::total_octave_lines
int total_octave_lines
Definition: psy.h:109
vorbis_info_psy_global::stretch_penalty
float stretch_penalty
Definition: psy.h:72
vorbis_info_psy::normal_start
int normal_start
Definition: psy.h:61
vorbis_dsp_state
Definition: codec.h:59