• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavcodec/acelp_vectors.h

Go to the documentation of this file.
00001 /*
00002  * adaptive and fixed codebook vector operations for ACELP-based codecs
00003  *
00004  * Copyright (c) 2008 Vladimir Voroshilov
00005  *
00006  * This file is part of Libav.
00007  *
00008  * Libav is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * Libav is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with Libav; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00021  */
00022 
00023 #ifndef AVCODEC_ACELP_VECTORS_H
00024 #define AVCODEC_ACELP_VECTORS_H
00025 
00026 #include <stdint.h>
00027 
00029 typedef struct {
00030     int      n;
00031     int      x[10];
00032     float    y[10];
00033     int      no_repeat_mask;
00034     int      pitch_lag;
00035     float    pitch_fac;
00036 } AMRFixed;
00037 
00052 extern const uint8_t ff_fc_4pulses_8bits_tracks_13[16];
00053 
00065 extern const uint8_t ff_fc_4pulses_8bits_track_4[32];
00066 
00081 extern const uint8_t ff_fc_2pulses_9bits_track1[16];
00082 extern const uint8_t ff_fc_2pulses_9bits_track1_gray[16];
00083 
00087 extern const float ff_b60_sinc[61];
00088 
00092 extern const float ff_pow_0_7[10];
00093 
00097 extern const float ff_pow_0_75[10];
00098 
00102 extern const float ff_pow_0_55[10];
00103 
00118 void ff_acelp_fc_pulse_per_track(int16_t* fc_v,
00119                                  const uint8_t *tab1,
00120                                  const uint8_t *tab2,
00121                                  int pulse_indexes,
00122                                  int pulse_signs,
00123                                  int pulse_count,
00124                                  int bits);
00125 
00138 void ff_decode_10_pulses_35bits(const int16_t *fixed_index,
00139                                 AMRFixed *fixed_sparse,
00140                                 const uint8_t *gray_decode,
00141                                 int half_pulse_count, int bits);
00142 
00143 
00159 void ff_acelp_weighted_vector_sum(int16_t* out,
00160                                   const int16_t *in_a,
00161                                   const int16_t *in_b,
00162                                   int16_t weight_coeff_a,
00163                                   int16_t weight_coeff_b,
00164                                   int16_t rounder,
00165                                   int shift,
00166                                   int length);
00167 
00179 void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b,
00180                              float weight_coeff_a, float weight_coeff_b,
00181                              int length);
00182 
00193 void ff_adaptive_gain_control(float *out, const float *in, float speech_energ,
00194                               int size, float alpha, float *gain_mem);
00195 
00211 void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
00212                                              float sum_of_squares, const int n);
00213 
00222 void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size);
00223 
00231 void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size);
00232 
00233 #endif /* AVCODEC_ACELP_VECTORS_H */
Generated on Thu Jul 11 2013 15:38:18 for Libav by doxygen 1.7.1