msvq
Functions
- 
int main(int argc, char *argv[])
 msvq [ option ] [ infile ]
-l int
length of vector
-m int
order of vector
-s str
codebook file
infile str
double-type vector to be quantized
stdout
int-type codebook index
The below example quantizes and reconstructs vectors in
data.d.msvq -s cbfile < data.d | imsvq -s cbfile > data.q
- Parameters:
 argc – [in] Number of arguments.
argv – [in] Argument vector.
- Returns:
 0 on success, 1 on failure.
- 
class MultistageVectorQuantization
 Perform multistage vector quantization.
The input is the
 -th order vector:and the -th order codebook vectors, . The output is the codebook indices:whereand the quantization error isPublic Functions
- 
MultistageVectorQuantization(int num_order, int num_stage)
 - Parameters:
 num_order – [in] Order of vector,
 .num_stage – [in] Number of quantization stages,
 .
- 
inline int GetNumOrder() const
 - Returns:
 Order of vector.
- 
inline int GetNumStage() const
 - Returns:
 Number of stages.
- 
inline bool IsValid() const
 - Returns:
 True if this object is valid.
- 
bool Run(const std::vector<double> &input_vector, const std::vector<std::vector<std::vector<double>>> &codebook_vectors, std::vector<int> *codebook_indices, MultistageVectorQuantization::Buffer *buffer) const
 - Parameters:
 input_vector – [in]
 -th order input vector.codebook_vectors – [in]
 -th order codebook vectors. The shape is .codebook_indices – [out]
 codebook indices.buffer – [out] Buffer.
- Returns:
 True on success, false on failure.
- 
class Buffer
 Buffer for MultistageVectorQuantization class.
- 
MultistageVectorQuantization(int num_order, int num_stage)
 
- 
class VectorQuantization
 Perform vector quantization.
The input is the
 -th order vector:and the -th order codebook vectors:The output is the index of the codebook vector that minimizes the distance between the input vector and the codebook vector in an Euclidean sense:Public Functions
- 
explicit VectorQuantization(int num_order)
 - Parameters:
 num_order – [in] Order of vector,
 .
- 
inline int GetNumOrder() const
 - Returns:
 Order of vector.
- 
inline bool IsValid() const
 - Returns:
 True if this object is valid.
- 
bool Run(const std::vector<double> &input_vector, const std::vector<std::vector<double>> &codebook_vectors, int *codebook_index) const
 - Parameters:
 input_vector – [in]
 -th order input vector.codebook_vectors – [in]
 -th order codebook vectors. The shape is .codebook_index – [out] Codebook index.
- Returns:
 True on success, false on failure.
- 
explicit VectorQuantization(int num_order)