From patchwork Tue Dec 1 22:40:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: galinart X-Patchwork-Id: 24231 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 48B6C449F2A for ; Wed, 2 Dec 2020 01:51:00 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 263D4688111; Wed, 2 Dec 2020 01:51:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C269B687F3C for ; Wed, 2 Dec 2020 01:50:53 +0200 (EET) Received: by mail-ej1-f67.google.com with SMTP id jx16so8215271ejb.10 for ; Tue, 01 Dec 2020 15:50:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ik2vn8LJBMfAy8cR7UQTRBRqehgoQbKb02iZDXOmQDM=; b=Tm38xVo73NzGYzv6jzW8ndTHyv+sDa+UdQaf2+e0/S+p6mekdRkjwIDk19OVKF4H0F FF7RxjhXAwKA6NZQrN+goiPA6sxKSKoBAU61PL4p1YNAVIBQ+b50pwMuQiEAiNOs1k3c QbGpCp1Q/zollo+bKCvIxmV5uTey6WahNRi9J7Myz8Yn7eV2O9O9siWPjFmtUG9H6Fr9 Fyql55Xs731SSZa2FbDrgRfDyJugfVhzIdehIP1svdv8vy0J8vpn5qN1bdoRTG8U1G8K xcqheVTf+MPVSMP1s/52FbYlZXh90QL9JKS73kQiaPC91FVqIqbo/eh73jDnRPfiNE7C Betw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ik2vn8LJBMfAy8cR7UQTRBRqehgoQbKb02iZDXOmQDM=; b=AHMm5KDnQCi21XQSjK3smNH2YMVDpw3imzGC70Vuzto8WdugI3kKXPf59iTHcXFIXH LJVnVTszGs8HyD5EOzHjW6oRnX6WTGLZtxai0Rsr887NgZoJiCQhalyUgX/Lrqq3A7mE SHSqLUZt7FoLExKC8UqNYk3atvBFJoMzhw27UThj2aOMEqY72IQDiKO1VsusG4Ykprbj e56Si238vQV0CSeayQ97NmuE3rcH3REYB51SjXWngHeM/Hb+PlYINArmK54IlvzoyiN5 V70+pjqU6dweFaHcDFd5cImFATjdqf+LanVTd5U1nuB/lbpVt9hGBbMOJUW8V9OmctFc lZJw== X-Gm-Message-State: AOAM533Rif+GuodWdftqpSeELOFu2tu+80g1LFYIrWgSnv8L72UbBkEO LQYNwZhWnNT+Ct7Qqjyf1fLZFXCizxgkEQFN X-Google-Smtp-Source: ABdhPJycI7KVxMxm7K+NoGb3rz7x7pIRJoxNxyIHXl2eQH1zHW9z/aU/yT9bISRVfFG2z01gDoGM3Q== X-Received: by 2002:a5d:4d92:: with SMTP id b18mr6949756wru.260.1606862434606; Tue, 01 Dec 2020 14:40:34 -0800 (PST) Received: from localhost.localdomain ([2a02:c7f:3015:4e00:410d:9860:8e11:8265]) by smtp.googlemail.com with ESMTPSA id g25sm1673698wmk.5.2020.12.01.14.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 14:40:34 -0800 (PST) From: Artem Galin X-Google-Original-From: Artem Galin To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Dec 2020 22:40:07 +0000 Message-Id: <20201201224008.19787-1-artem.galin@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavf/qsv_scale: fix green stripe at the bottom 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: Artem Galin Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Explicitly set region of interest for input surfaces. Signed-off-by: Artem Galin --- libavfilter/vf_scale_qsv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c index 5064dcbb60..321adbbb18 100644 --- a/libavfilter/vf_scale_qsv.c +++ b/libavfilter/vf_scale_qsv.c @@ -274,7 +274,7 @@ static const mfxHandleType handle_types[] = { MFX_HANDLE_D3D11_DEVICE, }; -static int init_out_session(AVFilterContext *ctx) +static int init_out_session(AVFilterContext *ctx, int in_width, int in_height) { QSVScaleContext *s = ctx->priv; @@ -385,8 +385,11 @@ static int init_out_session(AVFilterContext *ctx) sizeof(*s->mem_ids_in)); if (!s->mem_ids_in) return AVERROR(ENOMEM); - for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) + for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) { s->mem_ids_in[i] = in_frames_hwctx->surfaces[i].Data.MemId; + in_frames_hwctx->surfaces[i].Info.CropW = in_width; + in_frames_hwctx->surfaces[i].Info.CropH = in_height; + } s->nb_mem_ids_in = in_frames_hwctx->nb_surfaces; s->mem_ids_out = av_mallocz_array(out_frames_hwctx->nb_surfaces, @@ -450,7 +453,7 @@ static int init_scale_session(AVFilterContext *ctx, int in_width, int in_height, if (ret < 0) return ret; - ret = init_out_session(ctx); + ret = init_out_session(ctx, in_width, in_height); if (ret < 0) return ret;