From patchwork Tue Jan 21 08:41:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 17445 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id DA68E44B82E for ; Tue, 21 Jan 2020 10:42:12 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B969968A955; Tue, 21 Jan 2020 10:42:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0FCF168A955 for ; Tue, 21 Jan 2020 10:42:04 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 00:42:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,345,1574150400"; d="scan'208";a="399593644" Received: from icl-dev.sh.intel.com ([10.239.158.73]) by orsmga005.jf.intel.com with ESMTP; 21 Jan 2020 00:42:01 -0800 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Jan 2020 16:41:06 +0800 Message-Id: <1579596066-24850-1-git-send-email-linjie.fu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH] lavfi/vf_scale_qsv: add extra_hw_frames support X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" While using scale_qsv together with lookahead, extra_hw_frames is required to allocate enough memory. Fix #8379. Signed-off-by: Linjie Fu --- libavfilter/vf_scale_qsv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c index 1cf5367..784414a 100644 --- a/libavfilter/vf_scale_qsv.c +++ b/libavfilter/vf_scale_qsv.c @@ -205,6 +205,8 @@ static int init_out_pool(AVFilterContext *ctx, out_frames_ctx->height = FFALIGN(out_height, 16); out_frames_ctx->sw_format = out_format; out_frames_ctx->initial_pool_size = 4; + if (ctx->extra_hw_frames > 0) + out_frames_ctx->initial_pool_size += ctx->extra_hw_frames; out_frames_hwctx->frame_type = in_frames_hwctx->frame_type;