Libav
|
00001 /* 00002 * gain code, gain pitch and pitch delay decoding 00003 * 00004 * Copyright (c) 2008 Vladimir Voroshilov 00005 * 00006 * This file is part of FFmpeg. 00007 * 00008 * FFmpeg 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 * FFmpeg 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 FFmpeg; 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_PITCH_DELAY_H 00024 #define AVCODEC_ACELP_PITCH_DELAY_H 00025 00026 #include <stdint.h> 00027 #include "dsputil.h" 00028 00029 #define PITCH_DELAY_MIN 20 00030 #define PITCH_DELAY_MAX 143 00031 00043 int ff_acelp_decode_8bit_to_1st_delay3(int ac_index); 00044 00060 int ff_acelp_decode_5_6_bit_to_2nd_delay3( 00061 int ac_index, 00062 int pitch_delay_min); 00063 00080 int ff_acelp_decode_4bit_to_2nd_delay3( 00081 int ac_index, 00082 int pitch_delay_min); 00083 00099 int ff_acelp_decode_9bit_to_1st_delay6(int ac_index); 00100 00115 int ff_acelp_decode_6bit_to_2nd_delay6( 00116 int ac_index, 00117 int pitch_delay_min); 00118 00135 void ff_acelp_update_past_gain( 00136 int16_t* quant_energy, 00137 int gain_corr_factor, 00138 int log2_ma_pred_order, 00139 int erasure); 00140 00213 int16_t ff_acelp_decode_gain_code( 00214 DSPContext *dsp, 00215 int gain_corr_factor, 00216 const int16_t* fc_v, 00217 int mr_energy, 00218 const int16_t* quant_energy, 00219 const int16_t* ma_prediction_coeff, 00220 int subframe_size, 00221 int max_pred_order); 00222 00233 float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy, 00234 float *prediction_error, float energy_mean, 00235 const float *pred_table); 00236 00237 00251 void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index, 00252 const int prev_lag_int, const int subframe, 00253 int third_as_first, int resolution); 00254 00255 #endif /* AVCODEC_ACELP_PITCH_DELAY_H */