00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AVCODEC_ACELP_VECTORS_H
00024 #define AVCODEC_ACELP_VECTORS_H
00025
00026 #include <stdint.h>
00027
00028 typedef struct ACELPVContext {
00040 void (*weighted_vector_sumf)(float *out, const float *in_a, const float *in_b,
00041 float weight_coeff_a, float weight_coeff_b,
00042 int length);
00043
00044 }ACELPVContext;
00045
00049 void ff_acelp_vectors_init(ACELPVContext *c);
00050 void ff_acelp_vectors_init_mips(ACELPVContext *c);
00051
00053 typedef struct {
00054 int n;
00055 int x[10];
00056 float y[10];
00057 int no_repeat_mask;
00058 int pitch_lag;
00059 float pitch_fac;
00060 } AMRFixed;
00061
00076 extern const uint8_t ff_fc_4pulses_8bits_tracks_13[16];
00077
00089 extern const uint8_t ff_fc_4pulses_8bits_track_4[32];
00090
00105 extern const uint8_t ff_fc_2pulses_9bits_track1[16];
00106 extern const uint8_t ff_fc_2pulses_9bits_track1_gray[16];
00107
00137 extern const uint8_t ff_fc_2pulses_9bits_track2_gray[32];
00138
00142 extern const float ff_b60_sinc[61];
00143
00147 extern const float ff_pow_0_7[10];
00148
00152 extern const float ff_pow_0_75[10];
00153
00157 extern const float ff_pow_0_55[10];
00158
00173 void ff_acelp_fc_pulse_per_track(int16_t* fc_v,
00174 const uint8_t *tab1,
00175 const uint8_t *tab2,
00176 int pulse_indexes,
00177 int pulse_signs,
00178 int pulse_count,
00179 int bits);
00180
00193 void ff_decode_10_pulses_35bits(const int16_t *fixed_index,
00194 AMRFixed *fixed_sparse,
00195 const uint8_t *gray_decode,
00196 int half_pulse_count, int bits);
00197
00198
00214 void ff_acelp_weighted_vector_sum(int16_t* out,
00215 const int16_t *in_a,
00216 const int16_t *in_b,
00217 int16_t weight_coeff_a,
00218 int16_t weight_coeff_b,
00219 int16_t rounder,
00220 int shift,
00221 int length);
00222
00234 void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b,
00235 float weight_coeff_a, float weight_coeff_b,
00236 int length);
00237
00248 void ff_adaptive_gain_control(float *out, const float *in, float speech_energ,
00249 int size, float alpha, float *gain_mem);
00250
00266 void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in,
00267 float sum_of_squares, const int n);
00268
00277 void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size);
00278
00286 void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size);
00287
00288 #endif