Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe, Fan F <fan.f.he-at-intel.com@ffmpeg.org>2022-03-21 11:33:14 +0300
committerHaihao Xiang <haihao.xiang@intel.com>2022-04-06 12:12:26 +0300
commitad21f2649200cf88e45b645162a367d8a6907a1f (patch)
tree7cd152a838c4ba2d8fcba891232f19e4e98224f1 /libavcodec/qsvenc.c
parent02111be0c14ee30c2e27a3634c60e278136b5bbd (diff)
libavcodec/qsvenc: enable LowDelayBRC and MaxFrameSizeI/MaxFrameSizeP for more accurate bitrate control
Feature introduction of LowDelayBRC, MaxFrameSizeI and MaxFrameSizeP could be found here: https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md Signed-off-by: Dmitry Ermilov <dmitry.ermilov@intel.com> Signed-off-by: Fan F He <fan.f.he@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r--libavcodec/qsvenc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 55ce3d2499..d7441ac447 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -376,6 +376,13 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q,
#if QSV_VERSION_ATLEAST(1, 16)
av_log(avctx, AV_LOG_VERBOSE, "IntRefCycleDist: %"PRId16"\n", co3->IntRefCycleDist);
#endif
+#if QSV_VERSION_ATLEAST(1, 23)
+ av_log(avctx, AV_LOG_VERBOSE, "LowDelayBRC: %s\n", print_threestate(co3->LowDelayBRC));
+#endif
+#if QSV_VERSION_ATLEAST(1, 19)
+ av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSizeI: %d; ", co3->MaxFrameSizeI);
+ av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSizeP: %d\n", co3->MaxFrameSizeP);
+#endif
}
static void dump_video_vp9_param(AVCodecContext *avctx, QSVEncContext *q,
@@ -991,6 +998,16 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
if (q->int_ref_cycle_dist >= 0)
q->extco3.IntRefCycleDist = q->int_ref_cycle_dist;
#endif
+#if QSV_VERSION_ATLEAST(1, 23)
+ if (q->low_delay_brc >= 0)
+ q->extco3.LowDelayBRC = q->low_delay_brc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
+#endif
+#if QSV_VERSION_ATLEAST(1, 19)
+ if (q->max_frame_size_p >= 0)
+ q->extco3.MaxFrameSizeI = q->max_frame_size_i;
+ if (q->max_frame_size_p >= 0)
+ q->extco3.MaxFrameSizeP = q->max_frame_size_p;
+#endif
}
if (avctx->codec_id == AV_CODEC_ID_HEVC) {