From patchwork Mon Dec 23 20:16:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Cao X-Patchwork-Id: 16934 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 D0468449EFE for ; Mon, 23 Dec 2019 22:53:35 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AA35168A9FD; Mon, 23 Dec 2019 22:53:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 06A2768A175 for ; Mon, 23 Dec 2019 22:53:29 +0200 (EET) Received: by mail-pg1-f195.google.com with SMTP id 6so9381469pgk.0 for ; Mon, 23 Dec 2019 12:53:28 -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=9uPd/ICId6bk2N+UBuH1fLJeaWpmFQ0p2g+C/kJU2vI=; b=RxtYRLw4YUmF87mZfqNX7zDNJblDKFBcarsY5A5mDKOcCC+esL/785abvvk8XbaILr OB5DAvCEylFI1WkyMfhgixY8aiQRmOeZ2Un6mikRiXc3hdCHSaz4mGMzbIZCQaJPjW/N 1tcLYWqK7QsnYr9winxTdy4UQ4Sfv4ibkjM1nWGRFsQqFbuSEq27CG1a4XGiL7pYpbDX Dsubv2Blav/lUT/mYLP/N2q+gLi7YbSfNvE9nmJ82z9GmJsIgegYCsqmJEkQZ/r+UPyW boE/DJ8KhdbDOvr7Dqa7oFWUpgsx2Kjc4n1HHEHRkSV0Ebx87+MZ7JQ/mB/eGW9M65u8 z8ag== 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=9uPd/ICId6bk2N+UBuH1fLJeaWpmFQ0p2g+C/kJU2vI=; b=L2Ki2N89s4gphBy1jhl8JLT9UUUVahBC3TIzpTX8ihDS9GI/TiDaOgFqj/zmP8uKll DMv8CN1yhX8Hj2+bg50iOQDG0whldsEZKdm6KyNM8DmmoV8GFHiKol5jQMvjWlxCxaoY oVVBjMAhCsS/yvOY+cH3iFPkQyYXD7CK0nCfK0KBLr+MnTKoG41zCVYYJAlDndIfYBR3 /j6+4t5KDEj2sgGMxA3W+FR0CEQuU88CzJVzE+3K9u2ngZ6VZUxrvpgysY2FnmzTC5Zw cWNCLRg6MVbQXAccTTGo4bJIzFmiomw37Xw/jBLlGaB7dS9YrHxznIL4c3rTt4+9sqr8 UbrQ== X-Gm-Message-State: APjAAAXzKdgvur2AEJqfo3PnOTyE9A4ym74c1liryN11ncm0XdtyTTZ/ SHF9MRbE7r/JvuV1RVHalXVfg5ds55Y= X-Google-Smtp-Source: APXvYqwvIic47zBcnn/iOIN6O9CgjX5R2/k36Qtir/eoGr2sFOhr48zzqDvArtO+BaJZkw/Mnm5L/w== X-Received: by 2002:aa7:8699:: with SMTP id d25mr33863193pfo.139.1577132640430; Mon, 23 Dec 2019 12:24:00 -0800 (PST) Received: from wangcao.mtv.corp.google.com ([2620:0:1000:4011:7b84:dc77:c8b2:63c]) by smtp.gmail.com with ESMTPSA id w131sm26306314pfc.16.2019.12.23.12.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 12:23:59 -0800 (PST) From: Wang Cao X-Google-Original-From: Wang Cao To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Dec 2019 12:16:24 -0800 Message-Id: <20191223201622.18270-1-wangcao@google.com> X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog In-Reply-To: <20191218235558.117770-1-wangcao@google.com> References: <20191218235558.117770-1-wangcao@google.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Add a commandline option to control loop restoration for libaom 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: Wang Cao Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Wang Cao --- doc/encoders.texi | 3 +++ libavcodec/libaomenc.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index 4ee518a124..56b36c156b 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1587,6 +1587,9 @@ Enable row based multi-threading. Disabled by default. Enable Constrained Directional Enhancement Filter. The libaom-av1 encoder enables CDEF by default. +@item enable-restoration (@emph{boolean}) +Enable Loop Restoration Filter. Default is true for libaom-av1. + @item enable-global-motion (@emph{boolean}) Enable the use of global motion for block prediction. Default is true. diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index e06697c1bf..41a250302d 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -92,6 +92,7 @@ typedef struct AOMEncoderContext { int enable_cdef; int enable_global_motion; int enable_intrabc; + int enable_restoration; } AOMContext; static const char *const ctlidstr[] = { @@ -110,6 +111,7 @@ static const char *const ctlidstr[] = { [AV1E_SET_SUPERBLOCK_SIZE] = "AV1E_SET_SUPERBLOCK_SIZE", [AV1E_SET_TILE_COLUMNS] = "AV1E_SET_TILE_COLUMNS", [AV1E_SET_TILE_ROWS] = "AV1E_SET_TILE_ROWS", + [AV1E_SET_ENABLE_RESTORATION] = "AV1E_SET_ENABLE_RESTORATION", #ifdef AOM_CTRL_AV1E_SET_ROW_MT [AV1E_SET_ROW_MT] = "AV1E_SET_ROW_MT", #endif @@ -688,6 +690,9 @@ static av_cold int aom_init(AVCodecContext *avctx, codecctl_int(avctx, AOME_SET_ARNR_STRENGTH, ctx->arnr_strength); if (ctx->enable_cdef >= 0) codecctl_int(avctx, AV1E_SET_ENABLE_CDEF, ctx->enable_cdef); + if (ctx->enable_restoration >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_RESTORATION, ctx->enable_restoration); + codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh); if (ctx->crf >= 0) codecctl_int(avctx, AOME_SET_CQ_LEVEL, ctx->crf); @@ -1084,6 +1089,7 @@ static const AVOption options[] = { { "enable-cdef", "Enable CDEF filtering", OFFSET(enable_cdef), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { "enable-global-motion", "Enable global motion", OFFSET(enable_global_motion), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { "enable-intrabc", "Enable intra block copy prediction mode", OFFSET(enable_intrabc), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-restoration", "Enable Loop Restoration filtering", OFFSET(enable_restoration), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { NULL }, };