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 <jamr...@gmail.com> --- libswresample/rematrix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index b9bf4dcac0..e4dc61d6db 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -217,7 +217,7 @@ av_cold int swr_build_matrix2(const AVChannelLayout *in_layout, const AVChannelL matrix[FRONT_CENTER][ FRONT_LEFT]+= M_SQRT1_2; matrix[FRONT_CENTER][FRONT_RIGHT]+= M_SQRT1_2; if (av_channel_layout_index_from_channel(&in_ch_layout, AV_CHAN_FRONT_CENTER) >= 0) - matrix[FRONT_CENTER][ FRONT_CENTER] = center_mix_level*sqrt(2); + matrix[FRONT_CENTER][ FRONT_CENTER] += M_SQRT1_2; }else av_assert0(0); } @@ -334,7 +334,7 @@ av_cold int swr_build_matrix2(const AVChannelLayout *in_layout, const AVChannelL matrix[TOP_FRONT_CENTER][TOP_FRONT_LEFT ] += M_SQRT1_2; matrix[TOP_FRONT_CENTER][TOP_FRONT_RIGHT] += M_SQRT1_2; if (av_channel_layout_index_from_channel(&in_ch_layout, AV_CHAN_TOP_FRONT_CENTER) >= 0) - matrix[TOP_FRONT_CENTER][TOP_FRONT_CENTER] = center_mix_level * sqrt(2); + matrix[TOP_FRONT_CENTER][TOP_FRONT_CENTER] += M_SQRT1_2; } else if (av_channel_layout_index_from_channel(&out_ch_layout, AV_CHAN_FRONT_LEFT) >= 0) { if (av_channel_layout_index_from_channel(&in_ch_layout, AV_CHAN_FRONT_LEFT) >= 0) { matrix[FRONT_LEFT ][TOP_FRONT_LEFT ] += M_SQRT1_2; -- 2.47.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".