Patch attached.
From 9c4cd60e2dd41cf98d693c8251f4cfade0807073 Mon Sep 17 00:00:00 2001 From: Paul B Mahol <one...@gmail.com> Date: Thu, 5 Jan 2023 13:40:12 +0100 Subject: [PATCH] libswresample/swresample: avoid s16p internal transfer format
Instead use float one by default for sample rate conversions. The s16p internal transfer format produces visible and hearable quantization artifacts. Signed-off-by: Paul B Mahol <one...@gmail.com> --- libswresample/swresample.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 5884f8d533..e6151bc335 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -318,7 +318,8 @@ av_cold int swr_init(struct SwrContext *s){ if(s->int_sample_fmt == AV_SAMPLE_FMT_NONE){ if( av_get_bytes_per_sample(s-> in_sample_fmt) <= 2 - && av_get_bytes_per_sample(s->out_sample_fmt) <= 2){ + && av_get_bytes_per_sample(s->out_sample_fmt) <= 2 + && s->out_sample_rate==s->in_sample_rate) { s->int_sample_fmt= AV_SAMPLE_FMT_S16P; }else if( av_get_bytes_per_sample(s-> in_sample_fmt) <= 2 && !s->rematrix -- 2.37.2
_______________________________________________ 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".