X-Git-Url: https://git.xiph.org/?p=opus.git;a=blobdiff_plain;f=libcelt%2Fbands.h;h=6890f7793ea970cde53a361932fb3014e44f5f91;hp=af15e890c12e9c81d658e6330ad32d3ad7c235ce;hb=b30dd9e1bf847b8b72fdbe4b91ea35bfbf810e47;hpb=fdca84b42f627698219139f8d818e5f26fa55ba3;ds=sidebyside diff --git a/libcelt/bands.h b/libcelt/bands.h index af15e890..6890f779 100644 --- a/libcelt/bands.h +++ b/libcelt/bands.h @@ -32,17 +32,18 @@ #ifndef BANDS_H #define BANDS_H - +#include "arch.h" #include "modes.h" #include "entenc.h" #include "entdec.h" +#include "rate.h" /** Compute the amplitude (sqrt energy) in each of the bands * @param m Mode data * @param X Spectrum * @param bands Square root of the energy for each band (returned) */ -void compute_band_energies(const CELTMode *m, float *X, float *bands); +void compute_band_energies(const CELTMode *m, celt_sig_t *X, celt_ener_t *bands); /** Normalise each band of X such that the energy in each band is equal to 1 @@ -50,16 +51,16 @@ void compute_band_energies(const CELTMode *m, float *X, float *bands); * @param X Spectrum (returned normalised) * @param bands Square root of the energy for each band */ -void normalise_bands(const CELTMode *m, float *X, float *bands); +void normalise_bands(const CELTMode *m, celt_sig_t *freq, celt_norm_t *X, celt_ener_t *bands); -void renormalise_bands(const CELTMode *m, float *X); +void renormalise_bands(const CELTMode *m, celt_norm_t *X); /** Denormalise each band of X to restore full amplitude * @param m Mode data * @param X Spectrum (returned de-normalised) * @param bands Square root of the energy for each band */ -void denormalise_bands(const CELTMode *m, float *X, float *bands); +void denormalise_bands(const CELTMode *m, celt_norm_t *X, celt_sig_t *freq, celt_ener_t *bands); /** Compute the pitch predictor gain for each pitch band * @param m Mode data @@ -68,25 +69,29 @@ void denormalise_bands(const CELTMode *m, float *X, float *bands); * @param gains Gain computed for each pitch band (returned) * @param bank Square root of the energy for each band */ -void compute_pitch_gain(const CELTMode *m, float *X, float *P, float *gains, float *bank); +void compute_pitch_gain(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains, celt_ener_t *bank); -void pitch_quant_bands(const CELTMode *m, float *X, float *P, float *gains); +void pitch_quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_pgain_t *gains); /** Quantisation/encoding of the residual spectrum * @param m Mode data * @param X Residual (normalised) * @param P Pitch vector (normalised) * @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 */ -void quant_bands(const CELTMode *m, float *X, float *P, float *W, ec_enc *enc); +void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_mask_t *W, int total_bits, ec_enc *enc); /** Decoding of the residual spectrum * @param m Mode data * @param X Residual (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 */ -void unquant_bands(const CELTMode *m, float *X, float *P, ec_dec *dec); +void unquant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, int total_bits, ec_dec *dec); + +void stereo_mix(const CELTMode *m, celt_norm_t *X, celt_ener_t *bank, int dir); #endif /* BANDS_H */