aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_qsv.c
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2018-03-06 10:35:56 +0800
committerLuca Barbato <lu_zero@gentoo.org>2018-03-21 08:42:47 +0100
commit86499771d1228d8303c8eb6509e20c0caaa02da5 (patch)
tree4470d472c9fd032ad669d5bbb8e29bfb10686733 /libavutil/hwcontext_qsv.c
parentea2f72a2c14c67a3b35dac6426d1e3c0fae33fd5 (diff)
downloadffmpeg-86499771d1228d8303c8eb6509e20c0caaa02da5.tar.gz
qsv: align surface width/height to 16.
Per MediaSDK documentation, it requires width/height to 16 alignment. Without this patch, hwupload pipeline may fail if 16 alignment is not met. Although this patch also apply 16 alignment to qsv encoder/decoder, it will not bring any side-effect to them as they are already aligned. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavutil/hwcontext_qsv.c')
-rw-r--r--libavutil/hwcontext_qsv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 73b5f2467c..f5d78d0595 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -234,8 +234,8 @@ static int qsv_init_child_ctx(AVHWFramesContext *ctx)
child_frames_ctx->format = device_priv->child_pix_fmt;
child_frames_ctx->sw_format = ctx->sw_format;
child_frames_ctx->initial_pool_size = ctx->initial_pool_size;
- child_frames_ctx->width = ctx->width;
- child_frames_ctx->height = ctx->height;
+ child_frames_ctx->width = FFALIGN(ctx->width, 16);
+ child_frames_ctx->height = FFALIGN(ctx->height, 16);
#if CONFIG_DXVA2
if (child_device_ctx->type == AV_HWDEVICE_TYPE_DXVA2) {
@@ -307,9 +307,9 @@ static int qsv_init_surface(AVHWFramesContext *ctx, mfxFrameSurface1 *surf)
surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
surf->Info.FourCC = fourcc;
- surf->Info.Width = ctx->width;
+ surf->Info.Width = FFALIGN(ctx->width, 16);
surf->Info.CropW = ctx->width;
- surf->Info.Height = ctx->height;
+ surf->Info.Height = FFALIGN(ctx->height, 16);
surf->Info.CropH = ctx->height;
surf->Info.FrameRateExtN = 25;
surf->Info.FrameRateExtD = 1;