Libav
acelp_pitch_delay.h
Go to the documentation of this file.
1 /*
2  * gain code, gain pitch and pitch delay decoding
3  *
4  * Copyright (c) 2008 Vladimir Voroshilov
5  *
6  * This file is part of Libav.
7  *
8  * Libav is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * Libav is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with Libav; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef AVCODEC_ACELP_PITCH_DELAY_H
24 #define AVCODEC_ACELP_PITCH_DELAY_H
25 
26 #include <stdint.h>
27 #include "dsputil.h"
28 
29 #define PITCH_DELAY_MIN 20
30 #define PITCH_DELAY_MAX 143
31 
43 int ff_acelp_decode_8bit_to_1st_delay3(int ac_index);
44 
61  int ac_index,
62  int pitch_delay_min);
63 
81  int ac_index,
82  int pitch_delay_min);
83 
97 int ff_acelp_decode_9bit_to_1st_delay6(int ac_index);
98 
114  int ac_index,
115  int pitch_delay_min);
116 
134  int16_t* quant_energy,
135  int gain_corr_factor,
136  int log2_ma_pred_order,
137  int erasure);
138 
211  DSPContext *dsp,
212  int gain_corr_factor,
213  const int16_t* fc_v,
214  int mr_energy,
215  const int16_t* quant_energy,
216  const int16_t* ma_prediction_coeff,
217  int subframe_size,
218  int max_pred_order);
219 
230 float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
231  float *prediction_error, float energy_mean,
232  const float *pred_table);
233 
234 
248 void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index,
249  const int prev_lag_int, const int subframe,
250  int third_as_first, int resolution);
251 
252 #endif /* AVCODEC_ACELP_PITCH_DELAY_H */
int16_t ff_acelp_decode_gain_code(DSPContext *dsp, int gain_corr_factor, const int16_t *fc_v, int mr_energy, const int16_t *quant_energy, const int16_t *ma_prediction_coeff, int subframe_size, int max_pred_order)
Decode the adaptive codebook gain and add correction (4.1.5 and 3.9.1 of G.729).
void ff_acelp_update_past_gain(int16_t *quant_energy, int gain_corr_factor, int log2_ma_pred_order, int erasure)
Update past quantized energies.
DSPContext dsp
Definition: ac3enc.h:162
void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index, const int prev_lag_int, const int subframe, int third_as_first, int resolution)
Decode the adaptive codebook index to the integer and fractional parts of the pitch lag for one subfr...
int ff_acelp_decode_4bit_to_2nd_delay3(int ac_index, int pitch_delay_min)
Decode pitch delay with 1/3 precision.
int ff_acelp_decode_9bit_to_1st_delay6(int ac_index)
Decode pitch delay of the first subframe encoded by 9 bits with 1/6 precision.
float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy, float *prediction_error, float energy_mean, const float *pred_table)
Calculate fixed gain (part of section 6.1.3 of AMR spec)
int ff_acelp_decode_6bit_to_2nd_delay6(int ac_index, int pitch_delay_min)
Decode pitch delay of the second subframe encoded by 6 bits with 1/6 precision.
int ff_acelp_decode_8bit_to_1st_delay3(int ac_index)
Decode pitch delay of the first subframe encoded by 8 bits with 1/3 resolution.
DSP utils.
int ff_acelp_decode_5_6_bit_to_2nd_delay3(int ac_index, int pitch_delay_min)
Decode pitch delay of the second subframe encoded by 5 or 6 bits with 1/3 precision.
static const float energy_mean[8]
desired mean innovation energy, indexed by active mode
Definition: amrnbdata.h:1458
DSPContext.
Definition: dsputil.h:124