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 899454520D for ; Thu, 12 Jan 2023 16:09:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B11CD68B6C8; Thu, 12 Jan 2023 18:09:27 +0200 (EET) Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B3EE1689806 for ; Thu, 12 Jan 2023 18:09:21 +0200 (EET) Received: by mail-vs1-f45.google.com with SMTP id p1so2731338vsr.5 for ; Thu, 12 Jan 2023 08:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ic/kYOs+uCa+ztGC4ymQqKVI3uWe7HWQOhhYiFc6V9Q=; b=oPvtzd5R4sbbpEv+3SIunq97AnQrC+zHWXcQcH4kvDle+xp62uEGIgJ4zJ/zdP3Czl xrExEVYQ/TbBN4jfBF0QC70KhHc06EO7J6ysgdjQezxDP9bjV2R6zTUP/xjr4Vxj8zF1 8OahJeGJ1yBiYTRTwLroUo2e8f4a8KPq7j+nFHlzLHKTUdIUWGRUMfWdhgXxbObt8/fP yEppDDKOW4YqPq72M7Yza/ZT7+gMJOrwP/x61BOMZUQap3+k6+yusREinqxsrwat7xlm T4oRFNyXQCAeaxVOj7OgANGZXiPy3Qsl+sZ7P+eZFNiVIIvyv3x3kAhZ4O3ITKsKsF1O ioPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ic/kYOs+uCa+ztGC4ymQqKVI3uWe7HWQOhhYiFc6V9Q=; b=QF1V8AVvoPqMu5MdrBL2SoX+klYvmAWHdJKXLHeITGOWCSKMRGjgjwKCd4/HMJ8ft3 KAS4qMwCcV7b8g823TpjwyD2kExEd+udSwIKD0OwneLkFz7YRMEZOVC69RseqSTzX7Px GVlAjzS1pnqz6QG+sqxQ7EkpYtKpB0CgmxZa1WIMKb4358cmhek1i8A1ngy1mAmR4mFv UMDYcORbPy2U1syh6jXc691b+BmSAYIoRnU7zgNMwJz+p3uh7RN7n3VgaVSMY8mNWD2q seXPrHmsgPDXM1bqRw52Dakf9J8aGTFEdjhby5HoYGTpXYHA/E7qscRR9jpJFixRddET Xyqg== X-Gm-Message-State: AFqh2krxY6A6nrQQgE3ILdwzPxQd+rJBzQ2zlltwZf31ZmTzTmiVeriu fxNJmcMXK0ZORBVIK4pHnhVjTtqWqj505hMV6vqnmYMU X-Google-Smtp-Source: AMrXdXs4HOTn6qu+siUlKKWCvdw6JfyPyQ6fodXu6bj+8VjelzzroNbRMyOABy/JLgsxcjHTTqaD6b4X9Q4AbHnKUL0= X-Received: by 2002:a67:d019:0:b0:3d0:b6fd:9609 with SMTP id r25-20020a67d019000000b003d0b6fd9609mr2132398vsi.15.1673539760029; Thu, 12 Jan 2023 08:09:20 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:612c:2428:b0:32a:5eaa:92e4 with HTTP; Thu, 12 Jan 2023 08:09:18 -0800 (PST) In-Reply-To: <20230112154136.GM1949656@pb2> References: <20230105205342.GE4028235@pb2> <20230106172506.GG4028235@pb2> <20230108145210.GD35806@pb2> <20230112154136.GM1949656@pb2> From: Paul B Mahol Date: Thu, 12 Jan 2023 17:09:18 +0100 Message-ID: To: FFmpeg development discussions and patches 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 1/12/23, Michael Niedermayer wrote: > On Thu, Jan 12, 2023 at 03:20:06PM +0100, Paul B Mahol wrote: >> On 1/8/23, Michael Niedermayer wrote: >> > On Fri, Jan 06, 2023 at 07:04:59PM +0100, Paul B Mahol wrote: >> >> 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. >> > >> > I certainly would welcome a wider range of filters in swr, if you want >> > to >> > add >> > any low delay sinc approximation or in fact i would welcome any filter >> > you want to add. >> >> There is that afdelaysrc filter patch on ML to add FIR coefficient >> generation for fractional delay audio filter that can be also used as >> a interpolation FIR filter. And to me it seems better at same number >> of taps than already used/available ones in soxr and swr. > > Please add improvments into swr, if you have any! > > >> >> Also I have done prototype of resampling filter using afir filter via >> custom filters in filtergraph and it operates at similar speeds like >> soxr (in these very non optimized approach) and providing better/wider >> frequency output at highest band. > > Can it be added into swr ? It will use libavutil/tx.h for convolution. But I need first to research more and write actual code that does out/in sample rate ratio factorization and do lot of benchmarks comparing normal ratios with very big ones and make sure that approach is always faster than swr/soxr and at same time providing better/same quality. Also need to add min phase version of filter and compare what performance/latency it can bring at all. > > thx > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Awnsering whenever a program halts or runs forever is > On a turing machine, in general impossible (turings halting problem). > On any real computer, always possible as a real computer has a finite > number > of states N, and will either halt in less than N cycles or never halt. > _______________________________________________ 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".