00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FFMPEG_G729POSTFILTER_H
00022 #define FFMPEG_G729POSTFILTER_H
00023
00024 #include <stdint.h>
00025 #include "dsputil.h"
00026
00031 #define G729_TILT_FACTOR_PLUS 6554
00032
00037 #define G729_TILT_FACTOR_MINUS 29491
00038
00039
00040 #define FORMANT_PP_FACTOR_NUM 18022 //0.55 in Q15
00041 #define FORMANT_PP_FACTOR_DEN 22938 //0.70 in Q15
00042
00047 #define G729_AGC_FACTOR 32358
00048 #define G729_AGC_FAC1 (32768-G729_AGC_FACTOR)
00049
00055 #define MIN_LT_FILT_FACTOR_A 21845
00056
00060 #define SHORT_INT_FILT_LEN 2
00061
00065 #define LONG_INT_FILT_LEN 8
00066
00071 #define ANALYZED_FRAC_DELAYS 7
00072
00076 #define RES_PREV_DATA_SIZE (PITCH_DELAY_MAX + LONG_INT_FILT_LEN + 1)
00077
00097 void ff_g729_postfilter(DSPContext *dsp, int16_t* ht_prev_data, int* voicing,
00098 const int16_t *lp_filter_coeffs, int pitch_delay_int,
00099 int16_t* residual, int16_t* res_filter_data,
00100 int16_t* pos_filter_data, int16_t *speech,
00101 int subframe_size);
00102
00113 int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t *speech,
00114 int subframe_size, int16_t gain_prev);
00115
00116 #endif // FFMPEG_G729POSTFILTER_H