30 int i, flags1, flags2, block_align;
53 #if FF_API_OLD_ENCODE_AUDIO
105 const float * win = s->
windows[window_index];
107 float n = 2.0 * 32768.0 / window_len;
122 float v, *q, max_scale, *q_end;
130 v = pow(10, *exp_param++ * (1.0 / 16.0));
131 max_scale=
FFMAX(max_scale, v);
149 last_exp= *exp_param++;
150 av_assert0(last_exp-10 >= 0 && last_exp-10 < 32);
156 int exp = *exp_param++;
157 int code = exp - last_exp + 60;
167 int v, bsize, ch, coef_nb_bits, parse_exponents;
170 static const int fixed_exp[25]={20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20};
192 mdct_norm = 1.0 / (float)n4;
194 mdct_norm *= sqrt(n4);
212 float *coefs, *exponents,
mult;
217 mult = pow(10, total_gain * 0.05) / s->
max_exponent[ch];
219 coefs = src_coefs[ch];
225 for(i = 0;i < n; i++){
226 double t= *coefs++ / (exponents[i] *
mult);
227 if(t<-32768 || t>32767)
230 coefs1[i] =
lrint(t);
246 for(v= total_gain-1; v>=127; v-= 127)
271 if (parse_exponents) {
292 eptr = ptr + nb_coefs[ch];
295 for(;ptr < eptr; ptr++){
298 int abs_level=
FFABS(level);
300 if(abs_level <= s->
coef_vlcs[tindex]->max_level){
301 if(run < s->
coef_vlcs[tindex]->levels[abs_level-1])
302 code= run + s->
int_table[tindex][abs_level-1];
309 if(1<<coef_nb_bits <= abs_level)
350 int i, total_gain, ret, error;
362 a = s->
coefs[0][i]*0.5;
363 b = s->
coefs[1][i]*0.5;
380 while(total_gain <= 128 && error > 0)
399 #if CONFIG_WMAV1_ENCODER
413 #if CONFIG_WMAV2_ENCODER