From patchwork Wed Nov 27 17:21:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Foucu X-Patchwork-Id: 16461 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 D40EC448E69 for ; Wed, 27 Nov 2019 19:21:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AAB9068B0AE; Wed, 27 Nov 2019 19:21:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D523368AF7E for ; Wed, 27 Nov 2019 19:21:34 +0200 (EET) Received: by mail-pf1-f178.google.com with SMTP id 193so11322415pfc.13 for ; Wed, 27 Nov 2019 09:21:34 -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=vp14VTEKjvsslhTBaZBSuBFBXjjPqw4Wf3ik/v1JSYY=; b=Ch6EZP1DXv7dVhueuKWUwzkFrE/kga71jK/L3Qo5S/dfdx3KtL2cT7OtPOv1bJ0X52 kXEd43rrdwW/vWN9HFozZro2ofrcLfhqsYTzme7wNgD6A9ca3BwYF/M8ah0pCtPLf7Kc eJktevsweMR7ZOApYA34fdCc33UZRmXHoetdmS0EMnYl+tLA9ADGghuO5AIDADKuNaBA idJ2SRJhjSCIcXFEvrSC1k2D5b1Js4CPxudeYLpeEywxNWbDv5O5SjNltnJczICCoBUB D6HmSNlwiN+U6bdVoBS4841YVq2Umx9ijznf/MUy8zmo/CIz2yjHEY8B29a0VJ4je0ie F/rQ== 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=vp14VTEKjvsslhTBaZBSuBFBXjjPqw4Wf3ik/v1JSYY=; b=UFZnbdNBwD7BHMnDD+Y8uwSha9bdA2NAmrPhzSjcDWSAkkBgZH/Jkyw1c0sxT4ALG7 zhc+Iv966muX0TE2lMSasvh/s4bhVCmonQg+7uWcxxMvQ4Px+DniMA5Vavw99Jjgq+hc 0qYSgzte6NSLjcHzBqvEWcOJ1iwDDQZ2AClhzvMIIYmu9/FdbtgGm/RteViztMxxw+TT zMFeeEtymZnR2suvD5jEaSPdKpgdWZgLsqi4S+5phO0U+v7oGn2+MiCWx5bioyD7Iv09 bPEtiByW+3mhit43VgPvEW5zFIusbNXu6KU6t66OGA1hKf2tCL4J63SxT9Ngt53p6Ma6 JT0w== X-Gm-Message-State: APjAAAXj2/1TDSXC6V2yNapoEgtUe9kE9D/ErErskL/qp5fI+ERXNkNe 8GFla/TFQdeeVmusxXeSF1JmcLh/ X-Google-Smtp-Source: APXvYqy6MR0c9f3lWdphBT/49el3CsKjgB7xyBTGeoVEvUlsQwP/02T9IN2F4vfYjj9KoDlBk+71Jw== X-Received: by 2002:a62:cecd:: with SMTP id y196mr9467051pfg.206.1574875292600; Wed, 27 Nov 2019 09:21:32 -0800 (PST) Received: from tfoucu.mtv.corp.google.com ([2620:0:1000:4001:8e18:4d51:fb1:d54f]) by smtp.gmail.com with ESMTPSA id 39sm8074329pjo.7.2019.11.27.09.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 09:21:31 -0800 (PST) From: Thierry Foucu To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Nov 2019 09:21:28 -0800 Message-Id: <20191127172128.109224-1-tfoucu@gmail.com> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-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..86c899b5be 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 - 32) + +@item alllayer +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 } };