[FFmpeg-devel] [PATCH] lavf/qsv_scale: fix green stripe at the bottom

Xiang, Haihao haihao.xiang at intel.com
Wed Dec 2 03:18:11 EET 2020


On Tue, 2020-12-01 at 22:40 +0000, Artem Galin wrote:
> Explicitly set region of interest for input surfaces.
> 
> Signed-off-by: Artem Galin <artem.galin at intel.com>
> ---
>  libavfilter/vf_scale_qsv.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c
> index 5064dcbb60..321adbbb18 100644
> --- a/libavfilter/vf_scale_qsv.c
> +++ b/libavfilter/vf_scale_qsv.c
> @@ -274,7 +274,7 @@ static const mfxHandleType handle_types[] = {
>      MFX_HANDLE_D3D11_DEVICE,
>  };
>  
> -static int init_out_session(AVFilterContext *ctx)
> +static int init_out_session(AVFilterContext *ctx, int in_width, int
> in_height)
>  {
>  
>      QSVScaleContext                   *s = ctx->priv;
> @@ -385,8 +385,11 @@ static int init_out_session(AVFilterContext *ctx)
>                                           sizeof(*s->mem_ids_in));
>          if (!s->mem_ids_in)
>              return AVERROR(ENOMEM);
> -        for (i = 0; i < in_frames_hwctx->nb_surfaces; i++)
> +        for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) {
>              s->mem_ids_in[i] = in_frames_hwctx->surfaces[i].Data.MemId;
> +            in_frames_hwctx->surfaces[i].Info.CropW = in_width;
> +            in_frames_hwctx->surfaces[i].Info.CropH = in_height;
> +        }
>          s->nb_mem_ids_in = in_frames_hwctx->nb_surfaces;
>  
>          s->mem_ids_out = av_mallocz_array(out_frames_hwctx->nb_surfaces,
> @@ -450,7 +453,7 @@ static int init_scale_session(AVFilterContext *ctx, int
> in_width, int in_height,
>      if (ret < 0)
>          return ret;
>  
> -    ret = init_out_session(ctx);
> +    ret = init_out_session(ctx, in_width, in_height);
>      if (ret < 0)
>          return ret;

LGTM, thanks!

>  


More information about the ffmpeg-devel mailing list