From patchwork Fri Jun 26 00:55:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Cao X-Patchwork-Id: 20620 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 E0FBD44A741 for ; Fri, 26 Jun 2020 03:55:36 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CC29468835E; Fri, 26 Jun 2020 03:55:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F2FBC6882D8 for ; Fri, 26 Jun 2020 03:55:29 +0300 (EEST) Received: by mail-pl1-f178.google.com with SMTP id n2so3588699pld.13 for ; Thu, 25 Jun 2020 17:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=29o4FKChW1EkzgBZbjePMbWLDGgkvTbc/SoBfHTxUdw=; b=Gd0twQXXJEZYeimfuhqiqy2Gi/QbhbAoSqNWvs9ixqrjpgJ0teBtAvtNqkc0STdCjD Z2oR7M1rcxDGom4eio3s9kIg1yX6+EaVtx7kdn7W63QY23WHFu0WupQzwxzy6pHsp5I3 Hq9hMCUl++jo+l8wS3Cb7Yc0eDhu7yhMdPNBK1okcNxHnG97gWP+25a/WBbQPupyetba ENKHQZucERpiKvq6V67TCSRSsCQmHHCHPOnCg1yYe0KsvBPng3/x5KWN4KcIiHG331Ry nbHHHtSWgB8PGb5K5cSyx6r/MoX5t2GrD74JkWvh3fwM+SfDIVLJSSt8rb0Pdr6hrtmW JCAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=29o4FKChW1EkzgBZbjePMbWLDGgkvTbc/SoBfHTxUdw=; b=EX/wZ1HHXoA8dEPQqG4bvlPeA1vP9dMq8X020M/NQefweZqqnl0yEAMfj3ESP8q5UO ZKEO2xeDQ6VxrTr7C0hTCK0MU1zSMv54dEDHi7CtU/g3bGTJSfgjiFNupZJVjxwDLzCK rIoQ+jNGWHdjZJLGxynBnGt5bvSrrF6fJdN52ujgZAEqDPQ7DFtc+TBF9sQLsY+A6ev5 DZBgDUpUJyYKekf5Q3F6rSUmpqzCpR0x4+IUue6QfLhgNXAqXehLoatRvjV1EAqlPOuE iLsRxOqB6YPrJbaa96LhC72rkTzrdSdr3bZowFS3N3IzhG8n80G4kTviaAqUUXhpO5wo 9T5A== X-Gm-Message-State: AOAM531R3mlCTyDx4AB1eItPsAJqHj/Ktk3AFQz0VimVhKLH02Xk0Xvh FenV4U6PY3RSeKs9uIHXQcwtz1ctgPo= X-Google-Smtp-Source: ABdhPJyzXEBKYj0H8YM42RWVa3KWwgsFcysBg51T7lcQ01mi78KUb2K99QwjdKSwPqNep1MUEBsx8Q== X-Received: by 2002:a17:90b:3651:: with SMTP id nh17mr730920pjb.4.1593132927761; Thu, 25 Jun 2020 17:55:27 -0700 (PDT) Received: from wangcao.mtv.corp.google.com ([2620:0:1000:4011:7b84:dc77:c8b2:63c]) by smtp.gmail.com with ESMTPSA id bg6sm4298777pjb.51.2020.06.25.17.55.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 17:55:26 -0700 (PDT) From: Wang Cao X-Google-Original-From: Wang Cao To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jun 2020 17:55:14 -0700 Message-Id: <20200626005516.678811-3-wangcao@google.com> X-Mailer: git-send-email 2.27.0.111.gc72c7da667-goog In-Reply-To: <20200626005516.678811-1-wangcao@google.com> References: <20200626005516.678811-1-wangcao@google.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] libavcodec/libaomenc.c: Add command-line options for intra-coding tools 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" Signed-off-by: Wang Cao --- doc/encoders.texi | 21 +++++++++++++++++++ libavcodec/libaomenc.c | 47 ++++++++++++++++++++++++++++++++++++------ libavcodec/version.h | 2 +- 3 files changed, 63 insertions(+), 7 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 6513f6c3ef..f052d68c46 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1647,6 +1647,27 @@ Enable 1:4/4:1 partitions. Default is true. @item enable-ab-partitions (@emph{boolean}) Enable AB shape partitions. Default is true. +@item enable-angle-delta (@emph{boolean}) +Enable angle delta intra prediction. Default is true. + +@item enable-cfl-intra (@emph{boolean}) +Enable chroma predicted from luma intra prediction. Default is true. + +@item enable-filter-intra (@emph{boolean}) +Enable filter intra predictor. Default is true. + +@item enable-intra-edge-filter (@emph{boolean}) +Enable intra edge filter. Default is true. + +@item enable-smooth-intra (@emph{boolean}) +Enable smooth intra prediction mode. Default is true. + +@item enable-paeth-intra (@emph{boolean}) +Enable paeth predictor in intra prediction. Default is true. + +@item enable-palette (@emph{boolean}) +Enable palette prediction mode. Default is true. + @end table diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index ab2f456518..d1615e75c6 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -105,6 +105,13 @@ typedef struct AOMEncoderContext { int enable_rect_partitions; int enable_1to4_partitions; int enable_ab_partitions; + int enable_angle_delta; + int enable_cfl_intra; + int enable_paeth_intra; + int enable_smooth_intra; + int enable_intra_edge_filter; + int enable_palette; + int enable_filter_intra; } AOMContext; static const char *const ctlidstr[] = { @@ -142,12 +149,19 @@ static const char *const ctlidstr[] = { #ifdef AOM_CTRL_AV1E_SET_ENABLE_INTRABC [AV1E_SET_ENABLE_INTRABC] = "AV1E_SET_ENABLE_INTRABC", #endif - [AV1E_SET_ENABLE_CDEF] = "AV1E_SET_ENABLE_CDEF", - [AOME_SET_TUNING] = "AOME_SET_TUNING", - [AV1E_SET_ENABLE_SUPERRES] = "AV1E_SET_ENABLE_SUPERRES", - [AV1E_SET_ENABLE_1TO4_PARTITIONS] = "AV1E_SET_ENABLE_1TO4_PARTITIONS", - [AV1E_SET_ENABLE_AB_PARTITIONS] = "AV1E_SET_ENABLE_AB_PARTITIONS", - [AV1E_SET_ENABLE_RECT_PARTITIONS] = "AV1E_SET_ENABLE_RECT_PARTITIONS", + [AV1E_SET_ENABLE_CDEF] = "AV1E_SET_ENABLE_CDEF", + [AOME_SET_TUNING] = "AOME_SET_TUNING", + [AV1E_SET_ENABLE_SUPERRES] = "AV1E_SET_ENABLE_SUPERRES", + [AV1E_SET_ENABLE_1TO4_PARTITIONS] = "AV1E_SET_ENABLE_1TO4_PARTITIONS", + [AV1E_SET_ENABLE_AB_PARTITIONS] = "AV1E_SET_ENABLE_AB_PARTITIONS", + [AV1E_SET_ENABLE_RECT_PARTITIONS] = "AV1E_SET_ENABLE_RECT_PARTITIONS", + [AV1E_SET_ENABLE_ANGLE_DELTA] = "AV1E_SET_ENABLE_ANGLE_DELTA", + [AV1E_SET_ENABLE_CFL_INTRA] = "AV1E_SET_ENABLE_CFL_INTRA", + [AV1E_SET_ENABLE_FILTER_INTRA] = "AV1E_SET_ENABLE_FILTER_INTRA", + [AV1E_SET_ENABLE_INTRA_EDGE_FILTER] = "AV1E_SET_ENABLE_INTRA_EDGE_FILTER", + [AV1E_SET_ENABLE_PAETH_INTRA] = "AV1E_SET_ENABLE_PAETH_INTRA", + [AV1E_SET_ENABLE_SMOOTH_INTRA] = "AV1E_SET_ENABLE_SMOOTH_INTRA", + [AV1E_SET_ENABLE_PALETTE] = "AV1E_SET_ENABLE_PALETTE", }; static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) @@ -737,6 +751,20 @@ static av_cold int aom_init(AVCodecContext *avctx, codecctl_int(avctx, AV1E_SET_ENABLE_1TO4_PARTITIONS, ctx->enable_1to4_partitions); if (ctx->enable_ab_partitions >= 0) codecctl_int(avctx, AV1E_SET_ENABLE_AB_PARTITIONS, ctx->enable_ab_partitions); + if (ctx->enable_angle_delta >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_ANGLE_DELTA, ctx->enable_angle_delta); + if (ctx->enable_cfl_intra >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_CFL_INTRA, ctx->enable_cfl_intra); + if (ctx->enable_filter_intra >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_FILTER_INTRA, ctx->enable_filter_intra); + if (ctx->enable_intra_edge_filter >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_INTRA_EDGE_FILTER, ctx->enable_intra_edge_filter); + if (ctx->enable_paeth_intra >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_PAETH_INTRA, ctx->enable_paeth_intra); + if (ctx->enable_smooth_intra >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_SMOOTH_INTRA, ctx->enable_smooth_intra); + if (ctx->enable_palette >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_PALETTE, ctx->enable_palette); codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh); if (ctx->crf >= 0) @@ -1160,6 +1188,13 @@ static const AVOption options[] = { { "enable-rect-partitions", "Enable rectangular partitions", OFFSET(enable_rect_partitions), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { "enable-1to4-partitions", "Enable 1:4/4:1 partitions", OFFSET(enable_1to4_partitions), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { "enable-ab-partitions", "Enable ab shape partitions", OFFSET(enable_ab_partitions), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-angle-delta", "Enable angle delta intra prediction", OFFSET(enable_angle_delta), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-cfl-intra", "Enable chroma predicted from luma intra prediction", OFFSET(enable_cfl_intra), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-filter-intra", "Enable filter intra predictor", OFFSET(enable_filter_intra), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-intra-edge-filter", "Enable intra edge filter", OFFSET(enable_intra_edge_filter), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-smooth-intra", "Enable smooth intra prediction mode", OFFSET(enable_smooth_intra), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-paeth-intra", "Enable paeth predictor in intra prediction", OFFSET(enable_paeth_intra), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-palette", "Enable palette prediction mode", OFFSET(enable_palette), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { NULL }, }; diff --git a/libavcodec/version.h b/libavcodec/version.h index c9ce7981b5..78bac9f52a 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 93 -#define LIBAVCODEC_VERSION_MICRO 102 +#define LIBAVCODEC_VERSION_MICRO 103 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \