[FFmpeg-devel] [PATCH] avcodec/libvpxenc: return quantizer parameter for an encoded frame

James Almer jamrial at gmail.com
Tue Apr 5 16:57:26 EEST 2022



On 4/5/2022 10:55 AM, Lynne wrote:
> 5 Apr 2022, 14:15 by danilchap-at-google.com at 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.


More information about the ffmpeg-devel mailing list