This was added in libva 2.1.0 (VAAPI 1.1.0). Use AVCodecContext.qmax, matching the existing behaviour for qmin, and clean up the defaults so that we only pass min/max when explicitly set.
Showing the changes to libavcodec/vaapi_encode.c (1 of 7 files). Show all
Unified · Split
| @@ -1436,6 +1436,9 @@ static av_cold int vaapi_encode_init_rate_control(AVCodecContext *avctx) · 1435 unmodified lines | ||
| 1436 | 1436 | .initial_qp = 0, |
| 1437 | 1437 | .min_qp = (avctx->qmin > 0 ? avctx->qmin : 0), |
| 1438 | 1438 | .basic_unit_size = 0, |
| 1439 | +#if VA_CHECK_VERSION(1, 1, 0) | |
| 1440 | + .max_qp = (avctx->qmax > 0 ? avctx->qmax : 0), | |
| 1441 | +#endif | |
| 1439 | 1442 | }; |
| 1440 | 1443 | vaapi_encode_add_global_param(avctx, &ctx->rc_params.misc, |
| 1441 | 1444 | sizeof(ctx->rc_params)); |