From patchwork Fri Jun 26 00:55:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Cao X-Patchwork-Id: 20619 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 DF45944A741 for ; Fri, 26 Jun 2020 03:55:34 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CBB6F6881FE; Fri, 26 Jun 2020 03:55:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E45D26881F5 for ; Fri, 26 Jun 2020 03:55:27 +0300 (EEST) Received: by mail-pf1-f196.google.com with SMTP id a127so3869513pfa.12 for ; Thu, 25 Jun 2020 17:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ve5J4LrYBEi9EL4i0cIPc2mOzcCjxFbrcklkpxfyu4c=; b=XMntrtPGEdJIdelZLaoWOeLB1VGkGgiqYYsEOfTy0zeszZG8Sd5jxD/GNIOBRfOxhw mKqPcmp12oH3npGw+rlElM+eVK04BdRDj7+5S0jL44KHDgcjEtxVH2pq7tz2Z0wQm6dg 9zjBbcZieDm8UX6a87Nesf/TvlTW4UspxlNnXmuoN8FrJSlmU9aqJDpZH5IILutlcNiV rnYWHYPRGu4hfoS9g+AMte+VU8mzLkqJcik37FbwbYPPGkl1jN9S3tcdTNbH+4yGbTSV KSI0UJkK0doGnXkfrlAU533dP4BsMwLwRMj0xNNU4FdqTp/rqkfwZi2XVzA1uAey/49d RwYg== 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:mime-version :content-transfer-encoding; bh=ve5J4LrYBEi9EL4i0cIPc2mOzcCjxFbrcklkpxfyu4c=; b=uocHLNF5KnEddA2oadJsQk5hND9rdZ8F1jPMJDSeTqpk92M0hVKNZG0583xIJg+BGP nGNz3ba86yjeYYZlbvF/j65JI6djeBGsDwiSv2BUEsJVNxQ3PPRHYvej9QFtdWaWFogO cz+87lUK5qVDD5ZnoPktXABnYkrP5j192QnwKXCC7nAZBTI2YyBfCXODq4c68fdza1XL 4GI6Ar/K4yyZoTotDq2VULoXzQ/4u0vt2LlJfImrcWVGJQ2sjzGCvahry6l0f3P1XWao p0gbraqOYOuIRT6yIll16XtsQO2MA6ywhN+n3qNfzCDU8GK5RwjthrnXWfE0DQm39RWJ fbYg== X-Gm-Message-State: AOAM530PjwkCCOeYQ97pZrG9RWDa8l6OqMETYwfOCLk0ZuwEEyRXAnqL GpEKZQ74o+ErRFWS3fZn+v4EuBeX+nE= X-Google-Smtp-Source: ABdhPJxlunw5mRwyZvaZS5RUcD6eftyRpaZCAlMGAfnhbs5F8IRDJvjGFKvZKXuD8SteEq6/eY20jg== X-Received: by 2002:a65:6883:: with SMTP id e3mr494036pgt.5.1593132925629; Thu, 25 Jun 2020 17:55:25 -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.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 17:55:24 -0700 (PDT) From: Wang Cao X-Google-Original-From: Wang Cao To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jun 2020 17:55:12 -0700 Message-Id: <20200626005516.678811-1-wangcao@google.com> X-Mailer: git-send-email 2.27.0.111.gc72c7da667-goog MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper 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" From: Wang Cao Signed-off-by: Wang Cao --- doc/encoders.texi | 39 +++++++++++++++++++++++++++++++++++++++ libavcodec/libaomenc.c | 38 ++++++++++++++++++++++++++++++++++++++ libavcodec/version.h | 2 +- 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 17a0f4c821..045535accb 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1599,6 +1599,45 @@ Enable the use of global motion for block prediction. Default is true. Enable block copy mode for intra block prediction. This mode is useful for screen content. Default is true. +@item enable-superres (@emph{boolean}) +Enable super-resolution during the encoding process. + +@item superres-mode (@emph{mode}) +Select super-resolution mode. + +@table @option +@item none (@emph{0}) +No frame superres allowed. + +@item fixed (@emph{1}) +All frames are coded at the specified scale and super-resolved. + +@item random (@emph{2}) +All frames are coded at a random scale and super-resolved. + +@item qthresh (@emph{3}) +Superres scale for a frame is determined based on q_index. + +@item auto (@emph{4}) +Automatically select superres for appropriate frames. +@end table + +@item superres_denominator +The denominator for superres to use when @option{superres-mode} is @option{fixed}. +Valid value ranges from 8 to 16. + +@item superres_kf_denominator +The denominator for superres to use on key frames when +@option{superres-mode} is @option{fixed}. Valid value ranges from 8 to 16. + +@item superres_qthresh +The q level threshold after which superres is used when @option{superres-mode} +is @option{qthresh}. Valid value ranges from 1 to 63. + +@item superres_kf_qthresh +The q level threshold after which superres is used for key frames when +@option{superres-mode} is @option{qthresh}. Valid value ranges from 1 to 63. + @end table @section libkvazaar diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 1c78da719a..17e130d8ec 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -96,6 +96,12 @@ typedef struct AOMEncoderContext { int enable_restoration; int usage; int tune; + int enable_superres; + int superres_mode; + int superres_denominator; + int superres_qthresh; + int superres_kf_denominator; + int superres_kf_qthresh; } AOMContext; static const char *const ctlidstr[] = { @@ -135,6 +141,7 @@ static const char *const ctlidstr[] = { #endif [AV1E_SET_ENABLE_CDEF] = "AV1E_SET_ENABLE_CDEF", [AOME_SET_TUNING] = "AOME_SET_TUNING", + [AV1E_SET_ENABLE_SUPERRES] = "AV1E_SET_ENABLE_SUPERRES", }; static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) @@ -204,6 +211,13 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx, width, "tile_width_count:", cfg->tile_width_count, width, "tile_height_count:", cfg->tile_height_count); av_log(avctx, level, "\n"); + av_log(avctx, level, "super resolution settings\n" + " %*s%u\n %*s%u\n %*s%u\n %*s%u\n %*s%u\n ", + width, "rc_superres_mode:", cfg->rc_superres_mode, + width, "rc_superres_denominator:", cfg->rc_superres_denominator, + width, "rc_superres_qthresh:", cfg->rc_superres_qthresh, + width, "rc_superres_kf_denominator:", cfg->rc_superres_kf_denominator, + width, "rc_superres_kf_qthresh:", cfg->rc_superres_kf_qthresh); } static void coded_frame_add(void *list, struct FrameListData *cx_frame) @@ -546,6 +560,17 @@ static av_cold int aom_init(AVCodecContext *avctx, return AVERROR(EINVAL); } + if (ctx->superres_mode >= 0) + enccfg.rc_superres_mode = ctx->superres_mode; + if (ctx->superres_qthresh > 0) + enccfg.rc_superres_qthresh = ctx->superres_qthresh; + if (ctx->superres_kf_qthresh > 0) + enccfg.rc_superres_kf_qthresh = ctx->superres_kf_qthresh; + if (ctx->superres_denominator >= 8) + enccfg.rc_superres_denominator = ctx->superres_denominator; + if (ctx->superres_kf_denominator >= 8) + enccfg.rc_superres_kf_denominator = ctx->superres_kf_denominator; + dump_enc_cfg(avctx, &enccfg); enccfg.g_w = avctx->width; @@ -688,6 +713,8 @@ static av_cold int aom_init(AVCodecContext *avctx, // codec control failures are currently treated only as warnings av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n"); codecctl_int(avctx, AOME_SET_CPUUSED, ctx->cpu_used); + if (ctx->enable_superres >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_SUPERRES, ctx->enable_superres); if (ctx->auto_alt_ref >= 0) codecctl_int(avctx, AOME_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref); if (ctx->arnr_max_frames >= 0) @@ -1107,6 +1134,17 @@ static const AVOption options[] = { { "tune", "The metric that the encoder tunes for. Automatically chosen by the encoder by default", OFFSET(tune), AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_TUNE_SSIM, VE, "tune"}, { "psnr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AOM_TUNE_PSNR}, 0, 0, VE, "tune"}, { "ssim", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AOM_TUNE_SSIM}, 0, 0, VE, "tune"}, + { "enable-superres", "Enable super-resolution mode", OFFSET(enable_superres), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "superres-mode", "Select super-resultion mode", OFFSET(superres_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_SUPERRES_AUTO, VE, "superres_mode"}, + { "none", "No frame superres allowed", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_NONE}, 0, 0, VE, "superres_mode"}, + { "fixed", "All frames are coded at the specified scale and super-resolved", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_FIXED}, 0, 0, VE, "superres_mode"}, + { "random", "All frames are coded at a random scale and super-resolved.", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_RANDOM}, 0, 0, VE, "superres_mode"}, + { "qthresh", "Superres scale for a frame is determined based on q_index", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_QTHRESH}, 0, 0, VE, "superres_mode"}, + { "auto", "Automatically select superres for appropriate frames", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_AUTO}, 0, 0, VE, "superres_mode"}, + { "superres-denominator", "The denominator for superres to use, range [8, 16]", OFFSET(superres_denominator), AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE}, + { "superres-qthresh", "The q level threshold after which superres is used, range [1, 63]", OFFSET(superres_qthresh), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE}, + { "superres-kf-denominator", "The denominator for superres to use on key frames, range [8, 16]", OFFSET(superres_kf_denominator), AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE}, + { "superres-kf-qthresh", "The q level threshold after which superres is used for key frames, range [1, 63]", OFFSET(superres_kf_qthresh), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE}, { NULL }, }; diff --git a/libavcodec/version.h b/libavcodec/version.h index 03593026b3..05f59901ff 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 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ From patchwork Fri Jun 26 00:55:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Cao X-Patchwork-Id: 20623 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 4F2FD44B897 for ; Fri, 26 Jun 2020 04:02:35 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 229C16882AD; Fri, 26 Jun 2020 04:02:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B472E6880AA for ; Fri, 26 Jun 2020 04:02:28 +0300 (EEST) Received: by mail-pf1-f193.google.com with SMTP id d66so3896787pfd.6 for ; Thu, 25 Jun 2020 18:02:28 -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=eN+QO5KHH+/l34cxTiJL+3qVDTH+puTN5MGzb8sX+so=; b=aSxSq3hxoXfZxtRLmynvEWn/eCmMBbREmKrFzuwV2rs/VsvR+ofhnc4N7m7YfBV0/P 1RrrnFue5nb9i/OhAhMqlaX/0AEL2liPT3TQupO6C+ECPz2rBAGeElzoICQeNI3xD8zA Q1TpVd+DgYUQdLUGAT1qByrAOobcBLp8ZIRzPiCGzAgDuSNUagn5cuRnHsFtLZQxNKvl iGvwZSs2y5vPTTxVnNgUIp+xIkE12A5KHlSNU8Fe29JQXnJS8J1DCOvRqrgSoWG/Q8sV CYhSSF5ie/GEPVXhvTYfW8ZKeoPhmMXw+bM4/xG3rJnWFU7t6GiokN8wrbC2Ofk4xDpu tOYg== 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=eN+QO5KHH+/l34cxTiJL+3qVDTH+puTN5MGzb8sX+so=; b=OSYSzXtOx+vrKY8WsLATpj+E3ZAu4pFsGJdyZcv2THQCPTyHFR0qmfh4SB0OBwMCuC KtsfT5jJSIBQNmL3npt0kUX6jrNjBy1iyK/S1ptlGl/L1L967rLYwLn1+MJGee6LNc3t 8QnPUN5VNmIjQ8OA980hBcEtWus4Dxp92mxZ5I0XpO2PR9zIei0+tXoOhTOxnhYkSiWu 0wzNeMqetXdE+jLq3NyOeBXkjbk7fGnIH4PVfteSv8hxAHywi0HtYJYL+cgvkYgC3Y0k YOQgENu+rSMgjlDKY5gqo8bK/VBpdGXa6cad7HvNs4aJUC/eMxxiLYX0meCvA0ecd1V7 /kTw== X-Gm-Message-State: AOAM533iWAoxE3crRSjIO+ylypmFt94dOTHS3o+FKK4ID/DVZqJfwoBx WGKnMAzT48Nhfm4uLquG1sVr77YiJCw= X-Google-Smtp-Source: ABdhPJyax3rPQ+iCx9tAfLR258T/tbCpjpbFUvkPLx+sdnw6OgtWybQ89Az+WjW/uG8oekJK/953Ug== X-Received: by 2002:a63:2144:: with SMTP id s4mr491558pgm.94.1593132926511; Thu, 25 Jun 2020 17:55:26 -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.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 17:55:25 -0700 (PDT) From: Wang Cao X-Google-Original-From: Wang Cao To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jun 2020 17:55:13 -0700 Message-Id: <20200626005516.678811-2-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 2/5] libavcodec/libaomenc: Add command-line options to control the use of partition 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" This patch adds the control for enabling rectangular partitions, 1:4/4:1 partitions and AB shape partitions. Signed-off-by: Wang Cao --- doc/encoders.texi | 10 ++++++++++ libavcodec/libaomenc.c | 15 +++++++++++++++ libavcodec/version.h | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 045535accb..6513f6c3ef 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1638,8 +1638,18 @@ is @option{qthresh}. Valid value ranges from 1 to 63. The q level threshold after which superres is used for key frames when @option{superres-mode} is @option{qthresh}. Valid value ranges from 1 to 63. +@item enable-rect-partitions (@emph{boolean}) +Enable rectangular partitions. Default is true. + +@item enable-1to4-partitions (@emph{boolean}) +Enable 1:4/4:1 partitions. Default is true. + +@item enable-ab-partitions (@emph{boolean}) +Enable AB shape partitions. Default is true. + @end table + @section libkvazaar Kvazaar H.265/HEVC encoder. diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 17e130d8ec..ab2f456518 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -102,6 +102,9 @@ typedef struct AOMEncoderContext { int superres_qthresh; int superres_kf_denominator; int superres_kf_qthresh; + int enable_rect_partitions; + int enable_1to4_partitions; + int enable_ab_partitions; } AOMContext; static const char *const ctlidstr[] = { @@ -142,6 +145,9 @@ static const char *const ctlidstr[] = { [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", }; static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) @@ -725,6 +731,12 @@ static av_cold int aom_init(AVCodecContext *avctx, 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); + if (ctx->enable_rect_partitions >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_RECT_PARTITIONS, ctx->enable_rect_partitions); + if (ctx->enable_1to4_partitions >= 0) + 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); codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh); if (ctx->crf >= 0) @@ -1145,6 +1157,9 @@ static const AVOption options[] = { { "superres-qthresh", "The q level threshold after which superres is used, range [1, 63]", OFFSET(superres_qthresh), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE}, { "superres-kf-denominator", "The denominator for superres to use on key frames, range [8, 16]", OFFSET(superres_kf_denominator), AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE}, { "superres-kf-qthresh", "The q level threshold after which superres is used for key frames, range [1, 63]", OFFSET(superres_kf_qthresh), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE}, + { "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}, { NULL }, }; diff --git a/libavcodec/version.h b/libavcodec/version.h index 05f59901ff..c9ce7981b5 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 101 +#define LIBAVCODEC_VERSION_MICRO 102 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ 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, \ From patchwork Fri Jun 26 00:55:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Cao X-Patchwork-Id: 20621 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 CDAC444A741 for ; Fri, 26 Jun 2020 03:55:38 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B53766897CD; Fri, 26 Jun 2020 03:55:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4F3586881F5 for ; Fri, 26 Jun 2020 03:55:31 +0300 (EEST) Received: by mail-pl1-f172.google.com with SMTP id x8so2709750plm.10 for ; Thu, 25 Jun 2020 17:55:31 -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=MNxVmpwgPemlFSWBvf0bTJCVt9aMvIe0AsBsin4C6zk=; b=ff3P1OjGCCqRYtBJlOri4Hy+Q/S4n8zY9Lczk4vc3ogcMuXSDSoNLO+pJR1a4g+pf9 SyRX6MJQOMYRKLz9I2kcTs21k8gP9WuJ4ZhnH3IR4NUMxzPGKiZHMQgSOFWfkMlg/l/9 awcBzp/RYiUAbytPXUGUBnTU4E5SImo3uCrCL/QhVZZH8wbhP5btl7+g7xZLnPzq2QTU s9Qv9QrwHxgdMotU+WCzFysY6ZqIK/WXnzOos3H4RTaoD7zpJrRJ3MZ/sVGeMJhI1ljC kkQe1wmFXGahaKgIxqiviP11JYWkmrIYI0B51BWT0pyAfu+UQjxM3pgg2K1BC+F42wZt hWUQ== 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=MNxVmpwgPemlFSWBvf0bTJCVt9aMvIe0AsBsin4C6zk=; b=CwCexqtxTY5zkW2eL7ztCoIbEGdEO7ktCLadNRTzOK4ZPtM+7vE1wbFAuDC57yoids UQt5lBDx9ukByD3e5277OCgERnATEAKa6rkZjuLUWYhpTiCZi5jfQglRrWvwNz8iTmEx uI27w71XA4SW+Ep6T0MSjwkhImxecEHD24vUBeZ7chG6Zj1HeEYb23lKjLcA7T44gM3N GP4llyNOoMMBh3zoYF+WZ9CucTJK/J8yQitUEU30rcdiaEc/SioE+kxFjDApUcopwb9i hw9cbhPUukK63Wm1yCHIKxGjls5t1vnS4xxD4wcwjBN7mUvNPSkjKmiDE/YJXZwx0/Zn GvOQ== X-Gm-Message-State: AOAM530rvLVRig9v1z+KVbHDJ7FkCmbkWToif+RdpbdS/QyEJOmobGxz hEjG8x8Y0I171ZbCx7rapGU6eegQHSc= X-Google-Smtp-Source: ABdhPJwAdBqem8nsZb6nIlu3hyZITf9HmOhL9CPKm/s6G6FKNRWMZ326PsY3oicliTjFcx0KqPL7Mw== X-Received: by 2002:a17:902:8a98:: with SMTP id p24mr436907plo.90.1593132929048; Thu, 25 Jun 2020 17:55:29 -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.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 17:55:28 -0700 (PDT) From: Wang Cao X-Google-Original-From: Wang Cao To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jun 2020 17:55:15 -0700 Message-Id: <20200626005516.678811-4-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 4/5] libavcodec/libaomenc.c: Add command-line options for tx 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 | 31 +++++++++++++++++++++++++++++++ libavcodec/version.h | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index f052d68c46..329c887ce0 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1668,6 +1668,27 @@ Enable paeth predictor in intra prediction. Default is true. @item enable-palette (@emph{boolean}) Enable palette prediction mode. Default is true. +@item enable-flip-idtx (@emph{boolean}) +Enable extended transform type (0: false, 1: true (default)) +including FLIPADST_DCT, DCT_FLIPADST, FLIPADST_FLIPADST, +ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT, V_ADST, + H_ADST, V_FLIPADST, H_FLIPADST + +@item enable-tx64 (@emph{boolean}) +Enable 64-pt transform (0: false, 1: true (default)) + +@item reduced-tx-type-set (@emph{boolean}) +Use reduced set of transform types. Default is false. + +@item use-intra-dct-only (@emph{boolean}) +Use DCT only for INTRA modes. Default is false. + +@item use-inter-dct-only (@emph{boolean}) +Use DCT only for INTER modes. Default is false. + +@item use-intra-default-tx-only (@emph{boolean}) +Use Default-transform only for INTRA modes. Default is false. + @end table diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index d1615e75c6..745d7e09fc 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -112,6 +112,12 @@ typedef struct AOMEncoderContext { int enable_intra_edge_filter; int enable_palette; int enable_filter_intra; + int enable_flip_idtx; + int enable_tx64; + int reduced_tx_type_set; + int use_intra_dct_only; + int use_inter_dct_only; + int use_intra_default_tx_only; } AOMContext; static const char *const ctlidstr[] = { @@ -162,6 +168,12 @@ static const char *const ctlidstr[] = { [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", + [AV1E_SET_ENABLE_FLIP_IDTX] = "AV1E_SET_ENABLE_FLIP_IDTX", + [AV1E_SET_ENABLE_TX64] = "AV1E_SET_ENABLE_TX64", + [AV1E_SET_INTRA_DCT_ONLY] = "AV1E_SET_INTRA_DCT_ONLY", + [AV1E_SET_INTER_DCT_ONLY] = "AV1E_SET_INTER_DCT_ONLY", + [AV1E_SET_INTRA_DEFAULT_TX_ONLY] = "AV1E_SET_INTRA_DEFAULT_TX_ONLY", + [AV1E_SET_REDUCED_TX_TYPE_SET] = "AV1E_SET_REDUCED_TX_TYPE_SET", }; static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) @@ -765,6 +777,19 @@ static av_cold int aom_init(AVCodecContext *avctx, 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); + if (ctx->enable_tx64 >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_TX64, ctx->enable_tx64); + if (ctx->enable_flip_idtx >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_FLIP_IDTX, ctx->enable_flip_idtx); + if (ctx->use_intra_dct_only >= 0) + codecctl_int(avctx, AV1E_SET_INTRA_DCT_ONLY, ctx->use_intra_dct_only); + if (ctx->use_inter_dct_only >= 0) + codecctl_int(avctx, AV1E_SET_INTER_DCT_ONLY, ctx->use_inter_dct_only); + if (ctx->use_intra_default_tx_only >= 0) + codecctl_int(avctx, AV1E_SET_INTRA_DEFAULT_TX_ONLY, ctx->use_intra_default_tx_only); + if (ctx->reduced_tx_type_set >= 0) + codecctl_int(avctx, AV1E_SET_REDUCED_TX_TYPE_SET, ctx->reduced_tx_type_set); + codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh); if (ctx->crf >= 0) @@ -1195,6 +1220,12 @@ static const AVOption options[] = { { "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}, + { "enable-flip-idtx", "Enable extended transform type", OFFSET(enable_flip_idtx), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-tx64", "Enable 64-pt transform", OFFSET(enable_tx64), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "reduced-tx-type-set", "Use reduced set of transform types. Default is false", OFFSET(reduced_tx_type_set), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "use-intra-dct-only", "Use DCT only for INTRA modes", OFFSET(use_intra_dct_only), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "use-inter-dct-only", "Use DCT only for INTRA modes", OFFSET(use_inter_dct_only), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "use-intra-default-tx-only", "Use Default-transform only for INTRA modes", OFFSET(use_intra_default_tx_only), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { NULL }, }; diff --git a/libavcodec/version.h b/libavcodec/version.h index 78bac9f52a..bfe6abd92f 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 103 +#define LIBAVCODEC_VERSION_MICRO 104 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ From patchwork Fri Jun 26 00:55:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Cao X-Patchwork-Id: 20622 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 B780744A741 for ; Fri, 26 Jun 2020 03:55:39 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A8B396898D5; Fri, 26 Jun 2020 03:55:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC3196882D8 for ; Fri, 26 Jun 2020 03:55:32 +0300 (EEST) Received: by mail-pl1-f169.google.com with SMTP id n2so3588737pld.13 for ; Thu, 25 Jun 2020 17:55:32 -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=zAMj6Lns0PUBbP1moIfRWJsWSYaHwpNo9Br2b9D7Ly4=; b=YTFztsMUeO4KXiBmZxPzhzHStJ3YLMJVViWdxILKOkiiAlYlu68ZMnpQPPKDoQRpnJ Y09U+kWD6fwDguHHgpTMe1ILQHheS/hUKVsyRT8PeDT35TT5C2+cz3bBA9JPNT1/9yXF bGxwaWRC2seiFq9N9uZRu3FVrl/hCHF6NSpvA787vwuStyUiAyM74gKZAnU9iGB9QeXK imDsXBPfWmUBsuK/BuqAguzsWy20VVrRMrGB5yloYCRd3y4PhTQTcFzCrQbBvJcPR+aW fXyagDfspYBuq2vhqwSh21E6+uOKukNUvDp9Cb2XOTvK0jw3vgpsiPM6ghcTbOlCI+0c OaVA== 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=zAMj6Lns0PUBbP1moIfRWJsWSYaHwpNo9Br2b9D7Ly4=; b=TxcbysZqAcxyt2Ds3CosMyV262Snp0BrbaTtPvuMrWlxcztFpemi2/eC0sGN2Ap1OU iCJUwLxRaL4iG3s53BfsqycvfoSAGIcaGwbMMYn0ZUZuHAZBMambcQVoUcvzAfuAzZTO 4/HUBtm7XUF3knfLoKra1FdW6OSnQlPLmzMYLHy5xybHB3KvvAZlEfOw6suNVgIyJdaN faK22FWlNRTjUQRcUjM1IjDjXCjijjl24n6m+v1Sox+RKqJYER8M8/mWbdJNJM3hc59C hoCR1XKagITLcLT/ear1Gf9cMFJKd1ziZMYE7+JB3Sm0jJyWUif9mgU1ww37JCvX4UHi 98Lg== X-Gm-Message-State: AOAM5327kGqb4gReT9glqdD7DHlqZjiTqngsHkrzFx+RcC3/XD8DiS3C u7thHiJODd8sH4fyduKTN/I7BZTg2S8= X-Google-Smtp-Source: ABdhPJyhhQ6LNeFb7mNoR0HNa4ZeI45N3nnUBoD8qBTrMaK/s9Mbkl1qOl6ZrRWrRQpw9eM21xYR2A== X-Received: by 2002:a17:90a:d30e:: with SMTP id p14mr748529pju.72.1593132930438; Thu, 25 Jun 2020 17:55:30 -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.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 17:55:29 -0700 (PDT) From: Wang Cao X-Google-Original-From: Wang Cao To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jun 2020 17:55:16 -0700 Message-Id: <20200626005516.678811-5-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 5/5] libavcodec/libaomenc.c: Add command-line options for inter-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 | 36 +++++++++++++++++++++++++ libavcodec/libaomenc.c | 61 ++++++++++++++++++++++++++++++++++++++++++ libavcodec/version.h | 2 +- 3 files changed, 98 insertions(+), 1 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 329c887ce0..c1c5a9c9ca 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1689,6 +1689,42 @@ Use DCT only for INTER modes. Default is false. @item use-intra-default-tx-only (@emph{boolean}) Use Default-transform only for INTRA modes. Default is false. +@item enable-ref-frame-mvs (@emph{boolean}) +Enable temporal mv prediction (default is 1) + +@item enable-reduced-reference-set (@emph{boolean}) +Use reduced set of single and compound references (0: off (default), 1: on) + +@item enable-obmc (@emph{boolean}) +Enable obmc (0: false, 1: true (default)) + +@item enable-dual-filter (@emph{boolean}) +Enable dual filter (0: false, 1: true (default)) + +@item enable-diff-wtd-comp (@emph{boolean}) +Enable difference-weighted compound (0: false, 1: true (default)) + +@item enable-dist-wtd-comp (@emph{boolean}) +Enable distance-weighted compound (0: false, 1: true (default)) + +@item enable-onesided-comp (@emph{boolean}) +Enable one sided compound (0: false, 1: true (default)) + +@item enable-interinter-wedge (@emph{boolean}) +Enable interinter wedge compound (0: false, 1: true (default)) + +@item enable-interintra-wedge (@emph{boolean}) +Enable interintra wedge compound (0: false, 1: true (default)) + +@item enable-masked-comp (@emph{boolean}) +Enable masked compound (0: false, 1: true (default)) + +@item enable-interintra-comp (@emph{boolean}) +Enable interintra compound (0: false, 1: true (default)) + +@item enable-smooth-interintra (@emph{boolean}) +Enable smooth interintra mode (0: false, 1: true (default)) + @end table diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 745d7e09fc..3eed019ef3 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -118,6 +118,18 @@ typedef struct AOMEncoderContext { int use_intra_dct_only; int use_inter_dct_only; int use_intra_default_tx_only; + int enable_ref_frame_mvs; + int enable_interinter_wedge; + int enable_interintra_wedge; + int enable_interintra_comp; + int enable_masked_comp; + int enable_obmc; + int enable_onesided_comp; + int enable_reduced_reference_set; + int enable_smooth_interintra; + int enable_diff_wtd_comp; + int enable_dist_wtd_comp; + int enable_dual_filter; } AOMContext; static const char *const ctlidstr[] = { @@ -174,6 +186,19 @@ static const char *const ctlidstr[] = { [AV1E_SET_INTER_DCT_ONLY] = "AV1E_SET_INTER_DCT_ONLY", [AV1E_SET_INTRA_DEFAULT_TX_ONLY] = "AV1E_SET_INTRA_DEFAULT_TX_ONLY", [AV1E_SET_REDUCED_TX_TYPE_SET] = "AV1E_SET_REDUCED_TX_TYPE_SET", + [AV1E_SET_ALLOW_WARPED_MOTION] = "AV1E_SET_ALLOW_WARPED_MOTION", + [AV1E_SET_ENABLE_DIFF_WTD_COMP] = "AV1E_SET_ENABLE_DIFF_WTD_COMP", + [AV1E_SET_ENABLE_DIST_WTD_COMP] = "AV1E_SET_ENABLE_DIST_WTD_COMP", + [AV1E_SET_ENABLE_DUAL_FILTER] = "AV1E_SET_ENABLE_DUAL_FILTER", + [AV1E_SET_ENABLE_INTERINTER_WEDGE] = "AV1E_SET_ENABLE_INTERINTER_WEDGE", + [AV1E_SET_ENABLE_INTERINTRA_WEDGE] = "AV1E_SET_ENABLE_INTERINTRA_WEDGE", + [AV1E_SET_ENABLE_MASKED_COMP] = "AV1E_SET_ENABLE_MASKED_COMP", + [AV1E_SET_ENABLE_INTERINTRA_COMP] = "AV1E_SET_ENABLE_INTERINTRA_COMP", + [AV1E_SET_ENABLE_OBMC] = "AV1E_SET_ENABLE_OBMC", + [AV1E_SET_ENABLE_ONESIDED_COMP] = "AV1E_SET_ENABLE_ONESIDED_COMP", + [AV1E_SET_REDUCED_REFERENCE_SET] = "AV1E_SET_REDUCED_REFERENCE_SET", + [AV1E_SET_ENABLE_SMOOTH_INTERINTRA] = "AV1E_SET_ENABLE_SMOOTH_INTERINTRA", + [AV1E_SET_ENABLE_REF_FRAME_MVS] = "AV1E_SET_ENABLE_REF_FRAME_MVS", }; static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) @@ -789,6 +814,30 @@ static av_cold int aom_init(AVCodecContext *avctx, codecctl_int(avctx, AV1E_SET_INTRA_DEFAULT_TX_ONLY, ctx->use_intra_default_tx_only); if (ctx->reduced_tx_type_set >= 0) codecctl_int(avctx, AV1E_SET_REDUCED_TX_TYPE_SET, ctx->reduced_tx_type_set); + if (ctx->enable_ref_frame_mvs >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_REF_FRAME_MVS, ctx->enable_ref_frame_mvs); + if (ctx->enable_reduced_reference_set >= 0) + codecctl_int(avctx, AV1E_SET_REDUCED_REFERENCE_SET, ctx->enable_reduced_reference_set); + if (ctx->enable_diff_wtd_comp >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_DIFF_WTD_COMP, ctx->enable_diff_wtd_comp); + if (ctx->enable_dist_wtd_comp >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_DIST_WTD_COMP, ctx->enable_dist_wtd_comp); + if (ctx->enable_dual_filter >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_DUAL_FILTER, ctx->enable_dual_filter); + if (ctx->enable_interinter_wedge >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_INTERINTER_WEDGE, ctx->enable_interinter_wedge); + if (ctx->enable_masked_comp >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_MASKED_COMP, ctx->enable_masked_comp); + if (ctx->enable_interintra_comp >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_INTERINTRA_COMP, ctx->enable_interintra_comp); + if (ctx->enable_interintra_wedge >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_INTERINTRA_WEDGE, ctx->enable_interintra_wedge); + if (ctx->enable_obmc >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_OBMC, ctx->enable_obmc); + if (ctx->enable_onesided_comp >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_ONESIDED_COMP, ctx->enable_onesided_comp); + if (ctx->enable_smooth_interintra >= 0) + codecctl_int(avctx, AV1E_SET_ENABLE_SMOOTH_INTERINTRA, ctx->enable_smooth_interintra); codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh); @@ -1226,6 +1275,18 @@ static const AVOption options[] = { { "use-intra-dct-only", "Use DCT only for INTRA modes", OFFSET(use_intra_dct_only), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { "use-inter-dct-only", "Use DCT only for INTRA modes", OFFSET(use_inter_dct_only), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { "use-intra-default-tx-only", "Use Default-transform only for INTRA modes", OFFSET(use_intra_default_tx_only), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-ref-frame-mvs", "Enable temporal mv prediction (default is 1)", OFFSET(enable_ref_frame_mvs), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-reduced-reference-set", "Use reduced set of single and compound references (0: off (default), 1: on)", OFFSET(enable_reduced_reference_set), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-obmc", "Enable obmc (0: false, 1: true (default))", OFFSET(enable_obmc), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-dual-filter", "Enable dual filter (0: false, 1: true (default))", OFFSET(enable_dual_filter), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-diff-wtd-comp", "Enable difference-weighted compound (0: false, 1: true (default))", OFFSET(enable_diff_wtd_comp), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-dist-wtd-comp", "Enable distance-weighted compound (0: false, 1: true (default))", OFFSET(enable_dist_wtd_comp), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-onesided-comp", "Enable one sided compound (0: false, 1: true (default))", OFFSET(enable_onesided_comp), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-interinter-wedge", "Enable interinter wedge compound (0: false, 1: true (default))", OFFSET(enable_interinter_wedge), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-interintra-wedge", "Enable interintra wedge compound (0: false, 1: true (default))", OFFSET(enable_interintra_wedge), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-masked-comp", "Enable masked compound (0: false, 1: true (default))", OFFSET(enable_masked_comp), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-interintra-comp", "Enable interintra compound (0: false, 1: true (default))", OFFSET(enable_interintra_comp), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, + { "enable-smooth-interintra", "Enable smooth interintra mode (0: false, 1: true (default))", OFFSET(enable_smooth_interintra), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, { NULL }, }; diff --git a/libavcodec/version.h b/libavcodec/version.h index bfe6abd92f..d9b74642aa 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 104 +#define LIBAVCODEC_VERSION_MICRO 105 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \