From patchwork Tue Feb 9 18:58:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Degawa X-Patchwork-Id: 25525 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 91B09447BBD for ; Tue, 9 Feb 2021 21:00:29 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6188268A181; Tue, 9 Feb 2021 21:00:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from degawa.com (unknown [174.127.109.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B8E86881E8 for ; Tue, 9 Feb 2021 21:00:23 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomderp.com; s=default; h=Content-Transfer-Encoding:MIME-Version: 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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Z1YMfX3J/poOx3sfs7h6ee/FSMmua+l+HivB9JoFlnI=; b=yD35aF4qFci81thoqpz34KvojL pyAo3Uckki7hgQc9ZMuD0sP/3uM/CMNFbwh2skFA6EFA7/4TszQhXKjHttr8ZJVNvx+lw88HeQAPR hFLKJJt3esXkF0yMF/um69ZcaSsP02HtAJ5z5VqJLT/qIuA+wLqmqMSYNaepQwPY9ZAhKdJdNmcaO JSa8P3EBOOCbzpe61CSW+uUSNwh+HncPVxNqeiSLc8JYbDbe0HzRh1LWzgOKOmGPK3PVBBpLtfouE j+fd6VMCMmx3gShJsHzBX4b+P5OIYyFM0xB9k6j3kP8lKv6n6J+6/yn0cAW0gI8llx8bk+QdkHIho vaHtbdqg==; Received: from 108-216-168-194.lightspeed.mmphtn.sbcglobal.net ([108.216.168.194]:48906 helo=localhost.localdomain) by slmp-550-1.slc.westdc.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1l9YFJ-0004AH-6t; Tue, 09 Feb 2021 12:00:21 -0700 From: Christopher Degawa To: ffmpeg-devel@ffmpeg.org Date: Tue, 9 Feb 2021 12:58:16 -0600 Message-Id: <20210209185816.3230510-1-ccom@randomderp.com> X-Mailer: git-send-email 2.25.1 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] libsvtav1: Add lp option 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: Christopher Degawa Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Christopher Degawa Equivalent to the --lp option for SvtAv1EncApp, and is the only way to control how much cpu power svt-av1 uses for now Not using thread_count as it would be preferable to reserve that until svt-av1 properly implements a threads option 0 == getconf _NPROCESSORS_ONLN Signed-off-by: Christopher Degawa --- libavcodec/libsvtav1.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index eb6043bcac..260acc3d78 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -71,6 +71,8 @@ typedef struct SvtContext { int tile_columns; int tile_rows; + + unsigned logical_processors; } SvtContext; static const struct { @@ -218,6 +220,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, param->tile_columns = svt_enc->tile_columns; param->tile_rows = svt_enc->tile_rows; + param->logical_processors = svt_enc->logical_processors; + return 0; } @@ -533,6 +537,9 @@ static const AVOption options[] = { { "tile_columns", "Log2 of number of tile columns to use", OFFSET(tile_columns), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, VE}, { "tile_rows", "Log2 of number of tile rows to use", OFFSET(tile_rows), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 6, VE}, + { "lp", "Number of logical processors to run the encoder on, threads are managed by the OS scheduler", OFFSET(logical_processors), + AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, + {NULL}, };