forked from HandBrake/HandBrake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA01-qsv-libavfilter-qsvvpp-change-the-output-frame-s-width-a.patch
45 lines (38 loc) · 1.62 KB
/
A01-qsv-libavfilter-qsvvpp-change-the-output-frame-s-width-a.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
From 4157f6515caf9354e41983924898f24cf031366d Mon Sep 17 00:00:00 2001
From: "Chen,Wenbin" <[email protected]>
Date: Tue, 23 Mar 2021 16:24:03 +0800
Subject: [PATCH 66/88] libavfilter/qsvvpp: change the output frame's width and
height
qsvvpp align the width and height with 16, and that right. But qsvvpp asign this value
to frame->width and frame->height, and that may lead to error.
For example, when we use qsvvpp to resize frame to 1080p, qsvvpp will
align frame to 1088 and set frame->height to 1088, which is different from the height of
encoder (1080) and this will be treated as resolution change. The aligend value can
be kept in hw_frame_ctx as it is hardware dependent. Now I
assign the out_link's w/h to output
frame to overwrite the w/h got from hw_frame_ctx.
Signed-off-by: Wenbin Chen <[email protected]>
---
libavfilter/qsvvpp.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index d1218355c7..a44022c90c 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -460,15 +460,14 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink)
if (!out_frame->frame)
return NULL;
- out_frame->frame->width = outlink->w;
- out_frame->frame->height = outlink->h;
-
ret = map_frame_to_surface(out_frame->frame,
&out_frame->surface);
if (ret < 0)
return NULL;
}
+ out_frame->frame->width = outlink->w;
+ out_frame->frame->height = outlink->h;
out_frame->surface.Info = s->vpp_param.vpp.Out;
return out_frame;
--
2.17.1