From patchwork Fri Jun 8 02:15:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Koshevoy X-Patchwork-Id: 9320 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp301311jad; Thu, 7 Jun 2018 19:16:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLsMBv18zaoGOG9SZS6K2V3DqBz5I4dD19nD+b/8QTdzkABivhxPJfUQgeUkIybtUdHcI+Y X-Received: by 2002:adf:8e89:: with SMTP id q9-v6mr3430374wrb.269.1528424172174; Thu, 07 Jun 2018 19:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528424172; cv=none; d=google.com; s=arc-20160816; b=BRf64Holz0ZdMPgQ5oTX5FlCuc8UvIu9W2dxB3lC66NhKUkNnk6oE1BgDxEs4DkPH6 N/hMJG3Vc+Gv9z/8yi6UDz9j+AbD6sM8v5Nsczk6Y4jly0JA1QOEmo37ktHLv6p8EEX1 KKRD7BpO1STX1uRkvAzkHHGxpZTKl0lax5ByCEb3UhhW2RS5U9OnMRIVyU3MdVNUxL0l Vkqf5IOIfpjG5JH3lsTT1i7HbLBal1Wz/3MpkDz2pHz5lIvYNxsXssCsnNe+VUY2EVXt qBXLd5Gp8C9wmIwukMjD0Yu5ftAY4MbtNn5Utsj4MESEbzag7ieuL4l1E4svQKCUradc T6xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=ctg+zVGuWh+hPN0qz8WVXcLpFxkneZSvv5fps+DvhKc=; b=jUoJx9QoNTOKPHUVKVk6pJJexNiZMDweUVON477Fs6BhAdogOYuXF9gfqeRb0sVjLV VWYW8waJw9pfarAfhhdQ+LPmyLQy2UGejSUf7Xw+/U0vpL+Umjr81dOOHodZcaaHVFtN j3L4ZEnKrNqIYWWSDDflwPVJkyb6Os5a+ky1ipQYhSsRkPZcXZFFUVmdRKvw31stfN0u O617sQ73+TJWV1KFR27/fkaLtQe93kILHhaw9sxFXsP7bGit5Hn7yeeVdPEXsrRUcfSw WzyPIhj033NLVV4QgYsRK9/U0oAK1MDebW60AER/xSzEjowTrVjX40/B6OacFQOQYrgl 9fww== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rNMxgDMG; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 204-v6si232381wmw.56.2018.06.07.19.16.11; Thu, 07 Jun 2018 19:16:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rNMxgDMG; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BFF7A68A678; Fri, 8 Jun 2018 05:15:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f46.google.com (mail-pg0-f46.google.com [74.125.83.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 860F1689C3E for ; Fri, 8 Jun 2018 05:15:15 +0300 (EEST) Received: by mail-pg0-f46.google.com with SMTP id d2-v6so5629476pga.13 for ; Thu, 07 Jun 2018 19:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C9Q/XHk/Tm3TC4FbCYTSWwmcMAl/eZ1VQ6S9tRI2h78=; b=rNMxgDMGCMkD0Jvwroh+TvhNB69Tkn7HGzMFXT1D560rib+AwB0Wf5RDertuMRLD3e A2y85fqd8dY7RE4hDFTmDHa+Vg4qq3bVUXejIjnszfKGP4UxPzP5xmpMfY5sRK4Bohly YaAjq2c7bg5zkUKLE+9yUDG5PvRO+l8lYRsMRriSCeAYbg9fdsUBnJwPHN28nfAnfE4f bh3uDG/w0X2X67sLLLTFTmMUC3PO8TZx1U0zNxjsa01fgarkuZZJWsKMZ7GWxPmm4Yl6 fwf4KxtU/Wk/oYFQJtThCPBx0eTkDbwinQ2dGqJwWHpkaBcOPUiGI2gzdaZ/T0H/YxEy UhcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C9Q/XHk/Tm3TC4FbCYTSWwmcMAl/eZ1VQ6S9tRI2h78=; b=qtV7maKPccVVv3JvlbPVrx6ZCEuoXhi/Atz3o3y79nuNS3MHsDr6eV+vvOgjlQzDEj ji1Msy0FPvNNC30Xc/OuBbE8BWWXuAX6ajgJjkOoKYF/Px6+GMSnJfLZTMyO1VPtwzEc JYdz688eyefQXT5xwOwBB1k4NVkhRAiVdlfMAlMOakOSO/HSUiasjawwmCQobgHrxzS0 iEcsNqJavz7evsAGhJkQzALeLaOFytlO2rYV1cslSfKqEea4bDDEEuI13noC9E0mUsf9 vJ0G+SmWshfF6f6g359RAWREvO03Xnyoh7DGu7fu5eoTWCCtBkNXTtTdeRFugX473eHR mffw== X-Gm-Message-State: APt69E0ylV1l7+mUg9HFxugSbtax5Ai6W1PiXIaKZOj0smLak1q607Lt cKP2UMpvwj49EWkGypPykij0CA== X-Received: by 2002:a63:aa4c:: with SMTP id x12-v6mr3432165pgo.387.1528424160890; Thu, 07 Jun 2018 19:16:00 -0700 (PDT) Received: from homestead.aragog.com ([2605:a601:31e0:603:12c3:7bff:fe6c:2700]) by smtp.gmail.com with ESMTPSA id h84-v6sm60375510pfd.69.2018.06.07.19.15.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 19:16:00 -0700 (PDT) From: Pavel Koshevoy To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Jun 2018 20:15:58 -0600 Message-Id: <20180608021558.23862-1-pkoshevoy@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180607214003.GC24912@sunshine.barsnick.net> References: <20180607214003.GC24912@sunshine.barsnick.net> Subject: [FFmpeg-devel] [PATCH] lavfi/atempo: raise max tempo limit (v2) X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Pavel Koshevoy MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- doc/filters.texi | 17 ++++++++++++++--- libavfilter/af_atempo.c | 6 +++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 256ab42b00..6b98b04774 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -1986,7 +1986,12 @@ Adjust audio tempo. The filter accepts exactly one parameter, the audio tempo. If not specified then the filter will assume nominal 1.0 tempo. Tempo must -be in the [0.5, 2.0] range. +be in the [0.5, 100.0] range. + +Note that tempo greater than 2 will skip some samples rather than +blend them in. If for any reason this is a concern it is always +possible to daisy-chain several instances of atempo to achieve the +desired product tempo. @subsection Examples @@ -1998,9 +2003,15 @@ atempo=0.8 @end example @item -To speed up audio to 125% tempo: +To speed up audio to 300% tempo: +@example +atempo=3 +@end example + +@item +To speed up audio to 300% tempo by daisy-chaining two atempo instances: @example -atempo=1.25 +atempo=sqrt(3),atempo=sqrt(3) @end example @end itemize diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c index 8b214bccd7..52f15f2769 100644 --- a/libavfilter/af_atempo.c +++ b/libavfilter/af_atempo.c @@ -153,7 +153,7 @@ typedef struct ATempoContext { static const AVOption atempo_options[] = { { "tempo", "set tempo scale factor", - OFFSET(tempo), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, 0.5, 2.0, + OFFSET(tempo), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, 0.5, 100.0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM }, { NULL } }; @@ -439,8 +439,8 @@ static int yae_load_data(ATempoContext *atempo, return 0; } - // samples are not expected to be skipped: - av_assert0(read_size <= atempo->ring); + // samples are not expected to be skipped, unless tempo is greater than 2: + av_assert0(read_size <= atempo->ring || atempo->tempo > 2.0); while (atempo->position[0] < stop_here && src < src_end) { int src_samples = (src_end - src) / atempo->stride;