[FFmpeg-devel] [PATCH 02/10] lavfi: support unknown channel layouts.

Stefano Sabatini stefasab at gmail.com
Tue Jan 1 16:46:26 CET 2013

On date Tuesday 2013-01-01 02:05:30 +0100, Nicolas George encoded:
> Le primidi 11 nivôse, an CCXXI, Stefano Sabatini a écrit :
> > This is excluding lists supporting all channel layouts with a known
> > disposition, and channel layouts with unknown disposition and a
> > certain number N of channels, which could be represented as:
> > 
> > all_channels = 1;
> > list = { FF_CHAN2LAYOUT(N) };
> > 
> > Another case: a list supporting all channel layouts with unknown
> > disposition, but only a few with known disposition.
> > 
> > I wonder if this is by purpose. On the other hands such lists don't
> > make much sense, but even in this case I wonder which are the
> > pros/cons of adding more constraints.

> I believe it would make the code slightly more complicated, the merge and
> reduce part. It does not seem currently necessary, but if someone needs it
> at some time, it should be possible to implement it then.

On the other hand my intuition is that the code would be simpler the
other way, since the underlying mathematical construct looks simpler.

With the current code you can represent only a subset of the cartesian
product of the P(Counts) and P(Layouts) (powersets of Counts and
Layouts, both "completed" with the "all_layouts" and "all_counts"
symbols)* sorted by the reflexive subset inclusion relation, which
does not preserve the sup (least upper bound/supremum) in the sense
that considering the chain:

(L_1, C_1) <= (L_2, C_2) <= ... <= (L_n, C_n) <= ...

the property:
sup(L_i, C_i) == (sup(L_i), sup(C_n))

is not true, for example like in:

({l_1}, {c_1}) <= ({l_1, l_2}, {c_1}) <= ... <= ({l_1, l_2, ..., l_n}, {c_1}) <= ...

where you have:
sup(L_i) = all_channels
sup(C_i) = {c_1}

sup(L_i, C_i) = (all_channels, all_counts)

Also it sounds weird to be able to express:
({l_1, l_2, ..., l_n}, {c_1})

but not:
(all_layouts, {c_1})

But don't take this mail too seriously before I actually read the

* Notation: L_n element of P(Layouts), c_n element of Layouts, same
for C/c.
FFmpeg = Friendly Fostering Mysterious Peaceful Ecumenical Governor

More information about the ffmpeg-devel mailing list