Main Page   Compound List   File List   Compound Members   File Members  

vbr.h

Go to the documentation of this file.
00001 /* Copyright (C) 2002 Jean-Marc Valin 
00002    File: vbr.h
00003 
00004    VBR-related routines
00005 
00006    Redistribution and use in source and binary forms, with or without
00007    modification, are permitted provided that the following conditions
00008    are met:
00009    
00010    - Redistributions of source code must retain the above copyright
00011    notice, this list of conditions and the following disclaimer.
00012    
00013    - Redistributions in binary form must reproduce the above copyright
00014    notice, this list of conditions and the following disclaimer in the
00015    documentation and/or other materials provided with the distribution.
00016    
00017    - Neither the name of the Xiph.org Foundation nor the names of its
00018    contributors may be used to endorse or promote products derived from
00019    this software without specific prior written permission.
00020    
00021    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00024    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00025    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00026    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00027    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00028    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00029    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00030    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00031    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032 
00033 */
00034 
00035 
00036 #ifndef VBR_H
00037 #define VBR_H
00038 
00039 #define VBR_MEMORY_SIZE 5
00040 
00041 extern float vbr_nb_thresh[9][11];
00042 extern float vbr_hb_thresh[5][11];
00043 extern float vbr_uhb_thresh[2][11];
00044 
00045 typedef struct VBRState {
00046    float energy_alpha;
00047    float average_energy;
00048    float last_energy;
00049    float last_log_energy[VBR_MEMORY_SIZE];
00050    float accum_sum;
00051    float last_pitch_coef;
00052    float soft_pitch;
00053    float last_quality;
00054    float noise_level;
00055    float noise_accum;
00056    float noise_accum_count;
00057    int   consec_noise;
00058 } VBRState;
00059 
00060 void vbr_init(VBRState *vbr);
00061 
00062 float vbr_analysis(VBRState *vbr, float *sig, int len, int pitch, float pitch_coef);
00063 
00064 void vbr_destroy(VBRState *vbr);
00065 
00066 #endif

Generated on Sat Dec 6 08:47:41 2003 for speex by doxygen1.2.15