mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-24 06:10:09 +01:00
.github
cmake-proxies
dox2-src
help
images
include
lib-src
expat
ffmpeg
header-substitutes
lame
libflac
libid3tag
libmad
libnyquist
libogg
libscorealign
libsndfile
libsoxr
libvamp
libvorbis
doc
examples
include
lib
books
modes
Makefile.am
Makefile.in
analysis.c
backends.h
barkmel.c
bitrate.c
bitrate.h
block.c
codebook.c
codebook.h
codec_internal.h
envelope.c
envelope.h
floor0.c
floor1.c
highlevel.h
info.c
lookup.c
lookup.h
lookup_data.h
lookups.pl
lpc.c
lpc.h
lsp.c
lsp.h
mapping0.c
masking.h
mdct.c
mdct.h
misc.h
os.h
psy.c
psy.h
psytune.c
registry.c
registry.h
res0.c
scales.h
sharedbook.c
smallft.c
smallft.h
synthesis.c
tone.c
vorbisenc.c
vorbisfile.c
window.c
window.h
m4
macos
macosx
symbian
test
vq
win32
AUTHORS
CHANGES
COPYING
Makefile.am
Makefile.in
README
autogen.sh
autotools.patch
compile
config.guess
config.h.in
config.sub
configure
configure.ac
depcomp
install-sh
libvorbis.spec.in
local-libogg.patch
ltmain.sh
missing
no-docs-examples.patch
todo.txt
vorbis-uninstalled.pc.in
vorbis.m4
vorbis.pc.in
vorbisenc-uninstalled.pc.in
vorbisenc.pc.in
vorbisfile-uninstalled.pc.in
vorbisfile.pc.in
lv2
portaudio-v19
portburn
portmidi
portmixer
portsmf
sbsms
soundtouch
sqlite
twolame
audacity-patches.txt
linux
locale
mac
modules
nyq-po
nyquist
plug-ins
presets
qa
scripts
src
tests
win
.gitattributes
.gitignore
ABOUT-NLS
CHANGELOG.txt
CMakeLists.txt
CODE_OF_CONDUCT.md
CONTRIBUTING.md
INSTALL
LICENSE.txt
PULL_REQUEST_TEMPLATE.md
README.md
README.txt
audacity.dox
todo.txt
155 lines
4.6 KiB
C
155 lines
4.6 KiB
C
/********************************************************************
|
|
* *
|
|
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
|
* *
|
|
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
|
|
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
|
* *
|
|
********************************************************************
|
|
|
|
function: random psychoacoustics (not including preecho)
|
|
last mod: $Id: psy.h 16946 2010-03-03 16:12:40Z xiphmont $
|
|
|
|
********************************************************************/
|
|
|
|
#ifndef _V_PSY_H_
|
|
#define _V_PSY_H_
|
|
#include "smallft.h"
|
|
|
|
#include "backends.h"
|
|
#include "envelope.h"
|
|
|
|
#ifndef EHMER_MAX
|
|
#define EHMER_MAX 56
|
|
#endif
|
|
|
|
/* psychoacoustic setup ********************************************/
|
|
#define P_BANDS 17 /* 62Hz to 16kHz */
|
|
#define P_LEVELS 8 /* 30dB to 100dB */
|
|
#define P_LEVEL_0 30. /* 30 dB */
|
|
#define P_NOISECURVES 3
|
|
|
|
#define NOISE_COMPAND_LEVELS 40
|
|
typedef struct vorbis_info_psy{
|
|
int blockflag;
|
|
|
|
float ath_adjatt;
|
|
float ath_maxatt;
|
|
|
|
float tone_masteratt[P_NOISECURVES];
|
|
float tone_centerboost;
|
|
float tone_decay;
|
|
float tone_abs_limit;
|
|
float toneatt[P_BANDS];
|
|
|
|
int noisemaskp;
|
|
float noisemaxsupp;
|
|
float noisewindowlo;
|
|
float noisewindowhi;
|
|
int noisewindowlomin;
|
|
int noisewindowhimin;
|
|
int noisewindowfixed;
|
|
float noiseoff[P_NOISECURVES][P_BANDS];
|
|
float noisecompand[NOISE_COMPAND_LEVELS];
|
|
|
|
float max_curve_dB;
|
|
|
|
int normal_p;
|
|
int normal_start;
|
|
int normal_partition;
|
|
double normal_thresh;
|
|
} vorbis_info_psy;
|
|
|
|
typedef struct{
|
|
int eighth_octave_lines;
|
|
|
|
/* for block long/short tuning; encode only */
|
|
float preecho_thresh[VE_BANDS];
|
|
float postecho_thresh[VE_BANDS];
|
|
float stretch_penalty;
|
|
float preecho_minenergy;
|
|
|
|
float ampmax_att_per_sec;
|
|
|
|
/* channel coupling config */
|
|
int coupling_pkHz[PACKETBLOBS];
|
|
int coupling_pointlimit[2][PACKETBLOBS];
|
|
int coupling_prepointamp[PACKETBLOBS];
|
|
int coupling_postpointamp[PACKETBLOBS];
|
|
int sliding_lowpass[2][PACKETBLOBS];
|
|
|
|
} vorbis_info_psy_global;
|
|
|
|
typedef struct {
|
|
float ampmax;
|
|
int channels;
|
|
|
|
vorbis_info_psy_global *gi;
|
|
int coupling_pointlimit[2][P_NOISECURVES];
|
|
} vorbis_look_psy_global;
|
|
|
|
|
|
typedef struct {
|
|
int n;
|
|
struct vorbis_info_psy *vi;
|
|
|
|
float ***tonecurves;
|
|
float **noiseoffset;
|
|
|
|
float *ath;
|
|
long *octave; /* in n.ocshift format */
|
|
long *bark;
|
|
|
|
long firstoc;
|
|
long shiftoc;
|
|
int eighth_octave_lines; /* power of two, please */
|
|
int total_octave_lines;
|
|
long rate; /* cache it */
|
|
|
|
float m_val; /* Masking compensation value */
|
|
|
|
} vorbis_look_psy;
|
|
|
|
extern void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
|
|
vorbis_info_psy_global *gi,int n,long rate);
|
|
extern void _vp_psy_clear(vorbis_look_psy *p);
|
|
extern void *_vi_psy_dup(void *source);
|
|
|
|
extern void _vi_psy_free(vorbis_info_psy *i);
|
|
extern vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i);
|
|
|
|
extern void _vp_noisemask(vorbis_look_psy *p,
|
|
float *logmdct,
|
|
float *logmask);
|
|
|
|
extern void _vp_tonemask(vorbis_look_psy *p,
|
|
float *logfft,
|
|
float *logmask,
|
|
float global_specmax,
|
|
float local_specmax);
|
|
|
|
extern void _vp_offset_and_mix(vorbis_look_psy *p,
|
|
float *noise,
|
|
float *tone,
|
|
int offset_select,
|
|
float *logmask,
|
|
float *mdct,
|
|
float *logmdct);
|
|
|
|
extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
|
|
|
|
extern 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);
|
|
|
|
#endif
|