[FFmpeg-devel] [PATCH 2/2] Fix side channels when XCh extension is present
Kostya
kostya.shishkov
Sun Jul 11 08:45:37 CEST 2010
On Sat, Jul 10, 2010 at 09:47:58PM +0100, Nick Brereton wrote:
> Patch 2/2 to fix side channels when DTS-ES matrix is flagged *and*
> DTS-ES discrete is also present in XCh extension.
First, this is not unified diff, so it's not a patch in strict sense :)
And can you guarantee it's always correct mapping for channels (sorry,
don't have specs at hand) i.e. it does not depend on amode?
> Index: libavcodec/dca.c
> ===================================================================
> --- libavcodec/dca.c (previous working copy)
> +++ libavcodec/dca.c (working copy)
> 1395a1396,1409
> >
> > /* If this was marked as a DTS-ES stream we need to subtract back- */
> > /* channel from SL & SR to remove matrixed back-channel signal */
> > if((s->source_pcm_res & 1) && s->xch_present) {
> > float* back_chan = s->samples + s->channel_order_tab[s->xch_base_channel] * 256;
> > float* lt_chan = s->samples + s->channel_order_tab[s->xch_base_channel - 2] * 256;
> > float* rt_chan = s->samples + s->channel_order_tab[s->xch_base_channel - 1] * 256;
> > int j;
> > for(j = 0; j < 256; ++j) {
> > lt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f;
> > rt_chan[j] -= (back_chan[j] - s->add_bias) * 0.707107f;
> > }
> > }
> >
More information about the ffmpeg-devel
mailing list