From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 455ED450F5 for ; Fri, 6 Jan 2023 18:00:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5A18E68BD18; Fri, 6 Jan 2023 20:00:08 +0200 (EET) Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D4208689CE2 for ; Fri, 6 Jan 2023 20:00:01 +0200 (EET) Received: by mail-vs1-f47.google.com with SMTP id k4so2238395vsc.4 for ; Fri, 06 Jan 2023 10:00:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=djDpBW29b8PX2stgV1gVCl7znp8sQl+JO1FrzxuW0Cs=; b=QHA32S7FA5jGHqkqY0LJHYCSlM8HG9IRZj5EzKKHsMZjqVUGl34HdYFpOBR5VaU/W/ NaYrB5obkFWA5GZtjC9T3D38dNLtKat0wU4PQi9xMshN49Q7T+hmliP+eU12e87W8ySW 3C5eOpg0N+/XVgTMwo2xEJXpQDZnp56BfIQd2GxWm14/uMZBt7B0czTXYast037aaffn in1cJ3GW71/xn0QU8IVCC8Ol9tE4ilZoGrybH5w1Y3fkBObJe0IZYCKYJnNHGzQQ13OI iLKkf39uEcAgTDdVHhB98NvqZVXhPZ3jD12JASQrsixvo8cXBbrDdXK/qCUQnnqdbauc DGRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=djDpBW29b8PX2stgV1gVCl7znp8sQl+JO1FrzxuW0Cs=; b=BJw8bfMzU/Q4j3fiDBL51ByX8V65PvWAYRtRpx/KOy32kOiVjoFrWfa4xxKxfBEiHw RchJ9o9wkMRUEa/Zz39obyTdsxxrwXMVvYHccD8bIqpF/rEr+knwPeEN8WA2Qap2FSxN 6gMC9aC+Pkb56tkZyc90hlbaMqs/mazUBgh1zz4YDJVQp8u2rZOu9wnviNBYKxeq7FlW iUziz5TY3D9RUQlXHSaxbnwFSvhT2g8uJdeTS0qTGlLk8PHbDW+DNNKWbRR+emgUMPD8 1wLBrH1rMqp1a5DWC7uu8yws33J501ZHAx9DqrNancwhIEPbVf/1xExoTEUlvLxTyPr6 jJnA== X-Gm-Message-State: AFqh2krLLsQk7CPdLNFUGDKrGcjQRkuOx9dbG2L+aF8/VXH9/8kfsH5p GtplIQCzkwY4QdPV1DUJYZ1sKwyUtp96a3PCBkegEcTr X-Google-Smtp-Source: AMrXdXu+Lo3mQTW/pEA2CSatLg7VFSzg8/AhcLws7hcgYM7fjhSO5VjekpP3U+shI2DzPgJ6URT9rtHxtYYlx+LZC7k= X-Received: by 2002:a05:6102:149f:b0:3ce:896f:ed7b with SMTP id d31-20020a056102149f00b003ce896fed7bmr2474598vsv.61.1673028000451; Fri, 06 Jan 2023 10:00:00 -0800 (PST) MIME-Version: 1.0 References: <20230105205342.GE4028235@pb2> <20230106172506.GG4028235@pb2> In-Reply-To: From: Paul B Mahol Date: Fri, 6 Jan 2023 19:04:59 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] libswresample: avoid s16p internal processing format X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, Jan 6, 2023 at 7:01 PM Paul B Mahol wrote: > > > On Fri, Jan 6, 2023 at 6:25 PM Michael Niedermayer > wrote: > >> On Thu, Jan 05, 2023 at 11:08:25PM +0100, Paul B Mahol wrote: >> > On Thu, Jan 5, 2023 at 9:53 PM Michael Niedermayer < >> michael@niedermayer.cc> >> > wrote: >> > >> > > On Thu, Jan 05, 2023 at 01:44:10PM +0100, Paul B Mahol wrote: >> > > > Patch attached. >> > > >> > > > swresample.c | 3 ++- >> > > > 1 file changed, 2 insertions(+), 1 deletion(-) >> > > > eee7a0685b44aa867562138a2e2437ecb8844612 >> > > 0001-libswresample-swresample-avoid-s16p-internal-transfe.patch >> > > > From 9c4cd60e2dd41cf98d693c8251f4cfade0807073 Mon Sep 17 00:00:00 >> 2001 >> > > > From: Paul B Mahol >> > > > 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. >> > > >> > > When does this occur and why? >> > > >> > >> > It occurs always. Just compare output with 16bit and int32/float/double. >> > Look at other people report on internet. >> > Look at src.infinitewave.ca >> >> src.infinitewave.ca uses 32bit none of what it shows should touch the >> codepath >> you change. >> >> if we look at src.infinitewave.ca for swr we see 2 types of artifacts >> 1. Aliassing which is at maybe -120db with the actual signal at 0db >> i would like to see some evidence that a human can hear this >> > > For s16p<->s16p it is much lower, around -78dB thus this patch. > > Also for others and reports for swr its is lower than exact -120dB > > > 2. Reflection and attenuation at the transition frequency >> With linear filters there is a tradeof between attenuation of the >> passband, reflection of frequencies beyond, latency and so on >> You can have a perfect sharp cutoff with no attenuation and no refelection >> that requires a infinitly long filter. And while this looks best in this >> frequency plot, does it actually sound best ? If you can hear -120db >> signals you surely would then also hear the ringing long before a gunshot >> from such long filter. >> > One can always change linear FIR to be min phase FIR kernel. > >> also what actually is the optimal frequency response of this filter ? >> with a 22khz cutoff, a 22.1khz sine should be silence is that >> really subjectively better than a 21.9khz sine ? >> Iam not sure about this. Has someone done actual hearing tests with >> actual real audio? the sinc filter originates from the idea of lossless >> reconstruction of frequencies below nyquist if iam not mistaken, but >> humans >> are not trying to losslessly restore a block of frequencies. A human >> listener >> generally wants to enjoy listening to some media. Has someone looked into >> what is actually best for that real use case ? >> This question matters because with it we can tune the filter parameters to >> target humans. >> >> But lets push the doubts about choosing resampling purely based on >> frequency >> analysis away. >> swresample has several parameters with which you can tune this: >> we have a filter_size, if thats bigger you should get closer to the ideal >> sinc. Theres phase_shift which may reduce the (i assume) unhearable >> aliasing. >> And cutoff which should allow to tune the (i assume) hearable >> reflection/attenuation tradeoff also theres filter_type to allow you to >> tune the >> window function. >> >> If there are issues reported by people using their ears, please provide >> more >> details, iam interrested in these cases. >> >> >> > >> > >> > > This change should be limited to the case that benefits, this would >> force >> > > this >> > > even without resampling in some cases. >> > > >> > >> > It is forced only if sample rates between input and output differs. >> >> If iam not mistaken it affects rematrixing without resampling too >> > > How so? > I really doubt that this patch do that. > > >> >> thx >> >> [...] >> -- >> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB >> >> The real ebay dictionary, page 1 >> "Used only once" - "Some unspecified defect prevented a second use" >> "In good condition" - "Can be repaird by experienced expert" >> "As is" - "You wouldnt want it even if you were payed for it, if you knew >> ..." >> _______________________________________________ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> >> To unsubscribe, visit link above, or email >> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". >> > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".