Commit 5051b7f8 authored by Mark Thompson's avatar Mark Thompson

lavfi/vaapi: Improve support for colour properties

Attempts to pick the set of supported colour properties best matching the
input.  Output is then set with the same values, except for the colour
matrix which may change when converting between RGB and YUV.
parent 5fb9eb9e
This diff is collapsed.
......@@ -68,8 +68,6 @@ int ff_vaapi_vpp_config_input(AVFilterLink *inlink);
int ff_vaapi_vpp_config_output(AVFilterLink *outlink);
int ff_vaapi_vpp_colour_standard(enum AVColorSpace av_cs);
int ff_vaapi_vpp_init_params(AVFilterContext *avctx,
VAProcPipelineParameterBuffer *params,
const AVFrame *input_frame,
......
......@@ -237,6 +237,10 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail;
}
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
return err;
err = ff_vaapi_vpp_init_params(avctx, &params,
input_frame, output_frame);
if (err < 0)
......@@ -284,10 +288,6 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
if (err < 0)
goto fail;
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
goto fail;
if (ctx->field_rate == 2) {
if (field == 0)
output_frame->pts = 2 * input_frame->pts;
......
......@@ -143,6 +143,10 @@ static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail;
}
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
return err;
err = ff_vaapi_vpp_init_params(avctx, &params,
input_frame, output_frame);
if (err < 0)
......@@ -157,9 +161,6 @@ static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
if (err < 0)
goto fail;
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
goto fail;
av_frame_free(&input_frame);
av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
......
......@@ -148,6 +148,10 @@ static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
goto fail;
}
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
return err;
err = ff_vaapi_vpp_init_params(avctx, &params,
input_frame, output_frame);
if (err < 0)
......@@ -160,9 +164,6 @@ static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
if (err < 0)
goto fail;
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
goto fail;
av_frame_free(&input_frame);
av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
......
......@@ -106,6 +106,10 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail;
}
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
return err;
err = ff_vaapi_vpp_init_params(avctx, &params,
input_frame, output_frame);
if (err < 0)
......@@ -117,10 +121,6 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
if (err < 0)
goto fail;
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
goto fail;
av_frame_free(&input_frame);
av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64"), mode: %s.\n",
......
......@@ -143,6 +143,10 @@ static int transpose_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_fra
goto fail;
}
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
return err;
err = ff_vaapi_vpp_init_params(avctx, &params,
input_frame, output_frame);
if (err < 0)
......@@ -155,9 +159,6 @@ static int transpose_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_fra
if (err < 0)
goto fail;
err = av_frame_copy_props(output_frame, input_frame);
if (err < 0)
goto fail;
av_frame_free(&input_frame);
av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment