Now with Takehiro's table changes; in iteration_init:
=====
#if (defined(__GNUC__) && defined(__i386__)) || defined (_MSC_VER)
for (i = 0; i < PRECALC_SIZE - 1; i++)
adj43[i] = i + 0.5 - pow(0.5 * (pow43[i] + pow43[i + 1]), 0.75);
adj43[i] = 0.0;
#else
for (i = 0; i < PRECALC_SIZE - 1; i++)
adj43[i] = (i + 1) - pow(0.5 * (pow43[i] + pow43[i + 1]), 0.75);
adj43[i] = 0.5;
#endif
=====
and an updated quantize_xrpow:
=====
#if defined(__GNUC__) && defined(__i386__)
# define XRPOW_FTOI(src, dest) \
asm ("fistpl %0 " : "=m" (dest) : "t" (src) : "st")
#elif defined (_MSC_VER)
# define XRPOW_FTOI(src, dest) \
do { \
FLOAT8 src_ = (src); \
int dest_; \
{ \
__asm fld src_ \
__asm fistp dest_ \
} \
(dest) = dest_; \
} while (0)
#else
# define XRPOW_FTOI(src,dest) ((dest) = (int)(src))
#endif
#define QUANTFAC_OLD(rx) 0.4054
#define QUANTFAC(rx) adj43[rx]
void quantize_xrpow( FLOAT8 xr[576], int ix[576], gr_info *cod_info )
{
/* quantize on xr^(3/4) instead of xr */
register int j;
FLOAT8 x,quantizerStepSize;
FLOAT8 istep_l,istep0,istep1,istep2;
int rx;
quantizerStepSize = cod_info->quantizerStepSize;
istep_l = pow ( 2.0, quantizerStepSize * -0.1875 );
if ((cod_info->block_type==SHORT_TYPE))
{
istep0 = istep_l * pow(2.0,1.5* (FLOAT8) cod_info->subblock_gain[0]);
istep1 = istep_l * pow(2.0,1.5* (FLOAT8) cod_info->subblock_gain[1]);
istep2 = istep_l * pow(2.0,1.5* (FLOAT8) cod_info->subblock_gain[2]);
for (j=192;j>0;j--)
{
x = istep0 * *xr++;
XRPOW_FTOI(x - .5, rx);
XRPOW_FTOI(x + QUANTFAC(rx), *(ix++));
x = istep1 * *xr++;
XRPOW_FTOI(x - .5, rx);
XRPOW_FTOI(x + QUANTFAC(rx), *(ix++));
x = istep2 * *xr++;
XRPOW_FTOI(x - .5, rx);
XRPOW_FTOI(x + QUANTFAC(rx), *(ix++));
}
}
else
{
for (j=576;j>0;j--)
{
x = istep_l * *xr++;
XRPOW_FTOI(x - .5, rx);
XRPOW_FTOI(x + QUANTFAC(rx), *(ix++));
}
}
}
=====
-- Mat.
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )