FFmpeg
vf_amf_common.h
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 #ifndef AVFILTER_AMF_COMMON_H
20 #define AVFILTER_AMF_COMMON_H
21 
22 #include "avfilter.h"
23 
24 #include "AMF/core/Surface.h"
25 #include "AMF/components/Component.h"
27 
28 typedef struct AMFFilterContext {
29  const AVClass *class;
30 
31  int width, height;
36  int primaries;
37  int trc;
38  int fill;
41 
42  // HQScaler properties
43  int algorithm;
44  float sharpness;
45 
46  char *w_expr;
47  char *h_expr;
48  char *format_str;
51  int reset_sar;
52 
53  AMFComponent *component;
55 
59 
63 
66 int amf_init_filter_config(AVFilterLink *outlink, enum AVPixelFormat *in_format);
67 int amf_copy_surface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface* surface);
68 void amf_free_amfsurface(void *opaque, uint8_t *data);
69 AVFrame *amf_amfsurface_to_avframe(AVFilterContext *avctx, AMFSurface* pSurface);
70 int amf_avframe_to_amfsurface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface** ppSurface);
71 int amf_setup_input_output_formats(AVFilterContext *avctx, const enum AVPixelFormat *input_pix_fmts, const enum AVPixelFormat *output_pix_fmts);
73 
74 #endif /* AVFILTER_AMF_COMMON_H */
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
AMFFilterContext::hwframes_out_ref
AVBufferRef * hwframes_out_ref
Definition: vf_amf_common.h:57
AMFFilterContext::primaries
int primaries
Definition: vf_amf_common.h:36
amf_avframe_to_amfsurface
int amf_avframe_to_amfsurface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface **ppSurface)
Definition: vf_amf_common.c:442
AMFFilterContext::amf_device_ref
AVBufferRef * amf_device_ref
Definition: vf_amf_common.h:54
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
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:410
data
const char data[16]
Definition: mxf.c:149
AMFFilterContext::keep_ratio
int keep_ratio
Definition: vf_amf_common.h:40
AMFFilterContext::fill_color
int fill_color
Definition: vf_amf_common.h:39
AMFFilterContext::hwframes_in_ref
AVBufferRef * hwframes_in_ref
Definition: vf_amf_common.h:56
amf_filter_filter_frame
int amf_filter_filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_amf_common.c:74
amf_setup_input_output_formats
int amf_setup_input_output_formats(AVFilterContext *avctx, const enum AVPixelFormat *input_pix_fmts, const enum AVPixelFormat *output_pix_fmts)
Definition: vf_amf_common.c:171
AMFFilterContext::h_expr
char * h_expr
Definition: vf_amf_common.h:47
amf_free_amfsurface
void amf_free_amfsurface(void *opaque, uint8_t *data)
Definition: vf_amf_common.c:366
AMFFilterContext
Definition: vf_amf_common.h:28
amf_copy_surface
int amf_copy_surface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface *surface)
Definition: vf_amf_common.c:235
hwcontext_amf.h
AMFFilterContext::scale_type
int scale_type
Definition: vf_amf_common.h:33
AMFFilterContext::fill
int fill
Definition: vf_amf_common.h:38
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
AMFFilterContext::height
int height
Definition: vf_amf_common.h:31
AMFFilterContext::format_str
char * format_str
Definition: vf_amf_common.h:48
AMFFilterContext::trc
int trc
Definition: vf_amf_common.h:37
AMFFilterContext::force_original_aspect_ratio
int force_original_aspect_ratio
Definition: vf_amf_common.h:49
AMFFilterContext::format
enum AVPixelFormat format
Definition: vf_amf_common.h:32
AVAMFDeviceContext
This struct is allocated as AVHWDeviceContext.hwctx.
Definition: hwcontext_amf.h:33
AMFFilterContext::force_divisible_by
int force_divisible_by
Definition: vf_amf_common.h:50
amf_filter_uninit
void amf_filter_uninit(AVFilterContext *avctx)
Definition: vf_amf_common.c:58
AMFFilterContext::sharpness
float sharpness
Definition: vf_amf_common.h:44
AMFFilterContext::reset_sar
int reset_sar
Definition: vf_amf_common.h:51
amf_amfsurface_to_avframe
AVFrame * amf_amfsurface_to_avframe(AVFilterContext *avctx, AMFSurface *pSurface)
Definition: vf_amf_common.c:372
amf_init_filter_config
int amf_init_filter_config(AVFilterLink *outlink, enum AVPixelFormat *in_format)
Definition: vf_amf_common.c:259
AMFFilterContext::w_expr
char * w_expr
Definition: vf_amf_common.h:46
AMFFilterContext::width
int width
Definition: vf_amf_common.h:31
frame
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
AMFFilterContext::component
AMFComponent * component
Definition: vf_amf_common.h:53
AMFFilterContext::color_range
int color_range
Definition: vf_amf_common.h:35
avfilter.h
AMFFilterContext::hwdevice_ref
AVBufferRef * hwdevice_ref
Definition: vf_amf_common.h:58
AVFilterContext
An instance of a filter.
Definition: avfilter.h:257
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
AMFFilterContext::color_profile
int color_profile
Definition: vf_amf_common.h:34
AMFFilterContext::amf_device_ctx
AVAMFDeviceContext * amf_device_ctx
Definition: vf_amf_common.h:60
AMFFilterContext::algorithm
int algorithm
Definition: vf_amf_common.h:43
AMFFilterContext::local_context
int local_context
Definition: vf_amf_common.h:61
amf_filter_init
int amf_filter_init(AVFilterContext *avctx)
Definition: vf_amf_common.c:41