From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 4909A4CE36 for ; Fri, 31 Oct 2025 14:30:33 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'Jnop0fzoG1P9ZQsBmr2+Tdgs30BUCDqlDpagsk/Z8eI=', expected b'jX8CNvjeoSajWa+1n1jTAGdKMcVXh895fbUuCaS0MbU=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1761921013; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=Jnop0fzoG1P9ZQsBmr2+Tdgs30BUCDqlDpagsk/Z8eI=; b=M956nvv6r0ivpfK2V6h3mozQmL63U/y5a8+QOVIlsD83vhOE0xHKRD4pAMGQy41x8Y708 K2h3KCXCLEPp1ELZXHCwWisbLLwp7fXnQqNMa3jDwQl8ojLNyV8XQQhxWD0NFQER0C24/6R peyB4NVtVGSobmvbW9N9QMIxfoPhYZd0JUjHYDtK0qeZW5QHOoP1iWlUuEcUm/wEYC9Azip ajtHTc0xioIOAgKlciiYwXiDtguerpf2PvenQCqTSFQAwIUPi209nxNrcinBFVAGy56ONWN MbxEzIYTtzLHQZAjXEmX637mSy4oPm75DqyCkZIeGQ+MwmzR3d4zndnPrlog== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 413CB68FBB6; Fri, 31 Oct 2025 16:30:13 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1761921007; b=BrLr0EaUbYLJH7fs8qeyqjLDBuUZfMb6oHLCM5od8WWsHKPUe0ZZRaYYHWF2nJm4H1V2t 1wbmLcfx7ivk8aQ35uBFGhHSwafAr12/reZ8aDhcFwky3b22yKW0Jrrtb8vg71KFTcOyLMH qXCFTlX0XTJm1LA77uWVkKjy70oK3GtRqrNNGRM7CaM+PiW2MZtfTIcJt+tJwBzob1nS8AB fnPDN+3NjiPm+effv2iiq4FqHow0gvOvfmfdVTONJBZs69daNRzoOxqv3Jh27BXviT/beDW iSAD/hipnJ86xZLKcTw7xRwbz4E3TwQLxTN7YSh1QtWd6JJLFvZhuLB/jKrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1761921007; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=EDi3SQjVtRCFmtcNIgef/IYnmxZ/xey9DZoHf6J/Z20=; b=Tj9tana5vko2QrUKw89e0opL9xCyCiTL+cUoHlcRn2A16R3J2Hk8aOb84b4g249Ustxa2 QAkbqPBR29+XuaFyUo36p8KvjFMkB6s8YthvyS0fSvmxm4mr5NTNbMcXrC3O80P+7zVPrpA XDpoqEF1o9XXR6AV6Pc373rYhrKM+476zp/T96rl3Bk2oN9BUUPdBeDl8D3iDyCqNswWKni mW72jlTRDky53JrEVuhM1seKG29W5YfD1QPBSZzrTCDkN990yNmbHgssI5cOC8JXF0gE1Hx ke7EqrWk7DShRZ4FhBemBMW1QsbdHae9pz3dwPvHsNs3674pf6NHXkmjC4UA== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1761886085; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=jX8CNvjeoSajWa+1n1jTAGdKMcVXh895fbUuCaS0MbU=; b=Llmu1ddIINInR7/pKfNJpCjXbPjult3UYj4Y6ml65GQs1zGAXyv7LzMf2zpb75GQsgxw/ UjPlE91McI+1f/Bmvflbg6JzxIpMssD7E+Cqe3jitQc39IDIenyBtJp9qpEybDnXuOvOzeV rG/OyXGBJ80OE+bgFYfZtrqRrv77FzxvhUEvlkyBjwBApqeunFMXych33kAyyZV1Xz43bDi eCtYyaTGfgO+Jq8F/X4r2gMPb4ynUaTm2m6a6vIjvARRgxDim35Aa1Z3cxmpny7cD1tYVRu csV+ceBxdEd2w0zGl0+W8MI2ZLjppC5bbrh4nqE4osZJ0UoVxXLGA1TzjcmA== Received: from 02c22a36bd31 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id BEA8068F43E for ; Fri, 31 Oct 2025 06:48:05 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Fri, 31 Oct 2025 04:48:05 -0000 Message-ID: <176188608603.81.11142444074020450926@7d278768979e> X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: administrivia X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header Message-ID-Hash: 3XCC6KVXYHQGB5FIZ7GG6PMHYTQZVVGI X-Message-ID-Hash: 3XCC6KVXYHQGB5FIZ7GG6PMHYTQZVVGI X-Mailman-Approved-At: Fri, 31 Oct 2025 14:29:43 +0000 X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avformat/libopenmpt: add configurable interpolation options (PR #20800) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: paper via ffmpeg-devel Cc: paper Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20800 opened by paper URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20800 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20800.patch >>From 711fcb5f8a287727184664313451240686de178a Mon Sep 17 00:00:00 2001 From: Paper Date: Tue, 2 Sep 2025 10:47:06 -0400 Subject: [PATCH 1/2] avformat/libopenmpt: add configurable interpolation options This commit adds an interpolation setting to the AVOptions structure, allowing the user to choose which method they would like to use. For modules, this is fairly important. Most modules use lo-fi samples (read: 8khz 8-bit possibly adpcm) which can sound terrible when mixing using high quality interpolation algorithms. This becomes especially prevalent in chiptune compositions, where hi-fi interpolation completely changes the sound. Virtually any value is accepted by libopenmpt, but only [1,2,4,8] produce any tangible difference in output. All other values seemingly get routed to the default, which is equivalent to passing 8 (8-tap windowed sinc). Signed-off-by: Paper --- libavformat/libopenmpt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c index 46af4bff22..1721e59372 100644 --- a/libavformat/libopenmpt.c +++ b/libavformat/libopenmpt.c @@ -46,6 +46,7 @@ typedef struct OpenMPTContext { int sample_rate; AVChannelLayout ch_layout; int subsong; + int interp; } OpenMPTContext; #define OFFSET(x) offsetof(OpenMPTContext, x) @@ -57,6 +58,12 @@ static const AVOption options[] = { { "subsong", "set subsong", OFFSET(subsong), AV_OPT_TYPE_INT, { .i64 = -2 }, -2, INT_MAX, A | D, .unit = "subsong"}, { "all", "all", 0, AV_OPT_TYPE_CONST, { .i64 = -1}, 0, 0, A | D, .unit = "subsong" }, { "auto", "auto", 0, AV_OPT_TYPE_CONST, { .i64 = -2}, 0, 0, A | D, .unit = "subsong" }, + { "interpolation", "set interpolation method", OFFSET(interp), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A | D, .unit = "interpolation"}, + { "default", "default", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, A | D, .unit = "interpolation"}, + { "none", "none", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, A | D, .unit = "interpolation"}, + { "linear", "linear", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, A | D, .unit = "interpolation"}, + { "cubic", "cubic", 0, AV_OPT_TYPE_CONST, { .i64 = 4 }, 0, 0, A | D, .unit = "interpolation"}, + { "8-tap-sinc", "8-tap windowed sinc", 0, AV_OPT_TYPE_CONST, { .i64 = 8 }, 0, 0, A | D, .unit = "interpolation"}, { NULL } }; @@ -120,6 +127,14 @@ static int read_header_openmpt(AVFormatContext *s) return AVERROR_INVALIDDATA; #endif + ret = openmpt_module_set_render_param(openmpt->module, + OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH, + openmpt->interp); + if (!ret) { + av_log(s, AV_LOG_ERROR, "Invalid interpolation setting: %d\n", openmpt->interp); + return AVERROR(EINVAL); + } + if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) { av_log(s, AV_LOG_ERROR, "Invalid subsong index: %d\n", openmpt->subsong); return AVERROR(EINVAL); -- 2.49.1 >>From a6de836961f6813fa58f452161f876f52aa31cc5 Mon Sep 17 00:00:00 2001 From: Paper Date: Tue, 2 Sep 2025 12:37:43 -0400 Subject: [PATCH 2/2] avformat/libopenmpt: align AVOptions and remove unnecessary whitespace This is a purely cosmetic change. Signed-off-by: Paper --- libavformat/libopenmpt.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c index 1721e59372..d7c9d4a7d6 100644 --- a/libavformat/libopenmpt.c +++ b/libavformat/libopenmpt.c @@ -53,17 +53,17 @@ typedef struct OpenMPTContext { #define A AV_OPT_FLAG_AUDIO_PARAM #define D AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { - { "sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, { .i64 = 48000 }, 1000, INT_MAX, A | D }, - { "layout", "set channel layout", OFFSET(ch_layout), AV_OPT_TYPE_CHLAYOUT, { .str = "stereo" }, 0, 0, A | D }, - { "subsong", "set subsong", OFFSET(subsong), AV_OPT_TYPE_INT, { .i64 = -2 }, -2, INT_MAX, A | D, .unit = "subsong"}, - { "all", "all", 0, AV_OPT_TYPE_CONST, { .i64 = -1}, 0, 0, A | D, .unit = "subsong" }, - { "auto", "auto", 0, AV_OPT_TYPE_CONST, { .i64 = -2}, 0, 0, A | D, .unit = "subsong" }, - { "interpolation", "set interpolation method", OFFSET(interp), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A | D, .unit = "interpolation"}, - { "default", "default", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, A | D, .unit = "interpolation"}, - { "none", "none", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, A | D, .unit = "interpolation"}, - { "linear", "linear", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, A | D, .unit = "interpolation"}, - { "cubic", "cubic", 0, AV_OPT_TYPE_CONST, { .i64 = 4 }, 0, 0, A | D, .unit = "interpolation"}, - { "8-tap-sinc", "8-tap windowed sinc", 0, AV_OPT_TYPE_CONST, { .i64 = 8 }, 0, 0, A | D, .unit = "interpolation"}, + { "sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, { .i64 = 48000 }, 1000, INT_MAX, A | D }, + { "layout", "set channel layout", OFFSET(ch_layout), AV_OPT_TYPE_CHLAYOUT, { .str = "stereo" }, 0, 0, A | D }, + { "subsong", "set subsong", OFFSET(subsong), AV_OPT_TYPE_INT, { .i64 = -2 }, -2, INT_MAX, A | D, .unit = "subsong"}, + { "all", "all", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, A | D, .unit = "subsong" }, + { "auto", "auto", 0, AV_OPT_TYPE_CONST, { .i64 = -2 }, 0, 0, A | D, .unit = "subsong" }, + { "interpolation", "set interpolation method", OFFSET(interp), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, A | D, .unit = "interpolation"}, + { "default", "default", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, A | D, .unit = "interpolation"}, + { "none", "none", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, A | D, .unit = "interpolation"}, + { "linear", "linear", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, A | D, .unit = "interpolation"}, + { "cubic", "cubic", 0, AV_OPT_TYPE_CONST, { .i64 = 4 }, 0, 0, A | D, .unit = "interpolation"}, + { "8-tap-sinc", "8-tap windowed sinc", 0, AV_OPT_TYPE_CONST, { .i64 = 8 }, 0, 0, A | D, .unit = "interpolation"}, { NULL } }; -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org