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"
28 
29 typedef struct AMFFilterContext {
30  const AVClass *class;
31 
32  int width, height;
37  int in_trc;
41  int out_trc;
42  int fill;
45 
46  char *disp_master;
47  char *max_cll;
50 
51  // HQScaler properties
52  int algorithm;
53  float sharpness;
54 
55  char *w_expr;
56  char *h_expr;
57  char *format_str;
60  int reset_sar;
61 
62  AMFComponent *component;
64 
68 
72 
75 int amf_init_filter_config(AVFilterLink *outlink, enum AVPixelFormat *in_format);
76 int amf_copy_surface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface* surface);
77 void amf_free_amfsurface(void *opaque, uint8_t *data);
78 AVFrame *amf_amfsurface_to_avframe(AVFilterContext *avctx, AMFSurface* pSurface);
79 int amf_avframe_to_amfsurface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface** ppSurface);
80 int amf_setup_input_output_formats(AVFilterContext *avctx, const enum AVPixelFormat *input_pix_fmts, const enum AVPixelFormat *output_pix_fmts);
82 
83 #endif /* AVFILTER_AMF_COMMON_H */
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
AMFFilterContext::disp_master
char * disp_master
Definition: vf_amf_common.h:46
AMFFilterContext::in_primaries
int in_primaries
Definition: vf_amf_common.h:36
AMFFilterContext::hwframes_out_ref
AVBufferRef * hwframes_out_ref
Definition: vf_amf_common.h:66
amf_avframe_to_amfsurface
int amf_avframe_to_amfsurface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface **ppSurface)
Definition: vf_amf_common.c:451
AMFFilterContext::amf_device_ref
AVBufferRef * amf_device_ref
Definition: vf_amf_common.h:63
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:427
data
const char data[16]
Definition: mxf.c:149
AMFFilterContext::keep_ratio
int keep_ratio
Definition: vf_amf_common.h:44
AVContentLightMetadata
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
Definition: mastering_display_metadata.h:107
AMFFilterContext::fill_color
int fill_color
Definition: vf_amf_common.h:43
AMFFilterContext::hwframes_in_ref
AVBufferRef * hwframes_in_ref
Definition: vf_amf_common.h:65
amf_filter_filter_frame
int amf_filter_filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_amf_common.c:80
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:180
AMFFilterContext::h_expr
char * h_expr
Definition: vf_amf_common.h:56
amf_free_amfsurface
void amf_free_amfsurface(void *opaque, uint8_t *data)
Definition: vf_amf_common.c:375
AMFFilterContext
Definition: vf_amf_common.h:29
amf_copy_surface
int amf_copy_surface(AVFilterContext *avctx, const AVFrame *frame, AMFSurface *surface)
Definition: vf_amf_common.c:244
hwcontext_amf.h
AMFFilterContext::scale_type
int scale_type
Definition: vf_amf_common.h:34
AMFFilterContext::fill
int fill
Definition: vf_amf_common.h:42
AMFFilterContext::out_primaries
int out_primaries
Definition: vf_amf_common.h:40
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
AMFFilterContext::height
int height
Definition: vf_amf_common.h:32
AMFFilterContext::in_trc
int in_trc
Definition: vf_amf_common.h:37
AMFFilterContext::out_trc
int out_trc
Definition: vf_amf_common.h:41
AMFFilterContext::format_str
char * format_str
Definition: vf_amf_common.h:57
AMFFilterContext::out_color_range
int out_color_range
Definition: vf_amf_common.h:39
AMFFilterContext::force_original_aspect_ratio
int force_original_aspect_ratio
Definition: vf_amf_common.h:58
AMFFilterContext::format
enum AVPixelFormat format
Definition: vf_amf_common.h:33
AMFFilterContext::master_display
AVMasteringDisplayMetadata * master_display
Definition: vf_amf_common.h:48
AVAMFDeviceContext
This struct is allocated as AVHWDeviceContext.hwctx.
Definition: hwcontext_amf.h:35
AMFFilterContext::force_divisible_by
int force_divisible_by
Definition: vf_amf_common.h:59
amf_filter_uninit
void amf_filter_uninit(AVFilterContext *avctx)
Definition: vf_amf_common.c:58
AMFFilterContext::sharpness
float sharpness
Definition: vf_amf_common.h:53
AMFFilterContext::reset_sar
int reset_sar
Definition: vf_amf_common.h:60
amf_amfsurface_to_avframe
AVFrame * amf_amfsurface_to_avframe(AVFilterContext *avctx, AMFSurface *pSurface)
Definition: vf_amf_common.c:381
amf_init_filter_config
int amf_init_filter_config(AVFilterLink *outlink, enum AVPixelFormat *in_format)
Definition: vf_amf_common.c:268
AVMasteringDisplayMetadata
Mastering display metadata capable of representing the color volume of the display used to master the...
Definition: mastering_display_metadata.h:38
AMFFilterContext::w_expr
char * w_expr
Definition: vf_amf_common.h:55
AMFFilterContext::width
int width
Definition: vf_amf_common.h:32
AMFFilterContext::max_cll
char * max_cll
Definition: vf_amf_common.h:47
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:265
AMFFilterContext::component
AMFComponent * component
Definition: vf_amf_common.h:62
AMFFilterContext::in_color_range
int in_color_range
Definition: vf_amf_common.h:35
avfilter.h
AMFFilterContext::hwdevice_ref
AVBufferRef * hwdevice_ref
Definition: vf_amf_common.h:67
AMFFilterContext::light_meta
AVContentLightMetadata * light_meta
Definition: vf_amf_common.h:49
AVFilterContext
An instance of a filter.
Definition: avfilter.h:274
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
mastering_display_metadata.h
AMFFilterContext::color_profile
int color_profile
Definition: vf_amf_common.h:38
AMFFilterContext::amf_device_ctx
AVAMFDeviceContext * amf_device_ctx
Definition: vf_amf_common.h:69
AMFFilterContext::algorithm
int algorithm
Definition: vf_amf_common.h:52
AMFFilterContext::local_context
int local_context
Definition: vf_amf_common.h:70
amf_filter_init
int amf_filter_init(AVFilterContext *avctx)
Definition: vf_amf_common.c:41