comparison dca.c @ 12147:6d7a12293959 libavcodec

Use math constant instead of hardcoded rounded value for sqrt(0.5). Patch by Christophe.Gisquet (gmail)
author benoit
date Mon, 12 Jul 2010 12:32:24 +0000
parents 36f7c2d7b3fb
children 91e45d11dd6e
comparison
equal deleted inserted replaced
12146:36f7c2d7b3fb 12147:6d7a12293959
1401 float* back_chan = s->samples + s->channel_order_tab[s->xch_base_channel] * 256; 1401 float* back_chan = s->samples + s->channel_order_tab[s->xch_base_channel] * 256;
1402 float* lt_chan = s->samples + s->channel_order_tab[s->xch_base_channel - 2] * 256; 1402 float* lt_chan = s->samples + s->channel_order_tab[s->xch_base_channel - 2] * 256;
1403 float* rt_chan = s->samples + s->channel_order_tab[s->xch_base_channel - 1] * 256; 1403 float* rt_chan = s->samples + s->channel_order_tab[s->xch_base_channel - 1] * 256;
1404 int j; 1404 int j;
1405 for(j = 0; j < 256; ++j) { 1405 for(j = 0; j < 256; ++j) {
1406 lt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f; 1406 lt_chan[j] -= (back_chan[j] - s->add_bias) * M_SQRT1_2;
1407 rt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f; 1407 rt_chan[j] -= (back_chan[j] - s->add_bias) * M_SQRT1_2;
1408 } 1408 }
1409 } 1409 }
1410 1410
1411 s->dsp.float_to_int16_interleave(samples, s->samples_chanptr, 256, channels); 1411 s->dsp.float_to_int16_interleave(samples, s->samples_chanptr, 256, channels);
1412 samples += 256 * channels; 1412 samples += 256 * channels;