diff mbox series

[FFmpeg-devel,3/5] libavcodec/libaomenc.c: Add command-line options for intra-coding tools

Message ID 20200626005516.678811-3-wangcao@google.com
State Accepted
Headers show
Series [FFmpeg-devel,1/5] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Wang Cao June 26, 2020, 12:55 a.m. UTC
Signed-off-by: Wang Cao <wangcao@google.com>
---
 doc/encoders.texi      | 21 +++++++++++++++++++
 libavcodec/libaomenc.c | 47 ++++++++++++++++++++++++++++++++++++------
 libavcodec/version.h   |  2 +-
 3 files changed, 63 insertions(+), 7 deletions(-)

Comments

James Zern June 29, 2020, 6:15 p.m. UTC | #1
On Thu, Jun 25, 2020 at 5:55 PM Wang Cao <doubleecao@gmail.com> wrote:
>
> Signed-off-by: Wang Cao <wangcao@google.com>
> ---
>  doc/encoders.texi      | 21 +++++++++++++++++++
>  libavcodec/libaomenc.c | 47 ++++++++++++++++++++++++++++++++++++------
>  libavcodec/version.h   |  2 +-
>  3 files changed, 63 insertions(+), 7 deletions(-)
>

lgtm.
James Zern July 1, 2020, 6:57 p.m. UTC | #2
On Mon, Jun 29, 2020 at 11:15 AM James Zern <jzern@google.com> wrote:
>
> On Thu, Jun 25, 2020 at 5:55 PM Wang Cao <doubleecao@gmail.com> wrote:
> >
> > Signed-off-by: Wang Cao <wangcao@google.com>
> > ---
> >  doc/encoders.texi      | 21 +++++++++++++++++++
> >  libavcodec/libaomenc.c | 47 ++++++++++++++++++++++++++++++++++++------
> >  libavcodec/version.h   |  2 +-
> >  3 files changed, 63 insertions(+), 7 deletions(-)
> >
>
> lgtm.

applied, thanks.
James Almer July 1, 2020, 11:39 p.m. UTC | #3
On 7/1/2020 3:57 PM, James Zern wrote:
> On Mon, Jun 29, 2020 at 11:15 AM James Zern <jzern@google.com> wrote:
>>
>> On Thu, Jun 25, 2020 at 5:55 PM Wang Cao <doubleecao@gmail.com> wrote:
>>>
>>> Signed-off-by: Wang Cao <wangcao@google.com>
>>> ---
>>>  doc/encoders.texi      | 21 +++++++++++++++++++
>>>  libavcodec/libaomenc.c | 47 ++++++++++++++++++++++++++++++++++++------
>>>  libavcodec/version.h   |  2 +-
>>>  3 files changed, 63 insertions(+), 7 deletions(-)
>>>
>>
>> lgtm.
> 
> applied, thanks.

Are all these options available in 1.0.0? If not, then they need to be
wrapped in a pre-processor check like the other newer options.

I did not remove support for 1.0.0 since that's what Debian, Ubuntu and
other distros with LTS releases ship, and nobody (other than you)
commented when i asked what direction we should take.
James Zern July 2, 2020, 2:21 a.m. UTC | #4
On Wed, Jul 1, 2020 at 4:39 PM James Almer <jamrial@gmail.com> wrote:
>
> On 7/1/2020 3:57 PM, James Zern wrote:
> > On Mon, Jun 29, 2020 at 11:15 AM James Zern <jzern@google.com> wrote:
> >>
> >> On Thu, Jun 25, 2020 at 5:55 PM Wang Cao <doubleecao@gmail.com> wrote:
> >>>
> >>> Signed-off-by: Wang Cao <wangcao@google.com>
> >>> ---
> >>>  doc/encoders.texi      | 21 +++++++++++++++++++
> >>>  libavcodec/libaomenc.c | 47 ++++++++++++++++++++++++++++++++++++------
> >>>  libavcodec/version.h   |  2 +-
> >>>  3 files changed, 63 insertions(+), 7 deletions(-)
> >>>
> >>
> >> lgtm.
> >
> > applied, thanks.
>
> Are all these options available in 1.0.0? If not, then they need to be
> wrapped in a pre-processor check like the other newer options.
>

You're right, I had thought these made it to the normative branch, my
mistake. I'll send a patch.

> I did not remove support for 1.0.0 since that's what Debian, Ubuntu and
> other distros with LTS releases ship, and nobody (other than you)
> commented when i asked what direction we should take.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

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, \