32 int i, flags1, flags2, block_align;
102 const float * win = s->
windows[window_index];
104 float n = 2.0 * 32768.0 / window_len;
119 float v, *q, max_scale, *q_end;
127 v = pow(10, *exp_param++ * (1.0 / 16.0));
128 max_scale=
FFMAX(max_scale, v);
146 last_exp= *exp_param++;
147 av_assert0(last_exp-10 >= 0 && last_exp-10 < 32);
153 int exp = *exp_param++;
154 int code = exp - last_exp + 60;
164 int v, bsize, ch, coef_nb_bits, parse_exponents;
167 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};
189 mdct_norm = 1.0 / (float)n4;
191 mdct_norm *= sqrt(n4);
209 float *coefs, *exponents,
mult;
214 mult = pow(10, total_gain * 0.05) / s->
max_exponent[ch];
216 coefs = src_coefs[ch];
222 for(i = 0;i <
n; i++){
223 double t= *coefs++ / (exponents[i] *
mult);
224 if(t<-32768 || t>32767)
227 coefs1[i] =
lrint(t);
243 for(v= total_gain-1; v>=127; v-= 127)
268 if (parse_exponents) {
289 eptr = ptr + nb_coefs[ch];
292 for(;ptr < eptr; ptr++){
295 int abs_level=
FFABS(level);
297 if(abs_level <= s->
coef_vlcs[tindex]->max_level){
298 if(run < s->
coef_vlcs[tindex]->levels[abs_level-1])
299 code= run + s->
int_table[tindex][abs_level-1];
306 if(1<<coef_nb_bits <= abs_level)
347 int i, total_gain,
ret, error;
359 a = s->
coefs[0][i]*0.5;
360 b = s->
coefs[1][i]*0.5;
377 while(total_gain <= 128 && error > 0)
380 av_log(avctx,
AV_LOG_ERROR,
"Invalid input data or requested bitrate too low, cannot encode\n");
401 #if CONFIG_WMAV1_ENCODER
415 #if CONFIG_WMAV2_ENCODER