From patchwork Thu Nov 28 00:25:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Foucu X-Patchwork-Id: 16462 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 8492B449DCB for ; Thu, 28 Nov 2019 02:25:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6DC3968B143; Thu, 28 Nov 2019 02:25:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 49605689C3D for ; Thu, 28 Nov 2019 02:25:42 +0200 (EET) Received: by mail-pj1-f45.google.com with SMTP id w8so10951555pjh.11 for ; Wed, 27 Nov 2019 16:25:42 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=81DDKUclgRpLYZf+cGZEz9wtCnZKC3CX8V1g8sWSxvw=; b=Tzzlb3vWCwSWVLndPA8eVgsX2DH3FaND+NM2vnsdHdQt3NhNen9cekw9eF7cjBDFTl AagU1T8YqklfzMiNetXrD7xFHOghavyDruoPp6mR8j4Koh8uf0aUH7laiqsXhGqYPWVW StO+jTdlOk3SZ1kuyIcXZIAtT06Sjk8r71iIcYYAlkdGh6qA9nlmAoMppOLlay+ZQ69i n4IkCq0q4hBqGKAxk5WBD2f1DOYBb3YPyVJoZBLPkVz+hFwL4OrByLsmiMZSoNaUTk2l Rbgdsn4jjvsfYLFP/XzvPTIE1RFKVkpwtIONzev6ociDgMbUVyDcqcboKOR6fJtIvLYA g6EA== 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:mime-version:content-transfer-encoding; bh=81DDKUclgRpLYZf+cGZEz9wtCnZKC3CX8V1g8sWSxvw=; b=rImv+hJ4n9JmqJHvpEp8YUXm9Ftb28EzausOECupcQ2Ea5nmHwEcOfcBygMMjF3sKU ZSixowR9okgi431XkC27CcbIcBlzW8Tx0AfoOzefFhr66vqhJH1UNBi4qwh2TrHeiTn7 /5/BW4MbRYgPp0prrAKkr4tbw6TVIoItQz2BmwcOgC5TFN6a3PcMeXEqcIzFUPF/pEmZ n/2Ocvo80ONI181frCZjI8Z0SEmRA1HNnqIHda6eXIdmEcHPAjTGHz3JW4SyHSaH1kUC pcG7Z02S1zXRzP0Tcszhh0bpAaAOWFLkCRdNtWLo2cZTzGUjsLJubG525L/Bw9PeNEWi Jf/Q== X-Gm-Message-State: APjAAAVh9wCEVk3SXWucyKz34mv2QOEiRIqh+j8ZQWWNQVMxF2bVgtfI da/kpTuvEax+XSsB34gQMymRw34K X-Google-Smtp-Source: APXvYqwQoeLHLQUlWmzMR6NY5dI66bD/UIaOkirio5uUnhbgKybeNNz/UV1BM1jK0j8B/SQb7tyCdg== X-Received: by 2002:a17:90a:3463:: with SMTP id o90mr9335126pjb.4.1574900739924; Wed, 27 Nov 2019 16:25:39 -0800 (PST) Received: from tfoucu.mtv.corp.google.com ([2620:0:1000:4001:8e18:4d51:fb1:d54f]) by smtp.gmail.com with ESMTPSA id v189sm18489558pfv.133.2019.11.27.16.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 16:25:39 -0800 (PST) From: Thierry Foucu To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Nov 2019 16:25:33 -0800 Message-Id: <20191128002533.98593-1-tfoucu@gmail.com> X-Mailer: git-send-email 2.24.0.393.g34dc348eaf-goog In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] [libdav1d.c]: Add options for spatial layers. 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: Thierry Foucu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Disable by default to output all the layers, to match libaomdec wrapper. Add option to select the operating point for the spatial layers. Update the documentation with the new options. --- doc/decoders.texi | 6 ++++++ libavcodec/libdav1d.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/doc/decoders.texi b/doc/decoders.texi index 676e062e72..234890e968 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -71,6 +71,12 @@ Set amount of tile threads to use during decoding. The default value is 0 (autod Apply film grain to the decoded video if present in the bitstream. Defaults to the internal default of the library. +@item oppoint +Select an operating point of a scalable AV1 bitstream (0 - 31) + +@item alllayers +Output all spatial layers of a scalable AV1 bitstream. The default value is false. + @end table @section libdavs2 diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index cf4b178f1d..ea4ef641bf 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -40,6 +40,8 @@ typedef struct Libdav1dContext { int tile_threads; int frame_threads; int apply_grain; + int operating_point; + int all_layers; } Libdav1dContext; static const enum AVPixelFormat pix_fmt[][3] = { @@ -134,6 +136,10 @@ static av_cold int libdav1d_init(AVCodecContext *c) if (dav1d->apply_grain >= 0) s.apply_grain = dav1d->apply_grain; + s.all_layers = dav1d->all_layers; + if (dav1d->operating_point >= 0) + s.operating_point = dav1d->operating_point; + s.n_tile_threads = dav1d->tile_threads ? dav1d->tile_threads : FFMIN(floor(sqrt(threads)), DAV1D_MAX_TILE_THREADS); @@ -378,6 +384,8 @@ static const AVOption libdav1d_options[] = { { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD }, { "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD }, { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD }, + { "oppoint", "Select an operating point of the scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, 0, 31, VD }, + { "alllayers", "Output all spatial layers", OFFSET(all_layers), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD }, { NULL } };