Libav 0.7.1
|
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 00113 extern const uint8_t ff_fc_2pulses_9bits_track2_gray[32]; 00114 00118 extern const float ff_b60_sinc[61]; 00119 00123 extern const float ff_pow_0_7[10]; 00124 00128 extern const float ff_pow_0_75[10]; 00129 00133 extern const float ff_pow_0_55[10]; 00134 00149 void ff_acelp_fc_pulse_per_track(int16_t* fc_v, 00150 const uint8_t *tab1, 00151 const uint8_t *tab2, 00152 int pulse_indexes, 00153 int pulse_signs, 00154 int pulse_count, 00155 int bits); 00156 00169 void ff_decode_10_pulses_35bits(const int16_t *fixed_index, 00170 AMRFixed *fixed_sparse, 00171 const uint8_t *gray_decode, 00172 int half_pulse_count, int bits); 00173 00174 00190 void ff_acelp_weighted_vector_sum(int16_t* out, 00191 const int16_t *in_a, 00192 const int16_t *in_b, 00193 int16_t weight_coeff_a, 00194 int16_t weight_coeff_b, 00195 int16_t rounder, 00196 int shift, 00197 int length); 00198 00210 void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b, 00211 float weight_coeff_a, float weight_coeff_b, 00212 int length); 00213 00224 void ff_adaptive_gain_control(float *out, const float *in, float speech_energ, 00225 int size, float alpha, float *gain_mem); 00226 00242 void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in, 00243 float sum_of_squares, const int n); 00244 00253 void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size); 00254 00262 void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size); 00263 00264 #endif /* AVCODEC_ACELP_VECTORS_H */