Go to the documentation of this file.
24 #include "config_components.h"
45 #define HSTACK_NAME "hstack_qsv"
46 #define VSTACK_NAME "vstack_qsv"
47 #define XSTACK_NAME "xstack_qsv"
48 #define HWContext QSVVPPContext
49 #define StackHWContext StackQSVContext
59 static void rgb2yuv(
float r,
float g,
float b,
int *y,
int *
u,
int *v,
int depth)
61 *y = ((0.21260*219.0/255.0) *
r + (0.71520*219.0/255.0) *
g +
62 (0.07220*219.0/255.0) *
b) * ((1 << depth) - 1);
63 *
u = (-(0.11457*224.0/255.0) *
r - (0.38543*224.0/255.0) *
g +
64 (0.50000*224.0/255.0) *
b + 0.5) * ((1 << depth) - 1);
65 *v = ((0.50000*224.0/255.0) *
r - (0.45415*224.0/255.0) *
g -
66 (0.04585*224.0/255.0) *
b + 0.5) * ((1 << depth) - 1);
76 for (
int i = 0;
i <
ctx->nb_inputs;
i++) {
85 for (
int i = 0;
i <
ctx->nb_inputs;
i++)
101 mfxVPPCompInputStream *
is = sctx->
comp_conf.InputStream;
109 in_format = inlink0->
format;
124 }
else if (hwfc0->
device_ctx != hwfc->device_ctx) {
154 is[
i].GlobalAlpha = 255;
155 is[
i].GlobalAlphaEnable = 0;
156 is[
i].PixelAlphaEnable = 0;
188 sctx->
comp_conf.Header.BufferId = MFX_EXTBUFF_VPP_COMPOSITE;
235 #if CONFIG_HSTACK_QSV_FILTER
242 #if CONFIG_VSTACK_QSV_FILTER
249 #if CONFIG_XSTACK_QSV_FILTER
static av_cold void qsv_stack_uninit(AVFilterContext *ctx)
static int qsv_stack_query_formats(AVFilterContext *ctx)
AVPixelFormat
Pixel 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 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
The official guide to swscale for confused that is
#define u(width, name, range_min, range_max)
enum AVPixelFormat out_sw_format
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
uint8_t * data
The data buffer.
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
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
AVRational time_base
Time base for the output events.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static int process_frame(FFFrameSync *fs)
A link between two filters.
static int config_output(AVFilterLink *outlink)
void * priv
private data for use by the filter
#define DEFINE_STACK_FILTER(category, api, capi, filter_flags)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold void stack_uninit(AVFilterContext *avctx)
#define DEFINE_HSTACK_OPTIONS(api)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static enum AVPixelFormat pixel_formats[]
int ff_qsvvpp_close(AVFilterContext *avctx)
#define fs(width, name, subs,...)
#define DEFINE_XSTACK_OPTIONS(api)
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
int64_t pts
Timestamp of the current event.
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
int format
agreed upon media format
#define DEFINE_VSTACK_OPTIONS(api)
AVFilterContext * src
source filter
FF_FILTER_FORWARD_WANTED(outlink, inlink)
StackItemRegion * regions
#define i(width, name, range_min, range_max)
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
static int config_comm_output(AVFilterLink *outlink)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int(* filter_frame)(AVFilterLink *outlink, AVFrame *frame)
int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
void * av_calloc(size_t nmemb, size_t size)
This struct describes a set or pool of "hardware" frames (i.e.
static int filter_callback(AVFilterLink *outlink, AVFrame *frame)
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth)
int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picref)
static int stack_init(AVFilterContext *avctx)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
static int qsv_stack_init(AVFilterContext *ctx)
mfxExtVPPComposite comp_conf