From patchwork Mon May 9 18:47:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 35708 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a885:b0:7f:4be2:bd17 with SMTP id ca5csp3049081pzb; Mon, 9 May 2022 11:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+FkjFd5WWhkvJtwOm5RsDq24Iwn2Etor0c7DHlT4SOQUz6g3B/TcVVdaC+GiTzmoJM2mP X-Received: by 2002:a17:906:d54b:b0:6f4:d14b:bb91 with SMTP id cr11-20020a170906d54b00b006f4d14bbb91mr15572430ejc.314.1652122065666; Mon, 09 May 2022 11:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652122065; cv=none; d=google.com; s=arc-20160816; b=xoNmJlg0DhKQWxpS2jgDXOPM45HZXqFL506R/YQ/crJfHd8rTTj1xsnKqkAf4X081f SkW1c1Q0KqKoYI/1mh+3RFo8gduyRmsRFup6j9mQXJOtajQZfk385JZSTvilX+2fISbC CTZAkq3lHeFi8tGTtA1GFEEJY5okvsKEBKvxIKK+tw/ppLr3ryxSJWLWcnL0bsLFBpia /Hwj+OUny/9HYZMlRfgEC6ZqD+blxgBUmEbalzCALCKGU706pbXlDNjFlcQwFt75aCMi tuC+aKNb9CiXHRU447EMIm3BUcEOx5Sfb1NCWD5qgun9mi/w7elcmFkchhe/ScXfLZCB op7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=ZtBPNlFOYAEKjeNgkJ2TkrbhaIcK0M7/VwVG9xOidm0=; b=m+KJfGuX+QwTzey5wO7VqsvxlTb52mbjTPeLaAW6RWcRZ/sZna0mIzxVKJjB2WeUCx FqeYA4Vzk67tp21PaIa/C2S8V3MLdLvkPCdVGn1cZgNCrZIucpBP0984bW6m50c9u9s1 6Q5dkfOxbcCTLgK7iL6eelO/e4QUqmi+bh6s5+j4leuBBJymgSpzH7ohwCbTEJZ1ugcS sLTncQJKRnaTwMskIjLz/jvUxuMpizbKNLJJO6SSAlCYMY2aT+0C50Kah6hQDQ9SPEGi 0MNCY88hjRoqjeEBRy0eX41QdFALWKgUB0fPJyK8rDwYDRnVOxoeyJLW+UmSe81KBsxN Fsfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=RZgicREf; 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 3-20020a508e03000000b00427cfacfd62si12400169edw.142.2022.05.09.11.47.44; Mon, 09 May 2022 11:47:45 -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=20210112 header.b=RZgicREf; 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 543CF68B33C; Mon, 9 May 2022 21:47:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 864E668AC70 for ; Mon, 9 May 2022 21:47:35 +0300 (EEST) Received: by mail-lf1-f46.google.com with SMTP id w19so25384260lfu.11 for ; Mon, 09 May 2022 11:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=XHY3FzDFc8py62vBgrHW4WCPxWdmPJ7Y9oTjq5uOiSY=; b=RZgicREfKlDBhpeNlBVW0xTqw6nqty1SvJY7jv+5ajRWo5qUSO6mIrmvx2oSQ3t4O6 7y6ZkADusSvkqtmfuFplfZT4As0n3yRWiyWeP+sMbJtwMA1hnpelNpPHpmfKQzJUu5cc PKy1GNS218/Um+XQCIQoOljQb0vsQHupACk0tIQvhSm8s+WoCg4GyBA/x9jrrxR5kkRa Z+1pdCpVUIHTOI2MJfvNCpc5TaUBVrnvjXWrp/odDsTuC8w1Mp3XqvyaA6HxVWHHZAPu sqbith4xoA72O5PRQ2AVMKUZFNFGGBlMr3PqxwMzx75u9EmZUNvtpWXPNvHqxTweUy21 +0gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=XHY3FzDFc8py62vBgrHW4WCPxWdmPJ7Y9oTjq5uOiSY=; b=5gYRJIr1DjZFnL4JT3pIwN5+yyOBJHFINX7keE5Ih7JrWRR8a7Jh8WbPP+RHzgeBtE W1ReDhcuhe3it3y3y+StgeB0ghY+zyvGYQw/sn25ShzggRBozR3lHz7kzdWLtSqSyMXF jFPxPICkdlUh7qoQn/lfvuCcol4eCqWwuiOfJah/R0tKTXStTRnq1Vy0avN+D//yDFTu pxtUKrMVNarqeDLyljuUBkIJ88r16hsRtiLLeUKuuxZ5HSOC+Kf2JzjzJXcJkyJiCqHu td/H51TqeCYd5Wj2qVzADc9InE0mGy0ljtdrXXQyJ2yyny1WkYdBCKetpPo2khJyTUHh FeCw== X-Gm-Message-State: AOAM530TYNmJv+U1DgqPFM7jlX+NqljIB61D/deJr9d6KmiQFn9kqoOX uRbM7hclIlloMF8pFknRAZcKWLCuTE0= X-Received: by 2002:a05:6512:3f07:b0:464:f20b:a160 with SMTP id y7-20020a0565123f0700b00464f20ba160mr13721204lfa.653.1652122054806; Mon, 09 May 2022 11:47:34 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id 22-20020a05651c009600b0024f3d1dae99sm1893630ljq.33.2022.05.09.11.47.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 11:47:34 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 9 May 2022 21:47:27 +0300 Message-Id: <20220509184728.10265-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 1/2] avcodec/libsvtav1: update avctx bit rate according to RC mode 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: W2ro+gkJ/ZG6 This way we can filter out the default value for this member, which is nonzero. Bases on the current affairs that bit rate based rate control is nonzero in SVT-AV1. --- libavcodec/libsvtav1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index b4112004ad..2c4ddd4641 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -297,7 +297,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, param->profile = FF_PROFILE_AV1_HIGH; } - avctx->bit_rate = param->target_bit_rate; + avctx->bit_rate = param->rate_control_mode > 0 ? + param->target_bit_rate : 0; return 0; }