On 29/11/16 09:07, Anton Khirnov wrote:
> Quoting Mark Thompson (2016-11-25 00:27:11)
>> ---
>> Tested somewhat on Skylake GT2 and Polaris 11; on both it comes up with 
>> something which looks pretty plausible.
>>
>> I'm not exactly a connoisseur of interlaced video, though, so it might be 
>> helpful if someone with that particular affectation and a healthy selection 
>> of evil sample cases could have a go with it.
>>
>> ./avconv -y -vaapi_device /dev/dri/renderD128 -hwaccel vaapi 
>> -hwaccel_output_format vaapi -i in.mp4 -an -vf 
>> 'deinterlace_vaapi=motion_adaptive' -c:v h264_vaapi -qp 12 out.mp4
>>
>>
>>  configure                          |   1 +
>>  libavfilter/Makefile               |   1 +
>>  libavfilter/allfilters.c           |   1 +
>>  libavfilter/version.h              |   2 +-
>>  libavfilter/vf_deinterlace_vaapi.c | 602 
>> +++++++++++++++++++++++++++++++++++++
>>  5 files changed, 606 insertions(+), 1 deletion(-)
>>  create mode 100644 libavfilter/vf_deinterlace_vaapi.c
>>
>> ...
>> +    vas = vaQueryVideoProcPipelineCaps(ctx->hwctx->display,
>> +                                       ctx->va_context,
>> +                                       &ctx->filter_buffer, 1,
>> +                                       &ctx->pipeline_caps);
>> +    if (vas != VA_STATUS_SUCCESS) {
>> +        av_log(avctx, AV_LOG_ERROR, "Failed to query pipeline "
>> +               "caps: %d (%s).\n", vas, vaErrorStr(vas));
>> +        return AVERROR(EIO);
>> +    }
>> +
>> +    ctx->queue_depth = ctx->pipeline_caps.num_backward_references +
>> +                       ctx->pipeline_caps.num_forward_references + 1;
> 
> I don't see anything that guarantees this is less than MAX_REFERENCES,
> and it looks like stuff will break if that's not true.

Yes; I'll check it and return an error in that case.  (I doubt it will ever be 
hit - the highest total I've seen here is 2 + 1 + 1 = 4.)

>> ...
>> +    if (ctx->hwctx->driver_quirks &
>> +        AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
>> +        vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
>> +        if (vas != VA_STATUS_SUCCESS) {
>> +            av_log(avctx, AV_LOG_ERROR, "Failed to free parameter buffer: "
>> +                   "%d (%s).\n", vas, vaErrorStr(vas));
>> +            // And ignore.
>> +        }
>> +    }
>> +
>> +    av_frame_copy_props(output_frame, input_frame);
> 
> This needs an error check.

Yes; will add.

>> ...
>> +#define OFFSET(x) offsetof(DeintVAAPIContext, x)
>> +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM)
>> +static const AVOption deint_vaapi_options[] = {
>> +    { "mode", "Deinterlacing mode",
>> +      OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = VAProcDeinterlacingBob },
> 
> We might want to use one of the fancier algorithms by default. Also,
> docs would be nice.

i965 gives you bob, motion-adaptive and motion-compensated.

mesa gives you bob, weave and motion-adaptive.

The default could therefore be motion-adaptive?  Or a separate value "default" 
which picks the highest numbered algorithm?  (I don't really mind what this is 
at all.)

Thanks,

- Mark

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to