FFmpeg
vf_deinterlace_vaapi.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include <string.h>
20 
21 #include "libavutil/common.h"
22 #include "libavutil/opt.h"
23 #include "libavutil/pixdesc.h"
24 
25 #include "avfilter.h"
26 #include "formats.h"
27 #include "internal.h"
28 #include "video.h"
29 #include "vaapi_vpp.h"
30 
31 #define MAX_REFERENCES 8
32 
33 typedef struct DeintVAAPIContext {
34  VAAPIVPPContext vpp_ctx; // must be the first field
35 
36  int mode;
39 
40  VAProcFilterCapDeinterlacing
41  deint_caps[VAProcDeinterlacingCount];
43  VAProcPipelineCaps pipeline_caps;
44 
49 
50  int eof;
51  int prev_pts;
53 
54 static const char *deint_vaapi_mode_name(int mode)
55 {
56  switch (mode) {
57 #define D(name) case VAProcDeinterlacing ## name: return #name
58  D(Bob);
59  D(Weave);
60  D(MotionAdaptive);
61  D(MotionCompensated);
62 #undef D
63  default:
64  return "Invalid";
65  }
66 }
67 
69 {
70  DeintVAAPIContext *ctx = avctx->priv;
71  int i;
72 
73  for (i = 0; i < ctx->queue_count; i++)
74  av_frame_free(&ctx->frame_queue[i]);
75  ctx->queue_count = 0;
76 
78 }
79 
81 {
82  VAAPIVPPContext *vpp_ctx = avctx->priv;
83  DeintVAAPIContext *ctx = avctx->priv;
84  VAStatus vas;
85  VAProcFilterParameterBufferDeinterlacing params;
86  int i;
87 
88  ctx->nb_deint_caps = VAProcDeinterlacingCount;
89  vas = vaQueryVideoProcFilterCaps(vpp_ctx->hwctx->display,
90  vpp_ctx->va_context,
91  VAProcFilterDeinterlacing,
92  &ctx->deint_caps,
93  &ctx->nb_deint_caps);
94  if (vas != VA_STATUS_SUCCESS) {
95  av_log(avctx, AV_LOG_ERROR, "Failed to query deinterlacing "
96  "caps: %d (%s).\n", vas, vaErrorStr(vas));
97  return AVERROR(EIO);
98  }
99 
100  if (ctx->mode == VAProcDeinterlacingNone) {
101  for (i = 0; i < ctx->nb_deint_caps; i++) {
102  if (ctx->deint_caps[i].type > ctx->mode)
103  ctx->mode = ctx->deint_caps[i].type;
104  }
105  av_log(avctx, AV_LOG_VERBOSE, "Picking %d (%s) as default "
106  "deinterlacing mode.\n", ctx->mode,
107  deint_vaapi_mode_name(ctx->mode));
108  } else {
109  for (i = 0; i < ctx->nb_deint_caps; i++) {
110  if (ctx->deint_caps[i].type == ctx->mode)
111  break;
112  }
113  if (i >= ctx->nb_deint_caps) {
114  av_log(avctx, AV_LOG_ERROR, "Deinterlacing mode %d (%s) is "
115  "not supported.\n", ctx->mode,
116  deint_vaapi_mode_name(ctx->mode));
117  return AVERROR(EINVAL);
118  }
119  }
120 
121  params.type = VAProcFilterDeinterlacing;
122  params.algorithm = ctx->mode;
123  params.flags = 0;
124 
126  VAProcFilterParameterBufferType,
127  &params,
128  sizeof(params),
129  1);
130  if (vas)
131  return vas;
132 
133  vas = vaQueryVideoProcPipelineCaps(vpp_ctx->hwctx->display,
134  vpp_ctx->va_context,
135  &vpp_ctx->filter_buffers[0], 1,
136  &ctx->pipeline_caps);
137  if (vas != VA_STATUS_SUCCESS) {
138  av_log(avctx, AV_LOG_ERROR, "Failed to query pipeline "
139  "caps: %d (%s).\n", vas, vaErrorStr(vas));
140  return AVERROR(EIO);
141  }
142 
143  ctx->extra_delay_for_timestamps = ctx->field_rate == 2 &&
144  ctx->pipeline_caps.num_backward_references == 0;
145 
146  ctx->queue_depth = ctx->pipeline_caps.num_backward_references +
147  ctx->pipeline_caps.num_forward_references +
148  ctx->extra_delay_for_timestamps + 1;
149  if (ctx->queue_depth > MAX_REFERENCES) {
150  av_log(avctx, AV_LOG_ERROR, "Pipeline requires too many "
151  "references (%u forward, %u back).\n",
152  ctx->pipeline_caps.num_forward_references,
153  ctx->pipeline_caps.num_backward_references);
154  return AVERROR(ENOSYS);
155  }
156 
157  return 0;
158 }
159 
161 {
162  AVFilterLink *inlink = outlink->src->inputs[0];
163  AVFilterContext *avctx = outlink->src;
164  DeintVAAPIContext *ctx = avctx->priv;
165  int err;
166 
167  err = ff_vaapi_vpp_config_output(outlink);
168  if (err < 0)
169  return err;
170  outlink->time_base = av_mul_q(inlink->time_base,
171  (AVRational) { 1, ctx->field_rate });
172  outlink->frame_rate = av_mul_q(inlink->frame_rate,
173  (AVRational) { ctx->field_rate, 1 });
174 
175  return 0;
176 }
177 
179 {
180  AVFilterContext *avctx = inlink->dst;
181  AVFilterLink *outlink = avctx->outputs[0];
182  VAAPIVPPContext *vpp_ctx = avctx->priv;
183  DeintVAAPIContext *ctx = avctx->priv;
185  VASurfaceID input_surface;
186  VASurfaceID backward_references[MAX_REFERENCES];
187  VASurfaceID forward_references[MAX_REFERENCES];
188  VAProcPipelineParameterBuffer params;
189  VAProcFilterParameterBufferDeinterlacing *filter_params;
190  VAStatus vas;
191  void *filter_params_addr = NULL;
192  int err, i, field, current_frame_index;
193 
194  // NULL frame is used to flush the queue in field mode
195  if (input_frame)
196  av_log(avctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
197  av_get_pix_fmt_name(input_frame->format),
198  input_frame->width, input_frame->height, input_frame->pts);
199 
200  if (ctx->queue_count < ctx->queue_depth) {
201  ctx->frame_queue[ctx->queue_count++] = input_frame;
202  if (ctx->queue_count < ctx->queue_depth) {
203  // Need more reference surfaces before we can continue.
204  return 0;
205  }
206  } else {
207  av_frame_free(&ctx->frame_queue[0]);
208  for (i = 0; i + 1 < ctx->queue_count; i++)
209  ctx->frame_queue[i] = ctx->frame_queue[i + 1];
210  ctx->frame_queue[i] = input_frame;
211  }
212 
213  current_frame_index = ctx->pipeline_caps.num_forward_references;
214 
215  input_frame = ctx->frame_queue[current_frame_index];
216  if (!input_frame)
217  return 0;
218 
219  input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3];
220  for (i = 0; i < ctx->pipeline_caps.num_forward_references; i++)
221  forward_references[i] = (VASurfaceID)(uintptr_t)
222  ctx->frame_queue[current_frame_index - i - 1]->data[3];
223  for (i = 0; i < ctx->pipeline_caps.num_backward_references; i++)
224  backward_references[i] = (VASurfaceID)(uintptr_t)
225  ctx->frame_queue[current_frame_index + i + 1]->data[3];
226 
227  av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for "
228  "deinterlace input.\n", input_surface);
229  av_log(avctx, AV_LOG_DEBUG, "Backward references:");
230  for (i = 0; i < ctx->pipeline_caps.num_backward_references; i++)
231  av_log(avctx, AV_LOG_DEBUG, " %#x", backward_references[i]);
232  av_log(avctx, AV_LOG_DEBUG, "\n");
233  av_log(avctx, AV_LOG_DEBUG, "Forward references:");
234  for (i = 0; i < ctx->pipeline_caps.num_forward_references; i++)
235  av_log(avctx, AV_LOG_DEBUG, " %#x", forward_references[i]);
236  av_log(avctx, AV_LOG_DEBUG, "\n");
237 
238  for (field = 0; field < ctx->field_rate; field++) {
239  output_frame = ff_get_video_buffer(outlink, vpp_ctx->output_width,
240  vpp_ctx->output_height);
241  if (!output_frame) {
242  err = AVERROR(ENOMEM);
243  goto fail;
244  }
245 
246  err = av_frame_copy_props(output_frame, input_frame);
247  if (err < 0)
248  goto fail;
249 
250  err = ff_vaapi_vpp_init_params(avctx, &params,
251  input_frame, output_frame);
252  if (err < 0)
253  goto fail;
254 
255  if (!ctx->auto_enable || input_frame->interlaced_frame) {
256  vas = vaMapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0],
257  &filter_params_addr);
258  if (vas != VA_STATUS_SUCCESS) {
259  av_log(avctx, AV_LOG_ERROR, "Failed to map filter parameter "
260  "buffer: %d (%s).\n", vas, vaErrorStr(vas));
261  err = AVERROR(EIO);
262  goto fail;
263  }
264  filter_params = filter_params_addr;
265  filter_params->flags = 0;
266  if (input_frame->top_field_first) {
267  filter_params->flags |= field ? VA_DEINTERLACING_BOTTOM_FIELD : 0;
268  } else {
269  filter_params->flags |= VA_DEINTERLACING_BOTTOM_FIELD_FIRST;
270  filter_params->flags |= field ? 0 : VA_DEINTERLACING_BOTTOM_FIELD;
271  }
272  filter_params_addr = NULL;
273  vas = vaUnmapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0]);
274  if (vas != VA_STATUS_SUCCESS)
275  av_log(avctx, AV_LOG_ERROR, "Failed to unmap filter parameter "
276  "buffer: %d (%s).\n", vas, vaErrorStr(vas));
277 
278  params.filters = &vpp_ctx->filter_buffers[0];
279  params.num_filters = 1;
280 
281  params.forward_references = forward_references;
282  params.num_forward_references =
283  ctx->pipeline_caps.num_forward_references;
284  params.backward_references = backward_references;
285  params.num_backward_references =
286  ctx->pipeline_caps.num_backward_references;
287 
288  } else {
289  params.filters = NULL;
290  params.num_filters = 0;
291  }
292 
293  err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
294  if (err < 0)
295  goto fail;
296 
297  if (ctx->field_rate == 2) {
298  if (field == 0)
299  output_frame->pts = 2 * input_frame->pts;
300  else if (ctx->eof)
301  output_frame->pts = 3 * input_frame->pts - ctx->prev_pts;
302  else
303  output_frame->pts = input_frame->pts +
304  ctx->frame_queue[current_frame_index + 1]->pts;
305  }
306  output_frame->interlaced_frame = 0;
307 
308  av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
310  output_frame->width, output_frame->height, output_frame->pts);
311 
312  err = ff_filter_frame(outlink, output_frame);
313  if (err < 0)
314  break;
315  }
316 
317  ctx->prev_pts = input_frame->pts;
318 
319  return err;
320 
321 fail:
322  if (filter_params_addr)
323  vaUnmapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0]);
325  return err;
326 }
327 
329 {
330  AVFilterContext *avctx = link->src;
331  DeintVAAPIContext *ctx = avctx->priv;
332  int ret;
333 
334  if (ctx->eof)
335  return AVERROR_EOF;
336 
337  ret = ff_request_frame(link->src->inputs[0]);
338  if (ret == AVERROR_EOF && ctx->extra_delay_for_timestamps) {
339  ctx->eof = 1;
340  deint_vaapi_filter_frame(link->src->inputs[0], NULL);
341  } else if (ret < 0)
342  return ret;
343 
344  return 0;
345 }
346 
348 {
349  VAAPIVPPContext *vpp_ctx = avctx->priv;
350 
351  ff_vaapi_vpp_ctx_init(avctx);
354  vpp_ctx->output_format = AV_PIX_FMT_NONE;
355 
356  return 0;
357 }
358 
359 #define OFFSET(x) offsetof(DeintVAAPIContext, x)
360 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
361 static const AVOption deint_vaapi_options[] = {
362  { "mode", "Deinterlacing mode",
363  OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = VAProcDeinterlacingNone },
364  VAProcDeinterlacingNone, VAProcDeinterlacingCount - 1, FLAGS, "mode" },
365  { "default", "Use the highest-numbered (and therefore possibly most advanced) deinterlacing algorithm",
366  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingNone }, 0, 0, FLAGS, "mode" },
367  { "bob", "Use the bob deinterlacing algorithm",
368  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingBob }, 0, 0, FLAGS, "mode" },
369  { "weave", "Use the weave deinterlacing algorithm",
370  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingWeave }, 0, 0, FLAGS, "mode" },
371  { "motion_adaptive", "Use the motion adaptive deinterlacing algorithm",
372  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionAdaptive }, 0, 0, FLAGS, "mode" },
373  { "motion_compensated", "Use the motion compensated deinterlacing algorithm",
374  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionCompensated }, 0, 0, FLAGS, "mode" },
375 
376  { "rate", "Generate output at frame rate or field rate",
377  OFFSET(field_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 2, FLAGS, "rate" },
378  { "frame", "Output at frame rate (one frame of output for each field-pair)",
379  0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "rate" },
380  { "field", "Output at field rate (one frame of output for each field)",
381  0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, FLAGS, "rate" },
382 
383  { "auto", "Only deinterlace fields, passing frames through unchanged",
384  OFFSET(auto_enable), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
385 
386  { NULL },
387 };
388 
389 static const AVClass deint_vaapi_class = {
390  .class_name = "deinterlace_vaapi",
391  .item_name = av_default_item_name,
392  .option = deint_vaapi_options,
393  .version = LIBAVUTIL_VERSION_INT,
394 };
395 
396 static const AVFilterPad deint_vaapi_inputs[] = {
397  {
398  .name = "default",
399  .type = AVMEDIA_TYPE_VIDEO,
400  .filter_frame = &deint_vaapi_filter_frame,
401  .config_props = &ff_vaapi_vpp_config_input,
402  },
403 };
404 
406  {
407  .name = "default",
408  .type = AVMEDIA_TYPE_VIDEO,
409  .request_frame = &deint_vaapi_request_frame,
410  .config_props = &deint_vaapi_config_output,
411  },
412 };
413 
415  .name = "deinterlace_vaapi",
416  .description = NULL_IF_CONFIG_SMALL("Deinterlacing of VAAPI surfaces"),
417  .priv_size = sizeof(DeintVAAPIContext),
423  .priv_class = &deint_vaapi_class,
424  .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
425 };
ff_get_video_buffer
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:101
ff_vaapi_vpp_pipeline_uninit
void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:44
ff_vaapi_vpp_ctx_init
void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx)
Definition: vaapi_vpp.c:666
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
OFFSET
#define OFFSET(x)
Definition: vf_deinterlace_vaapi.c:359
ff_vaapi_vpp_render_picture
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, AVFrame *output_frame)
Definition: vaapi_vpp.c:592
FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:370
D
#define D(name)
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:999
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
DeintVAAPIContext::auto_enable
int auto_enable
Definition: vf_deinterlace_vaapi.c:38
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
FLAGS
#define FLAGS
Definition: vf_deinterlace_vaapi.c:360
deint_vaapi_config_output
static int deint_vaapi_config_output(AVFilterLink *outlink)
Definition: vf_deinterlace_vaapi.c:160
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:111
deint_vaapi_pipeline_uninit
static void deint_vaapi_pipeline_uninit(AVFilterContext *avctx)
Definition: vf_deinterlace_vaapi.c:68
deint_vaapi_init
static av_cold int deint_vaapi_init(AVFilterContext *avctx)
Definition: vf_deinterlace_vaapi.c:347
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:325
pixdesc.h
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:432
AVFrame::width
int width
Definition: frame.h:397
AVFrame::top_field_first
int top_field_first
If the content is interlaced, is top field displayed first.
Definition: frame.h:482
AVOption
AVOption.
Definition: opt.h:251
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
ff_request_frame
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition: avfilter.c:400
DeintVAAPIContext::frame_queue
AVFrame * frame_queue[MAX_REFERENCES]
Definition: vf_deinterlace_vaapi.c:47
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:196
AVVAAPIDeviceContext::display
VADisplay display
The VADisplay handle, to be filled by the user.
Definition: hwcontext_vaapi.h:72
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:175
video.h
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:346
formats.h
init
static int init
Definition: av_tx.c:47
VAAPIVPPContext::build_filter_params
int(* build_filter_params)(AVFilterContext *avctx)
Definition: vaapi_vpp.h:54
AVFilterContext::priv
void * priv
private data for use by the filter
Definition: avfilter.h:423
deint_vaapi_mode_name
static const char * deint_vaapi_mode_name(int mode)
Definition: vf_deinterlace_vaapi.c:54
fail
#define fail()
Definition: checkasm.h:131
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:49
DeintVAAPIContext::field_rate
int field_rate
Definition: vf_deinterlace_vaapi.c:37
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
DeintVAAPIContext::nb_deint_caps
int nb_deint_caps
Definition: vf_deinterlace_vaapi.c:42
AVFormatContext::flags
int flags
Flags modifying the (de)muxer behaviour.
Definition: avformat.h:1331
ff_vf_deinterlace_vaapi
const AVFilter ff_vf_deinterlace_vaapi
Definition: vf_deinterlace_vaapi.c:414
VAAPIVPPContext::output_width
int output_width
Definition: vaapi_vpp.h:48
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
ctx
AVFormatContext * ctx
Definition: movenc.c:48
VAAPIVPPContext::output_format
enum AVPixelFormat output_format
Definition: vaapi_vpp.h:47
ff_vaapi_vpp_make_param_buffers
int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx, int type, const void *data, size_t size, int count)
Definition: vaapi_vpp.c:563
DeintVAAPIContext::deint_caps
VAProcFilterCapDeinterlacing deint_caps[VAProcDeinterlacingCount]
Definition: vf_deinterlace_vaapi.c:41
field
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this field
Definition: writing_filters.txt:78
VAAPIVPPContext::hwctx
AVVAAPIDeviceContext * hwctx
Definition: vaapi_vpp.h:36
deint_vaapi_outputs
static const AVFilterPad deint_vaapi_outputs[]
Definition: vf_deinterlace_vaapi.c:405
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
link
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
Definition: filter_design.txt:23
deint_vaapi_request_frame
static int deint_vaapi_request_frame(AVFilterLink *link)
Definition: vf_deinterlace_vaapi.c:328
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
deint_vaapi_class
static const AVClass deint_vaapi_class
Definition: vf_deinterlace_vaapi.c:389
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:596
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AVFilterContext::inputs
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:416
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
DeintVAAPIContext::eof
int eof
Definition: vf_deinterlace_vaapi.c:50
DeintVAAPIContext::extra_delay_for_timestamps
int extra_delay_for_timestamps
Definition: vf_deinterlace_vaapi.c:48
MAX_REFERENCES
#define MAX_REFERENCES
Definition: vf_deinterlace_vaapi.c:31
deint_vaapi_build_filter_params
static int deint_vaapi_build_filter_params(AVFilterContext *avctx)
Definition: vf_deinterlace_vaapi.c:80
ff_vaapi_vpp_config_input
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition: vaapi_vpp.c:70
DeintVAAPIContext::queue_count
int queue_count
Definition: vf_deinterlace_vaapi.c:46
ff_vaapi_vpp_ctx_uninit
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition: vaapi_vpp.c:680
ff_vaapi_vpp_query_formats
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
Definition: vaapi_vpp.c:27
vaapi_vpp.h
DeintVAAPIContext::queue_depth
int queue_depth
Definition: vf_deinterlace_vaapi.c:45
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
deint_vaapi_options
static const AVOption deint_vaapi_options[]
Definition: vf_deinterlace_vaapi.c:361
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
DeintVAAPIContext::prev_pts
int prev_pts
Definition: vf_deinterlace_vaapi.c:51
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:412
output_frame
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
Definition: h264dec.c:844
internal.h
AVFrame::interlaced_frame
int interlaced_frame
The content of the picture is interlaced.
Definition: frame.h:477
VAAPIVPPContext::output_height
int output_height
Definition: vaapi_vpp.h:49
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
DeintVAAPIContext::mode
int mode
Definition: vf_deinterlace_vaapi.c:36
VAAPIVPPContext::filter_buffers
VABufferID filter_buffers[VAProcFilterCount]
Definition: vaapi_vpp.h:51
common.h
DeintVAAPIContext::vpp_ctx
VAAPIVPPContext vpp_ctx
Definition: vf_deinterlace_vaapi.c:34
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:55
AVFilter
Filter definition.
Definition: avfilter.h:171
ret
ret
Definition: filter_design.txt:187
DeintVAAPIContext::pipeline_caps
VAProcPipelineCaps pipeline_caps
Definition: vf_deinterlace_vaapi.c:43
VAAPIVPPContext
Definition: vaapi_vpp.h:33
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:71
VAAPIVPPContext::va_context
VAContextID va_context
Definition: vaapi_vpp.h:41
AVFrame::height
int height
Definition: frame.h:397
ff_vaapi_vpp_config_output
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
Definition: vaapi_vpp.c:95
mode
mode
Definition: ebur128.h:83
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
avfilter.h
VAAPIVPPContext::pipeline_uninit
void(* pipeline_uninit)(AVFilterContext *avctx)
Definition: vaapi_vpp.h:56
av_mul_q
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
Definition: rational.c:80
AVFilterContext
An instance of a filter.
Definition: avfilter.h:408
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
deint_vaapi_filter_frame
static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
Definition: vf_deinterlace_vaapi.c:178
DeintVAAPIContext
Definition: vf_deinterlace_vaapi.c:33
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:285
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
deint_vaapi_inputs
static const AVFilterPad deint_vaapi_inputs[]
Definition: vf_deinterlace_vaapi.c:396
av_get_pix_fmt_name
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
Definition: pixdesc.c:2582
ff_vaapi_vpp_init_params
int ff_vaapi_vpp_init_params(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, const AVFrame *input_frame, AVFrame *output_frame)
Definition: vaapi_vpp.c:515
AVFilterContext::outputs
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:420