From patchwork Thu Jul 30 22:21:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 21393 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 B828444AC18 for ; Fri, 31 Jul 2020 01:21:44 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 93BE968B643; Fri, 31 Jul 2020 01:21:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D6B1068B5DF for ; Fri, 31 Jul 2020 01:21:38 +0300 (EEST) Received: by mail-wm1-f49.google.com with SMTP id q76so6360080wme.4 for ; Thu, 30 Jul 2020 15:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=IB7qmQmwic7mNOdzfmTVQxZsU/DQNgoYmeqh7NVr5Oc=; b=OmOsoxcg0lDK+n1e3RAi9YmZdObbsDGI6q/8j4ZpC4PGmG5G1JQf5BUo4fvTTF5TKH Wz5URYCcebq7uxomeRSkstx1laoqDTcQj14zUNJQoVTUlhbPWH29XeJnReeYbPo4BfA3 RiReiWVd3kaWgLWs7BkkmOr9aCu7q3hGAZa4OkULWvw9Q2odAz1BlFKkVGwRsZkVR5eN GvpcomEVxs9r4VaL2DMwjlfaH1Q/fKucfLZ+RB7LWCvbKGLY3ngtfOTUP2SmzyfeKJNP gvv/jAf/k/mik1WIeDDl5hN4xhFZJmhseCNnoCErpfIu5g+uFLAJLGALYlWZ+VpelQZE 8oHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=IB7qmQmwic7mNOdzfmTVQxZsU/DQNgoYmeqh7NVr5Oc=; b=FPlkrYSnNTiRcmZuwqCaxIkFNojbiRheslHDZL6jMUZYlmhV0FJHcOVy5dDuohcy3b nyit4O79CTKF9sZ8Qri4/Qez7ts3HmPZ7Vl3boaaP5NXkz9brmy0d2h7xpX6t/R2ly23 /oLI67pzPI4j77c3r8nUjIGChl9Pdyadg9DXKSiNufOdM53Dus1rlm3/RiToveBcOW5w En0pkcNaNeTOWxOqnAkK50tCnC8IbH7zKhPKtUFUvkg1LOgeTti04DobEax77c5qPlJp nsE7qgtGlaynUxzTPuc9vj34vm9Wm3LwDVZ5Xdvqh4Or/VIu1KbJM8UqBbeidvpKPrcH xXyw== X-Gm-Message-State: AOAM533LcJWzdLA0EaiF31658tBWhpI2BIX9e9IbfCwY6qG7PnxA+sFj uJaZH5xMm1fqKuW0NiLUm89dfxj0YvQ= X-Google-Smtp-Source: ABdhPJz1qXh/X7OlfwQqCORx5jIMd2xwEZVghluQ3ZaJ8Il891l9Say8+3TS/3SVvfb0HnSWpKyi3Q== X-Received: by 2002:a7b:c5d8:: with SMTP id n24mr1098015wmk.153.1596147697658; Thu, 30 Jul 2020 15:21:37 -0700 (PDT) Received: from [192.168.0.3] (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id u1sm12745407wrb.78.2020.07.30.15.21.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2020 15:21:37 -0700 (PDT) From: Mark Thompson To: FFmpeg development discussions and patches Message-ID: <3dc92fb2-babd-3296-ad82-29766c926caf@jkqxz.net> Date: Thu, 30 Jul 2020 23:21:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH] librav1e: Make tile options consistent with other encoders 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" In all other AV1 encoders these are set as log2 of the number of tile columns/rows to use. This does change not the accessible configuration, since librav1e already requires these numbers to be powers of two. --- Possibly this is too late to be acceptable without additional messing around, but I'm not sure how many users of these options there would be anyway. (Or, for that matter, if anyone using it would notice that it doesn't do the same thing as libaom-av1.) doc/encoders.texi | 4 ++-- libavcodec/librav1e.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index af7d2ba983..8d33ac3369 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1397,10 +1397,10 @@ Selects the speed preset (0-10) to encode with. Selects how many tiles to encode with. @item tile-rows -Selects how many rows of tiles to encode with. +Sets log2 of how many rows of tiles to encode with. @item tile-columns -Selects how many columns of tiles to encode with. +Sets log2 of how many columns of tiles to encode with. @item rav1e-params Set rav1e options using a list of @var{key}=@var{value} pairs separated diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c index e9b82a724a..c455fd882e 100644 --- a/libavcodec/librav1e.c +++ b/libavcodec/librav1e.c @@ -319,7 +319,7 @@ static av_cold int librav1e_encode_init(AVCodecContext *avctx) } } if (ctx->tile_rows > 0) { - rret = rav1e_config_parse_int(cfg, "tile_rows", ctx->tile_rows); + rret = rav1e_config_parse_int(cfg, "tile_rows", 1 << ctx->tile_rows); if (rret < 0) { av_log(avctx, AV_LOG_ERROR, "Could not set number of tile rows to encode with.\n"); ret = AVERROR_EXTERNAL; @@ -327,7 +327,7 @@ static av_cold int librav1e_encode_init(AVCodecContext *avctx) } } if (ctx->tile_cols > 0) { - rret = rav1e_config_parse_int(cfg, "tile_cols", ctx->tile_cols); + rret = rav1e_config_parse_int(cfg, "tile_cols", 1 << ctx->tile_cols); if (rret < 0) { av_log(avctx, AV_LOG_ERROR, "Could not set number of tile cols to encode with.\n"); ret = AVERROR_EXTERNAL; @@ -564,8 +564,8 @@ static const AVOption options[] = { { "qp", "use constant quantizer mode", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE }, { "speed", "what speed preset to use", OFFSET(speed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 10, VE }, { "tiles", "number of tiles encode with", OFFSET(tiles), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE }, - { "tile-rows", "number of tiles rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE }, - { "tile-columns", "number of tiles columns to encode with", OFFSET(tile_cols), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE }, + { "tile-rows", "log2 of number of tiles rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE }, + { "tile-columns", "log2 of number of tiles columns to encode with", OFFSET(tile_cols), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE }, { "rav1e-params", "set the rav1e configuration using a :-separated list of key=value parameters", OFFSET(rav1e_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, { NULL } };