Browse Source

avcodec/libaomenc: Add command-line options to control the use of partition tools

This patch adds the control for enabling rectangular partitions, 1:4/4:1
partitions and AB shape partitions.

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: James Zern <jzern@google.com>
tags/n4.4
Wang Cao James Zern 4 years ago
parent
commit
aa5c6f382b
3 changed files with 25 additions and 1 deletions
  1. +9
    -0
      doc/encoders.texi
  2. +15
    -0
      libavcodec/libaomenc.c
  3. +1
    -1
      libavcodec/version.h

+ 9
- 0
doc/encoders.texi View File

@@ -1599,6 +1599,15 @@ Enable the use of global motion for block prediction. Default is true.
Enable block copy mode for intra block prediction. This mode is Enable block copy mode for intra block prediction. This mode is
useful for screen content. Default is true. useful for screen content. Default is true.


@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 @end table


@section libkvazaar @section libkvazaar


+ 15
- 0
libavcodec/libaomenc.c View File

@@ -96,6 +96,9 @@ typedef struct AOMEncoderContext {
int enable_restoration; int enable_restoration;
int usage; int usage;
int tune; int tune;
int enable_rect_partitions;
int enable_1to4_partitions;
int enable_ab_partitions;
} AOMContext; } AOMContext;


static const char *const ctlidstr[] = { static const char *const ctlidstr[] = {
@@ -135,6 +138,9 @@ static const char *const ctlidstr[] = {
#endif #endif
[AV1E_SET_ENABLE_CDEF] = "AV1E_SET_ENABLE_CDEF", [AV1E_SET_ENABLE_CDEF] = "AV1E_SET_ENABLE_CDEF",
[AOME_SET_TUNING] = "AOME_SET_TUNING", [AOME_SET_TUNING] = "AOME_SET_TUNING",
[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) static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc)
@@ -698,6 +704,12 @@ static av_cold int aom_init(AVCodecContext *avctx,
codecctl_int(avctx, AV1E_SET_ENABLE_CDEF, ctx->enable_cdef); codecctl_int(avctx, AV1E_SET_ENABLE_CDEF, ctx->enable_cdef);
if (ctx->enable_restoration >= 0) if (ctx->enable_restoration >= 0)
codecctl_int(avctx, AV1E_SET_ENABLE_RESTORATION, ctx->enable_restoration); 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); codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh);
if (ctx->crf >= 0) if (ctx->crf >= 0)
@@ -1108,6 +1120,9 @@ static const AVOption options[] = {
{ "psnr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AOM_TUNE_PSNR}, 0, 0, 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"}, { "ssim", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AOM_TUNE_SSIM}, 0, 0, VE, "tune"},
FF_AV1_PROFILE_OPTS FF_AV1_PROFILE_OPTS
{ "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 }, { NULL },
}; };




+ 1
- 1
libavcodec/version.h View File

@@ -29,7 +29,7 @@


#define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 93 #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, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \


Loading…
Cancel
Save