mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-14 11:00:08 +01:00
Merge commit '29a8ed766354c45c9be4b8512c5b2eb25a450cdc'
* commit '29a8ed766354c45c9be4b8512c5b2eb25a450cdc': lavf/qsvvpp: bypass vpp if not needed. Merged-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#include "libavutil/eval.h"
|
#include "libavutil/eval.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
|
#include "libavutil/mathematics.h"
|
||||||
|
|
||||||
#include "formats.h"
|
#include "formats.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
@@ -249,6 +250,7 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
QSVVPPParam param = { NULL };
|
QSVVPPParam param = { NULL };
|
||||||
QSVVPPCrop crop = { 0 };
|
QSVVPPCrop crop = { 0 };
|
||||||
mfxExtBuffer *ext_buf[ENH_FILTERS_COUNT];
|
mfxExtBuffer *ext_buf[ENH_FILTERS_COUNT];
|
||||||
|
AVFilterLink *inlink = ctx->inputs[0];
|
||||||
|
|
||||||
outlink->w = vpp->out_width;
|
outlink->w = vpp->out_width;
|
||||||
outlink->h = vpp->out_height;
|
outlink->h = vpp->out_height;
|
||||||
@@ -320,14 +322,34 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->procamp_conf;
|
param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->procamp_conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ff_qsvvpp_create(ctx, &vpp->qsv, ¶m);
|
if (vpp->use_frc || vpp->use_crop || vpp->deinterlace || vpp->denoise ||
|
||||||
|
vpp->detail || vpp->procamp || inlink->w != outlink->w || inlink->h != outlink->h)
|
||||||
|
return ff_qsvvpp_create(ctx, &vpp->qsv, ¶m);
|
||||||
|
else {
|
||||||
|
av_log(ctx, AV_LOG_VERBOSE, "qsv vpp pass through mode.\n");
|
||||||
|
if (inlink->hw_frames_ctx)
|
||||||
|
outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
|
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
|
||||||
{
|
{
|
||||||
VPPContext *vpp = inlink->dst->priv;
|
int ret = 0;
|
||||||
|
AVFilterContext *ctx = inlink->dst;
|
||||||
|
VPPContext *vpp = inlink->dst->priv;
|
||||||
|
AVFilterLink *outlink = ctx->outputs[0];
|
||||||
|
|
||||||
return ff_qsvvpp_filter_frame(vpp->qsv, inlink, picref);
|
if (vpp->qsv)
|
||||||
|
ret = ff_qsvvpp_filter_frame(vpp->qsv, inlink, picref);
|
||||||
|
else {
|
||||||
|
if (picref->pts != AV_NOPTS_VALUE)
|
||||||
|
picref->pts = av_rescale_q(picref->pts, inlink->time_base, outlink->time_base);
|
||||||
|
ret = ff_filter_frame(outlink, picref);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int query_formats(AVFilterContext *ctx)
|
static int query_formats(AVFilterContext *ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user