* [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
@ 2022-03-24 17:25 Danil Chapovalov
2022-04-01 9:53 ` Danil Chapovalov
2022-04-05 10:03 ` Anton Khirnov
0 siblings, 2 replies; 10+ messages in thread
From: Danil Chapovalov @ 2022-03-24 17:25 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Danil Chapovalov
---
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,
+ 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,
cx_frame->have_sse ? 3 : 0, pict_type);
if (cx_frame->have_sse) {
--
2.35.1.1021.g381101b075-goog
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-03-24 17:25 [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame Danil Chapovalov
@ 2022-04-01 9:53 ` Danil Chapovalov
2022-04-05 10:03 ` Anton Khirnov
1 sibling, 0 replies; 10+ messages in thread
From: Danil Chapovalov @ 2022-04-01 9:53 UTC (permalink / raw)
To: ffmpeg-devel
[-- Attachment #1.1: Type: text/plain, Size: 1289 bytes --]
Ping
On Thu, Mar 24, 2022 at 6:26 PM Danil Chapovalov <danilchap@google.com> wrote:
>
> ---
> 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,
> + 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,
> cx_frame->have_sse ? 3 : 0, pict_type);
>
> if (cx_frame->have_sse) {
> --
> 2.35.1.1021.g381101b075-goog
>
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4002 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-03-24 17:25 [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame Danil Chapovalov
2022-04-01 9:53 ` Danil Chapovalov
@ 2022-04-05 10:03 ` Anton Khirnov
2022-04-05 12:15 ` Danil Chapovalov
1 sibling, 1 reply; 10+ messages in thread
From: Anton Khirnov @ 2022-04-05 10:03 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Danil Chapovalov
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-04-05 10:03 ` Anton Khirnov
@ 2022-04-05 12:15 ` Danil Chapovalov
2022-04-05 13:55 ` Lynne
2022-04-05 13:59 ` James Almer
0 siblings, 2 replies; 10+ messages in thread
From: Danil Chapovalov @ 2022-04-05 12:15 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Danil Chapovalov
---
libavcodec/libvpxenc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index dff1d06b0e..0705863450 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1250,6 +1250,8 @@ 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;
+ VPxContext *ctx = avctx->priv_data;
if (ret < 0)
return ret;
@@ -1264,7 +1266,12 @@ 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(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality);
+ if (ret != VPX_CODEC_OK) {
+ quality = 0;
+ }
+
+ ff_side_data_set_encoder_stats(pkt, quality * FF_QP2LAMBDA, cx_frame->sse + 1,
cx_frame->have_sse ? 3 : 0, pict_type);
if (cx_frame->have_sse) {
--
2.35.1.1094.g7c7d902a7c-goog
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-04-05 12:15 ` Danil Chapovalov
@ 2022-04-05 13:55 ` Lynne
2022-04-05 13:57 ` James Almer
2022-04-05 13:59 ` James Almer
1 sibling, 1 reply; 10+ messages in thread
From: Lynne @ 2022-04-05 13:55 UTC (permalink / raw)
To: FFmpeg development discussions and patches
5 Apr 2022, 14:15 by danilchap-at-google.com@ffmpeg.org:
> ---
> libavcodec/libvpxenc.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index dff1d06b0e..0705863450 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1250,6 +1250,8 @@ 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;
> + VPxContext *ctx = avctx->priv_data;
>
> if (ret < 0)
> return ret;
> @@ -1264,7 +1266,12 @@ 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(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality);
> + if (ret != VPX_CODEC_OK) {
> + quality = 0;
> + }
>
Fix the coding style.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-04-05 13:55 ` Lynne
@ 2022-04-05 13:57 ` James Almer
2022-04-05 14:20 ` Danil Chapovalov
0 siblings, 1 reply; 10+ messages in thread
From: James Almer @ 2022-04-05 13:57 UTC (permalink / raw)
To: ffmpeg-devel
On 4/5/2022 10:55 AM, Lynne wrote:
> 5 Apr 2022, 14:15 by danilchap-at-google.com@ffmpeg.org:
>
>> ---
>> libavcodec/libvpxenc.c | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
>> index dff1d06b0e..0705863450 100644
>> --- a/libavcodec/libvpxenc.c
>> +++ b/libavcodec/libvpxenc.c
>> @@ -1250,6 +1250,8 @@ 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;
>> + VPxContext *ctx = avctx->priv_data;
>>
>> if (ret < 0)
>> return ret;
>> @@ -1264,7 +1266,12 @@ 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(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality);
>> + if (ret != VPX_CODEC_OK) {
>> + quality = 0;
>> + }
>>
>
> Fix the coding style.
You could just say to remove the brackets for one line statements.
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-04-05 13:57 ` James Almer
@ 2022-04-05 14:20 ` Danil Chapovalov
0 siblings, 0 replies; 10+ messages in thread
From: Danil Chapovalov @ 2022-04-05 14:20 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Danil Chapovalov
---
libavcodec/libvpxenc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index dff1d06b0e..b1d56d99b7 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1250,6 +1250,8 @@ 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;
+ VPxContext *ctx = avctx->priv_data;
if (ret < 0)
return ret;
@@ -1264,7 +1266,10 @@ 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(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality);
+ if (ret != VPX_CODEC_OK)
+ quality = 0;
+ ff_side_data_set_encoder_stats(pkt, quality * FF_QP2LAMBDA, cx_frame->sse + 1,
cx_frame->have_sse ? 3 : 0, pict_type);
if (cx_frame->have_sse) {
--
2.35.1.1094.g7c7d902a7c-goog
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-04-05 12:15 ` Danil Chapovalov
2022-04-05 13:55 ` Lynne
@ 2022-04-05 13:59 ` James Almer
2022-04-05 14:22 ` Danil Chapovalov
1 sibling, 1 reply; 10+ messages in thread
From: James Almer @ 2022-04-05 13:59 UTC (permalink / raw)
To: ffmpeg-devel
On 4/5/2022 9:15 AM, Danil Chapovalov wrote:
> ---
> libavcodec/libvpxenc.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index dff1d06b0e..0705863450 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1250,6 +1250,8 @@ 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;
> + VPxContext *ctx = avctx->priv_data;
>
> if (ret < 0)
> return ret;
> @@ -1264,7 +1266,12 @@ 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(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality);
> + if (ret != VPX_CODEC_OK) {
Is the last argument guaranteed to be untouched when the return value of
vpx_codec_control() is not VPX_CODEC_OK? If so, you can initialize
quality to 0 above, and remove this part.
> + quality = 0;
> + }
> +
> + ff_side_data_set_encoder_stats(pkt, quality * FF_QP2LAMBDA, cx_frame->sse + 1,
> cx_frame->have_sse ? 3 : 0, pict_type);
>
> if (cx_frame->have_sse) {
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-04-05 13:59 ` James Almer
@ 2022-04-05 14:22 ` Danil Chapovalov
2022-04-06 0:16 ` James Zern
0 siblings, 1 reply; 10+ messages in thread
From: Danil Chapovalov @ 2022-04-05 14:22 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1981 bytes --]
I've rechecked documentation for the "vpx_codec_control" - can't find
any guarantee about the last parameter when the function fails, thus
prefer to be on the safe side.
On Tue, Apr 5, 2022 at 3:59 PM James Almer <jamrial@gmail.com> wrote:
>
> On 4/5/2022 9:15 AM, Danil Chapovalov wrote:
> > ---
> > libavcodec/libvpxenc.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index dff1d06b0e..0705863450 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -1250,6 +1250,8 @@ 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;
> > + VPxContext *ctx = avctx->priv_data;
> >
> > if (ret < 0)
> > return ret;
> > @@ -1264,7 +1266,12 @@ 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(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality);
> > + if (ret != VPX_CODEC_OK) {
>
> Is the last argument guaranteed to be untouched when the return value of
> vpx_codec_control() is not VPX_CODEC_OK? If so, you can initialize
> quality to 0 above, and remove this part.
>
> > + quality = 0;
> > + }
> > +
> > + ff_side_data_set_encoder_stats(pkt, quality * FF_QP2LAMBDA, cx_frame->sse + 1,
> > cx_frame->have_sse ? 3 : 0, pict_type);
> >
> > if (cx_frame->have_sse) {
> _______________________________________________
> 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".
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4002 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame
2022-04-05 14:22 ` Danil Chapovalov
@ 2022-04-06 0:16 ` James Zern
0 siblings, 0 replies; 10+ messages in thread
From: James Zern @ 2022-04-06 0:16 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, Apr 5, 2022 at 7:23 AM Danil Chapovalov
<danilchap-at-google.com@ffmpeg.org> wrote:
>
> I've rechecked documentation for the "vpx_codec_control" - can't find
> any guarantee about the last parameter when the function fails, thus
> prefer to be on the safe side.
>
The check is fine, though the function can only fail due to invalid
arguments and won't modify the value in that case.
As an aside, try to avoid top posting on this list:
https://ffmpeg.org/contact.html#MailingLists
> On Tue, Apr 5, 2022 at 3:59 PM James Almer <jamrial@gmail.com> wrote:
> >
> > On 4/5/2022 9:15 AM, Danil Chapovalov wrote:
> > > ---
> > > libavcodec/libvpxenc.c | 9 ++++++++-
> > > 1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > index dff1d06b0e..0705863450 100644
> > > --- a/libavcodec/libvpxenc.c
> > > +++ b/libavcodec/libvpxenc.c
> > > @@ -1250,6 +1250,8 @@ 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;
> > > + VPxContext *ctx = avctx->priv_data;
> > >
> > > if (ret < 0)
> > > return ret;
> > > @@ -1264,7 +1266,12 @@ 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(&ctx->encoder, VP8E_GET_LAST_QUANTIZER_64, &quality);
> > > + if (ret != VPX_CODEC_OK) {
> >
> > Is the last argument guaranteed to be untouched when the return value of
> > vpx_codec_control() is not VPX_CODEC_OK? If so, you can initialize
> > quality to 0 above, and remove this part.
> >
> > > + quality = 0;
> > > + }
> > > +
> > > + ff_side_data_set_encoder_stats(pkt, quality * FF_QP2LAMBDA, cx_frame->sse + 1,
> > > cx_frame->have_sse ? 3 : 0, pict_type);
> > >
> > > if (cx_frame->have_sse) {
> > _______________________________________________
> > 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".
> _______________________________________________
> 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".
_______________________________________________
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".
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-04-06 0:16 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24 17:25 [FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame Danil Chapovalov
2022-04-01 9:53 ` Danil Chapovalov
2022-04-05 10:03 ` Anton Khirnov
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
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