Message ID | 20201201224008.19787-1-artem.galin@intel.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] lavf/qsv_scale: fix green stripe at the bottom | expand |
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 |
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@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! >
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;
Explicitly set region of interest for input surfaces. Signed-off-by: Artem Galin <artem.galin@intel.com> --- libavfilter/vf_scale_qsv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)