From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 09B394285D for ; Tue, 5 Apr 2022 10:03:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 32E1F68B0D6; Tue, 5 Apr 2022 13:03:16 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 59F1D68AE7C for ; Tue, 5 Apr 2022 13:03:10 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C8A4E240179; Tue, 5 Apr 2022 12:03:09 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id PngHb3a0rfYZ; Tue, 5 Apr 2022 12:03:09 +0200 (CEST) Received: from lain.red.khirnov.net (lain.red.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.red.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 509D12400F5; Tue, 5 Apr 2022 12:03:09 +0200 (CEST) Received: by lain.red.khirnov.net (Postfix, from userid 1000) id 9780C1601AD; Tue, 5 Apr 2022 12:03:09 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20220324172524.1191986-1-danilchap@google.com> References: <20220324172524.1191986-1-danilchap@google.com> Mail-Followup-To: FFmpeg development discussions and patches , Danil Chapovalov Date: Tue, 05 Apr 2022 12:03:09 +0200 Message-ID: <164915298959.21047.64072881760748019@lain.red.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Danil Chapovalov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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".