From 548c3d341f10499a558867783f22dcb7978edf6e Mon Sep 17 00:00:00 2001
In-Reply-To: <20200120094956.154224-1-jon.cook@cubicmotion.com>
References: <20200120094956.154224-1-jon.cook@cubicmotion.com>
From: JonCookCubic <jon.cook@cubicmotion.com>
Date: Tue, 21 Jan 2020 12:04:34 +0000
Subject: [PATCH] libavcodec/qsvenc.c: Set height and width alignment when
 using mjpeg_qsv

Setting FrameInfo.Width and Height as per review comments

Signed-off-by: JonCookCubic <jon.cook@cubicmotion.com>
---
 libavcodec/qsvenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 9e416500e9..40904af388 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -470,6 +470,12 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q)
     q->param.mfx.Quality              = av_clip(avctx->global_quality, 1, 100);
     q->param.mfx.RestartInterval      = 0;
 
+    q->width_align = 16;
+    q->height_align = 16;
+
+    q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, q->width_align);
+    q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, q->height_align);
+
     return 0;
 }
 
-- 
2.20.1.windows.1

