mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
vaapi_encode: Add flag to mark encoders supporting only constant-quality
And set it for MJPEG.
This commit is contained in:
parent
a7eda762dc
commit
fef2162b6e
@ -1277,7 +1277,8 @@ static av_cold int vaapi_encode_init_rate_control(AVCodecContext *avctx)
|
|||||||
ctx->va_rc_mode = VA_RC_CQP;
|
ctx->va_rc_mode = VA_RC_CQP;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (avctx->flags & AV_CODEC_FLAG_QSCALE ||
|
if (ctx->codec->flags & FLAG_CONSTANT_QUALITY_ONLY ||
|
||||||
|
avctx->flags & AV_CODEC_FLAG_QSCALE ||
|
||||||
avctx->bit_rate <= 0) {
|
avctx->bit_rate <= 0) {
|
||||||
if (rc_attr.value & VA_RC_CQP) {
|
if (rc_attr.value & VA_RC_CQP) {
|
||||||
av_log(avctx, AV_LOG_VERBOSE, "Using constant-quality mode.\n");
|
av_log(avctx, AV_LOG_VERBOSE, "Using constant-quality mode.\n");
|
||||||
|
@ -251,6 +251,8 @@ typedef struct VAAPIEncodeContext {
|
|||||||
enum {
|
enum {
|
||||||
// Codec supports controlling the subdivision of pictures into slices.
|
// Codec supports controlling the subdivision of pictures into slices.
|
||||||
FLAG_SLICE_CONTROL = 1 << 0,
|
FLAG_SLICE_CONTROL = 1 << 0,
|
||||||
|
// Codec only supports constant quality (no rate control).
|
||||||
|
FLAG_CONSTANT_QUALITY_ONLY = 1 << 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct VAAPIEncodeType {
|
typedef struct VAAPIEncodeType {
|
||||||
|
@ -476,6 +476,8 @@ static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = {
|
|||||||
static const VAAPIEncodeType vaapi_encode_type_mjpeg = {
|
static const VAAPIEncodeType vaapi_encode_type_mjpeg = {
|
||||||
.profiles = vaapi_encode_mjpeg_profiles,
|
.profiles = vaapi_encode_mjpeg_profiles,
|
||||||
|
|
||||||
|
.flags = FLAG_CONSTANT_QUALITY_ONLY,
|
||||||
|
|
||||||
.configure = &vaapi_encode_mjpeg_configure,
|
.configure = &vaapi_encode_mjpeg_configure,
|
||||||
|
|
||||||
.picture_params_size = sizeof(VAEncPictureParameterBufferJPEG),
|
.picture_params_size = sizeof(VAEncPictureParameterBufferJPEG),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user