aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhong Li <zhong.li@intel.com>2019-03-27 19:33:37 +0800
committerZhong Li <zhong.li@intel.com>2019-03-28 21:50:01 +0800
commitb9a066ae23cbf488faf332cbfd101a3af5b77611 (patch)
tree6dc3d6be1589fa8391b8c00ef1e40283825ecbff
parent4131b0619c22cc0da29e95ea16b2970e2e3a566e (diff)
downloadffmpeg-b9a066ae23cbf488faf332cbfd101a3af5b77611.tar.gz
lavc/qsvenc: use the common option "trellis" of AVCodecContext
Signed-off-by: Zhong Li <zhong.li@intel.com>
-rw-r--r--libavcodec/qsvenc.c5
-rw-r--r--libavcodec/qsvenc_h264.c2
-rw-r--r--libavcodec/qsvenc_hevc.c2
-rw-r--r--libavcodec/qsvenc_mpeg2.c2
4 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 9091772687..a6641f68fc 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -683,7 +683,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif
#if QSV_HAVE_TRELLIS
- q->extco2.Trellis = q->trellis;
+ if (avctx->trellis >= 0)
+ q->extco2.Trellis = (avctx->trellis == 0) ? MFX_TRELLIS_OFF : (MFX_TRELLIS_I | MFX_TRELLIS_P | MFX_TRELLIS_B);
+ else
+ q->extco2.Trellis = MFX_TRELLIS_UNKNOWN;
#endif
#if QSV_VERSION_ATLEAST(1, 8)
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index f458137848..4fea69fb2c 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -181,7 +181,7 @@ static const AVCodecDefault qsv_enc_defaults[] = {
#if FF_API_CODER_TYPE
{ "coder", "-1" },
#endif
-
+ { "trellis", "-1" },
{ "flags", "+cgop" },
#if FF_API_PRIVATE_OPT
{ "b_strategy", "-1" },
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index 1c615b4e81..d2e5432f99 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -254,7 +254,7 @@ static const AVCodecDefault qsv_enc_defaults[] = {
// same as the x264 default
{ "g", "248" },
{ "bf", "8" },
-
+ { "trellis", "-1" },
{ "flags", "+cgop" },
#if FF_API_PRIVATE_OPT
{ "b_strategy", "-1" },
diff --git a/libavcodec/qsvenc_mpeg2.c b/libavcodec/qsvenc_mpeg2.c
index a7427d8109..e4ade56d62 100644
--- a/libavcodec/qsvenc_mpeg2.c
+++ b/libavcodec/qsvenc_mpeg2.c
@@ -87,7 +87,7 @@ static const AVCodecDefault qsv_enc_defaults[] = {
// same as the x264 default
{ "g", "250" },
{ "bf", "3" },
-
+ { "trellis", "-1" },
{ "flags", "+cgop" },
#if FF_API_PRIVATE_OPT
{ "b_strategy", "-1" },