From patchwork Mon Jun 12 22:40:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 3951 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.22.4 with SMTP id 4csp78118vsw; Mon, 12 Jun 2017 15:43:07 -0700 (PDT) X-Received: by 10.223.169.203 with SMTP id b69mr752860wrd.1.1497307387219; Mon, 12 Jun 2017 15:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497307387; cv=none; d=google.com; s=arc-20160816; b=DHmwjQoQXQOW4bXBT66SA/H9Fv7VvalmVZxAeaShPIXUoTZhaYPvFgDedkRu4Ytbl2 G3+eBVKlK99Yt/F2AVcmuKHdCUIfLpRn75iyp8WQFy7mzsA9WpNd7THOt3UN6xdpEeAr UHN20CJGcuMJBxVnzpNAgquN/vAnxsI4f9cOued2dSGsI+Q+l3mGpE+kyK5MwbFSNtqv 3rAeWYSvdsy9xmlyC4WL1MVk//FELPLGtzRa1CkX40NYTlB4SpP+oW5rQe9ndTnmiSmh AAKDPn4eIjufv3KiPCWY7Olf8uUkc9XKIIttujnXSuWen8sj1ERGDlMhYR89MhaYunSY UrnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=lav3xLYGXOI0gtxw2hiAEj9orqBHl2Ti8SKfxTfViVg=; b=Kyb/XG2hwESNC8gyu49ZTU+XLVUhSN6wfLioVHbA6RCew/jEsvvGXe2rPsGX3KY4Ci uaypEUBJ/+X+e0RFk1fSZuLuUSv9ZXRdSVeg+l+4z/8PGtC1VIZcNXmWS2iu8tzYT09X LYvo1I3jy/EmM3S/N+tdej3lJpxaWjTGHDVPEQQbgSjoDf0FFxca9hY7pKtlAaPVVYOl wFU0egt/JdULnhB+L4tP/UCku+TjbwTPme7QaE/f7v5VMm8NOC4ft9uVP/JBl0DjZtJX I418MZEbDo32/T38k0YonqbW9z+vLT12XRzvIwmll1ru+AJyKT/HA/A804HvfyfARnqI Mndw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.b=aMX++Jy9; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k88si8985547wmi.131.2017.06.12.15.43.06; Mon, 12 Jun 2017 15:43:07 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.b=aMX++Jy9; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1859C68A089; Tue, 13 Jun 2017 01:41:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6597B68A050 for ; Tue, 13 Jun 2017 01:41:05 +0300 (EEST) Received: by mail-wr0-f178.google.com with SMTP id q97so116889571wrb.2 for ; Mon, 12 Jun 2017 15:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=JrjNErS9hOFAOQwWzEpvp0irCTVuc9Ze0GqNuoq2tLY=; b=aMX++Jy9RTMKv0R2E3VIEjNVKZEmf8ssssE2CHa6S/KlcxinK3FgEb0FXe0p60fllh 1bDXptlLSSCtgZeKhV6rjCCI4RH88ILRly0S67bNA7F+QYh5WfBNWD8CQ6yVHjfLHzi1 ENwAZDw/DVEjCOf03cZ9ZoZu6yocQ2bf3qzOX2i7CPbnMp0vnjsmg62MSkwYzIsz/Ko9 Fgsz9T0IXw0LyXEZACJfRjjJeZJhkArT/Ba47528tbk1gUXEsEmI3fH41KN2lXakko5W G3WfaPVYeBG7v0blaPHysZPRdBYUIQiN6iFvLwGJYm4Ay0qIVZ77on9mMAjAs/iM0JBp uIBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=JrjNErS9hOFAOQwWzEpvp0irCTVuc9Ze0GqNuoq2tLY=; b=Qn+hjZHwzEu4ZnmBGjtO49pUlUHRbe1C8X720xPNjJYTYSYrOVWv18hW3pLVkWs5t7 tyLgY5recUvD/Op3u4NZoODVtI2MvQGdOBmPHeF+NREIjdAgjOkvQRrAUDmTMb/Y5AbU TPLZXRrHT/wNdPxZpRQNFaO7TugxDHjhsvCkUw6B2EP4p38q1pEi7LCtFdYymr/Bigeq KOMkZYp6St1lB/93z4NkIiWU089U8Bdl7RzooeYu0vvvY/7ZFvc1L6NYvOMQZFTA9Sgf vOOnM/uta2DAw01VoiAMpBK0d8oxZ8cGATFd9hIlTuVLjG0Tal+OfWT83P57412wG399 yXWQ== X-Gm-Message-State: AKS2vOwa4yyDDLkI4O1gpb1g3CbkZewyFkLpewqiuiPVFeVZz120g/jV qJolfAnIex2UUrt95PI= X-Received: by 10.223.131.66 with SMTP id 60mr696651wrd.169.1497307266877; Mon, 12 Jun 2017 15:41:06 -0700 (PDT) Received: from rywe.jkqxz.net (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id m191sm13098233wmg.30.2017.06.12.15.41.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 15:41:06 -0700 (PDT) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Jun 2017 23:40:26 +0100 Message-Id: <20170612224041.6750-10-sw@jkqxz.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170612224041.6750-1-sw@jkqxz.net> References: <20170612224041.6750-1-sw@jkqxz.net> Subject: [FFmpeg-devel] [PATCH 09/24] vf_deinterlace_vaapi: Add support for field rate output X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" In order to work correctly with the i965 driver, this also fixes the direction of forward/backward references - forward references are intended to be those from the past to the current frame, not from the current frame to the future. (cherry picked from commit 9aa251c98ce60e5ee83156e5292547a7671ced3a) --- libavfilter/vf_deinterlace_vaapi.c | 289 +++++++++++++++++++++---------------- 1 file changed, 166 insertions(+), 123 deletions(-) diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c index 5e7f7cf1c2..838eb89c90 100644 --- a/libavfilter/vf_deinterlace_vaapi.c +++ b/libavfilter/vf_deinterlace_vaapi.c @@ -22,6 +22,7 @@ #include #include "libavutil/avassert.h" +#include "libavutil/common.h" #include "libavutil/hwcontext.h" #include "libavutil/hwcontext_vaapi.h" #include "libavutil/mem.h" @@ -42,6 +43,8 @@ typedef struct DeintVAAPIContext { AVBufferRef *device_ref; int mode; + int field_rate; + int auto_enable; int valid_ids; VAConfigID va_config; @@ -63,6 +66,7 @@ typedef struct DeintVAAPIContext { int queue_depth; int queue_count; AVFrame *frame_queue[MAX_REFERENCES]; + int extra_delay_for_timestamps; VABufferID filter_buffer; } DeintVAAPIContext; @@ -211,8 +215,12 @@ static int deint_vaapi_build_filter_params(AVFilterContext *avctx) return AVERROR(EIO); } + ctx->extra_delay_for_timestamps = ctx->field_rate == 2 && + ctx->pipeline_caps.num_backward_references == 0; + ctx->queue_depth = ctx->pipeline_caps.num_backward_references + - ctx->pipeline_caps.num_forward_references + 1; + ctx->pipeline_caps.num_forward_references + + ctx->extra_delay_for_timestamps + 1; if (ctx->queue_depth > MAX_REFERENCES) { av_log(avctx, AV_LOG_ERROR, "Pipeline requires too many " "references (%u forward, %u back).\n", @@ -227,6 +235,7 @@ static int deint_vaapi_build_filter_params(AVFilterContext *avctx) static int deint_vaapi_config_output(AVFilterLink *outlink) { AVFilterContext *avctx = outlink->src; + AVFilterLink *inlink = avctx->inputs[0]; DeintVAAPIContext *ctx = avctx->priv; AVVAAPIHWConfig *hwconfig = NULL; AVHWFramesConstraints *constraints = NULL; @@ -326,8 +335,13 @@ static int deint_vaapi_config_output(AVFilterLink *outlink) if (err < 0) goto fail; - outlink->w = ctx->output_width; - outlink->h = ctx->output_height; + outlink->w = inlink->w; + outlink->h = inlink->h; + + outlink->time_base = av_mul_q(inlink->time_base, + (AVRational) { 1, ctx->field_rate }); + outlink->frame_rate = av_mul_q(inlink->frame_rate, + (AVRational) { ctx->field_rate, 1 }); outlink->hw_frames_ctx = av_buffer_ref(ctx->output_frames_ref); if (!outlink->hw_frames_ctx) { @@ -375,7 +389,7 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) VABufferID params_id; VAStatus vas; void *filter_params_addr = NULL; - int err, i; + int err, i, field, current_frame_index; av_log(avctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n", av_get_pix_fmt_name(input_frame->format), @@ -394,17 +408,16 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) ctx->frame_queue[i] = input_frame; } - input_frame = - ctx->frame_queue[ctx->pipeline_caps.num_backward_references]; + current_frame_index = ctx->pipeline_caps.num_forward_references; + + input_frame = ctx->frame_queue[current_frame_index]; input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3]; - for (i = 0; i < ctx->pipeline_caps.num_backward_references; i++) - backward_references[i] = (VASurfaceID)(uintptr_t) - ctx->frame_queue[ctx->pipeline_caps.num_backward_references - - i - 1]->data[3]; for (i = 0; i < ctx->pipeline_caps.num_forward_references; i++) forward_references[i] = (VASurfaceID)(uintptr_t) - ctx->frame_queue[ctx->pipeline_caps.num_backward_references + - i + 1]->data[3]; + ctx->frame_queue[current_frame_index - i - 1]->data[3]; + for (i = 0; i < ctx->pipeline_caps.num_backward_references; i++) + backward_references[i] = (VASurfaceID)(uintptr_t) + ctx->frame_queue[current_frame_index + i + 1]->data[3]; av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for " "deinterlace input.\n", input_surface); @@ -417,129 +430,148 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) av_log(avctx, AV_LOG_DEBUG, " %#x", forward_references[i]); av_log(avctx, AV_LOG_DEBUG, "\n"); - output_frame = av_frame_alloc(); - if (!output_frame) { - err = AVERROR(ENOMEM); - goto fail; - } - - err = av_hwframe_get_buffer(ctx->output_frames_ref, - output_frame, 0); - if (err < 0) { - err = AVERROR(ENOMEM); - goto fail; - } - - output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3]; - av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for " - "deinterlace output.\n", output_surface); - - memset(¶ms, 0, sizeof(params)); - - input_region = (VARectangle) { - .x = 0, - .y = 0, - .width = input_frame->width, - .height = input_frame->height, - }; + for (field = 0; field < ctx->field_rate; field++) { + output_frame = ff_get_video_buffer(outlink, ctx->output_width, + ctx->output_height); + if (!output_frame) { + err = AVERROR(ENOMEM); + goto fail; + } - params.surface = input_surface; - params.surface_region = &input_region; - params.surface_color_standard = vaapi_proc_colour_standard( - input_frame->colorspace); + output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3]; + av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for " + "deinterlace output.\n", output_surface); + + memset(¶ms, 0, sizeof(params)); + + input_region = (VARectangle) { + .x = 0, + .y = 0, + .width = input_frame->width, + .height = input_frame->height, + }; + + params.surface = input_surface; + params.surface_region = &input_region; + params.surface_color_standard = + vaapi_proc_colour_standard(input_frame->colorspace); + + params.output_region = NULL; + params.output_background_color = 0xff000000; + params.output_color_standard = params.surface_color_standard; + + params.pipeline_flags = 0; + params.filter_flags = VA_FRAME_PICTURE; + + if (!ctx->auto_enable || input_frame->interlaced_frame) { + vas = vaMapBuffer(ctx->hwctx->display, ctx->filter_buffer, + &filter_params_addr); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map filter parameter " + "buffer: %d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + goto fail; + } + filter_params = filter_params_addr; + filter_params->flags = 0; + if (input_frame->top_field_first) { + filter_params->flags |= field ? VA_DEINTERLACING_BOTTOM_FIELD : 0; + } else { + filter_params->flags |= VA_DEINTERLACING_BOTTOM_FIELD_FIRST; + filter_params->flags |= field ? 0 : VA_DEINTERLACING_BOTTOM_FIELD; + } + filter_params_addr = NULL; + vas = vaUnmapBuffer(ctx->hwctx->display, ctx->filter_buffer); + if (vas != VA_STATUS_SUCCESS) + av_log(avctx, AV_LOG_ERROR, "Failed to unmap filter parameter " + "buffer: %d (%s).\n", vas, vaErrorStr(vas)); + + params.filters = &ctx->filter_buffer; + params.num_filters = 1; + + params.forward_references = forward_references; + params.num_forward_references = + ctx->pipeline_caps.num_forward_references; + params.backward_references = backward_references; + params.num_backward_references = + ctx->pipeline_caps.num_backward_references; + + } else { + params.filters = NULL; + params.num_filters = 0; + } - params.output_region = NULL; - params.output_background_color = 0xff000000; - params.output_color_standard = params.surface_color_standard; + vas = vaBeginPicture(ctx->hwctx->display, + ctx->va_context, output_surface); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to attach new picture: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + goto fail; + } - params.pipeline_flags = 0; - params.filter_flags = VA_FRAME_PICTURE; + vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, + VAProcPipelineParameterBufferType, + sizeof(params), 1, ¶ms, ¶ms_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + goto fail_after_begin; + } + av_log(avctx, AV_LOG_DEBUG, "Pipeline parameter buffer is %#x.\n", + params_id); - vas = vaMapBuffer(ctx->hwctx->display, ctx->filter_buffer, - &filter_params_addr); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to map filter parameter " - "buffer: %d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - filter_params = filter_params_addr; - filter_params->flags = 0; - if (input_frame->interlaced_frame && !input_frame->top_field_first) - filter_params->flags |= VA_DEINTERLACING_BOTTOM_FIELD_FIRST; - filter_params_addr = NULL; - vas = vaUnmapBuffer(ctx->hwctx->display, ctx->filter_buffer); - if (vas != VA_STATUS_SUCCESS) - av_log(avctx, AV_LOG_ERROR, "Failed to unmap filter parameter " - "buffer: %d (%s).\n", vas, vaErrorStr(vas)); - - params.filters = &ctx->filter_buffer; - params.num_filters = 1; - - params.forward_references = forward_references; - params.num_forward_references = - ctx->pipeline_caps.num_forward_references; - params.backward_references = backward_references; - params.num_backward_references = - ctx->pipeline_caps.num_backward_references; - - vas = vaBeginPicture(ctx->hwctx->display, - ctx->va_context, output_surface); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to attach new picture: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } + vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, + ¶ms_id, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to render parameter buffer: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + goto fail_after_begin; + } - vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, - VAProcPipelineParameterBufferType, - sizeof(params), 1, ¶ms, ¶ms_id); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; - } - av_log(avctx, AV_LOG_DEBUG, "Pipeline parameter buffer is %#x.\n", - params_id); + vas = vaEndPicture(ctx->hwctx->display, ctx->va_context); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to start picture processing: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + goto fail_after_render; + } - vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, - ¶ms_id, 1); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to render parameter buffer: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_begin; - } + 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. + } + } - vas = vaEndPicture(ctx->hwctx->display, ctx->va_context); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to start picture processing: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail_after_render; - } + err = av_frame_copy_props(output_frame, input_frame); + if (err < 0) + goto fail; - 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. + if (ctx->field_rate == 2) { + if (field == 0) + output_frame->pts = 2 * input_frame->pts; + else + output_frame->pts = input_frame->pts + + ctx->frame_queue[current_frame_index + 1]->pts; } - } + output_frame->interlaced_frame = 0; - err = av_frame_copy_props(output_frame, input_frame); - if (err < 0) - goto fail; + av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n", + av_get_pix_fmt_name(output_frame->format), + output_frame->width, output_frame->height, output_frame->pts); - av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n", - av_get_pix_fmt_name(output_frame->format), - output_frame->width, output_frame->height, output_frame->pts); + err = ff_filter_frame(outlink, output_frame); + if (err < 0) + break; + } - return ff_filter_frame(outlink, output_frame); + return err; fail_after_begin: vaRenderPicture(ctx->hwctx->display, ctx->va_context, ¶ms_id, 1); @@ -592,6 +624,17 @@ static const AVOption deint_vaapi_options[] = { 0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionAdaptive }, .unit = "mode" }, { "motion_compensated", "Use the motion compensated deinterlacing algorithm", 0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionCompensated }, .unit = "mode" }, + + { "rate", "Generate output at frame rate or field rate", + OFFSET(field_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 2, FLAGS, "rate" }, + { "frame", "Output at frame rate (one frame of output for each field-pair)", + 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .unit = "rate" }, + { "field", "Output at field rate (one frame of output for each field)", + 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, .unit = "rate" }, + + { "auto", "Only deinterlace fields, passing frames through unchanged", + OFFSET(auto_enable), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS }, + { NULL }, };