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

Michael Niedermayer michael at niedermayer.cc
Sun Jan 12 23:25:39 EET 2025


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:

small snippet:

TEST: mono->7.1, rate:16000-> 8000, fmt:fltp->fltp
-0[e:0.175068 c:0.722347 max:1.033369] len:  936
+0[e:0.215880 c:0.722347 max:1.209618] len:  936
-1[e:0.000170 c:0.999945 max:0.000952] len:   32 F: 20
+1[e:0.011484 c:0.999945 max:0.024403] len:   32 F: 20

TEST: mono->4.0, rate:16000-> 8000, fmt:fltp->fltp
-0[e:0.160055 c:0.779681 max:0.941573] len:  936
+0[e:0.208755 c:0.779681 max:1.226016] len:  936
-1[e:0.000170 c:0.999945 max:0.000952] len:   32 F:  7
+1[e:0.011484 c:0.999945 max:0.024403] len:   32 F:  7

TEST: 7.1(wide-side)->mono, rate:16000-> 8000, fmt:s16->fltp
-2[e:0.486037 c:0.697612 max:1.885189] len:  936
+2[e:0.530598 c:0.705716 max:1.934477] len:  936
-10[e:0.406654 c:0.914375 max:0.571520] len:   32 F: 14
+10[e:0.494768 c:0.935996 max:0.729301] len:   32 F: 14

TEST: mono->5.1(side), rate:16000-> 8000, fmt:dbl->s16
-0[e:0.154002 c:0.772701 max:0.915588] len:  936
+0[e:0.198087 c:0.772701 max:1.088437] len:  936
-1[e:0.000168 c:0.999947 max:0.000937] len:   32 F:  0
+1[e:0.011481 c:0.999947 max:0.024411] len:   32 F:  0

TEST: mono->5.0(side), rate:16000-> 8000, fmt:dbl->s16
-0[e:0.175335 c:0.725361 max:1.124762] len:  936
+0[e:0.214456 c:0.725361 max:1.261115] len:  936
-1[e:0.000168 c:0.999947 max:0.000937] len:   32 F:  1
+1[e:0.011481 c:0.999947 max:0.024411] len:   32 F:  1

TEST: mono->5.0(side), rate:16000-> 8000, fmt:dblp->s16
-0[e:0.146423 c:0.812755 max:0.887409] len:  936
+0[e:0.201471 c:0.812755 max:1.233457] len:  936
-1[e:0.000168 c:0.999947 max:0.000937] len:   32 F:  2
+1[e:0.011481 c:0.999947 max:0.024411] len:   32 F:  2

TEST: mono->3.0, rate:16000-> 8000, fmt:s32p->s16
-0[e:0.195285 c:0.770403 max:0.940613] len:  936
+0[e:0.181833 c:0.770403 max:0.943744] len:  936

TEST: mono->5.0(side), rate:16000-> 8000, fmt:flt->s16
-0[e:0.149642 c:0.785486 max:1.093705] len:  936
+0[e:0.198559 c:0.785486 max:1.241070] len:  936
-1[e:0.000168 c:0.999947 max:0.000937] len:   32 F: 15
+1[e:0.011481 c:0.999947 max:0.024411] len:   32 F: 15

TEST: mono->3.0, rate:16000-> 8000, fmt:fltp->s16
-0[e:0.161976 c:0.775346 max:1.064231] len:  936
+0[e:0.211721 c:0.775346 max:1.396510] len:  936
-1[e:0.000168 c:0.999947 max:0.000937] len:   32 F:  3
+1[e:0.011481 c:0.999947 max:0.024411] len:   32 F:  3

-e:9237.681503 c:61932.689569 max:35853.664093
+e:9281.274656 c:61954.481471 max:35988.363391

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- 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/20250112/9265e4ec/attachment.sig>


More information about the ffmpeg-devel mailing list