You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/libvpxenc: enable dynamic max quantizer reconfiguration
Signed-off-by: James Zern <jzern@google.com>
This commit is contained in:
committed by
James Zern
parent
c9ecbc08a1
commit
706f12992d
@@ -1996,8 +1996,11 @@ kilobits/s.
|
||||
@item keyint_min (@emph{kf-min-dist})
|
||||
|
||||
@item qmin (@emph{min-q})
|
||||
Minimum (Best Quality) Quantizer.
|
||||
|
||||
@item qmax (@emph{max-q})
|
||||
Maximum (Worst Quality) Quantizer.
|
||||
Can be changed per-frame.
|
||||
|
||||
@item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
|
||||
Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
|
||||
|
@@ -1629,6 +1629,16 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt,
|
||||
vpx_svc_layer_id_t layer_id;
|
||||
int layer_id_valid = 0;
|
||||
|
||||
if (avctx->qmax >= 0 && enccfg->rc_max_quantizer != avctx->qmax) {
|
||||
struct vpx_codec_enc_cfg cfg = *enccfg;
|
||||
cfg.rc_max_quantizer = avctx->qmax;
|
||||
res = vpx_codec_enc_config_set(&ctx->encoder, &cfg);
|
||||
if (res != VPX_CODEC_OK) {
|
||||
log_encoder_error(avctx, "Error reconfiguring encoder");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
if (frame) {
|
||||
const AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_REGIONS_OF_INTEREST);
|
||||
rawimg = &ctx->rawimg;
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MINOR 25
|
||||
#define LIBAVCODEC_VERSION_MICRO 100
|
||||
#define LIBAVCODEC_VERSION_MICRO 101
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
LIBAVCODEC_VERSION_MINOR, \
|
||||
|
Reference in New Issue
Block a user