[FFmpeg-devel] Channel mapping integration in af pan

Nicolas George nicolas.george at normalesup.org
Wed Jan 18 13:58:12 CET 2012

Le nonidi 29 nivôse, an CCXX, Clément Bœsch a écrit :
> After the first attempt to have a channel mapping filter [1], Nicolas proposed
> to integrate it in af pan filter instead. So here here is a patch set for that
> purpose.


> Note: I noticed the union gain (double/int) doesn't work as expected when we
> try "if (pan->gain.i[x][y])" with small coefficients.

I am not sure what you mean here. Is it that coefficients smaller than 1/256
are effectively rounded to 0, and therefore considered as such? If so, this
is the expected behaviour: by working with integers, we trade accuracy for

>							It can be fixed using
> int64_t instead of int in the union,

I do not think we want to have int64_t arithmetic in the inner loop for the
most common case.

>				       but I'm actually wondering if the union
> couldn't just be dropped instead.

This is unrelated: the point you raise is related to using integer
arithmetic, it would stay the same whether we use an union or not.

The union is only that: once we have decided the sample format, we can
convert all coefficients to the type we need, and since we will never need
the original floating-point coefficients again, we can store everything in
the same memory area.

> Also, a more problematic issue is that this example (taken from the doc):
>   pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
> doesn't actually work ('Expected out channel name, got " FL < FL"'). I didn't
> look closer though.

Probably a place where I forgot to skip spaces. Does it work if you remove
the space in front of FL?

>		      BTW, I think quotes should be added in this example.

I am not sure: quotes are for the shell, they are necessary when describing
complete command lines, but for isolated examples this is less obvious.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120118/2c5b7528/attachment.asc>

More information about the ffmpeg-devel mailing list