From patchwork Fri Oct 21 03:55:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Degawa X-Patchwork-Id: 38862 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp528543pzb; Thu, 20 Oct 2022 20:56:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PSwylqBM6E2svEelnDJ3H4clu9NEY+Z86J6mfsVApPJHFxHborJ6OIb8Hnt+6a2VWx4Nq X-Received: by 2002:a17:907:8690:b0:791:9f83:6872 with SMTP id qa16-20020a170907869000b007919f836872mr12462071ejc.386.1666324564390; Thu, 20 Oct 2022 20:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666324564; cv=none; d=google.com; s=arc-20160816; b=llNcibK/RB80KbNYHb8yUXzXJxfgLfwyz4KTOsvQiYjN2d7VFd7kW8bG/1LbqJxwRK 4X6jkgZxNRdu2eVWeW2GIKmTAXgkXrHN9zALcJwluc425rYYL3OxqJZAmdVvcuBbOhzw 8wy/eyEXGxGKoLq7n50yArMXgi2suWvDP+onMimHcSscWR2tShJKQJaL2kdmXi6iTPHa y0GUdS3MZAKil6Ks/Y2T2LdaoPYPF2asQ1O2dHFp3jBghKMihna4ol1FjpX70Nt5iRbx OxzapsiFjHb6IWwywCYF8mD3xXKx1+ngeY1D8gAGiQqMxF5uvAo5QtOmBcc6WEyEDeYf 9V1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=OF7WquWrxj3pmFSEkHIc1wx8vJDHUVMXMdUWr2lA+tY=; b=aI7iPt8svEjTnGUc3bYLi2SYSEyT3CAX8ANwHGYmOKA0yr0D2tNAEoFlvQ3WQ3Qka/ FojSJZmRMP3pKQreaVJbOmX69M/fmp/1nFvaVbM9kTNq9Ky4VZ4Q1B+V1t0BKZvaMygj DRhIAPRnzMLjEgXW4WNrNbfMIPuem06W90qg3b1Esz1HAHHM0KY7pG48qPelOQ+W++hJ GMZd72nr9dknyYlMWaK4OEDkKqZJwBf76cqqvF70uAalQ0OJR4uhKuwyWWaqHfQRY4wn dU6u711l5SKcJQbmlgVwGKCOCI5wu1N6scMVI1iDtKmf6Wz/wCVT+xviYkoJEW6osoA/ PBLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@randomderp.com header.s=default header.b="Ja/NB/14"; 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=NONE dis=NONE) header.from=randomderp.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b25-20020aa7dc19000000b0045ccd2c9944si15587562edu.233.2022.10.20.20.56.04; Thu, 20 Oct 2022 20:56:04 -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=@randomderp.com header.s=default header.b="Ja/NB/14"; 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=NONE dis=NONE) header.from=randomderp.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5CFB768BE44; Fri, 21 Oct 2022 06:55:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from degawa.com (174-127-109-95.slc.westdc.net [174.127.109.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60F1068BE0D for ; Fri, 21 Oct 2022 06:55:45 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomderp.com; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=K1uDCJkCk8XRvo/cKxFb5FChudYoynZuVJJOR2xAP8I=; b=Ja/NB/143akAgbj0cT6/tPIw72 Lu0LjTaul5r0FgCQ/PehZiGqh/kxaUb24puTrW73bI1k007T0f7FDGfieddhKyf+I+9DSxGY2TCPa MrKE4MCqwP/TPCjsnszaa4+s3tcZn2578rfA8uFFcSMeOVi3utAkxLzeNz6PrycsW/TUlwA8wxBAB qtUP2K2Qlz9ZNmFf19YkHLmECUzHzmnjl7TMrAl5QOlJh7Sl1VrxYzmNusE1hnEqzvlU3BXZzz7Au 6MeTT8zDRCqZheeg5SrmkcDx3S6VrIzdB20QHhxx11IgVui0I+/jx99YY30dBzkENU2VvZ7uz/Bze fyoaObrA==; Received: from 108-216-168-194.lightspeed.mmphtn.sbcglobal.net ([108.216.168.194]:45254 helo=localhost.localdomain) by slmp-550-1.slc.westdc.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1olj8M-0000Ez-2M; Thu, 20 Oct 2022 21:55:43 -0600 From: Christopher Degawa To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Oct 2022 22:55:28 -0500 Message-Id: <20221021035528.413664-2-ccom@randomderp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221021035528.413664-1-ccom@randomderp.com> References: <20221019224712.194658-2-ccom@randomderp.com> <20221021035528.413664-1-ccom@randomderp.com> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - slmp-550-1.slc.westdc.net X-AntiAbuse: Original Domain - ffmpeg.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - randomderp.com X-Get-Message-Sender-Via: slmp-550-1.slc.westdc.net: authenticated_id: ccom/from_h X-Authenticated-Sender: slmp-550-1.slc.westdc.net: ccom@randomderp.com X-Source: X-Source-Args: X-Source-Dir: Subject: [FFmpeg-devel] [PATCH v2 2/2] avcodec/libsvtav1: replace vbv_bufsize with maximum_buffer_size_ms 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 Cc: Christopher Degawa Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1uWNTdUo0KHM From: Christopher Degawa svt-av1 v1.2.0 has deprecated vbv_bufsize in favor of using - maximum_buffer_size_ms (--buf-sz) - starting_buffer_level_ms (--buf-initial-sz) - optimal_buffer_level_ms (--buf-optimal-sz) and vbv_bufsize has not been in use since svt-av1 v0.8.6 Signed-off-by: Christopher Degawa --- libavcodec/libsvtav1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 28da206cf8..48cd58a0b3 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -179,7 +179,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, param->min_qp_allowed = avctx->qmin; } param->max_bit_rate = avctx->rc_max_rate; - param->vbv_bufsize = avctx->rc_buffer_size; + param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate; if (svt_enc->crf > 0) { param->qp = svt_enc->crf; @@ -296,7 +296,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, avctx->bit_rate = param->rate_control_mode > 0 ? param->target_bit_rate : 0; avctx->rc_max_rate = param->max_bit_rate; - avctx->rc_buffer_size = param->vbv_bufsize; + avctx->rc_buffer_size = param->maximum_buffer_size_ms * avctx->bit_rate / 1000LL; if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) { AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx);