comparison mpegaudiodec.c @ 2532:b7511e7dabb7 libavcodec

cast to uint32 as the table is uint32_t, this also worksaround a gcc or libc bug related to frexp()
author michael
date Wed, 02 Mar 2005 20:46:06 +0000
parents e25782262d7d
children ac78b35aa838
comparison
equal deleted inserted replaced
2531:eed7d92a1dfc 2532:b7511e7dabb7
415 for(i=1;i<TABLE_4_3_SIZE;i++) { 415 for(i=1;i<TABLE_4_3_SIZE;i++) {
416 double f, fm; 416 double f, fm;
417 int e, m; 417 int e, m;
418 f = pow((double)(i/4), 4.0 / 3.0) * pow(2, (i&3)*0.25); 418 f = pow((double)(i/4), 4.0 / 3.0) * pow(2, (i&3)*0.25);
419 fm = frexp(f, &e); 419 fm = frexp(f, &e);
420 m = FIXHR(fm*0.5); 420 m = (uint32_t)(fm*(1LL<<31) + 0.5);
421 e+= FRAC_BITS - 31 + 5; 421 e+= FRAC_BITS - 31 + 5;
422 422
423 /* normalized to FRAC_BITS */ 423 /* normalized to FRAC_BITS */
424 table_4_3_value[i] = m; 424 table_4_3_value[i] = m;
425 // av_log(NULL, AV_LOG_DEBUG, "%d %d %f\n", i, m, pow((double)i, 4.0 / 3.0)); 425 // av_log(NULL, AV_LOG_DEBUG, "%d %d %f\n", i, m, pow((double)i, 4.0 / 3.0));