Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Dariusz Marcinkiewicz via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: James Zern <jzern@google.com>
Cc: "Dariusz Marcinkiewicz" <darekm@google.com>,
	"Erik Språng" <sprang@webrtc.org>,
	"FFmpeg development discussions and patches"
	<ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v3] lavc/libvpxenc: add screen-content-mode option
Date: Sat, 10 Feb 2024 09:28:01 +0100
Message-ID: <CALFZZQGFAN0VqMQ+YuwMCur51NXuywuhFGu5E5VTOoqbQAr07g@mail.gmail.com> (raw)
In-Reply-To: <CABWgkXJrVNVN-nr362toAcV-GpSJUMN7K3+DqRKfMxatynGs1w@mail.gmail.com>

Hello.

On Fri, Feb 9, 2024 at 7:28 PM James Zern <jzern@google.com> wrote:
>
Just sent v4, which addresses the below comments.
Thank you.

> On Thu, Feb 8, 2024 at 1:58 PM Dariusz Marcinkiewicz via ffmpeg-devel
> <ffmpeg-devel@ffmpeg.org> wrote:
...
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -114,6 +114,7 @@ typedef struct VPxEncoderContext {
> >      int crf;
> >      int static_thresh;
> >      int max_intra_rate;
> > +    int screen_content_mode;
>
> Move this to a VP8-only section similar to VP9.
>

Done.

...
> > @@ -164,6 +165,7 @@ static const char *const ctlidstr[] = {
...
> > +#ifdef VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
>
> This control was available in libvpx 1.4.0, the minimum version
> supported. You can remove this check.
>
Done.

...
> > +    if (avctx->codec_id == AV_CODEC_ID_VP8 && ctx->screen_content_mode >= 0) {
> > +      if (ctx->screen_content_mode == 2 && ctx->is_alpha) {
>
> Indent is 4 spaces here and throughout the patch.
>
Done.

> > [...]
> >
> > -    coded_size = queue_frames(avctx, &ctx->encoder, &ctx->coded_frame_list, pkt);
> > +    coded_size = queue_frames(avctx, &ctx->encoder, &ctx->coded_frame_list,
> > +                              pkt, ctx->is_alpha, &frame_enc);
> > +    if (avctx->codec_id == AV_CODEC_ID_VP8 && frame_enc == 0 &&
> > +        ctx->screen_content_mode == 2 && frame) {
> > +        // VP8 tuned for screen content with aggresive rate control - returned
>
> aggressive.
>
> > +        // OK status code but produced no output, this indicates frame was
> > +        // rolled back due to bitrate overshoot - try to encode it again.
>
> This is a little weird given there's no adjustment to the encoder. I
> think this should be a separate patch at least. If the encoder decided
> to drop the frame in this mode it seems like the right decision given
> the setting description. If it works as part of the drop frames
> threshold then maybe the recode should be in the library based on some
> threshold.
>
Dropped this part.

...
> > [...]
> > @@ -1946,6 +1987,12 @@ static const AVOption vp8_options[] = {
> >      { "auto-alt-ref",    "Enable use of alternate reference "
> >                           "frames (2-pass only)",                        OFFSET(auto_alt_ref),    AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE},
> >      { "cpu-used",        "Quality/Speed ratio modifier",                OFFSET(cpu_used),        AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE},
> > +#ifdef VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
> > +    { "screen-content-mode",     "Encoder screen content mode",         OFFSET(screen_content_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE, "screen_content_mode"},
> > +    { "off",          "Screen content mode off",                        0,                      AV_OPT_TYPE_CONST, {.i64 = 0}, 0,  0, VE, "screen_content_mode"},
> > +    { "on",           "Screen content mode on",                         0,                      AV_OPT_TYPE_CONST, {.i64 = 1}, 0,  0, VE, "screen_content_mode"},
> > +    { "on-agressive-rate-control", "Screen content mode on with aggressive rate control", 0,    AV_OPT_TYPE_CONST, {.i64 = 2}, 0,  0, VE, "screen_content_mode"},
>
> aggressive.
> There's no string equivalent in vpxenc though, so this should probably
> just be ints.
>
Removed.

...
> > diff --git a/libavcodec/version.h b/libavcodec/version.h
> > index 0fae3d06d3..4b618d740f 100644
> > --- a/libavcodec/version.h
> > +++ b/libavcodec/version.h
> > @@ -30,7 +30,7 @@
> >  #include "version_major.h"
> >
> >  #define LIBAVCODEC_VERSION_MINOR  38
> > -#define LIBAVCODEC_VERSION_MICRO 100
> > +#define LIBAVCODEC_VERSION_MICRO 101
> >
>
> This will need a rebase.
Done.
_______________________________________________
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".

  parent reply	other threads:[~2024-02-10  8:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 16:23 [FFmpeg-devel] [PATCH v2] libavcodec: add tune_content option also for VP8 Dariusz Marcinkiewicz via ffmpeg-devel
2024-02-07 16:03 ` Dariusz Marcinkiewicz via ffmpeg-devel
2024-02-08  6:13   ` James Zern via ffmpeg-devel
2024-02-08 21:56     ` [FFmpeg-devel] [PATCH v3] lavc/libvpxenc: add screen-content-mode option Dariusz Marcinkiewicz via ffmpeg-devel
2024-02-09 18:28       ` James Zern via ffmpeg-devel
2024-02-10  8:21         ` [FFmpeg-devel] [PATCH v4] " Dariusz Marcinkiewicz via ffmpeg-devel
2024-02-12 23:12           ` James Zern via ffmpeg-devel
2024-02-13  6:34             ` [FFmpeg-devel] [PATCH v5] " Dariusz Marcinkiewicz via ffmpeg-devel
2024-02-14  3:26               ` James Zern via ffmpeg-devel
2024-02-16  3:12                 ` James Zern via ffmpeg-devel
2024-02-14  2:24             ` [FFmpeg-devel] [PATCH v4] " Dariusz Marcinkiewicz via ffmpeg-devel
2024-02-10  8:28         ` Dariusz Marcinkiewicz via ffmpeg-devel [this message]
2024-02-08 22:00     ` [FFmpeg-devel] [PATCH v2] libavcodec: add tune_content option also for VP8 Dariusz Marcinkiewicz via ffmpeg-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALFZZQGFAN0VqMQ+YuwMCur51NXuywuhFGu5E5VTOoqbQAr07g@mail.gmail.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=darekm@google.com \
    --cc=jzern@google.com \
    --cc=sprang@webrtc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git