Mercurial > libavcodec.hg
comparison dca.c @ 12146:36f7c2d7b3fb libavcodec
Fix side channels when XCh extension is present.
Patch by Nick Brereton $name AT n$surname DOT net
author | benoit |
---|---|
date | Mon, 12 Jul 2010 09:10:53 +0000 |
parents | 9109a7e48d6e |
children | 6d7a12293959 |
comparison
equal
deleted
inserted
replaced
12145:9109a7e48d6e | 12146:36f7c2d7b3fb |
---|---|
1392 *data_size = 256 / 8 * s->sample_blocks * sizeof(int16_t) * channels; | 1392 *data_size = 256 / 8 * s->sample_blocks * sizeof(int16_t) * channels; |
1393 | 1393 |
1394 /* filter to get final output */ | 1394 /* filter to get final output */ |
1395 for (i = 0; i < (s->sample_blocks / 8); i++) { | 1395 for (i = 0; i < (s->sample_blocks / 8); i++) { |
1396 dca_filter_channels(s, i); | 1396 dca_filter_channels(s, i); |
1397 | |
1398 /* If this was marked as a DTS-ES stream we need to subtract back- */ | |
1399 /* channel from SL & SR to remove matrixed back-channel signal */ | |
1400 if((s->source_pcm_res & 1) && s->xch_present) { | |
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; | |
1403 float* rt_chan = s->samples + s->channel_order_tab[s->xch_base_channel - 1] * 256; | |
1404 int j; | |
1405 for(j = 0; j < 256; ++j) { | |
1406 lt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f; | |
1407 rt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f; | |
1408 } | |
1409 } | |
1410 | |
1397 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); |
1398 samples += 256 * channels; | 1412 samples += 256 * channels; |
1399 } | 1413 } |
1400 | 1414 |
1401 /* update lfe history */ | 1415 /* update lfe history */ |