zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
psy.c File Reference
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "vorbis/codec.h"
#include "codec_internal.h"
#include "masking.h"
#include "psy.h"
#include "os.h"
#include "lpc.h"
#include "smallft.h"
#include "scales.h"
#include "misc.h"
#include <stdio.h>

Go to the source code of this file.

Macros

#define NEGINF   -9999.f
 

Functions

void _vi_gpsy_free (vorbis_info_psy_global *i)
 
void _vi_psy_free (vorbis_info_psy *i)
 
float _vp_ampmax_decay (float amp, vorbis_dsp_state *vd)
 
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)
 
void _vp_global_free (vorbis_look_psy_global *look)
 
vorbis_look_psy_global_vp_global_look (vorbis_info *vi)
 
void _vp_noisemask (vorbis_look_psy *p, float *logmdct, float *logmask)
 
void _vp_offset_and_mix (vorbis_look_psy *p, float *noise, float *tone, int offset_select, float *logmask, float *mdct, float *logmdct)
 
void _vp_psy_clear (vorbis_look_psy *p)
 
void _vp_psy_init (vorbis_look_psy *p, vorbis_info_psy *vi, vorbis_info_psy_global *gi, int n, long rate)
 
void _vp_tonemask (vorbis_look_psy *p, float *logfft, float *logmask, float global_specmax, float local_specmax)
 
static int apsort (const void *a, const void *b)
 
static void attenuate_curve (float *c, float att)
 
static void bark_noise_hybridmp (int n, const long *b, const float *f, float *noise, const float offset, const int fixed)
 
static void flag_lossless (int limit, float prepoint, float postpoint, float *mdct, float *floor, int *flag, int i, int jn)
 
static void max_curve (float *c, float *c2)
 
static void max_seeds (vorbis_look_psy *p, float *seed, float *flr)
 
static void min_curve (float *c, float *c2)
 
static float noise_normalize (vorbis_look_psy *p, int limit, float *r, float *q, float *f, int *flags, float acc, int i, int n, int *out)
 
static void seed_chase (float *seeds, int linesper, long n)
 
static void seed_curve (float *seed, const float **curves, float amp, int oc, int n, int linesper, float dBoffset)
 
static void seed_loop (vorbis_look_psy *p, const float ***curves, const float *f, const float *flr, float *seed, float specmax)
 
static float *** setup_tone_curves (float curveatt_dB[P_BANDS], float binHz, int n, float center_boost, float center_decay_rate)
 

Variables

static float FLOOR1_fromdB_LOOKUP [256]
 
static const double stereo_threshholds [] ={0.0, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 16.5, 9e10}
 
static const double stereo_threshholds_limited [] ={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10}
 

Macro Definition Documentation

#define NEGINF   -9999.f

Definition at line 32 of file psy.c.

Referenced by _vp_tonemask(), and max_seeds().

Function Documentation

void _vi_gpsy_free ( vorbis_info_psy_global i)

Definition at line 55 of file psy.c.

References _ogg_free, and memset.

void _vi_psy_free ( vorbis_info_psy i)

Definition at line 62 of file psy.c.

References _ogg_free, and memset.

Referenced by vorbis_info_clear().

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 
)
void _vp_global_free ( vorbis_look_psy_global look)

Definition at line 48 of file psy.c.

References _ogg_free, and memset.

Referenced by vorbis_dsp_clear().

void _vp_noisemask ( vorbis_look_psy p,
float *  logmdct,
float *  logmask 
)
void _vp_offset_and_mix ( vorbis_look_psy p,
float *  noise,
float *  tone,
int  offset_select,
float *  logmask,
float *  mdct,
float *  logmdct 
)

@ M1 ** The following codes improve a noise problem. A fundamental idea uses the value of masking and carries out the relative compensation of the MDCT. However, this code is not perfect and all noise problems cannot be solved. by Aoyumi @ 2004/04/18

Definition at line 772 of file psy.c.

References i, vorbis_look_psy::m_val, max, vorbis_look_psy::n, vorbis_info_psy::noisemaxsupp, vorbis_look_psy::noiseoffset, vorbis_info_psy::tone_masteratt, and vorbis_look_psy::vi.

Referenced by mapping0_forward().

void _vp_tonemask ( vorbis_look_psy p,
float *  logfft,
float *  logmask,
float  global_specmax,
float  local_specmax 
)
static int apsort ( const void a,
const void b 
)
static

Definition at line 911 of file psy.c.

Referenced by noise_normalize().

static void attenuate_curve ( float *  c,
float  att 
)
static

Definition at line 80 of file psy.c.

References EHMER_MAX, and i.

Referenced by setup_tone_curves().

static void bark_noise_hybridmp ( int  n,
const long *  b,
const float *  f,
float *  noise,
const float  offset,
const int  fixed 
)
static

Definition at line 544 of file psy.c.

References cordic::hi, i, cordic::lo, R, and XX.

Referenced by _vp_noisemask().

static void flag_lossless ( int  limit,
float  prepoint,
float  postpoint,
float *  mdct,
float *  floor,
int flag,
int  i,
int  jn 
)
static

Definition at line 917 of file psy.c.

References fabs(), and j.

Referenced by _vp_couple_quantize_normalize().

static void max_curve ( float *  c,
float *  c2 
)
static

Definition at line 74 of file psy.c.

References i.

Referenced by setup_tone_curves().

static void min_curve ( float *  c,
float *  c2 
)
static

Definition at line 69 of file psy.c.

References EHMER_MAX, and i.

Referenced by setup_tone_curves().

static float noise_normalize ( vorbis_look_psy p,
int  limit,
float *  r,
float *  q,
float *  f,
int flags,
float  acc,
int  i,
int  n,
int out 
)
static
static void seed_chase ( float *  seeds,
int  linesper,
long  n 
)
static

Definition at line 451 of file psy.c.

References i.

Referenced by max_seeds().

static void seed_curve ( float *  seed,
const float **  curves,
float  amp,
int  oc,
int  n,
int  linesper,
float  dBoffset 
)
static

Definition at line 387 of file psy.c.

References EHMER_OFFSET, i, int, max, min, P_LEVEL_0, and P_LEVELS.

Referenced by seed_loop().

static void seed_loop ( vorbis_look_psy p,
const float ***  curves,
const float *  f,
const float *  flr,
float *  seed,
float  specmax 
)
static
static float*** setup_tone_curves ( float  curveatt_dB[P_BANDS],
float  binHz,
int  n,
float  center_boost,
float  center_decay_rate 
)
static

Variable Documentation

float FLOOR1_fromdB_LOOKUP[256]
static

Definition at line 843 of file psy.c.

Referenced by _vp_couple_quantize_normalize().

const double stereo_threshholds[] ={0.0, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 16.5, 9e10}
static

Definition at line 33 of file psy.c.

Referenced by _vp_couple_quantize_normalize().

const double stereo_threshholds_limited[] ={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10}
static

Definition at line 34 of file psy.c.

Referenced by _vp_couple_quantize_normalize().