This commit is contained in:
Jean-Marc Valin 2008-02-20 17:45:51 +11:00
parent 879fbfd528
commit 276de7211d
5 changed files with 26 additions and 9 deletions

View file

@ -78,6 +78,7 @@ void pitch_quant_bands(const CELTMode *m, float *X, float *P, float *gains);
* @param X Residual (normalised) * @param X Residual (normalised)
* @param P Pitch vector (normalised) * @param P Pitch vector (normalised)
* @param W Perceptual weighting * @param W Perceptual weighting
* @param total_bits Total number of bits that can be used for the frame (including the ones already spent)
* @param enc Entropy encoder * @param enc Entropy encoder
*/ */
void quant_bands(const CELTMode *m, float *X, float *P, float *W, int total_bits, ec_enc *enc); void quant_bands(const CELTMode *m, float *X, float *P, float *W, int total_bits, ec_enc *enc);
@ -86,6 +87,7 @@ void quant_bands(const CELTMode *m, float *X, float *P, float *W, int total_bits
* @param m Mode data * @param m Mode data
* @param X Residual (normalised) * @param X Residual (normalised)
* @param P Pitch vector (normalised) * @param P Pitch vector (normalised)
* @param total_bits Total number of bits that can be used for the frame (including the ones already spent)
* @param dec Entropy decoder * @param dec Entropy decoder
*/ */
void unquant_bands(const CELTMode *m, float *X, float *P, int total_bits, ec_dec *dec); void unquant_bands(const CELTMode *m, float *X, float *P, int total_bits, ec_dec *dec);

View file

@ -53,8 +53,11 @@
#define M_PI 3.14159263 #define M_PI 3.14159263
#endif #endif
/** Encoder state
@brief Encoder state
*/
struct CELTEncoder { struct CELTEncoder {
const CELTMode *mode; const CELTMode *mode; /**< Mode used by the encoder */
int frame_size; int frame_size;
int block_size; int block_size;
int nb_blocks; int nb_blocks;
@ -417,7 +420,9 @@ int celt_encode(CELTEncoder *st, celt_int16_t *pcm, unsigned char *compressed, i
/****************************************************************************/ /****************************************************************************/
/** Decoder state
@brief Decoder state
*/
struct CELTDecoder { struct CELTDecoder {
const CELTMode *mode; const CELTMode *mode;
int frame_size; int frame_size;

View file

@ -56,8 +56,11 @@ extern "C" {
#define CELT_CORRUPTED_DATA -4 #define CELT_CORRUPTED_DATA -4
/* Requests */ /* Requests */
/** GET the frame size used in the current mode */
#define CELT_GET_FRAME_SIZE 1000 #define CELT_GET_FRAME_SIZE 1000
/** GET the lookahead used in the current mode */
#define CELT_GET_LOOKAHEAD 1001 #define CELT_GET_LOOKAHEAD 1001
/** GET the number of channels used in the current mode */
#define CELT_GET_NB_CHANNELS 1002 #define CELT_GET_NB_CHANNELS 1002

View file

@ -35,6 +35,9 @@
#include "celt_types.h" #include "celt_types.h"
#include "celt.h" #include "celt.h"
/** Mode definition (opaque)
@brief Mode definition
*/
struct CELTMode { struct CELTMode {
int overlap; int overlap;
int mdctSize; int mdctSize;
@ -45,15 +48,15 @@ struct CELTMode {
int nbPBands; int nbPBands;
int pitchEnd; int pitchEnd;
const int *eBands; const int *eBands; /**< Definition for each "pseudo-critical band" */
const int *pBands; const int *pBands; /**< Definition of the bands used for the pitch */
float ePredCoef; float ePredCoef;/**< Prediction coefficient for the energy encoding */
int nbAllocVectors; int nbAllocVectors; /**< Number of lines in the matrix below */
const int *allocVectors; const int *allocVectors; /**< Number of bits in each band for several rates */
const int * const *bits; const int * const *bits; /**< Cache for pulses->bits mapping in each band */
}; };

View file

@ -1,5 +1,9 @@
/* (C) 2007 Jean-Marc Valin, CSIRO /* (C) 2007 Jean-Marc Valin, CSIRO
*/ */
/**
@file vq.h
@brief Vector quantisation of the residual
*/
/* /*
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions
@ -66,7 +70,7 @@ void alg_unquant(float *x, int N, int K, float *p, float alpha, ec_dec *dec);
* @param N Number of samples to encode * @param N Number of samples to encode
* @param K Number of pulses to use * @param K Number of pulses to use
* @param Y Lower frequency spectrum to use, normalised to the same standard deviation * @param Y Lower frequency spectrum to use, normalised to the same standard deviation
* @param p Pitch vector (it is assumed that p+x is a unit vector) * @param P Pitch vector (it is assumed that p+x is a unit vector)
* @param B Stride (number of channels multiplied by the number of MDCTs per frame) * @param B Stride (number of channels multiplied by the number of MDCTs per frame)
* @param N0 Number of valid offsets * @param N0 Number of valid offsets
* @param enc Entropy encoder state * @param enc Entropy encoder state