shithub: opus

Download patch

ref: 879fbfd528c21124dc6a224ebbf8020659ac4160
parent: 8c19b030df0bc6195db8f6b60f4908beb6a3ca97
author: Jean-Marc Valin <[email protected]>
date: Wed Feb 20 12:17:13 EST 2008

Updated Doxygen comments, removed an incorrectly placed LGPL header (we own
copyright, so it's fine!)

--- /dev/null
+++ b/Doxyfile
@@ -1,0 +1,283 @@
+# Doxyfile 1.5.3
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
+PROJECT_NAME           = CELT
+PROJECT_NUMBER         = 0.2.0
+OUTPUT_DIRECTORY       = doc/API
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class " \
+                         "The $name widget " \
+                         "The $name file " \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = YES
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = NO
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = NO
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
+HIDE_UNDOC_MEMBERS     = YES
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = NO
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text "
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = libcelt/celt.h \
+                         libcelt/celt_types.h \
+                         libcelt/celt_header.h
+INPUT_ENCODING         = UTF-8
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.C \
+                         *.CC \
+                         *.C++ \
+                         *.II \
+                         *.I++ \
+                         *.H \
+                         *.HH \
+                         *.H++ \
+                         *.CS \
+                         *.PHP \
+                         *.PHP3 \
+                         *.M \
+                         *.MM \
+                         *.PY
+RECURSIVE              = NO
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = *.c
+EXCLUDE_SYMBOLS        = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = *
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+HTML_DYNAMIC_SECTIONS  = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = YES
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = YES
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = NO
+MSCGEN_PATH            = 
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = NO
+INCLUDED_BY_GRAPH      = NO
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 1000
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,7 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = celt.pc 
 
-EXTRA_DIST = celt.pc.in
+EXTRA_DIST = celt.pc.in Doxyfile
 
 rpm: dist
 	rpmbuild -ta ${PACKAGE}-${VERSION}.tar.gz
--- a/libcelt/celt.h
+++ b/libcelt/celt.h
@@ -1,5 +1,10 @@
 /* (C) 2007 Jean-Marc Valin, CSIRO
 */
+/**
+  @file celt.h
+  @brief Contains all the functions for encoding and decoding audio streams
+ */
+
 /*
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -39,10 +44,15 @@
 #endif
 
 /* Error codes */
+/** No error */
 #define CELT_OK                0
+/** An (or more) invalid argument (e.g. out of range) */
 #define CELT_BAD_ARG          -1
+/** The mode struct passed is invalid */
 #define CELT_INVALID_MODE     -2
+/** An internal error was detected */
 #define CELT_INTERNAL_ERROR   -3
+/** The data passed (e.g. compressed data to decoder) is corrupted */
 #define CELT_CORRUPTED_DATA   -4
 
 /* Requests */
@@ -50,9 +60,12 @@
 #define CELT_GET_LOOKAHEAD    1001
 #define CELT_GET_NB_CHANNELS  1002
 
-/** State of the encoder. One encoder state is needed for each stream. It is
-    initialised once at the beginning of the stream. Do *not* re-initialise
-    the state for every frame */
+
+/** Contains the state of an encoder. One encoder state is needed for each 
+    stream. It is initialised once at the beginning of the stream. Do *not*
+    re-initialise the state for every frame.
+   @brief Encoder state
+ */
 typedef struct CELTEncoder CELTEncoder;
 
 /** State of the decoder. One decoder state is needed for each stream. It is
@@ -70,9 +83,12 @@
 #define celt_stereo celt_mode_create(44100, 2, 256, 128, NULL)
 
 
-/* Mode calls */
 
+/** \defgroup codec Encoding and decoding */
+/*  @{ */
 
+/* Mode calls */
+
 /** Creates a new mode struct. This will be passed to an encoder or decoder.
     The mode MUST NOT BE DESTROYED until the encoders and decoders that use it
     are destroyed as well.
@@ -95,9 +111,9 @@
 int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value);
 
 
-
 /* Encoder stuff */
 
+
 /** Creates a new encoder state. Each stream needs its own encoder state (can't
     be shared across simultaneous streams).
  @param mode Contains all the information about the characteristics of the stream
@@ -107,7 +123,7 @@
 CELTEncoder *celt_encoder_create(const CELTMode *mode);
 
 /** Destroys a an encoder state.
- @param mode Encoder state to be destroyed
+ @param st Encoder state to be destroyed
  */
 void celt_encoder_destroy(CELTEncoder *st);
 
@@ -126,10 +142,9 @@
 */
 int celt_encode(CELTEncoder *st, celt_int16_t *pcm, unsigned char *compressed, int nbCompressedBytes);
 
-
-
 /* Decoder stuff */
 
+
 /** Creates a new decoder state. Each stream needs its own decoder state (can't
     be shared across simultaneous streams).
  @param mode Contains all the information about the characteristics of the
@@ -139,7 +154,7 @@
 CELTDecoder *celt_decoder_create(const CELTMode *mode);
 
 /** Destroys a a decoder state.
- @param mode Decoder state to be destroyed
+ @param st Decoder state to be destroyed
  */
 void celt_decoder_destroy(CELTDecoder *st);
 
@@ -154,6 +169,7 @@
    */
 int celt_decode(CELTDecoder *st, unsigned char *data, int len, celt_int16_t *pcm);
 
+/*  @} */
 
 
 #ifdef __cplusplus
--- a/libcelt/celt_header.h
+++ b/libcelt/celt_header.h
@@ -39,18 +39,22 @@
 #include "celt.h"
 #include "celt_types.h"
 
+/** Header data to be used for Ogg files (or possibly other encapsulation) 
+    @brief Header data 
+ */
 typedef struct {
-   char         codec_id[8];
-   char         codec_version[20];
-   celt_int32_t version_id;
-   celt_int32_t header_size;
-   celt_int32_t mode;
-   celt_int32_t sample_rate;
-   celt_int32_t nb_channels;
-   celt_int32_t bytes_per_packet;
-   celt_int32_t extra_headers;
+   char         codec_id[8];       /**< MUST be "CELT    " (four spaces) */
+   char         codec_version[20]; /**< Version used (as string) */
+   celt_int32_t version_id;        /**< Version id (negative for until stream is frozen) */
+   celt_int32_t header_size;       /**< Size of this header */
+   celt_int32_t mode;              /**< Mode used for encoding (to be removed) */
+   celt_int32_t sample_rate;       /**< Sampling rate of the original audio */
+   celt_int32_t nb_channels;       /**< Number of channels */
+   celt_int32_t bytes_per_packet;  /**< Number of bytes per compressed packet (0 if unknown) */
+   celt_int32_t extra_headers;     /**< Number of additional headers that follow this header */
 } CELTHeader;
 
+/** Creates a basic header struct */
 void celt_header_init(CELTHeader *header, celt_int32_t rate, celt_int32_t nb_channels, const CELTMode *m);
 
 int celt_header_to_packet(const CELTHeader *header, unsigned char *packet, celt_uint32_t size);
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -1,24 +1,39 @@
+/* (C) 2007-2008 Jean-Marc Valin, CSIRO
+*/
 /**
    @file pitch.c
    @brief Pitch analysis
-*/
+ */
 
-/* Copyright (C) 2005
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+/*
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+   
+   - Redistributions in binary form must reproduce the above copyright
+   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
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
+
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
--- a/libcelt/pitch.h
+++ b/libcelt/pitch.h
@@ -1,24 +1,39 @@
+/* (C) 2007-2008 Jean-Marc Valin, CSIRO
+*/
 /**
    @file pitch.h
    @brief Pitch analysis
  */
 
-/* Copyright (C) 2005
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+/*
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+   
+   - Redistributions in binary form must reproduce the above copyright
+   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
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
+
 
 #ifndef _PITCH_H
 #define _PITCH_H
--- a/libcelt/quant_pitch.h
+++ b/libcelt/quant_pitch.h
@@ -35,10 +35,10 @@
 #include "entenc.h"
 #include "entdec.h"
 
-/* If this returns 0, the gain is zero (don't encode the pitch index) */
+/** If this returns 0, the gain is zero (don't encode the pitch index) */
 int quant_pitch(float *gains, int len, ec_enc *enc);
 
-/* If this returns 0, the gain is zero (don't decode the pitch index) */
+/** If this returns 0, the gain is zero (don't decode the pitch index) */
 int unquant_pitch(float *gains, int len, ec_dec *dec);
 
 #endif /* QUANT_PITCH_H */
--- a/libcelt/rate.h
+++ b/libcelt/rate.h
@@ -32,8 +32,18 @@
 #ifndef RATE_H
 #define RATE_H
 
+/** Computes a cache of the pulses->bits mapping in each band */
 void compute_alloc_cache(CELTMode *m);
 
+/** Compute the pulse allocation, i.e. how many pulses will go in each
+  * band. 
+ @param m mode
+ @param offsets Requested increase or decrease in the number of bits for
+                each band
+ @param total Number of bands
+ @param pulses Number of pulses per band (returned)
+ @return Total number of bits allocated
+*/
 int compute_allocation(const CELTMode *m, int *offsets, int total, int *pulses);
 
 
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -58,6 +58,7 @@
 #define approx_inv(x) (1.f/(x))
 #endif
 
+/** All the info necessary to keep track of a hypothesis during the search */
 struct NBest {
    float score;
    float gain;
@@ -69,9 +70,6 @@
    float yp;
 };
 
-/* Improved algebraic pulse-base 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. */
 void alg_quant(float *x, float *W, int N, int K, float *p, float alpha, ec_enc *enc)
 {
    int L = 3;
@@ -306,6 +304,8 @@
 
 }
 
+/** Decode pulse vector and combine the result with the pitch vector to produce
+    the final normalised signal in the current band. */
 void alg_unquant(float *x, int N, int K, float *p, float alpha, ec_dec *dec)
 {
    int i;
--- a/libcelt/vq.h
+++ b/libcelt/vq.h
@@ -36,15 +36,15 @@
 #include "entdec.h"
 
 
-/** Algebraic pulse-based 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 pulse-vector 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 alpha compression factor to apply in the pitch direction (magic!)
  * @param enc Entropy encoder state
 */
 void alg_quant(float *x, float *W, int N, int K, float *p, float alpha, ec_enc *enc);