From patchwork Wed Dec 18 23:55:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Cao X-Patchwork-Id: 16875 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 003B2446977 for ; Thu, 19 Dec 2019 02:25:43 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CEE6D68A297; Thu, 19 Dec 2019 02:25:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9484468A115 for ; Thu, 19 Dec 2019 02:25:36 +0200 (EET) Received: by mail-pg1-f196.google.com with SMTP id x7so2139022pgl.11 for ; Wed, 18 Dec 2019 16:25:36 -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:mime-version :content-transfer-encoding; bh=OOpMFCOpnQ/JujgnYycKTpMBA9q+bIv6YjRfqo7icE8=; b=RS1IynuLOvBSuy12CSaFxAWY5LKcSbJwzoPwwTYjLyeZHZny88PMqYBpUw4JrcZLcD oIjBSH0skbPgEPzyIUsW65HF5wXnu5hr0o7eWkMNzubaVF3itpbdmxStSg8u2q4QldRS ZKBl5ZBsyFdrtXMdWlv7bceGfCMr9sXLaT3xKBicS09N54jnfksA5CtEC0xWf0BWxdrL CMyiGD+rKLEcm/A6vHHs3EtPS5n/npenZuzk6sWu3pVplkON4fMrzCPeH8Dus1NBch3h I5r60B3u8C1Weiu6juTw0qhauWOyAndGItb4y9Y0BvwKgU4QCBws04MwmM1jWxZZdGBa Ry3Q== 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:mime-version :content-transfer-encoding; bh=OOpMFCOpnQ/JujgnYycKTpMBA9q+bIv6YjRfqo7icE8=; b=eJMIWcvsS/T6bMEExyePGo3enk3q0oRC1qvRFW/IXeLDvtQPz4Xr4goi3HHo6Xqnhu RHY9tzPsH/2PNvTZsGvlEpCpIDNxUsbmtun/bJHn4muK4tt5TZP0bsELhm31hrLQaRSt zDkfwYae0RZhGzQIkEbm67f7B7G7Rpk4u10BDFCJxVNn8wefqo5/XGmWCXnqQSKZV32e OZiqEdpR+Og72rB7B1Z3jU5xVQiKG5B9ExV5kv7sQepNdOzGBRbBuMsQW8PTzo1aWBt2 DMUvydF8HWrysbOVWk6tre2E1BQpZWDff+SEF1m6DF8VHgN7sEs8qys18QN1zYgp2rBi o/8w== X-Gm-Message-State: APjAAAVWTlB/x4qjZE2DAvE8xLJq/6sGu8hVW9471HS/CjKhYEJedhZy yY17r5rFHnfwXBxllVbnqY7ep38gnMk= X-Google-Smtp-Source: APXvYqwVQ+MoLXaq8YhEouUnO0b6LGmW6zmQHUlvhT7+5XE8lQuV0kSFoSsCKvfgUgWuzVN8rrwGmA== X-Received: by 2002:a63:5924:: with SMTP id n36mr5962324pgb.43.1576713367097; Wed, 18 Dec 2019 15:56:07 -0800 (PST) Received: from wangcao.mtv.corp.google.com ([2620:0:1000:4011:7b84:dc77:c8b2:63c]) by smtp.gmail.com with ESMTPSA id c1sm4830808pfa.51.2019.12.18.15.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2019 15:56:06 -0800 (PST) From: Wang Cao X-Google-Original-From: Wang Cao To: ffmpeg-devel@ffmpeg.org Date: Wed, 18 Dec 2019 15:55:58 -0800 Message-Id: <20191218235558.117770-1-wangcao@google.com> X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog 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 --- libavcodec/libaomenc.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 }, };