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 
50 
51 static const char *deint_vaapi_mode_name(int mode)
52 {
53  switch (mode) {
54 #define D(name) case VAProcDeinterlacing ## name: return #name
55  D(Bob);
56  D(Weave);
57  D(MotionAdaptive);
58  D(MotionCompensated);
59 #undef D
60  default:
61  return "Invalid";
62  }
63 }
64 
66 {
67  DeintVAAPIContext *ctx = avctx->priv;
68  int i;
69 
70  for (i = 0; i < ctx->queue_count; i++)
71  av_frame_free(&ctx->frame_queue[i]);
72  ctx->queue_count = 0;
73 
75 }
76 
78 {
79  VAAPIVPPContext *vpp_ctx = avctx->priv;
80  DeintVAAPIContext *ctx = avctx->priv;
81  VAStatus vas;
82  VAProcFilterParameterBufferDeinterlacing params;
83  int i;
84 
85  ctx->nb_deint_caps = VAProcDeinterlacingCount;
86  vas = vaQueryVideoProcFilterCaps(vpp_ctx->hwctx->display,
87  vpp_ctx->va_context,
88  VAProcFilterDeinterlacing,
89  &ctx->deint_caps,
90  &ctx->nb_deint_caps);
91  if (vas != VA_STATUS_SUCCESS) {
92  av_log(avctx, AV_LOG_ERROR, "Failed to query deinterlacing "
93  "caps: %d (%s).\n", vas, vaErrorStr(vas));
94  return AVERROR(EIO);
95  }
96 
97  if (ctx->mode == VAProcDeinterlacingNone) {
98  for (i = 0; i < ctx->nb_deint_caps; i++) {
99  if (ctx->deint_caps[i].type > ctx->mode)
100  ctx->mode = ctx->deint_caps[i].type;
101  }
102  av_log(avctx, AV_LOG_VERBOSE, "Picking %d (%s) as default "
103  "deinterlacing mode.\n", ctx->mode,
104  deint_vaapi_mode_name(ctx->mode));
105  } else {
106  for (i = 0; i < ctx->nb_deint_caps; i++) {
107  if (ctx->deint_caps[i].type == ctx->mode)
108  break;
109  }
110  if (i >= ctx->nb_deint_caps) {
111  av_log(avctx, AV_LOG_ERROR, "Deinterlacing mode %d (%s) is "
112  "not supported.\n", ctx->mode,
113  deint_vaapi_mode_name(ctx->mode));
114  return AVERROR(EINVAL);
115  }
116  }
117 
118  params.type = VAProcFilterDeinterlacing;
119  params.algorithm = ctx->mode;
120  params.flags = 0;
121 
123  VAProcFilterParameterBufferType,
124  &params,
125  sizeof(params),
126  1);
127  if (vas)
128  return vas;
129 
130  vas = vaQueryVideoProcPipelineCaps(vpp_ctx->hwctx->display,
131  vpp_ctx->va_context,
132  &vpp_ctx->filter_buffers[0], 1,
133  &ctx->pipeline_caps);
134  if (vas != VA_STATUS_SUCCESS) {
135  av_log(avctx, AV_LOG_ERROR, "Failed to query pipeline "
136  "caps: %d (%s).\n", vas, vaErrorStr(vas));
137  return AVERROR(EIO);
138  }
139 
140  ctx->extra_delay_for_timestamps = ctx->field_rate == 2 &&
141  ctx->pipeline_caps.num_backward_references == 0;
142 
143  ctx->queue_depth = ctx->pipeline_caps.num_backward_references +
144  ctx->pipeline_caps.num_forward_references +
145  ctx->extra_delay_for_timestamps + 1;
146  if (ctx->queue_depth > MAX_REFERENCES) {
147  av_log(avctx, AV_LOG_ERROR, "Pipeline requires too many "
148  "references (%u forward, %u back).\n",
149  ctx->pipeline_caps.num_forward_references,
150  ctx->pipeline_caps.num_backward_references);
151  return AVERROR(ENOSYS);
152  }
153 
154  return 0;
155 }
156 
158 {
159  AVFilterLink *inlink = outlink->src->inputs[0];
160  AVFilterContext *avctx = outlink->src;
161  DeintVAAPIContext *ctx = avctx->priv;
162  int err;
163 
164  err = ff_vaapi_vpp_config_output(outlink);
165  if (err < 0)
166  return err;
167  outlink->time_base = av_mul_q(inlink->time_base,
168  (AVRational) { 1, ctx->field_rate });
169  outlink->frame_rate = av_mul_q(inlink->frame_rate,
170  (AVRational) { ctx->field_rate, 1 });
171 
172  return 0;
173 }
174 
176 {
177  AVFilterContext *avctx = inlink->dst;
178  AVFilterLink *outlink = avctx->outputs[0];
179  VAAPIVPPContext *vpp_ctx = avctx->priv;
180  DeintVAAPIContext *ctx = avctx->priv;
182  VASurfaceID input_surface;
183  VASurfaceID backward_references[MAX_REFERENCES];
184  VASurfaceID forward_references[MAX_REFERENCES];
185  VAProcPipelineParameterBuffer params;
186  VAProcFilterParameterBufferDeinterlacing *filter_params;
187  VAStatus vas;
188  void *filter_params_addr = NULL;
189  int err, i, field, current_frame_index;
190 
191  av_log(avctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
192  av_get_pix_fmt_name(input_frame->format),
193  input_frame->width, input_frame->height, input_frame->pts);
194 
195  if (ctx->queue_count < ctx->queue_depth) {
196  ctx->frame_queue[ctx->queue_count++] = input_frame;
197  if (ctx->queue_count < ctx->queue_depth) {
198  // Need more reference surfaces before we can continue.
199  return 0;
200  }
201  } else {
202  av_frame_free(&ctx->frame_queue[0]);
203  for (i = 0; i + 1 < ctx->queue_count; i++)
204  ctx->frame_queue[i] = ctx->frame_queue[i + 1];
205  ctx->frame_queue[i] = input_frame;
206  }
207 
208  current_frame_index = ctx->pipeline_caps.num_forward_references;
209 
210  input_frame = ctx->frame_queue[current_frame_index];
211  input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3];
212  for (i = 0; i < ctx->pipeline_caps.num_forward_references; i++)
213  forward_references[i] = (VASurfaceID)(uintptr_t)
214  ctx->frame_queue[current_frame_index - i - 1]->data[3];
215  for (i = 0; i < ctx->pipeline_caps.num_backward_references; i++)
216  backward_references[i] = (VASurfaceID)(uintptr_t)
217  ctx->frame_queue[current_frame_index + i + 1]->data[3];
218 
219  av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for "
220  "deinterlace input.\n", input_surface);
221  av_log(avctx, AV_LOG_DEBUG, "Backward references:");
222  for (i = 0; i < ctx->pipeline_caps.num_backward_references; i++)
223  av_log(avctx, AV_LOG_DEBUG, " %#x", backward_references[i]);
224  av_log(avctx, AV_LOG_DEBUG, "\n");
225  av_log(avctx, AV_LOG_DEBUG, "Forward references:");
226  for (i = 0; i < ctx->pipeline_caps.num_forward_references; i++)
227  av_log(avctx, AV_LOG_DEBUG, " %#x", forward_references[i]);
228  av_log(avctx, AV_LOG_DEBUG, "\n");
229 
230  for (field = 0; field < ctx->field_rate; field++) {
231  output_frame = ff_get_video_buffer(outlink, vpp_ctx->output_width,
232  vpp_ctx->output_height);
233  if (!output_frame) {
234  err = AVERROR(ENOMEM);
235  goto fail;
236  }
237 
238  err = av_frame_copy_props(output_frame, input_frame);
239  if (err < 0)
240  goto fail;
241 
242  err = ff_vaapi_vpp_init_params(avctx, &params,
243  input_frame, output_frame);
244  if (err < 0)
245  goto fail;
246 
247  if (!ctx->auto_enable || input_frame->interlaced_frame) {
248  vas = vaMapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0],
249  &filter_params_addr);
250  if (vas != VA_STATUS_SUCCESS) {
251  av_log(avctx, AV_LOG_ERROR, "Failed to map filter parameter "
252  "buffer: %d (%s).\n", vas, vaErrorStr(vas));
253  err = AVERROR(EIO);
254  goto fail;
255  }
256  filter_params = filter_params_addr;
257  filter_params->flags = 0;
258  if (input_frame->top_field_first) {
259  filter_params->flags |= field ? VA_DEINTERLACING_BOTTOM_FIELD : 0;
260  } else {
261  filter_params->flags |= VA_DEINTERLACING_BOTTOM_FIELD_FIRST;
262  filter_params->flags |= field ? 0 : VA_DEINTERLACING_BOTTOM_FIELD;
263  }
264  filter_params_addr = NULL;
265  vas = vaUnmapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0]);
266  if (vas != VA_STATUS_SUCCESS)
267  av_log(avctx, AV_LOG_ERROR, "Failed to unmap filter parameter "
268  "buffer: %d (%s).\n", vas, vaErrorStr(vas));
269 
270  params.filters = &vpp_ctx->filter_buffers[0];
271  params.num_filters = 1;
272 
273  params.forward_references = forward_references;
274  params.num_forward_references =
275  ctx->pipeline_caps.num_forward_references;
276  params.backward_references = backward_references;
277  params.num_backward_references =
278  ctx->pipeline_caps.num_backward_references;
279 
280  } else {
281  params.filters = NULL;
282  params.num_filters = 0;
283  }
284 
285  err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
286  if (err < 0)
287  goto fail;
288 
289  if (ctx->field_rate == 2) {
290  if (field == 0)
291  output_frame->pts = 2 * input_frame->pts;
292  else
293  output_frame->pts = input_frame->pts +
294  ctx->frame_queue[current_frame_index + 1]->pts;
295  }
296  output_frame->interlaced_frame = 0;
297 
298  av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
300  output_frame->width, output_frame->height, output_frame->pts);
301 
302  err = ff_filter_frame(outlink, output_frame);
303  if (err < 0)
304  break;
305  }
306 
307  return err;
308 
309 fail:
310  if (filter_params_addr)
311  vaUnmapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0]);
313  return err;
314 }
315 
317 {
318  VAAPIVPPContext *vpp_ctx = avctx->priv;
319 
320  ff_vaapi_vpp_ctx_init(avctx);
323  vpp_ctx->output_format = AV_PIX_FMT_NONE;
324 
325  return 0;
326 }
327 
328 #define OFFSET(x) offsetof(DeintVAAPIContext, x)
329 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
330 static const AVOption deint_vaapi_options[] = {
331  { "mode", "Deinterlacing mode",
332  OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = VAProcDeinterlacingNone },
333  VAProcDeinterlacingNone, VAProcDeinterlacingCount - 1, FLAGS, "mode" },
334  { "default", "Use the highest-numbered (and therefore possibly most advanced) deinterlacing algorithm",
335  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingNone }, 0, 0, FLAGS, "mode" },
336  { "bob", "Use the bob deinterlacing algorithm",
337  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingBob }, 0, 0, FLAGS, "mode" },
338  { "weave", "Use the weave deinterlacing algorithm",
339  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingWeave }, 0, 0, FLAGS, "mode" },
340  { "motion_adaptive", "Use the motion adaptive deinterlacing algorithm",
341  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionAdaptive }, 0, 0, FLAGS, "mode" },
342  { "motion_compensated", "Use the motion compensated deinterlacing algorithm",
343  0, AV_OPT_TYPE_CONST, { .i64 = VAProcDeinterlacingMotionCompensated }, 0, 0, FLAGS, "mode" },
344 
345  { "rate", "Generate output at frame rate or field rate",
346  OFFSET(field_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 2, FLAGS, "rate" },
347  { "frame", "Output at frame rate (one frame of output for each field-pair)",
348  0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "rate" },
349  { "field", "Output at field rate (one frame of output for each field)",
350  0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, FLAGS, "rate" },
351 
352  { "auto", "Only deinterlace fields, passing frames through unchanged",
353  OFFSET(auto_enable), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
354 
355  { NULL },
356 };
357 
358 static const AVClass deint_vaapi_class = {
359  .class_name = "deinterlace_vaapi",
360  .item_name = av_default_item_name,
361  .option = deint_vaapi_options,
362  .version = LIBAVUTIL_VERSION_INT,
363 };
364 
365 static const AVFilterPad deint_vaapi_inputs[] = {
366  {
367  .name = "default",
368  .type = AVMEDIA_TYPE_VIDEO,
369  .filter_frame = &deint_vaapi_filter_frame,
370  .config_props = &ff_vaapi_vpp_config_input,
371  },
372  { NULL }
373 };
374 
376  {
377  .name = "default",
378  .type = AVMEDIA_TYPE_VIDEO,
379  .config_props = &deint_vaapi_config_output,
380  },
381  { NULL }
382 };
383 
385  .name = "deinterlace_vaapi",
386  .description = NULL_IF_CONFIG_SMALL("Deinterlacing of VAAPI surfaces"),
387  .priv_size = sizeof(DeintVAAPIContext),
393  .priv_class = &deint_vaapi_class,
394  .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
395 };
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:98
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
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
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:328
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:337
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:979
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:329
deint_vaapi_config_output
static int deint_vaapi_config_output(AVFilterLink *outlink)
Definition: vf_deinterlace_vaapi.c:157
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:112
deint_vaapi_pipeline_uninit
static void deint_vaapi_pipeline_uninit(AVFilterContext *avctx)
Definition: vf_deinterlace_vaapi.c:65
deint_vaapi_init
static av_cold int deint_vaapi_init(AVFilterContext *avctx)
Definition: vf_deinterlace_vaapi.c:316
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:303
pixdesc.h
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:396
AVFrame::width
int width
Definition: frame.h:361
AVFrame::top_field_first
int top_field_first
If the content is interlaced, is top field displayed first.
Definition: frame.h:438
AVOption
AVOption.
Definition: opt.h:247
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:149
video.h
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:317
formats.h
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:348
deint_vaapi_mode_name
static const char * deint_vaapi_mode_name(int mode)
Definition: vf_deinterlace_vaapi.c:51
fail
#define fail()
Definition: checkasm.h:136
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:52
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
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
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:1225
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
ff_vf_deinterlace_vaapi
const AVFilter ff_vf_deinterlace_vaapi
Definition: vf_deinterlace_vaapi.c:384
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:375
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:358
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:537
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:341
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
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:77
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
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
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:116
deint_vaapi_options
static const AVOption deint_vaapi_options[]
Definition: vf_deinterlace_vaapi.c:330
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:376
output_frame
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
Definition: h264dec.c:824
internal.h
AVFrame::interlaced_frame
int interlaced_frame
The content of the picture is interlaced.
Definition: frame.h:433
VAAPIVPPContext::output_height
int output_height
Definition: vaapi_vpp.h:49
i
int i
Definition: input.c:406
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:58
AVFilter
Filter definition.
Definition: avfilter.h:145
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:361
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:224
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:333
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:243
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
deint_vaapi_filter_frame
static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
Definition: vf_deinterlace_vaapi.c:175
DeintVAAPIContext
Definition: vf_deinterlace_vaapi.c:33
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233
deint_vaapi_inputs
static const AVFilterPad deint_vaapi_inputs[]
Definition: vf_deinterlace_vaapi.c:365
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:2460
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:345