diff mbox series

[FFmpeg-devel,V3] libavfilter/qsvvpp: change the output frame's width and height

Message ID 20210329052814.3295553-1-wenbin.chen@intel.com
State New
Headers show
Series [FFmpeg-devel,V3] libavfilter/qsvvpp: change the output frame's width and height
Related show


Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Chen, Wenbin March 29, 2021, 5:28 a.m. UTC
From: "Chen,Wenbin" <wenbin.chen@intel.com>

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 <wenbin.chen@intel.com>
 libavfilter/qsvvpp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series


diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index f216b3f248..70d6cb49e3 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -486,9 +486,6 @@  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,
         if (ret < 0)
@@ -497,6 +494,8 @@  static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink)
         out_frame->surface = &out_frame->surface_internal;
+    out_frame->frame->width  = outlink->w;
+    out_frame->frame->height = outlink->h;
     out_frame->surface->Info = s->vpp_param.vpp.Out;
     return out_frame;