This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0004-qsv-get-FrameInfo.Shift-by-desc-comp-0-.shift.patch
49 lines (42 loc) · 2.23 KB
/
0004-qsv-get-FrameInfo.Shift-by-desc-comp-0-.shift.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From da9530462ec00b1c19ddca9de53d5290df63d279 Mon Sep 17 00:00:00 2001
From: Linjie Fu <[email protected]>
Date: Mon, 18 May 2020 16:32:40 +0800
Subject: [PATCH 1/2] qsv: get FrameInfo.Shift by desc->comp[0].shift
Signed-off-by: Linjie Fu <[email protected]>
---
libavcodec/qsvenc.c | 4 ++--
libavutil/hwcontext_qsv.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index edf3770..0a35bae 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -447,7 +447,7 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q)
q->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth;
q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
- q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8;
+ q->param.mfx.FrameInfo.Shift = desc->comp[0].shift > 0;
q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, 16);
q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, 16);
@@ -549,7 +549,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
!desc->log2_chroma_w + !desc->log2_chroma_h;
q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth;
q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
- q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8;
+ q->param.mfx.FrameInfo.Shift = desc->comp[0].shift > 0;
// If the minor version is greater than or equal to 19,
// then can use the same alignment settings as H.264 for HEVC
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 4306c6e3..5a06e15 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -327,7 +327,7 @@ static int qsv_init_surface(AVHWFramesContext *ctx, mfxFrameSurface1 *surf)
surf->Info.BitDepthLuma = desc->comp[0].depth;
surf->Info.BitDepthChroma = desc->comp[0].depth;
- surf->Info.Shift = desc->comp[0].depth > 8;
+ surf->Info.Shift = desc->comp[0].shift > 0;
if (desc->log2_chroma_w && desc->log2_chroma_h)
surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
--
2.7.4