ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers cb_search.h Source File

cb_search.h

Go to the documentation of this file.
00001 /* Copyright (C) 2002 Jean-Marc Valin & David Rowe */
00002 /**
00003    @file cb_search.h
00004    @brief Overlapped codebook search
00005 */
00006 /*
00007    Redistribution and use in source and binary forms, with or without
00008    modification, are permitted provided that the following conditions
00009    are met:
00010    
00011    - Redistributions of source code must retain the above copyright
00012    notice, this list of conditions and the following disclaimer.
00013    
00014    - Redistributions in binary form must reproduce the above copyright
00015    notice, this list of conditions and the following disclaimer in the
00016    documentation and/or other materials provided with the distribution.
00017    
00018    - Neither the name of the Xiph.org Foundation nor the names of its
00019    contributors may be used to endorse or promote products derived from
00020    this software without specific prior written permission.
00021    
00022    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00025    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00026    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00027    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00028    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00029    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00030    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00031    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00032    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 */
00034 
00035 #ifndef CB_SEARCH_H
00036 #define CB_SEARCH_H
00037 
00038 #include <speex/speex_bits.h>
00039 #include "misc.h"
00040 
00041 /** Split codebook parameters. */
00042 typedef struct split_cb_params {
00043    int     subvect_size;
00044    int     nb_subvect;
00045    const signed char  *shape_cb;
00046    int     shape_bits;
00047    int     have_sign;
00048 } split_cb_params;
00049 
00050 
00051 void split_cb_search_shape_sign(
00052 spx_word16_t target[],             /* target vector */
00053 spx_coef_t ak[],                /* LPCs for this subframe */
00054 spx_coef_t awk1[],              /* Weighted LPCs for this subframe */
00055 spx_coef_t awk2[],              /* Weighted LPCs for this subframe */
00056 const void *par,                /* Codebook/search parameters */
00057 int   p,                        /* number of LPC coeffs */
00058 int   nsf,                      /* number of samples in subframe */
00059 spx_sig_t *exc,
00060 spx_word16_t *r,
00061 SpeexBits *bits,
00062 char *stack,
00063 int   complexity,
00064 int   update_target
00065 );
00066 
00067 void split_cb_shape_sign_unquant(
00068 spx_sig_t *exc,
00069 const void *par,                /* non-overlapping codebook */
00070 int   nsf,                      /* number of samples in subframe */
00071 SpeexBits *bits,
00072 char *stack,
00073 spx_int32_t *seed
00074 );
00075 
00076 
00077 void noise_codebook_quant(
00078 spx_word16_t target[],             /* target vector */
00079 spx_coef_t ak[],                /* LPCs for this subframe */
00080 spx_coef_t awk1[],              /* Weighted LPCs for this subframe */
00081 spx_coef_t awk2[],              /* Weighted LPCs for this subframe */
00082 const void *par,                /* Codebook/search parameters */
00083 int   p,                        /* number of LPC coeffs */
00084 int   nsf,                      /* number of samples in subframe */
00085 spx_sig_t *exc,
00086 spx_word16_t *r,
00087 SpeexBits *bits,
00088 char *stack,
00089 int   complexity,
00090 int   update_target
00091 );
00092 
00093 
00094 void noise_codebook_unquant(
00095 spx_sig_t *exc,
00096 const void *par,                /* non-overlapping codebook */
00097 int   nsf,                      /* number of samples in subframe */
00098 SpeexBits *bits,
00099 char *stack,
00100 spx_int32_t *seed
00101 );
00102 
00103 #endif