]> git.sesse.net Git - ffmpeg/commitdiff
lavc/qsvenc: add an option to set h264 pps for every frame
authorZhong Li <zhong.li@intel.com>
Thu, 25 Oct 2018 11:14:16 +0000 (19:14 +0800)
committerZhong Li <zhong.li@intel.com>
Fri, 7 Dec 2018 09:13:36 +0000 (17:13 +0800)
RepeatPPS is enabled by default in mfx. It is not necessary mostly and
wasting encoding bits.
Add an option to control it and disable it by default.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Zhong Li <zhong.li@intel.com>
libavcodec/qsvenc.c
libavcodec/qsvenc.h
libavcodec/qsvenc_h264.c
libavcodec/version.h

index 48bfec70c4b4e753bbc99391717a7b7982f80f5e..53ba7cad15f649bdf9d1526ead82b1bb72bcf763 100644 (file)
@@ -654,6 +654,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
 #if QSV_VERSION_ATLEAST(1, 8)
             q->extco2.LookAheadDS = q->look_ahead_downsampling;
+            q->extco2.RepeatPPS   = q->repeat_pps ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
 
 #if FF_API_PRIVATE_OPT
 FF_DISABLE_DEPRECATION_WARNINGS
index fbdc19900d4a2579859f0667fc104d14a45c5013..4316a101cafc36b82aa7a4c9d0c081a56fc69653 100644 (file)
@@ -162,6 +162,8 @@ typedef struct QSVEncContext {
     int int_ref_qp_delta;
     int recovery_point_sei;
 
+    int repeat_pps;
+
     int a53_cc;
 
 #if QSV_HAVE_MF
index 07c9d64e6b81f47d5f90dde00ef5a5abc4616ac2..8e61826eef4170b05141b5e8d9394d599b498add 100644 (file)
@@ -154,6 +154,8 @@ static const AVOption options[] = {
     { "auto"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_AUTO     }, INT_MIN, INT_MAX,     VE, "mfmode" },
 #endif
 
+    { "repeat_pps", "repeat pps for every frame", OFFSET(qsv.repeat_pps), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+
     { NULL },
 };
 
index f7580935824752e732e7e82450a860c5699ffa67..372a6f45b4a89137e0da8693494e7551cdb6edd6 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  41
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \