Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Danil Chapovalov <danilchap@google.com>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
Date: Tue, 05 Apr 2022 12:03:09 +0200
Message-ID: <164915298959.21047.64072881760748019@lain.red.khirnov.net> (raw)
In-Reply-To: <20220324172524.1191986-1-danilchap@google.com>

Quoting Danil Chapovalov (2022-03-24 18:25:24)
> ---
>  libavcodec/libvpxenc.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index dff1d06b0e..5db31db5dc 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1250,6 +1250,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
>      int ret = ff_get_encode_buffer(avctx, pkt, cx_frame->sz, 0);
>      uint8_t *side_data;
>      int pict_type;
> +    int quality;
>  
>      if (ret < 0)
>          return ret;
> @@ -1264,7 +1265,13 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
>          pict_type = AV_PICTURE_TYPE_P;
>      }
>  
> -    ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1,
> +    ret = vpx_codec_control(&((VPxContext *)avctx->priv_data)->encoder,

The cast is really ugly, just add a local variable for priv_data.

> +                            VP8E_GET_LAST_QUANTIZER_64, &quality);
> +    if (ret != VPX_CODEC_OK) {
> +        quality = 0;
> +    }
> +
> +    ff_side_data_set_encoder_stats(pkt, quality, cx_frame->sse + 1,

other encoders multiply the quantizer by FF_QP2LAMBDA

-- 
Anton Khirnov
_______________________________________________
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:[~2022-04-05 10:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 17:25 Danil Chapovalov
2022-04-01  9:53 ` Danil Chapovalov
2022-04-05 10:03 ` Anton Khirnov [this message]
2022-04-05 12:15   ` Danil Chapovalov
2022-04-05 13:55     ` Lynne
2022-04-05 13:57       ` James Almer
2022-04-05 14:20         ` Danil Chapovalov
2022-04-05 13:59     ` James Almer
2022-04-05 14:22       ` Danil Chapovalov
2022-04-06  0:16         ` James Zern

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=164915298959.21047.64072881760748019@lain.red.khirnov.net \
    --to=anton@khirnov.net \
    --cc=danilchap@google.com \
    --cc=ffmpeg-devel@ffmpeg.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