Class LspQuant

java.lang.Object
org.xiph.speex.LspQuant
All Implemented Interfaces:
Codebook
Direct Known Subclasses:
HighLspQuant, LbrLspQuant, NbLspQuant

public abstract class LspQuant extends Object implements Codebook
Abstract class that is the base for the various LSP Quantisation and Unquantisation methods.
Version:
$Revision: 1.2 $
Author:
Jim Lawrence, helloNetwork.com, Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)
  • Field Details

  • Constructor Details

    • LspQuant

      protected LspQuant()
      Constructor
  • Method Details

    • quant

      public abstract void quant(float[] lsp, float[] qlsp, int order, Bits bits)
      Line Spectral Pair Quantification.
      Parameters:
      lsp - - Line Spectral Pairs table.
      qlsp - - Quantified Line Spectral Pairs table.
      order -
      bits - - Speex bits buffer.
    • unquant

      public abstract void unquant(float[] lsp, int order, Bits bits)
      Line Spectral Pair Unquantification.
      Parameters:
      lsp - - Line Spectral Pairs table.
      order -
      bits - - Speex bits buffer.
    • unpackPlus

      protected void unpackPlus(float[] lsp, int[] tab, Bits bits, float k, int ti, int li)
      Read the next 6 bits from the buffer, and using the value read and the given codebook, rebuild LSP table.
      Parameters:
      lsp -
      tab -
      bits - - Speex bits buffer.
      k -
      ti -
      li -
    • lsp_quant

      protected static int lsp_quant(float[] x, int xs, int[] cdbk, int nbVec, int nbDim)
      LSP quantification Note: x is modified
      Parameters:
      x -
      xs -
      cdbk -
      nbVec -
      nbDim -
      Returns:
      the index of the best match in the codebook (NB x is also modified).
    • lsp_weight_quant

      protected static int lsp_weight_quant(float[] x, int xs, float[] weight, int ws, int[] cdbk, int nbVec, int nbDim)
      LSP weighted quantification Note: x is modified
      Parameters:
      x -
      xs -
      weight -
      ws -
      cdbk -
      nbVec -
      nbDim -
      Returns:
      the index of the best match in the codebook (NB x is also modified).