FFmpeg
vf_yadif_cuda.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Philip Langdale <philipl@overt.org>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "libavutil/avassert.h"
22 #include "libavutil/hwcontext.h"
24 #include "libavutil/cuda_check.h"
25 #include "internal.h"
26 #include "yadif.h"
27 
28 #include "cuda/load_helper.h"
29 
30 extern const unsigned char ff_vf_yadif_cuda_ptx_data[];
31 extern const unsigned int ff_vf_yadif_cuda_ptx_len;
32 
33 typedef struct DeintCUDAContext {
35 
40 
41  CUmodule cu_module;
42  CUfunction cu_func_uchar;
43  CUfunction cu_func_uchar2;
44  CUfunction cu_func_ushort;
45  CUfunction cu_func_ushort2;
47 
48 #define DIV_UP(a, b) ( ((a) + (b) - 1) / (b) )
49 #define ALIGN_UP(a, b) (((a) + (b) - 1) & ~((b) - 1))
50 #define BLOCKX 32
51 #define BLOCKY 16
52 
53 #define CHECK_CU(x) FF_CUDA_CHECK_DL(ctx, s->hwctx->internal->cuda_dl, x)
54 
55 static CUresult call_kernel(AVFilterContext *ctx, CUfunction func,
56  CUdeviceptr prev, CUdeviceptr cur, CUdeviceptr next,
57  CUarray_format format, int channels,
58  int src_width, // Width is pixels per channel
59  int src_height, // Height is pixels per channel
60  int src_pitch, // Pitch is bytes
61  CUdeviceptr dst,
62  int dst_width, // Width is pixels per channel
63  int dst_height, // Height is pixels per channel
64  int dst_pitch, // Pitch is pixels per channel
65  int parity, int tff)
66 {
67  DeintCUDAContext *s = ctx->priv;
68  CudaFunctions *cu = s->hwctx->internal->cuda_dl;
69  CUtexObject tex_prev = 0, tex_cur = 0, tex_next = 0;
70  int ret;
71  int skip_spatial_check = s->yadif.mode&2;
72 
73  void *args[] = { &dst, &tex_prev, &tex_cur, &tex_next,
74  &dst_width, &dst_height, &dst_pitch,
75  &src_width, &src_height, &parity, &tff,
76  &skip_spatial_check };
77 
78  CUDA_TEXTURE_DESC tex_desc = {
79  .filterMode = CU_TR_FILTER_MODE_POINT,
80  .flags = CU_TRSF_READ_AS_INTEGER,
81  };
82 
83  CUDA_RESOURCE_DESC res_desc = {
84  .resType = CU_RESOURCE_TYPE_PITCH2D,
85  .res.pitch2D.format = format,
86  .res.pitch2D.numChannels = channels,
87  .res.pitch2D.width = src_width,
88  .res.pitch2D.height = src_height,
89  .res.pitch2D.pitchInBytes = src_pitch,
90  };
91 
92  res_desc.res.pitch2D.devPtr = (CUdeviceptr)prev;
93  ret = CHECK_CU(cu->cuTexObjectCreate(&tex_prev, &res_desc, &tex_desc, NULL));
94  if (ret < 0)
95  goto exit;
96 
97  res_desc.res.pitch2D.devPtr = (CUdeviceptr)cur;
98  ret = CHECK_CU(cu->cuTexObjectCreate(&tex_cur, &res_desc, &tex_desc, NULL));
99  if (ret < 0)
100  goto exit;
101 
102  res_desc.res.pitch2D.devPtr = (CUdeviceptr)next;
103  ret = CHECK_CU(cu->cuTexObjectCreate(&tex_next, &res_desc, &tex_desc, NULL));
104  if (ret < 0)
105  goto exit;
106 
107  ret = CHECK_CU(cu->cuLaunchKernel(func,
108  DIV_UP(dst_width, BLOCKX), DIV_UP(dst_height, BLOCKY), 1,
109  BLOCKX, BLOCKY, 1,
110  0, s->hwctx->stream, args, NULL));
111 
112 exit:
113  if (tex_prev)
114  CHECK_CU(cu->cuTexObjectDestroy(tex_prev));
115  if (tex_cur)
116  CHECK_CU(cu->cuTexObjectDestroy(tex_cur));
117  if (tex_next)
118  CHECK_CU(cu->cuTexObjectDestroy(tex_next));
119 
120  return ret;
121 }
122 
123 static void filter(AVFilterContext *ctx, AVFrame *dst,
124  int parity, int tff)
125 {
126  DeintCUDAContext *s = ctx->priv;
127  YADIFContext *y = &s->yadif;
128  CudaFunctions *cu = s->hwctx->internal->cuda_dl;
129  CUcontext dummy;
130  int i, ret;
131 
132  ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
133  if (ret < 0)
134  return;
135 
136  for (i = 0; i < y->csp->nb_components; i++) {
137  CUfunction func;
138  CUarray_format format;
139  int pixel_size, channels;
140  const AVComponentDescriptor *comp = &y->csp->comp[i];
141 
142  if (comp->plane < i) {
143  // We process planes as a whole, so don't reprocess
144  // them for additional components
145  continue;
146  }
147 
148  pixel_size = (comp->depth + comp->shift) / 8;
149  channels = comp->step / pixel_size;
150  if (pixel_size > 2 || channels > 2) {
151  av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", y->csp->name);
152  goto exit;
153  }
154  switch (pixel_size) {
155  case 1:
156  func = channels == 1 ? s->cu_func_uchar : s->cu_func_uchar2;
157  format = CU_AD_FORMAT_UNSIGNED_INT8;
158  break;
159  case 2:
160  func = channels == 1 ? s->cu_func_ushort : s->cu_func_ushort2;
161  format = CU_AD_FORMAT_UNSIGNED_INT16;
162  break;
163  default:
164  av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", y->csp->name);
165  goto exit;
166  }
168  "Deinterlacing plane %d: pixel_size: %d channels: %d\n",
169  comp->plane, pixel_size, channels);
171  (CUdeviceptr)y->prev->data[i],
172  (CUdeviceptr)y->cur->data[i],
173  (CUdeviceptr)y->next->data[i],
174  format, channels,
175  AV_CEIL_RSHIFT(y->cur->width, i ? y->csp->log2_chroma_w : 0),
176  AV_CEIL_RSHIFT(y->cur->height, i ? y->csp->log2_chroma_h : 0),
177  y->cur->linesize[i],
178  (CUdeviceptr)dst->data[i],
179  AV_CEIL_RSHIFT(dst->width, i ? y->csp->log2_chroma_w : 0),
180  AV_CEIL_RSHIFT(dst->height, i ? y->csp->log2_chroma_h : 0),
181  dst->linesize[i] / comp->step,
182  parity, tff);
183  }
184 
185 exit:
186  CHECK_CU(cu->cuCtxPopCurrent(&dummy));
187  return;
188 }
189 
191 {
192  CUcontext dummy;
193  DeintCUDAContext *s = ctx->priv;
194 
195  if (s->hwctx && s->cu_module) {
196  CudaFunctions *cu = s->hwctx->internal->cuda_dl;
197  CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
198  CHECK_CU(cu->cuModuleUnload(s->cu_module));
199  CHECK_CU(cu->cuCtxPopCurrent(&dummy));
200  }
201 
203 
204  av_buffer_unref(&s->device_ref);
205  s->hwctx = NULL;
206  av_buffer_unref(&s->input_frames_ref);
207  s->input_frames = NULL;
208 }
209 
211 {
212  AVFilterContext *ctx = inlink->dst;
213  DeintCUDAContext *s = ctx->priv;
214 
215  if (!inlink->hw_frames_ctx) {
216  av_log(ctx, AV_LOG_ERROR, "A hardware frames reference is "
217  "required to associate the processing device.\n");
218  return AVERROR(EINVAL);
219  }
220 
221  s->input_frames_ref = av_buffer_ref(inlink->hw_frames_ctx);
222  if (!s->input_frames_ref) {
223  av_log(ctx, AV_LOG_ERROR, "A input frames reference create "
224  "failed.\n");
225  return AVERROR(ENOMEM);
226  }
227  s->input_frames = (AVHWFramesContext*)s->input_frames_ref->data;
228 
229  return 0;
230 }
231 
233 {
234  AVHWFramesContext *output_frames;
235  AVFilterContext *ctx = link->src;
236  DeintCUDAContext *s = ctx->priv;
237  YADIFContext *y = &s->yadif;
238  CudaFunctions *cu;
239  int ret = 0;
240  CUcontext dummy;
241 
242  av_assert0(s->input_frames);
243  s->device_ref = av_buffer_ref(s->input_frames->device_ref);
244  if (!s->device_ref) {
245  av_log(ctx, AV_LOG_ERROR, "A device reference create "
246  "failed.\n");
247  return AVERROR(ENOMEM);
248  }
249  s->hwctx = ((AVHWDeviceContext*)s->device_ref->data)->hwctx;
250  cu = s->hwctx->internal->cuda_dl;
251 
252  link->hw_frames_ctx = av_hwframe_ctx_alloc(s->device_ref);
253  if (!link->hw_frames_ctx) {
254  av_log(ctx, AV_LOG_ERROR, "Failed to create HW frame context "
255  "for output.\n");
256  ret = AVERROR(ENOMEM);
257  goto exit;
258  }
259 
260  output_frames = (AVHWFramesContext*)link->hw_frames_ctx->data;
261 
262  output_frames->format = AV_PIX_FMT_CUDA;
263  output_frames->sw_format = s->input_frames->sw_format;
264  output_frames->width = ctx->inputs[0]->w;
265  output_frames->height = ctx->inputs[0]->h;
266 
267  output_frames->initial_pool_size = 4;
268 
270  if (ret < 0)
271  goto exit;
272 
274  if (ret < 0) {
275  av_log(ctx, AV_LOG_ERROR, "Failed to initialise CUDA frame "
276  "context for output: %d\n", ret);
277  goto exit;
278  }
279 
281  if (ret < 0)
282  goto exit;
283 
284  y->csp = av_pix_fmt_desc_get(output_frames->sw_format);
285  y->filter = filter;
286 
287  ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
288  if (ret < 0)
289  goto exit;
290 
292  if (ret < 0)
293  goto exit;
294 
295  ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func_uchar, s->cu_module, "yadif_uchar"));
296  if (ret < 0)
297  goto exit;
298 
299  ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func_uchar2, s->cu_module, "yadif_uchar2"));
300  if (ret < 0)
301  goto exit;
302 
303  ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func_ushort, s->cu_module, "yadif_ushort"));
304  if (ret < 0)
305  goto exit;
306 
307  ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func_ushort2, s->cu_module, "yadif_ushort2"));
308  if (ret < 0)
309  goto exit;
310 
311 exit:
312  CHECK_CU(cu->cuCtxPopCurrent(&dummy));
313 
314  return ret;
315 }
316 
317 static const AVClass yadif_cuda_class = {
318  .class_name = "yadif_cuda",
319  .item_name = av_default_item_name,
320  .option = ff_yadif_options,
321  .version = LIBAVUTIL_VERSION_INT,
322  .category = AV_CLASS_CATEGORY_FILTER,
323 };
324 
325 static const AVFilterPad deint_cuda_inputs[] = {
326  {
327  .name = "default",
328  .type = AVMEDIA_TYPE_VIDEO,
329  .filter_frame = ff_yadif_filter_frame,
330  .config_props = config_input,
331  },
332 };
333 
334 static const AVFilterPad deint_cuda_outputs[] = {
335  {
336  .name = "default",
337  .type = AVMEDIA_TYPE_VIDEO,
338  .request_frame = ff_yadif_request_frame,
339  .config_props = config_output,
340  },
341 };
342 
344  .name = "yadif_cuda",
345  .description = NULL_IF_CONFIG_SMALL("Deinterlace CUDA frames"),
346  .priv_size = sizeof(DeintCUDAContext),
347  .priv_class = &yadif_cuda_class,
353  .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
354 };
func
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition: jacosubdec.c:68
AV_PIX_FMT_CUDA
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
Definition: pixfmt.h:260
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
hwcontext_cuda_internal.h
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:351
comp
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition: eamad.c:81
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2965
AVBufferRef::data
uint8_t * data
The data buffer.
Definition: buffer.h:90
AVHWFramesContext::format
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
Definition: hwcontext.h:197
ff_cuda_load_module
int ff_cuda_load_module(void *avctx, AVCUDADeviceContext *hwctx, CUmodule *cu_module, const unsigned char *data, const unsigned int length)
Loads a CUDA module and applies any decompression, if necessary.
Definition: load_helper.c:35
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
YADIFContext::csp
const AVPixFmtDescriptor * csp
Definition: yadif.h:76
DeintCUDAContext::input_frames_ref
AVBufferRef * input_frames_ref
Definition: vf_bwdif_cuda.c:38
av_hwframe_ctx_init
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
Definition: hwcontext.c:322
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:375
AVFrame::width
int width
Definition: frame.h:447
av_hwframe_ctx_alloc
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
Definition: hwcontext.c:248
AVPixFmtDescriptor::name
const char * name
Definition: pixdesc.h:70
av_buffer_ref
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:103
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:170
AVHWFramesContext::width
int width
The allocated dimensions of the frames in this pool.
Definition: hwcontext.h:217
DIV_UP
#define DIV_UP(a, b)
Definition: vf_yadif_cuda.c:48
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:396
DeintCUDAContext::input_frames
AVHWFramesContext * input_frames
Definition: vf_bwdif_cuda.c:39
ff_yadif_config_output_common
int ff_yadif_config_output_common(AVFilterLink *outlink)
Definition: yadif_common.c:218
DeintCUDAContext::hwctx
AVCUDADeviceContext * hwctx
Definition: vf_bwdif_cuda.c:36
DeintCUDAContext::cu_func_uchar
CUfunction cu_func_uchar
Definition: vf_bwdif_cuda.c:42
dummy
int dummy
Definition: motion.c:66
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_yadif_cuda.c:210
DeintCUDAContext::cu_func_uchar2
CUfunction cu_func_uchar2
Definition: vf_bwdif_cuda.c:43
DeintCUDAContext::device_ref
AVBufferRef * device_ref
Definition: vf_bwdif_cuda.c:37
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:33
AVHWDeviceContext
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition: hwcontext.h:60
filter
static void filter(AVFilterContext *ctx, AVFrame *dst, int parity, int tff)
Definition: vf_yadif_cuda.c:123
avassert.h
AV_LOG_TRACE
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition: log.h:206
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
deint_cuda_outputs
static const AVFilterPad deint_cuda_outputs[]
Definition: vf_yadif_cuda.c:334
av_cold
#define av_cold
Definition: attributes.h:90
AVHWFramesContext::height
int height
Definition: hwcontext.h:217
s
#define s(width, name)
Definition: cbs_vp9.c:198
DeintCUDAContext::cu_func_ushort2
CUfunction cu_func_ushort2
Definition: vf_bwdif_cuda.c:45
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:59
format
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 format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
ff_vf_yadif_cuda_ptx_data
const unsigned char ff_vf_yadif_cuda_ptx_data[]
deint_cuda_inputs
static const AVFilterPad deint_cuda_inputs[]
Definition: vf_yadif_cuda.c:325
BLOCKX
#define BLOCKX
Definition: vf_yadif_cuda.c:50
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
ctx
AVFormatContext * ctx
Definition: movenc.c:49
channels
channels
Definition: aptx.h:31
AVPixFmtDescriptor::log2_chroma_w
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
load_helper.h
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
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
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
yadif_cuda_class
static const AVClass yadif_cuda_class
Definition: vf_yadif_cuda.c:317
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
DeintCUDAContext::cu_module
CUmodule cu_module
Definition: vf_bwdif_cuda.c:41
NULL
#define NULL
Definition: coverity.c:32
AVHWFramesContext::sw_format
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Definition: hwcontext.h:210
av_buffer_unref
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition: buffer.c:139
AVComponentDescriptor
Definition: pixdesc.h:30
AVPixFmtDescriptor::nb_components
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:71
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
DeintCUDAContext::yadif
YADIFContext yadif
Definition: vf_bwdif_cuda.c:34
deint_cuda_uninit
static av_cold void deint_cuda_uninit(AVFilterContext *ctx)
Definition: vf_yadif_cuda.c:190
CHECK_CU
#define CHECK_CU(x)
Definition: vf_yadif_cuda.c:53
AV_CLASS_CATEGORY_FILTER
@ AV_CLASS_CATEGORY_FILTER
Definition: log.h:36
ff_vf_yadif_cuda_ptx_len
const unsigned int ff_vf_yadif_cuda_ptx_len
ff_yadif_options
const AVOption ff_yadif_options[]
Definition: yadif_common.c:271
yadif.h
config_output
static int config_output(AVFilterLink *link)
Definition: vf_yadif_cuda.c:232
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:94
YADIFContext::filter
void(* filter)(AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff)
Definition: yadif.h:65
parity
mcdeint parity
Definition: vf_mcdeint.c:281
DeintCUDAContext
Definition: vf_bwdif_cuda.c:33
YADIFContext::prev
AVFrame * prev
Definition: yadif.h:62
internal.h
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:172
call_kernel
static CUresult call_kernel(AVFilterContext *ctx, CUfunction func, CUdeviceptr prev, CUdeviceptr cur, CUdeviceptr next, CUarray_format format, int channels, int src_width, int src_height, int src_pitch, CUdeviceptr dst, int dst_width, int dst_height, int dst_pitch, int parity, int tff)
Definition: vf_yadif_cuda.c:55
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
YADIFContext
Definition: yadif.h:51
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:39
BLOCKY
#define BLOCKY
Definition: vf_yadif_cuda.c:51
AVFilter
Filter definition.
Definition: avfilter.h:166
AVHWFramesContext
This struct describes a set or pool of "hardware" frames (i.e.
Definition: hwcontext.h:115
AVCUDADeviceContext
This struct is allocated as AVHWDeviceContext.hwctx.
Definition: hwcontext_cuda.h:42
ret
ret
Definition: filter_design.txt:187
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
cuda_check.h
ff_vf_yadif_cuda
const AVFilter ff_vf_yadif_cuda
Definition: vf_yadif_cuda.c:343
AVFrame::hw_frames_ctx
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame.
Definition: frame.h:726
AVFrame::height
int height
Definition: frame.h:447
YADIFContext::next
AVFrame * next
Definition: yadif.h:61
ff_yadif_request_frame
int ff_yadif_request_frame(AVFilterLink *link)
Definition: yadif_common.c:184
AVPixFmtDescriptor::comp
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:105
AVFilterContext
An instance of a filter.
Definition: avfilter.h:407
AVHWFramesContext::initial_pool_size
int initial_pool_size
Initial size of the frame pool.
Definition: hwcontext.h:187
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
ff_yadif_uninit
void ff_yadif_uninit(AVFilterContext *ctx)
Definition: yadif_common.c:256
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:155
hwcontext.h
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:420
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
DeintCUDAContext::cu_func_ushort
CUfunction cu_func_ushort
Definition: vf_bwdif_cuda.c:44
YADIFContext::cur
AVFrame * cur
Definition: yadif.h:60
AVPixFmtDescriptor::log2_chroma_h
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89
ff_yadif_filter_frame
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: yadif_common.c:104
ff_filter_init_hw_frames
int ff_filter_init_hw_frames(AVFilterContext *avctx, AVFilterLink *link, int default_pool_size)
Perform any additional setup required for hardware frames.
Definition: avfilter.c:1613