[FFmpeg-cvslog] Merge commit 'f8060865f3e1a16c62e0d337ef0979b6ee4ba457'
James Almer
git at videolan.org
Mon Sep 3 01:17:47 EEST 2018
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Sep 2 19:12:18 2018 -0300| [aebc5b2284db1f40a5b3e2e9a2bf406f606436c7] | committer: James Almer
Merge commit 'f8060865f3e1a16c62e0d337ef0979b6ee4ba457'
* commit 'f8060865f3e1a16c62e0d337ef0979b6ee4ba457':
qsvenc: use the compression_level to replace private option
Merged-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aebc5b2284db1f40a5b3e2e9a2bf406f606436c7
---
libavcodec/qsvenc.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 3c82173379..3053dd1a06 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -453,8 +453,19 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
if (avctx->level > 0)
q->param.mfx.CodecLevel = avctx->level;
+ if (avctx->compression_level == FF_COMPRESSION_DEFAULT) {
+ avctx->compression_level = q->preset;
+ } else if (avctx->compression_level >= 0) {
+ if (avctx->compression_level > MFX_TARGETUSAGE_BEST_SPEED) {
+ av_log(avctx, AV_LOG_WARNING, "Invalid compression level: "
+ "valid range is 0-%d, using %d instead\n",
+ MFX_TARGETUSAGE_BEST_SPEED, MFX_TARGETUSAGE_BEST_SPEED);
+ avctx->compression_level = MFX_TARGETUSAGE_BEST_SPEED;
+ }
+ }
+
q->param.mfx.CodecProfile = q->profile;
- q->param.mfx.TargetUsage = q->preset;
+ q->param.mfx.TargetUsage = avctx->compression_level;
q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size);
q->param.mfx.GopRefDist = FFMAX(-1, avctx->max_b_frames) + 1;
q->param.mfx.GopOptFlag = avctx->flags & AV_CODEC_FLAG_CLOSED_GOP ?
======================================================================
More information about the ffmpeg-cvslog
mailing list