[FFmpeg-devel] [PATCH] swresample/rematrix: fix mixing of center channels

Michael Niedermayer michael at niedermayer.cc
Mon Jan 13 22:30:47 EET 2025


Hi

On Mon, Jan 13, 2025 at 03:51:07PM -0300, James Almer wrote:
> On 1/13/2025 12:49 AM, Michael Niedermayer wrote:
> > Hi James
> > 
> > On Sun, Jan 12, 2025 at 06:52:55PM -0300, James Almer wrote:
> > > On 1/12/2025 6:25 PM, Michael Niedermayer wrote:
> > > > Hi
> > > > 
> > > > On Sat, Jan 11, 2025 at 11:13:30AM -0300, James Almer wrote:
> > > > > With this, the output from
> > > > > 
> > > > > ffmpeg -i $fate-samples/ac3/monsters_inc_5.1_448_small.ac3 -af aresample,aformat=channel_layouts=mono -f s16le -
> > > > > 
> > > > > matches the one from
> > > > > 
> > > > > ffmpeg -downmix mono -i $fate-samples/ac3/monsters_inc_5.1_448_small.ac3 -f s16le -
> > > > > 
> > > > > When testing with tiny_psnr.
> > > > > 
> > > > > Signed-off-by: James Almer <jamrial at gmail.com>
> > > > > ---
> > > > >    libswresample/rematrix.c | 4 ++--
> > > > >    1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > This worsense test results:
> > > 
> > > What test is this, and how is it read?
> > 
> > its just tests/swresample
> > 
> > and a dumb script that tries to compare its output to spot cases that worsen
> Is this any better? (Also makes the above command line match)

Can we take a step back here.

please explain what you are fixing exactly

the matrix should be 1.0 on channels that exist before and afterwards
so a speaker thats there before the mix and after the mix produces the
same sound. That should naively be closest to correct,
Speakers which disappear need to have their sound mixed into existing
speakers. But existing speakers that dont change should not have their
output change if the goal is to replicate the input

Of course maybe something else is better in some case (i dont know)
but id like to read an explanation what and why. Not just that it
matches something else

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250113/49461614/attachment.sig>


More information about the ffmpeg-devel mailing list