Package javaforce.codec.speex
Class SbDecoder
java.lang.Object
javaforce.codec.speex.NbCodec
javaforce.codec.speex.SbCodec
javaforce.codec.speex.SbDecoder
Sideband Speex Decoder
- Version:
- $Revision$
- Author:
- Jim Lawrence, helloNetwork.com, Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)
-
Field Summary
FieldsFields inherited from class javaforce.codec.speex.SbCodec
foldingGain, fullFrameSize, g0_mem, g1_mem, high, QMF_ORDER, SB_FRAME_SIZE, SB_SUBMODE_BITS, SB_SUBMODES, x0d, y0, y1Fields inherited from class javaforce.codec.speex.NbCodec
awk1, awk2, awk3, bufSize, dtx_enabled, exc_gain_quant_scal1, exc_gain_quant_scal3, excBuf, excIdx, filters, first, frameSize, frmBuf, frmIdx, gamma1, gamma2, innov, interp_qlpc, interp_qlsp, lag_factor, lpc, lpc_floor, lpcSize, m_lsp, max_pitch, mem_sp, min_pitch, NB_FRAME_SIZE, NB_SUBMODE_BITS, NB_SUBMODES, nbSubframes, old_qlsp, pi_gain, pre_mem, preemph, qlsp, subframeSize, submodeID, submodes, VERY_SMALL, voc_m1, voc_m2, voc_mean, voc_offset, windowSizeFields inherited from interface javaforce.codec.speex.Codebook
cdbk_nb, cdbk_nb_high1, cdbk_nb_high2, cdbk_nb_low1, cdbk_nb_low2, exc_10_16_table, exc_10_32_table, exc_20_32_table, exc_5_256_table, exc_5_64_table, exc_8_128_table, gain_cdbk_lbr, gain_cdbk_nb, h0, h1, hexc_10_32_table, hexc_table, high_lsp_cdbk, high_lsp_cdbk2, NB_CDBK_SIZE, NB_CDBK_SIZE_HIGH1, NB_CDBK_SIZE_HIGH2, NB_CDBK_SIZE_LOW1, NB_CDBK_SIZE_LOW2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintDecode the given input bits.intdecodeLost(float[] out, boolean dtx) Decode when packets are lost.voiddecodeStereo(float[] data, int frameSize) Decode the given bits to stereo.booleanReturns whether perceptual enhancement is enabled or disabled.voidinit(int frameSize, int subframeSize, int lpcSize, int bufSize, float foldingGain) InitialisationvoidsetPerceptualEnhancement(boolean enhanced) Enables or disables perceptual enhancement.voiduwbinit()Ultra-wideband initialisationvoidwbinit()Wideband initialisationMethods inherited from class javaforce.codec.speex.SbCodec
buildUwbSubModes, buildWbSubModes, getDtx, getExc, getFrameSize, getInnov
-
Field Details
-
lowdec
-
stereo
-
enhanced
protected boolean enhanced
-
-
Constructor Details
-
SbDecoder
public SbDecoder()Constructor
-
-
Method Details
-
wbinit
public void wbinit()Wideband initialisation -
uwbinit
public void uwbinit()Ultra-wideband initialisation -
init
public void init(int frameSize, int subframeSize, int lpcSize, int bufSize, float foldingGain) Initialisation -
decode
Decode the given input bits.- Specified by:
decodein interfaceDecoder- Parameters:
bits- - Speex bits buffer.out- - the decoded mono audio frame.- Returns:
- 1 if a terminator was found, 0 if not.
- Throws:
StreamCorruptedException- If there is an error detected in the data stream.
-
decodeLost
public int decodeLost(float[] out, boolean dtx) Decode when packets are lost.- Parameters:
out- - the generated mono audio frame.dtx-- Returns:
- 0 if successful.
-
decodeStereo
public void decodeStereo(float[] data, int frameSize) Decode the given bits to stereo.- Specified by:
decodeStereoin interfaceDecoder- Parameters:
data- - float array of size 2*frameSize, that contains the mono audio samples in the first half. When the function has completed, the array will contain the interlaced stereo audio samples.frameSize- - the size of a frame of mono audio samples.
-
setPerceptualEnhancement
public void setPerceptualEnhancement(boolean enhanced) Enables or disables perceptual enhancement.- Specified by:
setPerceptualEnhancementin interfaceDecoder- Parameters:
enhanced-
-
getPerceptualEnhancement
public boolean getPerceptualEnhancement()Returns whether perceptual enhancement is enabled or disabled.- Specified by:
getPerceptualEnhancementin interfaceDecoder- Returns:
- whether perceptual enhancement is enabled or disabled.
-