X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libavfilter%2Fvf_scale_vaapi.c;h=54c055f0a9320ab46e3f19f94da3dd1b9b726b4d;hb=2b01b7918beebe7b392ebf255f887e396a59e4c6;hp=a371077ee02d08f68a28624d27e0f7456264a2ca;hpb=55e5af3c03898ffbac352fe4af83208fa4129c71;p=platform%2Fupstream%2Fffmpeg.git diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c index a371077..54c055f 100644 --- a/libavfilter/vf_scale_vaapi.c +++ b/libavfilter/vf_scale_vaapi.c @@ -22,7 +22,6 @@ #include "libavutil/pixdesc.h" #include "avfilter.h" -#include "formats.h" #include "internal.h" #include "scale_eval.h" #include "video.h" @@ -85,6 +84,16 @@ static int scale_vaapi_config_output(AVFilterLink *outlink) ff_scale_adjust_dimensions(inlink, &vpp_ctx->output_width, &vpp_ctx->output_height, ctx->force_original_aspect_ratio, ctx->force_divisible_by); + if (inlink->w == vpp_ctx->output_width && inlink->h == vpp_ctx->output_height && + (vpp_ctx->input_frames->sw_format == vpp_ctx->output_format || + vpp_ctx->output_format == AV_PIX_FMT_NONE) && + ctx->colour_primaries == AVCOL_PRI_UNSPECIFIED && + ctx->colour_transfer == AVCOL_TRC_UNSPECIFIED && + ctx->colour_matrix == AVCOL_SPC_UNSPECIFIED && + ctx->colour_range == AVCOL_RANGE_UNSPECIFIED && + ctx->chroma_location == AVCHROMA_LOC_UNSPECIFIED) + vpp_ctx->passthrough = 1; + err = ff_vaapi_vpp_config_output(outlink); if (err < 0) return err; @@ -111,6 +120,9 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) av_get_pix_fmt_name(input_frame->format), input_frame->width, input_frame->height, input_frame->pts); + if (vpp_ctx->passthrough) + return ff_filter_frame(outlink, input_frame); + if (vpp_ctx->va_context == VA_INVALID_ID) return AVERROR(EINVAL);