XGitUrl: http://git.xiph.org/?p=opus.git;a=blobdiff_plain;f=libcelt%2Fvq.h;h=56a31b6f80c6fd8a2051cfddea58a1ebb642d12e;hp=8ca25f85c3c05b9af7e6a634c6f3c1d5826143da;hb=58ecb1ac15cadec832fc5e539c250b0a6b1a0b90;hpb=0df0eb4c67443e0434368ddc9a979bce626b5ab7
diff git a/libcelt/vq.h b/libcelt/vq.h
index 8ca25f85..56a31b6f 100644
 a/libcelt/vq.h
+++ b/libcelt/vq.h
@@ 1,5 +1,10 @@
/* (C) 2007 JeanMarc Valin, CSIRO
*/
+/* Copyright (c) 20072008 CSIRO
+ Copyright (c) 20072009 Xiph.Org Foundation
+ Written by JeanMarc Valin */
+/**
+ @file vq.h
+ @brief Vector quantisation of the residual
+ */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ 12,10 +17,6 @@
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
  Neither the name of the Xiph.org Foundation nor the names of its
 contributors may be used to endorse or promote products derived from
 this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ 34,48 +35,35 @@
#include "entenc.h"
#include "entdec.h"
+#include "modes.h"

/** Algebraic pulsebased quantiser. The signal x is replaced by the sum of the
 * pitch a combination of pulses such that its norm is still equal to 1. The
 * only difference with the quantiser above is that the search is more complete.
+/** Algebraic pulsevector quantiser. The signal x is replaced by the sum of
+ * the pitch and a combination of pulses such that its norm is still equal
+ * to 1. This is the function that will typically require the most CPU.
* @param x Residual signal to quantise/encode (returns quantised version)
 * @param W Perceptual weight
+ * @param W Perceptual weight to use when optimising (currently unused)
* @param N Number of samples to encode
* @param K Number of pulses to use
* @param p Pitch vector (it is assumed that p+x is a unit vector)
 * @param alpha compression factor in the pitch direction (magic!)
* @param enc Entropy encoder state
+ * @ret A mask indicating which blocks in the band received pulses
*/
void alg_quant(float *x, float *W, int N, int K, float *p, float alpha, ec_enc *enc);
+unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B,
+ int resynth, ec_enc *enc, celt_word16 gain);
/** Algebraic pulse decoder
* @param x Decoded normalised spectrum (returned)
* @param N Number of samples to decode
* @param K Number of pulses to use
* @param p Pitch vector (automatically added to x)
 * @param alpha compression factor in the pitch direction (magic!)
* @param dec Entropy decoder state
+ * @ret A mask indicating which blocks in the band received pulses
*/
void alg_unquant(float *x, int N, int K, float *p, float alpha, ec_dec *dec);

/** Intraframe predictor that matches a section of the current frame (at lower
 * frequencies) to encode the current band.
 * @param x Residual signal to quantise/encode (returns quantised version)
 * @param W Perceptual weight
 * @param N Number of samples to encode
 * @param K Number of pulses to use
 * @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 B Stride (number of channels multiplied by the number of MDCTs per frame)
 * @param N0 Number of valid offsets
 * @param enc Entropy encoder state
 */
void intra_prediction(float *x, float *W, int N, int K, float *Y, float *P, int B, int N0, ec_enc *enc);
+unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B,
+ ec_dec *dec, celt_word16 gain);
void intra_unquant(float *x, int N, int K, float *Y, float *P, int B, int N0, ec_dec *dec);
+void renormalise_vector(celt_norm *X, int N, celt_word16 gain);
/** Encode the entire band as a "fold" from other parts of the spectrum. No bits required (only use is case of an emergency!) */
void intra_fold(float *x, int N, float *Y, float *P, int B, int N0, int Nmax);
+int stereo_itheta(celt_norm *X, celt_norm *Y, int stereo, int N);
#endif /* VQ_H */