Message ID | 20220317190734.3871376-1-danilchap@google.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] avcodec/libvpxenc: enable dynamic max quantizer parameter reconfiguration | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_aarch64_jetson | success | Make finished |
andriy/make_fate_aarch64_jetson | success | Make fate finished |
andriy/make_armv7_RPi4 | success | Make finished |
andriy/make_fate_armv7_RPi4 | success | Make fate finished |
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 8f94ba15dc..4735e57620 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -44,6 +44,7 @@ #include "libavutil/mathematics.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" +#include "libavutil/video_enc_params.h" /** * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h. @@ -1698,6 +1699,14 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, } } + sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_ENC_PARAMS); + if (sd) { + const AVVideoEncParams* enc_params = sd->data; + struct vpx_codec_enc_cfg cfg = *enccfg; + cfg.rc_max_quantizer = enc_params->qp; + vpx_codec_enc_config_set(&ctx->encoder, &cfg); + } + if (ctx->hdr10_plus_fifo) { AVFrameSideData *hdr10_plus_metadata; // Add HDR10+ metadata to queue.