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
59static 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++) {
83 if (ret < 0 && ret !=
AVERROR(EAGAIN))
88 for (
int i = 0;
i <
ctx->nb_inputs;
i++)
105 mfxVPPCompInputStream *
is = sctx->
comp_conf.InputStream;
113 in_format = inlink0->
format;
117 for (
int i = 1;
i < sctx->
base.nb_inputs;
i++) {
140 if (sctx->
base.fillcolor_enable) {
143 rgb2yuv(sctx->
base.fillcolor[0] / 255.0, sctx->
base.fillcolor[1] / 255.0,
144 sctx->
base.fillcolor[2] / 255.0, &
Y, &
U, &
V, depth);
154 for (
int i = 0;
i < sctx->
base.nb_inputs;
i++) {
155 is[
i].DstX = sctx->
base.regions[
i].x;
156 is[
i].DstY = sctx->
base.regions[
i].y;
157 is[
i].DstW = sctx->
base.regions[
i].width;
158 is[
i].DstH = sctx->
base.regions[
i].height;
159 is[
i].GlobalAlpha = 255;
160 is[
i].GlobalAlphaEnable = 0;
161 is[
i].PixelAlphaEnable = 0;
193 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 AVFormatContext * ctx
simple assert() macros that are a bit more flexible than ISO C assert().
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
#define is(width, name, range_min, range_max, subs,...)
#define i(width, name, range_min, range_max)
#define fs(width, name, subs,...)
common internal and external API header
simple arithmetic expression evaluator
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define u(width, name, range_min, range_max)
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
static FilterLink * ff_filter_link(AVFilterLink *link)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
AVPixelFormat
Pixel format.
@ 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...
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picref, AVFrame *propref)
int ff_qsvvpp_close(AVFilterContext *avctx)
int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
Intel Quick Sync Video VPP base function.
static int stack_init(AVFilterContext *avctx)
static int config_comm_output(AVFilterLink *outlink)
#define DEFINE_XSTACK_OPTIONS(api)
#define DEFINE_VSTACK_OPTIONS(api)
#define DEFINE_STACK_FILTER(category, api, capi, filter_flags)
#define DEFINE_HSTACK_OPTIONS(api)
static av_cold void stack_uninit(AVFilterContext *avctx)
uint8_t * data
The data buffer.
void * priv
private data for use by the filter
A link between two filters.
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int format
agreed upon media format
This structure describes decoded (raw) audio or video data.
This struct describes a set or pool of "hardware" frames (i.e.
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
Link properties exposed to filter code, but not external callers.
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
int(* filter_frame)(AVFilterLink *outlink, AVFrame *frame)
enum AVPixelFormat out_sw_format
mfxExtVPPComposite comp_conf
static int filter_callback(AVFilterLink *outlink, AVFrame *frame)
static int qsv_stack_init(AVFilterContext *ctx)
static av_cold void qsv_stack_uninit(AVFilterContext *ctx)
static enum AVPixelFormat qsv_stack_pix_fmts[]
static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth)
static int config_output(AVFilterLink *outlink)
static int filter_callback(AVFilterLink *outlink, AVFrame *frame)
static int process_frame(FFFrameSync *fs)