@@ -217,8 +217,10 @@ static void dump_video_param(AVCodecContext *avctx, QSVEncContext *q,
#if QSV_HAVE_CO2
av_log(avctx, AV_LOG_VERBOSE,
- "RecoveryPointSEI: %s IntRefType: %"PRIu16"; IntRefCycleSize: %"PRIu16"; IntRefQPDelta: %"PRId16"\n",
- print_threestate(co->RecoveryPointSEI), co2->IntRefType, co2->IntRefCycleSize, co2->IntRefQPDelta);
+ "RecoveryPointSEI: %s IntRefType: %"PRIu16"; IntRefCycleSize: %"PRIu16
+ "; IntRefQPDelta: %"PRId16"; IntRefCycleDist: %"PRId16"\n",
+ print_threestate(co->RecoveryPointSEI), co2->IntRefType, co2->IntRefCycleSize,
+ co2->IntRefQPDelta, co3->IntRefCycleDist);
av_log(avctx, AV_LOG_VERBOSE, "MaxFrameSize: %d; ", co2->MaxFrameSize);
#if QSV_HAVE_MAX_SLICE_SIZE
@@ -822,6 +824,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_log(avctx, AV_LOG_WARNING, "Please set max_b_frames(-bf) to 0 to enable P-pyramid\n");
}
+#if QSV_VERSION_ATLEAST(1, 16)
+ if (avctx->codec_id == AV_CODEC_ID_H264) {
+ if (q->int_ref_cycle_dist)
+ q->extco3.IntRefCycleDist = q->int_ref_cycle_dist;
+ }
+#endif
+
if (avctx->codec_id == AV_CODEC_ID_HEVC) {
#if QSV_VERSION_ATLEAST(1, 26)
q->extco3.TransformSkip = q->transform_skip ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
@@ -192,6 +192,7 @@ typedef struct QSVEncContext {
int int_ref_type;
int int_ref_cycle_size;
int int_ref_qp_delta;
+ int int_ref_cycle_dist;
int recovery_point_sei;
int repeat_pps;
@@ -129,10 +129,13 @@ static const AVOption options[] = {
{ "int_ref_type", "Intra refresh type", OFFSET(qsv.int_ref_type), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE, "int_ref_type" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, .flags = VE, "int_ref_type" },
{ "vertical", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .flags = VE, "int_ref_type" },
+ { "horizontal", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, .flags = VE, "int_ref_type" },
{ "int_ref_cycle_size", "Number of frames in the intra refresh cycle", OFFSET(qsv.int_ref_cycle_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE },
{ "int_ref_qp_delta", "QP difference for the refresh MBs", OFFSET(qsv.int_ref_qp_delta), AV_OPT_TYPE_INT, { .i64 = INT16_MIN }, INT16_MIN, INT16_MAX, VE },
{ "recovery_point_sei", "Insert recovery point SEI messages", OFFSET(qsv.recovery_point_sei), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE },
-
+#if QSV_VERSION_ATLEAST(1, 16)
+ { "int_ref_cycle_dist", "Distance between the beginnings of the intra-refresh cycles in frames", OFFSET(qsv.int_ref_cycle_dist), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT16_MAX, VE },
+#endif
{ "profile", NULL, OFFSET(qsv.profile), AV_OPT_TYPE_INT, { .i64 = MFX_PROFILE_UNKNOWN }, 0, INT_MAX, VE, "profile" },
{ "unknown" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
{ "baseline", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },