org.xiph.speex

Class Vbr


public class Vbr
extends java.lang.Object

This class analyses the signal to help determine what bitrate to use when the Varible BitRate option has been selected.
Version:
$Revision: 1.2 $
Author:
Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)

Field Summary

static int
MIN_ENERGY
static float
NOISE_POW
static int
VBR_MEMORY_SIZE
private float
accum_sum
private float
average_energy
private int
consec_noise
private float
energy_alpha
static float[][]
hb_thresh
Wideband threshhold table.
private float
last_energy
private float[]
last_log_energy
private float
last_pitch_coef
private float
last_quality
static float[][]
nb_thresh
Narrowband threshhold table.
private float
noise_accum
private float
noise_accum_count
private float
noise_level
private float
soft_pitch
static float[][]
uhb_thresh
Ultra-wideband threshhold table.

Constructor Summary

Vbr()
Constructor

Method Summary

float
analysis(float[] sig, int len, int pitch, float pitch_coef)
This function should analyse the signal and decide how critical the coding error will be perceptually.

Field Details

MIN_ENERGY

public static final int MIN_ENERGY
Field Value:
6000

NOISE_POW

public static final float NOISE_POW
Field Value:
0.0f

VBR_MEMORY_SIZE

public static final int VBR_MEMORY_SIZE
Field Value:
5

accum_sum

private float accum_sum

average_energy

private float average_energy

consec_noise

private int consec_noise

energy_alpha

private float energy_alpha

hb_thresh

public static final float[][] hb_thresh
Wideband threshhold table.

last_energy

private float last_energy

last_log_energy

private float[] last_log_energy

last_pitch_coef

private float last_pitch_coef

last_quality

private float last_quality

nb_thresh

public static final float[][] nb_thresh
Narrowband threshhold table.

noise_accum

private float noise_accum

noise_accum_count

private float noise_accum_count

noise_level

private float noise_level

soft_pitch

private float soft_pitch

uhb_thresh

public static final float[][] uhb_thresh
Ultra-wideband threshhold table.

Constructor Details

Vbr

public Vbr()
Constructor

Method Details

analysis

public float analysis(float[] sig,
                      int len,
                      int pitch,
                      float pitch_coef)
This function should analyse the signal and decide how critical the coding error will be perceptually. The following factors should be taken into account:
  • Attacks (positive energy derivative) should be coded with more bits
  • Stationary voiced segments should receive more bits
  • Segments with (very) low absolute energy should receive less bits (maybe only shaped noise?)
  • DTX for near-zero energy?
  • Stationary fricative segments should have less bits
  • Temporal masking: when energy slope is decreasing, decrease the bit-rate
  • Decrease bit-rate for males (low pitch)?
  • (wideband only) less bits in the high-band when signal is very non-stationary (harder to notice high-frequency noise)???
Parameters:
sig - - signal.
len - - signal length.
pitch - - signal pitch.
pitch_coef - - pitch coefficient.
Returns:
quality

Copyright © 1999-2004 Wimba S.A. All Rights Reserved.